Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion extension/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
);
Expand Down
29 changes: 17 additions & 12 deletions extension/js/addQuoteLastOnlyButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
14 changes: 9 additions & 5 deletions extension/js/keyboardShortcuts.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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();
}
Expand All @@ -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");

Expand Down
4 changes: 2 additions & 2 deletions extension/js/newResponseNotification.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
14 changes: 7 additions & 7 deletions extension/js/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
8 changes: 4 additions & 4 deletions extension/js/removeNestedQuotes.js
Original file line number Diff line number Diff line change
@@ -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;
}
Expand All @@ -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, "");

Expand Down
2 changes: 1 addition & 1 deletion extension/js/sefariaLinker.js
Original file line number Diff line number Diff line change
@@ -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");
Expand Down
6 changes: 3 additions & 3 deletions extension/js/settingsHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
}
Expand Down
1 change: 1 addition & 0 deletions extension/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ <h4 >קרעדיט:</h4>
<li><div>ממה נפשך</div></li>
<li><div>קנאפער ידען</div></li>
<li><div>רבות מחשבות</div></li>
<li><div>חכם ממה נשתנה</div></li>
<li><div>יקירי קרתא דק"ק אייוועלט</div></li>
<li><div style="user-select:none;">&thinsp;</div></li>
</ul>
Expand Down