diff --git a/extension/background.js b/extension/background.js index dcd4150..d38ce51 100644 --- a/extension/background.js +++ b/extension/background.js @@ -71,7 +71,7 @@ chrome.runtime.onMessage.addListener(function (request, sender, sendResponse) { }); chrome.webRequest.onBeforeRequest.addListener( - function(details) { return { redirectUrl: 'https://ivelt.com/forum/' }; }, + function(details) { return { redirectUrl: 'https://www.ivelt.com/forum/' }; }, {urls: ['*://www.ןהקךא.com/*']}, ["blocking"] ); diff --git a/extension/js/addQuoteLastOnlyButton.js b/extension/js/addQuoteLastOnlyButton.js index fcb8687..6f646b9 100644 --- a/extension/js/addQuoteLastOnlyButton.js +++ b/extension/js/addQuoteLastOnlyButton.js @@ -6,20 +6,25 @@ function addBtn(){ if (contentElement.innerHTML.includes("blockquote")){ let li = document.createElement('li'); let a = document.createElement('a'); - let href = btn.querySelector('a.button.icon-button.quote-icon').getAttribute('href'); - let onclick = btn.querySelector('a.button.icon-button.quote-icon').getAttribute('onclick'); - a.setAttribute('href', href + '&last=true'); - a.setAttribute('style', "height:18px;width:12px;margin:0;padding:0 5px;color:black;text-align:center;user-select:none;"); - a.setAttribute('class', 'button'); - a.setAttribute('title', 'ציטיר בלויז די לעצטע תגובה'); - if (isPosting){ - a.setAttribute("onclick", "last"+onclick) + let quoteBtn = btn.querySelector('[title="ציטיר אין תגובה"]'); + if (quoteBtn){ + let href = quoteBtn.getAttribute('href'); + let onclick = quoteBtn.getAttribute('onclick'); + a.setAttribute('href', href + '&last=true'); + a.setAttribute('style', "width:18px;color:black;text-align:center;user-select:none;"); + a.setAttribute('class', 'button button-icon-only'); + a.setAttribute('title', 'ציטיר בלויז די לעצטע תגובה'); + if (isPosting){ + a.setAttribute("onclick", "last"+onclick) + } + li.appendChild(a); + let quoteLi = quoteBtn.parentNode; + quoteLi.parentNode.insertBefore(li, quoteLi.nextSibling) + a.innerText = '-' } - li.appendChild(a); - btn.appendChild(li); - a.innerText = '-' + } }); } -addBtn(); +addBtn(); \ No newline at end of file diff --git a/extension/js/keyboardShortcuts.js b/extension/js/keyboardShortcuts.js index 2f1b643..93d8a69 100644 --- a/extension/js/keyboardShortcuts.js +++ b/extension/js/keyboardShortcuts.js @@ -7,11 +7,11 @@ function nextPage() { } function scrollTop() { - window.scrollTo(0, 0); + window.scrollTo({ top: 0, behavior: 'smooth' }); } function scrollBottom() { - window.scrollTo(0, document.body.scrollHeight); + window.scrollTo({ top: document.body.scrollHeight, behavior: 'smooth' } ); } function sendPost() { @@ -23,6 +23,10 @@ function previewPost() { } function checkKey(e) { + if (e.key == "a" && e.altKey) { + window.location.href = 'https://www.ivelt.com/forum/search.php?search_id=active_topics'; + } + if (e.key == "Enter" && e.ctrlKey && post) { sendPost(); } @@ -49,13 +53,13 @@ function checkKey(e) { console.log("attempted to go before first page"); } } else if (e.key == "ArrowUp") { - //scrollTop(); + scrollTop(); } else if (e.key == "ArrowDown") { - //scrollBottom(); + scrollBottom(); } } -document.querySelector(".icon-search-active a").accessKey = "a"; + const notificationNode = document.getElementById("notification_list_button"); diff --git a/extension/js/newResponseNotification.js b/extension/js/newResponseNotification.js index 2db49ce..b3d5b00 100644 --- a/extension/js/newResponseNotification.js +++ b/extension/js/newResponseNotification.js @@ -10,8 +10,8 @@ let title = document.title; // setting was unchecked by the user - let backgroundSync = document.getElementById('iveltHelperSettings').getAttribute('data-backgroundSync') === 'true'; - let backgroundSyncPosts = document.getElementById('iveltHelperSettings').getAttribute('data-backgroundSyncPosts'); + let backgroundSync = document.getElementById('iveltHelperSettings').getAttribute('data-background-sync') === 'true'; + let backgroundSyncPosts = document.getElementById('iveltHelperSettings').getAttribute('data-background-sync-posts'); if(!backgroundSync || !backgroundSyncPosts) return; diff --git a/extension/js/popup.js b/extension/js/popup.js index ccfd97d..6bc0e5a 100644 --- a/extension/js/popup.js +++ b/extension/js/popup.js @@ -17,38 +17,38 @@ function checkLoginState() { } function setLogOutState() { } - getLogOutCookie('http://ivelt.com', 'phpbb3_sw7ki_sid'); + getLogOutCookie('http://www.ivelt.com', 'phpbb3_sw7kk_sid'); document.getElementById('emergency_sign_out').style.display = 'block'; } else { document.getElementById('quick_sign_in').style.display = 'block'; } } -getUserId('http://ivelt.com', 'phpbb3_sw7ki_u'); +getUserId('http://www.ivelt.com', 'phpbb3_sw7kk_u'); function open_home_page(){ - chrome.tabs.create({url:'https://ivelt.com/forum/'}); + chrome.tabs.create({url:'https://www.ivelt.com/forum/'}); window.close(); } function open_pm_inbox(){ - chrome.tabs.create({url:'https://ivelt.com/forum/ucp.php?i=pm&folder=inbox'}); + chrome.tabs.create({url:'https://www.ivelt.com/forum/ucp.php?i=pm&folder=inbox'}); window.close(); } function open_active_topics(){ - chrome.tabs.create({url:'https://ivelt.com/forum/search.php?search_id=active_topics'}); + chrome.tabs.create({url:'https://www.ivelt.com/forum/search.php?search_id=active_topics'}); window.close(); } function quick_sign_in(){ - chrome.tabs.create({url:'https://ivelt.com/forum/ucp.php?mode=login', active: true}); + chrome.tabs.create({url:'https://www.ivelt.com/forum/ucp.php?mode=login', active: true}); chrome.storage.local.set({'logged_in':'0'}); window.close(); } function emergency_sign_out(){ - chrome.tabs.create({url:'https://ivelt.com/forum/ucp.php?mode=logout&sid='+logout_url, active: false}); + chrome.tabs.create({url:'https://www.ivelt.com/forum/ucp.php?mode=logout&sid='+logout_url, active: false}); chrome.storage.local.set({'logged_in':'0'}); window.close(); } diff --git a/extension/js/removeNestedQuotes.js b/extension/js/removeNestedQuotes.js index 44f1e39..ca70e64 100644 --- a/extension/js/removeNestedQuotes.js +++ b/extension/js/removeNestedQuotes.js @@ -1,9 +1,9 @@ function hasNestedQuotes(text) { - let firstQ = text.indexOf("[quote="); + let firstQ = text.indexOf("[quote"); if (firstQ === -1) { return false; } - let secondQ = text.indexOf("[quote=", firstQ + 1); + let secondQ = text.indexOf("[quote", firstQ + 1); if (secondQ === -1) { return false; } @@ -12,8 +12,8 @@ function hasNestedQuotes(text) { function removeNestedQuotes(text) { let nestedQuote = text.substring( - text.lastIndexOf('[quote="'), - text.indexOf("[/quote]", text.lastIndexOf('[quote="')) + 8 + text.lastIndexOf('[quote'), + text.indexOf("[/quote]", text.lastIndexOf('[quote')) + 9 ); let modifiedText = text.replace(nestedQuote, ""); diff --git a/extension/js/sefariaLinker.js b/extension/js/sefariaLinker.js index 3ce57fb..8dcc476 100644 --- a/extension/js/sefariaLinker.js +++ b/extension/js/sefariaLinker.js @@ -1,5 +1,5 @@ (function(){ - let sefariaLinkerSetting = document.getElementById('iveltHelperSettings').getAttribute('data-sefariaLinker') === 'true'; + let sefariaLinkerSetting = document.getElementById('iveltHelperSettings').getAttribute('data-sefaria-linker') === 'true'; if(sefariaLinkerSetting){ var linkerScript = document.createElement("script"); diff --git a/extension/js/settingsHandler.js b/extension/js/settingsHandler.js index dc89d51..271496b 100644 --- a/extension/js/settingsHandler.js +++ b/extension/js/settingsHandler.js @@ -27,9 +27,9 @@ let e = document.createElement('div'); e.style.display = "none"; e.setAttribute('id', 'iveltHelperSettings'); - e.setAttribute('data-sefariaLinker',items.sefariaLinker); - e.setAttribute('data-backgroundSync',items.backgroundSync); - e.setAttribute('data-backgroundSyncPosts',items.backgroundSyncPosts); + e.setAttribute('data-sefaria-linker',items.sefariaLinker); + e.setAttribute('data-background-sync',items.backgroundSync); + e.setAttribute('data-background-sync-posts',items.backgroundSyncPosts); document.body.appendChild(e); }); } diff --git a/extension/settings.html b/extension/settings.html index 5d114ab..8132922 100644 --- a/extension/settings.html +++ b/extension/settings.html @@ -19,6 +19,7 @@