User:Guywan/Scripts/InsertShortcuts.js: Difference between revisions

Content deleted Content added
mNo edit summary
mNo edit summary
Line 25:
// Load user's settings.
var source = window.us_InsertShortcuts_loadFrom ?
window.us_InsertShortcuts_loadFrom :
mw.util.getUrl(`User:${mw.config.get("wgUserName")}/InsertShortcutsSettings.js`);
 
$.ajax(
{
url : mw.util.getUrl(`User:${mw.config.get("wgUserName")}/InsertShortcutsSettings.js`)source + "?action=raw", dataType : "text"
})
.fail(result => { mw.notify("Failed to load your settings: " + result, "error"); })
Line 34 ⟶ 38:
// Remove escaped newlines. Split into tags.
this.inserts = text.replace(/\\\n/g, "").split("\n");
if(this.DEBUG) console.log("Finished loading user settings." + this.inserts);
});
},