diff -Nru bibledit-5.0.901/assets/editor.js bibledit-5.0.903/assets/editor.js --- bibledit-5.0.901/assets/editor.js 1970-01-01 00:00:00.000000000 +0000 +++ bibledit-5.0.903/assets/editor.js 2020-07-19 12:54:21.000000000 +0000 @@ -0,0 +1,49 @@ +/* +Copyright (©) 2003-2020 Teus Benschop. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ + + +function assetsEditorAddNote (quill, style, caller, noteId, chapter, verse) // Todo +{ + //
1 + .
+ //1 + 1.1 keyword Footnote text.
+ // Footnote uses \fr \fk \ft. + // Cross reference uses \xo \xk \xt. + var length = quill.getLength (); + quill.insertText (length, "\n", "paragraph", style, "user"); + quill.insertText (length, caller, "character", "notebody" + noteId, "user"); + length++; + quill.insertText (length, " + ", "character", "", "user"); + length += 3; + var referenceText = chapter + "." + verse; + var referenceStyle = "fr"; + if (style == "x") referenceStyle = "xo"; + quill.insertText (length, referenceText, "character", referenceStyle, "user"); + length += referenceText.length; + var keywordStyle = "fk"; + if (style == "x") keywordStyle = "xk"; + quill.insertText (length, " ", "character", keywordStyle, "user"); + length++; + quill.insertText (length, "keyword", "character", keywordStyle, "user"); + length += 7; + var textStyle = "ft"; + if (style == "x") textStyle = "xt"; + quill.insertText (length, " ", "character", textStyle, "user"); + length++; + quill.insertText (length, "Text.", "character", textStyle, "user"); +} + diff -Nru bibledit-5.0.901/bb/logic.cpp bibledit-5.0.903/bb/logic.cpp --- bibledit-5.0.901/bb/logic.cpp 2020-07-11 16:11:47.000000000 +0000 +++ bibledit-5.0.903/bb/logic.cpp 2020-07-19 12:54:21.000000000 +0000 @@ -426,11 +426,15 @@ for (auto & conflict : conflicts) { + // Add the passage to the subject. + string newsubject = conflict.subject; + if (conflict.book) newsubject.append (" | " + filter_passage_display (conflict.book, conflict.chapter, "")); + // Create the body of the email. xml_document document; xml_node node; node = document.append_child ("h3"); - node.text ().set (conflict.subject.c_str()); + node.text ().set (newsubject.c_str()); // Storage of the changes the user sent, and the result that was saved, in raw USFM, per verse. vectorConnect to https://ipv6.google.com
++ Show alert and block keyboard for a short time + +
##success##
##error##
diff -Nru bibledit-5.0.901/developer/index.js bibledit-5.0.903/developer/index.js
--- bibledit-5.0.901/developer/index.js 2020-07-11 16:11:47.000000000 +0000
+++ bibledit-5.0.903/developer/index.js 2020-07-19 12:54:21.000000000 +0000
@@ -28,3 +28,17 @@
});
}
+
+function showAlertWithTimeout ()
+{
+ notifyItSuccess ("The keyboard is blocked for a short while")
+ $("#textinput").prop ("readonly", true);
+ setTimeout (enableTextInput, 1000);
+}
+
+
+function enableTextInput ()
+{
+ $("#textinput").prop ("readonly", false);
+}
+
diff -Nru bibledit-5.0.901/edit/index.html bibledit-5.0.903/edit/index.html
--- bibledit-5.0.901/edit/index.html 2020-07-11 16:11:47.000000000 +0000
+++ bibledit-5.0.903/edit/index.html 2020-07-19 12:54:21.000000000 +0000
@@ -36,5 +36,6 @@
+
##navigationCode##
diff -Nru bibledit-5.0.901/edit/index.js bibledit-5.0.903/edit/index.js
--- bibledit-5.0.901/edit/index.js 2020-07-11 16:11:47.000000000 +0000
+++ bibledit-5.0.903/edit/index.js 2020-07-19 12:54:21.000000000 +0000
@@ -218,7 +218,7 @@
editorLoadDate = new Date();
var seconds = (editorLoadDate.getTime() - editorSaveDate.getTime()) / 1000;
if ((seconds < 2) || reload) {
- if (editorWriteAccess) alert (editorChapterVerseUpdatedLoaded);
+ if (editorWriteAccess) editorReloadAlert (editorChapterVerseUpdatedLoaded); // Todo
}
} else {
// Checksum error: Reload.
@@ -275,7 +275,7 @@
editorSaveDate = new Date();
var seconds = (editorSaveDate.getTime() - editorLoadDate.getTime()) / 1000;
if (seconds < 2) {
- if (editorWriteAccess) alert (editorChapterVerseUpdatedLoaded);
+ if (editorWriteAccess) editorReloadAlert (editorChapterVerseUpdatedLoaded); // Todo
}
},
});
@@ -888,7 +888,7 @@
var editorInsertedNotesCount = 0;
-function applyNotesStyle (style)
+function applyNotesStyle (style) // Todo
{
if (!editorWriteAccess) return;
@@ -912,14 +912,9 @@
quill.setSelection (caret, 0);
quill.insertText (caret, caller, "character", "notecall" + noteId, "user");
- // Append note text to notes section:
- // 1 + .
- var length = quill.getLength ();
- quill.insertText (length, "\n", "paragraph", style, "user");
- quill.insertText (length, caller, "character", "notebody" + noteId, "user");
- length++;
- quill.insertText (length, " + .", "character", "", "user");
-
+ // Append note text to notes section. Todo
+ assetsEditorAddNote (quill, style, caller, noteId, editorNavigationChapter, editorNavigationVerse);
+
editorInsertedNotesCount++;
editorActiveStylesFeedback ();
@@ -1055,3 +1050,27 @@
}
+/*
+
+Section for reload notifications.
+
+*/
+
+
+function editorReloadAlert (message) // Todo
+{
+ // Take action only if the editor has focus and the user can type in it.
+ if (quill.hasFocus ()) {
+ notifyItSuccess (message)
+ quill.enable (false);
+ setTimeout (editorReloadAlertTimeout, 3000);
+ }
+}
+
+
+function editorReloadAlertTimeout ()
+{
+ quill.enable (editorWriteAccess);
+ quill.focus ();
+}
+
diff -Nru bibledit-5.0.901/editone/index.html bibledit-5.0.903/editone/index.html
--- bibledit-5.0.901/editone/index.html 2020-07-11 16:11:47.000000000 +0000
+++ bibledit-5.0.903/editone/index.html 2020-07-19 12:54:21.000000000 +0000
@@ -34,5 +34,6 @@
+
##navigationCode##
diff -Nru bibledit-5.0.901/editone/index.js bibledit-5.0.903/editone/index.js
--- bibledit-5.0.901/editone/index.js 2020-07-11 16:11:47.000000000 +0000
+++ bibledit-5.0.903/editone/index.js 2020-07-19 12:54:21.000000000 +0000
@@ -237,7 +237,7 @@
if (oneverseVerseLoading in oneverseEditorSaveDate) {
var seconds = (oneverseEditorLoadDate[oneverseVerseLoading].getTime() - oneverseEditorSaveDate[oneverseVerseLoading].getTime()) / 1000;
if ((seconds < 2) | oneverseReloadFlag) {
- if (oneverseEditorWriteAccess) alert (oneverseEditorVerseUpdatedLoaded);
+ if (oneverseEditorWriteAccess) oneverseReloadAlert (oneverseEditorVerseUpdatedLoaded); // Todo
}
}
oneverseReloadFlag = false;
@@ -737,7 +737,7 @@
var oneverseInsertedNotesCount = 0;
-function oneverseApplyNotesStyle (style)
+function oneverseApplyNotesStyle (style) // Todo
{
if (!oneverseEditorWriteAccess) return;
@@ -762,13 +762,8 @@
quill.setSelection (caret, 0);
quill.insertText (caret, caller, "character", "notecall" + noteId, "user");
- // Append note text to notes section:
- // 1 + .
- var length = quill.getLength ();
- quill.insertText (length, "\n", "paragraph", style, "user");
- quill.insertText (length, caller, "character", "notebody" + noteId, "user");
- length++;
- quill.insertText (length, " + .", "character", "", "user");
+ // Append note text to notes section. Todo
+ assetsEditorAddNote (quill, style, caller, noteId, oneverseNavigationChapter, oneverseNavigationVerse);
oneverseInsertedNotesCount++;
@@ -888,3 +883,28 @@
parent.window.navigatePreviousVerse (event);
}
}
+
+
+/*
+
+Section for reload notifications.
+
+*/
+
+
+function oneverseReloadAlert (message) // Todo
+{
+ // Take action only if the editor has focus and the user can type in it.
+ if (quill.hasFocus ()) {
+ notifyItSuccess (message)
+ quill.enable (false);
+ setTimeout (oneverseReloadAlertTimeout, 3000);
+ }
+}
+
+
+function oneverseReloadAlertTimeout ()
+{
+ quill.enable (oneverseEditorWriteAccess);
+ quill.focus ();
+}
diff -Nru bibledit-5.0.901/editusfm/index.js bibledit-5.0.903/editusfm/index.js
--- bibledit-5.0.901/editusfm/index.js 2020-07-11 16:11:47.000000000 +0000
+++ bibledit-5.0.903/editusfm/index.js 2020-07-19 12:54:21.000000000 +0000
@@ -108,7 +108,7 @@
usfmBook = usfmNavigationBook;
usfmChapter = usfmNavigationChapter;
usfmIdChapter = 0;
- if (usfmEditorWriteAccess) $ ("#usfmeditor").focus;
+ if (usfmEditorWriteAccess) $ ("#usfmeditor").focus ();
usfmCaretPosition = usfmGetCaretPosition ();
$.ajax ({
url: "load",
@@ -146,7 +146,7 @@
usfmLoadDate = new Date();
var seconds = (usfmLoadDate.getTime() - usfmSaveDate.getTime()) / 1000;
if ((seconds < 2) | usfmReload) {
- if (usfmEditorWriteAccess) alert (usfmEditorVerseUpdatedLoaded);
+ if (usfmEditorWriteAccess) usfmEditorReloadAlert (usfmEditorVerseUpdatedLoaded); // Todo
}
usfmReload = false;
} else {
@@ -208,7 +208,7 @@
usfmSaveDate = new Date();
var seconds = (usfmSaveDate.getTime() - usfmLoadDate.getTime()) / 1000;
if (seconds < 2) {
- if (usfmEditorWriteAccess) alert (usfmEditorVerseUpdatedLoaded);
+ if (usfmEditorWriteAccess) usfmEditorReloadAlert (usfmEditorVerseUpdatedLoaded); // Todo
}
}
});
@@ -525,6 +525,34 @@
});
}
+
+/*
+
+Section for reload notifications.
+
+*/
+
+
+function usfmEditorReloadAlert (message) // Todo
+{
+ // Take action only if the editor has focus and the user can type in it.
+ var editor = $ ("#usfmeditor");
+ if (editor.is (":focus")) {
+ notifyItSuccess (message)
+ editor.attr('contenteditable', false);
+ setTimeout (usfmEditorReloadAlertTimeout, 3000);
+ }
+}
+
+
+function usfmEditorReloadAlertTimeout ()
+{
+ var editor = $ ("#usfmeditor");
+ editor.attr('contenteditable', usfmEditorWriteAccess);
+ editor.focus ();
+}
+
+
// Note that some focus operations were removed for a situation where the workspace has two editors, and the user edits in the visual editor, and then the USFM editor grabs focus, and then the user keeps typing, so he or she was expecting to type in the visual editor but is now typing in the USFM editor.
// Due to removing the focus operations, the caret positioner no longer works when the USFM editor is not focused.
// A new USFM chapter editor could be having multiple editors: One for each line, or rather one for each verse. These editors could be loaded from the server separately, each time it loads a verse line. This system makes placing the caret and scrolling the caret into view easier. Because the javascript just places the caret in a known and scrolls that into view.
diff -Nru bibledit-5.0.901/help/changelog.html bibledit-5.0.903/help/changelog.html
--- bibledit-5.0.901/help/changelog.html 2020-07-11 16:11:47.000000000 +0000
+++ bibledit-5.0.903/help/changelog.html 2020-07-19 12:54:21.000000000 +0000
@@ -1,5 +1,10 @@
ChangeLog
+5.0.903: If a Bible editor has focus, and its text is reloaded, it will be read-only for some seconds.
+5.0.903: If a Bible editor has focus, it shows a notification when the text is reloaded.
+5.0.903: Entering a cross reference adds the reference, the keyword, and the cross reference text.
+5.0.903: Entering a footnote adds the reference, the keyword, and the footnote text.
+5.0.902: The merge anomaly email contains the passage.
5.0.901: Better layout of the merge anomaly email.
5.0.899: Fixed: Displays an alert about "text reloaded" while saving text in the verse editor.
5.0.898: Type Ctrl-G to enter the passage to focus through the keyboard.
diff -Nru bibledit-5.0.901/locale/logic.cpp bibledit-5.0.903/locale/logic.cpp
--- bibledit-5.0.901/locale/logic.cpp 2020-07-11 16:11:47.000000000 +0000
+++ bibledit-5.0.903/locale/logic.cpp 2020-07-19 12:54:21.000000000 +0000
@@ -210,10 +210,6 @@
{
string message;
message.append (translate("Updated Bible text was loaded."));
- message.append (" ");
- message.append (translate("Press Enter to continue."));
- message.append (" ");
- message.append (translate("Please check the updated text."));
return message;
}
diff -Nru bibledit-5.0.901/paratext/logic.h bibledit-5.0.903/paratext/logic.h
--- bibledit-5.0.901/paratext/logic.h 2020-07-11 16:11:47.000000000 +0000
+++ bibledit-5.0.903/paratext/logic.h 2020-07-19 12:54:21.000000000 +0000
@@ -23,6 +23,7 @@
#include
#include
+#include
class Paratext_Logic
diff -Nru bibledit-5.0.901/pkgdata/files.txt bibledit-5.0.903/pkgdata/files.txt
--- bibledit-5.0.901/pkgdata/files.txt 2020-07-11 16:11:47.000000000 +0000
+++ bibledit-5.0.903/pkgdata/files.txt 2020-07-19 12:54:21.000000000 +0000
@@ -1,6 +1,7 @@
/access
/assets
/assets/checkbox.js
+/assets/editor.js
/assets/error.html
/assets/external.js
/assets/footer.html