User:PerfektesChaos/js/autoBackup/r.js: Difference between revisions

Content deleted Content added
2.0
2.2
 
(2 intermediate revisions by the same user not shown)
Line 1:
/// User:PerfektesChaos/js/autoBackup/r.js
/// 20172019-0107-0501 PerfektesChaos@de.wikipedia
/// Fingerprint:#0#69C472322860E0F5#
/// @license GPL [//www.mediawiki.org/w/COPYING](+GFDL,LGPL,:CC-BYby-SA)sa/4.0
///<nowiki>
(function(mw,$){
"use strict";
var BAK,VSNVERSION=2.03,BAK="autoBackup";
if(typeof mw.libs.autoBackup[BAK]!=="object"||!mw.libs.autoBackup[BAK]){
mw.libs.autoBackup[BAK]={};}
BAK=mw.libs[BAK].autoBackuptype=BAK;
BAK=mw.libs[BAK];
BAK.doc="[[w:en:User:PerfektesChaos/js/autoBackup"+BAK+"]]";
BAK.typevsn="autoBackup"VERSION;
BAK.vsn=VSN;
BAK.cnf={maxAge:72,maxHist:5,maxPages:10,maxRev:3,mid:5,msec:300000};
BAK.disk={self:"AutoBackupPerfectChaos",stick:"newest|subject"};
Line 20:
BAK.opt={};}
BAK.cnf.text={
"BAKself":{"en":"AutoBackup",
"de":"AutoBackup"},
"IntJSONparse":{"en":"Internal ERROR -- JSON.parse",
"de":"Interner FEHLER -- JSON.parse"},
"NoLSavail":{"en":"No localStorage available",
"de":"Kein localStorage zugreifbar"},
"otherPages":{"en":"Other Pages",
"de":"Andere Seiten"},
"pending":{"en":"Recover from pending abort?",
"de":"Wiederherstellung nach Abbruch?"},
"setItemExcept":{"en":"ERROR setting localStorage",
"de":"FEHLER beim Setzen im localStorage"},
"thisPage":{"en":"this page",
"de":"diese Seite"},
"VanishedLS":{"en":"ERROR: localStorage vanished",
"de":"FEHLER: localStorage verschwunden"},
"WriteCrash":{"en":"Crash on localStorage write attempt",
"de":"Schreibversuch auf localStorage versagt"}
};
BAK.cnf.translang={
"de":"de",
"de-at":"de",
"de-ch":"de",
"de-formal":"de",
"als":"de",
"bar":"de",
"dsb":"de",
"frr":"de",
"gsw":"de",
"hsb":"de",
"ksh":"de",
"lb":"de",
"nds":"de",
"pdc":"de",
"pdt":"de",
"pfl":"de",
"sli":"de",
"stq":"de",
"vmf":"de"
};
Line 154 ⟶ 172:
this.$top=$("#content");
if(!this.$top.length){
this.$top=mw.utilBAK.$contentpage;}}}
this.$top.before(this.$div);}}}
if(apply){
Line 185 ⟶ 203:
this.$editform=false;
this.$textarea=false;
$form=mw.utilBAK.$contentpage.find("#editform");
if($form){
$ta=mw.utilBAK.$contentpage.find("#wpTextbox2");
if($ta.length){
r=$ta.val();}
Line 493 ⟶ 511:
};
BAK.find=function(){
var q=new mw.Api(),w={action:"query",
"continue":"",
pageids:this.pageID,prop:"revisions",rvlimit:3,rvuser:mw.util.wikiUrlencode(mw.config.get("wgUserName"))
};
mw.config.get("wgUserName"))};
if(this.later){
delete w.pageids;
Line 509 ⟶ 529:
this.find();}}
if(typeof mw.user==="object"){
if(mw.user.options&&mw.user.options.get("uselivepreview")){
if(mw.user.options.get("uselivepreview")){
this.livePreview=true;
$(mw).bind("LivePreviewDone",this.fresh);}}}
this.gui.leading=true;
mw.hook("wikipage.content").add(this.fresh();
};
BAK.fixed=function(apply){
Line 665 ⟶ 684:
mw.hook("wikipage.content").add(BAK.firing);}}}
};
BAK.firing=function($all){
BAK.$page=$all;
switch(BAK.start){
case "submit":
Line 677 ⟶ 697:
};
function first(){
var signature="ext.gadget."+BAK.type,rls;
if(typeof JSON==="undefined"){
if(mw.loader.getState(signature)!=="ready"){
BAK.error="JSON unavailable";
rls={};
}else if(mw.config.get("wgNamespaceNumber")>=0){
rls[signature]="ready";
mw.loader.using(["user","mediawiki.api","mediawiki.user","mediawiki.util"],BAK.fire);}
mw.loader.state("ext.gadget.autoBackup","ready"rls);}
if(mw.config.get("wgUserNamewgNamespaceNumber")>=0)};{
if(!BAK.loaded){
mw.loader.using(["user","mediawiki.api","mediawiki.user","mediawiki.util"],BAK.fire);}}}
BAK.loaded=true;
first();}
}(window.mediaWiki,window.jQuery));
/// EOF</nowiki>autoBackup/r.js