Getting somewhere...

This commit is contained in:
Zixaphir 2013-05-03 10:43:14 -07:00
parent 46dcaf6467
commit 8b3dbc82fd
8 changed files with 48 additions and 87 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -9,10 +9,6 @@ Config =
false false
'Link to external catalog instead of the internal one.' 'Link to external catalog instead of the internal one.'
] ]
'QR Shortcut': [
false,
'Adds a small [QR] link in the header.'
]
'Announcement Hiding': [ 'Announcement Hiding': [
true true
'Add button to hide 4chan announcements.' 'Add button to hide 4chan announcements.'
@ -273,10 +269,6 @@ Config =
false false
'Remember the size of the quick reply\'s comment field.' 'Remember the size of the quick reply\'s comment field.'
] ]
'Hide Original Post Form': [
true
'Hide the normal post form.'
]
'Cooldown': [ 'Cooldown': [
true true
'Indicate the remaining time before posting again.' 'Indicate the remaining time before posting again.'
@ -667,10 +659,6 @@ Config =
true true
'Use compact inputs on the post form.' 'Use compact inputs on the post form.'
] ]
'Hide Show Post Form': [
false
'Hides the "Show Post Form" button when Persistent QR is disabled.'
]
'Show Post Form Header': [ 'Show Post Form Header': [
false false
'Force the Post Form to have a header.' 'Force the Post Form to have a header.'

View File

@ -1095,7 +1095,7 @@ input:checked + .rice {
"fixed": " "fixed": "
#qr { #qr {
top: auto !important; top: auto !important;
bottom: 1.7em !important; bottom: #{Style.pfOffset}em !important;
#{Style.sidebarLocation[0]}: 0 !important; #{Style.sidebarLocation[0]}: 0 !important;
#{Style.sidebarLocation[1]}: auto !important; #{Style.sidebarLocation[1]}: auto !important;
}" }"
@ -1107,7 +1107,7 @@ input:checked + .rice {
} }
#qr { #qr {
top: auto !important; top: auto !important;
bottom: 1.7em !important; bottom: #{Style.pfOffset}em !important;
#{Style.sidebarLocation[0]}: 0 !important; #{Style.sidebarLocation[0]}: 0 !important;
#{Style.sidebarLocation[1]}: auto !important; #{Style.sidebarLocation[1]}: auto !important;
#{agent}transform: translateX(#{xOffset}93%); #{agent}transform: translateX(#{xOffset}93%);
@ -1121,7 +1121,7 @@ input:checked + .rice {
"tabbed slideout": " "tabbed slideout": "
#qr { #qr {
top: auto !important; top: auto !important;
bottom: 1.7em !important; bottom: #{Style.pfOffset}em !important;
#{Style.sidebarLocation[0]}: 0 !important; #{Style.sidebarLocation[0]}: 0 !important;
#{Style.sidebarLocation[1]}: auto !important; #{Style.sidebarLocation[1]}: auto !important;
#{agent}transform: translateX(#{xOffset}100%); #{agent}transform: translateX(#{xOffset}100%);
@ -1159,7 +1159,7 @@ input:checked + .rice {
#qr { #qr {
overflow: visible; overflow: visible;
top: auto !important; top: auto !important;
bottom: 1.7em !important; bottom: #{Style.pfOffset}em !important;
#{Style.sidebarLocation[0]}: 2px !important; #{Style.sidebarLocation[0]}: 2px !important;
#{Style.sidebarLocation[1]}: auto !important; #{Style.sidebarLocation[1]}: auto !important;
opacity: 0.2; opacity: 0.2;

View File

@ -9,6 +9,7 @@ QR =
textContent: 'QR' textContent: 'QR'
title: 'Quick Reply' title: 'Quick Reply'
href: 'javascript:;' href: 'javascript:;'
$.on sc, 'click', -> $.on sc, 'click', ->
if !QR.nodes or QR.nodes.el.hidden if !QR.nodes or QR.nodes.el.hidden
$.event 'CloseMenu' $.event 'CloseMenu'
@ -20,9 +21,6 @@ QR =
Header.addShortcut sc Header.addShortcut sc
if Conf['Hide Original Post Form']
$.asap (-> doc), -> $.addClass doc, 'hide-original-post-form'
$.ready @initReady $.ready @initReady
$.on d, '4chanXInitFinished', @persist if Conf['Persistent QR'] $.on d, '4chanXInitFinished', @persist if Conf['Persistent QR']
@ -51,7 +49,6 @@ QR =
else else
QR.status() QR.status()
node: -> node: ->
$.on $('a[title="Quote this post"]', @nodes.info), 'click', QR.quote $.on $('a[title="Quote this post"]', @nodes.info), 'click', QR.quote

View File

@ -8,9 +8,9 @@ MascotTools =
return if el then el.src = "" else null return if el then el.src = "" else null
position = "#{if Conf['Mascot Position'] is 'bottom' or (Conf['Mascot Position'] is "default" and Conf['Post Form Style'] isnt "fixed") position = "#{if Conf['Mascot Position'] is 'bottom' or (Conf['Mascot Position'] is "default" and Conf['Post Form Style'] isnt "fixed")
0 + (if (g.VIEW isnt 'thread' or Conf['Bottom Header']) and Conf['4chan SS Navigation'] then 1.6 else 0) 0 + Style.pfOffset
else else
20.3 + (if g.VIEW isnt 'thread' or !!$ '#postForm input[name=spoiler]' then 1.4 else 0) + (if Conf['Show Post Form Header'] then 1.5 else 0) + (if Conf['Post Form Decorations'] then 0.2 else 0) 19.6 + (if g.VIEW isnt 'thread' or !!$ '#postForm input[name=spoiler]' then 1.4 else 0) + (if Conf['Show Post Form Header'] then 1.5 else 0) + (if Conf['Post Form Decorations'] then 0.2 else 0) + Style.pfOffset
}em" }em"
# If we're editting anything, let's not change mascots any time we change a value. # If we're editting anything, let's not change mascots any time we change a value.

View File

@ -13,6 +13,7 @@ Style =
prev = $ ".pagelist > .prev" prev = $ ".pagelist > .prev"
prevA = $.el 'a', prevA = $.el 'a',
textContent: '<' textContent: '<'
next = $ ".pagelist > .next" next = $ ".pagelist > .next"
nextA = $.el 'a', nextA = $.el 'a',
textContent: '>' textContent: '>'
@ -21,6 +22,7 @@ Style =
prevA.href = 'javascript:;' prevA.href = 'javascript:;'
$.on prevA, 'click', -> $.on prevA, 'click', ->
prevAction.firstElementChild.click() prevAction.firstElementChild.click()
if (nextAction = next.firstElementChild).nodeName is 'FORM' if (nextAction = next.firstElementChild).nodeName is 'FORM'
nextA.href = 'javascript:;' nextA.href = 'javascript:;'
$.on nextA, 'click', -> $.on nextA, 'click', ->
@ -33,7 +35,7 @@ Style =
return unless $.id 'navtopright' return unless $.id 'navtopright'
# Give ExLinks and 4sight a little time to append their dialog links # Give ExLinks and 4sight a little time to append their dialog links
setTimeout (-> setTimeout ->
Style.padding.nav = Header.bar Style.padding.nav = Header.bar
Style.padding.pages = $(".pagelist", d.body) Style.padding.pages = $(".pagelist", d.body)
Style.padding() Style.padding()
@ -42,7 +44,7 @@ Style =
if exLink = $ "#navtopright .exlinksOptionsLink", d.body if exLink = $ "#navtopright .exlinksOptionsLink", d.body
$.on exLink, "click", -> $.on exLink, "click", ->
setTimeout Rice.nodes, 100 setTimeout Rice.nodes, 100
), 500 , 500
agent: "<% if (type === 'crx') { %>-webkit-<% } else if (type === 'userscript') { %>-moz-<% } else { %>-o-<% } %>" agent: "<% if (type === 'crx') { %>-webkit-<% } else if (type === 'userscript') { %>-moz-<% } else { %>-o-<% } %>"
@ -114,12 +116,11 @@ Style =
nodes = d.head.children nodes = d.head.children
i = nodes.length i = nodes.length
while i-- while i--
break unless Style.headCount return unless Style.headCount
node = nodes[i] node = nodes[i]
if (node.nodeName is 'STYLE' and !node.id) or ("#{node.rel}".contains('stylesheet') and node.href[..3] isnt 'data') if (node.nodeName is 'STYLE' and !node.id) or ("#{node.rel}".contains('stylesheet') and node.href[..3] isnt 'data')
Style.headCount-- Style.headCount--
$.rm node $.rm node
continue
return return
filter: (text, background) -> filter: (text, background) ->
@ -148,6 +149,11 @@ Style =
_conf = Conf _conf = Conf
agent = Style.agent agent = Style.agent
xOffset = if _conf["Sidebar Location"] is "left" then '-' else '' xOffset = if _conf["Sidebar Location"] is "left" then '-' else ''
Style.pfOffset = if _conf['4chan SS Navigation'] and ((_conf['Bottom Header'] and _conf['Fixed Header']) or (g.VIEW is 'index' and _conf['Pagination'] is 'sticky bottom'))
1.5
else
0
# Position of submenus in relation to the post menu. # Position of submenus in relation to the post menu.
position = { position = {
@ -332,7 +338,7 @@ Style =
Style.padding.pages.property = _conf["Pagination"].split(" ") Style.padding.pages.property = _conf["Pagination"].split(" ")
Style.padding.pages.property = Style.padding.pages.property[Style.padding.pages.property.length - 1] Style.padding.pages.property = Style.padding.pages.property[Style.padding.pages.property.length - 1]
css = "body::before {\n" css = "body::before {\n"
if Style.padding.pages and ["sticky top", "top", "sticky bottom"].contains _conf["Pagination"] if _conf['4chan SS Navigation'] and Style.padding.pages and ["sticky top", "top", "sticky bottom"].contains _conf["Pagination"]
css += " #{Style.padding.pages.property}: #{Style.padding.pages.offsetHeight}px !important;\n" css += " #{Style.padding.pages.property}: #{Style.padding.pages.offsetHeight}px !important;\n"
if _conf['Fixed Header'] if _conf['Fixed Header']