ep_bookmark
Advanced tools
Comparing version 1.0.2 to 1.1.0
@@ -9,3 +9,3 @@ { | ||
"eejsBlock_body": "ep_bookmark/hooks:eejsBlock_body" | ||
}, | ||
}, | ||
"client_hooks": { | ||
@@ -12,0 +12,0 @@ "documentReady": "ep_bookmark/static/js/index", |
{ | ||
"ep_bookmark.bookmarkTitle": "Verwalte die Lesezeichen deiner Pads", | ||
"ep_bookmark.noPads": "Keine Pads", | ||
"ep_bookmark.addBookmarksAutomatically": "Füge neue Pads automatisch hinzu", | ||
"ep_bookmark.addBookmarksAutomatically.title": "Beim Aufruf von Pads werden diese automatisch zur Lesezeichenliste hinzugefügt", | ||
"ep_bookmark.addPadToBookmarks": "Füge dieses Pad als Lesezeichen hinzu", | ||
"ep_bookmark.cancel": "Abbrechen", | ||
"ep_bookmark.editIcon.title": "Bearbeite den Kommentar für dieses Lesezeichen", | ||
"ep_bookmark.saveIcon.title": "Speichere den Kommentar für dieses Lesezeichen", | ||
"ep_bookmark.closeIcon.title": "Breche das Editieren des Kommentars ab", | ||
"ep_bookmark.deleteIcon.title": "Lösche dieses Lesezeichen", | ||
"ep_bookmark.autoAdded": "automatisch hinzugefügt", | ||
"ep_bookmark.lastVisit": "Letzter Besuch", | ||
"ep_bookmark.info": "Info", | ||
"ep_bookmark.info.title": "Hier können Lesezeichen der Pads dieses Servers gespeichert werden. Diese werden nur in diesem Browser gespeichert. Die Anzeige der Pads ist sortiert nach dem letzten Besuch.", | ||
"ep_bookmark.notSupported": "Dein Browser unterstützt das Speichern von Lesezeichen nicht." | ||
"ep_bookmark.bookmarkTitle": "Verwalte die Lesezeichen deiner Pads", | ||
"ep_bookmark.noPads": "Keine Pads", | ||
"ep_bookmark.addBookmarksAutomatically": "Füge neue Pads automatisch hinzu", | ||
"ep_bookmark.addBookmarksAutomatically.title": "Beim Aufruf von Pads werden diese automatisch zur Lesezeichenliste hinzugefügt", | ||
"ep_bookmark.addPadToBookmarks": "Füge dieses Pad als Lesezeichen hinzu", | ||
"ep_bookmark.cancel": "Abbrechen", | ||
"ep_bookmark.editIcon.title": "Bearbeite den Kommentar für dieses Lesezeichen", | ||
"ep_bookmark.saveIcon.title": "Speichere den Kommentar für dieses Lesezeichen", | ||
"ep_bookmark.closeIcon.title": "Breche das Editieren des Kommentars ab", | ||
"ep_bookmark.deleteIcon.title": "Lösche dieses Lesezeichen", | ||
"ep_bookmark.autoAdded": "automatisch hinzugefügt", | ||
"ep_bookmark.lastVisit": "Letzter Besuch", | ||
"ep_bookmark.info": "Info", | ||
"ep_bookmark.info.title": "Hier können Lesezeichen der Pads dieses Servers gespeichert werden. Diese werden nur in diesem Browser gespeichert. Die Anzeige der Pads ist sortiert nach dem letzten Besuch.", | ||
"ep_bookmark.notSupported": "Dein Browser unterstützt das Speichern von Lesezeichen nicht.", | ||
"ep_bookmark.searchPlaceholder": "Suche nach Pads" | ||
} |
{ | ||
"ep_bookmark.bookmarkTitle": "Manage your pad bookmarks", | ||
"ep_bookmark.noPads": "No pads", | ||
"ep_bookmark.addBookmarksAutomatically": "Add bookmarks automatically", | ||
"ep_bookmark.addBookmarksAutomatically.title": "If you open a pad it will automatically be added to your bookmarks", | ||
"ep_bookmark.addPadToBookmarks": "Add this pad to your bookmarks", | ||
"ep_bookmark.cancel": "Cancel", | ||
"ep_bookmark.editIcon.title": "Edit comment for this bookmark", | ||
"ep_bookmark.saveIcon.title": "Save comment for this bookmark", | ||
"ep_bookmark.closeIcon.title": "Cancel editing this comment", | ||
"ep_bookmark.deleteIcon.title": "Delete this bookmark", | ||
"ep_bookmark.autoAdded": "automatically added", | ||
"ep_bookmark.lastVisit": "Last visit", | ||
"ep_bookmark.info": "Info", | ||
"ep_bookmark.info.title": "Here you can save a list of your pads on this server. The list is only stored in your browser and is ordered beginning with the latest visited pad.", | ||
"ep_bookmark.notSupported": "Your browser does not support saving of bookmarks." | ||
"ep_bookmark.bookmarkTitle": "Manage your pad bookmarks", | ||
"ep_bookmark.noPads": "No pads", | ||
"ep_bookmark.addBookmarksAutomatically": "Add bookmarks automatically", | ||
"ep_bookmark.addBookmarksAutomatically.title": "If you open a pad it will automatically be added to your bookmarks", | ||
"ep_bookmark.addPadToBookmarks": "Add this pad to your bookmarks", | ||
"ep_bookmark.cancel": "Cancel", | ||
"ep_bookmark.editIcon.title": "Edit comment for this bookmark", | ||
"ep_bookmark.saveIcon.title": "Save comment for this bookmark", | ||
"ep_bookmark.closeIcon.title": "Cancel editing this comment", | ||
"ep_bookmark.deleteIcon.title": "Delete this bookmark", | ||
"ep_bookmark.autoAdded": "automatically added", | ||
"ep_bookmark.lastVisit": "Last visit", | ||
"ep_bookmark.info": "Info", | ||
"ep_bookmark.info.title": "Here you can save a list of your pads on this server. The list is only stored in your browser and is ordered beginning with the latest visited pad.", | ||
"ep_bookmark.notSupported": "Your browser does not support saving of bookmarks.", | ||
"ep_bookmark.searchPlaceholder": "Search for padssssssss" | ||
} |
{ | ||
"name": "ep_bookmark", | ||
"version": "1.0.2", | ||
"version": "1.1.0", | ||
"description": "Etherpad plugin for users to save a list of bookmarks of their visited pads locally in the browser's local storage", | ||
@@ -8,3 +8,5 @@ "author": "gared (STEFAN MUELLER) <stefan@stefans-entwicklerecke.de>", | ||
"dependencies": {}, | ||
"engines": { "node": ">= 0.6.0"}, | ||
"engines": { | ||
"node": ">= 0.6.0" | ||
}, | ||
"repository": { | ||
@@ -11,0 +13,0 @@ "type": "git", |
@@ -1,2 +0,2 @@ | ||
#Etherpad plugin ep_bookmark | ||
#Etherpad plugin: ep_bookmark | ||
Etherpad plugin for users to save a list of bookmarks of their visited pads locally in the browser's local storage. | ||
@@ -3,0 +3,0 @@ |
/** | ||
* Refreshs the overlay for the pad bookmark list and its content | ||
*/ | ||
var refreshPadList = function() { | ||
var bookmarks = bookmarkStorage.getAllPadBookmarks(); | ||
var refreshPadList = function(bookmarks) { | ||
var padDiv; | ||
@@ -13,13 +12,17 @@ var padLinkTag; | ||
var closeTag; | ||
var deleteTag; | ||
$('#bookmarkSearchInput').attr('placeholder', html10n.get("ep_bookmark.searchPlaceholder") + " 🔍"); | ||
$("#padBookmarkList").empty(); | ||
if (bookmarks.length == 0) { | ||
if (bookmarks.length === 0) { | ||
$("#padBookmarkList").append("<div id='noPads'></div>").text(html10n.get("ep_bookmark.noPads")); | ||
} else { | ||
for (var i=0; i < bookmarks.length; i++) { | ||
padDiv = $("<div/>").attr('class', 'padBookmark').attr('id', bookmarks[i].padId); | ||
padLinkTag = $("<a class='bookmarkPadId' href='javascript:pad.switchToPad(\""+bookmarks[i].padId+"\")'>"+bookmarks[i].padId+"</a>").attr('title', html10n.get("ep_bookmark.lastVisit")+': '+new Date(bookmarks[i].timestamp).toLocaleString()); | ||
commentTag = $("<span/>").attr('class', 'comment').text(bookmarks[i].description); | ||
commentEditTag = $("<input/>").attr('class', 'editComment'); | ||
editTag = $("<a class='editIcon' href='#'>✍</a>'").click(editCommentClick); | ||
commentTag = $('<span class="comment"/>').text(bookmarks[i].description); | ||
commentEditTag = $('<input class="editComment" placeholder="🗒"/>'); | ||
editTag = $("<a class='editIcon' href='#'>🖉</a>'").click(editCommentClick); | ||
saveTag = $("<a class='saveIcon' href='#'>✓</a>'").click(saveCommentClick); | ||
@@ -39,6 +42,6 @@ closeTag = $("<a class='closeIcon' href='#'>✗</a>'").click(closeCommentClick); | ||
// ESC pressed | ||
if (e.keyCode == 27){ | ||
if (e.keyCode === 27){ | ||
abortCommentEditing($(e.currentTarget).parent()); | ||
// Enter pressed | ||
} else if (e.keyCode == 13) { | ||
} else if (e.keyCode === 13) { | ||
saveComment($(e.currentTarget).parent()); | ||
@@ -122,3 +125,3 @@ } | ||
if (bookmarks[i].timestamp > sortedBookmarks[k].timestamp) { | ||
if (k == 0) { | ||
if (k === 0) { | ||
// Add bookmark on first position | ||
@@ -133,3 +136,3 @@ sortedBookmarks.unshift(bookmarks[i]); | ||
} | ||
if (bookmarkAdded == false) { | ||
if (bookmarkAdded === false) { | ||
sortedBookmarks.push(bookmarks[i]); | ||
@@ -143,3 +146,3 @@ } | ||
for (var i=0; i < bookmarks.length; i++) { | ||
if (bookmarks[i].padId == padId) { | ||
if (bookmarks[i].padId === padId) { | ||
return bookmarks[i]; | ||
@@ -154,3 +157,3 @@ } | ||
for (var i=0; i < bookmarks.length; i++) { | ||
if (bookmarks[i].padId == bookmark.padId) { | ||
if (bookmarks[i].padId === bookmark.padId) { | ||
bookmarks[i] = bookmark; | ||
@@ -162,3 +165,3 @@ } | ||
padBookmarkExists: function(padId) { | ||
return bookmarkStorage.getPadBookmark(padId) == null ? false : true; | ||
return bookmarkStorage.getPadBookmark(padId) !== null; | ||
}, | ||
@@ -178,3 +181,3 @@ saveLocalStorageItem: function(storageItem) { | ||
bookmarkStorage.saveLocalStorageItem(localStorageItem); | ||
refreshPadList(); | ||
refreshPadList(bookmarkStorage.getAllPadBookmarks()); | ||
} | ||
@@ -186,3 +189,3 @@ }, | ||
for (var i=0; i < bookmarks.length; i++) { | ||
if (bookmarks[i].padId == padId) { | ||
if (bookmarks[i].padId === padId) { | ||
bookmarks.splice(i, 1); | ||
@@ -193,3 +196,3 @@ break; | ||
bookmarkStorage.saveLocalStorageItem(localStorageItem); | ||
refreshPadList(); | ||
refreshPadList(bookmarkStorage.getAllPadBookmarks()); | ||
}, | ||
@@ -326,6 +329,7 @@ setOption: function(name, value) { | ||
var documentReady = function (hook, context) { | ||
$("#managePadBookmarks a").click(function () { | ||
var module = $("#padBookmarkManager"); | ||
if (module.css('display') == "none") { | ||
if (module.css('display') === "none") { | ||
$("#addPadBookmark").val(html10n.get("ep_bookmark.addPadToBookmarks")); | ||
@@ -341,3 +345,3 @@ $("#infoText").attr("title", html10n.get("ep_bookmark.info.title")); | ||
$("#addPadBookmark").attr('disabled', $("#autoAddBookmarkCheckbox").attr('checked')); | ||
refreshPadList(); | ||
refreshPadList(bookmarkStorage.getAllPadBookmarks()); | ||
} else { | ||
@@ -357,3 +361,15 @@ $("#padBookmarkMain").hide(); | ||
$("#addPadBookmark").attr('disabled', $(this).is(":checked")); | ||
autoAddBookmark(); | ||
}); | ||
$('#bookmarkSearchInput').on('input', function () { | ||
var text = $('#bookmarkSearchInput').val().toUpperCase(); | ||
var bookmarks = bookmarkStorage.getAllPadBookmarks(); | ||
var filteredBookmarks = bookmarks.filter(function (bookmark) { | ||
return bookmark.padId.toUpperCase().indexOf(text) > -1 || | ||
bookmark.description.toUpperCase().indexOf(text) > -1; | ||
}); | ||
refreshPadList(filteredBookmarks); | ||
}) | ||
} | ||
@@ -360,0 +376,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21552
17
463