use ui.dialog
This commit is contained in:
parent
ba2e7b1515
commit
90426ea4d8
@ -207,13 +207,15 @@
|
|||||||
};
|
};
|
||||||
ui = {
|
ui = {
|
||||||
dialog: function(id, position, html) {
|
dialog: function(id, position, html) {
|
||||||
var el, saved;
|
var el, saved, _ref;
|
||||||
el = d.createElement('div');
|
el = d.createElement('div');
|
||||||
el.className = 'reply dialog';
|
el.className = 'reply dialog';
|
||||||
el.innerHTML = html;
|
el.innerHTML = html;
|
||||||
el.id = id;
|
el.id = id;
|
||||||
el.style.cssText = (saved = localStorage["" + NAMESPACE + id + ".position"]) ? saved : position;
|
el.style.cssText = (saved = localStorage["" + NAMESPACE + id + ".position"]) ? saved : position;
|
||||||
el.querySelector('div.move').addEventListener('mousedown', ui.dragstart, false);
|
if ((_ref = el.querySelector('div.move')) != null) {
|
||||||
|
_ref.addEventListener('mousedown', ui.dragstart, false);
|
||||||
|
}
|
||||||
return el;
|
return el;
|
||||||
},
|
},
|
||||||
dragstart: function(e) {
|
dragstart: function(e) {
|
||||||
@ -1219,10 +1221,7 @@
|
|||||||
},
|
},
|
||||||
dialog: function() {
|
dialog: function() {
|
||||||
var arr, back, checked, description, dialog, hiddenNum, hiddenThreads, input, key, li, obj, overlay, ta, time, ul, _i, _j, _len, _len2, _ref, _ref2, _ref3;
|
var arr, back, checked, description, dialog, hiddenNum, hiddenThreads, input, key, li, obj, overlay, ta, time, ul, _i, _j, _len, _len2, _ref, _ref2, _ref3;
|
||||||
dialog = $.el('div', {
|
dialog = ui.dialog('options', '', '\
|
||||||
id: 'options',
|
|
||||||
className: 'reply dialog',
|
|
||||||
innerHTML: '\
|
|
||||||
<div id=optionsbar>\
|
<div id=optionsbar>\
|
||||||
<div id=credits>\
|
<div id=credits>\
|
||||||
<a target=_blank href=http://aeosynth.github.com/4chan-x/>4chan X</a>\
|
<a target=_blank href=http://aeosynth.github.com/4chan-x/>4chan X</a>\
|
||||||
@ -1299,8 +1298,7 @@
|
|||||||
<tr><td>Reset the unread count to 0</td><td><input name=unreadCountTo0></td></tr>\
|
<tr><td>Reset the unread count to 0</td><td><input name=unreadCountTo0></td></tr>\
|
||||||
</tbody></table>\
|
</tbody></table>\
|
||||||
</div>\
|
</div>\
|
||||||
</div>'
|
</div>');
|
||||||
});
|
|
||||||
_ref = config.main;
|
_ref = config.main;
|
||||||
for (key in _ref) {
|
for (key in _ref) {
|
||||||
obj = _ref[key];
|
obj = _ref[key];
|
||||||
|
|||||||
@ -134,7 +134,7 @@ ui =
|
|||||||
el.innerHTML = html
|
el.innerHTML = html
|
||||||
el.id = id
|
el.id = id
|
||||||
el.style.cssText = if saved = localStorage["#{NAMESPACE}#{id}.position"] then saved else position
|
el.style.cssText = if saved = localStorage["#{NAMESPACE}#{id}.position"] then saved else position
|
||||||
el.querySelector('div.move').addEventListener 'mousedown', ui.dragstart, false
|
el.querySelector('div.move')?.addEventListener 'mousedown', ui.dragstart, false
|
||||||
el
|
el
|
||||||
dragstart: (e) ->
|
dragstart: (e) ->
|
||||||
#prevent text selection
|
#prevent text selection
|
||||||
@ -865,7 +865,7 @@ options =
|
|||||||
$.replace home, a
|
$.replace home, a
|
||||||
|
|
||||||
dialog: ->
|
dialog: ->
|
||||||
dialog = $.el 'div', id: 'options', className: 'reply dialog', innerHTML: '
|
dialog = ui.dialog 'options', '', '
|
||||||
<div id=optionsbar>
|
<div id=optionsbar>
|
||||||
<div id=credits>
|
<div id=credits>
|
||||||
<a target=_blank href=http://aeosynth.github.com/4chan-x/>4chan X</a>
|
<a target=_blank href=http://aeosynth.github.com/4chan-x/>4chan X</a>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user