### MediaWiki Resource Loader and User Token Setup Source: https://github.com/sufficientlysecure/document-viewer/blob/master/art/drawables/sources/External Sources/File Blank_globe.svg.htm This snippet demonstrates how MediaWiki's resource loader is used to implement user token functionality and conditionally load essential core and extension scripts. It ensures that critical JavaScript components are available for page rendering and interactive features. ```JavaScript mw.loader.implement("user.tokens",function(){mw.user.tokens.set({"editToken":"+\\", "watchToken":false});;},{},{}); if(window.mw){ mw.loader.load(["mediawiki.page.startup","mediawiki.legacy.wikibits","mediawiki.legacy.ajax","ext.wikimediaShopLink.core","ext.centralNotice.bannerController"]); } ``` -------------------------------- ### Initialize Spotlight Footer Elements Source: https://github.com/sufficientlysecure/document-viewer/blob/master/art/drawables/sources/External Sources/File Stop_hand_nuvola_black.svg.htm This JavaScript code initializes and populates specific footer elements on a Wikia page, likely for displaying advertisements or dynamic content. It checks for the existence of `OA_output` (OpenX Ad output) and populates `SPOTLIGHT_FOOTER` divs. If `OA_output` is not yet defined, it registers a callback to execute once it becomes available. ```javascript wgAfterContentAndJS.push(function() { fillElem_SPOTLIGHT_FOOTER_helper = function() { if (typeof OA_output != 'undefined') { if (typeof OA_output['14'] != 'undefined') { $('#SPOTLIGHT_FOOTER_1').html(OA_output['14']); } if (typeof OA_output['15'] != 'undefined') { $('#SPOTLIGHT_FOOTER_2').html(OA_output['15']); } if (typeof OA_output['16'] != 'undefined') { $('#SPOTLIGHT_FOOTER_3').html(OA_output['16']); } } }; fillElem_SPOTLIGHT_FOOTER = function () { fillElem_SPOTLIGHT_FOOTER_helper(); }; if (typeof OA_output == 'undefined') { fillElem_SPOTLIGHT_FOOTER_callback = function() { fillElem_SPOTLIGHT_FOOTER_helper(); }; if (typeof window.spcCallbacks == 'undefined') { window.spcCallbacks = new Array(); } window.spcCallbacks.push('fillElem_SPOTLIGHT_FOOTER_callback'); } }); ``` -------------------------------- ### JavaScript: Configure Liftium Ad Platform Options Source: https://github.com/sufficientlysecure/document-viewer/blob/master/art/drawables/sources/External Sources/File Stop_hand_nuvola_black.svg.htm This snippet initializes the global `LiftiumOptions` object with various configuration parameters for the Liftium ad platform. It includes publisher ID, base URL, wiki-specific key-value pairs (like database name, article ID, page type), geographical lookup URL, and domain. Additional properties like `hasMoreCalls`, `isCalledAfterOnload`, and `maxLoadDelay` are set to control ad loading behavior. ```JavaScript LiftiumOptions={"pubid":999,"baseUrl":"\/__varnish\_liftium\/","kv\_wgDBname":"runescape","kv\_article\_id":272795,"kv\_wpage":"Stop\_hand\_nuvola\_black.svg","kv\_Hub":"Gaming","kv\_skin":"oasis","kv\_user\_lang":"en","kv\_cont\_lang":"en","kv\_isMainPage":false,"kv\_page\_type":"article","geoUrl":"http:\/\/geoiplookup.wikia.com\/","kv\_domain":"runescape.wikia.com"};LiftiumOptions['hasMoreCalls']=true;LiftiumOptions['isCalledAfterOnload']=true;LiftiumOptions['maxLoadDelay']=6000; ``` -------------------------------- ### JavaScript: Configure and Prepare TOP_BUTTON Ad Slot Source: https://github.com/sufficientlysecure/document-viewer/blob/master/art/drawables/sources/External Sources/File Stop_hand_nuvola_black.svg.htm This script ensures the `window.adslots` array exists, then pushes a new ad slot configuration for 'TOP_BUTTON' with dimensions 242x90, using 'DART' as the ad server, and a priority of 24. It then conditionally calls `AdDriverDelayedLoader.prepareSlots` if ad driver initialization conditions are met, indicating the slot is ready for rendering. ```JavaScript if(!window.adslots) { window.adslots = []; } window.adslots.push(["TOP\_BUTTON", "242x90", "DART", 24]); if (window.wgLoadAdDriverOnLiftiumInit || (window.getTreatmentGroup && (getTreatmentGroup(EXP\_AD\_LOAD\_TIMING) == TG\_AS\_WRAPPERS\_ARE\_RENDERED))) { if (window.adDriverCanInit) { AdDriverDelayedLoader.prepareSlots(AdDriverDelayedLoader.highLoadPriorityFloor); } } ``` -------------------------------- ### Build Document Viewer with Gradle Source: https://github.com/sufficientlysecure/document-viewer/blob/master/README.md Instructions for building the Document Viewer Android application using Gradle. This involves setting up the Android SDK, pulling submodules, compiling native libraries, and executing the Gradle build command. ```Shell android ./init.sh cd document-viewer; ndk-build ./gradlew build ``` -------------------------------- ### OpenAIModel Constructor (__init__) Source: https://github.com/sufficientlysecure/document-viewer/blob/master/art/drawables/sources/External Sources/File Blank_globe.svg.htm Documents the `__init__` method of the `OpenAIModel` class. It specifies the `model_name` as a required string parameter for the AI model to be used, and an optional `provider` string parameter which defaults to 'openai'. ```APIDOC OpenAIModel: __init__(model_name: str, provider: str = 'openai') model_name: The name of the OpenAI model to use provider: The provider to use (defaults to 'openai') ``` -------------------------------- ### JavaScript: Configure and Prepare TOP_LEADERBOARD Ad Slot Source: https://github.com/sufficientlysecure/document-viewer/blob/master/art/drawables/sources/External Sources/File Stop_hand_nuvola_black.svg.htm This script ensures the `window.adslots` array exists, then pushes a new ad slot configuration for 'TOP_LEADERBOARD' with dimensions 728x90, using 'DART' as the ad server, and a priority of 25. It then conditionally calls `AdDriverDelayedLoader.prepareSlots` if ad driver initialization conditions are met, indicating the slot is ready for rendering. ```JavaScript if(!window.adslots) { window.adslots = []; } window.adslots.push(["TOP\_LEADERBOARD", "728x90", "DART", 25]); if (window.wgLoadAdDriverOnLiftiumInit || (window.getTreatmentGroup && (getTreatmentGroup(EXP\_AD\_LOAD\_TIMING) == TG\_AS\_WRAPPERS\_ARE\_RENDERED))) { if (window.adDriverCanInit) { AdDriverDelayedLoader.prepareSlots(AdDriverDelayedLoader.highLoadPriorityFloor); } } ``` -------------------------------- ### OpenAIModel Class Constructor API Reference Source: https://github.com/sufficientlysecure/document-viewer/blob/master/art/drawables/sources/External Sources/File Blank_globe.svg.htm API documentation for the `OpenAIModel` class, detailing its `__init__` method, required parameters, and their descriptions. This class is designed for integrating with OpenAI models. ```APIDOC OpenAIModel: __init__(model_name: str, provider: str = 'openai') model_name: The name of the OpenAI model to use provider: The provider to use (defaults to 'openai') ``` -------------------------------- ### Quantcast Analytics Integration with Custom Labels Source: https://github.com/sufficientlysecure/document-viewer/blob/master/art/drawables/sources/External Sources/File Stop_hand_nuvola_black.svg.htm This JavaScript snippet integrates Quantcast analytics. It initializes the `_qevents` array, dynamically loads the Quantcast script, and pushes a tracking event with a `qacct` and custom `labels`. The labels are dynamically generated from `cityShort` and `wgDartCustomKeyValues` to provide granular audience segmentation. ```javascript var _qevents = _qevents || []; (function() { var elem = document.createElement('script'); elem.src = (document.location.protocol == "https:" ? "https://secure" : "http://edge") + ".quantserve.com/quant.js"; elem.async = true; elem.type = "text/javascript"; var scpt = document.getElementsByTagName('script')[0]; scpt.parentNode.insertBefore(elem, scpt); })(); var quantcastLabels = ""; if (window.cityShort) { quantcastLabels += cityShort; if (window.wgDartCustomKeyValues) { var keyValues = wgDartCustomKeyValues.split(';'); for (var i=0; i= 2) { quantcastLabels += ',' + cityShort + '.' + keyValue[1]; } } } } _qevents.push( { qacct:"p-8bG6eLqkH6Avk", labels:quantcastLabels } ); ``` -------------------------------- ### RuneScape Wiki Global JavaScript Configuration Variables Source: https://github.com/sufficientlysecure/document-viewer/blob/master/art/drawables/sources/External Sources/File Stop_hand_nuvola_black.svg.htm This JavaScript block declares and initializes numerous global variables used for site configuration, including ad loading timings, A/B test settings, jQuery URL, page type, content category, Krux targeting, and various WikiFactory tags for content categorization and analytics. ```javascript var EXP_AD_LOAD_TIMING=1, AB_CONFIG=[], TG_ONLOAD=1, TG_AFTER_DEPENDENCIES=2, TG_AS_WRAPPERS_ARE_RENDERED=3, wgJqueryUrl=["http://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"], wikiaPageType="article", cscoreCat="Gaming", wgEnableKruxTargeting=true, wgKruxCategoryId="Hi0kJsuv", wgJSMessagesCB="59997.6007992.56146", JSSnippetsStack=[], wikiaTrackingSpool=[], _gaq=[], _wtq=[], adslots2=[], wgAfterContentAndJS=[], wgWikiFactoryTagIds=[1,10,13,14,19,20,21,28,37,38,131,100003,100020,100021,100024,100033,100038,100039,100040,100052,100056,100057,100058,100059,100065,100066,100078,100089,100090,100091,100092,100095,100428,100449,100455], wgWikiFactoryTagNames=["pc","fantasy","teens_(14-17)","kids_(13)","mmo","adults_(18-35)","adults_(35+)","rpg","male_(58%)","female_(42%)","gaming","rpg10","adinvisibletop","adinvisiblehometop","test","top25gaming","top_50_gaming","top_75_gaming","top_100_gaming","adss","wow","t9","skyscraper","skyscrapperwow","tandem","tandem_2","blizzardholidaysiteentry","top","pc,","mmo,","top_pc_mmo_rpg","addriver","apertureenabled","sensitive","krux"], wgDBname="runescape", wgCityId="304", wgMedusaSlot="slot1", wgContentLanguage="en", skin="oasis"; var wgNow = new Date(); window.WikiaTracker=window.WikiaTracker||{trackEvent:function(eventName,params,method){wikiaTrackingSpool.push([eventName,params,method]);}}; var EXP_AD_LOAD_TIMING=1,TG_ONLOAD=1,TG_AFTER_DEPENDENCIES=2,TG_AS_WRAPPERS_ARE_RENDERED=3,AB_CONFIG={"1":{"name":"Ad Load Timing","begin_time":"2012-05-10 17:14:39","end_time":"2020-01-01 00:00:00","ga_slot":46,"groups":{"1":{"name":"onload","is_control":true,"min":0,"max":-1},"2":{"name":"After Dependencies","is_control":false,"min":0,"max":-1},"3":{"name":"As wrappers are rendered","is_control":false,"min":0,"max":-1}}}} ``` -------------------------------- ### Initialize Ad Slot and Conditionally Load Ad Driver Source: https://github.com/sufficientlysecure/document-viewer/blob/master/art/drawables/sources/External Sources/File Stop_hand_nuvola_black.svg.htm This JavaScript code initializes a new advertisement slot, 'TOP_RIGHT_BOXAD', with specified dimensions and type. It then conditionally prepares ad driver slots for loading, based on global flags (`window.wgLoadAdDriverOnLiftiumInit`) or A/B testing group assignments, to optimize ad rendering performance. ```JavaScript if(!window.adslots) { window.adslots = []; } window.adslots.push(["TOP_RIGHT_BOXAD", "300x250", "DART", 20]); if (window.wgLoadAdDriverOnLiftiumInit || (window.getTreatmentGroup && (getTreatmentGroup(EXP_AD_LOAD_TIMING) == TG_AS_WRAPPERS_ARE_RENDERED))) { if (window.adDriverCanInit) { AdDriverDelayedLoader.prepareSlots(AdDriverDelayedLoader.highLoadPriorityFloor); } } ``` -------------------------------- ### MediaWiki JavaScript Loader Initialization Source: https://github.com/sufficientlysecure/document-viewer/blob/master/art/drawables/sources/External Sources/File Blank_globe.svg.htm Initializes MediaWiki's JavaScript loader state and loads various modules and extensions for the page. This script ensures that necessary components like user data, page readiness, and specific gadgets are loaded after the page's initial state is set. ```JavaScript if(window.mw){ mw.loader.state({"site":"loading","user":"ready","user.groups":"ready"}); } if(window.mw){ mw.loader.load(["mediawiki.action.view.metadata","mediawiki.user","mediawiki.page.ready","mediawiki.legacy.mwsuggest","ext.gadget.teahouse","ext.gadget.ReferenceTooltips","ext.vector.collapsibleNav","ext.vector.collapsibleTabs","ext.vector.editWarning","ext.vector.simpleSearch","ext.UserBuckets","ext.articleFeedback.startup","ext.markAsHelpful","ext.Experiments.lib","ext.Experiments.experiments"], null, true); } ``` -------------------------------- ### Comscore Analytics Integration for RuneScape Wiki Source: https://github.com/sufficientlysecure/document-viewer/blob/master/art/drawables/sources/External Sources/File Stop_hand_nuvola_black.svg.htm This JavaScript snippet integrates Comscore analytics. It initializes the `_comscore` array with configuration parameters, including `c1`, `c2`, and `url_append` for custom keywords, then dynamically loads the Comscore beacon script to track page views and user behavior. ```javascript var _comscore = _comscore || []; _comscore.push({ c1: "2", c2: "6177433", options: { url_append: "comscorekw=wikiacsid_gaming" } }); (function() { var s = document.createElement("script"), el = document.getElementsByTagName("script")[0]; s.async = true; s.src = (document.location.protocol == "https:" ? "https://sb" : "http://b") + ".scorecardresearch.com/beacon.js"; el.parentNode.insertBefore(s, el); })(); ``` -------------------------------- ### Initialize MediaWiki Loader State and Load Modules Source: https://github.com/sufficientlysecure/document-viewer/blob/master/art/drawables/sources/External Sources/File Question_book.svg.htm This JavaScript snippet checks for the presence of the global 'mw' object (MediaWiki's core JavaScript object). If 'mw' exists, it initializes the MediaWiki loader's state for the site and user. Subsequently, it loads a comprehensive list of MediaWiki modules and gadgets, which are crucial for various page functionalities, including metadata handling, user interactions, page readiness, search suggestions, and specific extensions like ZoomViewer, UploadWizard, and AjaxQuickDelete, likely supporting image annotation and other interactive features. ```JavaScript if(window.mw){ mw.loader.state({"site":"loading","user":"ready","user.groups":"ready"}); } if(window.mw){ mw.loader.load(["mediawiki.action.view.metadata","mediawiki.user","mediawiki.page.ready","mediawiki.legacy.mwsuggest","ext.gadget.ZoomViewer","ext.gadget.UploadWizard","ext.gadget.Long-Image-Names-in-Categories","ext.gadget.Stockphoto","ext.gadget.ExtraTabs2","ext.gadget.WikiMiniAtlas","ext.gadget.AjaxQuickDelete","ext.vector.collapsibleNav","ext.vector.collapsibleTabs","ext.vector.editWarning","ext.vector.simpleSearch"], null, true); } ``` -------------------------------- ### Configure MediaWiki Global Settings Source: https://github.com/sufficientlysecure/document-viewer/blob/master/art/drawables/sources/External Sources/File Stop_hand_nuvola_black.svg.htm This JavaScript code block sets various global configuration parameters for a MediaWiki instance, specifically for a file page (`File:Stop_hand_nuvola_black.svg`). It defines properties like namespace, page name, revision ID, article ID, user groups, categories, language, ad settings, geo-targeting, time ago internationalization, and SASS parameters for styling. This configuration is crucial for how the MediaWiki frontend renders the page and handles user interactions. ```javascript if(window.mw){ mw.config.set({"wgCanonicalNamespace":"File","wgCanonicalSpecialPageName":false,"wgNamespaceNumber":6,"wgPageName":"File:Stop_hand_nuvola_black.svg","wgTitle":"Stop hand nuvola black.svg","wgCurRevisionId":4325848,"wgArticleId":272795,"wgIsArticle":true,"wgAction":"view","wgUserName":null,"wgUserGroups":["*"],"wgCategories":["Permanently protected pages","LGPL images","RuneScape Wiki images"],"wgBreakFrames":false,"wgPageContentLanguage":"en","wgSeparatorTransformTable":["",""],"wgDigitTransformTable":["",""],"wgRelevantPageName":"File:Stop_hand_nuvola_black.svg","wgRestrictionEdit":["sysop"],"wgRestrictionMove":["sysop"],"wgRestrictionUpload":["sysop"],"wgSearchNamespaces":[0,14,116,120],"wgEnableAdsInContent":1,"wgEnableAdMeldAPIClient":true,"wgEnableAdMeldAPIClientPixels":true,"wgEnableOpenXSPC":true,"cityShort":"gaming","wgAdDriverCookieLifetime":1,"wgHighValueCountries":{"AU":3,"BE":3,"CA":3,"DE":3,"DK":3,"FI":3,"FR":3,"GB":3,"HU":3,"LU":3,"NL":3,"NO":3,"SE":3,"UA":3,"UK":3,"US":3},"wgAdDriverUseExpiryStorage":true,"wgDartCustomKeyValues":"age=kids;age=teen;gnre=mmo;gnre=rpg;pform=pc;volum=l;sex=m;age=3-12;age=13-17;eth=asian;eth=hisp;kids=0-17;kids=3-12;kids=13-17;hhi=0-30;hhi=60-100;comm=sensitive","wgTimeAgoi18n":{"year":"a year ago","years":"%d years ago","month":"a month ago","months":"%d months ago","day":"a day ago","days":"%d days ago","hour":"an hour ago","hours":"%d hours ago","minute":"a minute ago","minutes":"%d minutes ago","seconds":"a minute ago","year-from-now":"\\x26lt;timeago-year-from-now\\x26gt;","years-from-now":"\\x26lt;timeago-year-from-now\\x26gt;","month-from-now":"a month from now","months-from-now":"%d months from now","day-from-now":"a day from now","days-from-now":"%d days from now","hour-from-now":"an hour from now","hours-from-now":"%d hours from now","minute-from-now":"a minute from now","minutes-from-now":"%d minutes from now","second-from-now":"a minute from now","seconds-from-now":"a minute from now"},"sassParams":{"background-align":"center","background-fixed":"true","background-image":"http://images2.wikia.nocookie.net/__cb56/runescape/images/archive/5/50/20110104021204%21Wiki-background","background-tiled":"false","color-body":"#cda172","color-buttons":"#483821","color-header":"#483821","color-links":"#7f571f","color-page":"#fff8dc","page-opacity":"100","wordmark-font":"prociono"},"wgAssetsManagerQuery":"/__am/%4$d/%1$s/%3$s/%2$s","wgCdnRootUrl":"http://slot1.images.wikia.nocookie.net","wgCatId":2,"wgParentCatId":0,"wgBlankImgUrl":"data:image/gif;base64,R0lGODlhAQABAIABAAAAAP///yH5BAEAAAEALAAAAAABAAEAQAICTAEAOw%3D%3D","wgPrivateTracker":true,"wgMainpage":"RuneScape Wiki","wgStyleVersion":"59997","themename":"oasis","wgExtensionsPath":"http://slot1.images.wikia.nocookie.net/__cb59997/common/extensions","wgResourceBasePath":"http://slot1.images.wikia.nocookie.net/__cb59997/common","wgSitename":"RuneScape Wiki","wgMWrevId":false,"wgCookieDomain":".wikia.com","wgCookiePath":"/","ExitstitialOutboundScreen":"/wiki/Special:Outbound?f=File%3AStop_hand_nuvola_black.svg","wgExitstitialTitle":"Leaving RuneScape Wiki","wgExitstitialRegister":"\\x"}); } ``` -------------------------------- ### Load Social Media APIs via JSSnippetsStack Source: https://github.com/sufficientlysecure/document-viewer/blob/master/art/drawables/sources/External Sources/File Stop_hand_nuvola_black.svg.htm These JavaScript snippets demonstrate how social media APIs (Twitter and Facebook) are loaded on the page using a `JSSnippetsStack` mechanism. Each snippet pushes an object with `dependencies` and a `getLoaders` function that returns an array of loader functions, such as `$.loadTwitterAPI` or `$.loadFacebookAPI`. ```JavaScript JSSnippetsStack.push({dependencies:[],getLoaders:function(){return [$.loadTwitterAPI]}}) ``` ```JavaScript JSSnippetsStack.push({dependencies:[],getLoaders:function(){return [$.loadFacebookAPI]}}) ``` -------------------------------- ### Debug Document Viewer Native Libraries with NDK-GDB Source: https://github.com/sufficientlysecure/document-viewer/blob/master/README.md Steps to debug the native C/C++ libraries of Document Viewer using `ndk-gdb`. This includes building the native libraries with debug flags, a hack for `ndk-gdb` to find necessary files, and launching the debugger. ```Shell cd document-viewer; ndk-build -j8 NDK_DEBUG=1 cp src/main/AndroidManifest.xml . ndk-gdb ``` -------------------------------- ### Initialize MediaWiki Central Notice System Source: https://github.com/sufficientlysecure/document-viewer/blob/master/art/drawables/sources/External Sources/File Blank_globe.svg.htm This JavaScript call initializes the MediaWiki Central Notice system. This system is commonly used for displaying site-wide announcements, banners, or fundraising campaigns, such as the 'Wiki Loves Monuments' campaign mentioned in the document. ```JavaScript mw.centralNotice.initialize(); ``` -------------------------------- ### Register Callback for Facebook API Loading Source: https://github.com/sufficientlysecure/document-viewer/blob/master/art/drawables/sources/External Sources/File Stop_hand_nuvola_black.svg.htm This JavaScript snippet registers a callback function, `window.onFBloaded`, to be executed once the Facebook API is successfully loaded. It uses a `JSSnippetsStack` to manage dependencies and deferred execution of scripts, ensuring `$.loadFacebookAPI` is called before the callback. ```JavaScript JSSnippetsStack.push({dependencies:[],getLoaders:function(){return [$.loadFacebookAPI]},callback:function(json){window.onFBloaded(json)},id:"window.onFBloaded"}) ``` -------------------------------- ### MediaWiki User Options and Module Loader Script Source: https://github.com/sufficientlysecure/document-viewer/blob/master/art/drawables/sources/External Sources/File Antarctica_on_the_globe_(red).svg.htm This minified JavaScript code block defines global MediaWiki configuration settings and user-specific options. It includes preferences for UI elements (e.g., collapsible navigation, simple search), editing features (e.g., edit warning, section edit links), and content display (e.g., image size, show TOC). It also initializes the MediaWiki resource loader and user tokens. ```javascript collapsiblenav":true,"collapsibletabs":true,"editwarning":true,"expandablesearch":false,"footercleanup":false,"sectioneditlinks":false,"simplesearch":true,"experiments":true},"wgWikiEditorEnabledModules":{"toolbar":true,"dialogs":true,"hidesig":true,"templateEditor":false,"templates":false,"preview":false,"previewDialog":false,"publish":false,"toc":false},"wgCategoryTreePageCategoryOptions":"{\\"mode\\":0,\\"hideprefix\\":20,\\"showcount\\":true,\\"namespaces\\":false}","Geo":{"city":"","country":""},"wgNoticeProject":"wikipedia"}); }if(window.mw){ mw.loader.implement("user.options",function(){mw.user.options.set({"ccmeonemails":0,"cols":80,"date":"default","diffonly":0,"disablemail":0,"disablesuggest":0,"editfont":"default","editondblclick":0,"editsection":1,"editsectiononrightclick":0,"enotifminoredits":0,"enotifrevealaddr":0,"enotifusertalkpages":1,"enotifwatchlistpages":0,"extendwatchlist":0,"externaldiff":0,"externaleditor":0,"fancysig":0,"forceeditsummary":0,"gender":"unknown","hideminor":0,"hidepatrolled":0,"imagesize":2,"justify":0,"math":0,"minordefault":0,"newpageshidepatrolled":0,"nocache":0,"noconvertlink":0,"norollbackdiff":0,"numberheadings":0,"previewonfirst":0,"previewontop":1,"quickbar":5,"rcdays":7,"rclimit":50,"rememberpassword":0,"rows":25,"searchlimit":20,"showhiddencats":false,"showjumplinks":1,"shownumberswatching":1,"showtoc":1,"showtoolbar":1,"skin":"vector","stubthreshold":0,"thumbsize":4,"underline":2,"uselivepreview":0,"usenewrc":0,"watchcreations":1,"watchdefault":0,"watchdeletion":0,"watchlistdays":3 ,"watchlisthideanons":0,"watchlisthidebots":0,"watchlisthideliu":0,"watchlisthideminor":0,"watchlisthideown":0,"watchlisthidepatrolled":0,"watchmoves":0,"wllimit":250,"vector-simplesearch":1,"useeditwarning":1,"vector-collapsiblenav":1,"usebetatoolbar":1,"usebetatoolbar-cgd":1,"variant":"it","language":"it","searchNs0":true,"searchNs1":false,"searchNs2":false,"searchNs3":false,"searchNs4":false,"searchNs5":false,"searchNs6":false,"searchNs7":false,"searchNs8":false,"searchNs9":false,"searchNs10":false,"searchNs11":false,"searchNs12":false,"searchNs13":false,"searchNs14":false,"searchNs15":false,"searchNs100":false,"searchNs101":false,"searchNs102":false,"searchNs103":false});;},{},{});mw.loader.implement("user.tokens",function(){mw.user.tokens.set({"editToken":"+\\","watchToken":false});;},{},{}); /* cache key: itwiki:resourceloader:filter:minify-js:7:b58d12453f18a0080c4eac1dffcb1f76 */ } if(window.mw){ mw.loader.load(["mediawiki.page.startup","mediawiki.legacy.wikibits","mediawiki.legacy.ajax","ext.centralNotice.bannerController"]); } ``` -------------------------------- ### JavaScript for Central Notice Initialization and Dynamic HTML Injection Source: https://github.com/sufficientlysecure/document-viewer/blob/master/art/drawables/sources/External Sources/File Question_book.svg.htm This JavaScript code performs two main actions: it initializes the `mw.centralNotice` system, likely for displaying site-wide messages, and then dynamically writes a hidden `div` element named 'localNotice' into the document, which could be used for localized content. ```JavaScript mw.centralNotice.initialize(); /* */ ``` -------------------------------- ### MediaWiki Client Configuration Object Source: https://github.com/sufficientlysecure/document-viewer/blob/master/art/drawables/sources/External Sources/File Blank_globe.svg.htm Defines a comprehensive JavaScript object containing various MediaWiki client-side configuration settings. These settings control user interface elements, search behavior, gadget availability, and other operational parameters for the MediaWiki frontend. ```JavaScript { "rows": 25, "searchlimit": 20, "showhiddencats": false, "showjumplinks": 1, "shownumberswatching": 1, "showtoc": 1, "showtoolbar": 1, "skin": "vector", "stubthreshold": 0, "thumbsize": 4, "underline": 2, "uselivepreview": 0, "usenewrc": 0, "watchcreations": 1, "watchdefault": 0, "watchdeletion": 0, "watchlistdays": 3, "watchlisthideanons": 0, "watchlisthidebots": 0, "watchlisthideliu": 0, "watchlisthideminor": 0, "watchlisthideown": 0, "watchlisthidepatrolled": 0, "watchmoves": 0, "wllimit": 250, "flaggedrevssimpleui": 1, "flaggedrevsstable": 0, "flaggedrevseditdiffs": true, "flaggedrevsviewdiffs": false, "vector-simplesearch": 1, "useeditwarning": 1, "vector-collapsiblenav": 1, "usebetatoolbar": 1, "usebetatoolbar-cgd": 1, "wikilove-enabled": 1, "variant": "en", "language": "en", "searchNs0": true, "searchNs1": false, "searchNs2": false, "searchNs3": false, "searchNs4": false, "searchNs5": false, "searchNs6": false, "searchNs7": false, "searchNs8": false, "searchNs9": false, "searchNs10": false, "searchNs11": false, "searchNs12": false, "searchNs13": false, "searchNs14": false, "searchNs15": false, "searchNs100": false, "searchNs101": false, "searchNs108": false, "searchNs109": false, "gadget-teahouse": 1, "gadget-ReferenceTooltips": 1, "gadget-DRN-wizard": 1, "gadget-mySandbox": 1 } ``` -------------------------------- ### Configure MediaWiki Global Settings with JavaScript Source: https://github.com/sufficientlysecure/document-viewer/blob/master/art/drawables/sources/External Sources/File Blank_globe.svg.htm This JavaScript block sets various global configuration parameters for a MediaWiki environment using `mw.config.set()`. It includes details like the canonical namespace, page name, revision IDs, article status, user groups, language settings, date formats, and enabled Vector skin modules. ```JavaScript if(window.mw){ mw.config.set({"wgCanonicalNamespace":"File","wgCanonicalSpecialPageName":false,"wgNamespaceNumber":6,"wgPageName":"File:Blank_globe.svg","wgTitle":"Blank globe.svg","wgCurRevisionId":0,"wgArticleId":0,"wgIsArticle":true,"wgAction":"view","wgUserName":null,"wgUserGroups":["*"],"wgCategories":[],"wgBreakFrames":false,"wgPageContentLanguage":"en","wgSeparatorTransformTable":["",""],"wgDigitTransformTable":["",""],"wgDefaultDateFormat":"dmy","wgMonthNames":["","January","February","March","April","May","June","July","August","September","October","November","December"],"wgMonthNamesShort":["","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],"wgRelevantPageName":"File:Blank_globe.svg","wgRestrictionCreate":[],"wgRestrictionUpload":[],"wgSearchNamespaces":[0],"wgVectorEnabledModules":{"collapsiblenav":true,"collapsibletabs":true,"editwarning":true,"expandablesearch":false,"footercleanup":false,"sectioneditlinks":false,"simplesearch":true,"experiments":true},"wgWikiEditorEnabledModules":{"toolbar":true,"dialogs":true,"hidesig":true,"templateEditor":false,"templates":false,"preview":false,"previewDialog":false,"publish":false,"toc":false},"wgTrackingToken":"cb2d5b2ea29b19b34c6b42220a4c0401","wgArticleFeedbackv5Permissions":{"aft-reader":true,"aft-member":false,"aft-editor":false,"aft-monitor":false,"aft-administrator":false,"aft-oversighter":false},"wikilove-recipient":"","wikilove-anon":0,"mbEmailEnabled":true,"mbUserEmail":false,"mbIsEmailConfirmationPending":false,"wgFlaggedRevsParams":{"tags":{"status":{"levels":1,"quality":2,"pristine":3}}},"wgStableRevisionId":null,"wgCategoryTreePageCategoryOptions":"{\"mode\":0,\"hideprefix\":20,\"showcount\":true,\"namespaces\":false}","Geo":{"city":"","country":""},"wgNoticeProject":"wikipedia"}); } ``` -------------------------------- ### CSS Styles for MarkAsHelpful and Reference Tooltips Source: https://github.com/sufficientlysecure/document-viewer/blob/master/art/drawables/sources/External Sources/File Blank_globe.svg.htm This CSS snippet defines the visual appearance and behavior of the 'MarkAsHelpful' wrapper and the 'referencetooltip' elements on Wikipedia. It includes styles for normal, hover, and marked states for the helpfulness feature, and detailed styling for the reference tooltip, including its positioning, borders, shadows, and arrow-like elements. ```CSS .mw-mah-wrapper a{cursor:pointer}.mw-mah-wrapper .mah-helpful-state{background:transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAwFBMVEX///+AgICzs7OioqLS0tK9vb3e3t6ioqLe3t6lpaXe3t6ioqLS0tLX19fb29vS0tK4uLjb29u4uLjb29vb29vX19fNzc2urq7Dw8Ourq6urq6pqampqamlpaXNzc3JycmlpaXJycnDw8Ourq7JycnNzc3S0tKzs7O4uLje3t6NjY10dHSioqKurq52dnZ4eHi+vr7MzMyKioqVlZVra2t6enqlpaXb29t9fX3X19eHh4e7u7u9vb3Dw8NwcHCpqamjqutxAAAAJHRSTlMAAISB8/mHydjeGAwVVPYb0l3P81Raihjz8BJUTkiE2z/P+fOmaXKeAAAAlklEQVR4XmXP1Q6DQBCG0S4udXddQ+tu7/9W/QuEkPBdzE7O1WylHCHEMSzPswwHawKt+jWp002hd8+r/aGhcf7kaMe5VgX0GWMnhj57xuaABaX0SLOxAqzfhYYA/VVIBzSlPPsS+Tcp2wBFCBE/hDjEWBTAYBNF0TYIYjyjMYBMvnnT9PSZfUmylyQF4qpmGJqqSwClfm4rG35BO7jwAAAAAElFTkSuQmCC) no-repeat left center;background:transparent url(//bits.wikimedia.org/static-1.20wmf11/extensions/MarkAsHelpful/modules/ext.markAsHelpful/images/mah-helpful-dull.png?2012-09-03T14:56:40Z) no-repeat left center!ie;padding-left:18px}.mw-mah-wrapper .mah-helpful-state:hover{background:transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABpFBMVEX///+AgIBknYBYmXlknYBhnH5dmntYmXlhnH5Ul3VknYBhnH5hnH5dmntKlG5YmXlKlG5FkmpUl3VknYBknYBFkmpAkGdPlXJAkGc7jmRYmXk7jmQ3jWE3jWFknYA3jWE3jWEzi14zi14zi14wilwwilxPlXIwilwwilwuiVsuiVsuiVsuiVsuiVsuiVsuiVtkvpFmpYUzlGNqsY0xjV9SuoZhwpENIhhmwZNgrYUmVj1asoViooFprotop4diqoZDmG04mGdRuIQ6oGwKEQ1VqX4iUjlPp3pTkHJcpoBruZIPJho/onBdoX9euotgv45joIFdmntXuIZZvYpbwIxknYBovJFTsYFKs31doH4LEw9KnHJEpHNBnG08kWZZqIBqtpBduYo6lGY9nGw/o3EQKh1esogSKR1mqYZBnG5Wm3hIo3UPJRo9kmZqv5M8nGw5k2ZWmndpto1Rt4Qzi142k2NZqYE6nmsvWUQ5nWo1kmMVMCJIonRDl21KnXIuV0IzkmFQnnYykWFdsYdTnnhEpXMOIhggTDVPnnZmqodTnXhpvpMpx75iAAAAL3RSTlMAABLthPZOEmB41fNUXfkb29vMivN4G/OH7RJd/E5a88nwThiEzMaBEgXD7vYAAADdSURBVHheZc7DlgNRFIXhvqHRts1CbNu22bZtvXROUsP8o72+0e7rDSE0ODMUj/MYNJhd4DBDhMFAhPgCCoRh3a9eKtW3dGFWB8QTfqOr5PGcuYxpOhtgYM+tziSO/hM2tfuUCzD6cdW4wVUq/Pm9+LcCIHq1awNBhSJY1tp/JAD9T85kJBqLRSNJZ3YYYMS039RY5PJzzf3D4xjA+OHu59d3KuU4yOULkwBT05Vqra5Uen3HJ7NzAGj+4tJ8bbXemu8WFqnrS8uyF5J8k62uIQrQ+sYmhm1t7yCAntoIMi7vn1V0QgAAAABJRU5ErkJggg==) no-repeat left center;background:transparent url(//bits.wikimedia.org/static-1.20wmf11/extensions/MarkAsHelpful/modules/ext.markAsHelpful/images/mah-helpful-hover.png?2012-09-03T14:56:40Z) no-repeat left center!ie}.mw-mah-wrapper .mah-helpful-marked-state{background:transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAzFBMVEX///+AgICB0KiF0qtAuHtOvYWF0qt4zaFAuHtEun6F0qt9z6V9z6V4zaGB0KhgxJF4zaFgxJFZwYxsyJpyy51ZwYxTv4mB0KhOvYVyy51OvYVIu4FIu4FsyJpEun5Eun5AuHtmxpVTv4lmxpVAuHtsyJpyy51ZwYxTv4l4zaEQJhsrXUNAuHtOvYWF0qsSKR0ZNicVLiFfon9gpIEULyEJEQ0RKx4RJhyB0KhuxJdEun4FCgckUjszXkgmWUAwWUVmxpVgxJFIu4F9z6VRJyO9AAAAJXRSTlMAAPPYgfOH88lIGFpUG1r5FfPbz4TPh1cbhxVaVNvk3g/5hPAMT7vCKAAAAJhJREFUeF5lztUKw0AQhtFuVOru3rVY1V3e/536N4EQyAfDDOdqctkIIY6hhqFqODgjKCmnKKUdQ/6bVPhD0ZRyI9FWSrMC6DLGrgztz4w1AENK6Z2iJ6YOmL5SzQHld6oqoMb52uPIW3HeBLSEEMebEI8ljhmgowdBsHPdA5beA5D+J2kQv26PLlFjm8RAJprl+5a2IIBMPybPHPtdJtGCAAAAAElFTkSuQmCC) no-repeat left center;background:transparent url(//bits.wikimedia.org/static-1.20wmf11/extensions/MarkAsHelpful/modules/ext.markAsHelpful/images/mah-helpful-marked.png?2012-09-03T14:56:40Z) no-repeat left center!ie;padding-left:18px} /* cache key: enwiki:resourceloader:filter:minify-css:7:437eed27274d6a6da0e2cd19371e08d6 */ .referencetooltip{position:absolute;list-style:none;list-style-image:none;opacity:0;font-size:10px;margin:0;z-index:5;padding:0}.referencetooltip li{border:#080086 2px solid;max-width:260px;padding:10px 8px 13px 8px;margin:0px;background-color:#F7F7F7;box-shadow:2px 4px 2px rgba(0,0,0,0.3);-moz-box-shadow:2px 4px 2px rgba(0,0,0,0.3);-webkit-box-shadow:2px 4px 2px rgba(0,0,0,0.3)}.referencetooltip li+li{margin-left:7px;margin-top:-2px;border:0;padding:0;height:3px;width:0px;background-color:transparent;box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none;border-top:12px #080086 solid;border-right:7px transparent solid;border-left:7px transparent solid}.referencetooltip>li+li::after{content:'';border-top:8px #F7F7F7 solid;border-right:5px transparent solid;border-left:5px transparent solid;margin-top:-12px;margin-left:-5px;z-index:1;height:0px;width:0px;display:block}.client-js .referencetooltip li ul li{border:none;box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none;height:auto;width:auto;margin:auto;padding:0;position:static}.RTflipped{padding-top:13px}.referencetooltip.RTflipped li+li{position:absolute;top:2px;border-top:0;border-bottom:12px #080086 solid}.referencetooltip.RTflipped li+li::after{border-top:0;border-bottom:8px #F7F7F7 solid;position:absolute;margin-top:7px}.RTsettings{float:right;height:16px;width:16px;cursor:pointer;background-image:url(//upload.wikimedia.org/wikipedia/commons/e/ed/Cog.png);margin-top:-9px;margin-right:-7px;-webkit-transition:opacity 0.15s;-moz-transition:opacity 0.15s;-o-transition:opacity 0.15s;-ms-transi ``` -------------------------------- ### Dynamically Load CSS with JavaScript Source: https://github.com/sufficientlysecure/document-viewer/blob/master/art/drawables/sources/External Sources/File Stop_hand_nuvola_black.svg.htm This JavaScript snippet uses `setTimeout` to asynchronously load a CSS file. It utilizes the `wsl.loadCSS` function, likely a custom utility, to inject a print-specific stylesheet with a complex URL containing various theme parameters. The `setTimeout` ensures the CSS loading occurs after a short delay, potentially to avoid blocking initial page rendering or to wait for other scripts to initialize. ```JavaScript setTimeout(function(){wsl.loadCSS(["http:\\/\\/slot1.images.wikia.nocookie.net\\/__am\\/59997\\/sass\\/background-align%3Dcenter%26background-fixed%3Dtrue%26background-image%3Dhttp%253A%252F%252Fimages2.wikia.nocookie.net%252F__cb56%252Frunescape%252Fimages%252Farchive%252F5%252F50%252F20110104021204%252521Wiki-background%26background-tiled%3Dfalse%26color-body%3D%2523cda172%26color-buttons%3D%2523483821%26color-header%3D%2523483821%26color-links%3D%25237f571f%26color-page%3D%2523fff8dc%26page-opacity%3D100%26wordmark-font%3Dprociono\\/skins\\/oasis\\/css\\/print.scss"], 'print')}, 100) ```