User:PerfektesChaos/js/paneMarker/dialog/d.js

/// mw:User:PerfektesChaos/js/paneMarker/dialog/d.js /// 2013-10-15 PerfektesChaos@de.wikipedia // Equip Special:Gadgets dialog form of paneMarker /// Fingerprint: #0#0# /// @license GPL [//www.mediawiki.org/w/COPYING] (+GFDL, LGPL, CC-BY-SA) /// /*jshint curly:true, latedef:true, laxbreak:true, strict:true, trailing:true, undef:true, white:false          */ /*global window: true                                                 */ /*jslint forin: true, plusplus: true, white: true                     */ /*globals window: true                                                */

( function ( mw ) {  "use strict";   var PaneMk  =  "paneMarker";   if ( typeof mw.libs[ PaneMk ]  !==  "object" ||  ! mw.libs[ PaneMk ] ) {      mw.libs[ PaneMk ]  =  {  prefs:  { }  };   }   PaneMk  =  mw.libs[ PaneMk ];   if ( ! PaneMk.prefs ) {     PaneMk.prefs  =  { };   }   PaneMk.prefs.vsn    = -2.2;   PaneMk.prefs.texts  =  {      // 2013-10-12 PerfektesChaos@de.wikipedia      "suffix":      {"en": "&#8211; emphasize"                            + " browser windows or tabs"                            + " currently used for input activities",                      "de": "&#8211; Browser-Fenster oder Tabs"                            + " hervorheben,"                            + " in denen Bearbeitung offen"},      "?icon":       {"en": ""                            + "URL of alternative icon"                            + "  &#8211;"                            + " regular page icon"                            + "empty: use red favicon"                            + "",                      "de": ""                            + "URL eines alternativen Icons" + " &#8211;" + " hier kein abweichender Icon" + "leer: Roter Standard-Favicon" + ""}, "?mark":      {"en": "" + "marker string as desired</li>" + " nnnn &#8211;" + " Unicode of specific marker</li>" + " &#8211;" + " do not prepend any marker</li>" + "empty: use default marker</li>" + "</ul>", "de": "" + "Gewünschter Marker (direkt)</li>" + " nnnn &#8211;" + " Unicode des gewünschten Markers</li>" + " &#8211;" + " keinen Marker voranstellen</li>" + "leer: Standard-Marker</li>" + "</ul>"}, "^appleIcon": {"en": "Alternative red apple-touch-icon," + " or disabled", "de": "Alternativer apple-touch-icon," + " oder deaktiviert"}, "^faviconICO": {"en": "Alternative red favicon in .ICO format," + " or disabled", "de": "Alternativer Favicon im .ICO-Format," + " oder deaktiviert"}, "^faviconPNG": {"en": "Alternative red favicon in .PNG format," + " or disabled", "de": "Alternativer Favicon im .PNG-Format," + " oder deaktiviert"}, "^lazy":      {"en": "Always keep standard icon", "de": "Konventionellen Icon immer beibehalten"}, "^chars":     {"en": "Distinguishing mark: " + " general activation/deactivation", "de": "Unterscheidungszeichen" + " allgemein aktivieren/deaktivieren"}, "^charDiff":  {"en": "Marker for diffpages", "de": "Marker für diffpages"}, "^charHistory":{"en": "Marker for history pages", "de": "Marker für Versionsgeschichte"}, "^charLinks": {"en": "Marker for “Whatlinkshere”", "de": "Marker für Links auf diese Seite"}, "^charVitally":{"en": "Marker for important pages", "de": "Marker für wichtige Seiten-Aktivitäten"}, "^lowChar":   {"en": "Use ANSI characters", "de": "ANSI-Zeichen benutzen"}, "^favicon":   {"en": "Alternative default favicon" + " for thies project", "de": "Alternativer Favicon" + " für dieses Projekt"}, "^leave":     {"en": "Create window titles" + " as short as possible", "de": "(Benutze kurzen Seitentitel)"} };  // .prefs.texts PaneMk.prefs.userlang =  { // 2012-12-19 PerfektesChaos@de.wikipedia "de" :  "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" };  // .prefs.userlang

/*   * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as   * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. *   * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. *   * You should have received a copy of the GNU General Public License * along with this program; * if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * http://www.gnu.org/copyleft/gpl.html */

PaneMk.prefs.favorite =  function  { // Detect appropriate language, and support page in user language // Postcondition: //   Returns language code // Uses: //   >  .prefs.userlang //    < .prefs.support //   mw.config.get // 2013-10-08 PerfektesChaos@de.wikipedia var r =  mw.config.get( "wgUserLanguage" ).toLowerCase; if ( r.length > 4 ) {  // Remove RFC 1766 subtag from code if ( r.charCodeAt( 2 ) ===  45 ) {   // '-' r =  r.substr( 0, 2 ); }     }      r  =  this.userlang[ r ]; r =  ( r ? r : "en" ); switch ( r ) { case "de" : this.support =  r + ".wikipedia.org"; break; default: this.support =  "www.mediawiki.org"; }  // switch .slang this.support =  "//" + this.support + "/wiki/"; return r;  };   // .prefs.favorite

PaneMk.prefs.furnish =  function  { // Equip Special:Gadgets page with entry and form // Uses: //   >  .type //   >  .prefs.support //   >  .prefs.texts //   >  .lazy //   >  .chars //   >  .lowChar //   >  .prefs.supply //   .prefs.favorite //   .prefs.fetch //   .prefs.fiat //   mw.libs.preferencesGadgetOptions.form // 2013-10-06 PerfektesChaos@de.wikipedia var dialog, slang =  this.favorite; this.fetch; dialog = { script: PaneMk.type, support: this.support, suffix: this.texts.suffix[ slang ], opts:   [ { signature: "appleIcon", type:     "text", show:     this.texts[ "^appleIcon" ][ slang ], suffix:   this.texts[ "?icon" ][ slang ], val:      this.fiat( "appleIcon" ) },                   { signature: "faviconICO", type:     "text", show:     this.texts[ "^faviconICO" ][ slang ], suffix:   this.texts[ "?icon" ][ slang ], val:      this.fiat( "faviconICO" ) },                   { signature: "faviconPNG", type:     "text", show:     this.texts[ "^faviconPNG" ][ slang ], suffix:   this.texts[ "?icon" ][ slang ], val:      this.fiat( "faviconPNG" ) },                   { signature: "lazy", type:     "checkbox", show:     this.texts[ "^lazy" ][ slang ], val:      ( PaneMk.lazy ? true : false ) },                   { signature: "chars", type:     "checkbox", show:     this.texts[ "^chars" ][ slang ], val:      ( PaneMk.chars ? true : false ) },                   { signature: "charDiff", type:     "text", show:     this.texts[ "^charDiff" ][ slang ], suffix:   this.texts[ "?mark" ][ slang ], val:      this.fiat( "charDiff" ) },                   { signature: "charHistory", type:     "text", show:     this.texts[ "^charHistory" ][ slang ], suffix:   this.texts[ "?mark" ][ slang ], val:      this.fiat( "charHistory" ) },                   { signature: "charLinks", type:     "text", show:     this.texts[ "^charLinks" ][ slang ], suffix:   this.texts[ "?mark" ][ slang ], val:      this.fiat( "charLinks" ) },                   { signature: "charVitally", type:     "text", show:     this.texts[ "^charVitally" ][ slang ], suffix:   this.texts[ "?mark" ][ slang ], val:      this.fiat( "charVitally" ) },                   { signature: "lowChar", type:     "checkbox", show:     this.texts[ "^lowChar" ][ slang ], val:      ( PaneMk.lowChar ? true : false ) },                   { signature: "favicon", type:     "text", show:     this.texts[ "^favicon" ][ slang ], val:      this.fiat( "favicon" ) },                   { signature: "leave", type:     "checkbox", show:     this.texts[ "^leave" ][ slang ], val:      ( PaneMk.leave ? true : false ) }                 ] };      mw.libs[ this.supply ].form( dialog ); };  // .prefs.furnish

if ( mw.config.get( "wgCanonicalSpecialPageName" ) ===  "Gadgets" ) { PaneMk.prefs.furnish; } }( window.mediaWiki ) );

// Emacs // Local Variables: // encoding: utf-8-dos // coding: utf-8-dos // fill-column: 80 // End:

/// EOF  paneMarker/dialog/d.js