דילוג לתוכן
  • דף הבית
  • קטגוריות
  • פוסטים אחרונים
  • משתמשים
  • חיפוש
  • חוקי הפורום
כיווץ
תחומים

תחומים - פורום חרדי מקצועי

💡 רוצה לזכור קריאת שמע בזמן? לחץ כאן!
pcinfogmachP

pcinfogmach

@pcinfogmach
אודות
פוסטים
676
נושאים
183
קבוצות
0
עוקבים
3
עוקב אחרי
1

פוסטים

פוסטים אחרונים הגבוה ביותר שנוי במחלוקת

  • הסתעפות מייצור אינדקס - עזרה בקידוד C#
    pcinfogmachP pcinfogmach

    @dovid כתב בביצוע פרקטי לאינדוקס מאגר טקסט עברי:

    במילים אחרות אם אתה לא רוכש, אז אולי גם אל תשאל...

    אולי תסביר לי עוד קצת(או שאולי כדאי לפתוח אשכול חדש על זה): אפשר לתכנת שם תוכנה שלימה (והאם זה מומלץ) או רק לבדוק קודים? ומה בדיוק יש שם שאין למי שיש לו למשל chatgpt? וכמה שונה התיכנות שם מvisual studio?


  • הסתעפות מייצור אינדקס - עזרה בקידוד C#
    pcinfogmachP pcinfogmach

    @dovid
    אשריכם ישראל!
    שאלה: אם הבנתי נכון המעלה בlinqpad זה שאני יכול לבדוק את הקודים שלי במהירות?
    ועוד שאלה: הגירסה החינמית לא מספיק?


  • הסתעפות מייצור אינדקס - עזרה בקידוד C#
    pcinfogmachP pcinfogmach

    @dovid
    אני יודע C# בסיסי (היה גם חלק דברים שתיכנתתי בעצמי בתוסף - רק שמסיבות אישיות אני החלטתי לשים לעצמי גבול כמה אני הולך לתכנת) הבעיה היא ברגע שמתחילים לדבר איתי על מושגים מעולם התיכנות שאני לא נפגשתי בהם בלמידה העצמית שלי. וכל מה שהמתכנת אומר זה (זה מורכב מאוד ונאנח לו ככה)...


  • הסתעפות מייצור אינדקס - עזרה בקידוד C#
    pcinfogmachP pcinfogmach

    @dovid כתב בביצוע פרקטי לאינדוקס מאגר טקסט עברי:

    @pcinfogmach הקוד שהבאתי עדיין איטי? או שלא נמצא עוד האיש שיטמיע אותו?
    אתם צוות של אלף איש?

    התושבה היא - קצת משניהם.
    המפתח לא מעוניין כ"כ בפיתוח הוא מאוד עמוס זה אני שדוחף אותו לפרוייקט ועוד כמה כך שכל בעיה שצצה בעצם נופלת עלי.
    לבינתיים הקוד שהבאת לא עבד לנו אבל עוד לא התייאשנו לגמרי אולי כשיהיה למפתח יותר זמן אם יהיה לו.... הוא ישב על זה שוב.


  • ביצוע פרקטי לאינדוקס מאגר טקסט עברי
    pcinfogmachP pcinfogmach

    @dovid כתב בביצוע פרקטי לאינדוקס מאגר טקסט עברי:

    @yossiz הטכניקה שציינת מייתרת את כל הנושא (במקום לבנות אינדקסים, לשמור את התוכן כולו בעמודה עם FTS וגמרנו).
    אני לא הצעתי את זה כי לזכרוני זה טוב רק לאנגלית וגם אז זה לחיפושים "סטנדרטיים" ולא נותן חופש למפתח כמה להיות משוכלל.

    תרשו לי לשאול מהי בדיוק הטכניקה החדשנית של yossiz ואיך היא מייתרת את כל הנושא?
    האם למעשה היא מייתרת או רק תיאורטית?

    הצצתי בהצעות ש @yossiz נתן ונראה שם שהוא עובד עם העקרון של lucene ובני משפחתו הבעיה עם זה שהם לא עומדים בקצב כאשר צריך להציג הרבה תוצאות. משא"כ אינדקס לבינתיים לפי מה שבדקנו דוקא כן עומד בזה. למרות שלבינתיים עוד לא מצאנו צורה מושלמת ליצור אינדקס.


  • שאלה: מישהו יודע איזה קוד regex עושים לחיפוש מילה עם ניקוד או טעמים?
    pcinfogmachP pcinfogmach

    שאלה: מישהו יודע איזה קוד regex עושים לחיפוש מילה עם ניקוד או טעמים?


  • ביצוע פרקטי לאינדוקס מאגר טקסט עברי
    pcinfogmachP pcinfogmach

    @dovid
    תודה רבה על המענה הנפלא!

    יצרנו תוכנה בסיסית לבדוק את sqlite
    הבעיה שהאטיות שלו בבניית האינדקס פשוט לא פרקטית

    אולי אנחנו לא בנינו את הקוד נכון?
    בכל אופן מצו"ב הקוד בc# אם מישהו יכול לעזור

    using System;
    using System.Data.SQLite;
    using System.IO;
    using System.Text;
    using System.Text.RegularExpressions;
    using System.Windows.Forms;
    
    namespace TestSqlite
    {
        public partial class Form1 : Form
        {
            private ProgressBar progressBar;
            private Label progressLabel;
    
            public Form1()
            {
                InitializeComponent();
                InitializeUI();
            }
    
            private void InitializeUI()
            {
                Button startIndexingButton = new Button();
                startIndexingButton.Text = "Start Indexing";
                startIndexingButton.Click += StartIndexingButton_Click;
                startIndexingButton.Dock = DockStyle.Top;
    
                progressBar = new ProgressBar();
                progressBar.Dock = DockStyle.Bottom;
    
                progressLabel = new Label();
                progressLabel.Dock = DockStyle.Bottom;
    
                Controls.Add(progressBar);
                Controls.Add(progressLabel);
                Controls.Add(startIndexingButton);
            }
    
            private void StartIndexingButton_Click(object sender, EventArgs e)
            {
                string folderPath = @"C:\Users\0533105132\Desktop\MyBooks"; // Replace with the path to your folder.
                string databasePath = "index.db";
    
                CreateDatabase(databasePath);
    
                // Recursively process text files in the specified folder.
                ProcessFolder(folderPath, databasePath);
    
                MessageBox.Show("Indexing complete.");
            }
    
            private void CreateDatabase(string databasePath)
            {
                using (SQLiteConnection connection = new SQLiteConnection($"Data Source={databasePath}"))
                {
                    connection.Open();
    
                    string createTableQuery = @"
                        CREATE TABLE IF NOT EXISTS WordIndex (
                            Word TEXT,
                            FilePath TEXT,
                            LineNumber INT,
                            WordPosition INT
                        );
                    ";
    
                    using (SQLiteCommand command = new SQLiteCommand(createTableQuery, connection))
                    {
                        command.ExecuteNonQuery();
                    }
                }
            }
    
            private void ProcessFolder(string folderPath, string databasePath)
            {
                string[] files = Directory.GetFiles(folderPath, "*.txt", SearchOption.AllDirectories);
                progressBar.Maximum = files.Length;
                progressBar.Value = 0;
    
                foreach (string file in files)
                {
                    progressLabel.Text = $"Processing: {Path.GetFileName(file)}";
                    Application.DoEvents(); // Update the label text
    
                    ProcessFile(file, databasePath);
    
                    progressBar.Value++;
                }
    
                progressLabel.Text = "Processing complete.";
            }
    
            private void ProcessFile(string filePath, string databasePath)
            {
                using (SQLiteConnection connection = new SQLiteConnection($"Data Source={databasePath}"))
                {
                    connection.Open();
    
                    using (SQLiteCommand command = new SQLiteCommand(connection))
                    {
                        StringBuilder insertBatch = new StringBuilder();
                        string[] lines = File.ReadAllLines(filePath, Encoding.GetEncoding(1255));
                        int lineNumber = 0;
    
                        foreach (string line in lines)
                        {
                            lineNumber++;
    
                            string[] words = Regex.Split(line, @"\W+");
    
                            foreach (string word in words)
                            {
                                if (!string.IsNullOrWhiteSpace(word))
                                {
                                    string normalizedWord = word.ToLower();
                                    insertBatch.AppendLine("INSERT INTO WordIndex (Word, FilePath, LineNumber, WordPosition) " +
                                        $"VALUES ('{normalizedWord}', '{filePath}', {lineNumber}, {insertBatch.Length});");
                                }
                            }
                        }
    
                        // Execute all insert statements in a single transaction
                        command.CommandText = insertBatch.ToString();
                        command.ExecuteNonQuery();
                    }
                }
            }
        }
    }
    
    

    מצו"ב גם תמונה של הטבלה
    d140ce75-4bab-424f-a607-6a5daefe8c5a-image.png


  • חומרי עזר (למחשב) לאברך - חוברות הדרכה ועוד
    pcinfogmachP pcinfogmach

    מדי פעם אעלה פה עוד חומרים לפי המזדמן ובלי נדר


    1. מדריך קצר עבור קניית מחשב חדש.pdf

    1. שימוש במחשב
    • מידע-מחשבים-כללי.pdf
    • בעיות מצויות ופתרונותיהם
    • ווירוסים מצויים ופתרונותיהם

    1. 12-תכנות-שימושיות.htm

    1. טיפים-לעבודה-נכונה-עם-וורד-גרסה-2.dotm
      הופץ על ידי בעבר במקומות שונים כעת שופץ מחדש ונוספו לו תוספות רבות.

    1. תוסף עיצוב תורני 7.7.exe. תוסף חינמי לוורד.
      תורת אמת בוורד

    1. המילון התורני - תיקון שגיאות תורני לוורד.

    1. חיפוש בתוכן הקבצים Docfetcher
      הוראות שימוש: מדריך עבור תוכנת DocFetcher.pdf
      דוקפטשר - הוראות מתורגמות על ידי המנוע של וורד.docx

    1. פתרון באג שצג בוורד

    1. חיפוש והחלפה מתקדמים בתוכנת וורד.
      עריכה: מדריך בסיסי
      מדריך כללי
      אוסף קודים שימושיים

    1. גמ"ח עזרה לעורכים תורניים

    1. גמ"ח ספרים דרך המייל

    #. חומרים נוספים


  • שאלה: מה הסוד מאחורי מנוע החיפוש של בר אילן? (מבחינת תיכנות)
    pcinfogmachP pcinfogmach

    @dovid כתב בשאלה: מה הסוד מאחורי מנוע החיפוש של בר אילן? (מבחינת תיכנות):

    (אם יש לך שאלה מעשית - ולא המשך של השאלה הרעיונית שיש בנושא זה - שאל אותה בנושא קונקרטי עבורה).

    זה שאלה מאוד מעשית אני בקשר עם קבוצה של אנשים שמנסים ליצור תוכנה תורנית חדשה שתכלול את כל הספרים הכשרים מספריא ושתתן ממשק קצת יותר נוח מ"תורת אמת".
    הבעיה היא שאין לאף מושג איך ליצור את הפונקציה של החיפוש. הרבה דברים נוסו ולבינתיים ללא הועיל. אם תוכל להדריך אותנו בנושא זה מאוד יעזור.

    התוכנה כעת בפיתוח בשפת c#

    מצו"ב תמונה (למרות שזה ממש באמצע העבודה - לשם האמינות)
    0f969cc6-97d3-44e0-8973-374f28835c5f-image.png

    יש לנו עוד פרוייקט בשלב יותר מתקדם - תוסף תורת אמת בוורד
    שם לבינתיים אילתרנו משהו אבל אם כבר שם נוכל לעשות מנוע חיפוש זה יהיה כמעט מושלם.

    6e2d05a3-e6a4-4d3a-b7fe-8a33c25ccbf2-image.png
    dcca6841-b156-4655-8902-f7e82c65d874-image.png


  • שאלה: מה הסוד מאחורי מנוע החיפוש של בר אילן? (מבחינת תיכנות)
    pcinfogmachP pcinfogmach

    @dovid
    תודה
    קראתי על זה אבל לא הצלחתי להבין בדיוק איך יוצרים כזה קובץ
    הלוואי שיה דרך ליצור קובץ טבלאי בלתי מוגבל או משהו כזה


  • שאלה: מה הסוד מאחורי מנוע החיפוש של בר אילן? (מבחינת תיכנות)
    pcinfogmachP pcinfogmach

    @יוסף-בן-שמעון כתב בשאלה: מה הסוד מאחורי מנוע החיפוש של בר אילן? (מבחינת תיכנות):

    האפליקציה ניגשת לטבלאות האלו, שולפת את השורות הרצויות, מסתמא גם שולפת אחת לפני ואחת אחרי בשביל התצוגה, ומוסיפה את זה למערך של תוצאות החיפוש.

    לכאורה לעבוד על בסיס שורות זה בעיה כי אם מילה א של החיפוש נמצא בשורה א ומילה ב בשורה ב אז מה נעשה? נגדיר את החיפוש שידע לעבד כזה מצב או שיש פתרון יותר פשוט?


  • שאלה: מה הסוד מאחורי מנוע החיפוש של בר אילן? (מבחינת תיכנות)
    pcinfogmachP pcinfogmach

    inverted index זה אידקס מילים עם רשימה של מיקומים בה הוא מופיע. די פשוט. וכנ"ל.

    לעת עתה חיפוש פשוט זה מספיק לי

    @dovid כתב בשאלה: מה הסוד מאחורי מנוע החיפוש של בר אילן? (מבחינת תיכנות):

    לא צריך לטעון את האינדקס, זה יכול להיות כתוב בקובץ והסריקה יכולה להיות ישירות מהדיסק.

    באיזה קובץ מדובר שאפשר לסרוק אותו ישירות מהדיסק?


  • שאלה: מה הסוד מאחורי מנוע החיפוש של בר אילן? (מבחינת תיכנות)
    pcinfogmachP pcinfogmach

    שומע אבל אני תוהה כי אם כך אז תחת כל ערך יש כמות מטורפת של 'שורות' והאינדקסר צריך לחשב את כל זה....

    כמו"כ האינדקס עצמו יהיה מאוד ארוך כך שלכאורה הטעינה שלו תהיה מאוד איטית... ( זה אולי אפשר לעשות לפצל את האיננדקס לפי אותיות ראשוות של מילים).


  • שאלה: מה הסוד מאחורי מנוע החיפוש של בר אילן? (מבחינת תיכנות)
    pcinfogmachP pcinfogmach

    קודם כל תודה על ההיענות

    "ניגש לטבלאות הרלוונטיות" - תוכל לפרט קצת יותר?
    ומה ההבדל בין זה לחיפוש ישיר בכל החומר? רק סינון קבצים לא רלוונטיים? אז אם יש הרבה תוצאות מה?


  • שאלה: מה הסוד מאחורי מנוע החיפוש של בר אילן? (מבחינת תיכנות)
    pcinfogmachP pcinfogmach

    @יוסף-בן-שמעון
    אני מדבר על זה
    e18c5621-15ba-4888-8780-4ab4fcbafde4-image.png


  • שאלה: מה הסוד מאחורי מנוע החיפוש של בר אילן? (מבחינת תיכנות)
    pcinfogmachP pcinfogmach

    @יוסף-בן-שמעון
    אוקיי שיערת לעצמי אבל ה לא פותר את הבעיה כי אינדקס לא יכול לייצר גזירים רק להצביע היכן קיממים מילים מסויימים


  • שאלה: מה הסוד מאחורי מנוע החיפוש של בר אילן? (מבחינת תיכנות)
    pcinfogmachP pcinfogmach

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


  • קוד לעורך טקסט בhtml - שמישהו שלח לי - אולי יהיה שימושי למישהו
    pcinfogmachP pcinfogmach

    גירסה אחרת שמצאתי שעובדת על בסיס קידוד ישיר

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>HTML Editor</title>
        <style>
            body {
                background-color: #f0f0f0; /* Light gray background color */
                margin: 0;
                padding: 0;
            }
    
            /* Container for the editor */
            .editor-container {
                display: flex;
                height: 100vh;
                margin: 20px; /* Margin around the entire editor */
            }
    
            /* Style for the code input textarea */
            #codeInput {
                flex: 1;
                border: 1px solid #ccc;
                padding: 10px;
                margin-right: 10px; /* Margin between input and output */
            }
    
            /* Style for the output frame */
            #outputFrame {
                flex: 1;
                border: 1px solid #ccc;
                padding: 10px;
                background-color: #f5f5f5; /* Very light gray background color */
            }
        </style>
    </head>
    <body>
        <div class="editor-container">
            <!-- Left Box for Direct Editing -->
            <textarea id="codeInput" contenteditable="true"></textarea>
    
            <!-- Right Box for Code Display -->
            <iframe id="outputFrame"></iframe>
        </div>
    
        <script>
            // Get references to the textarea and the outputFrame
            const codeInput = document.getElementById('codeInput');
            const outputFrame = document.getElementById('outputFrame');
    
            // Function to update the outputFrame with HTML code from codeInput
            function updateOutput() {
                const code = codeInput.value;
                outputFrame.contentDocument.open();
                outputFrame.contentDocument.write(code);
                outputFrame.contentDocument.close();
            }
    
            // Update the output whenever there is a change in the codeInput
            codeInput.addEventListener('input', updateOutput);
    
            // You can initially load some sample code into the codeInput if needed
            codeInput.value = 'This text will change the formatting in the right box.';
            updateOutput(); // Update the output initially
        </script>
    </body>
    </html>
    

  • קוד לעורך טקסט בhtml - שמישהו שלח לי - אולי יהיה שימושי למישהו
    pcinfogmachP pcinfogmach

    קוד לעורך טקסט בhtml - מקור לא ידוע
    צריך כמה תיקונים אבל בגדול עובד.

    <!DOCTYPE html>
    <html>
    <head>
        <title>Text Editor</title>
        <style>
            body {
                margin: 0;
                padding: 0;
                font-family: 'Noto Sans Hebrew', Arial, sans-serif;
                background-color: #f0f0f0; /* Light gray background for the entire page */
            }
    
            #editor-container {
                margin: 50px auto; /* Center the editor container horizontally and provide top margin */
                width: 793px; /* Fixed width for the editor */
                height: 410px; /* Fixed height for the editor */
                border: 1px solid #ccc;
                padding: 20px; /* Add margins here */
                background-color: #fff; /* White content area background */
                overflow: auto; /* Enable vertical scrolling */
    			 margin-top: 100px; /* Adjust the margin-top to move the editor lower */
            }
    
            #editor:focus {
                outline: none; /* Remove the default focus outline */
                /* You can add additional styles or borders here as needed */
            }
    
            .floating-toolbar {
                position: fixed;
                top: 0;
                left: 0;
                width: 100%;
                background-color: #fff;
                border-bottom: 1px solid #ccc;
                box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
                z-index: 1000;
    			display: flex;
                align-items: center; /* Vertically center the items within the toolbar */
                justify-content: center; /* Horizontally center the items within the toolbar */
            }
    		
    		
    
            .button-container {
                display: flex;
                flex-wrap: wrap; /* Allow buttons to wrap to the next line */
                justify-content: center; /* Center-align the buttons horizontally */
                gap: 5px;
                padding: 5px 0; /* Adjust top and bottom padding to center vertically */
            }
    
            .button {
                font-size: 14px;
                background-color: #eee;
                color: #333;
                border: none;
                border-radius: 5px;
                cursor: pointer;
                min-width: 30px;
                padding: 5px; /* Add padding to match the size */
            }
    
            .button:hover {
                background-color: #ccc;
            }
    
            .underline-button {
                text-decoration: underline;
            }
    
            .dropdown select {
                padding: 5px;
                font-size: 14px;
                background-color: #eee;
                color: #333;
                border: none;
                border-radius: 5px;
                cursor: pointer;
            }
    
            .color-dropdown {
                position: relative;
            }
    
            .color-dropdown-content {
                display: none;
                position: absolute;
                background-color: #f9f9f9;
                width: 100px; /* Set a fixed width for the dropdown list */
                max-height: 100px; /* Limit the height of the dropdown */
                overflow-y: auto; /* Enable vertical scrolling */
                border: 1px solid #ccc;
                z-index: 1;
            }
    
            .color-dropdown-content button {
                display: block;
                width: 100%;
                text-align: left;
                padding: 8px 12px;
                border: none;
                background-color: transparent;
                cursor: pointer;
            }
    
            .color-dropdown-content button:hover {
                background-color: #ddd;
            }
    
            /* Add Hebrew fonts here */
            @import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Hebrew&display=swap');
    
            /* Media query for smaller screens */
            @media (max-width: 480px) {
                .button-container {
                    flex-direction: column; /* Stack buttons vertically */
                    align-items: center; /* Center-align buttons vertically */
                }
            }
    		
    		.label-font-size {
                padding: 5px 10px; /* Adjust the padding as needed */
                line-height: 1; /* Set line-height to 1 for vertical centering */
            }
        </style>
    </head>
    <body>
        <div class="floating-toolbar">
            <div class="button-container">
                <button class="button" onclick="formatText('bold')" title="Bold (Ctrl+B)">B</button>
                <button class="button" onclick="formatText('italic')" title="Italic (Ctrl+I)">I</button>
                <button class="button underline-button" onclick="formatText('underline')" title="Underline (Ctrl+U)">U</button>
                <button class="button" onclick="toggleJustify()" title="Justify">J</button>
                <button class="button" onclick="alignText('left')" title="Left Align">L</button>
                <button class="button" onclick="alignText('center')" title="Center Align">C</button>
                <button class="button" onclick="alignText('right')" title="Right Align">R</button>
                <div class="dropdown">
                    <select id="styleDropdown" onchange="formatHeader()" title="Style">
                        <option value="hidden" disabled selected style="display:none">Style</option>
                        <option value="normal">Normal</option>
                        <option value="h1">H1</option>
                        <option value="h2">H2</option>
                        <option value="h3">H3</option>
                        <option value="h4">H4</option>
                        <option value="h5">H5</option>
                        <option value="h6">H6</option>
                    </select>
                </div>
                <div class="dropdown">
                    <select id="fontDropdown" onchange="changeFont()" title="Font">
                        <option value="Arial">Arial</option>
                        <option value="Helvetica">Helvetica</option>
                        <option value="Verdana">Verdana</option>
                        <option value="Georgia">Georgia</option>
                        <option value="Times New Roman">Times New Roman</option>
                        <option value="Courier New">Courier New</option>
                        <option value="Arial Black">Arial Black</option>
                        <option value="Impact">Impact</option>
                        <option value="Lucida Console">Lucida Console</option>
                        <option value="Tahoma">Tahoma</option>
                        <option value="Trebuchet MS">Trebuchet MS</option>
                        <option value="Palatino Linotype">Palatino Linotype</option>
                        <!-- Change "Frank Ruhl Libre" to "FrankRuhl" -->
                        <option value="FrankRuhl">Frank Ruhl</option>
                        <!-- Add Hebrew fonts below -->
                        <option value="David">David</option>
                        <option value="Narkisim">Narkisim</option>
                        <option value="Hadassa">Hadassa</option>
                    </select>
                </div>
                
                <!-- Added buttons for creating HTML lists -->
                <button class="button" onclick="createUnorderedList()" title="Unordered HTML List"><b>&#8226</b></button>
                <button class="button" onclick="createOrderedList()" title="Ordered HTML List">1.2.3.</button>
                
                <!-- RTL button -->
                <button class="button" onclick="toggleRTL()" title="Toggle Right-to-Left">RTL</button>
                
                <!-- HR button -->
                <button class="button" onclick="insertHorizontalRule()" title="Insert Horizontal Line">HR</button>
    
                <!-- Text Color dropdown -->
                <div class="color-dropdown">
                    <button class="button" onclick="toggleTextColorDropdown()" title="Text Color">Text Color</button>
                    <div class="color-dropdown-content" id="textColorDropdown">
                        <button onclick="changeTextColor('black')" style="color: black;">Black</button>
                        <button onclick="changeTextColor('red')" style="color: red;">Red</button>
                        <button onclick="changeTextColor('green')" style="color: green;">Green</button>
                        <button onclick="changeTextColor('blue')" style="color: blue;">Blue</button>
                        <button onclick="changeTextColor('purple')" style="color: purple;">Purple</button>
                        <button onclick="changeTextColor('orange')" style="color: orange;">Orange</button>
                        <button onclick="changeTextColor('yellow')" style="color: yellow;">Yellow</button>
                        <button onclick="changeTextColor('pink')" style="color: pink;">Pink</button>
                        <button onclick="changeTextColor('brown')" style="color: brown;">Brown</button>
                        <button onclick="changeTextColor('gray')" style="color: gray;">Gray</button>
                        <button onclick="changeTextColor('lightblue')" style="color: lightblue;">Light Blue</button>
                        <button onclick="changeTextColor('lightgreen')" style="color: lightgreen;">Light Green</button>
                        <button onclick="changeTextColor('teal')" style="color: teal;">Teal</button>
                        <button onclick="changeTextColor('indigo')" style="color: indigo;">Indigo</button>
                        <button onclick="changeTextColor('violet')" style="color: violet;">Violet</button>
                    </div>
                </div>
    
                <!-- Highlight Color dropdown -->
                <div class="color-dropdown">
                    <button class="button" onclick="toggleHighlightColorDropdown()" title="Highlight Text">Highlight</button>
                    <div class="color-dropdown-content" id="highlightColorDropdown">
                        <button onclick="highlightText('yellow')" style="background-color: #ffffcc;">Yellow</button>
                        <button onclick="highlightText('lightgreen')" style="background-color: #ccffcc;">Light Green</button>
                        <button onclick="highlightText('lightpink')" style="background-color: #ffcce6;">Light Pink</button>
                        <button onclick="highlightText('lightblue')" style="background-color: #cce6ff;">Light Blue</button>
                        <button onclick="highlightText('lightorange')" style="background-color: #ffe6cc;">Light Orange</button>
                        <button onclick="highlightText('lightpurple')" style="background-color: #e6ccff;">Light Purple</button>
                        <button onclick="highlightText('lightgray')" style="background-color: #f2f2f2;">Light Gray</button>
                        <button onclick="highlightText('white')" style="background-color: #ffffff; color: #000000;">White</button>
                    </div>
                </div>
                
                <!-- Remove Formatting button -->
                <button class="button" onclick="removeFormatting()" title="Remove Color">Remove Formatting</button>
    			
    			<button class="button" onclick="formatText('superscript')" title="Superscript">Sup</button>
                <button class="button" onclick="formatText('subscript')" title="Subscript">Sub</button>
                <button class="button" onclick="increaseIndent()" title="Increase Indent">&#x2B72;</button>
                <button class="button" onclick="decreaseIndent()" title="Decrease Indent">&#x2B70;</button>
    
    			<!-- Font size buttons -->
                <label for="fontSizeSpan" class="label-font-size">Font Size:</label>
                <button class="button" onclick="changeFontSize('increase')" title="Increase Font Size">+</button>
                <button class="button" onclick="changeFontSize('decrease')" title="Decrease Font Size">-</button>
    			
    			 <!-- Spacing between paragraphs buttons -->
                <label for="spacingBetweenParagraphs" class="label-font-size">Spacing:</label>
                <button class="button" onclick="changeSpacing('increase')" title="Increase Spacing">+</button>
                <button class="button" onclick="changeSpacing('decrease')" title="Decrease Spacing">-</button>
    
    			<!-- Add Link button -->
                <button class="button add-link-button" title="Add Link">&#128279</button>
    			
    			
    
     <button class="button" onclick="exportHTML()" title="Export HTML">Export HTML</button>
     <button class="button" onclick="exportToTxt()" title="Export to TXT">Export As Code</button>
        <!-- Add this button for exporting HTML -->
    	
    	   </div>
        </div>
        <div id="editor-container">
            <div id="editor" contenteditable="true" onkeypress="handleKeyPress(event)">
                <!-- Automatically start with a <p> tag -->
                <p>Start typing here...</p>
            </div>
        </div>
    	
    
        <script>
            let isJustified = false;
            let isRTL = false;
    
            function formatText(command) {
                document.execCommand(command, false, null);
            }
    
            function toggleJustify() {
                isJustified = !isJustified;
                document.execCommand(isJustified ? 'justifyFull' : 'justifyLeft', false, null);
            }
    
            function alignText(align) {
                document.execCommand('justify' + align, false, null);
                isJustified = false;
            }
    
            function formatHeader() {
                const styleDropdown = document.getElementById('styleDropdown');
                const selectedStyle = styleDropdown.value;
                if (selectedStyle === 'normal') {
                    document.execCommand('formatBlock', false, 'p');
                } else if (selectedStyle) {
                    document.execCommand('formatBlock', false, selectedStyle);
                }
                styleDropdown.selectedIndex = 0;
            }
    
            function changeFont() {
                const fontDropdown = document.getElementById('fontDropdown');
                const selectedFont = fontDropdown.value;
                document.execCommand('fontName', false, selectedFont);
            }
    
            function createUnorderedList() {
                document.execCommand("insertUnorderedList");
            }
    
            function createOrderedList() {
                document.execCommand("insertOrderedList");
            }
    
            function handleKeyPress(event) {
                if (event.keyCode === 13) { // Enter key
                    document.execCommand('insertHTML', false, '<p><br></p>');
                    event.preventDefault();
                }
            }
    
            function insertHorizontalRule() {
                document.execCommand('insertHorizontalRule', false, null);
            }
    
            function toggleRTL() {
                isRTL = !isRTL;
                const editorContainer = document.getElementById('editor-container');
                editorContainer.style.direction = isRTL ? 'rtl' : 'ltr';
            }
    
            function toggleTextColorDropdown() {
                const textColorDropdown = document.getElementById('textColorDropdown');
                textColorDropdown.style.display = (textColorDropdown.style.display === 'block') ? 'none' : 'block';
            }
    
            function changeTextColor(color) {
                document.execCommand("foreColor", false, color);
                toggleTextColorDropdown(); // Close the dropdown
            }
    
            function toggleHighlightColorDropdown() {
                const highlightColorDropdown = document.getElementById('highlightColorDropdown');
                highlightColorDropdown.style.display = (highlightColorDropdown.style.display === 'block') ? 'none' : 'block';
            }
    
            function highlightText(color) {
                document.execCommand("hiliteColor", false, color);
                toggleHighlightColorDropdown(); // Close the dropdown
            }
    
            function removeFormatting() {
                document.execCommand("removeFormat", false, null);
            }
    		
    		function increaseIndent() {
                document.execCommand("indent", false, null);
            }
            
            function decreaseIndent() {
                document.execCommand("outdent", false, null);
            }
    		
    		function changeFontSize(action) {
                const editor = document.getElementById('editor');
                const selectedText = document.getSelection();
                const span = document.createElement('span');
                
                if (action === 'increase') {
                    span.style.fontSize = 'larger';
                } else if (action === 'decrease') {
                    span.style.fontSize = 'smaller';
                }
                
                if (!selectedText.isCollapsed) {
                    const range = selectedText.getRangeAt(0);
                    range.surroundContents(span);
                }
            }
    		
    		function changeSpacing(action) {
                const editor = document.getElementById('editor');
                const selectedParagraphs = document.querySelectorAll('#editor p');
                
                selectedParagraphs.forEach(paragraph => {
                    let currentMargin = parseInt(window.getComputedStyle(paragraph).marginBottom);
                    
                    if (action === 'increase') {
                        currentMargin += 5; // Increase spacing by 5px
                    } else if (action === 'decrease') {
                        currentMargin -= 5; // Decrease spacing by 5px
                    }
                    
                    paragraph.style.marginBottom = currentMargin + 'px';
                });
            }
    		
    		
    
      function exportHTML() {
                // Get the content of the editor
                const editorContent = document.getElementById('editor').innerHTML;
    
                // Create a new window or tab to preview the HTML content
                const previewWindow = window.open('', '_blank');
    
                // Create a blob containing the editor's HTML content
                const blob = new Blob([editorContent], { type: 'text/html' });
    
                // Create a URL for the blob
                const url = URL.createObjectURL(blob);
    
                // Create an anchor element to trigger the download
                const a = document.createElement('a');
                a.href = url;
                a.download = 'exported_text.html'; // Define the file name
    
                // Create a button to allow the user to download the HTML
                const downloadButton = document.createElement('button');
                downloadButton.textContent = 'Download HTML';
                downloadButton.style.position = 'absolute'; // Set the button position to absolute
                downloadButton.style.top = '10px'; // Adjust the top position as needed
                downloadButton.style.left = '10px'; // Adjust the left position as needed
                downloadButton.onclick = () => {
                    // Trigger a click event on the anchor element to start the download
                    a.click();
                    // Clean up by revoking the blob URL
                    URL.revokeObjectURL(url);
                };
    
                // Append the download button to the preview window
                previewWindow.document.body.appendChild(downloadButton);
    
                // Write the editor's HTML content to the new window
                previewWindow.document.open();
                previewWindow.document.write(editorContent);
                previewWindow.document.close();
            }
    		
    		
    
    
    		// Function to create a link using selected text or prompt for text and link address
    function createLink() {
        const selectedText = document.getSelection().toString();
        let linkText = selectedText;
        let linkURL = '';
    
        if (!selectedText) {
            linkText = prompt('Enter the text for the link:');
            if (!linkText) {
                return; // Cancelled by the user
            }
        }
    
        linkURL = prompt('Enter the link address:');
        if (!linkURL) {
            return; // Cancelled by the user
        }
    
        const linkHTML = `<a href="${linkURL}" target="_blank">${linkText}</a>`;
        document.execCommand('insertHTML', false, linkHTML);
    }
    
    // Add event listener for the "Add Link" button
    document.querySelector('.button.add-link-button').addEventListener('click', createLink);
    
    
    function exportToTxt() {
        // Get the editor content
        const editorContent = document.getElementById('editor').innerHTML;
    
        // Create a Blob containing the content and specify the MIME type as plain text
        const blob = new Blob([editorContent], { type: 'text/plain' });
    
        // Create a download link for the Blob
        const url = URL.createObjectURL(blob);
        const a = document.createElement('a');
        a.href = url;
        a.download = 'exported_text.txt';
    
        // Trigger a click event on the link to start the download
        a.click();
    
        // Release the object URL to free up resources
        URL.revokeObjectURL(url);
    }
    
    		
        </script>
    </body>
    </html>
    

  • תוסף חדש - תורת אמת בוורד
    pcinfogmachP pcinfogmach

    @אוריי
    תוקן - תודה רבה על ההערה!
    הקובץ בפוסט המקור עודכן

  • 1
  • 2
  • 30
  • 31
  • 32
  • 33
  • 34
  • 33 / 34
  • התחברות

  • אין לך חשבון עדיין? הרשמה

  • התחברו או הירשמו כדי לחפש.
  • פוסט ראשון
    פוסט אחרון
0
  • דף הבית
  • קטגוריות
  • פוסטים אחרונים
  • משתמשים
  • חיפוש
  • חוקי הפורום