Merge fixes from master

This commit is contained in:
Zixaphir 2013-04-08 15:53:08 -07:00
parent 46af845baa
commit 8a9753d3d7
8 changed files with 145 additions and 80 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,9 +1,9 @@
/* Updater + Stats */ /* Updater + Stats */
#updater, #updater,
#stats { #thread-stats {
#{align}: 2px !important; #{align}: #{if _conf["Updater Position"] is "bottom" and not _conf["Hide Delete UI"] then 23 else 2}px !important;
#{Style.sidebarLocation[1]}: auto !important; #{Style.sidebarLocation[1]}: auto !important;
top: auto !important; top: auto !important;
bottom: auto !important; bottom: auto !important;
#{if _conf["Updater Position"] is 'top' then "top: 1.6em !important" else "bottom: 0 !important"}; #{if _conf["Updater Position"] is 'top' then "top: 18px !important" else "bottom: 0 !important"};
} }

View File

@ -1,7 +1,7 @@
/* Updater + Stats */ /* Updater + Stats */
#updater, #updater,
#stats { #thread-stats {
#{align}: #{if _conf["Updater Position"] is "top" then "24" else "2"}px !important; #{align}: #{if _conf["Updater Position"] is "top" or not _conf["Hide Delete UI"] then 23 else 2}px !important;
#{Style.sidebarLocation[1]}: auto !important; #{Style.sidebarLocation[1]}: auto !important;
top: #{if _conf["Updater Position"] == "top" then "-1px" else "auto"} !important; top: #{if _conf["Updater Position"] == "top" then "-1px" else "auto"} !important;
bottom: #{if _conf["Updater Position"] == "bottom" then "-2px" else "auto"} !important; bottom: #{if _conf["Updater Position"] == "bottom" then "-2px" else "auto"} !important;

View File

@ -419,25 +419,25 @@ else "
position: fixed; position: fixed;
z-index: 10; z-index: 10;
padding: 0 1px 1px; padding: 0 1px 1px;
border: 1px solid transparent;
#{if _conf["Rounded Edges"] then "border-radius: 3px;" else ""} #{if _conf["Rounded Edges"] then "border-radius: 3px;" else ""}
} }
#updater:hover {
z-index: 30;
}
#updater:not(:hover) > div:not(.move) { #updater:not(:hover) > div:not(.move) {
display: none; display: none;
} }
#updater input { #updater input {
text-align: right; text-align: right;
} }
#updater .rice {
float: left;
}
#updater .field { #updater .field {
width: 50px; width: 50px;
} }
/* Stats */ /* Stats */
#stats { #thread-stats {
position: fixed; position: fixed;
#{if _conf["Rounded Edges"] then "border-radius: 3px;" else ""} #{if _conf["Rounded Edges"] then "border-radius: 3px;" else ""}
z-index: 10;
} }
/* Image Expansion */ /* Image Expansion */
#imgControls .menu-button { #imgControls .menu-button {
@ -573,7 +573,11 @@ hide: "
padding: 2px; padding: 2px;
#{if _conf["Rounded Edges"] then "border-radius: 3px;" else ""} #{if _conf["Rounded Edges"] then "border-radius: 3px;" else ""}
} }
#{ if _conf['Slideout Watcher'] then " #watcher > div {
max-height: 1.3em;
overflow: hidden;
}
#{if _conf['Slideout Watcher'] then "
#watcher { #watcher {
width: #{width}px; width: #{width}px;
#{Style.sidebarLocation[0]}: 2px !important; #{Style.sidebarLocation[0]}: 2px !important;
@ -585,7 +589,6 @@ hide: "
text-decoration: #{if _conf["Underline Links"] then "underline" else "none"}; text-decoration: #{if _conf["Underline Links"] then "underline" else "none"};
} }
#watcher > div { #watcher > div {
max-height: 1.6em;
overflow: hidden; overflow: hidden;
} }
#watcher:hover { #watcher:hover {
@ -600,13 +603,18 @@ hide: "
#watcher { #watcher {
width: 200px; width: 200px;
} }
#watcher:not(:hover) {
max-height: 200px;
overflow: hidden;
}
"} "}
/* Announcements */ /* Announcements */
#globalMessage { #globalMessage {
text-align: center; text-align: center;
#{if _conf["Rounded Edges"] then "border-radius: 3px;" else ""} #{if _conf["Rounded Edges"] then "border-radius: 3px;" else ""}
} }
#{if _conf['Announcements'] is 'slideout' then " #{{
'slideout': "
#globalMessage { #globalMessage {
position: fixed; position: fixed;
padding: 2px; padding: 2px;
@ -626,7 +634,12 @@ hide: "
overflow: hidden; overflow: hidden;
padding: 0; padding: 0;
border: 0 none; border: 0 none;
}" else ""} }"
'hide': "
#globalMessage {
display: none !important;
}
"}[_conf['Announcements']] or ""}
/* Threads */ /* Threads */
.thread { .thread {
margin: #{parseInt _conf["Top Thread Padding"], 10}px 0 #{parseInt _conf["Bottom Thread Padding"], 10}px 0; margin: #{parseInt _conf["Top Thread Padding"], 10}px 0 #{parseInt _conf["Bottom Thread Padding"], 10}px 0;
@ -711,9 +724,25 @@ hide: "
outline: none; outline: none;
} }
.reply.post { .reply.post {
display: inline-block;
#{Style.sizing}: border-box; #{Style.sizing}: border-box;
#{if _conf["Fit Width Replies"] then "width: 100%;" else ""} }
#{if _conf["Fit Width Replies"] then "
.reply.post {
display: block;
overflow: hidden;
}
.image_expanded .reply.post {
width: 100%;
}
" else "
.reply.post {
display: inline-block;
}
"}
.image_expanded .reply.post {
display: inline-block;
overflow: visible;
clear: both;
} }
.post { .post {
#{if _conf["Rounded Edges"] then "border-radius: 3px;" else ""} #{if _conf["Rounded Edges"] then "border-radius: 3px;" else ""}
@ -730,7 +759,7 @@ s {
clear: right; clear: right;
} }
#{if _conf['Force Reply Break'] or _conf["OP Background"] then " #{if _conf['Force Reply Break'] or _conf["OP Background"] then "
.op.post .postMessage { .op.post .postMessage::after {
display: block; display: block;
content: ' '; content: ' ';
clear: both; clear: both;
@ -747,7 +776,7 @@ s {
}" else ""} }" else ""}
/* Summary */ /* Summary */
#{ #{
if _conf["Fit Width Replies"] if _conf["Force Reply Break"]
".summary { clear: both; float: left; }" ".summary { clear: both; float: left; }"
else "" else ""
} }
@ -946,14 +975,18 @@ input:checked + .rice {
top: 0; top: 0;
} }
/* Select Dropdown */ /* Select Dropdown */
.selectrice ul { #selectrice {
padding: 0; padding: 0;
margin: 0;
position: fixed; position: fixed;
max-height: 120px; max-height: 120px;
overflow-y: auto; overflow-y: auto;
overflow-x: hidden; overflow-x: hidden;
z-index: 32; z-index: 32;
} }
#selectrice:empty {
display: none;
}
/* Post Form */ /* Post Form */
#qr { #qr {
z-index: 20; z-index: 20;
@ -1372,9 +1405,6 @@ a:only-of-type > .remove {
padding: 0; padding: 0;
#{if _conf["Rounded Edges"] then "border-radius: 3px;" else ""} #{if _conf["Rounded Edges"] then "border-radius: 3px;" else ""}
} }
#appchanx-settings .selectrice ul {
border-radius: 0;
}
.section-container { .section-container {
overflow: auto; overflow: auto;
position: absolute; position: absolute;
@ -1420,7 +1450,7 @@ a:only-of-type > .remove {
.rice_tab li:nth-of-type(2n+1), .rice_tab li:nth-of-type(2n+1),
.style_tab li:nth-of-type(2n+1), .style_tab li:nth-of-type(2n+1),
.keybinds_tab li:nth-of-type(2n+1), .keybinds_tab li:nth-of-type(2n+1),
.selectrice li:nth-of-type(2n+1) { #selectrice li:nth-of-type(2n+1) {
background-color: rgba(0, 0, 0, 0.05); background-color: rgba(0, 0, 0, 0.05);
} }
article li { article li {

View File

@ -68,8 +68,7 @@ html {
#prefetch, #prefetch,
#showQR, #showQR,
#{unless _conf["Post Form Decorations"] then '#spoilerLabel,' else ''} #{unless _conf["Post Form Decorations"] then '#spoilerLabel,' else ''}
#stats, #thread-stats {
#updater:not(:hover) .move {
text-shadow: text-shadow:
1px 1px 0 #{backgroundC}, 1px 1px 0 #{backgroundC},
-1px -1px 0 #{backgroundC}, -1px -1px 0 #{backgroundC},
@ -107,7 +106,7 @@ s:not(:hover) {
#appchanx-settings, #appchanx-settings,
#qrtab, #qrtab,
#{if _conf["Post Form Decorations"] then "#qr," else ""} #{if _conf["Post Form Decorations"] then "#qr," else ""}
#updater:hover, #updater,
input[type="submit"], input[type="submit"],
input[value="Report"], input[value="Report"],
span[style="left: 5px; position: absolute;"] a { span[style="left: 5px; position: absolute;"] a {
@ -134,9 +133,9 @@ textarea {
} }
#dump:hover, #dump:hover,
#qr-filename-container:hover, #qr-filename-container:hover,
#appchanx-settings .selectrice li:nth-of-type(2n+1):hover,
.selectrice:hover, .selectrice:hover,
.selectrice li:hover, #selectrice li:hover,
#selectrice li:nth-of-type(2n+1):hover,
input:hover, input:hover,
textarea:hover { textarea:hover {
background: #{theme["Hovered Input Background"]}; background: #{theme["Hovered Input Background"]};
@ -145,8 +144,8 @@ textarea:hover {
} }
#dump:active, #dump:active,
#dump:focus, #dump:focus,
#selectrice li:focus,
.selectrice:focus, .selectrice:focus,
.selectrice li:focus,
input:focus, input:focus,
textarea:focus, textarea:focus,
textarea.field:focus { textarea.field:focus {
@ -251,7 +250,7 @@ textarea {
} }
#exlinks-options-content > table, #exlinks-options-content > table,
#appchanx-settings ul, #appchanx-settings ul,
.selectrice ul { #selectrice {
border-bottom: 1px solid #{theme["Reply Border"]}; border-bottom: 1px solid #{theme["Reply Border"]};
box-shadow: inset #{theme["Shadow Color"]} 0 0 5px; box-shadow: inset #{theme["Shadow Color"]} 0 0 5px;
} }
@ -374,7 +373,7 @@ a .name {
border-color: #{if Style.lightTheme then "rgba(0,0,0,0.1)" else "rgba(255,255,255,0.1)"}; border-color: #{if Style.lightTheme then "rgba(0,0,0,0.1)" else "rgba(255,255,255,0.1)"};
} }
#appchanx-settings li, #appchanx-settings li,
.selectrice li:not(:first-of-type) { #selectrice li:not(:first-of-type) {
border-top: 1px solid #{if Style.lightTheme then "rgba(0,0,0,0.05)" else "rgba(255,255,255,0.025)"}; border-top: 1px solid #{if Style.lightTheme then "rgba(0,0,0,0.05)" else "rgba(255,255,255,0.025)"};
} }
#navtopright .exlinksOptionsLink::after, #navtopright .exlinksOptionsLink::after,

View File

@ -531,37 +531,43 @@ Rice =
selectclick: -> selectclick: ->
e.stopPropagation() e.stopPropagation()
if Rice.ul unless {ul} = Rice
return Rice.remSelect() Rice.ul = ul = $.el 'ul',
id: "selectrice"
$.add d.body, ul
if ul.children.length > 0
return Rice.rmOption()
rect = @getBoundingClientRect() rect = @getBoundingClientRect()
{clientHeight} = d.documentElement {clientHeight} = d.documentElement
ul = Rice.ul = $.el 'ul',
id: "selectrice"
{style} = ul {style} = ul
style.width = "#{rect.width}px"
if clientHeight - rect.bottom < 200 style.cssText = "width: #{rect.width}px; left: #{rect.left}px;" + (if clientHeight - rect.bottom < 200 then "bottom: #{clientHeight - rect.top}px" else "top: #{rect.bottom}px")
style.bottom = "#{clientHeight - rect.top}px" Rice.select = @previousSibling
else nodes = []
style.top = "#{rect.bottom}px"
style.left = "#{rect.left}px" for option in Rice.select.options
input = @previousSibling
for option in input.options
li = $.el 'li', li = $.el 'li',
textContent: option.textContent textContent: option.textContent
li.setAttribute 'data-value', option.value li.setAttribute 'data-value', option.value
$.on li, 'click', (e) -> $.on li, 'click', (e) ->
e.stopPropagation() e.stopPropagation()
container = @parentElement.parentElement select = Rice.select
input = container.previousSibling container = select.nextElementSibling
container.firstChild.textContent = @textContent container.firstChild.textContent = @textContent
input.value = @getAttribute 'data-value' input.value = @getAttribute 'data-value'
ev = document.createEvent 'HTMLEvents' ev = document.createEvent 'HTMLEvents'
ev.initEvent "change", true, true ev.initEvent "change", true, true
$.event input, ev $.event input, ev
Rice.remSelect() Rice.remSelect()
$.add ul, li nodes.push li
$.add ul, nodes
$.on ul, 'click scroll blur', (e) -> $.on ul, 'click scroll blur', (e) ->
e.stopPropagation() e.stopPropagation()
$.on d, 'click scroll blur resize', Rice.remSelect $.on d, 'click scroll blur resize', Rice.remSelect
$.add @, ul $.add @, ul

View File

@ -3864,8 +3864,13 @@ Favicon =
ThreadStats = ThreadStats =
init: -> init: ->
return if g.VIEW isnt 'thread' or !Conf['Thread Stats'] return if g.VIEW isnt 'thread' or !Conf['Thread Stats']
@dialog = UI.dialog 'thread-stats', 'bottom: 0; left: 0;', """ html = '<span id=post-count>0</span> / <span id=file-count>0</span>'
<div class=move><span id=post-count>0</span> / <span id=file-count>0</span></div> if Conf['Thread Updater']
@dialog = $.el 'span',
innerHTML: "[ #{html} ]"
else
@dialog = UI.dialog 'thread-stats', 'bottom: 0; left: 0;', """
<div class=move>#{html}</div>
""" """
@postCountEl = $ '#post-count', @dialog @postCountEl = $ '#post-count', @dialog
@ -3883,11 +3888,17 @@ ThreadStats =
ThreadStats.thread = @ ThreadStats.thread = @
ThreadStats.update postCount, fileCount ThreadStats.update postCount, fileCount
$.on d, 'ThreadUpdate', ThreadStats.onUpdate $.on d, 'ThreadUpdate', ThreadStats.onUpdate
$.add d.body, ThreadStats.dialog if Conf['Thread Updater']
$.asap (-> $('.move', ThreadUpdater.dialog)), ->
$.prepend $('.move', ThreadUpdater.dialog), ThreadStats.dialog
else
$.add d.body, ThreadStats.dialog
onUpdate: (e) -> onUpdate: (e) ->
return if e.detail[404] return if e.detail[404]
{postCount, fileCount} = e.detail {postCount, fileCount} = e.detail
ThreadStats.update postCount, fileCount ThreadStats.update postCount, fileCount
update: (postCount, fileCount) -> update: (postCount, fileCount) ->
{thread, postCountEl, fileCountEl} = ThreadStats {thread, postCountEl, fileCountEl} = ThreadStats
postCountEl.textContent = postCount postCountEl.textContent = postCount
@ -3911,7 +3922,7 @@ ThreadUpdater =
<div><label title='Controls whether *this* thread automatically updates or not'><input type=checkbox name='Auto Update This' #{checked}> Auto Update This</label></div> <div><label title='Controls whether *this* thread automatically updates or not'><input type=checkbox name='Auto Update This' #{checked}> Auto Update This</label></div>
<div><label><input type=number name=Interval class=field min=5 value=#{Conf['Interval']}> Refresh rate (s)</label></div> <div><label><input type=number name=Interval class=field min=5 value=#{Conf['Interval']}> Refresh rate (s)</label></div>
<div><input value='Update' type=button name='Update'></div> <div><input value='Update' type=button name='Update'></div>
""" """
@dialog = UI.dialog 'updater', 'bottom: 0; right: 0;', html @dialog = UI.dialog 'updater', 'bottom: 0; right: 0;', html
@timer = $ '#update-timer', @dialog @timer = $ '#update-timer', @dialog

View File

@ -413,8 +413,8 @@ Main =
'Thread Excerpt': ThreadExcerpt 'Thread Excerpt': ThreadExcerpt
'Favicon': Favicon 'Favicon': Favicon
'Unread': Unread 'Unread': Unread
'Thread Stats': ThreadStats
'Thread Updater': ThreadUpdater 'Thread Updater': ThreadUpdater
'Thread Stats': ThreadStats
'Thread Watcher': ThreadWatcher 'Thread Watcher': ThreadWatcher
'Index Navigation': Nav 'Index Navigation': Nav
'Keybinds': Keybinds 'Keybinds': Keybinds