User:The Transhumanist/QuickPortal.js: Difference between revisions

Content deleted Content added
define what to do if Restart portal is clicked when portal is in edit mode: replace entire contents by invoking insertQuickPortal()
switch order of if statements to check for more specific condition first. That way, if it doesn't get invoked, the else if run
Line 87:
// Development note: store pagename in local storage
 
if (document.title.indexOf("Editing Portal:") === 0) {
// Invoke a function by its name
// (The function itself is defined further down the page, using the word "function").
insertQuickPortal();
} else if (document.title.indexOf("Editing Portal:") === 0) {
// Invoke a function by its name; this one is like clicking "edit source"
// (The function itself is defined further down the page, using the word "function").
invokeEditPage();
} else if (document.title.indexOf("Editing Portal:") === 0) {
insertQuickPortal();
}
});