MediaWiki:ArticlePreview/beta.js

/** * @name           ArticlePreview * @author         Ultimate Dark Carnage  * @version        2.0a */ require(["wikia.window", "jquery", "mw", "ext.wikia.design-system.loading-spinner"], function(window, $, mw, Spinner){   var allowedActions = ["history", "view"];    if (allowedActions.indexOf(mw.config.get("wgAction")) === -1) return;

var a = [], slice = a.slice, indexOf = a.indexOf, o = {}, has = o.hasOwnProperty, _def = function{ var args = slice.call(arguments), res = null; while (args.length){ var value = args.shift; if (typeof value === "undefined") continue; res = value; break; }           return res; },       ArticlePreview = (function{            function guid{                var a = new Array(8), r = [];                for (var i = 0; i < a.length; i++){                    r[i] = Math.floor(Math.random * 10);                }                return Number(r.join(""));            }            var ap = {};            ap.guid = guid;            ap.name = "ArticlePreview";            ap.version = "2.0a";            return ap;        });

ArticlePreview.CHARACTER_LIMIT = 350;

ArticlePreview.IS_ADMIN = ["staff", "helper", "vstf", "bureaucrat", "sysop"].indexOf(mw.config.get("wgUserGroups").join(" ")) !== -1;

ArticlePreview.ShowPage = function(options){ if (!(this instanceof ArticlePreview.ShowPage)){ return new ArticlePreview.ShowPage(options); }       this.link = _def(options.link, ""); this.image = _def; this.pageName = _def; return this.process; };

ArticlePreview.ShowPage.prototype = { constructor: ArticlePreview.ShowPage, process: function{ return this; },       load: function{ }   }; });