Err, that might not have been the best way to do that. Flow fail.

This commit is contained in:
Zixaphir 2013-04-11 13:40:57 -07:00
parent 2689504662
commit bcd93c0475
2 changed files with 40 additions and 14 deletions

View File

@ -3747,11 +3747,23 @@
return e.stopPropagation();
},
focus: function() {
var items, string;
string = "" + g.BOARD + "." + this.className;
items = {
title: this.innerHTML
};
items["" + string] = '';
items["" + string + ".orig"] = false;
$.get(items, function(items) {
if (!(items["" + string + ".orig"] && items.title === items["" + string])) {
return $.set("" + string + ".orig", items.title);
}
});
return this.textContent = this.innerHTML;
},
blur: function() {
$.set("" + g.BOARD + "." + this.className, this.textContent);
$.set("" + g.BOARD + "." + child.className + ".orig", cachedTest);
this.innerHTML = this.textContent;
return this.contentEditable = false;
}
@ -3761,15 +3773,20 @@
cachedTest = child.innerHTML;
$.get("" + g.BOARD + "." + child.className, cachedTest, function(item) {
var title;
if (!(title = item["" + g.BOARD + "." + child.className])) {
return;
}
if (Conf['Persistent Custom Board Titles']) {
return child.innerHTML = item["" + g.BOARD + "." + child.className];
return child.innerHTML = title;
} else {
return $.get("" + g.BOARD + "." + child.className + ".orig", cachedTest, function(itemb) {
if (cachedTest === itemb["" + g.BOARD + "." + child.className + ".orig"]) {
return child.innerHTML = item["" + g.BOARD + "." + child.className];
return child.innerHTML = title;
} else {
$.set("" + g.BOARD + "." + child.className + ".orig", cachedTest);
return $.set("" + g.BOARD + "." + child.className, cachedTest);
$.set("" + g.BOARD + "." + child.className, cachedTest);
return $.set("" + g.BOARD + "." + child.className + ".orig", cachedTest);
}
});
}

View File

@ -200,7 +200,7 @@ Style =
icons = "data:image/png;base64,#{Icons[_conf["Icons"]]}"
css = """<%= grunt.file.read('css/theme.css') %>"""
<%= grunt.file.read('css/themeoptions.css') %>
iconPositions: ->
@ -492,32 +492,41 @@ Banner =
click: (e) ->
if e.shiftKey
@contentEditable = true
keydown: (e) ->
e.stopPropagation()
focus: ->
string = "#{g.BOARD}.#{@className}"
items =
title: @innerHTML
items["#{string}"] = ''
items["#{string}.orig"] = false
$.get items, (items) ->
unless items["#{string}.orig"] and items.title is items["#{string}"]
$.set "#{string}.orig", items.title
@textContent = @innerHTML
blur: ->
$.set "#{g.BOARD}.#{@className}", @textContent
$.set "#{g.BOARD}.#{child.className}.orig", cachedTest
@innerHTML = @textContent
@contentEditable = false
custom: (child) ->
cachedTest = child.innerHTML
$.get "#{g.BOARD}.#{child.className}", cachedTest, (item) ->
return unless title = item["#{g.BOARD}.#{child.className}"]
if Conf['Persistent Custom Board Titles']
child.innerHTML = item["#{g.BOARD}.#{child.className}"]
child.innerHTML = title
else
$.get "#{g.BOARD}.#{child.className}.orig", cachedTest, (itemb) ->
if cachedTest is itemb["#{g.BOARD}.#{child.className}.orig"]
child.innerHTML = item["#{g.BOARD}.#{child.className}"]
child.innerHTML = title
else
$.set "#{g.BOARD}.#{child.className}.orig", cachedTest
$.set "#{g.BOARD}.#{child.className}", cachedTest
$.set "#{g.BOARD}.#{child.className}.orig", cachedTest
$.on child, 'click', Banner.cb.click
$.on child, 'keydown', Banner.cb.keydown