לדלג לתוכן

משתמש:מוטי בוט/ניסוי3.js

מתוך המכלול, האנציקלופדיה היהודית

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

  • פיירפוקס / ספארי: להחזיק את המקש Shift בעת לחיצה על טעינה מחדש (Reload) או ללחוץ על צירוף המקשים Ctrl-F5 או Ctrl-R (במחשב מק: ⌘-R).
  • גוגל כרום: ללחוץ על צירוף המקשים Ctrl-Shift-R (במחשב מק: ⌘-Shift-R).
  • אדג': להחזיק את המקש Ctrl בעת לחיצה על רענן (Refresh) או ללחוץ על צירוף המקשים Ctrl-F5.
if (mw.config.get("wgDiffOldId")) {
  const sinunRegex = /{{תמונה חילופית\||{{סינון\//;
  
  // בחירת האלמנטים באופן יעיל יותר
  const diffTable = document.querySelector("table.diff-type-table");
  if (diffTable) {
    const contextDivs = diffTable.querySelectorAll(".diff-context div");
    const deletedDivs = diffTable.querySelectorAll(".diff-deletedline div");
    
    // איסוף הטקסט באופן יעיל
    const textDiff = Array.from(contextDivs).map(div => div.textContent).join('') +
                   Array.from(deletedDivs).map(div => div.textContent).join('');
    if (sinunRegex.test(textDiff)) {
      // הסרת האלמנטים
      diffTable.remove();
      [
        ".ve-init-mw-diffPage-loading",
        ".mw-diff-table-prefix",
        ".mw-revslider-container",
        ".ve-init-mw-diffPage-diff"
      ].forEach(selector => {
        const element = document.querySelector(selector);
        if (element) element.remove();
      });
      
      mw.notify("תצוגת ההבדלים כוללת תוכן בעייתי!", { type: "error" });
    }
  }
}
function loadHebcalScript() {
    return new Promise((resolve, reject) => {
        const script = document.createElement('script');
        script.src = 'https://cdn.jsdelivr.net/npm/@hebcal/[email protected]/dist/bundle.min.js';
        script.async = true;

        script.onload = () => {
            console.log('Hebcal script loaded successfully');
            resolve();
        };

        script.onerror = () => {
            console.error('Failed to load Hebcal script');
            reject(new Error('Script load error'));
        };

        document.body.appendChild(script);
    });
}

// שימוש בפונקציה
loadHebcalScript()
    .then(() => {
        // הקוד כאן ירוץ לאחר שהסקריפט נטען בהצלחה
        const today = new Hebcal.HDate();
        console.log('Today in Hebrew calendar:', today.toString());
    })
    .catch(error => {
        console.error('Error:', error);
    });
`<div style="display: flex;justify-content: center;">
<div class="ambox toccolours" style="border: 1px solid #AFAFAF; background-color: #f9f9f9; margin-top: 5px; margin-bottom: 5px; padding: 0.3em; text-align: center; font-size: 100%; clear: both;display: inline-flex;/*! justify-content: center; *//*! max-width: 80%; */">
  
    <div style="/*! padding-right: 1em; */ text-align:right; padding-left: 1em; vertical-align: middle; width: 22px;">
      <a href="/%D7%94%D7%9E%D7%9B%D7%9C%D7%95%D7%9C:%D7%94%D7%A8%D7%97%D7%91%D7%AA_%D7%90%D7%A1%D7%A4%D7%A7%D7%9C%D7%A8%D7%99%D7%94" title="דף זה נעול">
        <img alt="דף זה נעול" src="https://upload.wikimedia.org/wikipedia/commons/thumb/1/14/Full-edit-protection-shackle.svg/langhe-25px-Full-edit-protection-shackle.svg.png" decoding="async" width="25" height="25" srcset="https://upload.wikimedia.org/wikipedia/commons/thumb/1/14/Full-edit-protection-shackle.svg/langhe-38px-Full-edit-protection-shackle.svg.png 1.5x, https://upload.wikimedia.org/wikipedia/commons/thumb/1/14/Full-edit-protection-shackle.svg/langhe-50px-Full-edit-protection-shackle.svg.png 2x" data-file-width="512" data-file-height="512">
      </a>
    </div>
    <div style="text-align: right;">
      <span id="pl-autoconfirmed">
        <b>
          <a href="/%D7%94%D7%9E%D7%9B%D7%9C%D7%95%D7%9C:%D7%94%D7%A8%D7%97%D7%91%D7%AA_%D7%90%D7%A1%D7%A4%D7%A7%D7%9C%D7%A8%D7%99%D7%94" title="">דף זה נעול</a>
        </b>
      </span>
      ויכולים לעורכו רק 
      <a title="המכלול:עורך אספקלריה" href="/%D7%94%D7%9E%D7%9B%D7%9C%D7%95%D7%9C:%D7%A2%D7%95%D7%A8%D7%9A_%D7%90%D7%A1%D7%A4%D7%A7%D7%9C%D7%A8%D7%99%D7%94">עורכי אספקלריה</a> 
      ו<a title="המכלול:מעדכן" href="/%D7%94%D7%9E%D7%9B%D7%9C%D7%95%D7%9C:%D7%9E%D7%A2%D7%93%D7%9B%D7%9F">מעדכנים</a>.
    </div>

</div>
</div>`