מדיה ויקי:Mobile.js – הבדלי גרסאות

עדכון מויקיפדיה: https://he.wikipedia.org/wiki/%D7%9E%D7%93%D7%99%D7%94_%D7%95%D7%99%D7%A7%D7%99:Mobile.js
מ. רובין (שיחה | תרומות)
אין תקציר עריכה
 
שורה 1: שורה 1:
/* כל הסקריפטים הנכתבים כאן ייטענו עבור הגולשים באתר למכשירים ניידים בלבד */
/* Any JavaScript here will be loaded for users using the mobile site */
// $(function() { if ( $('.pgn-source-wrapper').length ) mw.loader.load( '//he.m.wikipedia.org/w/index.php?title=מדיה_ויקי:Common.js/pgn.js&action=raw&ctype=text/javascript' ) } )


// Many user scripts are using this.
 
window.importScript = function () {
window.importScript = function ( scriptPageName ) {
// @todo - let gadget developers know that they need to fix this.
//mw.notify('');
/* Disable the importScript function for now.
See [[Special:Permalink/36946424#טעינת_סקריפטים_אישיים_בנייד]] for details. */
'use strict';
mw.log.warn( 'Script "' + ( scriptPageName || '' ) + '" was not loaded because the importScript() function is not currently supported on the mobile interface. If the script was adapted to work properly on the mobile interface, please load it using mw.loader.load() instead.' );
};
};


/* פונקציה לייבוא סקריפט מ[[חב"דפדיה:סקריפטים]] */
window.importUserScript = function () {
window.importUserScript = function () {
/* Allow user scripts from [[חב:ס]] to load only if adapted
to work properly on the mobile interface.
To designate a user script from [[חב:ס]] as mobile-supported,
add its number to the mobileSupportedScriptNumbers array.
See [[Special:Permalink/36946424#טעינת_סקריפטים_אישיים_בנייד]] for details. */
'use strict';
'use strict';
 
var args = arguments;
var mobileSupportedScriptNumbers = [ 16, 107, 111, 112 ];
 
mw.loader.using( 'mediawiki.util', function () {
try {
for ( var arg = 0; arg < args.length; arg++ ) {
try {
var args = arguments;
importScript( 'MediaWiki:סקריפטים/' + args[arg] + '.js' );
for ( var i = 0; i < args.length; i++ ) {
if ( typeof args[ i ] !== 'number' ) {
continue;
}
}
catch( e ) {
if ( mobileSupportedScriptNumbers.indexOf( args[ i ] ) >= 0 ) {
mw.loader.load( 'https://chabadpedia.co.il//index.php?title=מדיה_ויקי:סקריפטים/' + args[ i ] + '.js&action=raw&ctype=text/javascript' );
} else {
mw.log.warn( 'Script number ' + args[ i ] + ' was not loaded because it is not included in the list of scripts supported on the mobile interface, as defined at [[MediaWiki:Mobile.js]]. If the script was adapted to work properly on the mobile interface, it should be added to that list.' );
}
}
}
}
} );
} catch ( e ) {
return;
}
};
};


if ( mw.config.get( 'wgUserName' ) ) { // only registred users. load is harmless if page does not exist
if ( mw.config.get( 'wgUserName' ) ) { // only registred users. load is harmless if page does not exist
שורה 37: שורה 62:
.replace(/"/g, '&quot;')
.replace(/"/g, '&quot;')
+ ']]';
+ ']]';
var RepotEditinto = 'חב&quot;דפדיה:דיווח על טעויות/נייד';
var RepotEditinto = 'חב"דפדיה:דיווח על טעויות/נייד';
if (  mw.config.get( 'wgNamespaceNumber' ) === 14 ) RepotEditinto = 'חב&quot;דפדיה:דיווח על טעויות/נייד/קטגוריה';
if (  mw.config.get( 'wgNamespaceNumber' ) === 14 ) RepotEditinto = 'חב"דפדיה:דיווח על טעויות/נייד/קטגוריה';
$('#page-secondary-actions').append('<form name="commentbox" class="commentbox" action="/index.php" method="get"><input value="edit" name="action" type="hidden"><input name="preloadtitle" type="hidden" value="' + reportPage + '"><input value="'+RepotEditinto+'" name="editintro" type="hidden"><input value="new" name="section" type="hidden"><input value="חב&quot;דפדיה:דיווח על טעויות" name="title" type="hidden"><input name="create" class="mw-ui-button button" value="משוב ודיווח על טעות" type="submit"></form>');
$('#page-secondary-actions').append('<form name="commentbox" class="commentbox" action="/index.php" method="get"><input value="edit" name="action" type="hidden"><input name="preloadtitle" type="hidden" value="' + reportPage + '"><input value="'+RepotEditinto+'" name="editintro" type="hidden"><input value="new" name="section" type="hidden"><input value="חב"דפדיה:דיווח על טעויות" name="title" type="hidden"><input name="create" class="mw-ui-button button" value="משוב ודיווח על טעות" type="submit"></form>');
}
}
});
});