Move dialog positions into Config.
This commit is contained in:
parent
21a1c58c97
commit
eb7c48af0c
@ -1,11 +1,9 @@
|
|||||||
dialog = (id, position, properties) ->
|
dialog = (id, properties) ->
|
||||||
el = $.el 'div',
|
el = $.el 'div',
|
||||||
className: 'dialog'
|
className: 'dialog'
|
||||||
id: id
|
id: id
|
||||||
$.extend el, properties
|
$.extend el, properties
|
||||||
el.style.cssText = position
|
el.style.cssText = Conf["#{id}.position"]
|
||||||
$.get "#{id}.position", position, (item) ->
|
|
||||||
(el.style.cssText = item["#{id}.position"])
|
|
||||||
|
|
||||||
move = $ '.move', el
|
move = $ '.move', el
|
||||||
$.on move, 'touchstart mousedown', dragstart
|
$.on move, 'touchstart mousedown', dragstart
|
||||||
|
|||||||
@ -5,7 +5,7 @@ Embedding =
|
|||||||
@types[type.key] = type for type in @ordered_types
|
@types[type.key] = type for type in @ordered_types
|
||||||
|
|
||||||
if Conf['Embedding']
|
if Conf['Embedding']
|
||||||
@dialog = UI.dialog 'embedding', 'top: 50px; right: 0px;',
|
@dialog = UI.dialog 'embedding',
|
||||||
<%= readHTML('Embed.html') %>
|
<%= readHTML('Embed.html') %>
|
||||||
@media = $ '#media-embed', @dialog
|
@media = $ '#media-embed', @dialog
|
||||||
$.one d, '4chanXInitFinished', @ready
|
$.one d, '4chanXInitFinished', @ready
|
||||||
|
|||||||
@ -19,7 +19,7 @@ ThreadStats =
|
|||||||
Header.addShortcut 'stats', sc, 200
|
Header.addShortcut 'stats', sc, 200
|
||||||
|
|
||||||
else
|
else
|
||||||
@dialog = sc = UI.dialog 'thread-stats', 'bottom: 0px; right: 0px;',
|
@dialog = sc = UI.dialog 'thread-stats',
|
||||||
<%= html('<div class="move" title="${statsTitle}">&{statsHTML}</div>') %>
|
<%= html('<div class="move" title="${statsTitle}">&{statsHTML}</div>') %>
|
||||||
$.addClass doc, 'float'
|
$.addClass doc, 'float'
|
||||||
$.ready ->
|
$.ready ->
|
||||||
|
|||||||
@ -14,7 +14,7 @@ ThreadUpdater =
|
|||||||
$.extend sc, <%= html('<span id="update-status" class="empty"></span><span id="update-timer" class="empty" title="Update now"></span>') %>
|
$.extend sc, <%= html('<span id="update-status" class="empty"></span><span id="update-timer" class="empty" title="Update now"></span>') %>
|
||||||
Header.addShortcut 'updater', sc, 100
|
Header.addShortcut 'updater', sc, 100
|
||||||
else
|
else
|
||||||
@dialog = sc = UI.dialog 'updater', 'bottom: 0px; left: 0px;',
|
@dialog = sc = UI.dialog 'updater',
|
||||||
<%= html('<div class="move"></div><span id="update-status"></span><span id="update-timer" title="Update now"></span>') %>
|
<%= html('<div class="move"></div><span id="update-status"></span><span id="update-timer" title="Update now"></span>') %>
|
||||||
$.addClass doc, 'float'
|
$.addClass doc, 'float'
|
||||||
$.ready ->
|
$.ready ->
|
||||||
|
|||||||
@ -10,7 +10,7 @@ ThreadWatcher =
|
|||||||
className: 'fa fa-eye'
|
className: 'fa fa-eye'
|
||||||
|
|
||||||
@db = new DataBoard 'watchedThreads', @refresh, true
|
@db = new DataBoard 'watchedThreads', @refresh, true
|
||||||
@dialog = UI.dialog 'thread-watcher', 'top: 50px; left: 0px;', <%= readHTML('ThreadWatcher.html') %>
|
@dialog = UI.dialog 'thread-watcher', <%= readHTML('ThreadWatcher.html') %>
|
||||||
|
|
||||||
@status = $ '#watcher-status', @dialog
|
@status = $ '#watcher-status', @dialog
|
||||||
@list = @dialog.lastElementChild
|
@list = @dialog.lastElementChild
|
||||||
|
|||||||
@ -456,7 +456,7 @@ QR =
|
|||||||
|
|
||||||
dialog: ->
|
dialog: ->
|
||||||
QR.nodes = nodes =
|
QR.nodes = nodes =
|
||||||
el: dialog = UI.dialog 'qr', 'top: 50px; right: 0px;',
|
el: dialog = UI.dialog 'qr',
|
||||||
<%= readHTML('QuickReply.html') %>
|
<%= readHTML('QuickReply.html') %>
|
||||||
|
|
||||||
setNode = (name, query) ->
|
setNode = (name, query) ->
|
||||||
|
|||||||
@ -1053,3 +1053,10 @@ Config =
|
|||||||
'Max Replies': 1000
|
'Max Replies': 1000
|
||||||
|
|
||||||
'Autohiding Scrollbar': false
|
'Autohiding Scrollbar': false
|
||||||
|
|
||||||
|
position:
|
||||||
|
'embedding.position': 'top: 50px; right: 0px;'
|
||||||
|
'thread-stats.position': 'bottom: 0px; right: 0px;'
|
||||||
|
'updater.position': 'bottom: 0px; left: 0px;'
|
||||||
|
'thread-watcher.position': 'top: 50px; left: 0px;'
|
||||||
|
'qr.position': 'top: 50px; right: 0px;'
|
||||||
|
|||||||
@ -602,7 +602,6 @@ $.clear = (cb) ->
|
|||||||
# Also support case where GM_listValues is not defined.
|
# Also support case where GM_listValues is not defined.
|
||||||
$.delete Object.keys(Conf)
|
$.delete Object.keys(Conf)
|
||||||
$.delete ['previousversion', 'QR Size', 'captchas', 'QR.persona', 'hiddenPSA']
|
$.delete ['previousversion', 'QR Size', 'captchas', 'QR.persona', 'hiddenPSA']
|
||||||
$.delete ("#{id}.position" for id in ['embedding', 'updater', 'thread-stats', 'thread-watcher', 'qr'])
|
|
||||||
try
|
try
|
||||||
$.delete $.listValues().map (key) -> key.replace g.NAMESPACE, ''
|
$.delete $.listValues().map (key) -> key.replace g.NAMESPACE, ''
|
||||||
cb?()
|
cb?()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user