/usr/share/bibledit/editone/index.js is in bibledit-data 5.0.453-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 | /*
Copyright (©) 2003-2017 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.
*/
var quill = undefined;
var Delta = Quill.import ("delta");
$ (document).ready (function ()
{
// Make the editor's menu to never scroll out of view.
var bar = $ ("#editorheader").remove ();
$ ("#workspacemenu").append (bar);
visualVerseEditorInitializeOnce ();
visualVerseEditorInitialize ();
navigationNewPassage ();
$ (window).on ("unload", oneverseEditorUnload);
oneverseIdPoller ();
oneverseBindUnselectable ();
$ ("#stylebutton").on ("click", oneverseStylesButtonHandler);
$ (window).on ("keydown", oneverseWindowKeyHandler);
if (swipe_operations) {
$ ("body").swipe ( {
swipeLeft:function (event, direction, distance, duration, fingerCount, fingerData) {
oneverseSwipeLeft (event);
},
swipeRight:function (event, direction, distance, duration, fingerCount, fingerData) {
oneverseSwipeRight (event);
}
});
}
$ ("#oneeditor").on ("click", oneEditorNoteCitationClicked);
});
function visualVerseEditorInitializeOnce ()
{
var Parchment = Quill.import ('parchment');
// Register block formatting class.
var ParagraphClass = new Parchment.Attributor.Class ('paragraph', 'b', { scope: Parchment.Scope.BLOCK });
Quill.register (ParagraphClass, true);
// Register inline formatting class.
var CharacterClass = new Parchment.Attributor.Class ('character', 'i', { scope: Parchment.Scope.INLINE });
Quill.register (CharacterClass, true);
}
function visualVerseEditorInitialize ()
{
// Work around https://github.com/quilljs/quill/issues/1116
// It sets the margins to 0 by adding an overriding class.
// The Quill editor will remove that class again.
$ ("#oneeditor > p").each (function (index) {
var element = $(this);
element.addClass ("nomargins");
});
// Instantiate editor.
quill = new Quill ('#oneeditor', { });
// Cause it to paste plain text only.
quill.clipboard.addMatcher (Node.ELEMENT_NODE, function (node, delta) {
var plaintext = $ (node).text ();
return new Delta().insert (plaintext);
});
if (!quill.hasFocus ()) quill.focus ();
// Event handlers.
quill.on ("text-change", visualVerseEditorTextChangeHandler);
quill.on ("selection-change", visualVerseEditorSelectionChangeHandler);
}
var oneverseBible;
var oneverseBook;
var oneverseNavigationBook;
var oneverseChapter;
var oneverseNavigationChapter;
var oneverseVerse;
var oneverseNavigationVerse;
var oneverseVerseLoading;
var oneverseVerseLoaded;
var oneverseEditorChangedTimeout;
var oneverseLoadedText;
var oneverseIdChapter = 0;
var oneverseIdTimeout;
var oneverseReloadFlag = false;
var oneverseReloadPosition = undefined;
var oneverseEditorTextChanged = false;
var oneverseSaveAsync;
var oneverseLoadAjaxRequest;
var oneverseSaving = false;
var oneverseEditorWriteAccess = true;
//
//
// Section for the new Passage event from the Navigator.
//
//
function navigationNewPassage ()
{
if (typeof navigationBook != 'undefined') {
oneverseNavigationBook = navigationBook;
oneverseNavigationChapter = navigationChapter;
oneverseNavigationVerse = navigationVerse;
} else if (parent.window.navigationBook != 'undefined') {
oneverseNavigationBook = parent.window.navigationBook;
oneverseNavigationChapter = parent.window.navigationChapter;
oneverseNavigationVerse = parent.window.navigationVerse;
} else {
return;
}
oneverseEditorSaveVerse (true);
oneverseReloadFlag = false;
oneverseEditorLoadVerse ();
}
//
//
// Section for editor load and save.
//
//
function oneverseEditorLoadVerse ()
{
if ((oneverseNavigationBook != oneverseBook) || (oneverseNavigationChapter != oneverseChapter) || (oneverseNavigationVerse != oneverseVerse) || oneverseReloadFlag) {
oneverseBible = navigationBible;
oneverseBook = oneverseNavigationBook;
oneverseChapter = oneverseNavigationChapter;
oneverseVerse = oneverseNavigationVerse;
oneverseVerseLoading = oneverseNavigationVerse;
oneverseIdChapter = 0;
if (oneverseReloadFlag) {
oneverseReloadPosition = oneverseCaretPosition ();
} else {
oneverseReloadPosition = undefined;
}
if (oneverseLoadAjaxRequest && oneverseLoadAjaxRequest.readystate != 4) {
oneverseLoadAjaxRequest.abort();
}
oneverseLoadAjaxRequest = $.ajax ({
url: "load",
type: "GET",
data: { bible: oneverseBible, book: oneverseBook, chapter: oneverseChapter, verse: oneverseVerseLoading },
success: function (response) {
// Flag for editor read-write or read-only.
oneverseEditorWriteAccess = checksum_readwrite (response);
// Checksumming.
response = checksum_receive (response);
// Splitting.
var bits;
if (response !== false) {
bits = response.split ("#_be_#");
if (bits.length != 3) response == false;
}
if (response !== false) {
$ ("#oneprefix").empty ();
$ ("#oneprefix").append (bits [0]);
$ ("#oneprefix").off ("click");
$ ("#oneprefix").on ("click", oneVerseHtmlClicked);
}
if (response !== false) {
// Destroy existing editor.
if (quill) delete quill;
// Load the html in the DOM.
$ ("#oneeditor").empty ();
$ ("#oneeditor").append (bits [1]);
oneverseVerseLoaded = oneverseVerseLoading;
oneverseEditorStatus (oneverseEditorVerseLoaded);
// Create the editor based on the DOM's content.
visualVerseEditorInitialize ();
quill.enable (oneverseEditorWriteAccess);
// The browser may reformat the loaded html, so take the possible reformatted data for reference.
oneverseLoadedText = $ (".ql-editor").html ();
oneverseReloadFlag = false;
oneverseCaretMovedTimeoutStart ();
// Create CSS for embedded styles.
css4embeddedstyles ();
}
if (response !== false) {
$ ("#onesuffix").empty ();
$ ("#onesuffix").append (bits [2]);
$ ("#onesuffix").off ("click");
$ ("#onesuffix").on ("click", oneVerseHtmlClicked);
}
if (response !== false) {
oneverseScrollVerseIntoView ();
oneversePositionCaret ();
}
if (response === false) {
// Checksum or other error: Reload.
oneverseReloadFlag = true;
oneverseEditorLoadVerse ();
}
},
});
}
}
function oneverseEditorUnload ()
{
oneverseEditorSaveVerse (true);
}
function oneverseEditorSaveVerse (sync)
{
if (oneverseSaving) {
oneverseEditorChanged ();
return;
}
if (!oneverseEditorWriteAccess) return;
oneverseEditorTextChanged = false;
if (!oneverseBible) return;
if (!oneverseBook) return;
if (!oneverseVerseLoaded) return;
var html = $ (".ql-editor").html ();
if (html == oneverseLoadedText) return;
oneverseEditorStatus (oneverseEditorVerseSaving);
oneverseLoadedText = html;
oneverseIdChapter = 0;
oneverseSaveAsync = true;
if (sync) oneverseSaveAsync = false;
var encodedHtml = filter_url_plus_to_tag (html);
var checksum = checksum_get (encodedHtml);
oneverseSaving = true;
$.ajax ({
url: "save",
type: "POST",
async: oneverseSaveAsync,
data: { bible: oneverseBible, book: oneverseBook, chapter: oneverseChapter, verse: oneverseVerseLoaded, html: encodedHtml, checksum: checksum },
error: function (jqXHR, textStatus, errorThrown) {
oneverseEditorStatus (oneverseEditorVerseRetrying);
oneverseLoadedText = "";
oneverseEditorChanged ();
if (!oneverseSaveAsync) oneverseEditorSaveVerse (true);
},
success: function (response) {
oneverseEditorStatus (response);
},
complete: function (xhr, status) {
oneverseSaveAsync = true;
oneverseSaving = false;
}
});
}
//
//
// Portion dealing with triggers for editor's content change.
//
//
var visualVerseEditorBlockingChange = false;
// Arguments: delta: Delta, oldContents: Delta, source: String
function visualVerseEditorTextChangeHandler (delta, oldContents, source)
{
// Ensure that it does not delete a chapter number or verse number.
if (!delta.ops [0].retain) {
quill.history.undo ();
}
// Start save delay timer.
oneverseEditorChanged ();
}
function oneverseEditorChanged ()
{
if (!oneverseEditorWriteAccess) return;
oneverseEditorTextChanged = true;
oneverseEditorStatus (oneverseEditorWillSave);
if (oneverseEditorChangedTimeout) {
clearTimeout (oneverseEditorChangedTimeout);
}
oneverseEditorChangedTimeout = setTimeout (oneverseEditorSaveVerse, 1000);
}
//
//
// Section for user interface updates and feedback.
//
//
function oneverseEditorStatus (text)
{
$ ("#onestatus").empty ();
$ ("#onestatus").append (text);
oneverseEditorSelectiveNotification (text);
}
function oneverseActiveStylesFeedback ()
{
var format = quill.getFormat ();
var paragraph = "...";
if (format.paragraph) paragraph = format.paragraph;
var character = "";
if (format.character) character = format.character;
if (character.search ("note") >= 0) character = "";
character = character.split ("0").join (" ");
var styles = paragraph + " " + character;
var element = $ ("#oneverseactivestyles");
element.text (styles);
}
function oneverseEditorSelectiveNotification (message)
{
if (message == oneverseEditorVerseLoaded) return;
if (message == oneverseEditorWillSave) return;
if (message == oneverseEditorVerseSaving) return;
if (message == oneverseEditorVerseSaved) return;
notifyItError (message);
}
//
//
// Section for polling the server for updates on the loaded chapter.
//
//
function oneverseIdPoller ()
{
if (oneverseIdTimeout) {
clearTimeout (oneverseIdTimeout);
}
oneverseIdTimeout = setTimeout (oneverseEditorPollId, 1000);
}
function oneverseEditorPollId ()
{
$.ajax ({
url: "../edit/id",
type: "GET",
data: { bible: oneverseBible, book: oneverseBook, chapter: oneverseChapter },
cache: false,
success: function (response) {
if (!oneverseSaving) {
if (oneverseIdChapter != 0) {
if (response != oneverseIdChapter) {
oneverseReloadFlag = true;
oneverseEditorLoadVerse ();
oneverseIdChapter = 0;
}
}
oneverseIdChapter = response;
}
},
complete: function (xhr, status) {
oneverseIdPoller ();
}
});
}
//
//
// Section for getting and setting the caret position.
//
//
function oneverseCaretPosition ()
{
var position = undefined;
var range = quill.getSelection();
if (range) position = range.index;
return position;
}
function oneversePositionCaret ()
{
setTimeout (oneversePositionCaretTimeout, 100);
}
function oneversePositionCaretTimeout ()
{
var position;
if (oneverseReloadPosition != undefined) {
position = oneverseReloadPosition;
oneverseReloadPosition = undefined;
} else {
position = 1 + oneverseVerse.length;
}
quill.setSelection (position, 0, "silent");
}
//
//
// Section for scrolling the editable portion into the center.
//
//
function oneverseScrollVerseIntoView ()
{
$("#workspacewrapper").stop();
var verseTop = $("#oneeditor").offset().top;
var workspaceHeight = $("#workspacewrapper").height();
var currentScrollTop = $("#workspacewrapper").scrollTop();
var scrollTo = verseTop - (workspaceHeight * verticalCaretPosition / 100) + currentScrollTop;
var lowerBoundary = currentScrollTop - (workspaceHeight / 10);
var upperBoundary = currentScrollTop + (workspaceHeight / 10);
if ((scrollTo < lowerBoundary) || (scrollTo > upperBoundary)) {
$("#workspacewrapper").animate({ scrollTop: scrollTo }, 500);
}
}
//
//
// Section for the styles handling.
//
//
function oneverseStylesButtonHandler ()
{
if (!oneverseEditorWriteAccess) return;
$.ajax ({
url: "../edit/styles",
type: "GET",
cache: false,
success: function (response) {
oneverseShowResponse (response);
oneverseBindUnselectable ();
oneverseDynamicClickHandlers ();
},
});
return false;
}
function oneverseBindUnselectable ()
{
var elements = $ (".unselectable");
elements.off ("mousedown");
elements.on ("mousedown", function (event) {
event.preventDefault();
});
}
function oneverseShowResponse (response)
{
if (!oneverseEditorWriteAccess) return;
$ ("#stylebutton").hide ();
$ ("#nostyles").hide ();
var area = $ ("#stylesarea");
area.empty ();
area.append (response);
}
function oneverseClearStyles ()
{
var area = $ ("#stylesarea");
area.empty ();
$ ("#stylebutton").show ();
$ ("#nostyles").show ();
}
function oneverseDynamicClickHandlers ()
{
var elements = $ ("#stylesarea > a");
elements.on ("click", function (event) {
event.preventDefault();
oneverseClearStyles ();
var href = event.currentTarget.href;
href = href.substring (href.lastIndexOf ('/') + 1);
if (href == "cancel") return;
if (href == "all") {
oneverseDisplayAllStyles ();
} else {
oneverseRequestStyle (href);
}
});
$ ("#styleslist").on ("change", function (event) {
var selection = $ ("#styleslist option:selected").text ();
var style = selection.substring (0, selection.indexOf (" "));
event.preventDefault();
oneverseClearStyles ();
oneverseRequestStyle (style);
});
}
function oneverseRequestStyle (style)
{
$.ajax ({
url: "../edit/styles",
type: "GET",
data: { style: style },
cache: false,
success: function (response) {
response = response.split ("\n");
var style = response [0];
var action = response [1];
if (action == "p") {
oneverseApplyParagraphStyle (style);
} else if (action == 'c') {
oneverseApplyCharacterStyle (style);
} else if (action == 'n') {
oneverseApplyNotesStyle (style);
} else if (action == "m") {
oneverseApplyMonoStyle (style);
}
},
});
}
function oneverseDisplayAllStyles ()
{
$.ajax ({
url: "../edit/styles",
type: "GET",
data: { all: "" },
cache: false,
success: function (response) {
oneverseShowResponse (response);
oneverseBindUnselectable ();
oneverseDynamicClickHandlers ();
},
});
}
function oneverseApplyParagraphStyle (style)
{
if (!oneverseEditorWriteAccess) return;
if (!quill.hasFocus ()) quill.focus ();
quill.format ("paragraph", style, "user");
oneverseActiveStylesFeedback ();
}
function oneverseApplyCharacterStyle (style)
{
if (!oneverseEditorWriteAccess) return;
if (!quill.hasFocus ()) quill.focus ();
// No formatting of a verse.
var range = quill.getSelection();
if (range) {
for (i = range.index; i < range.index + range.length; i++) {
var format = quill.getFormat (i);
if (format.character && format.character == "v") {
return;
}
}
}
// Apply style.
var format = quill.getFormat ();
style = editor_determine_character_style (format.character, style)
quill.format ("character", style, "user");
// Deal with embedded character styles.
post_embedded_style_application (style);
// Feedback.
oneverseActiveStylesFeedback ();
}
function oneverseApplyMonoStyle (style)
{
if (!oneverseEditorWriteAccess) return;
quill.focus ();
var range = quill.getSelection();
var caret = range.index;
var start = caret;
var text = quill.getText (start, 1);
if (text == "\n") caret--;
for (i = caret; i >= 0; i--) {
var text = quill.getText (i, 1);
if (text == "\n") break;
start = i;
}
var end = caret;
for (i = caret; true; i++) {
end = i;
var text = quill.getText (i, 1);
if (text == "\n") break;
}
text = quill.getText (start, end - start);
var char = text.substring (0, 1);
if (char == "\\") {
text = text.substring (1);
var pos = text.indexOf (' ');
text = text.substring (pos + 1);
}
text = "\\" + style + " " + text;
quill.deleteText (start, end - start);
quill.insertText (start, text, "paragraph", "mono");
oneverseActiveStylesFeedback ();
}
//
//
// Section with window events and their basic handlers.
//
//
function oneverseWindowKeyHandler (event)
{
if (!oneverseEditorWriteAccess) return;
// Ctrl-S: Style.
if ((event.ctrlKey == true) && (event.keyCode == 83)) {
oneverseStylesButtonHandler ();
return false;
}
// Escape.
if (event.keyCode == 27) {
oneverseClearStyles ();
}
}
//
//
// Section responding to a moved caret.
//
//
// Responds to a changed selection or caret.
// range: { index: Number, length: Number }
// oldRange: { index: Number, length: Number }
// source: String
function visualVerseEditorSelectionChangeHandler (range, oldRange, source)
{
// Bail out if editor not focused.
if (!range) return;
// Bail out if text was selected.
if (range.length != 0) return;
oneverseCaretMovedTimeoutStart ();
}
var oneverseCaretMovedTimeoutId;
function oneverseCaretMovedTimeoutStart ()
{
if (oneverseCaretMovedTimeoutId) clearTimeout (oneverseCaretMovedTimeoutId);
oneverseCaretMovedTimeoutId = setTimeout (oneverseActiveStylesFeedback, 200);
}
//
//
// Section for the notes.
//
//
var oneverseInsertedNotesCount = 0;
function oneverseApplyNotesStyle (style)
{
if (!oneverseEditorWriteAccess) return;
quill.focus ();
// Check for and optionally append the gap between text body and notes.
var notes = $ (".b-notes");
if (notes.length == 0) {
var length = quill.getLength ();
quill.insertText (length, "\n", "paragraph", "notes", "user")
}
// Get a new node identifier based on the local time.
var date = new Date();
var noteId = String (date.getTime());
var caller = String ((oneverseInsertedNotesCount % 9) + 1);
// Insert note caller at caret.
var range = quill.getSelection();
var caret = range.index;
quill.setSelection (caret, 0);
quill.insertText (caret, caller, "character", "notecall" + noteId, "user");
// Append note text to notes section:
// <p class="b-f"><span class="i-notebody1">1</span> + .</p>
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");
oneverseInsertedNotesCount++;
oneverseActiveStylesFeedback ();
}
function oneEditorNoteCitationClicked (event)
{
var target = $(event.target);
var cls = target.attr ("class");
if (cls.substr (0, 6) != "i-note") return;
cls = cls.substr (2);
var length = quill.getLength ();
if (cls.search ("call") > 0) {
cls = cls.replace ("call", "body");
// Start searching for note bodies at the end.
for (i = length; i >= 0; i--) {
var format = quill.getFormat (i, 1);
if (format.character && format.character == cls) {
quill.setSelection (i + 4, 0);
oneverseActiveStylesFeedback ();
return;
}
}
}
if (cls.search ("body") > 0) {
cls = cls.replace ("body", "call");
// Start searching for note callers at the start.
for (i = 0; i < length; i++) {
var format = quill.getFormat (i, 1);
if (format.character && format.character == cls) {
quill.setSelection (i + 1, 0);
oneverseActiveStylesFeedback ();
return;
}
}
}
}
//
//
// Section for navigating to another passage.
//
//
function oneVerseHtmlClicked (event)
{
// If the user selects text, do nothing.
var text = "";
if (window.getSelection) {
text = window.getSelection().toString();
} else if (document.selection && document.selection.type != "Control") {
text = document.selection.createRange().text;
}
if (text.length) return;
var verse = "";
var iterations = 0;
var target = $(event.target);
var tagName = target.prop("tagName");
if (tagName == "P") target = $ (target.children ().last ());
while ((iterations < 10) && (!target.hasClass ("v"))) {
var previous = $(target.prev ());
if (previous.length == 0) {
target = $ (target.parent ().prev ());
target = $ (target.children ().last ());
} else {
target = previous;
}
iterations++;
}
if (target.length == 0) verse = "0";
if (target.hasClass ("v")) {
verse = target[0].innerText;
}
$.ajax ({
url: "verse",
type: "GET",
data: { verse: verse },
cache: false
});
}
//
//
// Section for swipe navigation.
//
//
function oneverseSwipeLeft (event)
{
if (typeof navigateNextVerse != 'undefined') {
navigateNextVerse (event);
} else if (parent.window.navigateNextVerse != 'undefined') {
parent.window.navigateNextVerse (event);
}
}
function oneverseSwipeRight (event)
{
if (typeof navigatePreviousVerse != 'undefined') {
navigatePreviousVerse (event);
} else if (parent.window.navigatePreviousVerse != 'undefined') {
parent.window.navigatePreviousVerse (event);
}
}
|