rem
stringlengths 0
126k
| add
stringlengths 0
441k
| context
stringlengths 15
136k
|
---|---|---|
StopInlineSpellChecker(); | onClose: function() { //Reset recipients and attachments ReleaseAutoCompleteState(); awResetAllRows(); RemoveAllAttachments(); // We need to clear the identity popup menu in case the user will change them. It will be rebuilded later in ComposeStartup ClearIdentityListPopup(document.getElementById("msgIdentityPopup")); //Clear the subject document.getElementById("msgSubject").value = ""; SetComposeWindowTitle(); SetContentAndBodyAsUnmodified(); disableEditableFields(); ReleaseGlobalVariables(); //Reset Boxes size document.getElementById("headers-box").removeAttribute("height"); document.getElementById("appcontent").removeAttribute("height"); document.getElementById("addresses-box").removeAttribute("width"); document.getElementById("attachments-box").removeAttribute("width"); //Reset menu options document.getElementById("format_auto").setAttribute("checked", "true"); document.getElementById("priority_normal").setAttribute("checked", "true"); //Reset toolbars that could be hidden if (gHideMenus) { document.getElementById("formatMenu").hidden = false; document.getElementById("insertMenu").hidden = false; var showFormat = document.getElementById("menu_showFormatToolbar") showFormat.hidden = false; if (showFormat.getAttribute("checked") == "true") document.getElementById("FormatToolbar").hidden = false; } //Reset editor EditorResetFontAndColorAttributes(); EditorCleanup(); //Release the nsIMsgComposeParams object if (window.arguments && window.arguments[0]) window.arguments[0] = null; var event = document.createEvent('Events'); event.initEvent('compose-window-close', false, true); document.getElementById("msgcomposeWindow").dispatchEvent(event); if (gAutoSaveTimeout) clearTimeout(gAutoSaveTimeout); }, |
|
disableEditableFields() | onClose: function() { awResetAllRows(); RemoveAllAttachments(); //We need to clear the identity popup menu in case the user will change them. It will be rebuilded later in ComposeStartup ClearIdentityListPopup(document.getElementById("msgIdentityPopup")); SetContentAndBodyAsUnmodified(); ReleaseGlobalVariables(); }, |
|
if (top.awInputElement.getAttribute('focused') != '') top.awInputElement.removeAttribute('focused'); | awGetInputElement(1).removeAttribute('focused'); | onClose: function() { //Reset recipients and attachments ReleaseAutoCompleteState(); awResetAllRows(); RemoveAllAttachments(); // We need to clear the identity popup menu in case the user will change them. // It will be rebuilt later in ComposeStartup ClearIdentityListPopup(document.getElementById("msgIdentityPopup")); //Clear the subject GetMsgSubjectElement().value = ""; // be sure to clear the transaction manager for the subject GetMsgSubjectElement().editor.transactionManager.clear(); SetComposeWindowTitle(); SetContentAndBodyAsUnmodified(); disableEditableFields(); ReleaseGlobalVariables(); // Clear the focus if (top.awInputElement.getAttribute('focused') != '') top.awInputElement.removeAttribute('focused'); //Reset Boxes size document.getElementById("headers-box").removeAttribute("height"); document.getElementById("appcontent").removeAttribute("height"); document.getElementById("addresses-box").removeAttribute("width"); document.getElementById("attachments-box").removeAttribute("width"); //Reset menu options document.getElementById("format_auto").setAttribute("checked", "true"); document.getElementById("priority_normal").setAttribute("checked", "true"); //Reset toolbars that could be hidden if (gHideMenus) { document.getElementById("formatMenu").hidden = false; document.getElementById("insertMenu").hidden = false; var showFormat = document.getElementById("menu_showFormatToolbar") showFormat.hidden = false; if (showFormat.getAttribute("checked") == "true") document.getElementById("FormatToolbar").hidden = false; } //Reset editor InlineSpellChecker.Init(GetCurrentEditor(), false); // unregister inline spell checking listeners and release the spell checker EditorResetFontAndColorAttributes(); EditorCleanup(); //Release the nsIMsgComposeParams object if (window.arguments && window.arguments[0]) window.arguments[0] = null; var event = document.createEvent('Events'); event.initEvent('compose-window-close', false, true); document.getElementById("msgcomposeWindow").dispatchEvent(event); if (gAutoSaveTimeout) clearTimeout(gAutoSaveTimeout); }, |
return true; | function onClose(){ // Shutdown the spell check and close the dialog spellChecker.UninitSpellChecker(); SaveWindowLocation(); window.close();} |
|
if (client.userClose) | if ("userClose" in client && client.userClose) | function onClose(){ if (client.userClose) return true; client.userClose = true; client.currentObject.display ("Closing ChatZilla...", "INFO"); if (client.getConnectionCount() == 0) /* if we're not connected to anything, just close the window */ return true; /* otherwise, try to close out gracefully */ client.quit (client.userAgent); return false;} |
client.currentObject.display ("Closing ChatZilla...", "INFO"); | client.currentObject.display (getMsg("cli_closing"), "INFO"); | function onClose(){ if (client.userClose) return true; client.userClose = true; client.currentObject.display ("Closing ChatZilla...", "INFO"); if (client.getConnectionCount() == 0) /* if we're not connected to anything, just close the window */ return true; /* otherwise, try to close out gracefully */ client.quit (client.userAgent); return false;} |
onComplete:function(request){ new Effect.Highlight(itemContainerElemId,{}); addOneAjaxToDoItemCheckmarkHandling($(itemContainerElemId)); hideContainerIfEmpty('new_actions'); }, | onComplete:function(request){ new Effect.Highlight(itemContainerElemId,{}); addOneAjaxToDoItemCheckmarkHandling($(itemContainerElemId)); }, | onComplete:function(request){ new Effect.Highlight(itemContainerElemId,{}); addOneAjaxToDoItemCheckmarkHandling($(itemContainerElemId)); hideContainerIfEmpty('new_actions'); }, |
var msg = getMsg(MSN_PROFILE_SAVED, getURLSpecFromFile(file.localFile)); display (msg); console.status = msg; file.close(); | var w = window.open("about:blank"); w.wrappedJSObject.document.open(); w.wrappedJSObject.document.write(fileString.str); w.wrappedJSObject.document.close(); | function onComplete (i) { var msg = getMsg(MSN_PROFILE_SAVED, getURLSpecFromFile(file.localFile)); display (msg); console.status = msg; file.close(); }; |
dump( "Error setting close timeout\n" ); window.close(); dialog.cancel.childNodes[0].nodeValue = "Close"; | function onCompletion( status ) { // Note that we're done (and can ignore subsequent progress notifications). completed = true; // Indicate completion in status area. var msg = getString( "completeMsg" ); msg = replaceInsert( msg, 1, formatSeconds( elapsed/1000 ) ); onStatus( msg ); // Put progress meter at 100%. dialog.progress.setAttribute( "value", 100 ); dialog.progress.setAttribute( "mode", "normal" ); try { // Close the window in 2 seconds (to ensure user sees we're done). window.setTimeout( "window.close();", 2000 ); } catch ( exception ) { dump( "Error setting close timeout\n" ); // OK, try to just close the window immediately. window.close(); // If that's not working either, change button text to give user a clue. dialog.cancel.childNodes[0].nodeValue = "Close"; }} |
|
window.setTimeout( "window.close();", 2000 ); | dialog.progress.setAttribute( "value", 100 ); dialog.progress.setAttribute( "mode", "normal" ); try { window.setTimeout( "window.close();", 2000 ); } catch ( exception ) { dump( "Error setting close timeout\n" ); for ( prop in exception ) { dump( "exception." + prop + "=" + exception[ prop ] + "\n" ); } window.close(); dialog.cancel.childNodes[0].nodeValue = "Close"; } | function onCompletion( status ) { // Note that we're done (and can ignore subsequent progress notifications). completed = true; // Indicate completion in status area. onStatus( "Download completed in " + formatSeconds( elapsed/1000 ) ); // Close the window in 2 seconds (to ensure user sees we're done). window.setTimeout( "window.close();", 2000 );} |
cview.lastProgID = e.target.parentNode.getAttribute("progid"); | cview.lastContractID = e.target.parentNode.getAttribute("contractid"); | function onComponentClick(e){ cview.lastProgID = e.target.parentNode.getAttribute("progid"); if (cview.interfaceMode == "implemented-by") { cview.interfaceFilter = cview.lastProgID; filterInterfaces(); }} |
cview.interfaceFilter = cview.lastProgID; | cview.interfaceFilter = cview.lastContractID; | function onComponentClick(e){ cview.lastProgID = e.target.parentNode.getAttribute("progid"); if (cview.interfaceMode == "implemented-by") { cview.interfaceFilter = cview.lastProgID; filterInterfaces(); }} |
document.getElementById("textbox").focus(); | function onConfigLoad(){ // Load strings gConfigBundle = document.getElementById("configBundle"); document.title = gConfigBundle.getString("title"); gLockStrs[PREF_IS_DEFAULT_VALUE] = gConfigBundle.getString("default"); gLockStrs[PREF_IS_USER_SET] = gConfigBundle.getString("user"); gLockStrs[PREF_IS_LOCKED] = gConfigBundle.getString("locked"); gTypeStrs[nsIPrefBranch.PREF_STRING] = gConfigBundle.getString("string"); gTypeStrs[nsIPrefBranch.PREF_INT] = gConfigBundle.getString("int"); gTypeStrs[nsIPrefBranch.PREF_BOOL] = gConfigBundle.getString("bool"); var prefCount = { value: 0 }; var prefArray = gPrefBranch.getChildList("", prefCount); for (var i = 0; i < prefCount.value; ++i) { var prefName = prefArray[i]; if (/^capability\./.test(prefName)) // avoid displaying "private" preferences continue; fetchPref(prefName, gPrefArray.length); } var descending = document.getElementsByAttribute("sortDirection", "descending"); if (descending.length) { gSortedColumn = descending[0].id; gSortDirection = -1; } else { var ascending = document.getElementsByAttribute("sortDirection", "ascending"); if (ascending.length) gSortedColumn = ascending[0].id; else document.getElementById(gSortedColumn).setAttribute("sortDirection", "ascending"); } gSortFunction = gSortFunctions[gSortedColumn]; gPrefArray.sort(gSortFunction); gFastIndex = gPrefArray.length; gPrefBranch.addObserver("", gPrefListener, false); document.getElementById("configTree").view = view;} |
|
var prefCount = {value:0}; var prefService = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService); var prefBranch = prefService.getBranch(null); var prefArray = prefBranch.getChildList("" , prefCount); var prefName, prefType, prefValue, prefIndex, prefLockState; | var prefCount = { value: 0 }; var prefArray = gPrefBranch.getChildList("", prefCount); | function onConfigLoad(){ document.title = "about:config"; var prefCount = {value:0}; var prefService = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService); var prefBranch = prefService.getBranch(null); var prefArray = prefBranch.getChildList("" , prefCount); var prefName, prefType, prefValue, prefIndex, prefLockState; var i = 0; var j = 0; // This is used to avoid counting the "capability" preferences var k = 0; // This is to maintain a count of prefs (not including the "capability" prefs); prefArray.sort(); for (i = 0; i < prefCount.value; i++) { if((prefArray[i].indexOf("capability", 0) + 1) > 0) // avoid displaying "private" preferences { j++; continue; } k = (i - j); // avoid numbering "capability" prefs prefIndex = k + 1; if (prefBranch.prefIsLocked(prefArray[i])) prefLockState = kLocked; else if(prefBranch.prefHasUserValue(prefArray[i])) prefLockState = kUserSet; else prefLockState = kDefault; const nsIPrefBranch = Components.interfaces.nsIPrefBranch; switch (prefBranch.getPrefType(prefArray[i])) { case nsIPrefBranch.PREF_INT: prefType = kIntType; // convert to a string prefValue = "" + prefBranch.getIntPref(prefArray[i]); break; case nsIPrefBranch.PREF_BOOL: prefType = kBoolType; // convert to a string if (prefBranch.getBoolPref(prefArray[i])) prefValue = "true"; else prefValue = "false"; break; case nsIPrefBranch.PREF_STRING: default: prefType = kStrType; prefValue = htmlEscape(prefBranch.getCharPref(prefArray[i])); break; } prefArray[i] = htmlEscape(prefArray[i]); baseArray[k] = {indexCol:prefIndex, prefCol:prefArray[i], lockCol:prefLockState, typeCol:prefType, valueCol:prefValue}; } view.rowCount = k + 1; gTree = document.getElementById("configTree"); gTree.treeBoxObject.view = view;} |
var i = 0; var j = 0; var k = 0; | for (var i = 0; i < prefCount.value; ++i) { var prefName = prefArray[i]; if (/capability/.test(prefName)) continue; | function onConfigLoad(){ document.title = "about:config"; var prefCount = {value:0}; var prefService = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService); var prefBranch = prefService.getBranch(null); var prefArray = prefBranch.getChildList("" , prefCount); var prefName, prefType, prefValue, prefIndex, prefLockState; var i = 0; var j = 0; // This is used to avoid counting the "capability" preferences var k = 0; // This is to maintain a count of prefs (not including the "capability" prefs); prefArray.sort(); for (i = 0; i < prefCount.value; i++) { if((prefArray[i].indexOf("capability", 0) + 1) > 0) // avoid displaying "private" preferences { j++; continue; } k = (i - j); // avoid numbering "capability" prefs prefIndex = k + 1; if (prefBranch.prefIsLocked(prefArray[i])) prefLockState = kLocked; else if(prefBranch.prefHasUserValue(prefArray[i])) prefLockState = kUserSet; else prefLockState = kDefault; const nsIPrefBranch = Components.interfaces.nsIPrefBranch; switch (prefBranch.getPrefType(prefArray[i])) { case nsIPrefBranch.PREF_INT: prefType = kIntType; // convert to a string prefValue = "" + prefBranch.getIntPref(prefArray[i]); break; case nsIPrefBranch.PREF_BOOL: prefType = kBoolType; // convert to a string if (prefBranch.getBoolPref(prefArray[i])) prefValue = "true"; else prefValue = "false"; break; case nsIPrefBranch.PREF_STRING: default: prefType = kStrType; prefValue = htmlEscape(prefBranch.getCharPref(prefArray[i])); break; } prefArray[i] = htmlEscape(prefArray[i]); baseArray[k] = {indexCol:prefIndex, prefCol:prefArray[i], lockCol:prefLockState, typeCol:prefType, valueCol:prefValue}; } view.rowCount = k + 1; gTree = document.getElementById("configTree"); gTree.treeBoxObject.view = view;} |
prefArray.sort(); for (i = 0; i < prefCount.value; i++) { if((prefArray[i].indexOf("capability", 0) + 1) > 0) { j++; continue; } | fetchPref(prefName, gPrefArray.length); } | function onConfigLoad(){ document.title = "about:config"; var prefCount = {value:0}; var prefService = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService); var prefBranch = prefService.getBranch(null); var prefArray = prefBranch.getChildList("" , prefCount); var prefName, prefType, prefValue, prefIndex, prefLockState; var i = 0; var j = 0; // This is used to avoid counting the "capability" preferences var k = 0; // This is to maintain a count of prefs (not including the "capability" prefs); prefArray.sort(); for (i = 0; i < prefCount.value; i++) { if((prefArray[i].indexOf("capability", 0) + 1) > 0) // avoid displaying "private" preferences { j++; continue; } k = (i - j); // avoid numbering "capability" prefs prefIndex = k + 1; if (prefBranch.prefIsLocked(prefArray[i])) prefLockState = kLocked; else if(prefBranch.prefHasUserValue(prefArray[i])) prefLockState = kUserSet; else prefLockState = kDefault; const nsIPrefBranch = Components.interfaces.nsIPrefBranch; switch (prefBranch.getPrefType(prefArray[i])) { case nsIPrefBranch.PREF_INT: prefType = kIntType; // convert to a string prefValue = "" + prefBranch.getIntPref(prefArray[i]); break; case nsIPrefBranch.PREF_BOOL: prefType = kBoolType; // convert to a string if (prefBranch.getBoolPref(prefArray[i])) prefValue = "true"; else prefValue = "false"; break; case nsIPrefBranch.PREF_STRING: default: prefType = kStrType; prefValue = htmlEscape(prefBranch.getCharPref(prefArray[i])); break; } prefArray[i] = htmlEscape(prefArray[i]); baseArray[k] = {indexCol:prefIndex, prefCol:prefArray[i], lockCol:prefLockState, typeCol:prefType, valueCol:prefValue}; } view.rowCount = k + 1; gTree = document.getElementById("configTree"); gTree.treeBoxObject.view = view;} |
k = (i - j); | var descending = document.getElementsByAttribute("sortDirection", "descending"); if (descending.length) { gSortedColumn = descending[0].id; gSortDirection = -1; } else { var ascending = document.getElementsByAttribute("sortDirection", "ascending"); if (ascending.length) gSortedColumn = ascending[0].id; else document.getElementById(gSortedColumn).setAttribute("sortDirection", "ascending"); } gSortFunction = gSortFunctions[gSortedColumn]; gPrefArray.sort(gSortFunction); gFastIndex = gPrefArray.length; gPrefBranch.addObserver("", gPrefListener, false); | function onConfigLoad(){ document.title = "about:config"; var prefCount = {value:0}; var prefService = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService); var prefBranch = prefService.getBranch(null); var prefArray = prefBranch.getChildList("" , prefCount); var prefName, prefType, prefValue, prefIndex, prefLockState; var i = 0; var j = 0; // This is used to avoid counting the "capability" preferences var k = 0; // This is to maintain a count of prefs (not including the "capability" prefs); prefArray.sort(); for (i = 0; i < prefCount.value; i++) { if((prefArray[i].indexOf("capability", 0) + 1) > 0) // avoid displaying "private" preferences { j++; continue; } k = (i - j); // avoid numbering "capability" prefs prefIndex = k + 1; if (prefBranch.prefIsLocked(prefArray[i])) prefLockState = kLocked; else if(prefBranch.prefHasUserValue(prefArray[i])) prefLockState = kUserSet; else prefLockState = kDefault; const nsIPrefBranch = Components.interfaces.nsIPrefBranch; switch (prefBranch.getPrefType(prefArray[i])) { case nsIPrefBranch.PREF_INT: prefType = kIntType; // convert to a string prefValue = "" + prefBranch.getIntPref(prefArray[i]); break; case nsIPrefBranch.PREF_BOOL: prefType = kBoolType; // convert to a string if (prefBranch.getBoolPref(prefArray[i])) prefValue = "true"; else prefValue = "false"; break; case nsIPrefBranch.PREF_STRING: default: prefType = kStrType; prefValue = htmlEscape(prefBranch.getCharPref(prefArray[i])); break; } prefArray[i] = htmlEscape(prefArray[i]); baseArray[k] = {indexCol:prefIndex, prefCol:prefArray[i], lockCol:prefLockState, typeCol:prefType, valueCol:prefValue}; } view.rowCount = k + 1; gTree = document.getElementById("configTree"); gTree.treeBoxObject.view = view;} |
prefIndex = k + 1; if (prefBranch.prefIsLocked(prefArray[i])) prefLockState = kLocked; else if(prefBranch.prefHasUserValue(prefArray[i])) prefLockState = kUserSet; else prefLockState = kDefault; const nsIPrefBranch = Components.interfaces.nsIPrefBranch; switch (prefBranch.getPrefType(prefArray[i])) { case nsIPrefBranch.PREF_INT: prefType = kIntType; prefValue = "" + prefBranch.getIntPref(prefArray[i]); break; case nsIPrefBranch.PREF_BOOL: prefType = kBoolType; if (prefBranch.getBoolPref(prefArray[i])) prefValue = "true"; else prefValue = "false"; break; case nsIPrefBranch.PREF_STRING: default: prefType = kStrType; prefValue = htmlEscape(prefBranch.getCharPref(prefArray[i])); break; } prefArray[i] = htmlEscape(prefArray[i]); baseArray[k] = {indexCol:prefIndex, prefCol:prefArray[i], lockCol:prefLockState, typeCol:prefType, valueCol:prefValue}; } view.rowCount = k + 1; gTree = document.getElementById("configTree"); gTree.treeBoxObject.view = view; | document.getElementById("configTree").view = view; | function onConfigLoad(){ document.title = "about:config"; var prefCount = {value:0}; var prefService = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService); var prefBranch = prefService.getBranch(null); var prefArray = prefBranch.getChildList("" , prefCount); var prefName, prefType, prefValue, prefIndex, prefLockState; var i = 0; var j = 0; // This is used to avoid counting the "capability" preferences var k = 0; // This is to maintain a count of prefs (not including the "capability" prefs); prefArray.sort(); for (i = 0; i < prefCount.value; i++) { if((prefArray[i].indexOf("capability", 0) + 1) > 0) // avoid displaying "private" preferences { j++; continue; } k = (i - j); // avoid numbering "capability" prefs prefIndex = k + 1; if (prefBranch.prefIsLocked(prefArray[i])) prefLockState = kLocked; else if(prefBranch.prefHasUserValue(prefArray[i])) prefLockState = kUserSet; else prefLockState = kDefault; const nsIPrefBranch = Components.interfaces.nsIPrefBranch; switch (prefBranch.getPrefType(prefArray[i])) { case nsIPrefBranch.PREF_INT: prefType = kIntType; // convert to a string prefValue = "" + prefBranch.getIntPref(prefArray[i]); break; case nsIPrefBranch.PREF_BOOL: prefType = kBoolType; // convert to a string if (prefBranch.getBoolPref(prefArray[i])) prefValue = "true"; else prefValue = "false"; break; case nsIPrefBranch.PREF_STRING: default: prefType = kStrType; prefValue = htmlEscape(prefBranch.getCharPref(prefArray[i])); break; } prefArray[i] = htmlEscape(prefArray[i]); baseArray[k] = {indexCol:prefIndex, prefCol:prefArray[i], lockCol:prefLockState, typeCol:prefType, valueCol:prefValue}; } view.rowCount = k + 1; gTree = document.getElementById("configTree"); gTree.treeBoxObject.view = view;} |
document.title = "about:config"; | gConfigBundle = document.getElementById("configBundle"); document.title = gConfigBundle.getString("title"); gLockStrs[PREF_IS_DEFAULT_VALUE] = gConfigBundle.getString("default"); gLockStrs[PREF_IS_USER_SET] = gConfigBundle.getString("user"); gLockStrs[PREF_IS_LOCKED] = gConfigBundle.getString("locked"); gTypeStrs[nsIPrefBranch.PREF_STRING] = gConfigBundle.getString("string"); gTypeStrs[nsIPrefBranch.PREF_INT] = gConfigBundle.getString("int"); gTypeStrs[nsIPrefBranch.PREF_BOOL] = gConfigBundle.getString("bool"); | function onConfigLoad(){ document.title = "about:config"; var prefCount = { value: 0 }; var prefArray = gPrefBranch.getChildList("", prefCount); for (var i = 0; i < prefCount.value; ++i) { var prefName = prefArray[i]; if (/capability/.test(prefName)) // avoid displaying "private" preferences continue; fetchPref(prefName, gPrefArray.length); } var descending = document.getElementsByAttribute("sortDirection", "descending"); if (descending.length) { gSortedColumn = descending[0].id; gSortDirection = -1; } else { var ascending = document.getElementsByAttribute("sortDirection", "ascending"); if (ascending.length) gSortedColumn = ascending[0].id; else document.getElementById(gSortedColumn).setAttribute("sortDirection", "ascending"); } gSortFunction = gSortFunctions[gSortedColumn]; gPrefArray.sort(gSortFunction); gFastIndex = gPrefArray.length; gPrefBranch.addObserver("", gPrefListener, false); document.getElementById("configTree").view = view;} |
document.getElementById("configTree").view = null; | function onConfigUnload(){ gPrefBranch.removeObserver("", gPrefListener);} |
|
} | }, | onCreateRulePopup: function() { } |
datepopup.dateField.value = formatDate( datepopup.value ); | function onDatePick( datepopup ){ // display the new date in the textbox datepopup.dateField.value = formatDate( datepopup.value ); // remember the new date in a property, "editDate". we created on the date textbox datepopup.dateField.editDate = datepopup.value; var Now = new Date(); //change the end date of recurring events to today, if the new date is after today and repeat is not checked. if ( datepopup.value > Now && !getFieldValue( "repeat-checkbox", "checked" ) ) { document.getElementById( "repeat-end-date-text" ).value = formatDate( datepopup.value ); document.getElementById( "repeat-end-date-text" ).editDate = datepopup.value; } updateAdvancedWeekRepeat(); updateAdvancedRepeatDayOfMonth(); updateAddExceptionButton(); updateOKButton();} |
|
datepopup.dateField.editDate = datepopup.value; | function onDatePick( datepopup ){ // display the new date in the textbox datepopup.dateField.value = formatDate( datepopup.value ); // remember the new date in a property, "editDate". we created on the date textbox datepopup.dateField.editDate = datepopup.value; var Now = new Date(); //change the end date of recurring events to today, if the new date is after today and repeat is not checked. if ( datepopup.value > Now && !getFieldValue( "repeat-checkbox", "checked" ) ) { document.getElementById( "repeat-end-date-text" ).value = formatDate( datepopup.value ); document.getElementById( "repeat-end-date-text" ).editDate = datepopup.value; } updateAdvancedWeekRepeat(); updateAdvancedRepeatDayOfMonth(); updateAddExceptionButton(); updateOKButton();} |
|
document.getElementById( "repeat-end-date-text" ).value = formatDate( datepopup.value ); document.getElementById( "repeat-end-date-text" ).editDate = datepopup.value; | document.getElementById( "repeat-end-date-picker" ).value = formatDate( datepopup.value ); | function onDatePick( datepopup ){ // display the new date in the textbox datepopup.dateField.value = formatDate( datepopup.value ); // remember the new date in a property, "editDate". we created on the date textbox datepopup.dateField.editDate = datepopup.value; var Now = new Date(); //change the end date of recurring events to today, if the new date is after today and repeat is not checked. if ( datepopup.value > Now && !getFieldValue( "repeat-checkbox", "checked" ) ) { document.getElementById( "repeat-end-date-text" ).value = formatDate( datepopup.value ); document.getElementById( "repeat-end-date-text" ).editDate = datepopup.value; } updateAdvancedWeekRepeat(); updateAdvancedRepeatDayOfMonth(); updateAddExceptionButton(); updateOKButton();} |
setElementValue("repeat-end-date-picker") = pickedDateTime; | setElementValue("repeat-end-date-picker", pickedDateTime); | function onDateTimePick(dateTimePicker){ var startDate = getElementValue("start-datetime"); var endDate = getElementValue("end-datetime"); var pickedDateTime = new Date(dateTimePicker.value); var duration = ( endDate.getTime() - startDate.getTime() ); if (dateTimePicker.id == "end-datetime") { if (getElementValue("all-day-event-checkbox", "checked")) { //display enddate == ical enddate - 1 (for allday events) pickedDateTime.setDate( pickedDateTime.getDate() + 1 ); } setElementValue("end-datetime", pickedDateTime); endDate = getElementValue("end-datetime"); // save the duration duration = endDate.getTime() - startDate.getTime(); updateOKButton(); return; } if (dateTimePicker.id == "start-datetime") { setElementValue("start-datetime", pickedDateTime); startDate = getElementValue("start-datetime"); // preserve the previous duration by changing end endDate.setTime(startDate.getTime() + duration ); var displayEndDate = new Date(endDate) if (getElementValue("all-day-event-checkbox", "checked")) { //display enddate == ical enddate - 1 (for allday events) displayEndDate.setDate( displayEndDate.getDate() - 1 ); } setElementValue("end-datetime", displayEndDate); } var now = new Date(); // change the end date of recurring events to today, // if the new date is after today and repeat is not checked. if (pickedDateTime.getTime() > now.getTime() && !getElementValue("repeat-checkbox", "checked") ) { setElementValue("repeat-end-date-picker") = pickedDateTime; } updateAdvancedWeekRepeat(); updateAdvancedRepeatDayOfMonth(); updateAddExceptionButton(); updateOKButton();} |
document.getElementById( "end-datetime" ).value = gEndDate; | var userEndDate =new Date(gEndDate) if( getFieldValue( "all-day-event-checkbox", "checked" ) ) { userEndDate.setDate( userEndDate.getDate() - 1 ); } document.getElementById( "end-datetime" ).value = userEndDate; | function onDateTimePick( dateTimePicker ){ var pickedDateTime = new Date( dateTimePicker.value); if( dateTimePicker.id == "end-datetime" ) { gEndDate = pickedDateTime; // save the duration gDuration = gEndDate.getTime() - gStartDate.getTime(); updateOKButton(); return; } if( dateTimePicker.id == "start-datetime" ) { gStartDate = pickedDateTime; // preserve the previous duration by changing end gEndDate.setTime( gStartDate.getTime() + gDuration ); document.getElementById( "end-datetime" ).value = gEndDate; } var now = new Date(); // change the end date of recurring events to today, // if the new date is after today and repeat is not checked. if ( pickedDateTime.getTime() > now.getTime() && !getFieldValue( "repeat-checkbox", "checked" ) ) { document.getElementById( "repeat-end-date-picker" ).value = pickedDateTime; } updateAdvancedWeekRepeat(); updateAdvancedRepeatDayOfMonth(); updateAddExceptionButton(); updateOKButton();} |
}, | } | onDblClick: function( event ) { addSelectedAddressesIntoInviteBucket( '', '' ); }, |
if (t.localName != "outlinerbody") | if (t.localName != "outlinerchildren") | function onDblClick(e) { var t = e.originalTarget; if (t.localName != "outlinerbody") return; openSelectedFile();} |
if (e.button != 0) return; | function onDblClick(e) { var t = e.originalTarget; if (t.localName != "treechildren") return; openSelectedFile();} |
|
smtpService.deleteSmtpServer(server); | gDeletedSmtpServers[gDeletedSmtpServers.length] = server.key; | function onDelete(event){ var server = getSelectedServer(); if (!server) return; smtpService.deleteSmtpServer(server); refreshServerList();} |
var protocolinfo = Components.classes["component: | var protocolinfo = Components.classes["@mozilla.org/messenger/protocol/info;1?type=" + type].getService(Components.interfaces.nsIMsgProtocolInfo); | function onDeleteAccount(event) { //dump("onDeleteAccount\n"); if (event.target.getAttribute("disabled") == "true") return; var result = getServerIdAndPageIdFromTree(accounttree); if (!result) return; var account = getAccountFromServerId(result.serverId); if (!account) return; var server = account.incomingServer; var type = server.type; var protocolinfo = Components.classes["component://netscape/messenger/protocol/info;type=" + type].getService(Components.interfaces.nsIMsgProtocolInfo); if (!protocolinfo.canDelete) return; var confirmDeleteAccount = Bundle.GetStringFromName("confirmDeleteAccount"); if (!window.confirm(confirmDeleteAccount)) return; try { // clear cached data out of the account array if (accountArray[result.serverId]) accountArray[result.serverId] = null; currentServerId = currentPageId = null; accountManager.removeAccount(account); selectServer(null); } catch (ex) { dump("failure to delete account: " + ex + "\n"); var alertText = Bundle.GetStringFromName("failedDeleteAccount"); window.alert(alertText); }} |
if (!protocolinfo.canDelete) return; | var canDelete = protocolinfo.canDelete; if (!canDelete) { canDelete = server.canDelete; } if (!canDelete) return; | function onDeleteAccount(event) { //dump("onDeleteAccount\n"); if (event.target.getAttribute("disabled") == "true") return; var result = getServerIdAndPageIdFromTree(accounttree); if (!result) return; var account = getAccountFromServerId(result.serverId); if (!account) return; var server = account.incomingServer; var type = server.type; var protocolinfo = Components.classes["@mozilla.org/messenger/protocol/info;1?type=" + type].getService(Components.interfaces.nsIMsgProtocolInfo); if (!protocolinfo.canDelete) return; var confirmDeleteAccount = Bundle.GetStringFromName("confirmDeleteAccount"); if (!window.confirm(confirmDeleteAccount)) return; try { // clear cached data out of the account array if (accountArray[result.serverId]) accountArray[result.serverId] = null; currentServerId = currentPageId = null; accountManager.removeAccount(account); selectServer(null); } catch (ex) { dump("failure to delete account: " + ex + "\n"); var alertText = Bundle.GetStringFromName("failedDeleteAccount"); window.alert(alertText); }} |
if (client.viewsArray.length < 2) { client.currentObject.display ("Cannot delete last view.", "ERROR"); return; } | function onDeleteCurrentView(){ var tb = getTBForObject(client.currentObject); if (tb) { var i = deleteToolbutton (tb); if (i != -1) { delete client.currentObject.messages; if (i >= client.viewsArray.length) i = client.viewsArray.length - 1; setCurrentObject (client.viewsArray[i].source); } } } |
|
delete client.currentObject.messageCount; | function onDeleteCurrentView(){ var tb = getTabForObject(client.currentObject); if (client.viewsArray.length < 2) { client.currentObject.display (getMsg("onDeleteCurrentViewMsg"), "ERROR"); return; } if (tb) { var i = deleteTab (tb); if (i != -1) { delete client.currentObject.messages; if (i >= client.viewsArray.length) i = client.viewsArray.length - 1; setCurrentObject (client.viewsArray[i].source); } } } |
|
for each (obs in this.compCalendar.mObservers) obs.onDeleteItem(aDeletedItem); | this.notifyObservers("onDeleteItem", arguments); | onDeleteItem: function(aDeletedItem) { for each (obs in this.compCalendar.mObservers) obs.onDeleteItem(aDeletedItem); }, |
onDeleteItem: function (aItem) { if (aItem instanceof Components.interfaces.calITodo) | onDeleteItem: function(aDeletedItem) { if (aDeletedItem instanceof Components.interfaces.calITodo && !this.mInBatch) | onDeleteItem: function (aItem) { if (aItem instanceof Components.interfaces.calITodo) toDoUnifinderRefresh(); }, |
dump("In OnDeleteOrMoveMessagesCompleted\n"); | OnDeleteOrMoveMessagesCompleted :function(folder) { dump("In OnDeleteOrMoveMessagesCompleted\n"); if(IsCurrentLoadedFolder(folder)) { msgNavigationService.EnsureDocumentIsLoaded(document); dump("next message uri is " + gNextMessageAfterDelete + "\n"); if(gNextMessageAfterDelete) { var nextMessage = document.getElementById(gNextMessageAfterDelete); if(!nextMessage) dump("No next message after delete\n"); SelectNextMessage(nextMessage); var threadTree = GetThreadTree(); if(threadTree) threadTree.ensureElementIsVisible(nextMessage); else dump("No thread tree\n"); gNextMessageAfterDelete = null; } } } |
|
dump("next message uri is " + gNextMessageAfterDelete + "\n"); | OnDeleteOrMoveMessagesCompleted :function(folder) { dump("In OnDeleteOrMoveMessagesCompleted\n"); if(IsCurrentLoadedFolder(folder)) { msgNavigationService.EnsureDocumentIsLoaded(document); dump("next message uri is " + gNextMessageAfterDelete + "\n"); if(gNextMessageAfterDelete) { var nextMessage = document.getElementById(gNextMessageAfterDelete); if(!nextMessage) dump("No next message after delete\n"); SelectNextMessage(nextMessage); var threadTree = GetThreadTree(); if(threadTree) threadTree.ensureElementIsVisible(nextMessage); else dump("No thread tree\n"); gNextMessageAfterDelete = null; } } } |
|
if(!nextMessage) dump("No next message after delete\n"); | OnDeleteOrMoveMessagesCompleted :function(folder) { dump("In OnDeleteOrMoveMessagesCompleted\n"); if(IsCurrentLoadedFolder(folder)) { msgNavigationService.EnsureDocumentIsLoaded(document); dump("next message uri is " + gNextMessageAfterDelete + "\n"); if(gNextMessageAfterDelete) { var nextMessage = document.getElementById(gNextMessageAfterDelete); if(!nextMessage) dump("No next message after delete\n"); SelectNextMessage(nextMessage); var threadTree = GetThreadTree(); if(threadTree) threadTree.ensureElementIsVisible(nextMessage); else dump("No thread tree\n"); gNextMessageAfterDelete = null; } } } |
|
else dump("No thread tree\n"); | OnDeleteOrMoveMessagesCompleted :function(folder) { dump("In OnDeleteOrMoveMessagesCompleted\n"); if(IsCurrentLoadedFolder(folder)) { msgNavigationService.EnsureDocumentIsLoaded(document); dump("next message uri is " + gNextMessageAfterDelete + "\n"); if(gNextMessageAfterDelete) { var nextMessage = document.getElementById(gNextMessageAfterDelete); if(!nextMessage) dump("No next message after delete\n"); SelectNextMessage(nextMessage); var threadTree = GetThreadTree(); if(threadTree) threadTree.ensureElementIsVisible(nextMessage); else dump("No thread tree\n"); gNextMessageAfterDelete = null; } } } |
|
var file = Components.classes[nsILocalFile_PROGID].createInstance(nsILocalFile); | var file = Components.classes[nsILocalFile_CONTRACTID].createInstance(nsILocalFile); | function onDirectoryChanged(target){ var path = target.getAttribute("value"); var file = Components.classes[nsILocalFile_PROGID].createInstance(nsILocalFile); file.initWithPath(path); gotoDirectory(file);} |
var file = Components.classes[NS_LOCALFILE_CONTRACTID].createInstance(nsILocalFile); | var file = Components.classes[NS_LOCAL_FILE_CONTRACTID].createInstance(nsILocalFile); | function onDirectoryChanged(target){ var path = target.getAttribute("label"); var file = Components.classes[NS_LOCALFILE_CONTRACTID].createInstance(nsILocalFile); file.initWithPath(path); if (!sfile.equals(file)) { // Do this on a timeout callback so the directory list can roll up // and we don't keep the mouse grabbed while we are loading. setTimeout(gotoDirectory, 0, file); }} |
this._wiz.getButton("back").disabled = true; this._wiz.getButton("finish").disabled = false; | this._wiz.canRewind = false; | onDonePageShow: function () { this._wiz.getButton("cancel").disabled = true; this._wiz.getButton("back").disabled = true; this._wiz.getButton("finish").disabled = false; this._listItems("doneItems"); } |
result.copyTo(backupDir, makeName('initial')); | copyToOverwriting(result, backupDir, makeName('initial')); | onDownloadComplete: function(downloader, request, ctxt, status, result) { if (doInitialBackup) result.copyTo(backupDir, makeName('initial')); if (doDailyBackup) result.copyTo(backupDir, dailyBackupFileName); provider.doWriteICS(); }, |
result.copyTo(backupDir, dailyBackupFileName); | copyToOverwriting(result, backupDir, dailyBackupFileName); | onDownloadComplete: function(downloader, request, ctxt, status, result) { if (doInitialBackup) result.copyTo(backupDir, makeName('initial')); if (doDailyBackup) result.copyTo(backupDir, dailyBackupFileName); provider.doWriteICS(); }, |
Feed.onDownloaded = function(event) { var request = event.target; var url = request.channel.originalURI.spec; debug(url + " downloaded"); var feed = FeedCache.getFeed(url); if (!feed) throw("error after downloading " + url + ": couldn't retrieve feed from request"); feed.parse(); } | onDownloaded: function(aEvent) { var request = aEvent.target; var url = request.channel.originalURI.spec; debug(url + " downloaded"); var feed = FeedCache.getFeed(url); if (!feed) throw("error after downloading " + url + ": couldn't retrieve feed from request"); feed.parse(); }, | Feed.onDownloaded = function(event) { var request = event.target; var url = request.channel.originalURI.spec; debug(url + " downloaded"); var feed = FeedCache.getFeed(url); if (!feed) throw("error after downloading " + url + ": couldn't retrieve feed from request"); feed.parse(); // parse will asynchronously call the download callback when it is done} |
feed.downloaded(nsnull); | feed.downloaded(feed, false); | Feed.onDownloadError = function(event) { // XXX add error message if available and notify the user? var request = event.target; var url = request.channel.originalURI.spec; var feed = gFzFeedCache[url]; if (feed) { debug(feed.title + " download failed"); if (feed.downloadCallback) feed.downloaded(nsnull); } throw("error downloading feed " + url);} |
Feed.onDownloadError = function(event) { var request = event.target; var url = request.channel.originalURI.spec; var feed = FeedCache.getFeed(url); if (feed.downloadCallback) feed.downloadCallback.downloaded(feed, kNewsBlogRequestFailure); FeedCache.removeFeed(url); } | onDownloadError: function(aEvent) { var request = aEvent.target; var url = request.channel.originalURI.spec; var feed = FeedCache.getFeed(url); if (feed.downloadCallback) feed.downloadCallback.downloaded(feed, kNewsBlogRequestFailure); FeedCache.removeFeed(url); }, | Feed.onDownloadError = function(event) { var request = event.target; var url = request.channel.originalURI.spec; var feed = FeedCache.getFeed(url); if (feed.downloadCallback) feed.downloadCallback.downloaded(feed, kNewsBlogRequestFailure); FeedCache.removeFeed(url);} |
var request = event.target; var url = request.channel.originalURI.spec; var feed = gFzFeedCache[url]; if (feed) { debug(feed.title + " download failed"); if (feed.downloadCallback) feed.downloaded(feed, false); } throw("error downloading feed " + url); | if (feed.downloadCallback) feed.downloadCallback.downloaded(feed, kNewsBlogRequestFailure); | Feed.onDownloadError = function(event) { // XXX add error message if available and notify the user? var request = event.target; var url = request.channel.originalURI.spec; var feed = gFzFeedCache[url]; if (feed) { debug(feed.title + " download failed"); if (feed.downloadCallback) feed.downloaded(feed, false); } throw("error downloading feed " + url);} |
if (children[i].id == "NC:PersonalToolbarFolder") { | if (children[i].id == "NC:PersonalToolbarFolder" && children[i].localName == "hbox") { | onDragCloseMenu: function (aNode) { var children = aNode.childNodes; for (var i = 0; i < children.length; i++) { if (children[i].id == "NC:PersonalToolbarFolder") { this.onDragCloseMenu(children[i]); } else if (this.isContainer(children[i]) && children[i].getAttribute("open") == "true") { this.onDragCloseMenu(children[i].firstChild); if (children[i] != this.mCurrentDragOverTarget || this.mCurrentDropPosition != this.DROP_ON) children[i].firstChild.hidePopup(); } } }, |
if (this.mCurrentDragOverTarget.parentNode.id == "NC:PersonalToolbarFolder") | if (this.mCurrentDragOverTarget.parentNode.id == "NC:PersonalToolbarFolder" && this.mCurrentDragOverTarget.parentNode.localName == "hbox") | onDragCloseTarget: function () { // if the mouse is not over a menu, then close everything. if (!this.mCurrentDragOverTarget) { this.onDragCloseMenu(document.getElementById("PersonalToolbar")); return } // The bookmark button is not a sibling of the folders in the PT if (this.mCurrentDragOverTarget.parentNode.id == "NC:PersonalToolbarFolder") this.onDragCloseMenu(document.getElementById("PersonalToolbar")); else this.onDragCloseMenu(this.mCurrentDragOverTarget.parentNode); }, |
if (currentObserver != this.mObservers[i]) | if (currentObserver != this.mObservers[i]) { | onDragCloseTarget: function () { var currentObserver = this.getObserverForNode(this.mCurrentDragOverTarget); // close all the menus not hovered by the mouse for (var i=0; i < this.mObservers.length; i++) { if (currentObserver != this.mObservers[i]) this.onDragCloseMenu(this.mObservers[i]); else this.onDragCloseMenu(this.mCurrentDragOverTarget.parentNode); } }, |
else | if (this.mObservers[i].parentNode.id == "bookmarks-menu") this.mObservers[i].hidePopup(); } else | onDragCloseTarget: function () { var currentObserver = this.getObserverForNode(this.mCurrentDragOverTarget); // close all the menus not hovered by the mouse for (var i=0; i < this.mObservers.length; i++) { if (currentObserver != this.mObservers[i]) this.onDragCloseMenu(this.mObservers[i]); else this.onDragCloseMenu(this.mCurrentDragOverTarget.parentNode); } }, |
onDragExit: function () | onDragExit: function (aEvent, aDragSession) | onDragExit: function () { var homeButton = document.getElementById("homebutton"); homeButton.removeAttribute("home-dragover"); statusTextFld.setAttribute("value", gStatus); gStatus = null; }, |
if (aDragSession.sourceDocument == window._content.document) | if (aDragSession.sourceDocument == window._content.document) { | onDragOver: function (aEvent, aFlavour, aDragSession) { // if the drag originated w/in this content area, bail early. This avoids loading // a URL dragged from the content area into the very same content area (which is // almost never the desired action). This code is a bit too simplistic and may // have problems with nested frames, but that's not my problem ;) if (aDragSession.sourceDocument == window._content.document) aDragSession.canDrop = false; }, |
return; } aDragSession.dragAction = Components.interfaces.nsIDragService.DRAGDROP_ACTION_LINK; | onDragOver: function (aEvent, aFlavour, aDragSession) { // if the drag originated w/in this content area, bail early. This avoids loading // a URL dragged from the content area into the very same content area (which is // almost never the desired action). This code is a bit too simplistic and may // have problems with nested frames, but that's not my problem ;) if (aDragSession.sourceDocument == window._content.document) aDragSession.canDrop = false; }, |
|
onDragOver: function (aEvent, aFlavour) | onDragOver: function (aEvent, aFlavour, aDragSession) | onDragOver: function (aEvent, aFlavour) { // temporary if (!isPToolbarDNDEnabled()) return false; var toolbar = document.getElementById("PersonalToolbar"); toolbar.setAttribute("dd-triggerrepaint", 0); }, |
var attachmentBox = document.getElementById("attachments-box"); if (attachmentBox.hidden) | if (aFlavour.contentType != "text/x-moz-address") | onDragOver: function (aEvent, aFlavour, aDragSession) { // make sure the attachment box is visible during drag over var attachmentBox = document.getElementById("attachments-box"); if (attachmentBox.hidden) { attachmentBox.hidden = false; document.getElementById("attachmentbucket-sizer").hidden=false; } }, |
attachmentBox.hidden = false; document.getElementById("attachmentbucket-sizer").hidden=false; | var attachmentBox = document.getElementById("attachments-box"); if (attachmentBox.hidden) { attachmentBox.hidden = false; document.getElementById("attachmentbucket-sizer").hidden=false; } | onDragOver: function (aEvent, aFlavour, aDragSession) { // make sure the attachment box is visible during drag over var attachmentBox = document.getElementById("attachments-box"); if (attachmentBox.hidden) { attachmentBox.hidden = false; document.getElementById("attachmentbucket-sizer").hidden=false; } }, |
if (aEvent.getPreventDefault()) return; | onDragOver: function (aEvent, aFlavour, aDragSession) { // if the drag originated w/in this content area, bail early. This avoids loading // a URL dragged from the content area into the very same content area (which is // almost never the desired action). This code is a bit too simplistic and may // have problems with nested frames, but that's not my problem ;) if (aDragSession.sourceDocument == window._content.document) { aDragSession.canDrop = false; return; } // this causes d&d problems on windows -- see bug 68058 //aDragSession.dragAction = Components.interfaces.nsIDragService.DRAGDROP_ACTION_LINK; }, |
|
if (aDragSession.sourceDocument == window._content.document) { | if (aDragSession.sourceDocument == aEvent.view.document) { | onDragOver: function (aEvent, aFlavour, aDragSession) { if (aEvent.getPreventDefault()) return; // if the drag originated w/in this content area, bail early. This avoids loading // a URL dragged from the content area into the very same content area (which is // almost never the desired action). This code is a bit too simplistic and may // have problems with nested frames, but that's not my problem ;) if (aDragSession.sourceDocument == window._content.document) { aDragSession.canDrop = false; return; } // this causes d&d problems on windows -- see bug 68058 //aDragSession.dragAction = Components.interfaces.nsIDragService.DRAGDROP_ACTION_LINK; }, |
} else if (aTarget.localName == "hbox") { aTarget.lastChild.removeAttribute("dragover-right"); | onDragRemoveFeedBack: function (aTarget) { if (aTarget.localName == "toolbar") { aTarget.lastChild.lastChild.removeAttribute("dragover-right"); } else { aTarget.removeAttribute("dragover-left"); aTarget.removeAttribute("dragover-right"); aTarget.removeAttribute("dragover-top"); aTarget.removeAttribute("dragover-bottom"); } }, |
|
var bt = document.getElementById("bookmarks-toolbar"); | bt = document.getElementById("bookmarks-toolbar"); | onDragRemoveFeedBack: function (aTarget) { var newTarget; if (aTarget.localName == "hbox") { // hit when dropping in the bt or between the last visible bookmark // and the chevron var bt = document.getElementById("bookmarks-toolbar"); newTarget = bt.getLastVisibleBookmark(); if (newTarget) newTarget.removeAttribute("dragover-right"); } else if (aTarget.localName == "stack") { var bt = document.getElementById("bookmarks-toolbar"); newTarget = bt.getLastVisibleBookmark(); newTarget.removeAttribute("dragover-right"); } else { aTarget.removeAttribute("dragover-left"); aTarget.removeAttribute("dragover-right"); aTarget.removeAttribute("dragover-top"); aTarget.removeAttribute("dragover-bottom"); } }, |
if (aTarget.localName == "bookmarks-toolbar") { var ptf = document.getAnonymousElementByAttribute(aTarget, "anonid", "bookmarks-ptf"); if (ptf.hasChildNodes()) ptf.lastChild.removeAttribute("dragover-right"); } else if (aTarget.localName == "hbox") { aTarget.lastChild.removeAttribute("dragover-right"); | if (aTarget.localName == "hbox") { var bt = document.getElementById("bookmarks-toolbar"); var newTarget = bt.getLastVisibleBookmark(); if (newTarget) newTarget.removeAttribute("dragover-right"); } else if (aTarget.localName == "stack") { var bt = document.getElementById("bookmarks-toolbar"); var newTarget = bt.getLastVisibleBookmark(); newTarget.removeAttribute("dragover-right"); | onDragRemoveFeedBack: function (aTarget) { if (aTarget.localName == "bookmarks-toolbar") { var ptf = document.getAnonymousElementByAttribute(aTarget, "anonid", "bookmarks-ptf"); if (ptf.hasChildNodes()) ptf.lastChild.removeAttribute("dragover-right"); } else if (aTarget.localName == "hbox") { aTarget.lastChild.removeAttribute("dragover-right"); } else { aTarget.removeAttribute("dragover-left"); aTarget.removeAttribute("dragover-right"); aTarget.removeAttribute("dragover-top"); aTarget.removeAttribute("dragover-bottom"); } }, |
aTarget.lastChild.setAttribute("dragover-right", "true"); | var bt = document.getElementById("bookmarks-toolbar"); var newTarget = bt.getLastVisibleBookmark(); if (newTarget) newTarget.setAttribute("dragover-right", "true"); | onDragSetFeedBack: function (aTarget, aOrientation) { switch (aTarget.localName) { case "toolbarseparator": case "toolbarbutton": switch (aOrientation) { case BookmarksUtils.DROP_BEFORE: aTarget.setAttribute("dragover-left", "true"); break; case BookmarksUtils.DROP_AFTER: aTarget.setAttribute("dragover-right", "true"); break; case BookmarksUtils.DROP_ON: aTarget.setAttribute("dragover-top" , "true"); aTarget.setAttribute("dragover-bottom", "true"); aTarget.setAttribute("dragover-left" , "true"); aTarget.setAttribute("dragover-right" , "true"); break; } break; case "menuseparator": case "menu": case "menuitem": switch (aOrientation) { case BookmarksUtils.DROP_BEFORE: aTarget.setAttribute("dragover-top", "true"); break; case BookmarksUtils.DROP_AFTER: aTarget.setAttribute("dragover-bottom", "true"); break; case BookmarksUtils.DROP_ON: break; } break; case "hbox" : aTarget.lastChild.setAttribute("dragover-right", "true"); break; case "menupopup": case "toolbar" : break; case "bookmarks-toolbar": break; // no personal toolbar folder default: dump("No feedback for: "+aTarget.localName+"\n"); } }, |
case "menupopup": case "toolbar" : break; case "bookmarks-toolbar": break; default: dump("No feedback for: "+aTarget.localName+"\n"); | case "stack" : case "menupopup": break; default: dump("No feedback for: "+aTarget.localName+"\n"); | onDragSetFeedBack: function (aTarget, aOrientation) { switch (aTarget.localName) { case "toolbarseparator": case "toolbarbutton": switch (aOrientation) { case BookmarksUtils.DROP_BEFORE: aTarget.setAttribute("dragover-left", "true"); break; case BookmarksUtils.DROP_AFTER: aTarget.setAttribute("dragover-right", "true"); break; case BookmarksUtils.DROP_ON: aTarget.setAttribute("dragover-top" , "true"); aTarget.setAttribute("dragover-bottom", "true"); aTarget.setAttribute("dragover-left" , "true"); aTarget.setAttribute("dragover-right" , "true"); break; } break; case "menuseparator": case "menu": case "menuitem": switch (aOrientation) { case BookmarksUtils.DROP_BEFORE: aTarget.setAttribute("dragover-top", "true"); break; case BookmarksUtils.DROP_AFTER: aTarget.setAttribute("dragover-bottom", "true"); break; case BookmarksUtils.DROP_ON: break; } break; case "hbox" : aTarget.lastChild.setAttribute("dragover-right", "true"); break; case "menupopup": case "toolbar" : break; case "bookmarks-toolbar": break; // no personal toolbar folder default: dump("No feedback for: "+aTarget.localName+"\n"); } }, |
if (target.localName == "descriptionitem") | if (target.localName == "listitem") | onDragStart: function (aEvent, aAttachmentData, aDragAction) { var target = aEvent.target; if (target.localName == "descriptionitem") { var attachmentUrl = target.getAttribute("attachmentUrl"); var attachmentDisplayName = target.getAttribute("label"); var attachmentContentType = target.getAttribute("attachmentContentType"); var tmpurl = attachmentUrl; tmpurl = tmpurl + "&type=" + attachmentContentType + "&filename=" + attachmentDisplayName; aAttachmentData.data = new TransferData(); if (attachmentUrl && attachmentDisplayName) { aAttachmentData.data.addDataForFlavour("text/x-moz-url-data", tmpurl); aAttachmentData.data.addDataForFlavour("text/x-moz-url-desc", attachmentDisplayName); aAttachmentData.data.addDataForFlavour("application/x-moz-file-promise-url", tmpurl); aAttachmentData.data.addDataForFlavour("application/x-moz-file-promise", new nsFlavorDataProvider(), 0, Components.interfaces.nsISupports); aAttachmentData.data.addDataForFlavour("text/x-moz-url", tmpurl + "\n" + attachmentDisplayName); } } } |
}, | } | onDragStart: function (aEvent) { var title = aEvent.target.getAttribute("value"); var uri = aEvent.target.parentNode.parentNode.id; dump("*** title = " + title + "; uri = " + uri + "\n"); if ( aEvent.target.localName != "treecell" ) // make sure we have something to drag return null; var htmlString = "<A HREF='" + uri + "'>" + title + "</A>"; var flavourList = { }; flavourList["text/unicode"] = { width: 2, data: uri }; flavourList["text/html"] = { width: 2, data: htmlString }; flavourList["text/x-moz-url"] = { width: 2, data: uri + "\n" + title }; return flavourList; }, |
if ( title == "" && uri == "" ) | if ( aEvent.target.localName != "treecell" ) | onDragStart: function (aEvent) { var title = aEvent.target.getAttribute("value"); var uri = aEvent.target.parentNode.parentNode.id; dump("*** title = " + title + "; uri = " + uri + "\n"); if ( title == "" && uri == "" ) // make sure we have something to drag return null; var htmlString = "<A HREF='" + uri + "'>" + title + "</A>"; var flavourList = { }; flavourList["text/unicode"] = { width: 2, data: uri }; flavourList["text/html"] = { width: 2, data: htmlString }; flavourList["text/x-moz-url"] = { width: 2, data: uri + " " + "[ TEMP TITLE ]" }; return flavourList; }, |
flavourList["text/x-moz-url"] = { width: 2, data: uri + " " + "[ TEMP TITLE ]" }; | flavourList["text/x-moz-url"] = { width: 2, data: uri + " " + title }; | onDragStart: function (aEvent) { var title = aEvent.target.getAttribute("value"); var uri = aEvent.target.parentNode.parentNode.id; dump("*** title = " + title + "; uri = " + uri + "\n"); if ( title == "" && uri == "" ) // make sure we have something to drag return null; var htmlString = "<A HREF='" + uri + "'>" + title + "</A>"; var flavourList = { }; flavourList["text/unicode"] = { width: 2, data: uri }; flavourList["text/html"] = { width: 2, data: htmlString }; flavourList["text/x-moz-url"] = { width: 2, data: uri + " " + "[ TEMP TITLE ]" }; return flavourList; }, |
aXferData.data.addDataForFlavour("text/x-moz-url", url + "\n" + title); | aXferData.data.addDataForFlavour("text/x-moz-url", uri + "\n" + title); | onDragStart: function (aEvent, aXferData, aDragAction) { var title = aEvent.target.getAttribute("label"); var uri = aEvent.target.parentNode.parentNode.id; if (aEvent.target.localName != "treecell") // make sure we have something to drag return null; var htmlString = "<A HREF='" + uri + "'>" + title + "</A>"; aXferData.data = new TransferData(); aXferData.data.addDataForFlavour("text/unicode", uri); aXferData.data.addDataForFlavour("text/html", htmlString); aXferData.data.addDataForFlavour("text/x-moz-url", url + "\n" + title); } |
tmpurl = tmpurl + "&type=" + attachmentContentType + "&filename=" + attachmentDisplayName; | var tmpurlWithExtraInfo = tmpurl + "&type=" + attachmentContentType + "&filename=" + attachmentDisplayName; | onDragStart: function (aEvent, aAttachmentData, aDragAction) { var target = aEvent.target; if (target.localName == "listitem") { var attachmentUrl = target.getAttribute("attachmentUrl"); var attachmentDisplayName = target.getAttribute("label"); var attachmentContentType = target.getAttribute("attachmentContentType"); var tmpurl = attachmentUrl; tmpurl = tmpurl + "&type=" + attachmentContentType + "&filename=" + attachmentDisplayName; aAttachmentData.data = new TransferData(); if (attachmentUrl && attachmentDisplayName) { aAttachmentData.data.addDataForFlavour("text/x-moz-url", tmpurl + "\n" + attachmentDisplayName); aAttachmentData.data.addDataForFlavour("text/x-moz-url-data", tmpurl); aAttachmentData.data.addDataForFlavour("text/x-moz-url-desc", attachmentDisplayName); aAttachmentData.data.addDataForFlavour("application/x-moz-file-promise-url", tmpurl); aAttachmentData.data.addDataForFlavour("application/x-moz-file-promise", new nsFlavorDataProvider(), 0, Components.interfaces.nsISupports); } } } |
aAttachmentData.data.addDataForFlavour("text/x-moz-url", tmpurl + "\n" + attachmentDisplayName); | aAttachmentData.data.addDataForFlavour("text/x-moz-url", tmpurlWithExtraInfo + "\n" + attachmentDisplayName); | onDragStart: function (aEvent, aAttachmentData, aDragAction) { var target = aEvent.target; if (target.localName == "listitem") { var attachmentUrl = target.getAttribute("attachmentUrl"); var attachmentDisplayName = target.getAttribute("label"); var attachmentContentType = target.getAttribute("attachmentContentType"); var tmpurl = attachmentUrl; tmpurl = tmpurl + "&type=" + attachmentContentType + "&filename=" + attachmentDisplayName; aAttachmentData.data = new TransferData(); if (attachmentUrl && attachmentDisplayName) { aAttachmentData.data.addDataForFlavour("text/x-moz-url", tmpurl + "\n" + attachmentDisplayName); aAttachmentData.data.addDataForFlavour("text/x-moz-url-data", tmpurl); aAttachmentData.data.addDataForFlavour("text/x-moz-url-desc", attachmentDisplayName); aAttachmentData.data.addDataForFlavour("application/x-moz-file-promise-url", tmpurl); aAttachmentData.data.addDataForFlavour("application/x-moz-file-promise", new nsFlavorDataProvider(), 0, Components.interfaces.nsISupports); } } } |
return; | return false; | onDragStart: function (aEvent, aXferData, aDragAction) { var target = aEvent.target; // Prevent dragging from invalid regions // can't drag from the empty areas if (target.id == "bookmarks-menu" || target.id == "bookmarks-chevron" || target.id == "bookmarks-ptf") return false; if (!BookmarksMenu.isBTBookmark(target.id)) return false; // Prevent dragging out of menupopups on non Win32 platforms. // a) on Mac drag from menus is generally regarded as being satanic // b) on Linux, this causes an X-server crash, (bug 151336) // c) on Windows, there is no hang or crash associated with this, so we'll leave // the functionality there. if (navigator.platform != "Win32" && target.localName != "toolbarbutton") return; // a drag start is fired when leaving an open toolbarbutton(type=menu) // (see bug 143031) if (this.isContainer(target)) { if (this.isPlatformNotSupported) return; if (!aEvent.shiftKey && !aEvent.altKey && !aEvent.ctrlKey) return; // menus open on mouse down target.firstChild.hidePopup(); } var selection = BookmarksMenu.getBTSelection(target); aXferData.data = BookmarksUtils.getXferDataFromSelection(selection); }, |
return true; | onDragStart: function (aEvent, aXferData, aDragAction) { var target = aEvent.target; // Prevent dragging from invalid regions // can't drag from the empty areas if (target.id == "bookmarks-menu" || target.id == "bookmarks-chevron" || target.id == "bookmarks-ptf") return false; if (!BookmarksMenu.isBTBookmark(target.id)) return false; // Prevent dragging out of menupopups on non Win32 platforms. // a) on Mac drag from menus is generally regarded as being satanic // b) on Linux, this causes an X-server crash, (bug 151336) // c) on Windows, there is no hang or crash associated with this, so we'll leave // the functionality there. if (navigator.platform != "Win32" && target.localName != "toolbarbutton") return; // a drag start is fired when leaving an open toolbarbutton(type=menu) // (see bug 143031) if (this.isContainer(target)) { if (this.isPlatformNotSupported) return; if (!aEvent.shiftKey && !aEvent.altKey && !aEvent.ctrlKey) return; // menus open on mouse down target.firstChild.hidePopup(); } var selection = BookmarksMenu.getBTSelection(target); aXferData.data = BookmarksUtils.getXferDataFromSelection(selection); }, |
|
flavourList["text/x-moz-url"] = { width: 2, data: escape(uri) + " " + title }; | flavourList["text/x-moz-url"] = { width: 2, data: uri + " " + title }; | onDragStart: function (aEvent) { var title = aEvent.target.getAttribute("value"); var uri = aEvent.target.parentNode.parentNode.id; dump("*** title = " + title + "; uri = " + uri + "\n"); if ( aEvent.target.localName != "treecell" ) // make sure we have something to drag return null; var htmlString = "<A HREF='" + uri + "'>" + title + "</A>"; var flavourList = { }; flavourList["text/unicode"] = { width: 2, data: uri }; flavourList["text/html"] = { width: 2, data: htmlString }; flavourList["text/x-moz-url"] = { width: 2, data: escape(uri) + " " + title }; return flavourList; }, |
var url = builder.getResourceAtIndex(currentIndex).Value; | var url = builder.getResourceAtIndex(currentIndex).ValueUTF8; | onDragStart: function (aEvent, aXferData, aDragAction) { var currentIndex = gHistoryTree.currentIndex; if (isContainer(gHistoryTree, currentIndex)) return false; var builder = gHistoryTree.builder.QueryInterface(Components.interfaces.nsIXULTreeBuilder); var url = builder.getResourceAtIndex(currentIndex).Value; var title = gHistoryTree.treeBoxObject.view.getCellText(currentIndex, "Name"); var htmlString = "<A HREF='" + url + "'>" + title + "</A>"; aXferData.data = new TransferData(); aXferData.data.addDataForFlavour("text/unicode", url); aXferData.data.addDataForFlavour("text/html", htmlString); aXferData.data.addDataForFlavour("text/x-moz-url", url + "\n" + title); return true; } |
flavourList["text/x-moz-url"] = { width: 2, data: escape(urlBar.value) + " " + window.title }; | flavourList["text/x-moz-url"] = { width: 2, data: urlBar.value + " " + window._content.document.title }; | onDragStart: function () { var urlBar = document.getElementById("urlbar"); var flavourList = { }; flavourList["text/unicode"] = { width: 2, data: urlBar.value }; flavourList["text/x-moz-url"] = { width: 2, data: escape(urlBar.value) + " " + window.title }; var htmlString = "<a href=\"" + urlBar.value + "\">" + urlBar.value + "</a>"; flavourList["text/html"] = { width: 2, data: htmlString }; return flavourList; } |
var srcDirectory = GetDirectoryFromURI(GetSelectedDirectory()); if ((srcDirectory.operations & srcDirectory.opWrite)) aDragAction.action = Components.interfaces. nsIDragService.DRAGDROP_ACTION_COPY | Components.interfaces. nsIDragService.DRAGDROP_ACTION_MOVE; else aDragAction.action = Components.interfaces. nsIDragService.DRAGDROP_ACTION_COPY; | onDragStart: function (aEvent, aXferData, aDragAction){ aXferData.data = new TransferData(); var selectedRows = GetSelectedRows(); var selectedAddresses = GetSelectedAddresses(); aXferData.data.addDataForFlavour("moz/abcard", selectedRows); aXferData.data.addDataForFlavour("text/x-moz-address", selectedAddresses); aXferData.data.addDataForFlavour("text/unicode", selectedAddresses); }, |
|
flavourList["text/x-moz-url"] = { width: 2, data: uri + " " + title }; | flavourList["text/x-moz-url"] = { width: 2, data: escape(uri) + " " + title }; | onDragStart: function (aEvent) { var title = aEvent.target.getAttribute("value"); var uri = aEvent.target.parentNode.parentNode.id; dump("*** title = " + title + "; uri = " + uri + "\n"); if ( aEvent.target.localName != "treecell" ) // make sure we have something to drag return null; var htmlString = "<A HREF='" + uri + "'>" + title + "</A>"; var flavourList = { }; flavourList["text/unicode"] = { width: 2, data: uri }; flavourList["text/html"] = { width: 2, data: htmlString }; flavourList["text/x-moz-url"] = { width: 2, data: uri + " " + title }; return flavourList; }, |
tmpurl = tmpurl + "&type=" + attachmentContentType + "&filename=" + attachmentDisplayName; | var tmpurlWithExtraInfo = tmpurl + "&type=" + attachmentContentType + "&filename=" + attachmentDisplayName; | onDragStart: function (aEvent, aAttachmentData, aDragAction) { var target = aEvent.target; if (target.localName == "descriptionitem") { var attachmentUrl = target.getAttribute("attachmentUrl"); var attachmentDisplayName = target.getAttribute("label"); var attachmentContentType = target.getAttribute("attachmentContentType"); var tmpurl = attachmentUrl; tmpurl = tmpurl + "&type=" + attachmentContentType + "&filename=" + attachmentDisplayName; aAttachmentData.data = new TransferData(); if (attachmentUrl && attachmentDisplayName) { aAttachmentData.data.addDataForFlavour("text/x-moz-url", tmpurl + "\n" + attachmentDisplayName); aAttachmentData.data.addDataForFlavour("text/x-moz-url-data", tmpurl); aAttachmentData.data.addDataForFlavour("text/x-moz-url-desc", attachmentDisplayName); aAttachmentData.data.addDataForFlavour("application/x-moz-file-promise-url", tmpurl); aAttachmentData.data.addDataForFlavour("application/x-moz-file-promise", new nsFlavorDataProvider(), 0, Components.interfaces.nsISupports); } } } |
aAttachmentData.data.addDataForFlavour("text/x-moz-url", tmpurl + "\n" + attachmentDisplayName); | aAttachmentData.data.addDataForFlavour("text/x-moz-url", tmpurlWithExtraInfo + "\n" + attachmentDisplayName); | onDragStart: function (aEvent, aAttachmentData, aDragAction) { var target = aEvent.target; if (target.localName == "descriptionitem") { var attachmentUrl = target.getAttribute("attachmentUrl"); var attachmentDisplayName = target.getAttribute("label"); var attachmentContentType = target.getAttribute("attachmentContentType"); var tmpurl = attachmentUrl; tmpurl = tmpurl + "&type=" + attachmentContentType + "&filename=" + attachmentDisplayName; aAttachmentData.data = new TransferData(); if (attachmentUrl && attachmentDisplayName) { aAttachmentData.data.addDataForFlavour("text/x-moz-url", tmpurl + "\n" + attachmentDisplayName); aAttachmentData.data.addDataForFlavour("text/x-moz-url-data", tmpurl); aAttachmentData.data.addDataForFlavour("text/x-moz-url-desc", attachmentDisplayName); aAttachmentData.data.addDataForFlavour("application/x-moz-file-promise-url", tmpurl); aAttachmentData.data.addDataForFlavour("application/x-moz-file-promise", new nsFlavorDataProvider(), 0, Components.interfaces.nsISupports); } } } |
var fileURL = nsJSComponentManager.createInstance("component: | var fileURL = nsJSComponentManager.createInstance("@mozilla.org/network/standard-url;1", "nsIFileURL"); | onDrop: function (aEvent, aData, aDragSession) { aData = aData.length ? aData[0] : aData; if (aData.flavour != "application/x-moz-file") return; var dataObj = aData.data.data.QueryInterface(Components.interfaces.nsIFile); if (!dataObj) return; var fileURL = nsJSComponentManager.createInstance("component://netscape/network/standard-url", "nsIFileURL"); fileURL.file = dataObj; AddAttachment(fileURL.spec); }, |
if (commonDialogsService) commonDialogsService.Alert(window, errorTitle, errorMsg); | if (promptService) promptService.Alert(window, errorTitle, errorMsg); | onDrop: function (aEvent, aData, aDragSession) { var prettyName; var rawData = aData.data; switch (aData.flavour.contentType) { case "text/x-moz-url": case "text/nsmessage": var separator = rawData.indexOf("\n"); if (separator != -1) { prettyName = rawData.substr(separator+1); rawData = rawData.substr(0,separator); } break; case "application/x-moz-file": const FileContractID = "@mozilla.org/network/standard-url;1"; const FileURLIID = Components.interfaces.nsIFileURL; var fileURL = Components.classes[FileContractID].createInstance(FileURLIID); fileURL.file = aData.data; rawData = fileURL.spec; break; } if (!(DuplicateFileCheck(rawData))) AddAttachment(rawData, prettyName); else { var errorTitle = gComposeMsgsBundle.getString("DuplicateFileErrorDlogTitle"); var errorMsg = gComposeMsgsBundle.getString("DuplicateFileErrorDlogMessage"); if (commonDialogsService) commonDialogsService.Alert(window, errorTitle, errorMsg); else window.alert(errorMsg); } }, |
if (!showDialog) | if (showDialog) | onDrop: function (aEvent, aData) { var aData = aData.length ? aData[0] : aData; var url = retrieveURLFromData(aData); var showDialog = nsPreferences.getBoolPref("browser.homepage.enable_home_button_drop", false); var setHomepage; if (!showDialog) { var commonDialogService = nsJSComponentManager.getService("component://netscape/appshell/commonDialogs", "nsICommonDialogs"); var block = nsJSComponentManager.createInstanceByID("c01ad085-4915-11d3-b7a0-85cf-55c3523c", "nsIDialogParamBlock"); var checkValue = { value: false }; var pressedVal = { }; var promptTitle = bundle.GetStringFromName("droponhometitle"); var promptMsg = bundle.GetStringFromName("droponhomemsg"); var checkMsg = bundle.GetStringFromName("dontremindme"); var okButton = bundle.GetStringFromName("droponhomeokbutton"); var iconURL = "chrome://navigator/skin/home.gif"; // evil evil common dialog code! evil! /* block.SetInt(2, 2); block.SetString(0, bundle.GetStringFromName("droponhomemsg")); block.SetString(3, bundle.GetStringFromName("droponhometitle")); block.SetString(2, "chrome://navigator/skin/home.gif"); block.SetString(1, bundle.GetStringFromName("dontremindme")); block.SetInt(1, 1); // checkbox is checked block.SetString(8, bundle.GetStringFromName("droponhomeokbutton")); */ commonDialogService.UniversalDialog(window, null, promptTitle, promptMsg, checkMsg, okButton, null, null, null, null, null, { }, { }, iconURL, checkValue, 2, 0, null, pressedVal); nsPreferences.setBoolPref("browser.homepage.enable_home_button_drop", checkValue.value); setHomepage = pressedVal.value == 0 ? true : false; } else setHomepage = true; dump("*** pressedVal = " + pressedVal.value + "\n"); if (setHomepage) nsPreferences.setUnicharPref("browser.startup.homepage", url); }, |
var checkValue = { value: false }; | var checkValue = { value: true }; | onDrop: function (aEvent, aData) { var aData = aData.length ? aData[0] : aData; var url = retrieveURLFromData(aData); var showDialog = nsPreferences.getBoolPref("browser.homepage.enable_home_button_drop", false); var setHomepage; if (!showDialog) { var commonDialogService = nsJSComponentManager.getService("component://netscape/appshell/commonDialogs", "nsICommonDialogs"); var block = nsJSComponentManager.createInstanceByID("c01ad085-4915-11d3-b7a0-85cf-55c3523c", "nsIDialogParamBlock"); var checkValue = { value: false }; var pressedVal = { }; var promptTitle = bundle.GetStringFromName("droponhometitle"); var promptMsg = bundle.GetStringFromName("droponhomemsg"); var checkMsg = bundle.GetStringFromName("dontremindme"); var okButton = bundle.GetStringFromName("droponhomeokbutton"); var iconURL = "chrome://navigator/skin/home.gif"; // evil evil common dialog code! evil! /* block.SetInt(2, 2); block.SetString(0, bundle.GetStringFromName("droponhomemsg")); block.SetString(3, bundle.GetStringFromName("droponhometitle")); block.SetString(2, "chrome://navigator/skin/home.gif"); block.SetString(1, bundle.GetStringFromName("dontremindme")); block.SetInt(1, 1); // checkbox is checked block.SetString(8, bundle.GetStringFromName("droponhomeokbutton")); */ commonDialogService.UniversalDialog(window, null, promptTitle, promptMsg, checkMsg, okButton, null, null, null, null, null, { }, { }, iconURL, checkValue, 2, 0, null, pressedVal); nsPreferences.setBoolPref("browser.homepage.enable_home_button_drop", checkValue.value); setHomepage = pressedVal.value == 0 ? true : false; } else setHomepage = true; dump("*** pressedVal = " + pressedVal.value + "\n"); if (setHomepage) nsPreferences.setUnicharPref("browser.startup.homepage", url); }, |
dump("*** pressedVal = " + pressedVal.value + "\n"); | onDrop: function (aEvent, aData) { var aData = aData.length ? aData[0] : aData; var url = retrieveURLFromData(aData); var showDialog = nsPreferences.getBoolPref("browser.homepage.enable_home_button_drop", false); var setHomepage; if (!showDialog) { var commonDialogService = nsJSComponentManager.getService("component://netscape/appshell/commonDialogs", "nsICommonDialogs"); var block = nsJSComponentManager.createInstanceByID("c01ad085-4915-11d3-b7a0-85cf-55c3523c", "nsIDialogParamBlock"); var checkValue = { value: false }; var pressedVal = { }; var promptTitle = bundle.GetStringFromName("droponhometitle"); var promptMsg = bundle.GetStringFromName("droponhomemsg"); var checkMsg = bundle.GetStringFromName("dontremindme"); var okButton = bundle.GetStringFromName("droponhomeokbutton"); var iconURL = "chrome://navigator/skin/home.gif"; // evil evil common dialog code! evil! /* block.SetInt(2, 2); block.SetString(0, bundle.GetStringFromName("droponhomemsg")); block.SetString(3, bundle.GetStringFromName("droponhometitle")); block.SetString(2, "chrome://navigator/skin/home.gif"); block.SetString(1, bundle.GetStringFromName("dontremindme")); block.SetInt(1, 1); // checkbox is checked block.SetString(8, bundle.GetStringFromName("droponhomeokbutton")); */ commonDialogService.UniversalDialog(window, null, promptTitle, promptMsg, checkMsg, okButton, null, null, null, null, null, { }, { }, iconURL, checkValue, 2, 0, null, pressedVal); nsPreferences.setBoolPref("browser.homepage.enable_home_button_drop", checkValue.value); setHomepage = pressedVal.value == 0 ? true : false; } else setHomepage = true; dump("*** pressedVal = " + pressedVal.value + "\n"); if (setHomepage) nsPreferences.setUnicharPref("browser.startup.homepage", url); }, |
|
var name = split[1]; saveURL(url, name, null, true, true); | if (url != split) { var name = split[1]; saveURL(url, name, null, true, true); } | onDrop: function(aEvent, aXferData, aDragSession) { var split = aXferData.data.split("\n"); var url = split[0]; var name = split[1]; saveURL(url, name, null, true, true); }, |
switch (document.firstChild.getAttribute('windowtype')) { | switch (document.documentElement.getAttribute('windowtype')) { | onDrop: function (aEvent, aXferData, aDragSession) { var url = transferUtils.retrieveURLFromData(aXferData.data, aXferData.flavour.contentType); // valid urls don't contain spaces ' '; if we have a space it // isn't a valid url, or if it's a javascript: or data: url, // bail out if (!url || !url.length || url.indexOf(" ", 0) != -1 || /^\s*(javascript|data):/.test(url)) return; switch (document.firstChild.getAttribute('windowtype')) { case "navigator:browser": // Perform a security check before loading the URI nsDragAndDrop.dragDropSecurityCheck(aEvent, aDragSession, url); loadURI(getShortcutOrURI(url)); break; case "navigator:view-source": viewSource(url); break; } // keep the event from being handled by the dragDrop listeners // built-in to gecko if they happen to be above us. aEvent.preventDefault(); }, |
var rdfContainer = nsJSComponentManager.createInstance("component: | var rdfContainer = nsJSComponentManager.createInstance("@mozilla.org/rdf/container;1", | onDrop: function (aEvent, aData, aDragSession) { // temporary if (!isPToolbarDNDEnabled()) return false; var element = aData.data.data; var dropElement = aEvent.target.id; var elementRes = RDFUtils.getResource(element); var dropElementRes = RDFUtils.getResource(dropElement); var personalToolbarRes = RDFUtils.getResource("NC:PersonalToolbarFolder"); var childDB = document.getElementById("innermostBox").database; var rdfContainer = nsJSComponentManager.createInstance("component://netscape/rdf/container", "nsIRDFContainer"); rdfContainer.Init(childDB, personalToolbarRes); var elementIsOnToolbar = rdfContainer.IndexOf(elementRes); if (elementIsOnToolbar > 0) rdfContainer.RemoveElement(elementRes, true); else if (dropIndex == -1) { // look up this URL's title in global history var potentialTitle = null; var historyDS = gRDFService.GetDataSource("rdf:history"); var historyEntry = gRDFService.GetResource(element); var historyTitleProperty = gRDFService.GetResource(NC_RDF("Name")); var titleFromHistory = historyDS.GetTarget(historyEntry, historyTitleProperty, true); if (titleFromHistory) titleFromHistory = titleFromHistory.QueryInterface(Components.interfaces.nsIRDFLiteral); if (titleFromHistory) potentialTitle = titleFromHistory.Value; linkTitle = potentialTitle ? potentialTitle : element; childDB.Assert(gRDFService.GetResource(element, true), gRDFService.GetResource(NC_RDF("Name"), true), gRDFService.GetLiteral(linkTitle), true); } var dropIndex = rdfContainer.IndexOf(dropElementRes); // determine the drop position var dropPosition = this.determineDropPosition(aEvent); switch (dropPosition) { case -1: rdfContainer.InsertElementAt(elementRes, dropIndex, true); break; case 0: // do something here to drop into subfolders var childContainer = nsJSComponentManager.createInstance("component://netscape/rdf/container", "nsIRDFContainer"); childContainer.Init(childDB, dropElementRes); childContainer.AppendElement(elementRes); break; case 1: default: rdfContainer.InsertElementAt(elementRes, dropIndex+1, true); break; } return true; }, |
var childContainer = nsJSComponentManager.createInstance("component: | var childContainer = nsJSComponentManager.createInstance("@mozilla.org/rdf/container;1", | onDrop: function (aEvent, aData, aDragSession) { // temporary if (!isPToolbarDNDEnabled()) return false; var element = aData.data.data; var dropElement = aEvent.target.id; var elementRes = RDFUtils.getResource(element); var dropElementRes = RDFUtils.getResource(dropElement); var personalToolbarRes = RDFUtils.getResource("NC:PersonalToolbarFolder"); var childDB = document.getElementById("innermostBox").database; var rdfContainer = nsJSComponentManager.createInstance("component://netscape/rdf/container", "nsIRDFContainer"); rdfContainer.Init(childDB, personalToolbarRes); var elementIsOnToolbar = rdfContainer.IndexOf(elementRes); if (elementIsOnToolbar > 0) rdfContainer.RemoveElement(elementRes, true); else if (dropIndex == -1) { // look up this URL's title in global history var potentialTitle = null; var historyDS = gRDFService.GetDataSource("rdf:history"); var historyEntry = gRDFService.GetResource(element); var historyTitleProperty = gRDFService.GetResource(NC_RDF("Name")); var titleFromHistory = historyDS.GetTarget(historyEntry, historyTitleProperty, true); if (titleFromHistory) titleFromHistory = titleFromHistory.QueryInterface(Components.interfaces.nsIRDFLiteral); if (titleFromHistory) potentialTitle = titleFromHistory.Value; linkTitle = potentialTitle ? potentialTitle : element; childDB.Assert(gRDFService.GetResource(element, true), gRDFService.GetResource(NC_RDF("Name"), true), gRDFService.GetLiteral(linkTitle), true); } var dropIndex = rdfContainer.IndexOf(dropElementRes); // determine the drop position var dropPosition = this.determineDropPosition(aEvent); switch (dropPosition) { case -1: rdfContainer.InsertElementAt(elementRes, dropIndex, true); break; case 0: // do something here to drop into subfolders var childContainer = nsJSComponentManager.createInstance("component://netscape/rdf/container", "nsIRDFContainer"); childContainer.Init(childDB, dropElementRes); childContainer.AppendElement(elementRes); break; case 1: default: rdfContainer.InsertElementAt(elementRes, dropIndex+1, true); break; } return true; }, |
var PBStyle = window.getComputedStyle(document.getElementById("PersonalToolbar"),''); var isHorizontal = (target.localName == "toolbarbutton"); if ((PBStyle.direction == 'rtl') && isHorizontal) if (orientation == BookmarksUtils.DROP_AFTER) orientation = BookmarksUtils.DROP_BEFORE; else if (orientation == BookmarksUtils.DROP_BEFORE) orientation = BookmarksUtils.DROP_AFTER; | onDrop: function (aEvent, aXferData, aDragSession) { var target = aEvent.target; this.onDragRemoveFeedBack(target); var selection = BookmarksUtils.getSelectionFromXferData(aDragSession); var orientation = BookmarksMenu.getBTOrientation(aEvent); var selTarget = BookmarksMenu.getBTTarget(target, orientation); const kDSIID = Components.interfaces.nsIDragService; const kCopyAction = kDSIID.DRAGDROP_ACTION_COPY + kDSIID.DRAGDROP_ACTION_LINK; // hide the 'open in tab' menuseparator because bookmarks // can be inserted after it if they are dropped after the last bookmark // a more comprehensive fix would be in the menupopup template builder var menuSeparator = null; var menuTarget = (target.localName == "toolbarbutton" || target.localName == "menu") && orientation == BookmarksUtils.DROP_ON? target.lastChild:target.parentNode; if (menuTarget.hasChildNodes() && menuTarget.lastChild.getAttribute("class") == "openintabs-menuitem") { menuSeparator = menuTarget.lastChild.previousSibling; menuTarget.removeChild(menuSeparator); } if (aDragSession.dragAction & kCopyAction) BookmarksUtils.insertAndCheckSelection("drag", selection, selTarget); else BookmarksUtils.moveAndCheckSelection("drag", selection, selTarget); // show again the menuseparator if (menuSeparator) menuTarget.insertBefore(menuSeparator, menuTarget.lastChild); }, |
|
if (xferData.length >= 2) | var bookmarksDS = gRDFService.GetDataSource("rdf:bookmarks"); var nameRes = RDFUtils.getResource(NC_RDF("Name")); var nameFromBookmarks = bookmarksDS.GetTarget(elementRes, nameRes, true); if (nameFromBookmarks) nameFromBookmarks = nameFromBookmarks.QueryInterface(Components.interfaces.nsIRDFLiteral); if (nameFromBookmarks) { linkTitle = nameFromBookmarks.Value; } else if (xferData.length >= 2) | onDrop: function (aEvent, aXferData, aDragSession) { var xferData = aXferData.data.split("\n"); var elementRes = RDFUtils.getResource(xferData[0]); var personalToolbarRes = RDFUtils.getResource("NC:PersonalToolbarFolder"); var inner = document.getElementById("innermostBox"); var childDB = inner.database; const kCtrContractID = "@mozilla.org/rdf/container;1"; const kCtrIID = Components.interfaces.nsIRDFContainer; var rdfContainer = Components.classes[kCtrContractID].createInstance(kCtrIID); // if dragged url is already bookmarked, remove it from current location first var parentContainer = this.findParentContainer(aDragSession.sourceNode); if (parentContainer) { rdfContainer.Init(childDB, parentContainer); rdfContainer.RemoveElement(elementRes, false); } // determine charset of link var linkCharset = aDragSession.sourceDocument ? aDragSession.sourceDocument.characterSet : null; // determine title of link var linkTitle; if (xferData.length >= 2) linkTitle = xferData[1] else { // look up this URL's title in global history var potentialTitle = null; var historyDS = gRDFService.GetDataSource("rdf:history"); var titlePropRes = RDFUtils.getResource(NC_RDF("Name")); var titleFromHistory = historyDS.GetTarget(elementRes, titlePropRes, true); if (titleFromHistory) titleFromHistory = titleFromHistory.QueryInterface(Components.interfaces.nsIRDFLiteral); if (titleFromHistory) potentialTitle = titleFromHistory.Value; linkTitle = potentialTitle; } var dropElement = aEvent.target.id; var dropElementRes, dropIndex, dropPosition; if (dropElement == "innermostBox") { dropElementRes = personalToolbarRes; dropPosition = this.DROP_ON; } else { dropElementRes = RDFUtils.getResource(dropElement); rdfContainer.Init(childDB, personalToolbarRes); dropIndex = rdfContainer.IndexOf(dropElementRes); if (dropPosition == undefined) dropPosition = this.determineDropPosition(aEvent); } switch (dropPosition) { case this.DROP_BEFORE: if (dropIndex<1) dropIndex = 1; this.insertBookmarkAt(xferData[0], linkTitle, linkCharset, personalToolbarRes, dropIndex); break; case this.DROP_ON: this.insertBookmarkAt(xferData[0], linkTitle, linkCharset, dropElementRes, -1); break; case this.DROP_AFTER: default: // compensate for badly calculated dropIndex rdfContainer.Init(childDB, personalToolbarRes); if (dropIndex < rdfContainer.GetCount()) ++dropIndex; if (dropIndex<0) dropIndex = 0; this.insertBookmarkAt(xferData[0], linkTitle, linkCharset, personalToolbarRes, dropIndex); break; } return true; }, |
onDrop: function (aEvent, aData, aDragSession) | onDrop: function (aEvent, aXferData, aDragSession) | onDrop: function (aEvent, aData, aDragSession) { var data = (('length' in aData) && aData.length) ? aData[0] : aData; var url = retrieveURLFromData(data); if (url.length == 0) return true; // valid urls don't contain spaces ' '; if we have a space it isn't a valid url so bail out if ( url.indexOf(" ", 0) != -1 ) return true; switch (document.firstChild.getAttribute('windowtype')) { case "navigator:browser": loadShortcutOrURI(url); break; case "navigator:view-source": viewSource(url); break; default: } return true; }, |
var data = (('length' in aData) && aData.length) ? aData[0] : aData; var url = retrieveURLFromData(data); if (url.length == 0) return true; | var url = retrieveURLFromData(aXferData.data, aXferData.flavour.contentType); | onDrop: function (aEvent, aData, aDragSession) { var data = (('length' in aData) && aData.length) ? aData[0] : aData; var url = retrieveURLFromData(data); if (url.length == 0) return true; // valid urls don't contain spaces ' '; if we have a space it isn't a valid url so bail out if ( url.indexOf(" ", 0) != -1 ) return true; switch (document.firstChild.getAttribute('windowtype')) { case "navigator:browser": loadShortcutOrURI(url); break; case "navigator:view-source": viewSource(url); break; default: } return true; }, |
if ( url.indexOf(" ", 0) != -1 ) return true; | if (!url || !url.length || url.indexOf(" ", 0) != -1) return; | onDrop: function (aEvent, aData, aDragSession) { var data = (('length' in aData) && aData.length) ? aData[0] : aData; var url = retrieveURLFromData(data); if (url.length == 0) return true; // valid urls don't contain spaces ' '; if we have a space it isn't a valid url so bail out if ( url.indexOf(" ", 0) != -1 ) return true; switch (document.firstChild.getAttribute('windowtype')) { case "navigator:browser": loadShortcutOrURI(url); break; case "navigator:view-source": viewSource(url); break; default: } return true; }, |
default: | onDrop: function (aEvent, aData, aDragSession) { var data = (('length' in aData) && aData.length) ? aData[0] : aData; var url = retrieveURLFromData(data); if (url.length == 0) return true; // valid urls don't contain spaces ' '; if we have a space it isn't a valid url so bail out if ( url.indexOf(" ", 0) != -1 ) return true; switch (document.firstChild.getAttribute('windowtype')) { case "navigator:browser": loadShortcutOrURI(url); break; case "navigator:view-source": viewSource(url); break; default: } return true; }, |
|
return true; | onDrop: function (aEvent, aData, aDragSession) { var data = (('length' in aData) && aData.length) ? aData[0] : aData; var url = retrieveURLFromData(data); if (url.length == 0) return true; // valid urls don't contain spaces ' '; if we have a space it isn't a valid url so bail out if ( url.indexOf(" ", 0) != -1 ) return true; switch (document.firstChild.getAttribute('windowtype')) { case "navigator:browser": loadShortcutOrURI(url); break; case "navigator:view-source": viewSource(url); break; default: } return true; }, |
|
SOUND.beep(); | BookmarksUtils.insertSelection("drag", selection, selTarget); | onDrop: function (aEvent, aXferData, aDragSession) { var target = aEvent.target; this.onDragRemoveFeedBack(target); var selection = BookmarksUtils.getSelectionFromXferData(aDragSession); var orientation = BookmarksMenu.getBTOrientation(aEvent); var selTarget = BookmarksMenu.getBTTarget(target, orientation); const kDSIID = Components.interfaces.nsIDragService; const kCopyAction = kDSIID.DRAGDROP_ACTION_COPY + kDSIID.DRAGDROP_ACTION_LINK; // hide the 'open in tab' menuseparator because bookmarks // can be inserted after it if they are dropped after the last bookmark // a more comprehensive fix would be in the menupopup template builder var menuTarget = (target.localName == "toolbarbutton" || target.localName == "menu") && orientation == BookmarksUtils.DROP_ON? target.lastChild:target.parentNode; if (menuTarget.hasChildNodes() && menuTarget.lastChild.id == "openintabs-menuitem") { menuTarget.removeChild(menuTarget.lastChild.previousSibling); } // disabling ctrl-DND for now bookmarks are not cloned if (aDragSession.dragAction & kCopyAction) SOUND.beep(); //BookmarksUtils.insertSelection("drag", selection, selTarget, true); else BookmarksUtils.moveSelection("drag", selection, selTarget); // show again the menuseparator if (menuTarget.hasChildNodes() && menuTarget.lastChild.id == "openintabs-menuitem") { var element = document.createElementNS(XUL_NS, "menuseparator"); menuTarget.insertBefore(element, menuTarget.lastChild); } }, |
var urlBar = document.getElementById("urlbar"); urlBar.value = url; BrowserLoadURL(); | loadShortcutOrURI(url); | onDrop: function (aEvent, aData, aDragSession) { var data = (('length' in aData) && aData.length) ? aData[0] : aData; var url = retrieveURLFromData(data); if (url.length == 0) return true; // valid urls don't contain spaces ' '; if we have a space it isn't a valid url so bail out if ( url.indexOf(" ", 0) != -1 ) return true; switch (document.firstChild.getAttribute('windowtype')) { case "navigator:browser": var urlBar = document.getElementById("urlbar"); urlBar.value = url; BrowserLoadURL(); break; case "navigator:view-source": viewSource(url); break; default: } return true; }, |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.