boldvilla.blogg.se

Wikia tabview js
Wikia tabview js













wikia tabview js

The TabView.js file says that it anycodings_php "epends on skins/oasis/js/tab.js". $js = "mw.ing( 'ext.TabView', function () ) " In the hook function, we then need to anycodings_php tell MediaWiki to load this module and anycodings_php to call the TabView.init() function, anycodings_php like this: $opts = array( 'id' => "flytabs_$id", 'selected' => $optionsIndex )

wikia tabview js

Of course, if we had anycodings_php several extensions that used the anycodings_php mustache.js library, it would be more anycodings_php efficient and elegant to make it a anycodings_php separate module by itself, but then it anycodings_php would need a glue script that did anycodings_php something like window.Mustache = anycodings_php Mustache. (I believe loading the two JS files anycodings_php together like this should work, even anycodings_php with ResourceLoader's scoping anycodings_php peculiarities. You'll also need to copy anycodings_php the mustache.js library to the anycodings_php TabView/js subdirectory.

wikia tabview js

You can specify them in MediaWiki:Common. There are 3 variables that contain config for the script. Insert this somewhere near the top of anycodings_php the extension code, outside the function anycodings_php definitions. Without any setup, script will only support basic and advanced tooltips. 'scripts' => array( 'js/mustache.js', 'js/TabView.js' ), First, we need to anycodings_php define a ResourceLoader module that anycodings_php loads the scripts we need (warning: anycodings_php untested code!): $wgResourceModules = array( It shouldn't be too hard to do the same anycodings_php thing with the standard MediaWiki anycodings_php ResourceLoader. Specifically, looking at the JSSnippets anycodings_php class documentation (see links above), anycodings_php what the addToStack() call does is tell anycodings_php the browser to asynchronously load the anycodings_php two linked JS files and then, once the anycodings_php files have loaded, call the JS function anycodings_php TabView.init() with the named arguments anycodings_php id and selected (passed as properties of anycodings_php a generic object, like in JSON). You could try anycodings_php adding all the dependencies to your anycodings_php wiki, but it might be easier to just anycodings_php replicate the functionality using anycodings_php standard MediaWiki features.

WIKIA TABVIEW JS CODE

In short, the JS side of that extension anycodings_php seems to make use of a whole bunch of anycodings_php Wikia-specific code. To execute arbitrary JavaScript code within the template without rendering its output. Through anycodings_php the framework, it instantiates a anycodings_php JSSnippets object from the Wikia anycodings_php JSSnippets extension. The TabView extension you linked to anycodings_php seems to depend on the Wikia Nirvana anycodings_php framework, and specifically on the anycodings_php WikiaSuperFactory class (which the class anycodings_php "F" is a dummy subclass of).















Wikia tabview js