diff --git a/CHANGELOG.md b/CHANGELOG.md index c0e172ac4..90f272c15 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,14 @@ +**seaweedchan**: + +![Board title editing in action](src/General/img/changelog/1.2.31.png) + +- Ported `Custom Board Titles` feature from Appchan X (with Zixaphir) + - This allows you to edit the board title and subtitle in real-time by ctrl+clicking them +- Ported ability to change to a new random banner image on click from Appchan X + +**Zixaphir**: +- Small linkifier fix + ### v1.2.30 *2013-08-15* diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 095817bcb..e532bda45 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -8517,11 +8517,11 @@ items = { title: this.innerHTML }; - items["" + string] = ''; - items["" + string + ".orig"] = false; + items[string] = ''; + items[string.orig] = false; $.get(items, function(items) { - if (!(items["" + string + ".orig"] && items.title === items["" + string])) { - return $.set("" + string + ".orig", items.title); + if (!(items[string.orig] && items.title === items[string])) { + return $.set(string.orig, items.title); } }); return this.textContent = this.innerHTML; @@ -8533,30 +8533,30 @@ } }, custom: function(child) { - var cachedTest; + var cachedTest, string; cachedTest = child.innerHTML; - $.get("" + g.BOARD + "." + child.className, cachedTest, function(item) { + string = "" + g.BOARD + "." + child.className; + $.get(string, cachedTest, function(item) { var title; - if (!(title = item["" + g.BOARD + "." + child.className])) { + if (!(title = item[string])) { return; } if (Conf['Persistent Custom Board Titles']) { return child.innerHTML = title; } else { - return $.get("" + g.BOARD + "." + child.className + ".orig", cachedTest, function(itemb) { - if (cachedTest === itemb["" + g.BOARD + "." + child.className + ".orig"]) { + return $.get(string.org, cachedTest, function(itemb) { + if (cachedTest === itemb[string.orig]) { return child.innerHTML = title; } else { - $.set("" + g.BOARD + "." + child.className, cachedTest); - return $.set("" + g.BOARD + "." + child.className + ".orig", cachedTest); + $.set(string, cachedTest); + return $.set(string.orig, cachedTest); } }); } }); - $.on(child, 'click', Banner.cb.click); - $.on(child, 'keydown', Banner.cb.keydown); - $.on(child, 'focus', Banner.cb.focus); - return $.on(child, 'blur', Banner.cb.blur); + return $.on(child, 'click keydown focus blur', function(e) { + return Banner.cb[e.type].call(this); + }); } }; diff --git a/builds/crx/script.js b/builds/crx/script.js index 58f7801f9..291539ac9 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -8507,11 +8507,11 @@ items = { title: this.innerHTML }; - items["" + string] = ''; - items["" + string + ".orig"] = false; + items[string] = ''; + items[string.orig] = false; $.get(items, function(items) { - if (!(items["" + string + ".orig"] && items.title === items["" + string])) { - return $.set("" + string + ".orig", items.title); + if (!(items[string.orig] && items.title === items[string])) { + return $.set(string.orig, items.title); } }); return this.textContent = this.innerHTML; @@ -8523,30 +8523,30 @@ } }, custom: function(child) { - var cachedTest; + var cachedTest, string; cachedTest = child.innerHTML; - $.get("" + g.BOARD + "." + child.className, cachedTest, function(item) { + string = "" + g.BOARD + "." + child.className; + $.get(string, cachedTest, function(item) { var title; - if (!(title = item["" + g.BOARD + "." + child.className])) { + if (!(title = item[string])) { return; } if (Conf['Persistent Custom Board Titles']) { return child.innerHTML = title; } else { - return $.get("" + g.BOARD + "." + child.className + ".orig", cachedTest, function(itemb) { - if (cachedTest === itemb["" + g.BOARD + "." + child.className + ".orig"]) { + return $.get(string.org, cachedTest, function(itemb) { + if (cachedTest === itemb[string.orig]) { return child.innerHTML = title; } else { - $.set("" + g.BOARD + "." + child.className, cachedTest); - return $.set("" + g.BOARD + "." + child.className + ".orig", cachedTest); + $.set(string, cachedTest); + return $.set(string.orig, cachedTest); } }); } }); - $.on(child, 'click', Banner.cb.click); - $.on(child, 'keydown', Banner.cb.keydown); - $.on(child, 'focus', Banner.cb.focus); - return $.on(child, 'blur', Banner.cb.blur); + return $.on(child, 'click keydown focus blur', function(e) { + return Banner.cb[e.type].call(this); + }); } }; diff --git a/src/General/img/changelog/1.2.31.png b/src/General/img/changelog/1.2.31.png new file mode 100644 index 000000000..57ae022b9 Binary files /dev/null and b/src/General/img/changelog/1.2.31.png differ diff --git a/src/Miscellaneous/Banner.coffee b/src/Miscellaneous/Banner.coffee index f0aba0b46..4cd5fcc0b 100644 --- a/src/Miscellaneous/Banner.coffee +++ b/src/Miscellaneous/Banner.coffee @@ -49,12 +49,12 @@ Banner = string = "#{g.BOARD}.#{@className}" items = title: @innerHTML - items["#{string}"] = '' - items["#{string}.orig"] = false + items[string] = '' + items[string.orig] = false $.get items, (items) -> - unless items["#{string}.orig"] and items.title is items["#{string}"] - $.set "#{string}.orig", items.title + unless items[string.orig] and items.title is items[string] + $.set string.orig, items.title @textContent = @innerHTML blur: -> @@ -64,20 +64,18 @@ Banner = custom: (child) -> cachedTest = child.innerHTML + string = "#{g.BOARD}.#{child.className}" - $.get "#{g.BOARD}.#{child.className}", cachedTest, (item) -> - return unless title = item["#{g.BOARD}.#{child.className}"] + $.get string, cachedTest, (item) -> + return unless title = item[string] if Conf['Persistent Custom Board Titles'] child.innerHTML = title else - $.get "#{g.BOARD}.#{child.className}.orig", cachedTest, (itemb) -> - if cachedTest is itemb["#{g.BOARD}.#{child.className}.orig"] + $.get string.org, cachedTest, (itemb) -> + if cachedTest is itemb[string.orig] child.innerHTML = title else - $.set "#{g.BOARD}.#{child.className}", cachedTest - $.set "#{g.BOARD}.#{child.className}.orig", cachedTest + $.set string, cachedTest + $.set string.orig, cachedTest - $.on child, 'click', Banner.cb.click - $.on child, 'keydown', Banner.cb.keydown - $.on child, 'focus', Banner.cb.focus - $.on child, 'blur', Banner.cb.blur \ No newline at end of file + $.on child, 'click keydown focus blur', (e) -> Banner.cb[e.type].call @ \ No newline at end of file