Merge branch 'page1' into newnames

This commit is contained in:
ccd0 2014-04-13 01:38:24 -07:00
commit c5b06f6988
19 changed files with 544 additions and 473 deletions

View File

@ -1,3 +1,10 @@
### v1.7.9
*2014-04-13*
**ccd0**
- Bugfixes in JSON navigation and embedding.
- More work toward compatibility with new URLs.
### v1.7.8
*2014-04-12*

View File

@ -1,5 +1,5 @@
/*
* 4chan X - Version 1.7.8 - 2014-04-12
* 4chan X - Version 1.7.9 - 2014-04-13
*
* Licensed under the MIT license.
* https://github.com/ccd0/4chan-x/blob/master/LICENSE

View File

@ -1,6 +1,6 @@
// ==UserScript==
// @name 4chan X
// @version 1.7.8
// @version 1.7.9
// @minGMVer 1.14
// @minFFVer 26
// @namespace 4chan-X

File diff suppressed because one or more lines are too long

Binary file not shown.

View File

@ -1,6 +1,6 @@
{
"name": "4chan X",
"version": "1.7.8",
"version": "1.7.9",
"manifest_version": 2,
"description": "Cross-browser userscript for maximum lurking on 4chan.",
"icons": {

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?>
<gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'>
<app appid='lacclbnghgdicfifcamcmcnilckjamag'>
<updatecheck codebase='https://ccd0.github.io/4chan-x/builds/crx.crx' version='1.7.8' />
<updatecheck codebase='https://ccd0.github.io/4chan-x/builds/crx.crx' version='1.7.9' />
</app>
</gupdate>

View File

@ -1,6 +1,6 @@
{
"name": "4chan-X",
"version": "1.7.8",
"version": "1.7.9",
"description": "Cross-browser userscript for maximum lurking on 4chan.",
"meta": {
"name": "4chan X",

View File

@ -39,7 +39,6 @@ Navigate =
QuoteBacklink.containers = {}
$.rmAll $('.board')
Index.pagelist.hidden = true
features: [
['Thread Excerpt', ThreadExcerpt]

View File

@ -26,14 +26,12 @@
@font-face{font-family:FontAwesome;src:url('data:application/font-woff;base64,<%= grunt.file.read('node_modules/font-awesome/fonts/fontawesome-webfont.woff', {encoding: 'base64'}) %>') format('woff');font-weight:400;font-style:normal}.fa::before{font-family:FontAwesome;font-weight:400;font-style:normal;-webkit-font-smoothing:antialiased;*margin-right:.3em;text-decoration:inherit;display:none;speak:none}
:root.shortcut-icons .fa::before,
.menu-button .fa::before,
.hide-reply-button .fa::before,
.hide-thread-button .fa::before {display:inline-block;font-size:13px;visibility:visible}
.fa::before {display:inline-block;font-size:13px;visibility:visible}
:root:not(.shortcut-icons) #shortcuts .fa::before {display:none}
:root.shortcut-icons #shortcuts .fa::before{font-size:15px!important;margin-top:-3px!important;position:relative;top:1px}
:root.shortcut-icons .fa, .menu-button .fa{font-size:0;visibility:hidden}
:root.shortcut-icons #shortcuts .fa, .menu-button .fa{font-size:0;visibility:hidden}
:root.shortcut-icons .shortcut.brackets-wrap::after,:root.shortcut-icons .shortcut.brackets-wrap::before{display:none}
:root.shortcut-icons a .fa,
:root.shortcut-icons #shortcuts a .fa,
.menu-button .fa,
.hide-reply-button .fa,
.hide-thread-button .fa {display:inline}

View File

@ -480,7 +480,8 @@ div.center:not(.ad-cnt) {
/* Index */
:root.index-loading .navLinks,
:root.index-loading .board,
:root.index-loading .pagelist {
:root.index-loading .pagelist,
:root.thread .pagelist {
display: none;
}
#index-search {

View File

@ -197,7 +197,7 @@ Gallery =
if src[2] is 'i.4cdn.org'
URL = Redirect.to 'file',
boardID: src[3]
filename: src[5]
filename: src[src.length - 1]
if URL
thumb.href = URL
return unless Gallery.nodes.current is img
@ -206,8 +206,8 @@ Gallery =
if g.DEAD or post.isDead or post.file.isDead
return
# XXX CORS for images.4chan.org WHEN?
$.ajax "//api.4chan.org/#{post.board}/res/#{post.thread}.json", onload: ->
# XXX CORS for i.4cdn.org WHEN?
$.ajax "//a.4cdn.org/#{post.board}/res/#{post.thread}.json", onload: ->
return if @status isnt 200
i = 0
{posts} = @response

View File

@ -206,7 +206,7 @@ ImageExpand =
if src[2] is 'i.4cdn.org'
URL = Redirect.to 'file',
boardID: src[3]
filename: src[5]
filename: src[src.length - 1]
if URL
setTimeout ImageExpand.expand, 10000, post, URL
return

View File

@ -52,7 +52,7 @@ ImageHover =
if src[2] is 'i.4cdn.org'
URL = Redirect.to 'file',
boardID: src[3]
filename: src[5].replace /\?.+$/, ''
filename: src[src.length - 1].replace /\?.+$/, ''
if URL
@src = URL
return

View File

@ -222,8 +222,8 @@ Linkify =
el = (type = Linkify.types[a.dataset.key]).el a
# Set style values.
el.style.cssText = if style = type.style
style
el.style.cssText = if type.style?
type.style
else
"border: 0; width: 640px; height: 390px"
@ -261,9 +261,10 @@ Linkify =
ordered_types: [
key: 'audio'
regExp: /(.*\.(mp3|ogg|wav))$/
style: ''
el: (a) ->
$.el 'audio',
controls: 'controls'
controls: true
preload: 'auto'
src: a.dataset.uid
,
@ -403,10 +404,12 @@ Linkify =
,
key: 'Vocaroo'
regExp: /.*(?:vocaroo.com\/)([^#\&\?]*).*/
style: 'border: 0; width: 150px; height: 45px;'
style: ''
el: (a) ->
$.el 'object',
innerHTML: "<embed src='http://vocaroo.com/player.swf?playMediaID=#{a.dataset.uid.replace /^i\//, ''}&autoplay=0' wmode='opaque' width='150' height='45' pluginspage='http://get.adobe.com/flashplayer/' type='application/x-shockwave-flash'></embed>"
$.el 'audio',
controls: true
preload: 'auto'
src: "http://vocaroo.com/media_command.php?media=#{a.dataset.uid.replace /^i\//, ''}&command=download_ogg"
,
key: 'Vimeo'
regExp: /.*(?:vimeo.com\/)([^#\&\?]*).*/
@ -446,6 +449,7 @@ Linkify =
,
key: 'video'
regExp: /(.*\.(ogv|webm|mp4))$/
style: 'border: 0; width: auto; height: auto;'
el: (a) ->
$.el 'video',
controls: 'controls'

View File

@ -35,7 +35,7 @@ Banner =
->
type = Object.keys(types)[Math.floor 3 * Math.random()]
num = Math.floor types[type] * Math.random()
@src = "//static.4chan.org/image/title/#{num}.#{type}"
@src = "//s.4cdn.org/image/title/#{num}.#{type}"
click: (e) ->
if e.ctrlKey
@ -86,4 +86,4 @@ Banner =
$.set string, cachedTest
$.set string2, cachedTest
child
child

View File

@ -23,7 +23,7 @@ ExpandComment =
return
return unless a = $ '.abbr > a', post.nodes.comment
a.textContent = "Post No.#{post} Loading..."
$.cache "//api.4chan.org#{a.pathname}.json", -> ExpandComment.parse @, a, post
$.cache "//a.4cdn.org#{a.pathname}.json", -> ExpandComment.parse @, a, post
contract: (post) ->
return unless post.nodes.shortComment
a = $ '.abbr > a', post.nodes.shortComment

View File

@ -22,7 +22,7 @@ InfiniScroll =
new Notice 'info', "Fetching next page.", 2
InfiniScroll.isFetching = true
url = "//api.4chan.org/#{g.BOARD}/catalog.json"
url = "//a.4cdn.org/#{g.BOARD}/catalog.json"
$.ajax url, onloadend: InfiniScroll.cb.load,
whenModified: true