More optimizations + changelog

This commit is contained in:
seaweedchan 2013-08-16 02:24:24 -07:00
parent 15db317896
commit 109699d83a
5 changed files with 53 additions and 44 deletions

View File

@ -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*

View File

@ -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);
});
}
};

View File

@ -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);
});
}
};

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View File

@ -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
$.on child, 'click keydown focus blur', (e) -> Banner.cb[e.type].call @