This commit is contained in:
Jordan Bates 2013-05-27 06:13:40 -07:00
commit 4481b56851
9 changed files with 51 additions and 62 deletions

View File

@ -1,3 +1,12 @@
**MayhemYDG**:
- Add page count to thread stats
- Better performance for Fit Height by using vh
**seaweedchan**:
- Added OpenSettings event on 4chan X settings/sections open for userscripts like OneeChan and 4chan Style Script
- Changed defaults that use the arrow keys to shift+arrow key to not conflict with scrolling
- Made Mayhem's page count in thread stats optional
### v1.2.10 ### v1.2.10
*2013-05-25* *2013-05-25*

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

@ -117,11 +117,11 @@ Build =
if file?.isDeleted if file?.isDeleted
fileHtml = if isOP fileHtml = if isOP
"<div class=file id=f#{data.no}><div class=fileInfo></div><span class=fileThumb>" + "<div class=file id=f#{postID}><div class=fileInfo></div><span class=fileThumb>" +
"<img src='#{staticPath}filedeleted.gif' alt='File deleted.' class=fileDeletedRes>" + "<img src='#{staticPath}filedeleted.gif' alt='File deleted.' class=fileDeletedRes>" +
"</span></div>" "</span></div>"
else else
"<div class=file id=f#{data.no}><span class=fileThumb>" + "<div class=file id=f#{postID}><span class=fileThumb>" +
"<img src='#{staticPath}filedeleted-res.gif' alt='File deleted.' class=fileDeletedRes>" + "<img src='#{staticPath}filedeleted-res.gif' alt='File deleted.' class=fileDeletedRes>" +
"</span></div>" "</span></div>"
else if file else if file

View File

@ -612,6 +612,9 @@ a.hide-announcement {
clear: both; clear: both;
display: table; display: table;
} }
:root.fit-height .full-image {
max-height: 100vh;
}
:root.fit-width .full-image { :root.fit-width .full-image {
max-width: 100%; max-width: 100%;
} }

View File

@ -51,16 +51,20 @@ ImageExpand =
$.queueTask func, post $.queueTask func, post
return return
setFitness: -> setFitness: ->
{checked} = @ (if @checked then $.addClass else $.rmClass) doc, @name.toLowerCase().replace /\s+/g, '-'
(if checked then $.addClass else $.rmClass) doc, @name.toLowerCase().replace /\s+/g, '-' <% if (type === 'userjs') { %>
# XXX Opera doesn't support CSS vh.
return unless @name is 'Fit height' return unless @name is 'Fit height'
if checked if @checked
$.on window, 'resize', ImageExpand.resize $.on window, 'resize', ImageExpand.resize
unless ImageExpand.style unless ImageExpand.style
ImageExpand.style = $.addStyle null ImageExpand.style = $.addStyle null
ImageExpand.resize() ImageExpand.resize()
else else
$.off window, 'resize', ImageExpand.resize $.off window, 'resize', ImageExpand.resize
resize: ->
ImageExpand.style.textContent = ":root.fit-height .full-image {max-height:#{doc.clientHeight}px}"
<% } %>
toggle: (post) -> toggle: (post) ->
{thumb} = post.file {thumb} = post.file
@ -200,8 +204,5 @@ ImageExpand =
$.on input, 'change', $.cb.checked $.on input, 'change', $.cb.checked
el: label el: label
resize: ->
ImageExpand.style.textContent = ":root.fit-height .full-image {max-height:#{doc.clientHeight}px}"
menuToggle: (e) -> menuToggle: (e) ->
ImageExpand.opmenu.toggle e, @, g ImageExpand.opmenu.toggle e, @, g

View File

@ -31,6 +31,7 @@ ThreadStats =
postCount++ postCount++
fileCount++ if post.file fileCount++ if post.file
ThreadStats.thread = @ ThreadStats.thread = @
ThreadStats.fetchPage()
ThreadStats.update postCount, fileCount ThreadStats.update postCount, fileCount
$.on d, 'ThreadUpdate', ThreadStats.onUpdate $.on d, 'ThreadUpdate', ThreadStats.onUpdate

View File

@ -212,6 +212,8 @@ QR =
loadPersonas: (type, arr) -> loadPersonas: (type, arr) ->
list = $ "#list-#{type}", QR.nodes.el list = $ "#list-#{type}", QR.nodes.el
for val in arr for val in arr
# XXX Firefox displays empty <option>s in the completion list.
continue unless val
$.add list, $.el 'option', $.add list, $.el 'option',
textContent: val textContent: val
return return