Just in case

This commit is contained in:
seaweedchan 2013-08-16 02:47:35 -07:00
parent 109699d83a
commit 2dedd6af1d
4 changed files with 40 additions and 28 deletions

View File

@ -134,7 +134,8 @@
'Index Navigation': [false, 'Add buttons to navigate between threads.'], 'Index Navigation': [false, 'Add buttons to navigate between threads.'],
'Reply Navigation': [false, 'Add buttons to navigate to top / bottom of thread.'], 'Reply Navigation': [false, 'Add buttons to navigate to top / bottom of thread.'],
'Show Dice Roll': [true, 'Show dice that were entered into the email field.'], 'Show Dice Roll': [true, 'Show dice that were entered into the email field.'],
'Custom Board Titles': [true, 'Allow editing of the board titles'], 'Custom Board Titles': [true, 'Allow editing of the board title and subtitle by ctrl+clicking them'],
'Persistent Custom Board Titles': [false, 'Force custom board titles to be persistent, even if moot updates the board titles.'],
'Show Updated Notifications': [true, 'Show notifications when 4chan X is successfully updated.'], 'Show Updated Notifications': [true, 'Show notifications when 4chan X is successfully updated.'],
'Emoji': [false, 'Adds icons next to names for different emails'], 'Emoji': [false, 'Adds icons next to names for different emails'],
'Color User IDs': [false, 'Assign unique colors to user IDs on boards that use them'], 'Color User IDs': [false, 'Assign unique colors to user IDs on boards that use them'],
@ -8512,16 +8513,17 @@
} }
}, },
focus: function() { focus: function() {
var items, string; var items, string, string2;
string = "" + g.BOARD + "." + this.className; string = "" + g.BOARD + "." + this.className;
string2 = "" + string + ".orig";
items = { items = {
title: this.innerHTML title: this.innerHTML
}; };
items[string] = ''; items[string] = '';
items[string.orig] = false; items[string2] = false;
$.get(items, function(items) { $.get(items, function(items) {
if (!(items[string.orig] && items.title === items[string])) { if (!(items[string2] && items.title === items[string])) {
return $.set(string.orig, items.title); return $.set(string2, items.title);
} }
}); });
return this.textContent = this.innerHTML; return this.textContent = this.innerHTML;
@ -8533,9 +8535,10 @@
} }
}, },
custom: function(child) { custom: function(child) {
var cachedTest, string; var cachedTest, string, string2;
cachedTest = child.innerHTML; cachedTest = child.innerHTML;
string = "" + g.BOARD + "." + child.className; string = "" + g.BOARD + "." + child.className;
string2 = "" + string + ".orig";
$.get(string, cachedTest, function(item) { $.get(string, cachedTest, function(item) {
var title; var title;
if (!(title = item[string])) { if (!(title = item[string])) {
@ -8544,18 +8547,18 @@
if (Conf['Persistent Custom Board Titles']) { if (Conf['Persistent Custom Board Titles']) {
return child.innerHTML = title; return child.innerHTML = title;
} else { } else {
return $.get(string.org, cachedTest, function(itemb) { return $.get(string2, cachedTest, function(itemb) {
if (cachedTest === itemb[string.orig]) { if (cachedTest === itemb[string2]) {
return child.innerHTML = title; return child.innerHTML = title;
} else { } else {
$.set(string, cachedTest); $.set(string, cachedTest);
return $.set(string.orig, cachedTest); return $.set(string2, cachedTest);
} }
}); });
} }
}); });
return $.on(child, 'click keydown focus blur', function(e) { return $.on(child, 'click keydown focus blur', function(e) {
return Banner.cb[e.type].call(this); return Banner.cb[e.type].apply(this, [e]);
}); });
} }
}; };

View File

@ -116,7 +116,8 @@
'Index Navigation': [false, 'Add buttons to navigate between threads.'], 'Index Navigation': [false, 'Add buttons to navigate between threads.'],
'Reply Navigation': [false, 'Add buttons to navigate to top / bottom of thread.'], 'Reply Navigation': [false, 'Add buttons to navigate to top / bottom of thread.'],
'Show Dice Roll': [true, 'Show dice that were entered into the email field.'], 'Show Dice Roll': [true, 'Show dice that were entered into the email field.'],
'Custom Board Titles': [true, 'Allow editing of the board titles'], 'Custom Board Titles': [true, 'Allow editing of the board title and subtitle by ctrl+clicking them'],
'Persistent Custom Board Titles': [false, 'Force custom board titles to be persistent, even if moot updates the board titles.'],
'Show Updated Notifications': [true, 'Show notifications when 4chan X is successfully updated.'], 'Show Updated Notifications': [true, 'Show notifications when 4chan X is successfully updated.'],
'Emoji': [false, 'Adds icons next to names for different emails'], 'Emoji': [false, 'Adds icons next to names for different emails'],
'Color User IDs': [false, 'Assign unique colors to user IDs on boards that use them'], 'Color User IDs': [false, 'Assign unique colors to user IDs on boards that use them'],
@ -8502,16 +8503,17 @@
} }
}, },
focus: function() { focus: function() {
var items, string; var items, string, string2;
string = "" + g.BOARD + "." + this.className; string = "" + g.BOARD + "." + this.className;
string2 = "" + string + ".orig";
items = { items = {
title: this.innerHTML title: this.innerHTML
}; };
items[string] = ''; items[string] = '';
items[string.orig] = false; items[string2] = false;
$.get(items, function(items) { $.get(items, function(items) {
if (!(items[string.orig] && items.title === items[string])) { if (!(items[string2] && items.title === items[string])) {
return $.set(string.orig, items.title); return $.set(string2, items.title);
} }
}); });
return this.textContent = this.innerHTML; return this.textContent = this.innerHTML;
@ -8523,9 +8525,10 @@
} }
}, },
custom: function(child) { custom: function(child) {
var cachedTest, string; var cachedTest, string, string2;
cachedTest = child.innerHTML; cachedTest = child.innerHTML;
string = "" + g.BOARD + "." + child.className; string = "" + g.BOARD + "." + child.className;
string2 = "" + string + ".orig";
$.get(string, cachedTest, function(item) { $.get(string, cachedTest, function(item) {
var title; var title;
if (!(title = item[string])) { if (!(title = item[string])) {
@ -8534,18 +8537,18 @@
if (Conf['Persistent Custom Board Titles']) { if (Conf['Persistent Custom Board Titles']) {
return child.innerHTML = title; return child.innerHTML = title;
} else { } else {
return $.get(string.org, cachedTest, function(itemb) { return $.get(string2, cachedTest, function(itemb) {
if (cachedTest === itemb[string.orig]) { if (cachedTest === itemb[string2]) {
return child.innerHTML = title; return child.innerHTML = title;
} else { } else {
$.set(string, cachedTest); $.set(string, cachedTest);
return $.set(string.orig, cachedTest); return $.set(string2, cachedTest);
} }
}); });
} }
}); });
return $.on(child, 'click keydown focus blur', function(e) { return $.on(child, 'click keydown focus blur', function(e) {
return Banner.cb[e.type].call(this); return Banner.cb[e.type].apply(this, [e]);
}); });
} }
}; };

View File

@ -59,7 +59,11 @@ Config =
] ]
'Custom Board Titles': [ 'Custom Board Titles': [
true true
'Allow editing of the board titles' 'Allow editing of the board title and subtitle by ctrl+clicking them'
]
'Persistent Custom Board Titles': [
false
'Force custom board titles to be persistent, even if moot updates the board titles.'
] ]
'Show Updated Notifications': [ 'Show Updated Notifications': [
true true

View File

@ -47,14 +47,15 @@ Banner =
focus: -> focus: ->
string = "#{g.BOARD}.#{@className}" string = "#{g.BOARD}.#{@className}"
string2 = "#{string}.orig"
items = items =
title: @innerHTML title: @innerHTML
items[string] = '' items[string] = ''
items[string.orig] = false items[string2] = false
$.get items, (items) -> $.get items, (items) ->
unless items[string.orig] and items.title is items[string] unless items[string2] and items.title is items[string]
$.set string.orig, items.title $.set string2, items.title
@textContent = @innerHTML @textContent = @innerHTML
blur: -> blur: ->
@ -65,17 +66,18 @@ Banner =
custom: (child) -> custom: (child) ->
cachedTest = child.innerHTML cachedTest = child.innerHTML
string = "#{g.BOARD}.#{child.className}" string = "#{g.BOARD}.#{child.className}"
string2 = "#{string}.orig"
$.get string, cachedTest, (item) -> $.get string, cachedTest, (item) ->
return unless title = item[string] return unless title = item[string]
if Conf['Persistent Custom Board Titles'] if Conf['Persistent Custom Board Titles']
child.innerHTML = title child.innerHTML = title
else else
$.get string.org, cachedTest, (itemb) -> $.get string2, cachedTest, (itemb) ->
if cachedTest is itemb[string.orig] if cachedTest is itemb[string2]
child.innerHTML = title child.innerHTML = title
else else
$.set string, cachedTest $.set string, cachedTest
$.set string.orig, cachedTest $.set string2, cachedTest
$.on child, 'click keydown focus blur', (e) -> Banner.cb[e.type].call @ $.on child, 'click keydown focus blur', (e) -> Banner.cb[e.type].apply @, [e]