Skip to content

Commit

Permalink
One click watching feature doesn't work in other languages than engli…
Browse files Browse the repository at this point in the history
…sh. #1129
  • Loading branch information
2Abendsegler committed Dec 18, 2019
1 parent 9aa7629 commit 6f92a0e
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions gc_little_helper_II.user.js
Expand Up @@ -2076,24 +2076,28 @@ var mainGC = function() {
$(link)[0].style.backgroundImage = (buttonSetTo == 'Ignore' ? 'url(/images/icons/16/ignore.png)' : 'url('+global_stop_ignore_icon+')');
}

//xxxx
// Improve Watch button handling. (Not for Stop Watching handling.)
if (is_page("cache_listing") && settings_use_one_click_watching && $('#ctl00_ContentBody_GeoNav_uxWatchlistBtn a')[0] && !$('#ctl00_ContentBody_GeoNav_uxWatchlistBtn a')[0].href.match(/action=rem/)) {
// if (is_page("cache_listing") && settings_use_one_click_watching && $('#ctl00_ContentBody_GeoNav_uxWatchlistBtn a')[0] && !$('#ctl00_ContentBody_GeoNav_uxWatchlistBtn a')[0].href.match(/action=rem/)) {
if (is_page("cache_listing") && settings_use_one_click_watching && $('#ctl00_ContentBody_GeoNav_uxWatchlistBtn a')[0]) {
try {
// Set Watch.
changeWatchButton('Watch');

// Prepare one click watching.
var link = '#ctl00_ContentBody_GeoNav_uxWatchlistBtn a';
$(link).attr('data-url', $(link)[0].href);
var wID = $(link)[0].href.match(/aspx\?w=([0-9]+)/);
$(link).attr('data-wID', wID[1]);
$(link)[0].href = 'javascript:void(0);';
$(link)[0].addEventListener("click", oneClickWatching, false);
changeWatchButton($(link)[0].innerHTML);
var saved = document.createElement('span');
saved.setAttribute('id', 'watchSaved');
saved.appendChild(document.createTextNode('saved'));
$('#ctl00_ContentBody_GeoNav_uxWatchlistBtn')[0].append(saved);
if ($(link)[0].href.match(/action=rem/)) {
$(link)[0].innerHTML = 'Stop Watching';
} else {
$(link)[0].innerHTML = 'Watch';
$(link).attr('data-url', $(link)[0].href);
var wID = $(link)[0].href.match(/aspx\?w=([0-9]+)/);
$(link).attr('data-wID', wID[1]);
$(link)[0].href = 'javascript:void(0);';
$(link)[0].addEventListener("click", oneClickWatching, false);
changeWatchButton($(link)[0].innerHTML);
var saved = document.createElement('span');
saved.setAttribute('id', 'watchSaved');
saved.appendChild(document.createTextNode('saved'));
$('#ctl00_ContentBody_GeoNav_uxWatchlistBtn')[0].append(saved);
}
} catch(e) {gclh_error("Improve Watch button handling.",e);}
}
function oneClickWatching() {
Expand Down

0 comments on commit 6f92a0e

Please sign in to comment.