پرش به محتوا

مدیاویکی:Gadget-intropreload.js: تفاوت میان نسخه‌ها

از دانشنامه علوم انسانی
imported>Huji
بدون خلاصۀ ویرایش
imported>Huji
بدون خلاصۀ ویرایش
 
(یک نسخهٔ میانیِ ایجادشده توسط همین کاربر نشان داده نشد)
خط ۱: خط ۱:
$(function () {
$(function () {
   var preload = editintro = '';
   var preload = editintro = '';
   if ( location.href.indexOf('preload') > -1 ) {
   if ( location.href.indexOf('?preload') > -1 | location.href.indexOf('&preload') > -1 ) {
     preload = location.href.split('preload')[1].split('&')[0];
     preload = location.href.split('preload')[1].split('&')[0];
     preload = location.href.split('?')[0] + "?title" + preload;
     preload = location.href.split('?')[0] + "?title" + preload;
   }
   }
   if ( location.href.indexOf('editintro') > -1 ) {
   if ( location.href.indexOf('?editintro') > -1 | location.href.indexOf('&editintro') > -1) {
     editintro = location.href.split('editintro')[1].split('&')[0];
     editintro = location.href.split('editintro')[1].split('&')[0];
     editintro= location.href.split('?')[0] + "?title" + editintro;
     editintro= location.href.split('?')[0] + "?title" + editintro;
خط ۱۲: خط ۱۲:
     el = document.createElement('span');
     el = document.createElement('span');
     el.style.fontSize = "10pt";
     el.style.fontSize = "10pt";
    el.style.marginRight = "10px";


     if( preload != '') {
     if( preload != '') {
خط ۱۸: خط ۱۷:
       pr.innerHTML = '(محتوای پیش‌فرض)';
       pr.innerHTML = '(محتوای پیش‌فرض)';
       pr.href = preload;
       pr.href = preload;
      pr.style.marginRight = "10px";
       el.appendChild(pr);
       el.appendChild(pr);
     }
     }
    if( preload != '' & editintro != '') {
 
      spacer = document.createElement('span');
      spacer.innerHTML = '  ';
      el.appendChild(spacer);
    }
     if( editintro != '') {
     if( editintro != '') {
       ei = document.createElement('a');
       ei = document.createElement('a');
       ei.innerHTML = '(اعلان بالای صفحه)';
       ei.innerHTML = '(اعلان بالای صفحه)';
       ei.href = editintro;
       ei.href = editintro;
      ei.style.marginRight = "10px";
       el.appendChild(ei);
       el.appendChild(ei);
     }
     }

نسخهٔ کنونی تا ۵ ژانویهٔ ۲۰۱۳، ساعت ۱۹:۳۲

$(function () {
  var preload = editintro = '';
  if ( location.href.indexOf('?preload') > -1 | location.href.indexOf('&preload') > -1 ) {
    preload = location.href.split('preload')[1].split('&')[0];
    preload = location.href.split('?')[0] + "?title" + preload;
  }
  if ( location.href.indexOf('?editintro') > -1 | location.href.indexOf('&editintro') > -1) {
    editintro = location.href.split('editintro')[1].split('&')[0];
    editintro= location.href.split('?')[0] + "?title" + editintro;
  }
  if ( preload != '' | editintro != '' ) {
    el = document.createElement('span');
    el.style.fontSize = "10pt";

    if( preload != '') {
      pr = document.createElement('a');
      pr.innerHTML = '(محتوای پیش‌فرض)';
      pr.href = preload;
      pr.style.marginRight = "10px";
      el.appendChild(pr);
    }

    if( editintro != '') {
      ei = document.createElement('a');
      ei.innerHTML = '(اعلان بالای صفحه)';
      ei.href = editintro;
      ei.style.marginRight = "10px";
      el.appendChild(ei);
    }

    document.getElementById('firstHeading').appendChild(el);
  }
});