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