rem
stringlengths
0
126k
add
stringlengths
0
441k
context
stringlengths
15
136k
function EditorShowEmbeddedObjects() { dump("\nEmbedded Objects:\n"); var objectArray = editorShell.GetEmbeddedObjects(); dump(objectArray.Count() + " embedded objects\n"); for (var i=0; i < objectArray.Count(); ++i) dump(objectArray.GetElementAt(i) + "\n"); } function EditorUnitTests() { dump("Running Unit Tests\n"); editorShell.RunUnitTests(); } function EditorTestDocument() { dump("Getting document\n"); var theDoc = editorShell.editorDocument; if (theDoc) { dump("Got the doc\n"); dump("Document name:" + theDoc.nodeName + "\n"); dump("Document type:" + theDoc.doctype + "\n"); } else { dump("Failed to get the doc\n"); } } function EditorExecuteScript(fileSpec) { fileSpec.openStreamForReading(); var buf = { value:null }; var tmpBuf = { value:null }; var didTruncate = { value:false }; var lineNum = 0; var ex; while (!fileSpec.eof()) { buf.value = ""; didTruncate.value = true; while (didTruncate.value && !fileSpec.eof()) { didTruncate.value = false; fileSpec.readLine(tmpBuf, 1024, didTruncate); buf.value += tmpBuf.value; tmpBuf.value = null; } ++lineNum; try { eval(buf.value); } catch(ex) { dump("Playback ERROR: Line " + lineNum + " " + ex + "\n"); return; } } buf.value = null; } function EditorGetScriptFileSpec() { var fs = Components.classes["component: fs = fs.QueryInterface(Components.interfaces.nsIFileSpec); fs.unixStyleFilePath = "journal.js"; return fs; } function EditorStartLog() { var fs; fs = EditorGetScriptFileSpec(); editorShell.StartLogging(fs); contentWindow.focus(); fs = null; } function EditorStopLog() { editorShell.StopLogging(); contentWindow.focus(); } function EditorRunLog() { var fs; fs = EditorGetScriptFileSpec(); EditorExecuteScript(fs); contentWindow.focus(); }
function EditorTestTableLayout(){ var table = editorShell.GetElementOrParentByTagName("table", null); if (!table) { dump("Enclosing Table not found: Place caret in a table cell to do this test\n\n"); return; } var cell; var startRowIndexObj = new Object(); var startColIndexObj = new Object(); var rowSpanObj = new Object(); var colSpanObj = new Object(); var isSelectedObj = new Object(); var startRowIndex = 0; var startColIndex = 0; var rowSpan; var colSpan; var isSelected; var col = 0; var row = 0; var rowCount = 0; var maxColCount = 0; var doneWithRow = false; var doneWithCol = false; dump("\n\n\n************ Starting Table Layout test ************\n"); // Note: We could also get the number of rows, cols and use for loops, // but this tests using out-of-bounds offsets to detect end of row or column while (!doneWithRow) // Iterate through rows { while(!doneWithCol) // Iterate through cells in the row { try { cell = editorShell.GetCellDataAt(table, row, col, startRowIndexObj, startColIndexObj, rowSpanObj, colSpanObj, isSelectedObj); if (cell) { rowSpan = rowSpanObj.value; colSpan = colSpanObj.value; isSelected = isSelectedObj.value; dump("Row,Col: "+row+","+col+" StartRow,StartCol: "+startRowIndexObj.value+","+startColIndexObj.value+" RowSpan="+rowSpan+" ColSpan="+colSpan); if (isSelected) dump(" Cell is selected\n"); else dump(" Cell is NOT selected\n"); // Save the indexes of a cell that will span across the cellmap grid if (rowSpan > 1) startRowIndex = startRowIndexObj.value; if (colSpan > 1) startColIndex = startColIndexObj.value; // Initialize these for efficient spanned-cell search startRowIndexObj.value = startRowIndex; startColIndexObj.value = startColIndex; col++; } else { doneWithCol = true; // Get maximum number of cells in any row if (col > maxColCount) maxColCount = col; dump(" End of row found\n\n"); } } catch (e) { dump(" *** GetCellDataAt barfed at Row,Col:"+row+","+col+" ***\n\n"); col++; } } if (col == 0) { // Didn't find a cell in the first col of a row, // thus no more rows in table doneWithRow = true; rowCount = row; dump("No more rows in table\n\n"); } else { // Setup for next row col = 0; row++; doneWithCol = false; dump("Setup for next row\n"); } } dump("Counted during scan: Number of rows="+rowCount+" Number of Columns="+maxColCount+"\n"); rowCount = editorShell.GetTableRowCount(table); maxColCount = editorShell.GetTableColumnCount(table); dump("From nsITableLayout: Number of rows="+rowCount+" Number of Columns="+maxColCount+"\n****** End of Table Layout Test *****\n\n");}
editorShell.DisplayParagraphMarks(checked != "true");
editorShell.DisplayParagraphMarks(checked == "true");
function EditorToggleParagraphMarks(){ var menuItem = document.getElementById("viewParagraphMarks"); if (menuItem) { var checked = menuItem.getAttribute("checked"); try { editorShell.DisplayParagraphMarks(checked != "true"); } catch(e) { dump("Failed to load style sheet for paragraph marks\n"); return; } if (checked) menuItem.removeAttribute("checked"); else menuItem.setAttribute("checked", "true"); }}
if (checked) menuItem.removeAttribute("checked"); else menuItem.setAttribute("checked", "true");
function EditorToggleParagraphMarks(){ var menuItem = document.getElementById("viewParagraphMarks"); if (menuItem) { var checked = menuItem.getAttribute("checked"); try { editorShell.DisplayParagraphMarks(checked != "true"); } catch(e) { dump("Failed to load style sheet for paragraph marks\n"); return; } if (checked) menuItem.removeAttribute("checked"); else menuItem.setAttribute("checked", "true"); }}
contentWindow.focus();
function EditorUndo(){ dump("Undoing\n"); window.editorShell.Undo();}
fileurl = window.content.location;
fileurl = window._content.location;
function EditorViewSource(){ // Temporary hack: save to a file and call up the source view window // using the local file url. if (!editorShell.CheckAndSaveDocument(GetString("BeforeViewSource"))) return; fileurl = ""; try { fileurl = window.content.location; } catch (e) { return; } // CheckAndSave doesn't tell us if the user said "Don't Save", // so make sure we have a url: if (fileurl != "" && fileurl != "about:blank") { // Use a browser window to view source window.openDialog( "chrome://navigator/content/viewSource.xul", "_blank", "chrome,menubar,status,dialog=no,resizable", fileurl, "view-source" ); }}
var focusedWindow = launchWindow.document.commandDispatcher.focusedWindow; var sourceWin = isDocumentFrame(focusedWindow) ? focusedWindow.location.href : focusedWindow._content.location.href; const nsIScriptSecurityManager = Components.interfaces.nsIScriptSecurityManager; var secMan = Components.classes["@mozilla.org/scriptsecuritymanager;1"].getService(). QueryInterface(nsIScriptSecurityManager); try { secMan.checkLoadURIStr(sourceWin, url, nsIScriptSecurityManager.STANDARD); } catch (e) { throw "Edit of " + url + " denied."; }
function editPage(url, launchWindow, delay){ // User may not have supplied a window if (!launchWindow) { if (window) { launchWindow = window; } else { dump("No window to launch an editor from!\n"); return; } } var windowManager = Components.classes['@mozilla.org/rdf/datasource;1?name=window-mediator'].getService(); if (!windowManager) return; var windowManagerInterface = windowManager.QueryInterface( Components.interfaces.nsIWindowMediator); if ( !windowManagerInterface ) return; var enumerator = windowManagerInterface.getEnumerator( "composer:html" ); if ( !enumerator ) return; while ( enumerator.hasMoreElements() ) { var window = windowManagerInterface.convertISupportsToDOMWindow( enumerator.getNext() ); if ( window && window.editorShell) { if (window.editorShell.checkOpenWindowForURLMatch(url, window)) { // We found an editor with our url window.focus(); return; } } } // Create new Composer window if (delay) launchWindow.delayedOpenWindow("chrome://editor/content", "chrome,all,dialog=no", url); else launchWindow.openDialog("chrome://editor/content", "_blank", "chrome,all,dialog=no", url);}
emptyWindow.FinishHTMLSource();
emptyWindow.SetEditMode(emptyWindow.PreviousNonSourceDisplayMode);
function editPage(url, launchWindow, delay){ var focusedWindow = document.commandDispatcher.focusedWindow; if (isDocumentFrame(focusedWindow)) url = focusedWindow.location.href; // User may not have supplied a window if (!launchWindow) { if (window) { launchWindow = window; } else { dump("No window to launch an editor from!\n"); return; } } // if the current window is a browser window, then extract the current charset menu setting from the current // document and use it to initialize the new composer window... var wintype = document.firstChild.getAttribute('windowtype'); var charsetArg; if (launchWindow && (wintype == "navigator:browser") && launchWindow._content.document) charsetArg = "charset=" + launchWindow._content.document.characterSet; try { var uri = createURI(url, null, null); var windowManager = Components.classes['@mozilla.org/appshell/window-mediator;1'].getService(); var windowManagerInterface = windowManager.QueryInterface( Components.interfaces.nsIWindowMediator); var enumerator = windowManagerInterface.getEnumerator( "composer:html" ); var emptyWindow; while ( enumerator.hasMoreElements() ) { var win = enumerator.getNext().QueryInterface(Components.interfaces.nsIDOMWindowInternal); if ( win && win.editorShell) { if (CheckOpenWindowForURIMatch(uri, win)) { // We found an editor with our url win.focus(); return; } else if (!emptyWindow && win.PageIsEmptyAndUntouched()) { emptyWindow = win; } } } if (emptyWindow) { // we have an empty window we can use if (emptyWindow.IsInHTMLSourceMode()) emptyWindow.FinishHTMLSource(); emptyWindow.editorShell.LoadUrl(url); emptyWindow.focus(); emptyWindow.SetSaveAndPublishUI(url); return; } // Create new Composer window if (delay) { launchWindow.delayedOpenWindow("chrome://editor/content", "chrome,all,dialog=no", url); } else launchWindow.openDialog("chrome://editor/content", "_blank", "chrome,all,dialog=no", url, charsetArg); } catch(e) {}}
if (isDocumentFrame(focusedWindow)) url = focusedWindow.location.href;
if (isContentFrame(focusedWindow)) url = Components.lookupMethod(focusedWindow, 'location').call(focusedWindow).href;
function editPage(url, launchWindow, delay){ var focusedWindow = document.commandDispatcher.focusedWindow; if (isDocumentFrame(focusedWindow)) url = focusedWindow.location.href; // Always strip off "view-source:" if (url.slice(0,12) == "view-source:") url = url.slice(13); // User may not have supplied a window if (!launchWindow) { if (window) { launchWindow = window; } else { dump("No window to launch an editor from!\n"); return; } } // if the current window is a browser window, then extract the current charset menu setting from the current // document and use it to initialize the new composer window... var wintype = document.firstChild.getAttribute('windowtype'); var charsetArg; if (launchWindow && (wintype == "navigator:browser") && launchWindow._content.document) charsetArg = "charset=" + launchWindow._content.document.characterSet; try { var uri = createURI(url, null, null); var windowManager = Components.classes['@mozilla.org/appshell/window-mediator;1'].getService(); var windowManagerInterface = windowManager.QueryInterface( Components.interfaces.nsIWindowMediator); var enumerator = windowManagerInterface.getEnumerator( "composer:html" ); var emptyWindow; while ( enumerator.hasMoreElements() ) { var win = enumerator.getNext().QueryInterface(Components.interfaces.nsIDOMWindowInternal); if ( win && win.IsWebComposer()) { if (CheckOpenWindowForURIMatch(uri, win)) { // We found an editor with our url win.focus(); return; } else if (!emptyWindow && win.PageIsEmptyAndUntouched()) { emptyWindow = win; } } } if (emptyWindow) { // we have an empty window we can use if (emptyWindow.IsInHTMLSourceMode()) emptyWindow.SetEditMode(emptyWindow.PreviousNonSourceDisplayMode); emptyWindow.editorShell.LoadUrl(url); emptyWindow.focus(); emptyWindow.SetSaveAndPublishUI(url); return; } // Create new Composer window if (delay) { launchWindow.delayedOpenWindow("chrome://editor/content", "chrome,all,dialog=no", url); } else launchWindow.openDialog("chrome://editor/content", "_blank", "chrome,all,dialog=no", url, charsetArg); } catch(e) {}}
var url;
function editPageOrFrame(){ var url; var focusedWindow = document.commandDispatcher.focusedWindow; if (isDocumentFrame(focusedWindow)) url = focusedWindow.location.href; else url = window._content.location.href; editPage(url, window, false)}
if (isDocumentFrame(focusedWindow)) url = focusedWindow.location.href; else url = window._content.location.href;
var url = getContentFrameURI(focusedWindow);
function editPageOrFrame(){ var url; var focusedWindow = document.commandDispatcher.focusedWindow; if (isDocumentFrame(focusedWindow)) url = focusedWindow.location.href; else url = window._content.location.href; editPage(url, window, false)}
while (aNode.childNodes.length > 0) {
while (aNode.hasChildNodes()) {
emptyChildren: function(aNode) { while (aNode.childNodes.length > 0) { aNode.removeChild(aNode.lastChild); } },
var numSelected = tree.treeBoxObject.selection ? tree.treeBoxObject.selection.count : 0;
var numSelected = tree.view.selection.count; var canMoveUp = false, canMoveDown = false, customizeURL = '';
function enable_buttons_for_current_panels() { var up = document.getElementById('up'); var down = document.getElementById('down'); var tree = document.getElementById('current-panels'); var customize = document.getElementById('customize-button'); var remove = document.getElementById('remove-button'); var numSelected = tree.treeBoxObject.selection ? tree.treeBoxObject.selection.count : 0; var noneSelected, isFirst, isLast, selectedNode if (numSelected > 0) { selectedNode = tree.contentView.getItemAtIndex(tree.currentIndex); isFirst = selectedNode == selectedNode.parentNode.firstChild isLast = selectedNode == selectedNode.parentNode.lastChild } // up /\ button if (numSelected != 1 || isFirst) { up.setAttribute('disabled', 'true'); } else { up.removeAttribute('disabled'); } // down \/ button if (numSelected != 1 || isLast) { down.setAttribute('disabled', 'true'); } else { down.removeAttribute('disabled'); } // "Customize..." button var customizeURL = null; if (numSelected == 1) { customizeURL = selectedNode.getAttribute('customize'); } if (customizeURL == null || customizeURL == '') { customize.setAttribute('disabled','true'); } else { customize.removeAttribute('disabled'); } // "Remove" button if (numSelected == 0) { remove.setAttribute('disabled','true'); } else { remove.removeAttribute('disabled'); }}
var noneSelected, isFirst, isLast, selectedNode if (numSelected > 0) { selectedNode = tree.contentView.getItemAtIndex(tree.currentIndex); isFirst = selectedNode == selectedNode.parentNode.firstChild isLast = selectedNode == selectedNode.parentNode.lastChild
if (numSelected == 1 && tree.view.selection.isSelected(tree.currentIndex)) { var selectedNode = tree.view.getItemAtIndex(tree.currentIndex); customizeURL = selectedNode.getAttribute('customize'); canMoveUp = selectedNode != selectedNode.parentNode.firstChild; canMoveDown = selectedNode != selectedNode.parentNode.lastChild;
function enable_buttons_for_current_panels() { var up = document.getElementById('up'); var down = document.getElementById('down'); var tree = document.getElementById('current-panels'); var customize = document.getElementById('customize-button'); var remove = document.getElementById('remove-button'); var numSelected = tree.treeBoxObject.selection ? tree.treeBoxObject.selection.count : 0; var noneSelected, isFirst, isLast, selectedNode if (numSelected > 0) { selectedNode = tree.contentView.getItemAtIndex(tree.currentIndex); isFirst = selectedNode == selectedNode.parentNode.firstChild isLast = selectedNode == selectedNode.parentNode.lastChild } // up /\ button if (numSelected != 1 || isFirst) { up.setAttribute('disabled', 'true'); } else { up.removeAttribute('disabled'); } // down \/ button if (numSelected != 1 || isLast) { down.setAttribute('disabled', 'true'); } else { down.removeAttribute('disabled'); } // "Customize..." button var customizeURL = null; if (numSelected == 1) { customizeURL = selectedNode.getAttribute('customize'); } if (customizeURL == null || customizeURL == '') { customize.setAttribute('disabled','true'); } else { customize.removeAttribute('disabled'); } // "Remove" button if (numSelected == 0) { remove.setAttribute('disabled','true'); } else { remove.removeAttribute('disabled'); }}
if (numSelected != 1 || isFirst) { up.setAttribute('disabled', 'true'); } else { up.removeAttribute('disabled'); } if (numSelected != 1 || isLast) { down.setAttribute('disabled', 'true'); } else { down.removeAttribute('disabled'); } var customizeURL = null; if (numSelected == 1) { customizeURL = selectedNode.getAttribute('customize'); } if (customizeURL == null || customizeURL == '') { customize.setAttribute('disabled','true'); } else { customize.removeAttribute('disabled'); } if (numSelected == 0) { remove.setAttribute('disabled','true'); } else { remove.removeAttribute('disabled'); }
up.disabled = !canMoveUp; down.disabled = !canMoveDown; customize.disabled = !customizeURL; remove.disabled = !numSelected;
function enable_buttons_for_current_panels() { var up = document.getElementById('up'); var down = document.getElementById('down'); var tree = document.getElementById('current-panels'); var customize = document.getElementById('customize-button'); var remove = document.getElementById('remove-button'); var numSelected = tree.treeBoxObject.selection ? tree.treeBoxObject.selection.count : 0; var noneSelected, isFirst, isLast, selectedNode if (numSelected > 0) { selectedNode = tree.contentView.getItemAtIndex(tree.currentIndex); isFirst = selectedNode == selectedNode.parentNode.firstChild isLast = selectedNode == selectedNode.parentNode.lastChild } // up /\ button if (numSelected != 1 || isFirst) { up.setAttribute('disabled', 'true'); } else { up.removeAttribute('disabled'); } // down \/ button if (numSelected != 1 || isLast) { down.setAttribute('disabled', 'true'); } else { down.removeAttribute('disabled'); } // "Customize..." button var customizeURL = null; if (numSelected == 1) { customizeURL = selectedNode.getAttribute('customize'); } if (customizeURL == null || customizeURL == '') { customize.setAttribute('disabled','true'); } else { customize.removeAttribute('disabled'); } // "Remove" button if (numSelected == 0) { remove.setAttribute('disabled','true'); } else { remove.removeAttribute('disabled'); }}
var sel = all_panels.treeBoxObject.selection;
var sel = all_panels.view.selection;
function enable_buttons_for_other_panels(){ var add_button = document.getElementById('add_button'); var preview_button = document.getElementById('preview_button'); var all_panels = document.getElementById('other-panels'); var sel = all_panels.treeBoxObject.selection; var num_selected = sel ? sel.count : 0; if (sel) { var ranges = sel.getRangeCount(); for (var range = 0; range < ranges; ++range) { var min = {}, max = {}; sel.getRangeAt(range, min, max); for (var index = min; index <= max; ++index) { var node = all_panels.contentView.getItemAtIndex(index); if (node.getAttribute('container') != 'true') { ++num_selected; } } } } if (num_selected > 0) { add_button.removeAttribute('disabled'); preview_button.removeAttribute('disabled'); } else { add_button.setAttribute('disabled','true'); preview_button.setAttribute('disabled','true'); }}
var save_button = document.getElementById('ok');
var save_button = document.documentElement.getButton("accept");
function enable_save(){ var save_button = document.getElementById('ok'); save_button.removeAttribute('disabled');}
while (column_node) {
while (column_node && menuitem) {
function enable_sort_menuitems() { var columns = document.getElementById('theColumns'); var column_node = columns.firstChild; var head = document.getElementById('headRow'); var tree_column = head.firstChild; var skip_column = document.getElementById('popupCell'); var menuitem = document.getElementById('fill_after_this_node'); menuitem = menuitem.nextSibling while (column_node) { if (skip_column != tree_column) { if ("true" == column_node.getAttribute("hidden")) { menuitem.setAttribute("disabled", "true"); } else { menuitem.removeAttribute("disabled"); } } menuitem = menuitem.nextSibling; tree_column = tree_column.nextSibling; column_node = column_node.nextSibling; if (column_node && column_node.tagName == "splitter") column_node = column_node.nextSibling; }}
var autocompleteSkipDirectory = document.getElementById("autocompleteSkipDirectory");
function enableAutocomplete(){ var autocompleteLDAP = document.getElementById("autocompleteLDAP"); var directoriesList = document.getElementById("directoriesList"); var directoriesListPopup = document.getElementById("directoriesListPopup"); var editButton = document.getElementById("editButton"); var autocompleteSkipDirectory = document.getElementById("autocompleteSkipDirectory"); if (autocompleteLDAP.checked) { directoriesList.removeAttribute("disabled"); directoriesListPopup.removeAttribute("disabled"); editButton.removeAttribute("disabled"); autocompleteSkipDirectory.removeAttribute("disabled"); } else { directoriesList.setAttribute("disabled", true); directoriesListPopup.setAttribute("disabled", true); editButton.setAttribute("disabled", true); autocompleteSkipDirectory.setAttribute("disabled", true); } gFromGlobalPref = true; LoadDirectories(directoriesListPopup);}
autocompleteSkipDirectory.removeAttribute("disabled");
function enableAutocomplete(){ var autocompleteLDAP = document.getElementById("autocompleteLDAP"); var directoriesList = document.getElementById("directoriesList"); var directoriesListPopup = document.getElementById("directoriesListPopup"); var editButton = document.getElementById("editButton"); var autocompleteSkipDirectory = document.getElementById("autocompleteSkipDirectory"); if (autocompleteLDAP.checked) { directoriesList.removeAttribute("disabled"); directoriesListPopup.removeAttribute("disabled"); editButton.removeAttribute("disabled"); autocompleteSkipDirectory.removeAttribute("disabled"); } else { directoriesList.setAttribute("disabled", true); directoriesListPopup.setAttribute("disabled", true); editButton.setAttribute("disabled", true); autocompleteSkipDirectory.setAttribute("disabled", true); } gFromGlobalPref = true; LoadDirectories(directoriesListPopup);}
autocompleteSkipDirectory.setAttribute("disabled", true);
function enableAutocomplete(){ var autocompleteLDAP = document.getElementById("autocompleteLDAP"); var directoriesList = document.getElementById("directoriesList"); var directoriesListPopup = document.getElementById("directoriesListPopup"); var editButton = document.getElementById("editButton"); var autocompleteSkipDirectory = document.getElementById("autocompleteSkipDirectory"); if (autocompleteLDAP.checked) { directoriesList.removeAttribute("disabled"); directoriesListPopup.removeAttribute("disabled"); editButton.removeAttribute("disabled"); autocompleteSkipDirectory.removeAttribute("disabled"); } else { directoriesList.setAttribute("disabled", true); directoriesListPopup.setAttribute("disabled", true); editButton.setAttribute("disabled", true); autocompleteSkipDirectory.setAttribute("disabled", true); } gFromGlobalPref = true; LoadDirectories(directoriesListPopup);}
gFromGlobalPref = true;
function enableAutocomplete(){ var autocompleteLDAP = document.getElementById("autocompleteLDAP"); var directoriesList = document.getElementById("directoriesList"); var directoriesListPopup = document.getElementById("directoriesListPopup"); var editButton = document.getElementById("editButton");// var autocompleteSkipDirectory = document.getElementById("autocompleteSkipDirectory"); if (autocompleteLDAP.checked) { // If the default directory preference is locked // disable the list popup if (gPrefInt.prefIsLocked("ldap_2.autoComplete.directoryServer")) { directoriesList.setAttribute("disabled", true); directoriesListPopup.setAttribute("disabled", true); } else { directoriesList.removeAttribute("disabled"); directoriesListPopup.removeAttribute("disabled"); } editButton.removeAttribute("disabled");// autocompleteSkipDirectory.removeAttribute("disabled"); } else { directoriesList.setAttribute("disabled", true); directoriesListPopup.setAttribute("disabled", true); editButton.setAttribute("disabled", true);// autocompleteSkipDirectory.setAttribute("disabled", true); } // if we do not have any directories disable the dropdown list box if (!gAvailDirectories || (gAvailDirectories.length < 1)) directoriesList.setAttribute("disabled", true); gFromGlobalPref = true; LoadDirectories(directoriesListPopup);}
if (navigator.platform.indexOf("Mac") > 0) {
if (navigator.platform.indexOf("Mac") == -1) {
function EnableBusyCursor(doEnable){ if (doEnable) { // set the spinning cursor everywhere but mac, we have our own way to // do this thankyouverymuch. if (navigator.platform.indexOf("Mac") > 0) { setCursor("spinning"); _content.setCursor("spinning"); } } else { setCursor("auto"); _content.setCursor("auto"); }}
window._content.setCursor("spinning");
_content.setCursor("spinning");
function EnableBusyCursor(doEnable) { if (doEnable) { // set the spinning cursor everywhere but mac, we have our own way to // do this thankyouverymuch. if ( navigator.platform.indexOf("Mac") > 0 ) { window.setCursor("spinning"); window._content.setCursor("spinning"); } } else { window.setCursor("auto"); window._content.setCursor("auto"); }}
window._content.setCursor("auto");
_content.setCursor("auto");
function EnableBusyCursor(doEnable) { if (doEnable) { // set the spinning cursor everywhere but mac, we have our own way to // do this thankyouverymuch. if ( navigator.platform.indexOf("Mac") > 0 ) { window.setCursor("spinning"); window._content.setCursor("spinning"); } } else { window.setCursor("auto"); window._content.setCursor("auto"); }}
up.setAttribute('disabled', '');
up.removeAttribute('disabled');
function enableButtonsForCurrentPanels() { var up = document.getElementById('up'); var down = document.getElementById('down'); var tree = document.getElementById('current-panels'); var customize = document.getElementById('customize-button'); var remove = document.getElementById('remove-button'); var numSelected = tree.selectedItems.length; var noneSelected, isFirst, isLast, selectedNode if (numSelected > 0) { selectedNode = tree.selectedItems[0] isFirst = selectedNode == selectedNode.parentNode.firstChild isLast = selectedNode == selectedNode.parentNode.lastChild } // up /\ button if (numSelected != 1 || isFirst) { up.setAttribute('disabled', 'true'); } else { up.setAttribute('disabled', ''); } // down \/ button if (numSelected != 1 || isLast) { down.setAttribute('disabled', 'true'); } else { down.setAttribute('disabled', ''); } // "Customize..." button var customizeURL = null; if (numSelected == 1) { customizeURL = selectedNode.getAttribute('customize'); } if (customizeURL == null || customizeURL == '') { customize.setAttribute('disabled','true'); } else { customize.setAttribute('disabled',''); } // "Remove" button if (numSelected == 0) { remove.setAttribute('disabled','true'); } else { remove.setAttribute('disabled',''); }}
down.setAttribute('disabled', '');
down.removeAttribute('disabled');
function enableButtonsForCurrentPanels() { var up = document.getElementById('up'); var down = document.getElementById('down'); var tree = document.getElementById('current-panels'); var customize = document.getElementById('customize-button'); var remove = document.getElementById('remove-button'); var numSelected = tree.selectedItems.length; var noneSelected, isFirst, isLast, selectedNode if (numSelected > 0) { selectedNode = tree.selectedItems[0] isFirst = selectedNode == selectedNode.parentNode.firstChild isLast = selectedNode == selectedNode.parentNode.lastChild } // up /\ button if (numSelected != 1 || isFirst) { up.setAttribute('disabled', 'true'); } else { up.setAttribute('disabled', ''); } // down \/ button if (numSelected != 1 || isLast) { down.setAttribute('disabled', 'true'); } else { down.setAttribute('disabled', ''); } // "Customize..." button var customizeURL = null; if (numSelected == 1) { customizeURL = selectedNode.getAttribute('customize'); } if (customizeURL == null || customizeURL == '') { customize.setAttribute('disabled','true'); } else { customize.setAttribute('disabled',''); } // "Remove" button if (numSelected == 0) { remove.setAttribute('disabled','true'); } else { remove.setAttribute('disabled',''); }}
customize.setAttribute('disabled','');
customize.removeAttribute('disabled');
function enableButtonsForCurrentPanels() { var up = document.getElementById('up'); var down = document.getElementById('down'); var tree = document.getElementById('current-panels'); var customize = document.getElementById('customize-button'); var remove = document.getElementById('remove-button'); var numSelected = tree.selectedItems.length; var noneSelected, isFirst, isLast, selectedNode if (numSelected > 0) { selectedNode = tree.selectedItems[0] isFirst = selectedNode == selectedNode.parentNode.firstChild isLast = selectedNode == selectedNode.parentNode.lastChild } // up /\ button if (numSelected != 1 || isFirst) { up.setAttribute('disabled', 'true'); } else { up.setAttribute('disabled', ''); } // down \/ button if (numSelected != 1 || isLast) { down.setAttribute('disabled', 'true'); } else { down.setAttribute('disabled', ''); } // "Customize..." button var customizeURL = null; if (numSelected == 1) { customizeURL = selectedNode.getAttribute('customize'); } if (customizeURL == null || customizeURL == '') { customize.setAttribute('disabled','true'); } else { customize.setAttribute('disabled',''); } // "Remove" button if (numSelected == 0) { remove.setAttribute('disabled','true'); } else { remove.setAttribute('disabled',''); }}
remove.setAttribute('disabled','');
remove.removeAttribute('disabled');
function enableButtonsForCurrentPanels() { var up = document.getElementById('up'); var down = document.getElementById('down'); var tree = document.getElementById('current-panels'); var customize = document.getElementById('customize-button'); var remove = document.getElementById('remove-button'); var numSelected = tree.selectedItems.length; var noneSelected, isFirst, isLast, selectedNode if (numSelected > 0) { selectedNode = tree.selectedItems[0] isFirst = selectedNode == selectedNode.parentNode.firstChild isLast = selectedNode == selectedNode.parentNode.lastChild } // up /\ button if (numSelected != 1 || isFirst) { up.setAttribute('disabled', 'true'); } else { up.setAttribute('disabled', ''); } // down \/ button if (numSelected != 1 || isLast) { down.setAttribute('disabled', 'true'); } else { down.setAttribute('disabled', ''); } // "Customize..." button var customizeURL = null; if (numSelected == 1) { customizeURL = selectedNode.getAttribute('customize'); } if (customizeURL == null || customizeURL == '') { customize.setAttribute('disabled','true'); } else { customize.setAttribute('disabled',''); } // "Remove" button if (numSelected == 0) { remove.setAttribute('disabled','true'); } else { remove.setAttribute('disabled',''); }}
add_button.setAttribute('disabled',''); preview_button.setAttribute('disabled','');
add_button.removeAttribute('disabled'); preview_button.removeAttribute('disabled');
function enableButtonsForOtherPanels(){ var add_button = document.getElementById('add_button'); var preview_button = document.getElementById('preview_button'); var all_panels = document.getElementById('other-panels'); var num_selected = 0; // Only count non-folders as selected for button enabling for (var ii=0; ii<all_panels.selectedItems.length; ii++) { var node = all_panels.selectedItems[ii]; if (node.getAttribute('container') != 'true') { num_selected++; } } if (num_selected > 0) { add_button.setAttribute('disabled',''); preview_button.setAttribute('disabled',''); } else { add_button.setAttribute('disabled','true'); preview_button.setAttribute('disabled','true'); }}
if (receiptSend && (receiptSend.getAttribute("value") == 0)) {
if (receiptSend && (receiptSend.getAttribute("value") == "false")) {
function EnableDisableAllowedReceipts() { if (receiptSend && (receiptSend.getAttribute("value") == 0)) { notInToCcPref.setAttribute("disabled", "true"); notInToCcLabel.setAttribute("disabled", "true"); outsideDomainPref.setAttribute("disabled", "true"); outsideDomainLabel.setAttribute("disabled", "true"); otherCasesPref.setAttribute("disabled", "true"); otherCasesLabel.setAttribute("disabled", "true"); } else { notInToCcPref.removeAttribute("disabled"); notInToCcLabel.removeAttribute("disabled"); outsideDomainPref.removeAttribute("disabled"); outsideDomainLabel.removeAttribute("disabled"); otherCasesPref.removeAttribute("disabled"); otherCasesLabel.removeAttribute("disabled"); } return true;}
if (!neverReturn.getAttribute("disabled") && (receiptSend.getAttribute("value") != 0)) {
if (!neverReturn.getAttribute("disabled") && (receiptSend.getAttribute("value") != "false")) {
function EnableDisableAllowedReceipts() { if (receiptSend) { if (!neverReturn.getAttribute("disabled") && (receiptSend.getAttribute("value") != 0)) { notInToCcPref.removeAttribute("disabled"); notInToCcLabel.removeAttribute("disabled"); outsideDomainPref.removeAttribute("disabled"); outsideDomainLabel.removeAttribute("disabled"); otherCasesPref.removeAttribute("disabled"); otherCasesLabel.removeAttribute("disabled"); } else { notInToCcPref.setAttribute("disabled", "true"); notInToCcLabel.setAttribute("disabled", "true"); outsideDomainPref.setAttribute("disabled", "true"); outsideDomainLabel.setAttribute("disabled", "true"); otherCasesPref.setAttribute("disabled", "true"); otherCasesLabel.setAttribute("disabled", "true"); } } return true;}
if (useCustomPrefs && (useCustomPrefs.getAttribute("value") == 0)) {
if (useCustomPrefs && (useCustomPrefs.getAttribute("value") == "false")) {
function EnableDisableCustomSettings() { if (useCustomPrefs && (useCustomPrefs.getAttribute("value") == 0)) { requestReceipt.setAttribute("disabled", "true"); leaveInInbox.setAttribute("disabled", "true"); moveToSent.setAttribute("disabled", "true"); neverReturn.setAttribute("disabled", "true"); returnSome.setAttribute("disabled", "true"); receiptArriveLabel.setAttribute("disabled", "true"); receiptRequestLabel.setAttribute("disabled", "true"); } else { requestReceipt.removeAttribute("disabled"); leaveInInbox.removeAttribute("disabled"); moveToSent.removeAttribute("disabled"); neverReturn.removeAttribute("disabled"); returnSome.removeAttribute("disabled"); receiptArriveLabel.removeAttribute("disabled"); receiptRequestLabel.removeAttribute("disabled"); } EnableDisableAllowedReceipts(); return true;}
onLockPreference("mail.identity", gIdentity.key); onLockPreference("mail.server", gIncomingServer.key);
function EnableDisableCustomSettings() { if (useCustomPrefs && (useCustomPrefs.getAttribute("value") == "false")) { requestReceipt.setAttribute("disabled", "true"); leaveInInbox.setAttribute("disabled", "true"); moveToSent.setAttribute("disabled", "true"); neverReturn.setAttribute("disabled", "true"); returnSome.setAttribute("disabled", "true"); receiptArriveLabel.setAttribute("disabled", "true"); receiptRequestLabel.setAttribute("disabled", "true"); } else { requestReceipt.removeAttribute("disabled"); leaveInInbox.removeAttribute("disabled"); moveToSent.removeAttribute("disabled"); neverReturn.removeAttribute("disabled"); returnSome.removeAttribute("disabled"); receiptArriveLabel.removeAttribute("disabled"); receiptRequestLabel.removeAttribute("disabled"); } EnableDisableAllowedReceipts(); return true;}
editorShell.editor.SetFlags(nsIPlaintextEditor.eEditorMailMask);
var flags = new Object; editorShell.editor.GetFlags(flags); editorShell.editor.SetFlags(flags.value ^ nsIPlaintextEditor.eEditorReadonlyMask);
function enableEditableFields(){ editorShell.editor.SetFlags(nsIPlaintextEditor.eEditorMailMask); var enableElements = document.getElementsByAttribute("disableonsend", "true"); for (i=0;i<enableElements.length;i++) { enableElements[i].removeAttribute('disabled'); }}
var enabled = (item.getAttribute('disabled') !='true'); if(item && (enableItem != enabled))
if(item)
function EnableMenuItem(id, enableItem){ var item = document.getElementById(id); var enabled = (item.getAttribute('disabled') !='true'); if(item && (enableItem != enabled)) { item.setAttribute('disabled', enableItem ? '' : 'true'); }}
item.setAttribute('disabled', enableItem ? '' : 'true');
var enabled = (item.getAttribute('disabled') !='true'); if(enableItem != enabled) { item.setAttribute('disabled', enableItem ? '' : 'true'); }
function EnableMenuItem(id, enableItem){ var item = document.getElementById(id); var enabled = (item.getAttribute('disabled') !='true'); if(item && (enableItem != enabled)) { item.setAttribute('disabled', enableItem ? '' : 'true'); }}
save_button.setAttribute('disabled','');
if (list_unchanged) { save_button.setAttribute('disabled','true'); } else { save_button.setAttribute('disabled',''); }
function enableSave() { var save_button = document.getElementById('save_button'); save_button.setAttribute('disabled',''); }
save_button.setAttribute('disabled','');
save_button.removeAttribute('disabled');
function enableSave() { debug("in enableSave()"); var root = document.getElementById('current-panels-root'); var panels = root.childNodes; var list_unchanged = (panels.length == original_panels.length); debug ("panels.length="+panels.length); debug ("orig.length="+original_panels.length); for (var ii = 0; ii < panels.length && list_unchanged; ii++) { //node = root.firstChild; node != null; node = node.nextSibling) { debug("orig="+original_panels[ii]); debug(" new="+panels.item(ii).getAttribute('id')); debug("orig.length="+original_panels.length+" ii="+ii); if (original_panels[ii] != panels.item(ii).getAttribute('id')) { list_unchanged = false; } } var save_button = document.getElementById('save_button'); if (list_unchanged) { save_button.setAttribute('disabled','true'); } else { save_button.setAttribute('disabled',''); }}
gFromGlobalPref = false;
function enabling(){ var autocomplete = document.getElementById("ldapAutocomplete"); var directoriesList = document.getElementById("directoriesList"); var directoriesListPopup = document.getElementById("directoriesListPopup"); var editButton = document.getElementById("editButton"); // this is the hidden text element that assigned a value from the prefs var overrideGlobalPref = document.getElementById("identity.overrideGlobalPref"); switch(autocomplete.value) { case "0": directoriesList.setAttribute("disabled", true); directoriesListPopup.setAttribute("disabled", true); editButton.setAttribute("disabled", true); break; case "1": directoriesList.removeAttribute("disabled"); directoriesListPopup.removeAttribute("disabled"); editButton.removeAttribute("disabled"); break; } if (!gPrefInt) { gPrefInt = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch); } // If the default per-identity directory preferences are locked // disable the corresponding elements. if (gIdentity && gPrefInt.prefIsLocked("mail.identity." + gIdentity.key + ".overrideGlobal_Pref")) { document.getElementById("useGlobalPref").setAttribute("disabled", "true"); document.getElementById("directories").setAttribute("disabled", "true"); } else { document.getElementById("useGlobalPref").removeAttribute("disabled"); document.getElementById("directories").removeAttribute("disabled"); } if (gIdentity && gPrefInt.prefIsLocked("mail.identity." + gIdentity.key + ".directoryServer")) { document.getElementById("directoriesList").setAttribute("disabled", "true"); document.getElementById("directoriesListPopup").setAttribute("disabled", "true"); } gFromGlobalPref = false; LoadDirectories(directoriesListPopup);}
s = DWREngine._utf8(s); var c; var enc = ""; for (var i= 0; i<s.length; i++) { if (DWREngine._okURIchars.indexOf(s.charAt(i)) == -1) { enc += "%" + DWREngine._toHex(s.charCodeAt(i)); } else { enc += s.charAt(i); } } return enc;
s = DWREngine._utf8(s); var c; var enc = ""; for (var i= 0; i<s.length; i++) { if (DWREngine._okURIchars.indexOf(s.charAt(i)) == -1) { enc += "%" + DWREngine._toHex(s.charCodeAt(i)); } else { enc += s.charAt(i); }
window.encodeURIComponent = function(s) { s = DWREngine._utf8(s); var c; var enc = ""; for (var i= 0; i<s.length; i++) { if (DWREngine._okURIchars.indexOf(s.charAt(i)) == -1) { enc += "%" + DWREngine._toHex(s.charCodeAt(i)); } else { enc += s.charAt(i); } } return enc; }
return enc; }
window.encodeURIComponent = function(s) { s = DWREngine._utf8(s); var c; var enc = ""; for (var i= 0; i<s.length; i++) { if (DWREngine._okURIchars.indexOf(s.charAt(i)) == -1) { enc += "%" + DWREngine._toHex(s.charCodeAt(i)); } else { enc += s.charAt(i); } } return enc; }
s = s.replace(/^+/gi, "^1"); s = s.replace(/\|+/gi, "^2");
s = s.replace(/\^/g, "^1"); s = s.replace(/\|/g, "^2");
function EncodeVerticalBars(s) { s = s.replace(/^+/gi, "^1"); s = s.replace(/\|+/gi, "^2"); return s;}
return this.get( this.stack.pop() );
return this.set( this.stack.pop() );
end: function() { if( !(this.stack && this.stack.length) ) return this; return this.get( this.stack.pop() ); },
if (!batch.asynch) batch.verb = DWREngine._asynch;
DWREngine.endBatch = function() { var batch = DWREngine._batch; if (batch == null) { DWREngine._handleError("No batch in progress."); return; } // Merge the global batch level properties into the batch meta data if (!batch.preHook) batch.preHook = DWREngine._preHook; if (!batch.postHook) batch.postHook = DWREngine._postHook; if (!batch.method) batch.method = DWREngine._method; if (!batch.verb) batch.verb = DWREngine._verb; // If we are in ordered mode, then we don't send unless the list of sent // items is empty if (!DWREngine._ordered) { DWREngine._sendData(batch); DWREngine._batches[DWREngine._batches.length] = batch; } else { if (DWREngine._batches.length == 0) { // We aren't waiting for anything, go now. DWREngine._sendData(batch); DWREngine._batches[DWREngine._batches.length] = batch; } else { // Push the batch onto the waiting queue DWREngine._batchQueue[DWREngine._batchQueue.length] = batch; } } DWREngine._batch = null;};
DWREngine._batches[DWREngine._batches.length] = batch;
DWREngine.endBatch = function(options) { var batch = DWREngine._batch; if (batch == null) { DWREngine._handleError("No batch in progress."); return; } // Merge the global batch level properties into the batch meta data if (options && options.preHook) batch.preHooks.unshift(options.preHook); if (options && options.postHook) batch.postHooks.push(options.postHook); if (DWREngine._preHook) batch.preHooks.unshift(DWREngine._preHook); if (DWREngine._postHook) batch.postHooks.push(DWREngine._postHook); if (batch.method == null) batch.method = DWREngine._method; if (batch.verb == null) batch.verb = DWREngine._verb; if (batch.async == null) batch.async = DWREngine._async; if (batch.timeout == null) batch.timeout = DWREngine._timeout; batch.completed = false; // We are about to send so this batch should not be globally visible DWREngine._batch = null; // If we are in ordered mode, then we don't send unless the list of sent // items is empty if (!DWREngine._ordered) { DWREngine._sendData(batch); DWREngine._batches[DWREngine._batches.length] = batch; } else { if (DWREngine._batches.length == 0) { // We aren't waiting for anything, go now. DWREngine._sendData(batch); DWREngine._batches[DWREngine._batches.length] = batch; } else { // Push the batch onto the waiting queue DWREngine._batchQueue[DWREngine._batchQueue.length] = batch; } }};
batch.completed = false; DWREngine._batch = null; if (batch.map.callCount == 0) return;
DWREngine.endBatch = function(options) { if (options == null) options = {}; var batch = DWREngine._batch; if (batch == null) { DWREngine._handleError(null, { name:"dwrengine.batchNotBegun", message:"No batch in progress" }); return; } // The hooks need to be merged carefully to preserve ordering if (options && options.preHook) batch.preHooks.unshift(options.preHook); if (options && options.postHook) batch.postHooks.push(options.postHook); if (DWREngine._preHook) batch.preHooks.unshift(DWREngine._preHook); if (DWREngine._postHook) batch.postHooks.push(DWREngine._postHook); // Other props. priority: batch, call, global - the order in which they were set var propname; for (var i = 0; i < DWREngine._propnames.length; i++) { propname = DWREngine._propnames[i]; if (options[propname] != null) batch[propname] = options[propname]; if (batch[propname] == null) batch[propname] = DWREngine["_" + propname]; } batch.completed = false; // We are about to send so this batch should not be globally visible DWREngine._batch = null; if (batch.map.callCount == 0) return; // In ordered mode, we don't send unless the list of sent items is empty if (DWREngine._ordered && DWREngine._batches.length != 0) { DWREngine._batchQueue[DWREngine._batchQueue.length] = batch; } else { DWREngine._batches[DWREngine._batches.length] = batch; DWREngine._sendData(batch); }};
if (DWREngine._ordered && DWREngine._batches.length != 0) {
if (DWREngine._ordered && DWREngine._batchesLength != 0) {
DWREngine.endBatch = function(options) { if (options == null) options = {}; var batch = DWREngine._batch; if (batch == null) { DWREngine._handleError(null, { name:"dwrengine.batchNotBegun", message:"No batch in progress" }); return; } // The hooks need to be merged carefully to preserve ordering if (options && options.preHook) batch.preHooks.unshift(options.preHook); if (options && options.postHook) batch.postHooks.push(options.postHook); if (DWREngine._preHook) batch.preHooks.unshift(DWREngine._preHook); if (DWREngine._postHook) batch.postHooks.push(DWREngine._postHook); // Other props. priority: batch, call, global - the order in which they were set var propname; for (var i = 0; i < DWREngine._propnames.length; i++) { propname = DWREngine._propnames[i]; if (options[propname] != null) batch[propname] = options[propname]; if (batch[propname] == null) batch[propname] = DWREngine["_" + propname]; } batch.completed = false; // We are about to send so this batch should not be globally visible DWREngine._batch = null; if (batch.map.callCount == 0) return; // In ordered mode, we don't send unless the list of sent items is empty if (DWREngine._ordered && DWREngine._batches.length != 0) { DWREngine._batchQueue[DWREngine._batchQueue.length] = batch; } else { DWREngine._batches[DWREngine._batches.length] = batch; DWREngine._sendData(batch); }};
DWREngine._batches[DWREngine._batches.length] = batch;
DWREngine.endBatch = function(options) { if (options == null) options = {}; var batch = DWREngine._batch; if (batch == null) { DWREngine._handleError(null, { name:"dwrengine.batchNotBegun", message:"No batch in progress" }); return; } // The hooks need to be merged carefully to preserve ordering if (options && options.preHook) batch.preHooks.unshift(options.preHook); if (options && options.postHook) batch.postHooks.push(options.postHook); if (DWREngine._preHook) batch.preHooks.unshift(DWREngine._preHook); if (DWREngine._postHook) batch.postHooks.push(DWREngine._postHook); // Other props. priority: batch, call, global - the order in which they were set var propname; for (var i = 0; i < DWREngine._propnames.length; i++) { propname = DWREngine._propnames[i]; if (options[propname] != null) batch[propname] = options[propname]; if (batch[propname] == null) batch[propname] = DWREngine["_" + propname]; } batch.completed = false; // We are about to send so this batch should not be globally visible DWREngine._batch = null; if (batch.map.callCount == 0) return; // In ordered mode, we don't send unless the list of sent items is empty if (DWREngine._ordered && DWREngine._batches.length != 0) { DWREngine._batchQueue[DWREngine._batchQueue.length] = batch; } else { DWREngine._batches[DWREngine._batches.length] = batch; DWREngine._sendData(batch); }};
if (!batch.errorHandler) batch.errorHandler = DWREngine._errorHandler; if (!batch.warningHandler) batch.warningHandler = DWREngine._warningHandler; if (!batch.timeout) batch.timeout = DWREngine._timeout;
DWREngine.endBatch = function() { var batch = DWREngine._batch; if (batch == null) { DWREngine._handleError("No batch in progress."); return; } // Merge the global batch level properties into the batch meta data if (!batch.preHook) batch.preHook = DWREngine._preHook; if (!batch.postHook) batch.postHook = DWREngine._postHook; if (!batch.method) batch.method = DWREngine._method; if (!batch.verb) batch.verb = DWREngine._verb; if (!batch.asynchronous) batch.asynchronous = DWREngine._asynchronous; // If we are in ordered mode, then we don't send unless the list of sent // items is empty if (!DWREngine._ordered) { DWREngine._sendData(batch); DWREngine._batches[DWREngine._batches.length] = batch; } else { if (DWREngine._batches.length == 0) { // We aren't waiting for anything, go now. DWREngine._sendData(batch); DWREngine._batches[DWREngine._batches.length] = batch; } else { // Push the batch onto the waiting queue DWREngine._batchQueue[DWREngine._batchQueue.length] = batch; } } DWREngine._batch = null;};
if (!batch.errorHandler) batch.errorHandler = DWREngine._errorHandler; if (!batch.warningHandler) batch.warningHandler = DWREngine._warningHandler; if (!batch.timeout) batch.timeout = DWREngine._timeout;
DWREngine.endBatch = function() { var batch = DWREngine._batch; if (batch == null) { DWREngine._handleError("No batch in progress."); return; } // Merge the global batch level properties into the batch meta data if (!batch.preHook) batch.preHook = DWREngine._preHook; if (!batch.postHook) batch.postHook = DWREngine._postHook; if (!batch.method) batch.method = DWREngine._method; if (!batch.verb) batch.verb = DWREngine._verb; if (!batch.asynchronous) batch.asynchronous = DWREngine._asynchronous; if (!batch.errorHandler) batch.errorHandler = DWREngine._errorHandler; if (!batch.warningHandler) batch.warningHandler = DWREngine._warningHandler; if (!batch.timeout) batch.timeout = DWREngine._timeout; // If we are in ordered mode, then we don't send unless the list of sent // items is empty if (!DWREngine._ordered) { DWREngine._sendData(batch); DWREngine._batches[DWREngine._batches.length] = batch; } else { if (DWREngine._batches.length == 0) { // We aren't waiting for anything, go now. DWREngine._sendData(batch); DWREngine._batches[DWREngine._batches.length] = batch; } else { // Push the batch onto the waiting queue DWREngine._batchQueue[DWREngine._batchQueue.length] = batch; } } DWREngine._batch = null;};
if (!DWREngine._ordered) { DWREngine._sendData(batch); DWREngine._batches[DWREngine._batches.length] = batch;
if (!DWREngine._ordered) { DWREngine._sendData(batch); DWREngine._batches[DWREngine._batches.length] = batch; } else { if (DWREngine._batches.length == 0) { DWREngine._sendData(batch); DWREngine._batches[DWREngine._batches.length] = batch;
DWREngine.endBatch = function() { var batch = DWREngine._batch; if (batch == null) { DWREngine._handleError("No batch in progress."); return; } // Merge the global batch level properties into the batch meta data if (!batch.preHook) batch.preHook = DWREngine._preHook; if (!batch.postHook) batch.postHook = DWREngine._postHook; if (!batch.method) batch.method = DWREngine._method; if (!batch.verb) batch.verb = DWREngine._verb; if (!batch.asynchronous) batch.asynchronous = DWREngine._asynchronous; // If we are in ordered mode, then we don't send unless the list of sent // items is empty if (!DWREngine._ordered) { DWREngine._sendData(batch); DWREngine._batches[DWREngine._batches.length] = batch; } else { if (DWREngine._batches.length == 0) { // We aren't waiting for anything, go now. DWREngine._sendData(batch); DWREngine._batches[DWREngine._batches.length] = batch; } else { // Push the batch onto the waiting queue DWREngine._batchQueue[DWREngine._batchQueue.length] = batch; } } DWREngine._batch = null;};
if (DWREngine._batches.length == 0) { DWREngine._sendData(batch); DWREngine._batches[DWREngine._batches.length] = batch; } else { DWREngine._batchQueue[DWREngine._batchQueue.length] = batch; }
DWREngine._batchQueue[DWREngine._batchQueue.length] = batch;
DWREngine.endBatch = function() { var batch = DWREngine._batch; if (batch == null) { DWREngine._handleError("No batch in progress."); return; } // Merge the global batch level properties into the batch meta data if (!batch.preHook) batch.preHook = DWREngine._preHook; if (!batch.postHook) batch.postHook = DWREngine._postHook; if (!batch.method) batch.method = DWREngine._method; if (!batch.verb) batch.verb = DWREngine._verb; if (!batch.asynchronous) batch.asynchronous = DWREngine._asynchronous; // If we are in ordered mode, then we don't send unless the list of sent // items is empty if (!DWREngine._ordered) { DWREngine._sendData(batch); DWREngine._batches[DWREngine._batches.length] = batch; } else { if (DWREngine._batches.length == 0) { // We aren't waiting for anything, go now. DWREngine._sendData(batch); DWREngine._batches[DWREngine._batches.length] = batch; } else { // Push the batch onto the waiting queue DWREngine._batchQueue[DWREngine._batchQueue.length] = batch; } } DWREngine._batch = null;};
DWREngine.endBatch = function() {
DWREngine.endBatch = function(options) {
DWREngine.endBatch = function() { var batch = DWREngine._batch; if (batch == null) { DWREngine._handleError("No batch in progress."); return; } // Merge the global batch level properties into the batch meta data if (!batch.preHook) batch.preHook = DWREngine._preHook; if (!batch.postHook) batch.postHook = DWREngine._postHook; if (!batch.method) batch.method = DWREngine._method; if (!batch.verb) batch.verb = DWREngine._verb; if (!batch.asynchronous) batch.asynchronous = DWREngine._asynchronous; // If we are in ordered mode, then we don't send unless the list of sent // items is empty if (!DWREngine._ordered) { DWREngine._sendData(batch); DWREngine._batches[DWREngine._batches.length] = batch; } else { if (DWREngine._batches.length == 0) { // We aren't waiting for anything, go now. DWREngine._sendData(batch); DWREngine._batches[DWREngine._batches.length] = batch; } else { // Push the batch onto the waiting queue DWREngine._batchQueue[DWREngine._batchQueue.length] = batch; } } DWREngine._batch = null;};
if (!batch.preHook) batch.preHook = DWREngine._preHook; if (!batch.postHook) batch.postHook = DWREngine._postHook;
if (options && options.preHook) batch.preHooks.unshift(options.preHook); if (options && options.postHook) batch.postHooks.push(options.postHook); if (DWREngine._preHook) batch.preHooks.unshift(DWREngine._preHook); if (DWREngine._postHook) batch.postHooks.push(DWREngine._postHook);
DWREngine.endBatch = function() { var batch = DWREngine._batch; if (batch == null) { DWREngine._handleError("No batch in progress."); return; } // Merge the global batch level properties into the batch meta data if (!batch.preHook) batch.preHook = DWREngine._preHook; if (!batch.postHook) batch.postHook = DWREngine._postHook; if (!batch.method) batch.method = DWREngine._method; if (!batch.verb) batch.verb = DWREngine._verb; if (!batch.asynchronous) batch.asynchronous = DWREngine._asynchronous; // If we are in ordered mode, then we don't send unless the list of sent // items is empty if (!DWREngine._ordered) { DWREngine._sendData(batch); DWREngine._batches[DWREngine._batches.length] = batch; } else { if (DWREngine._batches.length == 0) { // We aren't waiting for anything, go now. DWREngine._sendData(batch); DWREngine._batches[DWREngine._batches.length] = batch; } else { // Push the batch onto the waiting queue DWREngine._batchQueue[DWREngine._batchQueue.length] = batch; } } DWREngine._batch = null;};
batch.completed = false;
DWREngine.endBatch = function() { var batch = DWREngine._batch; if (batch == null) { DWREngine._handleError("No batch in progress."); return; } // Merge the global batch level properties into the batch meta data if (!batch.preHook) batch.preHook = DWREngine._preHook; if (!batch.postHook) batch.postHook = DWREngine._postHook; if (!batch.method) batch.method = DWREngine._method; if (!batch.verb) batch.verb = DWREngine._verb; if (!batch.asynchronous) batch.asynchronous = DWREngine._asynchronous; // If we are in ordered mode, then we don't send unless the list of sent // items is empty if (!DWREngine._ordered) { DWREngine._sendData(batch); DWREngine._batches[DWREngine._batches.length] = batch; } else { if (DWREngine._batches.length == 0) { // We aren't waiting for anything, go now. DWREngine._sendData(batch); DWREngine._batches[DWREngine._batches.length] = batch; } else { // Push the batch onto the waiting queue DWREngine._batchQueue[DWREngine._batchQueue.length] = batch; } } DWREngine._batch = null;};
DWREngine.endBatch = function() { if (DWREngine._batch == null) { if (DWREngine._errorHandler) { DWREngine._errorHandler("No batch in progress."); }
DWREngine.endBatch = function() { if (DWREngine._batch == null) { DWREngine._handleError("No batch in progress.");
DWREngine.endBatch = function(){ if (DWREngine._batch == null) { if (DWREngine._errorHandler) { DWREngine._errorHandler("No batch in progress."); } return; } // If we are in ordered mode, then we don't send unless the list of sent // items is empty if (!DWREngine._ordered) { DWREngine._sendData(DWREngine._batch); DWREngine._batches[DWREngine._batches.length] = DWREngine._batch; } else { if (DWREngine._batches.length == 0) { // We aren't waiting for anything, go now. DWREngine._sendData(DWREngine._batch); DWREngine._batches[DWREngine._batches.length] = DWREngine._batch; } else { // Push the batch onto the waiting queue DWREngine._batchQueue[DWREngine._batchQueue.length] = DWREngine._batch; } } DWREngine._batch = null;};
if (!batch.asynchronous) batch.verb = DWREngine._asynchronous;
if (!batch.asynchronous) batch.asynchronous = DWREngine._asynchronous;
DWREngine.endBatch = function() { var batch = DWREngine._batch; if (batch == null) { DWREngine._handleError("No batch in progress."); return; } // Merge the global batch level properties into the batch meta data if (!batch.preHook) batch.preHook = DWREngine._preHook; if (!batch.postHook) batch.postHook = DWREngine._postHook; if (!batch.method) batch.method = DWREngine._method; if (!batch.verb) batch.verb = DWREngine._verb; if (!batch.asynchronous) batch.verb = DWREngine._asynchronous; // If we are in ordered mode, then we don't send unless the list of sent // items is empty if (!DWREngine._ordered) { DWREngine._sendData(batch); DWREngine._batches[DWREngine._batches.length] = batch; } else { if (DWREngine._batches.length == 0) { // We aren't waiting for anything, go now. DWREngine._sendData(batch); DWREngine._batches[DWREngine._batches.length] = batch; } else { // Push the batch onto the waiting queue DWREngine._batchQueue[DWREngine._batchQueue.length] = batch; } } DWREngine._batch = null;};
if (!batch.method) batch.method = DWREngine._method; if (!batch.verb) batch.verb = DWREngine._verb; if (!batch.async) batch.async = DWREngine._async;
if (batch.method == null) batch.method = DWREngine._method; if (batch.verb == null) batch.verb = DWREngine._verb; if (batch.async == null) batch.async = DWREngine._async; if (batch.timeout == null) batch.timeout = DWREngine._timeout;
DWREngine.endBatch = function(options) { var batch = DWREngine._batch; if (batch == null) { DWREngine._handleError("No batch in progress."); return; } // Merge the global batch level properties into the batch meta data if (options && options.preHook) batch.preHooks.unshift(options.preHook); if (options && options.postHook) batch.postHooks.push(options.postHook); if (DWREngine._preHook) batch.preHooks.unshift(DWREngine._preHook); if (DWREngine._postHook) batch.postHooks.push(DWREngine._postHook); if (!batch.method) batch.method = DWREngine._method; if (!batch.verb) batch.verb = DWREngine._verb; if (!batch.async) batch.async = DWREngine._async; batch.completed = false; // We are about to send so this batch should not be globally visible DWREngine._batch = null; // If we are in ordered mode, then we don't send unless the list of sent // items is empty if (!DWREngine._ordered) { DWREngine._sendData(batch); DWREngine._batches[DWREngine._batches.length] = batch; } else { if (DWREngine._batches.length == 0) { // We aren't waiting for anything, go now. DWREngine._sendData(batch); DWREngine._batches[DWREngine._batches.length] = batch; } else { // Push the batch onto the waiting queue DWREngine._batchQueue[DWREngine._batchQueue.length] = batch; } }};
DWREngine.endBatch = function(options) {
dwr.engine.endBatch = function(options) {
DWREngine.endBatch = function(options) { if (options == null) options = {}; var batch = DWREngine._batch; if (batch == null) { DWREngine._handleError(null, { name:"dwrengine.batchNotBegun", message:"No batch in progress" }); return; } DWREngine._batch = null; if (batch.map.callCount == 0) return; // The hooks need to be merged carefully to preserve ordering if (options && options.preHook) batch.preHooks.unshift(options.preHook); if (options && options.postHook) batch.postHooks.push(options.postHook); if (DWREngine._preHook) batch.preHooks.unshift(DWREngine._preHook); if (DWREngine._postHook) batch.postHooks.push(DWREngine._postHook); // Other props. priority: batch, call, global - the order in which they were set var propname; for (var i = 0; i < DWREngine._propnames.length; i++) { propname = DWREngine._propnames[i]; if (options[propname] != null) batch[propname] = options[propname]; if (batch[propname] == null) batch[propname] = DWREngine["_" + propname]; } // In ordered mode, we don't send unless the list of sent items is empty if (DWREngine._ordered && DWREngine._batchesLength != 0) { DWREngine._batchQueue[DWREngine._batchQueue.length] = batch; } else { DWREngine._sendData(batch); }};
var batch = DWREngine._batch;
var batch = dwr.engine._batch;
DWREngine.endBatch = function(options) { if (options == null) options = {}; var batch = DWREngine._batch; if (batch == null) { DWREngine._handleError(null, { name:"dwrengine.batchNotBegun", message:"No batch in progress" }); return; } DWREngine._batch = null; if (batch.map.callCount == 0) return; // The hooks need to be merged carefully to preserve ordering if (options && options.preHook) batch.preHooks.unshift(options.preHook); if (options && options.postHook) batch.postHooks.push(options.postHook); if (DWREngine._preHook) batch.preHooks.unshift(DWREngine._preHook); if (DWREngine._postHook) batch.postHooks.push(DWREngine._postHook); // Other props. priority: batch, call, global - the order in which they were set var propname; for (var i = 0; i < DWREngine._propnames.length; i++) { propname = DWREngine._propnames[i]; if (options[propname] != null) batch[propname] = options[propname]; if (batch[propname] == null) batch[propname] = DWREngine["_" + propname]; } // In ordered mode, we don't send unless the list of sent items is empty if (DWREngine._ordered && DWREngine._batchesLength != 0) { DWREngine._batchQueue[DWREngine._batchQueue.length] = batch; } else { DWREngine._sendData(batch); }};
DWREngine._handleError(null, { name:"dwrengine.batchNotBegun", message:"No batch in progress" });
dwr.engine._handleError(null, { name:"dwr.engine.batchNotBegun", message:"No batch in progress" });
DWREngine.endBatch = function(options) { if (options == null) options = {}; var batch = DWREngine._batch; if (batch == null) { DWREngine._handleError(null, { name:"dwrengine.batchNotBegun", message:"No batch in progress" }); return; } DWREngine._batch = null; if (batch.map.callCount == 0) return; // The hooks need to be merged carefully to preserve ordering if (options && options.preHook) batch.preHooks.unshift(options.preHook); if (options && options.postHook) batch.postHooks.push(options.postHook); if (DWREngine._preHook) batch.preHooks.unshift(DWREngine._preHook); if (DWREngine._postHook) batch.postHooks.push(DWREngine._postHook); // Other props. priority: batch, call, global - the order in which they were set var propname; for (var i = 0; i < DWREngine._propnames.length; i++) { propname = DWREngine._propnames[i]; if (options[propname] != null) batch[propname] = options[propname]; if (batch[propname] == null) batch[propname] = DWREngine["_" + propname]; } // In ordered mode, we don't send unless the list of sent items is empty if (DWREngine._ordered && DWREngine._batchesLength != 0) { DWREngine._batchQueue[DWREngine._batchQueue.length] = batch; } else { DWREngine._sendData(batch); }};
DWREngine._batch = null;
dwr.engine._batch = null;
DWREngine.endBatch = function(options) { if (options == null) options = {}; var batch = DWREngine._batch; if (batch == null) { DWREngine._handleError(null, { name:"dwrengine.batchNotBegun", message:"No batch in progress" }); return; } DWREngine._batch = null; if (batch.map.callCount == 0) return; // The hooks need to be merged carefully to preserve ordering if (options && options.preHook) batch.preHooks.unshift(options.preHook); if (options && options.postHook) batch.postHooks.push(options.postHook); if (DWREngine._preHook) batch.preHooks.unshift(DWREngine._preHook); if (DWREngine._postHook) batch.postHooks.push(DWREngine._postHook); // Other props. priority: batch, call, global - the order in which they were set var propname; for (var i = 0; i < DWREngine._propnames.length; i++) { propname = DWREngine._propnames[i]; if (options[propname] != null) batch[propname] = options[propname]; if (batch[propname] == null) batch[propname] = DWREngine["_" + propname]; } // In ordered mode, we don't send unless the list of sent items is empty if (DWREngine._ordered && DWREngine._batchesLength != 0) { DWREngine._batchQueue[DWREngine._batchQueue.length] = batch; } else { DWREngine._sendData(batch); }};
if (DWREngine._preHook) batch.preHooks.unshift(DWREngine._preHook); if (DWREngine._postHook) batch.postHooks.push(DWREngine._postHook);
if (dwr.engine._preHook) batch.preHooks.unshift(dwr.engine._preHook); if (dwr.engine._postHook) batch.postHooks.push(dwr.engine._postHook);
DWREngine.endBatch = function(options) { if (options == null) options = {}; var batch = DWREngine._batch; if (batch == null) { DWREngine._handleError(null, { name:"dwrengine.batchNotBegun", message:"No batch in progress" }); return; } DWREngine._batch = null; if (batch.map.callCount == 0) return; // The hooks need to be merged carefully to preserve ordering if (options && options.preHook) batch.preHooks.unshift(options.preHook); if (options && options.postHook) batch.postHooks.push(options.postHook); if (DWREngine._preHook) batch.preHooks.unshift(DWREngine._preHook); if (DWREngine._postHook) batch.postHooks.push(DWREngine._postHook); // Other props. priority: batch, call, global - the order in which they were set var propname; for (var i = 0; i < DWREngine._propnames.length; i++) { propname = DWREngine._propnames[i]; if (options[propname] != null) batch[propname] = options[propname]; if (batch[propname] == null) batch[propname] = DWREngine["_" + propname]; } // In ordered mode, we don't send unless the list of sent items is empty if (DWREngine._ordered && DWREngine._batchesLength != 0) { DWREngine._batchQueue[DWREngine._batchQueue.length] = batch; } else { DWREngine._sendData(batch); }};
for (var i = 0; i < DWREngine._propnames.length; i++) { propname = DWREngine._propnames[i];
for (var i = 0; i < dwr.engine._propnames.length; i++) { propname = dwr.engine._propnames[i];
DWREngine.endBatch = function(options) { if (options == null) options = {}; var batch = DWREngine._batch; if (batch == null) { DWREngine._handleError(null, { name:"dwrengine.batchNotBegun", message:"No batch in progress" }); return; } DWREngine._batch = null; if (batch.map.callCount == 0) return; // The hooks need to be merged carefully to preserve ordering if (options && options.preHook) batch.preHooks.unshift(options.preHook); if (options && options.postHook) batch.postHooks.push(options.postHook); if (DWREngine._preHook) batch.preHooks.unshift(DWREngine._preHook); if (DWREngine._postHook) batch.postHooks.push(DWREngine._postHook); // Other props. priority: batch, call, global - the order in which they were set var propname; for (var i = 0; i < DWREngine._propnames.length; i++) { propname = DWREngine._propnames[i]; if (options[propname] != null) batch[propname] = options[propname]; if (batch[propname] == null) batch[propname] = DWREngine["_" + propname]; } // In ordered mode, we don't send unless the list of sent items is empty if (DWREngine._ordered && DWREngine._batchesLength != 0) { DWREngine._batchQueue[DWREngine._batchQueue.length] = batch; } else { DWREngine._sendData(batch); }};
if (batch[propname] == null) batch[propname] = DWREngine["_" + propname];
if (batch[propname] == null) batch[propname] = dwr.engine["_" + propname];
DWREngine.endBatch = function(options) { if (options == null) options = {}; var batch = DWREngine._batch; if (batch == null) { DWREngine._handleError(null, { name:"dwrengine.batchNotBegun", message:"No batch in progress" }); return; } DWREngine._batch = null; if (batch.map.callCount == 0) return; // The hooks need to be merged carefully to preserve ordering if (options && options.preHook) batch.preHooks.unshift(options.preHook); if (options && options.postHook) batch.postHooks.push(options.postHook); if (DWREngine._preHook) batch.preHooks.unshift(DWREngine._preHook); if (DWREngine._postHook) batch.postHooks.push(DWREngine._postHook); // Other props. priority: batch, call, global - the order in which they were set var propname; for (var i = 0; i < DWREngine._propnames.length; i++) { propname = DWREngine._propnames[i]; if (options[propname] != null) batch[propname] = options[propname]; if (batch[propname] == null) batch[propname] = DWREngine["_" + propname]; } // In ordered mode, we don't send unless the list of sent items is empty if (DWREngine._ordered && DWREngine._batchesLength != 0) { DWREngine._batchQueue[DWREngine._batchQueue.length] = batch; } else { DWREngine._sendData(batch); }};
if (DWREngine._ordered && DWREngine._batchesLength != 0) { DWREngine._batchQueue[DWREngine._batchQueue.length] = batch;
if (dwr.engine._ordered && dwr.engine._batchesLength != 0) { dwr.engine._batchQueue[dwr.engine._batchQueue.length] = batch;
DWREngine.endBatch = function(options) { if (options == null) options = {}; var batch = DWREngine._batch; if (batch == null) { DWREngine._handleError(null, { name:"dwrengine.batchNotBegun", message:"No batch in progress" }); return; } DWREngine._batch = null; if (batch.map.callCount == 0) return; // The hooks need to be merged carefully to preserve ordering if (options && options.preHook) batch.preHooks.unshift(options.preHook); if (options && options.postHook) batch.postHooks.push(options.postHook); if (DWREngine._preHook) batch.preHooks.unshift(DWREngine._preHook); if (DWREngine._postHook) batch.postHooks.push(DWREngine._postHook); // Other props. priority: batch, call, global - the order in which they were set var propname; for (var i = 0; i < DWREngine._propnames.length; i++) { propname = DWREngine._propnames[i]; if (options[propname] != null) batch[propname] = options[propname]; if (batch[propname] == null) batch[propname] = DWREngine["_" + propname]; } // In ordered mode, we don't send unless the list of sent items is empty if (DWREngine._ordered && DWREngine._batchesLength != 0) { DWREngine._batchQueue[DWREngine._batchQueue.length] = batch; } else { DWREngine._sendData(batch); }};
DWREngine._sendData(batch);
dwr.engine._sendData(batch);
DWREngine.endBatch = function(options) { if (options == null) options = {}; var batch = DWREngine._batch; if (batch == null) { DWREngine._handleError(null, { name:"dwrengine.batchNotBegun", message:"No batch in progress" }); return; } DWREngine._batch = null; if (batch.map.callCount == 0) return; // The hooks need to be merged carefully to preserve ordering if (options && options.preHook) batch.preHooks.unshift(options.preHook); if (options && options.postHook) batch.postHooks.push(options.postHook); if (DWREngine._preHook) batch.preHooks.unshift(DWREngine._preHook); if (DWREngine._postHook) batch.postHooks.push(DWREngine._postHook); // Other props. priority: batch, call, global - the order in which they were set var propname; for (var i = 0; i < DWREngine._propnames.length; i++) { propname = DWREngine._propnames[i]; if (options[propname] != null) batch[propname] = options[propname]; if (batch[propname] == null) batch[propname] = DWREngine["_" + propname]; } // In ordered mode, we don't send unless the list of sent items is empty if (DWREngine._ordered && DWREngine._batchesLength != 0) { DWREngine._batchQueue[DWREngine._batchQueue.length] = batch; } else { DWREngine._sendData(batch); }};
if (!batch.asynchronous) batch.asynchronous = DWREngine._asynchronous;
if (!batch.async) batch.async = DWREngine._async;
DWREngine.endBatch = function(options) { var batch = DWREngine._batch; if (batch == null) { DWREngine._handleError("No batch in progress."); return; } // Merge the global batch level properties into the batch meta data if (options && options.preHook) batch.preHooks.unshift(options.preHook); if (options && options.postHook) batch.postHooks.push(options.postHook); if (DWREngine._preHook) batch.preHooks.unshift(DWREngine._preHook); if (DWREngine._postHook) batch.postHooks.push(DWREngine._postHook); if (!batch.method) batch.method = DWREngine._method; if (!batch.verb) batch.verb = DWREngine._verb; if (!batch.asynchronous) batch.asynchronous = DWREngine._asynchronous; batch.completed = false; // If we are in ordered mode, then we don't send unless the list of sent // items is empty if (!DWREngine._ordered) { DWREngine._sendData(batch); DWREngine._batches[DWREngine._batches.length] = batch; } else { if (DWREngine._batches.length == 0) { // We aren't waiting for anything, go now. DWREngine._sendData(batch); DWREngine._batches[DWREngine._batches.length] = batch; } else { // Push the batch onto the waiting queue DWREngine._batchQueue[DWREngine._batchQueue.length] = batch; } } DWREngine._batch = null;};
if (!DWREngine._ordered) {
if (batch.map.callCount == 0) return; if (DWREngine._ordered && DWREngine._batches.length != 0) { DWREngine._batchQueue[DWREngine._batchQueue.length] = batch; } else {
DWREngine.endBatch = function(options) { if (options == null) options = {}; var batch = DWREngine._batch; if (batch == null) { DWREngine._handleError("No batch in progress."); return; } // The hooks need to be merged carefully to preserve ordering if (options && options.preHook) batch.preHooks.unshift(options.preHook); if (options && options.postHook) batch.postHooks.push(options.postHook); if (DWREngine._preHook) batch.preHooks.unshift(DWREngine._preHook); if (DWREngine._postHook) batch.postHooks.push(DWREngine._postHook); // Other props. priority: batch, call, global - the order in which they were set var propnames = [ "method", "verb", "async", "timeout" ]; var propname; for (var i = 0; i < propnames.length; i++) { propname = propnames[i]; if (options[propname] != null) batch[propname] = options[propname]; if (batch[propname] == null) batch[propname] = DWREngine["_" + propname]; } batch.completed = false; // We are about to send so this batch should not be globally visible DWREngine._batch = null; // If we are in ordered mode, then we don't send unless the list of sent // items is empty if (!DWREngine._ordered) { DWREngine._batches[DWREngine._batches.length] = batch; DWREngine._sendData(batch); } else { if (DWREngine._batches.length == 0) { // We aren't waiting for anything, go now. DWREngine._batches[DWREngine._batches.length] = batch; DWREngine._sendData(batch); } else { // Push the batch onto the waiting queue DWREngine._batchQueue[DWREngine._batchQueue.length] = batch; } }};
else { if (DWREngine._batches.length == 0) { DWREngine._batches[DWREngine._batches.length] = batch; DWREngine._sendData(batch); } else { DWREngine._batchQueue[DWREngine._batchQueue.length] = batch; } }
DWREngine.endBatch = function(options) { if (options == null) options = {}; var batch = DWREngine._batch; if (batch == null) { DWREngine._handleError("No batch in progress."); return; } // The hooks need to be merged carefully to preserve ordering if (options && options.preHook) batch.preHooks.unshift(options.preHook); if (options && options.postHook) batch.postHooks.push(options.postHook); if (DWREngine._preHook) batch.preHooks.unshift(DWREngine._preHook); if (DWREngine._postHook) batch.postHooks.push(DWREngine._postHook); // Other props. priority: batch, call, global - the order in which they were set var propnames = [ "method", "verb", "async", "timeout" ]; var propname; for (var i = 0; i < propnames.length; i++) { propname = propnames[i]; if (options[propname] != null) batch[propname] = options[propname]; if (batch[propname] == null) batch[propname] = DWREngine["_" + propname]; } batch.completed = false; // We are about to send so this batch should not be globally visible DWREngine._batch = null; // If we are in ordered mode, then we don't send unless the list of sent // items is empty if (!DWREngine._ordered) { DWREngine._batches[DWREngine._batches.length] = batch; DWREngine._sendData(batch); } else { if (DWREngine._batches.length == 0) { // We aren't waiting for anything, go now. DWREngine._batches[DWREngine._batches.length] = batch; DWREngine._sendData(batch); } else { // Push the batch onto the waiting queue DWREngine._batchQueue[DWREngine._batchQueue.length] = batch; } }};
updateUndoRedoMenu();
function endBatchTransaction() { gTransactionMgr.endBatch();}
getBrowser().userTypedClear = false;
if (getBrowser().userTypedClear > 0) getBrowser().userTypedClear--;
endDocumentLoad : function(aRequest, aStatus) { // The document is done loading, it's okay to clear // the value again. getBrowser().userTypedClear = false; const nsIChannel = Components.interfaces.nsIChannel; var urlStr = aRequest.QueryInterface(nsIChannel).originalURI.spec; if (Components.isSuccessCode(aStatus)) dump("Document "+urlStr+" loaded successfully\n"); // per QA request else { // per QA request var e = new Components.Exception("", aStatus); var name = e.name; dump("Error loading URL "+urlStr+" : "+ Number(aStatus).toString(16)); if (name) dump(" ("+name+")"); dump('\n'); } var observerService = Components.classes["@mozilla.org/observer-service;1"] .getService(Components.interfaces.nsIObserverService); var notification = Components.isSuccessCode(aStatus) ? "EndDocumentLoad" : "FailDocumentLoad"; try { observerService.notifyObservers(_content, notification, urlStr); } catch (e) { } }
observerService.Notify(_content, notification, urlStr);
observerService.notifyObservers(_content, notification, urlStr);
endDocumentLoad : function(aRequest, aStatus) { const nsIChannel = Components.interfaces.nsIChannel; var urlStr = aRequest.QueryInterface(nsIChannel).originalURI.spec; if (Components.isSuccessCode(aStatus)) dump("Document "+urlStr+" loaded successfully\n"); // per QA request else { // per QA request var e = new Components.Exception("", aStatus); var name = e.name; dump("Error loading URL "+urlStr+" : "+ Number(aStatus).toString(16)); if (name) dump(" ("+name+")"); dump('\n'); } var observerService = Components.classes["@mozilla.org/observer-service;1"] .getService(Components.interfaces.nsIObserverService); var notification = Components.isSuccessCode(aStatus) ? "EndDocumentLoad" : "FailDocumentLoad"; try { observerService.Notify(_content, notification, urlStr); } catch (e) { } }
gReplicationBundle.getString("downloadButtonAccessKey");
gReplicationBundle.getString("downloadButton.accesskey");
function EndDownload(aStatus){ document.getElementById("download").label = gReplicationBundle.getString("downloadButton"); document.getElementById("download").accessKey = gReplicationBundle.getString("downloadButtonAccessKey"); // stop the spinning gProgressMeter.setAttribute("mode", "normal"); gProgressMeter.setAttribute("value", "100"); gProgressMeter.hidden = true; gDownloadInProgress = false; gProgressText.value = gReplicationBundle.getString(aStatus ? "replicationSucceeded" : gReplicationCancelled ? "replicationCancelled" : "replicationFailed");}
this.template = aTemplate;
function EngineURL(aType, aMethod, aTemplate) { ENSURE_ARG(aType && aMethod && aTemplate, "missing type, method or template for EngineURL!"); var method = aMethod.toUpperCase(); var type = aType.toLowerCase(); ENSURE_ARG(method == "GET" || method == "POST", "method passed to EngineURL must be \"GET\" or \"POST\""); this.type = type; this.method = method; this.template = aTemplate; this.params = [];}
var templateURI = makeURI(aTemplate); ENSURE(templateURI, "new EngineURL: template is not a valid URI!", Cr.NS_ERROR_FAILURE); switch (templateURI.scheme) { case "http": case "https": this.template = templateURI.spec; break; default: ENSURE(false, "new EngineURL: template uses invalid scheme!", Cr.NS_ERROR_FAILURE); }
function EngineURL(aType, aMethod, aTemplate) { ENSURE_ARG(aType && aMethod && aTemplate, "missing type, method or template for EngineURL!"); var method = aMethod.toUpperCase(); var type = aType.toLowerCase(); ENSURE_ARG(method == "GET" || method == "POST", "method passed to EngineURL must be \"GET\" or \"POST\""); this.type = type; this.method = method; this.template = aTemplate; this.params = [];}
var mPrefs = Components.classes["@mozilla.org/preferences;1"].getService(Components.interfaces.nsIPrefBranch);
var mPrefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
function ensureDefaultEnginePrefs(aRDF,aDS) { var mPrefs = Components.classes["@mozilla.org/preferences;1"].getService(Components.interfaces.nsIPrefBranch); var defaultName = mPrefs.getComplexValue("browser.search.defaultenginename" , Components.interfaces.nsIPrefLocalizedString); var kNC_Root = aRDF.GetResource("NC:SearchEngineRoot"); var kNC_child = aRDF.GetResource("http://home.netscape.com/NC-rdf#child"); var kNC_Name = aRDF.GetResource("http://home.netscape.com/NC-rdf#Name"); var arcs = aDS.GetTargets(kNC_Root, kNC_child, true); while (arcs.hasMoreElements()) { var engineRes = arcs.getNext().QueryInterface(Components.interfaces.nsIRDFResource); var name = readRDFString(aDS, engineRes, kNC_Name); if (name == defaultName) mPrefs.setCharPref("browser.search.defaultengine", engineRes.Value); }}
builder.toggleOpenState(EnsureFolderindex(builder, msgFolder.parent));
builder.toggleOpenState(EnsureFolderIndex(builder, msgFolder.parent));
function EnsureFolderIndex(builder, msgFolder){ // try to get the index of the folder in the tree var index = builder.getIndexOfResource(msgFolder); if (index == -1) { // if we couldn't find the folder, open the parent builder.toggleOpenState(EnsureFolderindex(builder, msgFolder.parent)); index = builder.getIndexOfResource(msgFolder); } return index;}
if (index < 0) return;
function EnsureRowInThreadOutlinerIsVisible(index){ var outliner = GetThreadOutliner(); outliner.boxObject.QueryInterface(Components.interfaces.nsIOutlinerBoxObject).ensureRowIsVisible(index); }
var mPrefs = Components.classes["@mozilla.org/preferences;1"].getService(Components.interfaces.nsIPrefBranch);
var mPrefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
function ensureSearchPref(){ var rdf = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(Components.interfaces.nsIRDFService); var ds = rdf.GetDataSource("rdf:internetsearch"); var mPrefs = Components.classes["@mozilla.org/preferences;1"].getService(Components.interfaces.nsIPrefBranch); kNC_Name = rdf.GetResource("http://home.netscape.com/NC-rdf#Name"); try { defaultEngine = mPrefs.getCharPref("browser.search.defaultengine"); } catch(ex) { ensureDefaultEnginePrefs(rdf, ds); defaultEngine = mPrefs.getCharPref("browser.search.defaultengine"); }}
kNC_Name = rdf.GetResource("http:
var kNC_Name = rdf.GetResource("http: var defaultEngine;
function ensureSearchPref(){ var rdf = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(Components.interfaces.nsIRDFService); var ds = rdf.GetDataSource("rdf:internetsearch"); var mPrefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch); kNC_Name = rdf.GetResource("http://home.netscape.com/NC-rdf#Name"); try { defaultEngine = mPrefs.getCharPref("browser.search.defaultengine"); } catch(ex) { ensureDefaultEnginePrefs(rdf, ds); defaultEngine = mPrefs.getCharPref("browser.search.defaultengine"); }}
return;
return null;
function enterNewSite(site) { var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"] .getService(Components.interfaces.nsIPromptService); var stringBundle = document.getElementById("stringBundle"); var message = stringBundle.getString("enterSiteName"); var title = stringBundle.getString("enterSiteTitle"); var name = (!site ? {} : site); if (!promptService.prompt(window, title, message, name, null, {})) return; var host = name.value.replace(/^\s*([-\w]*:\/+)?/, ""); // trim any leading space and scheme try { var ioService = Components.classes["@mozilla.org/network/io-service;1"] .getService(Components.interfaces.nsIIOService); var uri = ioService.newURI("http://"+host, null, null); host = uri.host; return host; } catch(ex) { // if we get here, the user has managed to enter something that couldn't get parsed to a real URI // call this function again, with the string originally entered pre-populated var alertTitle = stringBundle.getString("addSiteFailedTitle"); var alertMsg = stringBundle.getFormattedString("addSiteFailedMessage",[host]); promptService.alert(window, alertTitle, alertMsg); enterNewSite(name); }}
enterNewSite(name);
function enterNewSite(site) { var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"] .getService(Components.interfaces.nsIPromptService); var stringBundle = document.getElementById("stringBundle"); var message = stringBundle.getString("enterSiteName"); var title = stringBundle.getString("enterSiteTitle"); var name = (!site ? {} : site); if (!promptService.prompt(window, title, message, name, null, {})) return; var host = name.value.replace(/^\s*([-\w]*:\/+)?/, ""); // trim any leading space and scheme try { var ioService = Components.classes["@mozilla.org/network/io-service;1"] .getService(Components.interfaces.nsIIOService); var uri = ioService.newURI("http://"+host, null, null); host = uri.host; return host; } catch(ex) { // if we get here, the user has managed to enter something that couldn't get parsed to a real URI // call this function again, with the string originally entered pre-populated var alertTitle = stringBundle.getString("addSiteFailedTitle"); var alertMsg = stringBundle.getFormattedString("addSiteFailedMessage",[host]); promptService.alert(window, alertTitle, alertMsg); enterNewSite(name); }}
return null;
function enterNewSite(site) { var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"] .getService(Components.interfaces.nsIPromptService); var stringBundle = document.getElementById("stringBundle"); var message = stringBundle.getString("enterSiteName"); var title = stringBundle.getString("enterSiteTitle"); var name = (!site ? {} : site); if (!promptService.prompt(window, title, message, name, null, {})) return; var host = name.value.replace(/^\s*([-\w]*:\/+)?/, ""); // trim any leading space and scheme try { var ioService = Components.classes["@mozilla.org/network/io-service;1"] .getService(Components.interfaces.nsIIOService); var uri = ioService.newURI("http://"+host, null, null); host = uri.host; return host; } catch(ex) { // if we get here, the user has managed to enter something that couldn't get parsed to a real URI // call this function again, with the string originally entered pre-populated var alertTitle = stringBundle.getString("addSiteFailedTitle"); var alertMsg = stringBundle.getFormattedString("addSiteFailedMessage",[host]); promptService.alert(window, alertTitle, alertMsg); enterNewSite(name); }}
this.id = null;
function Entry() { this._summary = null; this._content = null; this._title = null; this.fields = Cc["@mozilla.org/hash-property-bag;1"]. createInstance(Ci.nsIWritablePropertyBag2); this.link = null; this.baseURI = null;}
document.getElementById("addSynonym").setAttribute("style", "display: none") document.getElementById("removeSynonym").setAttribute("style", "display: none")
function EntryDeselected(){ document.getElementById("removeEntry").setAttribute("disabled", "true") document.getElementById("addSynonym").setAttribute("disabled", "true")}
var schemaId = document.getElementById("schematree").selectedItems[0].getAttribute("id"); var schemanumb =parseInt(schemaId.substring(5, schemaId.length)); var entryId = document.getElementById("entrytree").selectedItems[0].getAttribute("id"); var entrynumb =parseInt(entryId.substring(5, entryId.length)); var entryName = Decrypt(strings[entries[schemas[schemanumb]+entrynumb]+1]); var synonymText = document.getElementById("synonymtext"); synonymText.setAttribute("value", synonymText.getAttribute("value2") + entryName); document.getElementById("addSynonym").setAttribute("style", "display: inline;"); document.getElementById("removeSynonym").setAttribute("style", "display: inline;");
function EntrySelected(){ document.getElementById("removeEntry").setAttribute("disabled", "false") document.getElementById("addSynonym").setAttribute("disabled", "false")}
return (hooks.push({pattern: pattern, f: f, name: name, neg: neg, enabled: enabled}) - 1);
var hook = { pattern: pattern, f: f, name: name, neg: neg, enabled: enabled }; hooks.push(hook); return hook;
function ep_addhook(pattern, f, name, neg, enabled, hooks){ if (typeof hooks == "undefined") hooks = this.hooks; if (typeof f != "function") return false; if (typeof enabled == "undefined") enabled = true; else enabled = Boolean(enabled); neg = Boolean(neg); return (hooks.push({pattern: pattern, f: f, name: name, neg: neg, enabled: enabled}) - 1);}
e.destMethod);
e.destMethod + "\n" + dumpObjectTree(ex));
function ep_routeevent (e){ var count = 0; this.currentEvent = e; e.level = 0; while (e.destObject) { e.level++; this.onHook (e); var destObject = e.destObject; e.destObject = (void 0); switch (typeof destObject[e.destMethod]) { case "function": if (1) try { destObject[e.destMethod] (e); } catch (ex) { dd ("Error routing event: " + ex + " in " + e.destMethod); } else destObject[e.destMethod] (e); if (count++ > this.MAX_EVENT_DEPTH) throw "Too many events in chain"; break; case "undefined": //dd ("** " + e.destMethod + " does not exist."); break; default: dd ("** " + e.destMethod + " is not a function."); } if ((e.type != "event-end") && (!e.destObject)) { e.lastSet = e.set; e.set = "eventpump"; e.lastType = e.type; e.type = "event-end"; e.destMethod = "onEventEnd"; e.destObject = this; } } delete this.currentEvent; return true; }
if (typeof data == "object" && data.name = "Error" && data.description)
if (typeof data == "object" && data.name == "Error" && data.description)
DWREngine.errorHandler = function(data){ if (typeof data == "object" && data.name = "Error" && data.description) { alert("Error: " + data.description); } else { alert(data); }}
var json = this.transport.getResponseHeader('X-JSON'), object; object = eval(json); return object; } catch (e) { }
return eval(this.header('X-JSON')); } catch (e) {}
evalJSON: function() { try { var json = this.transport.getResponseHeader('X-JSON'), object; object = eval(json); return object; } catch (e) { } },
jQuery.getScript( this.src, function() {} );
jQuery.getScript( this.src );
evalScripts: function() { return this.find('script').each(function(){ if ( this.src ) // for some weird reason, it doesn't work if the callback is ommited jQuery.getScript( this.src, function() {} ); else eval.call( window, this.text || this.textContent || this.innerHTML || "" ); }).end(); }
else eval.call( window, this.text || this.textContent || this.innerHTML || "" );
else { var data = this.text || this.textContent || this.innerHTML || ""; if (window.execScript) window.execScript( data ); else window.setTimeout( data, 0 ); }
evalScripts: function() { return this.find('script').each(function(){ if ( this.src ) // for some weird reason, it doesn't work if the callback is ommited jQuery.getScript( this.src ); else eval.call( window, this.text || this.textContent || this.innerHTML || "" ); }).end(); }
jQuery.eval ( this.text || this.textContent || this.innerHTML || "" );
jQuery.globalEval( this.text || this.textContent || this.innerHTML || "" );
evalScripts: function() { return this.find('script').each(function(){ if ( this.src ) // for some weird reason, it doesn't work if the callback is ommited jQuery.getScript( this.src ); else { jQuery.eval ( this.text || this.textContent || this.innerHTML || "" ); } }).end(); }
var data = this.text || this.textContent || this.innerHTML || ""; if (window.execScript) window.execScript( data ); else window.setTimeout( data, 0 );
jQuery.eval ( this.text || this.textContent || this.innerHTML || "" );
evalScripts: function() { return this.find('script').each(function(){ if ( this.src ) // for some weird reason, it doesn't work if the callback is ommited jQuery.getScript( this.src ); else { // TODO extract into $.eval var data = this.text || this.textContent || this.innerHTML || ""; if (window.execScript) window.execScript( data ); else window.setTimeout( data, 0 ); } }).end(); }
function EvalTest() { with( this ) { try { MY_EVAL( "RESULT = \"Failed: indirect call to eval was successful; should be an error\"" ); } catch ( e ) { RESULT = EXPECT; }
function EvalTest() { with( this ) { MY_EVAL( "RESULT = h(-1, 1)" ); EXPECT = 1;
function EvalTest() { with( this ) { try { MY_EVAL( "RESULT = \"Failed: indirect call to eval was successful; should be an error\"" ); } catch ( e ) { RESULT = EXPECT; } testcases[tc++] = new TestCase( SECTION, "Call eval indirectly", EXPECT, RESULT ); }}
} catch (e if e == THROW) { if (x) { x.result = x2.result; throw THROW; } throw x2.result;
function evaluate(s, f, l) { var x = ExecutionContext.current; var x2 = new ExecutionContext(GLOBAL_CODE); ExecutionContext.current = x2; try { execute(compile(s, f, l), x2); } finally { ExecutionContext.current = x; } return x2.result;}
if(typeof console != "undefined")
if(typeof console != "undefined") {
function evaluateTest(files, num, js) { var Test = []; js = js.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&amp;/g, "&"); try { eval(js); } catch(e) { if(typeof console != "undefined") console.error(e); console.debug(js); Test.push( [ false, "Died on test #" + (Test.length+1) + ": " + e ] ); } var good = 0, bad = 0; var ol = document.createElement("ol"); var li = "", state = "pass"; for ( var i = 0; i < Test.length; i++ ) { var li = document.createElement("li"); li.className = Test[i][0] ? "pass" : "fail"; li.innerHTML = Test[i][1]; ol.appendChild( li ); if ( !Test[i][0] ) { state = "fail"; bad++; } else good++; } var li = document.createElement("li"); li.className = state; var b = document.createElement("b"); b.innerHTML = files[num] + " <b style='color:black;'>(<b class='fail'>" + bad + "</b>, <b class='pass'>" + good + "</b>, " + Test.length + ")</b>"; b.onclick = function(){ var n = this.nextSibling; if ( jQuery.css( n, "display" ) == "none" ) n.style.display = "block"; else n.style.display = "none"; }; li.appendChild( b ); li.appendChild( ol ); document.getElementById("tests").appendChild( li ); blocking = false; process(); function ok(a, msg) { Test.push( [ !!a, msg ] ); } function cmpOK( a, c, b, msg ) { var res; eval( "res = (a " + c + " b)" ); Test.push( [ res, msg ] ); } function isSet(a, b, msg) { var ret = true; if ( a && b && a.length == b.length ) { for ( var i in a ) if ( a[i] != b[i] ) ret = false; } else ret = false; if ( !ret && console ) console.log( msg, a, b ); Test.push( [ ret, msg ] ); } function q() { var r = []; for ( var i = 0; i < arguments.length; i++ ) r.push( document.getElementById( arguments[i] ) ); return r; } function t(a,b,c) { var f = jQuery.find(b); var s = ""; for ( var i = 0; i < f.length; i++ ) s += (s && ",") + '"' + f[i].id + '"'; isSet(f, q.apply(q,c), a + " (" + b + ")"); }}
}
function evaluateTest(files, num, js) { var Test = []; js = js.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&amp;/g, "&"); try { eval(js); } catch(e) { if(typeof console != "undefined") console.error(e); console.debug(js); Test.push( [ false, "Died on test #" + (Test.length+1) + ": " + e ] ); } var good = 0, bad = 0; var ol = document.createElement("ol"); var li = "", state = "pass"; for ( var i = 0; i < Test.length; i++ ) { var li = document.createElement("li"); li.className = Test[i][0] ? "pass" : "fail"; li.innerHTML = Test[i][1]; ol.appendChild( li ); if ( !Test[i][0] ) { state = "fail"; bad++; } else good++; } var li = document.createElement("li"); li.className = state; var b = document.createElement("b"); b.innerHTML = files[num] + " <b style='color:black;'>(<b class='fail'>" + bad + "</b>, <b class='pass'>" + good + "</b>, " + Test.length + ")</b>"; b.onclick = function(){ var n = this.nextSibling; if ( jQuery.css( n, "display" ) == "none" ) n.style.display = "block"; else n.style.display = "none"; }; li.appendChild( b ); li.appendChild( ol ); document.getElementById("tests").appendChild( li ); blocking = false; process(); function ok(a, msg) { Test.push( [ !!a, msg ] ); } function cmpOK( a, c, b, msg ) { var res; eval( "res = (a " + c + " b)" ); Test.push( [ res, msg ] ); } function isSet(a, b, msg) { var ret = true; if ( a && b && a.length == b.length ) { for ( var i in a ) if ( a[i] != b[i] ) ret = false; } else ret = false; if ( !ret && console ) console.log( msg, a, b ); Test.push( [ ret, msg ] ); } function q() { var r = []; for ( var i = 0; i < arguments.length; i++ ) r.push( document.getElementById( arguments[i] ) ); return r; } function t(a,b,c) { var f = jQuery.find(b); var s = ""; for ( var i = 0; i < f.length; i++ ) s += (s && ",") + '"' + f[i].id + '"'; isSet(f, q.apply(q,c), a + " (" + b + ")"); }}
var code = document.getElementById("TextfieldEval").value;
var code = document.getElementById("TextboxEval").value;
function evaluateTypein(){ var code = document.getElementById("TextfieldEval").value; var iframe = document.getElementById("Evaluator"); iframe.setAttribute("src", "javascript: " + code);}