<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[שיתוף | תוסף (סקריפט לTampermonkey) לתיקון שגיאות כתיב אוטמטי לפני שליחה בפורום]]></title><description><![CDATA[<p dir="auto">שלום לכולם.<br />
שלחתי את זה כבר בפורום מתמחים טופ, וחשבתי שזה יכול להיות יעיל גם פה.</p>
<p dir="auto">לפעמים קורה שאנשים כותבים מהר, או שפחות מתאמצים שהטקסט יהיה כתוב נכון מבחינה דקדוקית, ולפעמים זה ממש מקשה על הקוראים להבין את מה שנכתב.</p>
<p>
                <button class="btn btn-primary extended-markdown-spoiler" data-bs-toggle="collapse" data-bs-target="#spoiler2225" aria-expanded="false" aria-controls="spoiler2225">
                    Spoiler <i class="fa fa-eye"></i>
                </button>
                </p><div class="collapse" id="spoiler2225">
                    <div class="card card-body spoiler"><p dir="auto">לו נוח לקרו טקסט עם מלה שגיות קתיב...</p></div>
                </div><p></p>
<p dir="auto">קיצור.. בניתי סקריפט (למה עדיף סקריפט? מהסיבות שנכתבו <a href="https://mitmachim.top/topic/95531/%D7%91%D7%A7%D7%A9%D7%94-%D7%9E%D7%94-%D7%A8%D7%A2-%D7%91%D7%A1%D7%A7%D7%A8%D7%99%D7%A4%D7%98%D7%99%D7%9D-%D7%9Ctampermonkey" target="_blank" rel="noopener noreferrer nofollow ugc">פה</a>..)</p>
<p dir="auto">הסקריפט (בספויילר):</p>
<p>
                <button class="btn btn-primary extended-markdown-spoiler" data-bs-toggle="collapse" data-bs-target="#spoiler2226" aria-expanded="false" aria-controls="spoiler2226">
                    Spoiler <i class="fa fa-eye"></i>
                </button>
                </p><div class="collapse" id="spoiler2226">
                    <div class="card card-body spoiler"><p dir="auto"></p>
<pre><code>// ==UserScript==
// @name         מתקן שגיאות חכם - מתמחים טופ (מבוסס Gemini)
// @namespace    http://tampermonkey.net/
// @version      3.0
// @description  תיקון שגיאות כתיב אוטומטי לפני שליחת הודעה, כולל חלון תצוגה מתקדם והגנה מלאה על ציטוטים.
// @author       @חובבן מקצועי (בסיוע Gemini)
// @match         https://*.bina.top/*
// @grant        GM_getValue
// @grant        GM_setValue
// @grant        GM_xmlhttpRequest
// @connect      generativelanguage.googleapis.com
// ==/UserScript==

(function() {
    'use strict';

    function getApiKey() {
        let key = GM_getValue('gemma_api_key', null);
        if (!key) {
            key = prompt("הכנס מפתח API עבור Gemini:");
            if (key) {
                key = key.trim();
                GM_setValue('gemma_api_key', key);
            }
        }
        return key;
    }

    async function checkSpelling(text) {
        const apiKey = getApiKey();
        if (!apiKey) return null;

        const url = `https://generativelanguage.googleapis.com/v1beta/models/gemini-3.1-flash-lite-preview:generateContent?key=${apiKey}`;

        const systemInstruction = `
תפקיד: בודק שגיאות כתיב (Spell Checker) בלבד.

חוקי ברזל:
1. **אסור לשנות סגנון, תחביר או פיסוק!** תקן אך ורק הקלדות שגויות (Typos) ושגיאות כתיב מובהקות.
2. **התעלמות מוחלטת מציטוטים:** שורות שמתחילות בתו "&gt;" (גדול מ...) הן ציטוטים. **אסור לך לגעת בהן, אסור לך לתקן בהן שגיאות כתיב, ואסור לך בשום אופן לדווח על שגיאות שמצאת בהן ברשימת השינויים.** העתק אותן בדיוק מוחלט כפי שהן.
3. **מבנה תשובה:** א. אם לא ביצעת אף תיקון (או אם כל הטקסט הוא ציטוט), החזר רק את המילה: "תקין".
   ב. אם מצאת שגיאת כתיב (שאינה בציטוט) ותיקנת אותה, החזר את הטקסט המלא המתוקן, הוסף שורה חדשה עם "***", ומתחתיה ציין אך ורק את המילים שבאמת שינית.
`;

        const payload = {
            systemInstruction: { parts: [{ text: systemInstruction }] },
            contents: [{ role: "user", parts: [{ text: text }] }]
        };

        return new Promise((resolve) =&gt; {
            GM_xmlhttpRequest({
                method: "POST",
                url: url,
                headers: { "Content-Type": "application/json" },
                data: JSON.stringify(payload),
                onload: function(response) {
                    try {
                        if (response.status !== 200) return resolve(null);
                        const data = JSON.parse(response.responseText);
                        if (data?.candidates?.[0]?.content?.parts?.[0]?.text) {
                            resolve(data.candidates[0].content.parts[0].text.trim());
                        } else {
                            resolve(null);
                        }
                    } catch (e) { resolve(null); }
                },
                onerror: function() { resolve(null); }
            });
        });
    }

    function showCustomDialog(cleanText, changeLogs, onAccept, onReject, onCancel) {
        const dialog = document.createElement('dialog');
        dialog.style.cssText = 'border:none; border-radius:8px; box-shadow:0 10px 25px rgba(0,0,0,0.2); padding:20px; width:90%; max-width:500px; font-family:system-ui, sans-serif; direction:rtl; background:#fff; color:#333; z-index:9999; position:relative;';

        const title = document.createElement('h3');
        title.textContent = 'הצעת תיקון מ-Gemini';
        title.style.cssText = 'margin-top:0; color:#2c3e50; font-size:18px; font-weight:bold; border-bottom:2px solid #f0f0f0; padding-bottom:10px;';

        const textDiv = document.createElement('div');
        textDiv.style.cssText = 'background:#f8f9fa; padding:12px; border-radius:6px; max-height:200px; overflow-y:auto; font-size:14px; margin-bottom:15px; border: 1px solid #e9ecef; white-space: pre-wrap; line-height: 1.5; color:#212529;';
        textDiv.textContent = cleanText;

        const changesTitle = document.createElement('h4');
        changesTitle.textContent = 'פירוט השינויים:';
        changesTitle.style.cssText = 'margin:0 0 8px 0; font-size:14px; color:#555; font-weight:bold;';

        const logsDiv = document.createElement('div');
        logsDiv.style.cssText = 'font-size:13px; color:#666; margin-bottom:20px; white-space:pre-wrap; line-height: 1.4;';
        logsDiv.textContent = changeLogs;

        const btnContainer = document.createElement('div');
        btnContainer.style.cssText = 'display:flex; gap:10px; justify-content:flex-end; flex-wrap:wrap; margin-bottom: 10px;';

        const btnCancel = document.createElement('button');
        btnCancel.textContent = 'ביטול (חזור לעריכה)';
        btnCancel.style.cssText = 'padding:8px 14px; background:#e0e0e0; border:none; border-radius:4px; cursor:pointer; color:#333; font-weight:bold; transition: 0.2s;';
        btnCancel.onmouseover = () =&gt; btnCancel.style.background = '#d0d0d0';
        btnCancel.onmouseout = () =&gt; btnCancel.style.background = '#e0e0e0';

        const btnReject = document.createElement('button');
        btnReject.textContent = 'שלח מקורי (עם השגיאות)';
        btnReject.style.cssText = 'padding:8px 14px; background:#e74c3c; color:#fff; border:none; border-radius:4px; cursor:pointer; font-weight:bold; transition: 0.2s;';
        btnReject.onmouseover = () =&gt; btnReject.style.background = '#c0392b';
        btnReject.onmouseout = () =&gt; btnReject.style.background = '#e74c3c';

        const btnAccept = document.createElement('button');
        btnAccept.textContent = 'שמור תיקונים ושלח';
        btnAccept.style.cssText = 'padding:8px 14px; background:#27ae60; color:#fff; border:none; border-radius:4px; cursor:pointer; font-weight:bold; transition: 0.2s;';
        btnAccept.onmouseover = () =&gt; btnAccept.style.background = '#219653';
        btnAccept.onmouseout = () =&gt; btnAccept.style.background = '#27ae60';

        btnContainer.append(btnAccept, btnReject, btnCancel);

        // הוספת הקרדיט בתחתית החלון
        const creditDiv = document.createElement('div');
        creditDiv.textContent = 'פותח ע"י @חובבן מקצועי';
        creditDiv.style.cssText = 'font-size: 11px; color: #a0a0a0; text-align: left; margin-top: 15px; border-top: 1px solid #f0f0f0; padding-top: 5px; user-select: none;';

        dialog.append(title, textDiv, changesTitle, logsDiv, btnContainer, creditDiv);
        document.body.appendChild(dialog);

        btnAccept.onclick = () =&gt; { dialog.close(); onAccept(); };
        btnReject.onclick = () =&gt; { dialog.close(); onReject(); };
        btnCancel.onclick = () =&gt; { dialog.close(); onCancel(); };

        dialog.addEventListener('close', () =&gt; dialog.remove());
        dialog.showModal();
    }

    document.addEventListener('click', async function(e) {
        const sendBtn = e.target.closest('.composer-submit');
        if (!sendBtn || sendBtn.dataset.verified === "true") return;

        const textarea = document.querySelector('.composer .write');
        if (!textarea || !textarea.value.trim()) return;

        e.preventDefault();
        e.stopImmediatePropagation();

        const originalText = textarea.value;

        const iconElement = sendBtn.querySelector('i.fa');
        let originalIconClass = "";
        if (iconElement) {
            originalIconClass = iconElement.className;
            iconElement.className = 'fa fa-spinner fa-spin';
        }
        sendBtn.classList.add('disabled');
        sendBtn.style.pointerEvents = 'none';

        const textNode = Array.from(sendBtn.childNodes).find(node =&gt; node.nodeType === Node.TEXT_NODE &amp;&amp; node.textContent.trim() !== "");
        let originalTextContent = textNode ? textNode.textContent : "";
        if (textNode) textNode.textContent = " מוודא כתיב... ";

        let result = await checkSpelling(originalText);

        if (iconElement) iconElement.className = originalIconClass;
        if (textNode) textNode.textContent = originalTextContent;
        sendBtn.classList.remove('disabled');
        sendBtn.style.pointerEvents = 'auto';

        if (!result || result === "תקין" || result === originalText) {
            submitForm(sendBtn);
        } else {
            const parts = result.split('***');
            let cleanText = parts[0].trim();
            let changeLogs = parts[1] ? parts[1].trim() : "בוצעו תיקוני כתיב";

            if (cleanText === originalText.trim()) {
                submitForm(sendBtn);
                return;
            }

            showCustomDialog(
                cleanText,
                changeLogs,
                () =&gt; {
                    textarea.value = cleanText;
                    textarea.dispatchEvent(new Event('input', { bubbles: true }));
                    textarea.dispatchEvent(new Event('change', { bubbles: true }));
                    submitForm(sendBtn);
                },
                () =&gt; submitForm(sendBtn),
                () =&gt; {}
            );
        }
    }, true);

    function submitForm(btn) {
        btn.dataset.verified = "true";
        btn.click();
        setTimeout(() =&gt; { delete btn.dataset.verified; }, 1500);
    }
})();
</code></pre>
<p dir="auto"></p></div>
                </div><p></p>
<p dir="auto">הביצוע ממש פשוט - תריצו את זה על tampermonkey - יש לזה מדריך <a href="https://mitmachim.top/post/898325" target="_blank" rel="noopener noreferrer nofollow ugc">פה</a>.<br />
קודם כל תצטרכו להוציא מפתח api <a href="https://aistudio.google.com/api-keys" target="_blank" rel="noopener noreferrer nofollow ugc">מAI סטודיו</a>.<br />
בפעם הראשונה יקפוץ לכם חלון בו אתם מדביקים את הkey שקיבלתם. וייתכן ותצטרכו לאשר אותו שוב.. (יפתח לכם חלון קופץ - בו אתם מאשרים שוב. זאת בלי קשר למדריך שתסתכלו איך מריצים בכלל סקריפטים..)<br />
ואז לאחר מכן - כל פוסט שתלחצו עליו בכפתור 'שליחה' - הוא יחשוב כמה שניות - ואז יציע לכם את התיקונים הנדרשים.. עם אפשרות לשליחה עם התיקונים / חזרה לעריכה / ושליחה בלי תיקונים.</p>
<p>
                <button class="btn btn-primary extended-markdown-spoiler" data-bs-toggle="collapse" data-bs-target="#spoiler2227" aria-expanded="false" aria-controls="spoiler2227">
                    Spoiler <i class="fa fa-eye"></i>
                </button>
                </p><div class="collapse" id="spoiler2227">
                    <div class="card card-body spoiler"><p dir="auto"><img src="/assets/uploads/files/1786884395898-4d856908-2992-48f0-bb63-085a5d3fcef8-image.jpeg" alt="4d856908-2992-48f0-bb63-085a5d3fcef8-image.jpeg" class=" img-fluid img-markdown" /> </p></div>
                </div><p></p>
<p dir="auto">משתמש יקר - אם אתה יודע שלעיתים קרובות (ואולי גם קצת רחוקות) אתה נוטה לכתוב עם שגיאות כתיב - באמת לטובתך (וכמובן לטובת כלל הפורום) - כדאי שתתקין סקריפט זה, זה גם יעזור לכולם - וגם יכבד אותך. זה שווה את זמן ההמתנה בין הכתיבה לשליחה בפועל.. בתודה מראש!</p>
<p dir="auto"><strong>שימו לב</strong> - התוסף עובד רק כאשר לוחצים על כפתור שלח, ולא כשמשתמים בקיצור המקלדת CTRL + ENTER</p>
<p>
                <button class="btn btn-primary extended-markdown-spoiler" data-bs-toggle="collapse" data-bs-target="#spoiler2228" aria-expanded="false" aria-controls="spoiler2228">
                    Spoiler <i class="fa fa-eye"></i>
                </button>
                </p><div class="collapse" id="spoiler2228">
                    <div class="card card-body spoiler"><p dir="auto">מי שככבר התקין את התוסף הזה במתמחים, ורוצה שזה יהיה בשתי הפורומים, אפשר פשוט להוסיף שורה נוספת שבה יהיה כתוב</p>
<pre><code>// @match         https://*.bina.top/*
</code></pre>
<p dir="auto">וכך למעשה לחסוך כפילות קודים.</p>
<p dir="auto"><img src="/assets/uploads/files/1786883961316-2debf720-e4ba-4f8e-8068-a6751dbb3494-image.jpeg" alt="2debf720-e4ba-4f8e-8068-a6751dbb3494-image.jpeg" class=" img-fluid img-markdown" /><br />
</p></div>
                </div><p></p>
]]></description><link>https://bina.top/topic/172/שיתוף-תוסף-סקריפט-לtampermonkey-לתיקון-שגיאות-כתיב-אוטמטי-לפני-שליחה-בפורום</link><generator>RSS for Node</generator><lastBuildDate>Sun, 16 Aug 2026 20:58:32 GMT</lastBuildDate><atom:link href="https://bina.top/topic/172.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 16 Aug 2026 12:41:51 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to שיתוף | תוסף (סקריפט לTampermonkey) לתיקון שגיאות כתיב אוטמטי לפני שליחה בפורום on Sun, 16 Aug 2026 18:11:26 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/%D7%91%D7%99%D7%A0%D7%90%D7%A8%D7%99-%D7%97%D7%9B%D7%9D" aria-label="Profile: בינארי-חכם">@<bdi>בינארי-חכם</bdi></a> לא, אתה יכול לראות מה הוא שינה, ולפי זה ללמוד מה עליך לתקן, ואז לשנות ולשלוח בלי תיקון.</p>
]]></description><link>https://bina.top/post/2243</link><guid isPermaLink="true">https://bina.top/post/2243</guid><dc:creator><![CDATA[חובבן מקצועי]]></dc:creator><pubDate>Sun, 16 Aug 2026 18:11:26 GMT</pubDate></item><item><title><![CDATA[Reply to שיתוף | תוסף (סקריפט לTampermonkey) לתיקון שגיאות כתיב אוטמטי לפני שליחה בפורום on Sun, 16 Aug 2026 18:10:12 GMT]]></title><description><![CDATA[<p dir="auto">אפשר להחליט לבד איזה תיקון להחיל ואיזה לא?</p>
]]></description><link>https://bina.top/post/2242</link><guid isPermaLink="true">https://bina.top/post/2242</guid><dc:creator><![CDATA[בינארי חכם]]></dc:creator><pubDate>Sun, 16 Aug 2026 18:10:12 GMT</pubDate></item><item><title><![CDATA[Reply to שיתוף | תוסף (סקריפט לTampermonkey) לתיקון שגיאות כתיב אוטמטי לפני שליחה בפורום on Sun, 16 Aug 2026 18:09:04 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/%D7%97%D7%95%D7%91%D7%91%D7%9F-%D7%9E%D7%A7%D7%A6%D7%95%D7%A2%D7%99" aria-label="Profile: חובבן-מקצועי">@<bdi>חובבן-מקצועי</bdi></a><br />
בסדר הצלחתי תודה!</p>
]]></description><link>https://bina.top/post/2241</link><guid isPermaLink="true">https://bina.top/post/2241</guid><dc:creator><![CDATA[אלוף בטכנולוגיה]]></dc:creator><pubDate>Sun, 16 Aug 2026 18:09:04 GMT</pubDate></item><item><title><![CDATA[Reply to שיתוף | תוסף (סקריפט לTampermonkey) לתיקון שגיאות כתיב אוטמטי לפני שליחה בפורום on Sun, 16 Aug 2026 18:05:08 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/%D7%90%D7%9C%D7%95%D7%A3-%D7%91%D7%98%D7%9B%D7%A0%D7%95%D7%9C%D7%95%D7%92%D7%99%D7%94" aria-label="Profile: אלוף-בטכנולוגיה">@<bdi>אלוף-בטכנולוגיה</bdi></a> אוקי, בשביל זה הבאתי קישור <a href="https://mitmachim.top/post/898325" target="_blank" rel="noopener noreferrer nofollow ugc">למדריך</a>  במתמחים טופ.</p>
]]></description><link>https://bina.top/post/2238</link><guid isPermaLink="true">https://bina.top/post/2238</guid><dc:creator><![CDATA[חובבן מקצועי]]></dc:creator><pubDate>Sun, 16 Aug 2026 18:05:08 GMT</pubDate></item><item><title><![CDATA[Reply to שיתוף | תוסף (סקריפט לTampermonkey) לתיקון שגיאות כתיב אוטמטי לפני שליחה בפורום on Sun, 16 Aug 2026 17:54:49 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/%D7%97%D7%95%D7%91%D7%91%D7%9F-%D7%9E%D7%A7%D7%A6%D7%95%D7%A2%D7%99" aria-label="Profile: חובבן-מקצועי">@<bdi>חובבן-מקצועי</bdi></a><br />
אני לא בדיוק מבין בזה ואני לא יודע מה עושים עם הקוד הזה...<br />
בינתיים בכל הסקריפטים שהתקנתי הביאו קישור...</p>
<p>
                <button class="btn btn-primary extended-markdown-spoiler" data-bs-toggle="collapse" data-bs-target="#spoiler2237" aria-expanded="false" aria-controls="spoiler2237">
                    Spoiler <i class="fa fa-eye"></i>
                </button>
                </p><div class="collapse" id="spoiler2237">
                    <div class="card card-body spoiler"><p dir="auto">סליחה על הבורות...<img src="https://bina.top/assets/plugins/nodebb-plugin-emoji/emoji/apple/1f61e.png?v=c8010d9745b" class="not-responsive emoji emoji-apple emoji--disappointed" style="height:23px;width:auto;vertical-align:middle" title=":disappointed:" alt="😞" /> </p></div>
                </div><p></p>
]]></description><link>https://bina.top/post/2237</link><guid isPermaLink="true">https://bina.top/post/2237</guid><dc:creator><![CDATA[אלוף בטכנולוגיה]]></dc:creator><pubDate>Sun, 16 Aug 2026 17:54:49 GMT</pubDate></item><item><title><![CDATA[Reply to שיתוף | תוסף (סקריפט לTampermonkey) לתיקון שגיאות כתיב אוטמטי לפני שליחה בפורום on Sun, 16 Aug 2026 17:53:15 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/%D7%90%D7%9C%D7%95%D7%A3-%D7%91%D7%98%D7%9B%D7%A0%D7%95%D7%9C%D7%95%D7%92%D7%99%D7%94" aria-label="Profile: אלוף-בטכנולוגיה">@<bdi>אלוף-בטכנולוגיה</bdi></a> למה אתה מתכוון? אתה רוצה שאוסיף את זה למאגר מקוון ? (כי כרגע זה לא נמצא בשום מאגר, ופשוט הבאתי את הקוד של הסקריפט)</p>
]]></description><link>https://bina.top/post/2236</link><guid isPermaLink="true">https://bina.top/post/2236</guid><dc:creator><![CDATA[חובבן מקצועי]]></dc:creator><pubDate>Sun, 16 Aug 2026 17:53:15 GMT</pubDate></item><item><title><![CDATA[Reply to שיתוף | תוסף (סקריפט לTampermonkey) לתיקון שגיאות כתיב אוטמטי לפני שליחה בפורום on Sun, 16 Aug 2026 17:42:11 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/%D7%97%D7%95%D7%91%D7%91%D7%9F-%D7%9E%D7%A7%D7%A6%D7%95%D7%A2%D7%99" aria-label="Profile: חובבן-מקצועי">@<bdi>חובבן-מקצועי</bdi></a><br />
אתה יכול לצרף קישור לסקריפט?</p>
]]></description><link>https://bina.top/post/2235</link><guid isPermaLink="true">https://bina.top/post/2235</guid><dc:creator><![CDATA[אלוף בטכנולוגיה]]></dc:creator><pubDate>Sun, 16 Aug 2026 17:42:11 GMT</pubDate></item><item><title><![CDATA[Reply to שיתוף | תוסף (סקריפט לTampermonkey) לתיקון שגיאות כתיב אוטמטי לפני שליחה בפורום on Sun, 16 Aug 2026 13:20:05 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/%D7%97%D7%95%D7%91%D7%91%D7%9F-%D7%9E%D7%A7%D7%A6%D7%95%D7%A2%D7%99" aria-label="Profile: חובבן-מקצועי">@<bdi>חובבן-מקצועי</bdi></a> תן בראש תותח</p>
]]></description><link>https://bina.top/post/2226</link><guid isPermaLink="true">https://bina.top/post/2226</guid><dc:creator><![CDATA[Bugs Bunny]]></dc:creator><pubDate>Sun, 16 Aug 2026 13:20:05 GMT</pubDate></item></channel></rss>