Difference between revisions 137842 and 137924 on testwiki

/// PerfektesChaos/js/WikisyntaxTextMod/?L.js
/// 2012-06-202 [email protected]
/// Fingerprint: #0#0#
/// <nowiki>
// Localization for WikiSyntaxTextMod



if (typeof(mediaWiki) !== "object") {   // disconnected
   mw  =  { libs:   { WikiSyntaxTextMod:  {debugging: false}
                    },
            log:    function () {}
          };
}
if (typeof(mw.libs.WikiSyntaxTextMod) !== "object") {   // isolated
   mw.libs.WikiSyntaxTextMod  =  { };
}
if (typeof(mw.libs.WikiSyntaxTextMod.l10n) !== "object") {
   mw.libs.WikiSyntaxTextMod.l10n  =  { };
}
mw.libs.WikiSyntaxTextMod.l10n.vsn  =  -3.99891;
if (typeof(mw.libs.WikiSyntaxTextMod.bb) !== "object") {
   mw.libs.WikiSyntaxTextMod.bb  =  { };
}
with (mw.libs) {   // "W"
   if (typeof(WikiSyntaxTextMod.main) !== "object") {
      WikiSyntaxTextMod.main  =  { modules: [ ] };   // "W"
   }
(contracted; show full)   //                [0]  -- string: plain code or longer expression
   //                [1]  -- true: try to make template,  format ID
   // Postcondition:
   //    Returns string with standardized ID (not trimmed) or
   //            created template transclusion
   // Uses:
   //    >  .str.sticks

   //    ><.g.re.issn_badform
   //    ><.g.re.issn_encode
   // 2012-05-316-22 [email protected]
   var r  =  arglist[0];
   var x;
mw.log(WSTM.debugging,".hooks.issn()",0,WSTM.g.re);
   if (! WSTM.g.re.issn_badform) {
      WSTM.g.re.issn_badform  =  new RegExp("\\bISSN[:=]?( *[0-9])", "");
   }
   if (! WSTM.g.re.issn_encode) {
      WSTM.g.re.issn_encode  =  new RegExp("([0-9])[" + WSTM.str.sticks + " ]
                                           + " ]([0-9xX])",
                                           "g");
   }
   r  =  r.replace(WSTM.g.re.issn_encode, "-$1-$2");
   if (arglist[1]) {
      x  =  WSTM.l10n.lang[WSTM.g.projLang];
      if (typeof(x) === "object") {
         x  =  x.issn;
         if (typeof(x) === "function") {
            r  =  x(r);
         }
      }
   } else {
      r  =  r.toUpperCase().replace(/\bISSN[:=]?( *[0-9])/, "WSTM.g.re.issn_badform, "ISSN $1");
   }
   return  r;
};   // .hooks.issn()



};   // .bb.hooks()
(contracted; show full)// Emacs
// Local Variables:
// coding: utf-8-unix
// encoding: utf-8-unix
// fill-column: 80
// End:

/// EOF </nowiki>   WikiSyntaxTextMod/?L.js