r95186 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r95185‎ | r95186 | r95187 >
Date:00:42, 22 August 2011
Author:jeroendedauw
Status:ok
Tags:
Comment:
adding some utility js
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/SMW_Setup.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/resources (added) (history)
  • /trunk/extensions/SemanticMediaWiki/resources/ext.smw.compat.js (added) (history)
  • /trunk/extensions/SemanticMediaWiki/resources/ext.smw.js (added) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/SMW_Setup.php
@@ -112,9 +112,18 @@
113113 'remoteBasePath' => $smwgScriptPath,
114114 'group' => 'ext.smw'
115115 );
 116+
 117+ $wgResourceModules['ext.smw'] = $moduleTemplate + array(
 118+ 'scripts' => array(
 119+ 'resources/ext.smw.js',
 120+ 'resources/ext.smw.compat.js',
 121+ ),
 122+ );
 123+
116124 $wgResourceModules['ext.smw.style'] = $moduleTemplate + array(
117125 'styles' => 'skins/SMW_custom.css'
118126 );
 127+
119128 $wgResourceModules['ext.smw.tooltips'] = $moduleTemplate + array(
120129 'scripts' => 'skins/SMW_tooltip.js',
121130 'dependencies' => array(
Index: trunk/extensions/SemanticMediaWiki/resources/ext.smw.js
@@ -0,0 +1,45 @@
 2+/**
 3+ * JavasSript for Semantic MediaWiki.
 4+ * @see http://semantic-mediawiki.org/
 5+ *
 6+ * @licence GNU GPL v3 or later
 7+ * @author Jeroen De Dauw <jeroendedauw at gmail dot com>
 8+ */
 9+
 10+window.semanticMediaWiki = new( function() {
 11+
 12+ this.log = function( message ) {
 13+ if ( typeof mediaWiki === 'undefined' ) {
 14+ if ( typeof console !== 'undefined' ) {
 15+ console.log( 'SMW: ' + message );
 16+ }
 17+ }
 18+ else {
 19+ return mediaWiki.log.call( mediaWiki.log, 'SMW: ' + message );
 20+ }
 21+ }
 22+
 23+ this.msg = function() {
 24+ if ( typeof mediaWiki === 'undefined' ) {
 25+ message = window.wgSMWMessages[arguments[0]];
 26+
 27+ for ( var i = arguments.length - 1; i > 0; i-- ) {
 28+ message = message.replace( '$' + i, arguments[i] );
 29+ }
 30+
 31+ return message;
 32+ }
 33+ else {
 34+ return mediaWiki.msg.apply( mediaWiki.msg, arguments );
 35+ }
 36+ }
 37+
 38+} )();
 39+
 40+window.smw = window.semanticMediaWiki;
 41+
 42+(function( $ ) { $( document ).ready( function() {
 43+
 44+
 45+
 46+} ); })( jQuery );
Property changes on: trunk/extensions/SemanticMediaWiki/resources/ext.smw.js
___________________________________________________________________
Added: svn:eol-style
147 + native
Index: trunk/extensions/SemanticMediaWiki/resources/ext.smw.compat.js
Property changes on: trunk/extensions/SemanticMediaWiki/resources/ext.smw.compat.js
___________________________________________________________________
Added: svn:eol-style
248 + native

Status & tagging log