הערה: לאחר הפרסום, ייתכן שיהיה צורך לנקות את זיכרון המטמון (cache) של הדפדפן כדי להבחין בשינויים.

  • פיירפוקס / ספארי: להחזיק את המקש Shift בעת לחיצה על טעינה מחדש (Reload) או ללחוץ על צירוף המקשים Ctrl-F5 או Ctrl-R (במחשב מק: ⌘-R).
  • גוגל כרום: ללחוץ על צירוף המקשים Ctrl-Shift-R (במחשב מק: ⌘-Shift-R).
  • אינטרנט אקספלורר / אדג': להחזיק את המקש Ctrl בעת לחיצה על רענן (Refresh) או ללחוץ על צירוף המקשים Ctrl-F5.
  • אופרה: ללחוץ על Ctrl-F5.
if ($.inArray(mw.config.get('wgNamespaceNumber'), [0, 4, 10, 12, 14, 100]) + 1)
$(function($) {
        var translate = {
                'he': {
                        notfound: "לא נמצאה כותרת ויקינתונים",
                        nolabel: "(אין תווית)",
                        nodescription: "(אין תיאור)"
                },
                'en': {
                        notfound: "Wikidata item not found",
                        nolabel: "(No label)",
                        nodescription: "(no description given)"
                }
        },
        pagename = mw.config.get('wgPageName').replace(/_/g, " ");
 
        $.ajax({
                url: '//www.wikidata.org/w/api.php',
                data: {
                        'format': 'json',
                        'action': 'wbgetentities',
                        'sites': mw.config.get('wgDBname'),
                        'titles': pagename,
                        'props': 'info|labels|descriptions|aliases',
                        'languages': mw.config.get('wgPageContentLanguage')
                },
                dataType: 'jsonp',
                success: function(data) {
                        var d = $("<li>");
                        $("#p-views ul").append(d);
                        if (data.success) {
                                var lang = mw.config.get('wgPageContentLanguage'),
                                        m = translate[lang] || translate.he;
                                for (var i in data.entities) {
                                        if (i == -1) {
                                                d.append(
                                                        $("<span>")
                                                        .append(
                                                                $("<a>")
                                                                .attr("href", "//www.wikidata.org/wiki/Special:CreateItem?setlang=he&label=" + pagename + "&site=hewiki&page=" + pagename)
                                                                .attr("title", m.notfound)
                                                                .append(
                                                                        $("<img>")
                                                                        .attr("src", "//upload.wikimedia.org/wikipedia/commons/e/e8/Wikidata-favicon.png")
                                                                        .attr("style", "margin-bottom: 5px; opacity:0.3; filter:alpha(opacity=30);")
                                                                )
                                                        )
                                                );
                                        } else {
                                                var item = data.entities[i],
                                                        i = 0,
                                                        aliases = [];
                                                try {
                                                        for (; i < item.aliases[lang].length; i++) {
                                                                aliases.push(item.aliases[lang][i].value);
                                                        }
                                                } catch (e) { }
                                                d.append(
                                                        $("<span>")
                                                        .append(
                                                                $("<a>")
                                                                .attr("href", "//www.wikidata.org/wiki/" + item.title)
                                                                .attr("title", ((item.labels && item.labels[lang]) ? item.labels[lang].value : m.nolabel) + " (" + item.title + "):" + ((item.descriptions && item.descriptions[lang]) ? item.descriptions[lang].value : m.nodescription))
                                                                .append(
                                                                        $("<img>")
                                                                        .attr("src", "//upload.wikimedia.org/wikipedia/commons/e/e8/Wikidata-favicon.png")
                                                                        .attr("style", "margin-bottom: 5px;")
                                                                )
                                                        )
                                                );
function addDes(e)
	{
		var QidOr = item.title;
		if (QidOr) {
			hebrewDes = $('#WikiBaseHeDes').val();
			if (hebrewDes) {
				mw.loader.using( [ 'wikibase.api.RepoApi', "mw.config.values.wbRepo" ] ).done(function(){
					var repoConfig = mw.config.get( 'wbRepo' ),
					repoApi = new wikibase.api.RepoApi( wikibase.api.getLocationAgnosticMwApi(repoConfig.url + repoConfig.scriptPath + '/api.php') );
					repoApi.setDescription(QidOr,0,hebrewDes,'he').done(function(d){ if (d.success) mw.notify('התיאור נשמר!'); });
				});
			}
		}
		e.preventDefault();
	}
	if (!item.descriptions[lang]) {
	var execResult = /(?: הוא| היא| היה| הייתה| הינו| הם| היו| הן) (.+?)\./.exec($('#mw-content-text').text()),
		HelloWorld123 = execResult ? execResult[1] : '';
		HelloWorld123 = HelloWorld123.replace(/"/g, "&quot;");
		HelloWorld123 = ' value="' + HelloWorld123 + '"';
	$('#bodyContent').before(
		$('<input type="text" id="WikiBaseHeDes"' + HelloWorld123 + 'size="100">'),
		' ',
		$('<a>')
			.text('הוספת תיאור בוויקינתונים')
			.click(addDes)
		);}
                                        } // else
                                } // for
                        } // if success
                } // succeess function
        }); // ajax
}); // ready