rem
stringlengths
0
126k
add
stringlengths
0
441k
context
stringlengths
15
136k
value = value.replace(/\xA0/g, ' ');
function string(value) { if (value != null) { value = value.replace(/^\s+/, ''); value = value.replace(/\s+$/, ''); value = value.replace(/\\/g, '\\\\'); value = value.replace(/\"/g, '\\"'); value = value.replace(/\r/g, '\\r'); value = value.replace(/\n/g, '\\n'); return '"' + value + '"'; } else { return '""'; }}
value = value.replace(/^\s+/, ''); value = value.replace(/\s+$/, '');
function string(value) { if (value != null) { value = value.replace(/^\s+/, ''); value = value.replace(/\s+$/, ''); value = value.replace(/\\/g, '\\\\'); value = value.replace(/\"/g, '\\"'); value = value.replace(/\r/g, '\\r'); value = value.replace(/\n/g, '\\n'); value = value.replace(/\xA0/g, ' '); return '"' + value + '"'; } else { return '""'; }}
value = value.replace(/\xA0/g, ' ');
function string(value) { if (value != null) { value = value.replace(/^\s+/, ''); value = value.replace(/\s+$/, ''); value = value.replace(/\\/g, '\\\\'); value = value.replace(/\"/g, '\\"'); value = value.replace(/\r/g, '\\r'); value = value.replace(/\n/g, '\\n'); value = value.replace(/\xA0/g, ' '); return '"' + value + '"'; } else { return '""'; }}
value = value.replace(/\r/g, '\\r');
string = function(value) { value = value.replace(/\"/g, '\\"'); value = value.replace(/\n/g, '\\n'); var unicode = false; for (var i = 0; i < value.length; i++) { if (value.charCodeAt(i) >= 128) { unicode = true; } } return (unicode ? 'u' : '') + '"' + value + '"';}
String_prototype_doDisplay_immutable = function(p) {
var String_prototype_doDisplay_immutable = function(p) {
String_prototype_doDisplay_immutable = function(p) { if (this.charAt(0) !== sc_SYMBOL_PREFIX) p.appendJSString(this); else p.appendJSString(this.slice(1));}
String_prototype_doWrite_immutable = function(p) {
var String_prototype_doWrite_immutable = function(p) {
String_prototype_doWrite_immutable = function(p) { // TODO: handle escape-chars symbols if (this.charAt(0) !== sc_SYMBOL_PREFIX) p.appendJSString('"' + sc_escapeWriteString(this) + '"'); else p.appendJSString(this.slice(1));}
String_prototype_doWrite_mutable = function(p) {
var String_prototype_doWrite_mutable = function(p) {
String_prototype_doWrite_mutable = function(p) { p.appendJSString(this);}
if (! theForm)
if (! theForm) { alert("null form in submitForm!");
function submitForm(theForm, theInput, theMimeType) { if (! theForm) return; refreshBufferList(g_cq_buffer_current); // copy the selected database to the session cookie var currDatabase = document.getElementById(g_cq_database_list_id).value; debug("submitForm: currDatabase = " + currDatabase); setCookie(g_cq_database_list_id, currDatabase, 30); // copy current buffer to hidden element document.getElementById(g_cq_query_input).value = theInput; debug("submitForm: "+document.getElementById(g_cq_query_input).value); // set the mime type if (theMimeType != null) { debug("submitForm: mimeType = " + theMimeType); document.getElementById(g_cq_query_mime_type).value = theMimeType; } // post the form theForm.submit(); return;}
refreshBufferList(g_cq_buffer_current);
refreshBufferList(g_cq_buffer_current, "submitForm");
function submitForm(theForm, theInput, theMimeType) { if (! theForm) return; refreshBufferList(g_cq_buffer_current); // copy the selected database to the session cookie var currDatabase = document.getElementById(g_cq_database_list_id).value; debug("submitForm: currDatabase = " + currDatabase); setCookie(g_cq_database_list_id, currDatabase, 30); // copy current buffer to hidden element document.getElementById(g_cq_query_input).value = theInput; debug("submitForm: "+document.getElementById(g_cq_query_input).value); // set the mime type if (theMimeType != null) { debug("submitForm: mimeType = " + theMimeType); document.getElementById(g_cq_query_mime_type).value = theMimeType; } // post the form theForm.submit(); return;}
var currDatabase = document.getElementById(g_cq_database_list_id).value;
var currDatabase = document.getElementById(g_cq_eval_list_id).value;
function submitForm(theForm, theInput, theMimeType) { if (! theForm) return; refreshBufferList(g_cq_buffer_current); // copy the selected database to the session cookie var currDatabase = document.getElementById(g_cq_database_list_id).value; debug("submitForm: currDatabase = " + currDatabase); setCookie(g_cq_database_list_id, currDatabase, 30); // copy current buffer to hidden element document.getElementById(g_cq_query_input).value = theInput; debug("submitForm: "+document.getElementById(g_cq_query_input).value); // set the mime type if (theMimeType != null) { debug("submitForm: mimeType = " + theMimeType); document.getElementById(g_cq_query_mime_type).value = theMimeType; } // post the form theForm.submit(); return;}
setCookie(g_cq_database_list_id, currDatabase, 30);
setCookie(g_cq_eval_list_id, currDatabase, 30);
function submitForm(theForm, theInput, theMimeType) { if (! theForm) return; refreshBufferList(g_cq_buffer_current); // copy the selected database to the session cookie var currDatabase = document.getElementById(g_cq_database_list_id).value; debug("submitForm: currDatabase = " + currDatabase); setCookie(g_cq_database_list_id, currDatabase, 30); // copy current buffer to hidden element document.getElementById(g_cq_query_input).value = theInput; debug("submitForm: "+document.getElementById(g_cq_query_input).value); // set the mime type if (theMimeType != null) { debug("submitForm: mimeType = " + theMimeType); document.getElementById(g_cq_query_mime_type).value = theMimeType; } // post the form theForm.submit(); return;}
var currDatabase = document.getElementById(g_cq_eval_list_id).value; debug("submitForm: currDatabase = " + currDatabase); setCookie(g_cq_eval_list_id, currDatabase, 30);
if (false) { disableButtons(true); var fSet = getFrameset(); var qFrame = getQueryFrame(); var rFrame = getResultFrame(); if (!(rFrame && qFrame)) { debug("null queryFrame or resultFrame!"); } else { var f = function () { disableButtons(false) }; rFrame.onload = f; rFrame.onunload = f; rFrame.onabort = f; qFrame.onabort = f; fSet.onabort = f; debug("resultFrame.onload = " + rFrame.onload); } } var currEval = document.getElementById(g_cq_eval_list_id).value; debug("submitForm: currEval = " + currEval); setCookie(g_cq_eval_list_id, currEval, 30);
function submitForm(theForm, theInput, theMimeType) { if (! theForm) { alert("null form in submitForm!"); return; } refreshBufferList(g_cq_buffer_current, "submitForm"); // copy the selected database to the session cookie var currDatabase = document.getElementById(g_cq_eval_list_id).value; debug("submitForm: currDatabase = " + currDatabase); setCookie(g_cq_eval_list_id, currDatabase, 30); // copy current buffer to hidden element document.getElementById(g_cq_query_input).value = theInput; debug("submitForm: "+document.getElementById(g_cq_query_input).value); // set the mime type if (theMimeType != null) { debug("submitForm: mimeType = " + theMimeType); document.getElementById(g_cq_query_mime_type).value = theMimeType; } // post the form theForm.submit(); return;}
return;
function submitForm(theForm, theInput, theMimeType) { if (! theForm) { alert("null form in submitForm!"); return; } refreshBufferList(g_cq_buffer_current, "submitForm"); // copy the selected database to the session cookie var currDatabase = document.getElementById(g_cq_eval_list_id).value; debug("submitForm: currDatabase = " + currDatabase); setCookie(g_cq_eval_list_id, currDatabase, 30); // copy current buffer to hidden element document.getElementById(g_cq_query_input).value = theInput; debug("submitForm: "+document.getElementById(g_cq_query_input).value); // set the mime type if (theMimeType != null) { debug("submitForm: mimeType = " + theMimeType); document.getElementById(g_cq_query_mime_type).value = theMimeType; } // post the form theForm.submit(); return;}
$(gQueryInput).value = query;
$(kQueryInput).value = query;
function submitForm(theForm, query, theMimeType, saveHistory) { debug.print("submitForm: " + query); if (! theForm) { alert("null form in submitForm!"); return; } if (saveHistory) { gHistory.add(query); } // sync the session, if it has changed gSession.sync(); // copy query to the hidden element $(gQueryInput).value = query; //debug.print("submitForm: " + $F(gQueryInput)); // set the mime type if (null != theMimeType) { debug.print("submitForm: mimeType = " + theMimeType); $(gQueryMimeType).value = theMimeType; } // TODO it would be nice to grey out the target frame, if possible // post the form theForm.submit(); // would like to disable buttons during post // TODO what if the user hits the stop button? // IE6 supports onstop, gecko does not // onabort is not useful for this. //gBufferTabs.disableButtons(); //Event.observe(parent.frames[1].window, "unload", //function(e) { this.enableButtons(); } //.bindAsEventListener(gBufferTabs));}
$(gQueryMimeType).value = theMimeType;
$(kQueryMimeType).value = theMimeType;
function submitForm(theForm, query, theMimeType, saveHistory) { debug.print("submitForm: " + query); if (! theForm) { alert("null form in submitForm!"); return; } if (saveHistory) { gHistory.add(query); } // sync the session, if it has changed gSession.sync(); // copy query to the hidden element $(gQueryInput).value = query; //debug.print("submitForm: " + $F(gQueryInput)); // set the mime type if (null != theMimeType) { debug.print("submitForm: mimeType = " + theMimeType); $(gQueryMimeType).value = theMimeType; } // TODO it would be nice to grey out the target frame, if possible // post the form theForm.submit(); // would like to disable buttons during post // TODO what if the user hits the stop button? // IE6 supports onstop, gecko does not // onabort is not useful for this. //gBufferTabs.disableButtons(); //Event.observe(parent.frames[1].window, "unload", //function(e) { this.enableButtons(); } //.bindAsEventListener(gBufferTabs));}
gBuffers.activate();
function submitForm(theForm, query, theMimeType, saveHistory) { if (! theForm) { alert("null form in submitForm!"); return; } gBuffers.activate(); if (saveHistory) { gHistory.add(query); } // sync the session, if it has changed gSession.sync(gHistory.lastModified); // TODO would like to disable buttons during post // TODO it would be nice to grey out the target frame, if possible // copy query to the hidden element $(gQueryInput).value = query; debug.print("submitForm: " + $F(gQueryInput)); // set the mime type if (theMimeType != null) { debug.print("submitForm: mimeType = " + theMimeType); $(gQueryMimeType).value = theMimeType; } // post the form theForm.submit();}
debug("null queryFrame or resultFrame!");
debug.print("null queryFrame or resultFrame!");
function submitForm(theForm, theInput, theMimeType) { if (! theForm) { alert("null form in submitForm!"); return; } refreshBufferList(g_cq_buffer_current, "submitForm"); // TODO would like to disable buttons during post // but it's too problematic for now if (false) { disableButtons(true); // set onload behavior to re-enable the buttons // TODO this works in gecko, but not IE6 - use onreadystatechange? // TODO how do we re-enable the buttons if the query is cancelled? // seems like onabort should work, but it doesn't // IE6 has onstop handler, but gecko doesn't var fSet = getFrameset(); var qFrame = getQueryFrame(); var rFrame = getResultFrame(); if (!(rFrame && qFrame)) { debug("null queryFrame or resultFrame!"); } else { var f = function () { disableButtons(false) }; rFrame.onload = f; rFrame.onunload = f; rFrame.onabort = f; qFrame.onabort = f; fSet.onabort = f; debug("resultFrame.onload = " + rFrame.onload); } } // copy the selected eval-in args to the session cookie var currEval = document.getElementById(g_cq_eval_list_id).value; debug("submitForm: currEval = " + currEval); setCookie(g_cq_eval_list_id, currEval, 30); // copy current buffer to hidden element document.getElementById(g_cq_query_input).value = theInput; debug("submitForm: "+document.getElementById(g_cq_query_input).value); // set the mime type if (theMimeType != null) { debug("submitForm: mimeType = " + theMimeType); document.getElementById(g_cq_query_mime_type).value = theMimeType; } // post the form theForm.submit();}
debug("resultFrame.onload = " + rFrame.onload);
debug.print("resultFrame.onload = " + rFrame.onload);
function submitForm(theForm, theInput, theMimeType) { if (! theForm) { alert("null form in submitForm!"); return; } refreshBufferList(g_cq_buffer_current, "submitForm"); // TODO would like to disable buttons during post // but it's too problematic for now if (false) { disableButtons(true); // set onload behavior to re-enable the buttons // TODO this works in gecko, but not IE6 - use onreadystatechange? // TODO how do we re-enable the buttons if the query is cancelled? // seems like onabort should work, but it doesn't // IE6 has onstop handler, but gecko doesn't var fSet = getFrameset(); var qFrame = getQueryFrame(); var rFrame = getResultFrame(); if (!(rFrame && qFrame)) { debug("null queryFrame or resultFrame!"); } else { var f = function () { disableButtons(false) }; rFrame.onload = f; rFrame.onunload = f; rFrame.onabort = f; qFrame.onabort = f; fSet.onabort = f; debug("resultFrame.onload = " + rFrame.onload); } } // copy the selected eval-in args to the session cookie var currEval = document.getElementById(g_cq_eval_list_id).value; debug("submitForm: currEval = " + currEval); setCookie(g_cq_eval_list_id, currEval, 30); // copy current buffer to hidden element document.getElementById(g_cq_query_input).value = theInput; debug("submitForm: "+document.getElementById(g_cq_query_input).value); // set the mime type if (theMimeType != null) { debug("submitForm: mimeType = " + theMimeType); document.getElementById(g_cq_query_mime_type).value = theMimeType; } // post the form theForm.submit();}
debug("submitForm: currEval = " + currEval);
debug.print("submitForm: currEval = " + currEval);
function submitForm(theForm, theInput, theMimeType) { if (! theForm) { alert("null form in submitForm!"); return; } refreshBufferList(g_cq_buffer_current, "submitForm"); // TODO would like to disable buttons during post // but it's too problematic for now if (false) { disableButtons(true); // set onload behavior to re-enable the buttons // TODO this works in gecko, but not IE6 - use onreadystatechange? // TODO how do we re-enable the buttons if the query is cancelled? // seems like onabort should work, but it doesn't // IE6 has onstop handler, but gecko doesn't var fSet = getFrameset(); var qFrame = getQueryFrame(); var rFrame = getResultFrame(); if (!(rFrame && qFrame)) { debug("null queryFrame or resultFrame!"); } else { var f = function () { disableButtons(false) }; rFrame.onload = f; rFrame.onunload = f; rFrame.onabort = f; qFrame.onabort = f; fSet.onabort = f; debug("resultFrame.onload = " + rFrame.onload); } } // copy the selected eval-in args to the session cookie var currEval = document.getElementById(g_cq_eval_list_id).value; debug("submitForm: currEval = " + currEval); setCookie(g_cq_eval_list_id, currEval, 30); // copy current buffer to hidden element document.getElementById(g_cq_query_input).value = theInput; debug("submitForm: "+document.getElementById(g_cq_query_input).value); // set the mime type if (theMimeType != null) { debug("submitForm: mimeType = " + theMimeType); document.getElementById(g_cq_query_mime_type).value = theMimeType; } // post the form theForm.submit();}
debug("submitForm: "+document.getElementById(g_cq_query_input).value);
debug.print("submitForm: "+document.getElementById(g_cq_query_input).value);
function submitForm(theForm, theInput, theMimeType) { if (! theForm) { alert("null form in submitForm!"); return; } refreshBufferList(g_cq_buffer_current, "submitForm"); // TODO would like to disable buttons during post // but it's too problematic for now if (false) { disableButtons(true); // set onload behavior to re-enable the buttons // TODO this works in gecko, but not IE6 - use onreadystatechange? // TODO how do we re-enable the buttons if the query is cancelled? // seems like onabort should work, but it doesn't // IE6 has onstop handler, but gecko doesn't var fSet = getFrameset(); var qFrame = getQueryFrame(); var rFrame = getResultFrame(); if (!(rFrame && qFrame)) { debug("null queryFrame or resultFrame!"); } else { var f = function () { disableButtons(false) }; rFrame.onload = f; rFrame.onunload = f; rFrame.onabort = f; qFrame.onabort = f; fSet.onabort = f; debug("resultFrame.onload = " + rFrame.onload); } } // copy the selected eval-in args to the session cookie var currEval = document.getElementById(g_cq_eval_list_id).value; debug("submitForm: currEval = " + currEval); setCookie(g_cq_eval_list_id, currEval, 30); // copy current buffer to hidden element document.getElementById(g_cq_query_input).value = theInput; debug("submitForm: "+document.getElementById(g_cq_query_input).value); // set the mime type if (theMimeType != null) { debug("submitForm: mimeType = " + theMimeType); document.getElementById(g_cq_query_mime_type).value = theMimeType; } // post the form theForm.submit();}
debug("submitForm: mimeType = " + theMimeType);
debug.print("submitForm: mimeType = " + theMimeType);
function submitForm(theForm, theInput, theMimeType) { if (! theForm) { alert("null form in submitForm!"); return; } refreshBufferList(g_cq_buffer_current, "submitForm"); // TODO would like to disable buttons during post // but it's too problematic for now if (false) { disableButtons(true); // set onload behavior to re-enable the buttons // TODO this works in gecko, but not IE6 - use onreadystatechange? // TODO how do we re-enable the buttons if the query is cancelled? // seems like onabort should work, but it doesn't // IE6 has onstop handler, but gecko doesn't var fSet = getFrameset(); var qFrame = getQueryFrame(); var rFrame = getResultFrame(); if (!(rFrame && qFrame)) { debug("null queryFrame or resultFrame!"); } else { var f = function () { disableButtons(false) }; rFrame.onload = f; rFrame.onunload = f; rFrame.onabort = f; qFrame.onabort = f; fSet.onabort = f; debug("resultFrame.onload = " + rFrame.onload); } } // copy the selected eval-in args to the session cookie var currEval = document.getElementById(g_cq_eval_list_id).value; debug("submitForm: currEval = " + currEval); setCookie(g_cq_eval_list_id, currEval, 30); // copy current buffer to hidden element document.getElementById(g_cq_query_input).value = theInput; debug("submitForm: "+document.getElementById(g_cq_query_input).value); // set the mime type if (theMimeType != null) { debug("submitForm: mimeType = " + theMimeType); document.getElementById(g_cq_query_mime_type).value = theMimeType; } // post the form theForm.submit();}
var currDatabase = document.getElementById(g_cq_database_list).value; setCookie(g_cq_database_list, currDatabase, 30);
var currDatabase = document.getElementById(g_cq_database_list_id).value; debug("submitForm: currDatabase = " + currDatabase); setCookie(g_cq_database_list_id, currDatabase, 30);
function submitForm(theForm, theInput, theMimeType) { if (! theForm) return; refreshBufferList(g_cq_buffer_current); // copy the selected database to the session cookie var currDatabase = document.getElementById(g_cq_database_list).value; //alert("submitForm: currDatabase = " + currDatabase); setCookie(g_cq_database_list, currDatabase, 30); // copy current buffer to hidden element document.getElementById(g_cq_query_input).value = theInput; //alert("submitForm: "+document.getElementById(g_cq_query_input).value); // set the mime type if (theMimeType != null) { //alert("submitForm: mimeType = " + theMimeType); document.getElementById(g_cq_query_mime_type).value = theMimeType; } // post the form theForm.submit(); return;}
debug("submitForm: "+document.getElementById(g_cq_query_input).value);
function submitForm(theForm, theInput, theMimeType) { if (! theForm) return; refreshBufferList(g_cq_buffer_current); // copy the selected database to the session cookie var currDatabase = document.getElementById(g_cq_database_list).value; //alert("submitForm: currDatabase = " + currDatabase); setCookie(g_cq_database_list, currDatabase, 30); // copy current buffer to hidden element document.getElementById(g_cq_query_input).value = theInput; //alert("submitForm: "+document.getElementById(g_cq_query_input).value); // set the mime type if (theMimeType != null) { //alert("submitForm: mimeType = " + theMimeType); document.getElementById(g_cq_query_mime_type).value = theMimeType; } // post the form theForm.submit(); return;}
debug("submitForm: mimeType = " + theMimeType);
function submitForm(theForm, theInput, theMimeType) { if (! theForm) return; refreshBufferList(g_cq_buffer_current); // copy the selected database to the session cookie var currDatabase = document.getElementById(g_cq_database_list).value; //alert("submitForm: currDatabase = " + currDatabase); setCookie(g_cq_database_list, currDatabase, 30); // copy current buffer to hidden element document.getElementById(g_cq_query_input).value = theInput; //alert("submitForm: "+document.getElementById(g_cq_query_input).value); // set the mime type if (theMimeType != null) { //alert("submitForm: mimeType = " + theMimeType); document.getElementById(g_cq_query_mime_type).value = theMimeType; } // post the form theForm.submit(); return;}
gBuffers.activate();
function submitForm(theForm, query, theMimeType, saveHistory) { debug.print("submitForm: " + query); if (! theForm) { alert("null form in submitForm!"); return; } // this causes the label to update gBuffers.activate(); if (saveHistory) { gHistory.add(query); } // sync the session, if it has changed gSession.sync(); // TODO would like to disable buttons during post // TODO it would be nice to grey out the target frame, if possible // copy query to the hidden element $(gQueryInput).value = query; debug.print("submitForm: " + $F(gQueryInput)); // set the mime type if (theMimeType != null) { debug.print("submitForm: mimeType = " + theMimeType); $(gQueryMimeType).value = theMimeType; } // post the form theForm.submit();}
debug.print("submitForm: " + $F(gQueryInput));
function submitForm(theForm, query, theMimeType, saveHistory) { debug.print("submitForm: " + query); if (! theForm) { alert("null form in submitForm!"); return; } // this causes the label to update gBuffers.activate(); if (saveHistory) { gHistory.add(query); } // sync the session, if it has changed gSession.sync(); // TODO would like to disable buttons during post // TODO it would be nice to grey out the target frame, if possible // copy query to the hidden element $(gQueryInput).value = query; debug.print("submitForm: " + $F(gQueryInput)); // set the mime type if (theMimeType != null) { debug.print("submitForm: mimeType = " + theMimeType); $(gQueryMimeType).value = theMimeType; } // post the form theForm.submit();}
if (theMimeType != null) {
if (null != theMimeType) {
function submitForm(theForm, query, theMimeType, saveHistory) { debug.print("submitForm: " + query); if (! theForm) { alert("null form in submitForm!"); return; } // this causes the label to update gBuffers.activate(); if (saveHistory) { gHistory.add(query); } // sync the session, if it has changed gSession.sync(); // TODO would like to disable buttons during post // TODO it would be nice to grey out the target frame, if possible // copy query to the hidden element $(gQueryInput).value = query; debug.print("submitForm: " + $F(gQueryInput)); // set the mime type if (theMimeType != null) { debug.print("submitForm: mimeType = " + theMimeType); $(gQueryMimeType).value = theMimeType; } // post the form theForm.submit();}
debug("submitFormWrapper: " + theForm + " as " + mimeType);
debug.print("submitFormWrapper: " + theForm + " as " + mimeType);
function submitFormWrapper(theForm, mimeType) { debug("submitFormWrapper: " + theForm + " as " + mimeType); if (!theForm) return; var query = getBuffer().value; saveQueryHistory(query); // this approach won't work: cookie get too big //saveBuffersRecoveryPoint(); submitForm(theForm, query, mimeType);}
if (!theForm)
if (!theForm) {
function submitFormWrapper(theForm, mimeType) { debug.print("submitFormWrapper: " + theForm + " as " + mimeType); if (!theForm) return; var query = getBuffer().value; saveQueryHistory(query); // this approach won't work: cookie get too big //saveBuffersRecoveryPoint(); submitForm(theForm, query, mimeType);}
}
function submitFormWrapper(theForm, mimeType) { debug.print("submitFormWrapper: " + theForm + " as " + mimeType); if (!theForm) return; var query = getBuffer().value; saveQueryHistory(query); // this approach won't work: cookie get too big //saveBuffersRecoveryPoint(); submitForm(theForm, query, mimeType);}
debug("submitHTML");
function submitHTML(theForm) { //alert("submitHTML"); if (theForm) { //cqAutoSave(); submitForm(theForm, getBuffer().value, "text/html"); //resizeResultFrame(); }} // submitHTML
tinyMCE.removeTinyMCEFormElements(this);
submitPatch : function() { tinyMCE.removeTinyMCEFormElements(this); tinyMCE.triggerSave(); this.mceOldSubmit(); tinyMCE.isNotDirty = true; },
tinyMCE.isNotDirty = true;
submitPatch : function() { tinyMCE.removeTinyMCEFormElements(this); tinyMCE.triggerSave(); this.mceOldSubmit(); tinyMCE.isNotDirty = true; },
debug("submitText");
function submitText(theForm) { //alert("submitText"); if (theForm) { //cqAutoSave(); submitForm(theForm, getBuffer().value, "text/plain"); //resizeResultFrame(); }} // submitText
debug("submitXML");
function submitXML(theForm) { //alert("submitXML"); if (theForm) { //cqAutoSave(); submitForm(theForm, getBuffer().value, "text/xml"); //resizeResultFrame(); }} // submitXML
return log(address + " already subscribed"); user_list.push({ name: sender_name, address: address });
return log(address + " is already subscribed"); var now=time(); user_list.push({ name: sender_name ,address: address ,created: system.timestr(now) ,last_activity: system.timestr(now) ,last_activity_time: format("%08lxh",now) });
function subscription_control(cmd, list, address){ if(!address) address=sender_address; log(LOG_INFO,format("%s Subscription control command (%s) from %s" ,list.name,cmd,address)); /* Get subscriber list */ var user_fname = list.msgbase_file + user_list_ext; var user_file = new File(user_fname); if(!user_file.open("r+")) return log(LOG_ERR,format("%s !ERROR %d opening file: %s" ,list.name, user_file.error, user_fname)); user_list = user_file.iniGetAllObjects(); switch(cmd.toLowerCase()) { case "unsubscribe": if(remove_user(user_list, address)) { write_user_list(user_list, user_file); return log(LOG_INFO,address + " unsubscribed successfully"); } return("!subscriber not found: " + address); case "subscribe": if(find_user(user_list, address)!=-1) return log(address + " already subscribed"); user_list.push({ name: sender_name, address: address }); write_user_list(user_list, user_file); return log(address + " subscription successful"); }}
var np = ((notepad instanceof HTMLElement) || (notepad instanceof Object && notepad.propertyIsEnumerable( "innerHTML" )))
var np = hop_isHTMLElement( notepad )
var success = function( http ) { if( http.responseText != null ) { var found = 0; var np = ((notepad instanceof HTMLElement) || (notepad instanceof Object && notepad.propertyIsEnumerable( "innerHTML" ))) ? notepad : document.getElementById( notepad ); var ta = ((tab instanceof HTMLElement) || (tab instanceof Object && tab.propertyIsEnumerable( "innerHTML" ))) ? tab : document.getElementById( tab ); var i; for( i = 0; i < np.childNodes.length; i++ ) { var c = np.childNodes[ i ]; if( c.className == "hop-notepad-tabs" ) { for( j = 0; j < c.childNodes.length; j++ ) { var c2 = c.childNodes[ j ]; if( c2 == ta ) { c2.className = "hop-nptab-active"; found = j; } else { c2.className = "hop-nptab-inactive"; } } } if( c.className == "hop-notepad-body" ) { hop_replace_inner( c )( http ); } } } }
var ta = ((tab instanceof HTMLElement) || (tab instanceof Object && tab.propertyIsEnumerable( "innerHTML" )))
var ta = hop_isHTMLElement( tab )
var success = function( http ) { if( http.responseText != null ) { var found = 0; var np = ((notepad instanceof HTMLElement) || (notepad instanceof Object && notepad.propertyIsEnumerable( "innerHTML" ))) ? notepad : document.getElementById( notepad ); var ta = ((tab instanceof HTMLElement) || (tab instanceof Object && tab.propertyIsEnumerable( "innerHTML" ))) ? tab : document.getElementById( tab ); var i; for( i = 0; i < np.childNodes.length; i++ ) { var c = np.childNodes[ i ]; if( c.className == "hop-notepad-tabs" ) { for( j = 0; j < c.childNodes.length; j++ ) { var c2 = c.childNodes[ j ]; if( c2 == ta ) { c2.className = "hop-nptab-active"; found = j; } else { c2.className = "hop-nptab-inactive"; } } } if( c.className == "hop-notepad-body" ) { hop_replace_inner( c )( http ); } } } }
var np = (notepad instanceof HTMLElement) ? notepad : document.getElementById( notepad ); var ta = (tab instanceof HTMLElement) ? tab : document.getElementById( tab );
var np = ((notepad instanceof HTMLElement) || (notepad instanceof Object && notepad.propertyIsEnumerable( "innerHTML" ))) ? notepad : document.getElementById( notepad ); var ta = ((tab instanceof HTMLElement) || (tab instanceof Object && tab.propertyIsEnumerable( "innerHTML" ))) ? tab : document.getElementById( tab );
var success = function( http ) { if( http.responseText != null ) { var found = 0; var np = (notepad instanceof HTMLElement) ? notepad : document.getElementById( notepad ); var ta = (tab instanceof HTMLElement) ? tab : document.getElementById( tab ); var i; for( i = 0; i < np.childNodes.length; i++ ) { var c = np.childNodes[ i ]; if( c.className == "hop-notepad-tabs" ) { for( j = 0; j < c.childNodes.length; j++ ) { var c2 = c.childNodes[ j ]; if( c2 == ta ) { c2.className = "hop-nptab-active"; found = j; } else { c2.className = "hop-nptab-inactive"; } } } if( c.className == "hop-notepad-body" ) { hop_replace_inner( c )( http ); } } } }
var np = document.getElementById( notepad );
var found = 0; var np = (notepad instanceof HTMLElement) ? notepad : document.getElementById( notepad ); var ta = (tab instanceof HTMLElement) ? tab : document.getElementById( tab ); var i;
var success = function( http ) { if( http.responseText != null ) { var np = document.getElementById( notepad ); for( i = 0; i < np.childNodes.length; i++ ) { var c = np.childNodes[ i ]; if( c.className == "hop-notepad-tabs" ) { for( j = 0; j < c.childNodes.length; j++ ) { var c2 = c.childNodes[ j ]; if( c2.id == tab ) { c2.className = "hop-nptab-active"; } else { c2.className = "hop-nptab-inactive"; } } } if( c.className == "hop-notepad-body" ) { hop_replace_inner( c )( http ); } } } }
if( c2.id == tab ) {
if( c2 = ta ) {
var success = function( http ) { if( http.responseText != null ) { var np = document.getElementById( notepad ); for( i = 0; i < np.childNodes.length; i++ ) { var c = np.childNodes[ i ]; if( c.className == "hop-notepad-tabs" ) { for( j = 0; j < c.childNodes.length; j++ ) { var c2 = c.childNodes[ j ]; if( c2.id == tab ) { c2.className = "hop-nptab-active"; } else { c2.className = "hop-nptab-inactive"; } } } if( c.className == "hop-notepad-body" ) { hop_replace_inner( c )( http ); } } } }
found = j;
var success = function( http ) { if( http.responseText != null ) { var np = document.getElementById( notepad ); for( i = 0; i < np.childNodes.length; i++ ) { var c = np.childNodes[ i ]; if( c.className == "hop-notepad-tabs" ) { for( j = 0; j < c.childNodes.length; j++ ) { var c2 = c.childNodes[ j ]; if( c2.id == tab ) { c2.className = "hop-nptab-active"; } else { c2.className = "hop-nptab-inactive"; } } } if( c.className == "hop-notepad-body" ) { hop_replace_inner( c )( http ); } } } }
Editor.log.debug("supportsCommand");
supportsCommand : function(cmd) { Editor.log.debug("supportsCommand"); switch (cmd) { case "cmd_close": case "cmd_open": case "cmd_save": case "cmd_selenium_play": case "cmd_selenium_pause": case "cmd_selenium_step": return true; default: return false; } },
{
function switchChannel(xy, bouquet, channel){ if (window.screen.width < 800) { NewWindow('/cgi-bin/zapTo?path='+xy+'&curBouquet='+bouquet+'&curChannel='+channel, 'zap', '1', '1', 'no'); } else { if (zapMode < 4) { document.location = "/cgi-bin/zapTo?path="+xy+"&curBouquet="+bouquet+"&curChannel="+channel; setTimeout("zapHeaderReload()", 3000); } else { document.location = "/cgi-bin/zapTo?path="+xy; setTimeout("zapBodyReload()", 3000); } }}
setTimeout("zapHeaderReload()", 3000); }
function switchChannel(xy, bouquet, channel){ if (window.screen.width < 800) { NewWindow('/cgi-bin/zapTo?path='+xy+'&curBouquet='+bouquet+'&curChannel='+channel, 'zap', '1', '1', 'no'); } else { if (zapMode < 4) { document.location = "/cgi-bin/zapTo?path="+xy+"&curBouquet="+bouquet+"&curChannel="+channel; setTimeout("zapHeaderReload()", 3000); } else { document.location = "/cgi-bin/zapTo?path="+xy; setTimeout("zapBodyReload()", 3000); } }}
{ document.location = "/cgi-bin/zapTo?path="+xy; setTimeout("zapBodyReload()", 3000); }
document.location = "?path="+xy; setTimeout("zapHeaderReload()", 3000);
function switchChannel(xy, bouquet, channel){ if (window.screen.width < 800) { NewWindow('/cgi-bin/zapTo?path='+xy+'&curBouquet='+bouquet+'&curChannel='+channel, 'zap', '1', '1', 'no'); } else { if (zapMode < 4) { document.location = "/cgi-bin/zapTo?path="+xy+"&curBouquet="+bouquet+"&curChannel="+channel; setTimeout("zapHeaderReload()", 3000); } else { document.location = "/cgi-bin/zapTo?path="+xy; setTimeout("zapBodyReload()", 3000); } }}
document.location = "?path = "+xy;
document.location = "body?mode=zap&zapmode=4&zapsubmode=1&path="+xy;
function switchChannel(xy, bouquet, channel){ if (window.screen.width < 800) { NewWindow('cgi-bin/zapTo?path='+xy+'&curBouquet='+bouquet+'&curChannel='+channel, 'zap', '1', '1', 'no'); } else { if (zapMode < 4) document.location = "cgi-bin/zapTo?path="+xy+"&curBouquet="+bouquet+"&curChannel="+channel; else document.location = "?path = "+xy; setTimeout("parent.data.location.reload()", 2000); setTimeout("parent.channavi.location.reload()", 2000); }}
document.location = "?path="+xy;
document.location = "/cgi-bin/zapTo?path="+xy;
function switchChannel(xy, bouquet, channel){ if (window.screen.width < 800) { NewWindow('/cgi-bin/zapTo?path='+xy+'&curBouquet='+bouquet+'&curChannel='+channel, 'zap', '1', '1', 'no'); } else { if (zapMode < 4) { document.location = "/cgi-bin/zapTo?path="+xy+"&curBouquet="+bouquet+"&curChannel="+channel; setTimeout("zapHeaderReload()", 3000); } else { document.location = "?path="+xy; setTimeout("zapBodyReload()", 3000); } }}
setTimeout("parent.header.location.reload()", 2000);
if (screen.width < 800) setTimeout("reload()", 3000); else setTimeout("parent.header.location.reload()", 3000);
function switchChannel(xy, bouquet, channel){ document.location = "/cgi-bin/zapTo?path="+xy+"&curBouquet="+bouquet+"&curChannel="+channel; setTimeout("parent.header.location.reload()", 2000);}
fileClicked(filesSelect.options[filesSelect.selectedIndex].value, false);
function switchFile(){ var filesSelect = document.getElementById("files"); loadFile(filesSelect.options[filesSelect.selectedIndex].value, true);}
functionSelect.blur();
function switchFunction(index, shouldResetPopup){ if (shouldResetPopup === undefined) shouldResetPopup = false; var sourcesFrame = window.frames['sourcesFrame']; if (shouldResetPopup || index == 0) { document.getElementById("functionPopupButtonContent").innerHTML = '<span class="placeholder">&lt;No selected symbol&gt;</span>'; return; } var functionSelect = document.getElementById("functions"); var selectedFunction = functionSelect.childNodes[index]; var selection = sourcesFrame.getSelection(); var currentFunction = selectedFunction.value; var currentFunctionElement = sourcesFrame.document.getElementById(currentFunction); sourcesFrame.focus(); selection.setBaseAndExtent(currentFunctionElement, 0, currentFunctionElement, 1); sourcesFrame.location.hash = "#function-" + selectedFunction.value; document.getElementById("functionPopupButtonContent").innerText = selectedFunction.innerText;}
console.log('leave mode?'+mode+","+this.mode);
switchModeTo: function(mode) { console.log('leave mode?'+mode+","+this.mode); if (mode != this.mode) { this.mode = mode; this.buttons[mode].firstChild.src = this.buttons[mode].activeImgLocation; } else { this.leaveMode(); } },
switch (this.mode) { case "zoombox": this.map.div.style.cursor = "crosshair"; break; default: this.map.div.style.cursor = "default"; break; }
switchModeTo: function(mode) { if (mode != this.mode) { if (this.mode && this.buttons[this.mode]) { OpenLayers.Util.modifyAlphaImageDiv(this.buttons[this.mode], null, null, null, this.buttons[this.mode].imgLocation); } if (this.mode == "measure" && mode != "measure") { for(var i = 0; i < this.measureDivs.length; i++) { if (this.measureDivs[i]) { this.map.layerContainerDiv.removeChild(this.measureDivs[i]); } } this.measureDivs = []; this.measureStart = null; } this.mode = mode; if (this.buttons[mode]) { OpenLayers.Util.modifyAlphaImageDiv(this.buttons[mode], null, null, null, this.buttons[mode].activeImgLocation); } } },
effect.element.undoPositionend();
effect.element.undoPositioned();
Effect.SwitchOff = function(element) { element = $(element); var oldOpacity = element.getInlineOpacity(); return new Effect.Appear(element, { duration: 0.4, from: 0, transition: Effect.Transitions.flicker, afterFinishInternal: function(effect) { new Effect.Scale(effect.element, 1, { duration: 0.3, scaleFromCenter: true, scaleX: false, scaleContent: false, restoreAfterFinish: true, beforeSetup: function(effect) { effect.element.makePositioned(); effect.element.makeClipping(); }, afterFinishInternal: function(effect) { effect.element.hide(); effect.element.undoClipping(); effect.element.undoPositionend(); effect.element.setStyle({opacity: oldOpacity}); } }) } });}
return new Effect.Appear(element, {
return new Effect.Appear(element, $H({
Effect.SwitchOff = function(element) { element = $(element); var oldOpacity = element.getInlineOpacity(); return new Effect.Appear(element, { duration: 0.4, from: 0, transition: Effect.Transitions.flicker, afterFinishInternal: function(effect) { new Effect.Scale(effect.element, 1, { duration: 0.3, scaleFromCenter: true, scaleX: false, scaleContent: false, restoreAfterFinish: true, beforeSetup: function(effect) { effect.element.makePositioned(); effect.element.makeClipping(); }, afterFinishInternal: function(effect) { effect.element.hide(); effect.element.undoClipping(); effect.element.undoPositioned(); effect.element.setStyle({opacity: oldOpacity}); } }) } });}
});
}).merge(arguments[1] || {}));
Effect.SwitchOff = function(element) { element = $(element); var oldOpacity = element.getInlineOpacity(); return new Effect.Appear(element, { duration: 0.4, from: 0, transition: Effect.Transitions.flicker, afterFinishInternal: function(effect) { new Effect.Scale(effect.element, 1, { duration: 0.3, scaleFromCenter: true, scaleX: false, scaleContent: false, restoreAfterFinish: true, beforeSetup: function(effect) { effect.element.makePositioned(); effect.element.makeClipping(); }, afterFinishInternal: function(effect) { effect.element.hide(); effect.element.undoClipping(); effect.element.undoPositioned(); effect.element.setStyle({opacity: oldOpacity}); } }) } });}
new Effect.Appear(element, { duration: 0.4, transition: Effect.Transitions.flicker, afterFinish: function(effect) { effect.element.style.overflow = 'hidden'; new Effect.Scale(effect.element, 1, { duration: 0.3, scaleFromCenter: true, scaleX: false, scaleContent: false, afterUpdate: function(effect) { if(effect.element.style.position=="") effect.element.style.position = 'relative'; }, afterFinish: function(effect) { Element.hide(effect.element); } } ) } } );
element = $(element); var oldOpacity = Element.getInlineOpacity(element); return new Effect.Appear(element, { duration: 0.4, from: 0, transition: Effect.Transitions.flicker, afterFinishInternal: function(effect) { new Effect.Scale(effect.element, 1, { duration: 0.3, scaleFromCenter: true, scaleX: false, scaleContent: false, restoreAfterFinish: true, beforeSetup: function(effect) { Element.makePositioned(effect.element); Element.makeClipping(effect.element); }, afterFinishInternal: function(effect) { Element.hide(effect.element); Element.undoClipping(effect.element); Element.undoPositioned(effect.element); Element.setInlineOpacity(effect.element, oldOpacity); } }) } });
Effect.SwitchOff = function(element) { new Effect.Appear(element, { duration: 0.4, transition: Effect.Transitions.flicker, afterFinish: function(effect) { effect.element.style.overflow = 'hidden'; new Effect.Scale(effect.element, 1, { duration: 0.3, scaleFromCenter: true, scaleX: false, scaleContent: false, afterUpdate: function(effect) { if(effect.element.style.position=="") effect.element.style.position = 'relative'; }, afterFinish: function(effect) { Element.hide(effect.element); } } ) } } );}
return new Effect.Appear(element, $H({
return new Effect.Appear(element, Object.extend({
Effect.SwitchOff = function(element) { element = $(element); var oldOpacity = element.getInlineOpacity(); return new Effect.Appear(element, $H({ duration: 0.4, from: 0, transition: Effect.Transitions.flicker, afterFinishInternal: function(effect) { new Effect.Scale(effect.element, 1, { duration: 0.3, scaleFromCenter: true, scaleX: false, scaleContent: false, restoreAfterFinish: true, beforeSetup: function(effect) { effect.element.makePositioned(); effect.element.makeClipping(); }, afterFinishInternal: function(effect) { effect.element.hide(); effect.element.undoClipping(); effect.element.undoPositioned(); effect.element.setStyle({opacity: oldOpacity}); } }) } }).merge(arguments[1] || {}));}
}).merge(arguments[1] || {}));
}, arguments[1] || {}));
Effect.SwitchOff = function(element) { element = $(element); var oldOpacity = element.getInlineOpacity(); return new Effect.Appear(element, $H({ duration: 0.4, from: 0, transition: Effect.Transitions.flicker, afterFinishInternal: function(effect) { new Effect.Scale(effect.element, 1, { duration: 0.3, scaleFromCenter: true, scaleX: false, scaleContent: false, restoreAfterFinish: true, beforeSetup: function(effect) { effect.element.makePositioned(); effect.element.makeClipping(); }, afterFinishInternal: function(effect) { effect.element.hide(); effect.element.undoClipping(); effect.element.undoPositioned(); effect.element.setStyle({opacity: oldOpacity}); } }) } }).merge(arguments[1] || {}));}
paneElement.style.display = null;
paneElement.style.removeProperty("display");
function switchPane(pane){ currentPane = pane; for (var i = 0; i < tabNames.length; i++) { var paneElement = document.getElementById(tabNames[i] + "Pane"); var button = document.getElementById(tabNames[i] + "Button"); if (!button.originalClassName) button.originalClassName = button.className; if (pane == tabNames[i]) { if (!noSelection) paneElement.style.display = null; button.className = button.originalClassName + " selected"; } else { paneElement.style.display = "none"; button.className = button.originalClassName; } } if (noSelection) return; if (!paneUpdateState[pane]) { eval("update" + pane.charAt(0).toUpperCase() + pane.substr(1) + "Pane()"); paneUpdateState[pane] = true; } else { refreshScrollbars(); }}
debug.print("SessionClass.sync: disabled");
debug.print(label + "disabled");
this.sync = function() { if (this.syncDisabled) { debug.print("SessionClass.sync: disabled"); return false; } var lastModified = this.history.getLastModified(); debug.print("SessionClass.sync: " + lastModified + " ? " + this.lastSync); if (null != this.lastSync && lastModified < this.lastSync && (new Date() - this.lastSync) < (1000 * this.autosave.frequency)) { return; } var buffers = encodeURIComponent(this.buffers.toXml()); var history = encodeURIComponent(this.history.toXml()); var tabs = encodeURIComponent(this.tabs.toXml()); var params = ('BUFFERS=' + buffers + '&HISTORY=' + history + '&TABS=' + tabs); debug.print("SessionClass.sync: " + params); var req = new Ajax.Request(syncUrl, { method: 'post', parameters: params, onFailure: reportError } ); this.lastSync = new Date(); return true; }
debug.print("SessionClass.sync: " + lastModified + " ? " + this.lastSync);
debug.print(label + lastModified + " ? " + this.lastSync);
this.sync = function() { if (this.syncDisabled) { debug.print("SessionClass.sync: disabled"); return false; } var lastModified = this.history.getLastModified(); debug.print("SessionClass.sync: " + lastModified + " ? " + this.lastSync); if (null != this.lastSync && lastModified < this.lastSync && (new Date() - this.lastSync) < (1000 * this.autosave.frequency)) { return; } var buffers = encodeURIComponent(this.buffers.toXml()); var history = encodeURIComponent(this.history.toXml()); var tabs = encodeURIComponent(this.tabs.toXml()); var params = ('BUFFERS=' + buffers + '&HISTORY=' + history + '&TABS=' + tabs); debug.print("SessionClass.sync: " + params); var req = new Ajax.Request(syncUrl, { method: 'post', parameters: params, onFailure: reportError } ); this.lastSync = new Date(); return true; }
&& (new Date() - this.lastSync) < (1000 * this.autosave.frequency))
&& lastLineStatus < this.lastSync)
this.sync = function() { if (this.syncDisabled) { debug.print("SessionClass.sync: disabled"); return false; } var lastModified = this.history.getLastModified(); debug.print("SessionClass.sync: " + lastModified + " ? " + this.lastSync); if (null != this.lastSync && lastModified < this.lastSync && (new Date() - this.lastSync) < (1000 * this.autosave.frequency)) { return; } var buffers = encodeURIComponent(this.buffers.toXml()); var history = encodeURIComponent(this.history.toXml()); var tabs = encodeURIComponent(this.tabs.toXml()); var params = ('BUFFERS=' + buffers + '&HISTORY=' + history + '&TABS=' + tabs); debug.print("SessionClass.sync: " + params); var req = new Ajax.Request(syncUrl, { method: 'post', parameters: params, onFailure: reportError } ); this.lastSync = new Date(); return true; }
debug.print("SessionClass.sync: " + params);
this.sync = function() { if (this.syncDisabled) { debug.print("SessionClass.sync: disabled"); return false; } var lastModified = this.history.getLastModified(); debug.print("SessionClass.sync: " + lastModified + " ? " + this.lastSync); if (null != this.lastSync && lastModified < this.lastSync && (new Date() - this.lastSync) < (1000 * this.autosave.frequency)) { return; } var buffers = encodeURIComponent(this.buffers.toXml()); var history = encodeURIComponent(this.history.toXml()); var tabs = encodeURIComponent(this.tabs.toXml()); var params = ('BUFFERS=' + buffers + '&HISTORY=' + history + '&TABS=' + tabs); debug.print("SessionClass.sync: " + params); var req = new Ajax.Request(syncUrl, { method: 'post', parameters: params, onFailure: reportError } ); this.lastSync = new Date(); return true; }
result.value = element.innerHTML;
result.value = SeleniumIDE.getRecorderWindow().exactMatchPattern(element.innerHTML);
table: function(window, element) { var result = { name: "Table" }; if (element && element.tagName && 'td' == element.tagName.toLowerCase()) { var parentTable = null; var temp = element.parentNode; while (temp != null) { if (temp.tagName.toLowerCase() == 'table') { parentTable = temp; break; } temp = temp.parentNode; } if (parentTable == null) { result.disabled = true; result.target = "(Unavailable: Selection not a cell of a table)"; } else { //first try to locate table by id and then by name var tableName = parentTable.id; if (!tableName) { tableName = parentTable.name; } if (!tableName) { result.disabled = true; result.target = "(Unavailable: Table must have an id declared)"; } else { result.target = tableName + '.' + element.parentNode.rowIndex + '.' + element.cellIndex; result.value = element.innerHTML; } } } else { result.disabled = true; } return result; }
result.target = "(Unavailable: Table must have an id or name declared)";
result.target = "(Unavailable: Table must have an id declared)";
table: function(window, element) { var result = { name: "Table" }; if (element && element.tagName && 'td' == element.tagName.toLowerCase()) { var parentTable = null; var temp = element.parentNode; while (temp != null) { if (temp.tagName.toLowerCase() == 'table') { parentTable = temp; break; } temp = temp.parentNode; } if (parentTable == null) { result.disabled = true; result.target = "(Unavailable: Selection not a cell of a table)"; } else { //first try to locate table by id and then by name var tableName = parentTable.id; if (!tableName) { tableName = parentTable.name; } if (!tableName) { result.disabled = true; result.target = "(Unavailable: Table must have an id or name declared)"; } else { result.target = tableName + '.' + element.parentNode.rowIndex + '.' + element.cellIndex; result.value = element.innerHTML; } } } else { result.disabled = true; } return result; }
el.firstChild.data = newval;
el.innerHTML = newval;
Calendar.tableMouseOver = function (ev) { var cal = Calendar._C; if (!cal) { return; } var el = cal.activeDiv; var target = Calendar.getTargetElement(ev); if (target == el || target.parentNode == el) { Calendar.addClass(el, "hilite active"); Calendar.addClass(el.parentNode, "rowhilite"); } else { if (typeof el.navtype == "undefined" || (el.navtype != 50 && (el.navtype == 0 || Math.abs(el.navtype) > 2))) Calendar.removeClass(el, "active"); Calendar.removeClass(el, "hilite"); Calendar.removeClass(el.parentNode, "rowhilite"); } ev || (ev = window.event); if (el.navtype == 50 && target != el) { var pos = Calendar.getAbsolutePos(el); var w = el.offsetWidth; var x = ev.clientX; var dx; var decrease = true; if (x > pos.x + w) { dx = x - pos.x - w; decrease = false; } else dx = pos.x - x; if (dx < 0) dx = 0; var range = el._range; var current = el._current; var count = Math.floor(dx / 10) % range.length; for (var i = range.length; --i >= 0;) if (range[i] == current) break; while (count-- > 0) if (decrease) { if (--i < 0) i = range.length - 1; } else if ( ++i >= range.length ) i = 0; var newval = range[i]; el.firstChild.data = newval; cal.onUpdateTime(); } var mon = Calendar.findMonth(target); if (mon) { if (mon.month != cal.date.getMonth()) { if (cal.hilitedMonth) { Calendar.removeClass(cal.hilitedMonth, "hilite"); } Calendar.addClass(mon, "hilite"); cal.hilitedMonth = mon; } else if (cal.hilitedMonth) { Calendar.removeClass(cal.hilitedMonth, "hilite"); } } else { if (cal.hilitedMonth) { Calendar.removeClass(cal.hilitedMonth, "hilite"); } var year = Calendar.findYear(target); if (year) { if (year.year != cal.date.getFullYear()) { if (cal.hilitedYear) { Calendar.removeClass(cal.hilitedYear, "hilite"); } Calendar.addClass(year, "hilite"); cal.hilitedYear = year; } else if (cal.hilitedYear) { Calendar.removeClass(cal.hilitedYear, "hilite"); } } else if (cal.hilitedYear) { Calendar.removeClass(cal.hilitedYear, "hilite"); } } return Calendar.stopEvent(ev);};
if(typeof Builder == 'undefined') throw("Effect.tagifyText requires including script.aculo.us' builder.js library");
tagifyText: function(element) { var tagifyStyle = 'position:relative'; if(/MSIE/.test(navigator.userAgent)) tagifyStyle += ';zoom:1'; element = $(element); $A(element.childNodes).each( function(child) { if(child.nodeType==3) { child.nodeValue.toArray().each( function(character) { element.insertBefore( Builder.node('span',{style: tagifyStyle}, character == ' ' ? String.fromCharCode(160) : character), child); }); Element.remove(child); } }); },
$A(child.nodeValue).each( function(character) {
child.nodeValue.toArray().each( function(character) {
tagifyText: function(element) { var tagifyStyle = "position:relative"; if(/MSIE/.test(navigator.userAgent)) tagifyStyle += ";zoom:1"; element = $(element); $A(element.childNodes).each( function(child) { if(child.nodeType==3) { $A(child.nodeValue).each( function(character) { element.insertBefore( Builder.node('span',{style: tagifyStyle}, character == " " ? String.fromCharCode(160) : character), child); }); Element.remove(child); } }); },
if(/MSIE/.test(navigator.userAgent)) tagifyStyle += ';zoom:1';
if(/MSIE/.test(navigator.userAgent) && !window.opera) tagifyStyle += ';zoom:1';
tagifyText: function(element) { if(typeof Builder == 'undefined') throw("Effect.tagifyText requires including script.aculo.us' builder.js library"); var tagifyStyle = 'position:relative'; if(/MSIE/.test(navigator.userAgent)) tagifyStyle += ';zoom:1'; element = $(element); $A(element.childNodes).each( function(child) { if(child.nodeType==3) { child.nodeValue.toArray().each( function(character) { element.insertBefore( Builder.node('span',{style: tagifyStyle}, character == ' ' ? String.fromCharCode(160) : character), child); }); Element.remove(child); } }); },
function terminate_everything(terminate_reason) { log("Terminating: " + terminate_reason);
function terminate_everything(terminate_reason, error) { log(error ? LOG_ERR : LOG_NOTICE, "Terminating: " + terminate_reason);
function terminate_everything(terminate_reason) { log("Terminating: " + terminate_reason); for(thisClient in Local_Sockets_Map) { var Client = Local_Sockets_Map[thisClient]; Client.rawout("ERROR :" + terminate_reason); Client.socket.close(); } exit();}
exit();
exit(error);
function terminate_everything(terminate_reason) { log("Terminating: " + terminate_reason); for(thisClient in Local_Sockets_Map) { var Client = Local_Sockets_Map[thisClient]; Client.rawout("ERROR :" + terminate_reason); Client.socket.close(); } exit();}
if (Client.local)
if (Client && Client.local)
function terminate_everything(terminate_reason) { for(thisClient in Clients) { var Client = Clients[thisClient]; if (Client.local) Client.quit(terminate_reason,false) } exit();}
log("Terminating: " + terminate_reason);
function terminate_everything(terminate_reason) { for(thisClient in Clients) { var Client = Clients[thisClient]; if (Client && Client.local) Client.quit(terminate_reason,false) } exit();}
Client.quit(terminate_reason,false)
Client.quit(terminate_reason,true)
function terminate_everything(terminate_reason) { log("Terminating: " + terminate_reason); for(thisClient in Clients) { var Client = Clients[thisClient]; if (Client && Client.local) Client.quit(terminate_reason,false) } exit();}
client = Clients[thisClient];
var client = Clients[thisClient];
function terminate_everything(terminate_reason) { for(thisClient in Clients) { client = Clients[thisClient]; if (client.local) client.quit(terminate_reason,false) }}
var client = Clients[thisClient]; if (client.local) client.quit(terminate_reason,false)
var Client = Clients[thisClient]; if (Client.local) Client.quit(terminate_reason,false)
function terminate_everything(terminate_reason) { for(thisClient in Clients) { var client = Clients[thisClient]; if (client.local) client.quit(terminate_reason,false) }}
for (var i = 0; i < node.childNodes.length + 1; i++) { print("item " + i + ": " + node.childNodes.item(i));
var childNodes = node.childNodes; for (var i = 0; i < childNodes.length + 1; i++) { print("item " + i + ": " + childNodes.item(i));
function test(){ print("Node is " + Node); for (var p in Node) print(p + ": " + Node[p]); node = new Node(); print("node is " + node); for (var p in node) print(p + ": " + node[p]); child1 = new Node(); child2 = new Node(); child3 = new Node(); node.appendChild(child1); node.appendChild(child2); for (var i = 0; i < node.childNodes.length + 1; i++) { print("item " + i + ": " + node.childNodes.item(i)); } for (var i = 0; i < node.childNodes.length + 1; i++) { print(i + ": " + node.childNodes[i]); } node.removeChild(child1); node.replaceChild(child3, child2); for (var i = 0; i < node.childNodes.length + 1; i++) { print("item " + i + ": " + node.childNodes.item(i)); } for (var i = 0; i < node.childNodes.length + 1; i++) { print(i + ": " + node.childNodes[i]); } try { node.appendChild(null); } catch(e) { print("caught: " + e); } try { var o = new Object(); o.appendChild = node.appendChild; o.appendChild(node); } catch(e) { print("caught: " + e); } try { node.appendChild(); } catch(e) { print("caught: " + e); } oldNodeType = node.nodeType; node.nodeType = 1; shouldBe("node.nodeType", oldNodeType); shouldBe("node instanceof Node", true); shouldBe("new Object() instanceof Node", false); print(Node); /* var element, name, weapon; var document = new Document(); document.appendChild(document.createElement('Root')); // Tank Girl element = document.createElement('Hero'); name = document.createElement('Name'); name.appendChild(document.createTextNode('Tank Girl')); element.appendChild(name); weapon = document.createElement('Weapon'); weapon.appendChild(document.createTextNode('Tank')); element.appendChild(weapon); weapon = document.createElement('Weapon'); weapon.appendChild(document.createTextNode('Attitude')); element.appendChild(weapon); weapon = document.createElement('Weapon'); weapon.appendChild(document.createTextNode('Army of genetically engineered super-kangaroos')); element.appendChild(weapon); document.firstChild.appendChild(element); // Skeletor element = document.createElement('Villain'); name = document.createElement('Name'); name.appendChild(document.createTextNode('Skeletor')); element.appendChild(name); weapon = document.createElement('Weapon'); weapon.appendChild(document.createTextNode('Havok Staff')); element.appendChild(weapon); weapon = document.createElement('Weapon'); weapon.appendChild(document.createTextNode('Motley crew of henchmen')); element.appendChild(weapon); document.firstChild.appendChild(element); // Serialize document.serialize(); */}
for (var i = 0; i < node.childNodes.length + 1; i++) { print(i + ": " + node.childNodes[i]);
for (var i = 0; i < childNodes.length + 1; i++) { print(i + ": " + childNodes[i]);
function test(){ print("Node is " + Node); for (var p in Node) print(p + ": " + Node[p]); node = new Node(); print("node is " + node); for (var p in node) print(p + ": " + node[p]); child1 = new Node(); child2 = new Node(); child3 = new Node(); node.appendChild(child1); node.appendChild(child2); for (var i = 0; i < node.childNodes.length + 1; i++) { print("item " + i + ": " + node.childNodes.item(i)); } for (var i = 0; i < node.childNodes.length + 1; i++) { print(i + ": " + node.childNodes[i]); } node.removeChild(child1); node.replaceChild(child3, child2); for (var i = 0; i < node.childNodes.length + 1; i++) { print("item " + i + ": " + node.childNodes.item(i)); } for (var i = 0; i < node.childNodes.length + 1; i++) { print(i + ": " + node.childNodes[i]); } try { node.appendChild(null); } catch(e) { print("caught: " + e); } try { var o = new Object(); o.appendChild = node.appendChild; o.appendChild(node); } catch(e) { print("caught: " + e); } try { node.appendChild(); } catch(e) { print("caught: " + e); } oldNodeType = node.nodeType; node.nodeType = 1; shouldBe("node.nodeType", oldNodeType); shouldBe("node instanceof Node", true); shouldBe("new Object() instanceof Node", false); print(Node); /* var element, name, weapon; var document = new Document(); document.appendChild(document.createElement('Root')); // Tank Girl element = document.createElement('Hero'); name = document.createElement('Name'); name.appendChild(document.createTextNode('Tank Girl')); element.appendChild(name); weapon = document.createElement('Weapon'); weapon.appendChild(document.createTextNode('Tank')); element.appendChild(weapon); weapon = document.createElement('Weapon'); weapon.appendChild(document.createTextNode('Attitude')); element.appendChild(weapon); weapon = document.createElement('Weapon'); weapon.appendChild(document.createTextNode('Army of genetically engineered super-kangaroos')); element.appendChild(weapon); document.firstChild.appendChild(element); // Skeletor element = document.createElement('Villain'); name = document.createElement('Name'); name.appendChild(document.createTextNode('Skeletor')); element.appendChild(name); weapon = document.createElement('Weapon'); weapon.appendChild(document.createTextNode('Havok Staff')); element.appendChild(weapon); weapon = document.createElement('Weapon'); weapon.appendChild(document.createTextNode('Motley crew of henchmen')); element.appendChild(weapon); document.firstChild.appendChild(element); // Serialize document.serialize(); */}
for (var i = 0; i < node.childNodes.length + 1; i++) { print("item " + i + ": " + node.childNodes.item(i));
for (var i = 0; i < childNodes.length + 1; i++) { print("item " + i + ": " + childNodes.item(i));
function test(){ print("Node is " + Node); for (var p in Node) print(p + ": " + Node[p]); node = new Node(); print("node is " + node); for (var p in node) print(p + ": " + node[p]); child1 = new Node(); child2 = new Node(); child3 = new Node(); node.appendChild(child1); node.appendChild(child2); for (var i = 0; i < node.childNodes.length + 1; i++) { print("item " + i + ": " + node.childNodes.item(i)); } for (var i = 0; i < node.childNodes.length + 1; i++) { print(i + ": " + node.childNodes[i]); } node.removeChild(child1); node.replaceChild(child3, child2); for (var i = 0; i < node.childNodes.length + 1; i++) { print("item " + i + ": " + node.childNodes.item(i)); } for (var i = 0; i < node.childNodes.length + 1; i++) { print(i + ": " + node.childNodes[i]); } try { node.appendChild(null); } catch(e) { print("caught: " + e); } try { var o = new Object(); o.appendChild = node.appendChild; o.appendChild(node); } catch(e) { print("caught: " + e); } try { node.appendChild(); } catch(e) { print("caught: " + e); } oldNodeType = node.nodeType; node.nodeType = 1; shouldBe("node.nodeType", oldNodeType); shouldBe("node instanceof Node", true); shouldBe("new Object() instanceof Node", false); print(Node); /* var element, name, weapon; var document = new Document(); document.appendChild(document.createElement('Root')); // Tank Girl element = document.createElement('Hero'); name = document.createElement('Name'); name.appendChild(document.createTextNode('Tank Girl')); element.appendChild(name); weapon = document.createElement('Weapon'); weapon.appendChild(document.createTextNode('Tank')); element.appendChild(weapon); weapon = document.createElement('Weapon'); weapon.appendChild(document.createTextNode('Attitude')); element.appendChild(weapon); weapon = document.createElement('Weapon'); weapon.appendChild(document.createTextNode('Army of genetically engineered super-kangaroos')); element.appendChild(weapon); document.firstChild.appendChild(element); // Skeletor element = document.createElement('Villain'); name = document.createElement('Name'); name.appendChild(document.createTextNode('Skeletor')); element.appendChild(name); weapon = document.createElement('Weapon'); weapon.appendChild(document.createTextNode('Havok Staff')); element.appendChild(weapon); weapon = document.createElement('Weapon'); weapon.appendChild(document.createTextNode('Motley crew of henchmen')); element.appendChild(weapon); document.firstChild.appendChild(element); // Serialize document.serialize(); */}
var yahoo = document.getElementById("test2").getElementsByTagName("a")[1]; assertNull(eventManager.getAttributesXPathLocator(yahoo, pageBot));
function testAttributesXPathLocator() { var elements = document.getElementById("test1").getElementsByTagName("input"); var pageBot = eventManager.getPageBot(window); assertEquals("//input[@name='foo']", eventManager.getAttributesXPathLocator(elements[0], pageBot)); assertEquals("//input[@name='foo' and @value='bar' and @type='button' and @onclick=\"alert(\'test\')\"]", eventManager.getAttributesXPathLocator(elements[1], pageBot)); assertEquals("//input[@name='foo' and @value='bar' and @type='button' and @onclick=\'alert(\"test2\")\']", eventManager.getAttributesXPathLocator(elements[2], pageBot)); assertEquals("//input[@name='foo' and @value='bar' and @type='button' and @onclick=concat(\"alert('test3'\, \",'\"test4\")')]", eventManager.getAttributesXPathLocator(elements[3], pageBot)); assertNull(eventManager.getAttributesXPathLocator(elements[4], pageBot));}
assertEquals(" assertNull(eventManager.getAttributesXPathLocator(elements[2], pageBot));
assertEquals(" assertEquals(" assertEquals(" assertNull(eventManager.getAttributesXPathLocator(elements[4], pageBot));
function testAttributesXPathLocator() { var elements = document.getElementById("test1").getElementsByTagName("input"); var pageBot = eventManager.getPageBot(window); assertEquals("//input[@name='foo']", eventManager.getAttributesXPathLocator(elements[0], pageBot)); assertEquals("//input[@name='foo' and @value='bar' and @type='button' and @onclick='alert()']", eventManager.getAttributesXPathLocator(elements[1], pageBot)); assertNull(eventManager.getAttributesXPathLocator(elements[2], pageBot));}
assertEquals("'\xA0'", decodeText("'&#xA0;'")); assertEquals("'\xA0'", decodeText("'&#160;'")); assertEquals("'\xA0'", decodeText("'&nbsp;'"));
assertEquals("' '", decodeText("'&#xA0;'")); assertEquals("' '", decodeText("'&#160;'")); assertEquals("' '", decodeText("'&nbsp;'"));
function testDecodeTextWithHtmlFormat() { assertEquals("abc", decodeText("abc")); assertEquals("'\xA0'", decodeText("'&#xA0;'")); assertEquals("'\xA0'", decodeText("'&#160;'")); assertEquals("'\xA0'", decodeText("'&nbsp;'")); assertEquals("'abc'", decodeText("'abc'")); assertEquals("&amp;", decodeText("&amp;amp;")); assertEquals("a=b&c=d", decodeText("a=b&c=d")); assertEquals("&foobar;", decodeText("&foobar;"));}
assertEquals("a\nb", decodeText("a<br>b")); assertEquals("a\nb", decodeText("a<br />b"));
function testDecodeTextWithHtmlFormat() { assertEquals("abc", decodeText("abc")); assertEquals("' '", decodeText("'&#xA0;'")); assertEquals("' '", decodeText("'&#160;'")); assertEquals("' '", decodeText("'&nbsp;'")); assertEquals("'abc'", decodeText("'abc'")); assertEquals("&amp;", decodeText("&amp;amp;")); assertEquals("a=b&c=d", decodeText("a=b&c=d")); assertEquals("&foobar;", decodeText("&foobar;"));}
assertEquals(" ", encodeText(" ")); assertEquals("&nbsp;&nbsp;", encodeText(" "));
function testEncodeTextWithHtmlFormat() { assertEquals("&nbsp;", encodeText("\xA0")); assertEquals("'abc'", encodeText("'abc'")); assertEquals("&amp;amp;", encodeText("&amp;")); assertEquals("a=b&c=d", encodeText("a=b&c=d")); assertEquals("&foobar;", encodeText("&foobar;"));}
assertEquals("<br />", encodeText("\n"));
function testEncodeTextWithHtmlFormat() { assertEquals("&nbsp;", encodeText("\xA0")); assertEquals(" ", encodeText(" ")); assertEquals("&nbsp;&nbsp;", encodeText(" ")); assertEquals("'abc'", encodeText("'abc'")); assertEquals("&amp;amp;", encodeText("&amp;")); assertEquals("a=b&c=d", encodeText("a=b&c=d")); assertEquals("&foobar;", encodeText("&foobar;"));}
debug('<span class="fail">FAIL</span> ' + msg + '</span>');
debug('<span class="fail">FAIL</span> ' + escapeHTML(msg) + '</span>');
function testFailed(msg){ debug('<span class="fail">FAIL</span> ' + msg + '</span>');}
assertEquals('assertEquals(new String[] {"", "abc", "ab,c"}, selenium.getSelectOptions("theSelect"));', nextCommand());
assertEquals('String[] array1 = selenium.getSelectOptions("theSelect");\n' + 'assertEquals(3, array1.length);\n' + 'assertEquals("", array1[0]);\n' + 'assertEquals("abc", array1[1]);\n' + 'assertEquals("ab,c", array1[2]);', nextCommand());
function testJavaRCFormat() { var format = this.formats.findFormat("java-rc"); var f = format.getFormatter(); this.formatter = f; assertEquals('assertTrue(selenium.isTextPresent("hello"));', nextCommand()); assertEquals('assertFalse(selenium.isTextPresent("hello"));', nextCommand()); assertEquals('boolean abc = selenium.isTextPresent("test");', nextCommand()); assertTrue(nextCommand().indexOf('if (selenium.isTextPresent("test")) break; }') >= 0); assertTrue(nextCommand().indexOf('if (!selenium.isTextPresent("test")) break; }') >= 0); assertEquals('assertEquals("def", selenium.getText("abc"));', nextCommand()); assertEquals('assertEquals("abc", selenium.getLocation());', nextCommand()); assertEquals('assertNotEquals("abc", selenium.getLocation());', nextCommand()); assertEquals('selenium.type("theText", selenium.getEval("\'abc\'"));', nextCommand()); assertEquals('assertEquals(new String[] {"", "abc", "ab,c"}, selenium.getSelectOptions("theSelect"));', nextCommand()); assertEquals('assertNotEquals("abc", selenium.getLocation());', nextCommand()); assertEquals('String def = selenium.getText("abc");', nextCommand()); assertTrue(nextCommand().indexOf('if ("def".equals(selenium.getText("abc"))) break; }') >= 0); assertTrue(nextCommand().indexOf('if (!Pattern.compile("foo.*").matcher(selenium.getValue("abc")).find()) break; }') >= 0); assertTrue(nextCommand().indexOf('if (!"def".equals(selenium.getText("abc"))) break; }') >= 0); assertEquals('selenium.open("http://www.google.com/");', nextCommand()); assertEquals('selenium.waitForPageToLoad("30000");', nextCommand()); assertEquals('Thread.sleep(1000);', nextCommand()); assertEquals("// line 1\n// line 2", f.formatComment(this.commands.shift()));}
assertEquals('assertFalse(Pattern.compile("ab[cd]").matcher(selenium.getText("test")).find());', nextCommand());
function testJavaRCFormat() { var format = this.formats.findFormat("java-rc"); var f = format.getFormatter(); this.formatter = f; assertEquals('assertTrue(selenium.isTextPresent("hello"));', nextCommand()); assertEquals('assertFalse(selenium.isTextPresent("hello"));', nextCommand()); assertEquals('boolean abc = selenium.isTextPresent("test");', nextCommand()); assertTrue(nextCommand().indexOf('if (selenium.isTextPresent("test")) break; }') >= 0); assertTrue(nextCommand().indexOf('if (!selenium.isTextPresent("test")) break; }') >= 0); assertEquals('assertEquals("def", selenium.getText("abc"));', nextCommand()); assertEquals('assertEquals("abc", selenium.getLocation());', nextCommand()); assertEquals('assertNotEquals("abc", selenium.getLocation());', nextCommand()); assertEquals('selenium.type("theText", selenium.getEval("\'abc\'"));', nextCommand()); assertEquals('String[] array1 = selenium.getSelectOptions("theSelect");\n' + 'assertEquals(3, array1.length);\n' + 'assertEquals("", array1[0]);\n' + 'assertEquals("abc", array1[1]);\n' + 'assertEquals("ab,c", array1[2]);', nextCommand()); assertEquals('assertNotEquals("abc", selenium.getLocation());', nextCommand()); assertEquals('String def = selenium.getText("abc");', nextCommand()); assertTrue(nextCommand().indexOf('if ("def".equals(selenium.getText("abc"))) break; }') >= 0); assertTrue(nextCommand().indexOf('if (!Pattern.compile("foo.*").matcher(selenium.getValue("abc")).find()) break; }') >= 0); assertTrue(nextCommand().indexOf('if (!"def".equals(selenium.getText("abc"))) break; }') >= 0); assertEquals('selenium.open("http://www.google.com/");', nextCommand()); assertEquals('selenium.waitForPageToLoad("30000");', nextCommand()); assertEquals('Thread.sleep(1000);', nextCommand()); assertEquals("// line 1\n// line 2", f.formatComment(this.commands.shift()));}
assertEquals('assertTrue(selenium.getText("abc").matches("^def(.|[\\\\r\\\\n])*$"));', nextCommand());
assertEquals('assertTrue(selenium.getText("abc").matches("^def[\\\\s\\\\S]*$"));', nextCommand());
function testJavaRCFormat() { var format = this.formats.findFormat("java-rc"); var f = format.getFormatter(); this.formatter = f; assertEquals('assertTrue(selenium.isTextPresent("hello"));', nextCommand()); assertEquals('assertFalse(selenium.isTextPresent("hello"));', nextCommand()); assertEquals('boolean abc = selenium.isTextPresent("test");', nextCommand()); assertEquals('assertFalse(Pattern.compile("ab[cd]").matcher(selenium.getText("test")).find());', nextCommand()); assertTrue(nextCommand().indexOf('if (selenium.isTextPresent("test")) break; }') >= 0); assertTrue(nextCommand().indexOf('if (!selenium.isTextPresent("test")) break; }') >= 0); assertEquals('assertEquals("def", selenium.getText("abc"));', nextCommand()); assertEquals('assertTrue(selenium.getText("abc").matches("^def(.|[\\\\r\\\\n])*$"));', nextCommand()); assertEquals('assertEquals("abc", selenium.getLocation());', nextCommand()); assertEquals('assertNotEquals("abc", selenium.getLocation());', nextCommand()); assertEquals('selenium.type("theText", selenium.getEval("\'abc\'"));', nextCommand()); assertEquals('String[] array1 = selenium.getSelectOptions("theSelect");\n' + 'assertEquals(3, array1.length);\n' + 'assertEquals("", array1[0]);\n' + 'assertEquals("abc", array1[1]);\n' + 'assertEquals("ab,c", array1[2]);', nextCommand()); assertEquals('assertNotEquals("abc", selenium.getLocation());', nextCommand()); assertEquals('String def = selenium.getText("abc");', nextCommand()); assertTrue(nextCommand().indexOf('if ("def".equals(selenium.getText("abc"))) break; }') >= 0); assertTrue(nextCommand().indexOf('if (!Pattern.compile("foo.*").matcher(selenium.getValue("abc")).find()) break; }') >= 0); assertTrue(nextCommand().indexOf('if (!"def".equals(selenium.getText("abc"))) break; }') >= 0); assertEquals('selenium.open("http://www.google.com/");', nextCommand()); assertEquals('selenium.waitForPageToLoad("30000");', nextCommand()); assertEquals('Thread.sleep(1000);', nextCommand()); assertEquals("// line 1\n// line 2", f.formatComment(this.commands.shift()));}
var yahooJP = document.getElementById("test2").getElementsByTagName("a")[4]; assertLocator("link=Yahoo Japan", eventManager.getLinkLocator(yahooJP, pageBot), yahooJP);
function testLinkLocator() { var google = document.getElementById("test2").getElementsByTagName("a")[0]; assertLocator("link=exact:Google:Google", eventManager.getLinkLocator(google, pageBot), google); var yahoo = document.getElementById("test2").getElementsByTagName("a")[1]; assertLocator("link=Yahoo", eventManager.getLinkLocator(yahoo, pageBot), yahoo);}
var yahoo2 = document.getElementById("test2").getElementsByTagName("a")[2]; assertLocator("
function testLinkXPathLocator() { var yahoo = document.getElementById("test2").getElementsByTagName("a")[1]; assertLocator("//a[contains(text(),'Yahoo')]", builders.buildWith('linkXPath', yahoo), yahoo); var yahoo2 = document.getElementById("test2").getElementsByTagName("a")[2]; assertLocator("//a[img/@alt='test']", builders.buildWith('linkXPath', yahoo2), yahoo2);}
else { try { var processNext = handler.executor.call(selenium, command.target, command.value); if (handler.type == "assert") { this.assertionPassed(); } else { this.actionOK(); }
function TestLoop(commandFactory) { this.commandFactory = commandFactory; this.commandInterval = 0; this.processState == SELENIUM_PROCESS_CONTINUE; var self = this; this.start = function() { self.continueCurrentTest(); } this.continueCurrentTest = function() { this.processState = self.executeNextCommand(); if (this.processState == SELENIUM_PROCESS_WAIT) { //window.setTimeout("continueCurrentTest()", 500); selenium.callOnNextPageLoad(function() {eval("testLoop.continueCurrentTest()")}); return; } if (this.processState == SELENIUM_PROCESS_PAUSED) { return; // Will re-enter this loop on reload. } if (this.processState != SELENIUM_PROCESS_COMPLETE) { // Continue processing if (this.commandInterval >= 0) { window.setTimeout("testLoop.continueCurrentTest();", this.commandInterval); } return; } this.onTestComplete(); } this.executeNextCommand = function() { var command = this.nextCommand(); if (!command) return SELENIUM_PROCESS_COMPLETE; handler = this.commandFactory.getCommandHandler(command.command); // Make the current row blue this.beginCommand(command); if(handler == null) { this.commandError("Unknown command", ERROR); return SELENIUM_PROCESS_COMPLETE; } else { try { var processNext = handler.executor.call(selenium, command.target, command.value); if (handler.type == "assert") { this.assertionPassed(); } else { this.actionOK(); } return processNext; } catch (e) { if (e.isJsUnitException && handler.type == "assert") { this.assertionFailed(e.jsUnitMessage); } else { this.commandError(e.message); } } } }}
return processNext; } catch (e) { if (e.isJsUnitException && handler.type == "assert") { this.assertionFailed(e.jsUnitMessage); } else { this.commandError(e.message); }
try { var processNext = handler.executor.call(selenium, command.target, command.value); if (processNext == undefined && handler.wait) { processNext = SELENIUM_PROCESS_WAIT; } if (handler.type == "assert") { this.assertionPassed(); } else { this.actionOK(); } return processNext; } catch (e) { if (e.isJsUnitException && handler.type == "assert") { this.assertionFailed(e.jsUnitMessage); } else { this.commandError(e.message);
function TestLoop(commandFactory) { this.commandFactory = commandFactory; this.commandInterval = 0; this.processState == SELENIUM_PROCESS_CONTINUE; var self = this; this.start = function() { self.continueCurrentTest(); } this.continueCurrentTest = function() { this.processState = self.executeNextCommand(); if (this.processState == SELENIUM_PROCESS_WAIT) { //window.setTimeout("continueCurrentTest()", 500); selenium.callOnNextPageLoad(function() {eval("testLoop.continueCurrentTest()")}); return; } if (this.processState == SELENIUM_PROCESS_PAUSED) { return; // Will re-enter this loop on reload. } if (this.processState != SELENIUM_PROCESS_COMPLETE) { // Continue processing if (this.commandInterval >= 0) { window.setTimeout("testLoop.continueCurrentTest();", this.commandInterval); } return; } this.onTestComplete(); } this.executeNextCommand = function() { var command = this.nextCommand(); if (!command) return SELENIUM_PROCESS_COMPLETE; handler = this.commandFactory.getCommandHandler(command.command); // Make the current row blue this.beginCommand(command); if(handler == null) { this.commandError("Unknown command", ERROR); return SELENIUM_PROCESS_COMPLETE; } else { try { var processNext = handler.executor.call(selenium, command.target, command.value); if (handler.type == "assert") { this.assertionPassed(); } else { this.actionOK(); } return processNext; } catch (e) { if (e.isJsUnitException && handler.type == "assert") { this.assertionFailed(e.jsUnitMessage); } else { this.commandError(e.message); } } } }}
LOG.error(e);
function TestLoop(commandFactory, executionContext) { this.commandFactory = commandFactory; var self = this; this.start = function() { this.continueCurrentTest(); }; this.continueCurrentTest = function() { var testStatus = this.kickoffNextCommandExecution(); if (testStatus == TEST_FINISHED) { this.testComplete(); } }; this.kickoffNextCommandExecution = function() { var command; if (starting_up == true) { command = this.firstCommand(); starting_up = false; } else { command = this.nextCommand(); } if (!command) return TEST_FINISHED; // Make the current row blue this.commandStarted(command); var result; try { var handler = this.commandFactory.getCommandHandler(command.command); if(handler == null) { throw new Error("Unknown command"); } result = handler.execute(selenium, command); } catch (e) { // TODO: only throw typed errors from commands so that we can perform better error handling // to differentiate between expected command errors and unexpected javascript errors. if (e instanceof TypeError) { // Not a command error. throw e; } this.commandError(e.message); return TEST_FINISHED; } // Record the result so that we can continue the execution using window.setTimeout() this.lastCommandResult = result; if (result.processState == SELENIUM_PROCESS_WAIT) { executionContext.waitForPageLoad(this,selenium); } else { // Continue processing this.continueCommandExecutionWithDelay(); } // Test is not finished. return TEST_CONTINUE; }; /** * Continues the command execution, after waiting for the specified delay. */ this.continueCommandExecutionWithDelay = function() { // Get the interval to use for this command execution, using the pauseInterval is // specified. Reset the pause interval, since it's a one-off thing. var interval = this.pauseInterval || this.getCommandInterval(); this.pauseInterval = undefined; // Continue processing if (interval >= 0) { window.setTimeout("testLoop.finishCommandExecution()", interval); } }; /** * Finishes the execution of the previous command, and continues the test */ this.finishCommandExecution = function() { this.commandComplete(this.lastCommandResult); this.continueCurrentTest(); };}
if (interval >= 0) {
if (interval < 0) { this.waitingForNext(); } else {
function TestLoop(commandFactory) { this.commandFactory = commandFactory; var self = this; this.start = function() { this.continueCurrentTest(); }; this.continueCurrentTest = function() { var testStatus = this.kickoffNextCommandExecution(); if (testStatus == TEST_FINISHED) { this.testComplete(); } }; this.kickoffNextCommandExecution = function() { var command; if (starting_up == true) { command = this.firstCommand(); starting_up = false; } else { command = this.nextCommand(); } if (!command) return TEST_FINISHED; // Make the current row blue this.commandStarted(command); LOG.debug("Executing: |" + command.command + " | " + command.target + " | " + command.value + " |"); var result; try { var handler = this.commandFactory.getCommandHandler(command.command); if(handler == null) { throw new Error("Unknown command: '" + command.command + "'"); } result = handler.execute(selenium, command); } catch (e) { LOG.error(e); // TODO: only throw typed errors from commands so that we can perform better error handling // to differentiate between expected command errors and unexpected javascript errors. if (e instanceof TypeError) { // Not a command error. throw e; } this.commandError(e.message); return TEST_FINISHED; } // Record the result so that we can continue the execution using window.setTimeout() this.lastCommandResult = result; if (result.processState == SELENIUM_PROCESS_WAIT) { // Since we're waiting for page to reload, we can't continue command execution // directly, we need use a page load listener. // TODO there is a potential race condition by attaching a load listener after // the command has completed execution. selenium.callOnNextPageLoad(function() {eval("testLoop.continueCommandExecutionWithDelay()");}); } else { // Continue processing this.continueCommandExecutionWithDelay(); } // Test is not finished. return TEST_CONTINUE; }; /** * Continues the command execution, after waiting for the specified delay. */ this.continueCommandExecutionWithDelay = function() { // Get the interval to use for this command execution, using the pauseInterval is // specified. Reset the pause interval, since it's a one-off thing. var interval = this.pauseInterval || this.getCommandInterval(); this.pauseInterval = undefined; // Continue processing if (interval >= 0) { window.setTimeout("testLoop.finishCommandExecution()", interval); } }; /** * Finishes the execution of the previous command, and continues the test */ this.finishCommandExecution = function() { this.commandComplete(this.lastCommandResult); this.continueCurrentTest(); };}
throw new Error("Unknown command");
throw new Error("Unknown command: '" + command.command + "'");
function TestLoop(commandFactory, executionContext) { this.commandFactory = commandFactory; var self = this; this.start = function() { this.continueCurrentTest(); }; this.continueCurrentTest = function() { var testStatus = this.kickoffNextCommandExecution(); if (testStatus == TEST_FINISHED) { this.testComplete(); } }; this.kickoffNextCommandExecution = function() { var command; if (starting_up == true) { command = this.firstCommand(); starting_up = false; } else { command = this.nextCommand(); } if (!command) return TEST_FINISHED; // Make the current row blue this.commandStarted(command); LOG.debug("Executing: |" + command.command + " | " + command.target + " | " + command.value + " |"); var result; try { var handler = this.commandFactory.getCommandHandler(command.command); if(handler == null) { throw new Error("Unknown command"); } result = handler.execute(selenium, command); } catch (e) { LOG.error(e); // TODO: only throw typed errors from commands so that we can perform better error handling // to differentiate between expected command errors and unexpected javascript errors. if (e instanceof TypeError) { // Not a command error. throw e; } this.commandError(e.message); return TEST_FINISHED; } // Record the result so that we can continue the execution using window.setTimeout() this.lastCommandResult = result; if (result.processState == SELENIUM_PROCESS_WAIT) { executionContext.waitForPageLoad(this,selenium); } else { // Continue processing this.continueCommandExecutionWithDelay(); } // Test is not finished. return TEST_CONTINUE; }; /** * Continues the command execution, after waiting for the specified delay. */ this.continueCommandExecutionWithDelay = function() { // Get the interval to use for this command execution, using the pauseInterval is // specified. Reset the pause interval, since it's a one-off thing. var interval = this.pauseInterval || this.getCommandInterval(); this.pauseInterval = undefined; // Continue processing if (interval >= 0) { window.setTimeout("testLoop.finishCommandExecution()", interval); } }; /** * Finishes the execution of the previous command, and continues the test */ this.finishCommandExecution = function() { this.commandComplete(this.lastCommandResult); this.continueCurrentTest(); };}
log.error("failed to select format: " + error);
this.log.error("failed to select format: " + error);
function TestManager(options) { this.options = options; this.log = new Log("TestManager"); this.presetFormatInfos = [new InternalFormatInfo("default", "HTML", "html.js"), new InternalFormatInfo("ruby", "Ruby", "ruby.js")]; this.reloadFormats(); if (options.selectedFormat != null) { try { this.selectFormat(options.selectedFormat); } catch (error) { log.error("failed to select format: " + error); } } if (this.currentFormatInfo == null) { this.currentFormatInfo = this.formatInfos[0]; }}
this.log.debug("selecting default format");
function TestManager(options) { this.options = options; this.log = new Log("TestManager"); this.presetFormatInfos = [new InternalFormatInfo("default", "HTML", "html.js"), new InternalFormatInfo("ruby", "Ruby", "ruby.js")]; this.reloadFormats(); if (options.selectedFormat != null) { try { this.selectFormat(options.selectedFormat); } catch (error) { log.error("failed to select format: " + error); } } if (this.currentFormatInfo == null) { this.currentFormatInfo = this.formatInfos[0]; }}
this.currentFormatInfo = this.formatInfos[0];
if (options.selectedFormat != null) { try { this.selectFormat(options.selectedFormat); } catch (error) { log.error("failed to select format: " + error); } } if (this.currentFormatInfo == null) { this.currentFormatInfo = this.formatInfos[0]; }
function TestManager(options) { this.options = options; this.log = new Log("TestManager"); this.presetFormatInfos = [new InternalFormatInfo("default", "HTML", "html.js"), new InternalFormatInfo("ruby", "Ruby", "ruby.js")]; this.reloadFormats(); this.currentFormatInfo = this.formatInfos[0];}