משתמש:מהדורה קמא/בדיקת עוגנים.js: הבדלים בין גרסאות בדף

אין תקציר עריכה
(ניסוי בכתיבת קוד לכפתור טיפול בעוגנים כפולים)
 
אין תקציר עריכה
שורה 1: שורה 1:
// סקריפט לאיתור ותיקון עוגנים כפולים במדיה ויקי
mw.loader.using(['jquery.client'], function () {
  $(function () {
    if (mw.config.get('wgAction') === 'edit' || mw.config.get('wgAction') === 'submit') {
      var textArea = $('#wpTextbox1');
     
      // יצירת כפתור
      var button = $('<button type="button">בדוק ותקן עוגנים כפולים</button>');
      button.css({
        marginTop: '10px',
        padding: '5px 10px',
        fontSize: '1rem',
        cursor: 'pointer'
      });
      // הוספת הכפתור לדף
      textArea.after(button);
      // הגדרת פעולת הכפתור
      button.click(function () {
mw.loader.using(['jquery.client'], function () {
mw.loader.using(['jquery.client'], function () {
   // בדיקה ש-jQuery זמין ונטען
   // בדיקה ש-jQuery זמין ונטען
שורה 53: שורה 73:
     }
     }
   }
   }
});
      });
    }
  });
});
});