10
CHANGELOG.md
@ -1,3 +1,13 @@
|
|||||||
|
### v1.3.6
|
||||||
|
*2014-02-13*
|
||||||
|
|
||||||
|
**Spittie**
|
||||||
|
- Upload images directly from urls
|
||||||
|

|
||||||
|
- Add gfycat.com embedding
|
||||||
|
- Replace some icons with fontawesome
|
||||||
|
- Add Metro favicons (lel)
|
||||||
|
|
||||||
### v1.3.5
|
### v1.3.5
|
||||||
*2014-02-10*
|
*2014-02-10*
|
||||||
|
|
||||||
|
|||||||
2
LICENSE
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* 4chan X - Version 1.3.5 - 2014-02-11
|
* 4chan X - Version 1.3.6 - 2014-02-13
|
||||||
*
|
*
|
||||||
* Licensed under the MIT license.
|
* Licensed under the MIT license.
|
||||||
* https://github.com/Spittie/4chan-x/blob/master/LICENSE
|
* https://github.com/Spittie/4chan-x/blob/master/LICENSE
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
// ==UserScript==
|
// ==UserScript==
|
||||||
// @name 4chan X
|
// @name 4chan X
|
||||||
// @version 1.3.5
|
// @version 1.3.6
|
||||||
// @minGMVer 1.13
|
// @minGMVer 1.13
|
||||||
// @minFFVer 26
|
// @minFFVer 26
|
||||||
// @namespace 4chan-X
|
// @namespace 4chan-X
|
||||||
@ -18,5 +18,5 @@
|
|||||||
// @run-at document-start
|
// @run-at document-start
|
||||||
// @updateURL https://github.com/Spittie/4chan-x/raw/stable/builds/4chan-X.meta.js
|
// @updateURL https://github.com/Spittie/4chan-x/raw/stable/builds/4chan-X.meta.js
|
||||||
// @downloadURL https://github.com/Spittie/4chan-x/raw/stable/builds/4chan-X.user.js
|
// @downloadURL https://github.com/Spittie/4chan-x/raw/stable/builds/4chan-X.user.js
|
||||||
// @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAACVBMVEUAAGcAAABmzDNZt9VtAAAAAXRSTlMAQObYZgAAAHFJREFUKFOt0LENACEIBdBv4Qju4wgWanEj3D6OcIVMKaitYHEU/jwTCQj8W75kiVCSBvdQ5/AvfVHBin11BgdRq3ysBgfwBDRrj3MCIA+oAQaku/Q1cNctrAmyDl577tOThYt/Y1RBM4DgOHzM0HFTAyLukH/cmRnqAAAAAElFTkSuQmCC
|
// @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAACVBMVEUAAGcAAABmzDNZt9VtAAAAAXRSTlMAQObYZgAAAF5JREFUeNrtkTESABAQxPD/R6tsE2dUGYUtFJvLDKf93KevHJAjpBorAQWSBIKqFASC4G0pCAkm4GfaEvgYXl0T6HBaE97f0vmnfYHbZOMLZCx9ISdKWwjOWZSC8GYm4SUGwfYgqI4AAAAASUVORK5CYII=
|
||||||
// ==/UserScript==
|
// ==/UserScript==
|
||||||
|
|||||||
BIN
builds/crx.crx
|
Before Width: | Height: | Size: 157 B After Width: | Height: | Size: 154 B |
|
Before Width: | Height: | Size: 204 B After Width: | Height: | Size: 185 B |
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "4chan X",
|
"name": "4chan X",
|
||||||
"version": "1.3.5",
|
"version": "1.3.6",
|
||||||
"manifest_version": 2,
|
"manifest_version": 2,
|
||||||
"description": "Cross-browser userscript for maximum lurking on 4chan.",
|
"description": "Cross-browser userscript for maximum lurking on 4chan.",
|
||||||
"icons": {
|
"icons": {
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
postMessage({version:'1.3.5'},'*')
|
postMessage({version:'1.3.6'},'*')
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "4chan-X",
|
"name": "4chan-X",
|
||||||
"version": "1.3.5",
|
"version": "1.3.6",
|
||||||
"description": "Cross-browser userscript for maximum lurking on 4chan.",
|
"description": "Cross-browser userscript for maximum lurking on 4chan.",
|
||||||
"meta": {
|
"meta": {
|
||||||
"name": "4chan X",
|
"name": "4chan X",
|
||||||
|
|||||||
@ -21,7 +21,6 @@
|
|||||||
<div id=dump-list-container>
|
<div id=dump-list-container>
|
||||||
<div id=dump-list></div>
|
<div id=dump-list></div>
|
||||||
<a id=add-post href=javascript:; title="Add a post" tabindex=50>+</a>
|
<a id=add-post href=javascript:; title="Add a post" tabindex=50>+</a>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div id=file-n-submit>
|
<div id=file-n-submit>
|
||||||
<span id=qr-filename-container class=field tabindex=60>
|
<span id=qr-filename-container class=field tabindex=60>
|
||||||
@ -42,4 +41,4 @@
|
|||||||
</form>
|
</form>
|
||||||
<datalist id="list-name"></datalist>
|
<datalist id="list-name"></datalist>
|
||||||
<datalist id="list-email"></datalist>
|
<datalist id="list-email"></datalist>
|
||||||
<datalist id="list-sub"></datalist>
|
<datalist id="list-sub"></datalist>
|
||||||
|
|||||||
BIN
src/General/img/changelog/1.1.18.png
Executable file → Normal file
|
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 26 KiB |
BIN
src/General/img/changelog/1.2.0.png
Executable file → Normal file
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 19 KiB |
BIN
src/General/img/changelog/1.3.6.gif
Normal file
|
After Width: | Height: | Size: 355 KiB |
BIN
src/General/img/emoji/SS-sage.png
Executable file → Normal file
|
Before Width: | Height: | Size: 576 B After Width: | Height: | Size: 565 B |
BIN
src/General/img/emoji/arch.png
Executable file → Normal file
|
Before Width: | Height: | Size: 567 B After Width: | Height: | Size: 563 B |
BIN
src/General/img/emoji/centos.png
Executable file → Normal file
|
Before Width: | Height: | Size: 858 B After Width: | Height: | Size: 845 B |
|
Before Width: | Height: | Size: 602 B After Width: | Height: | Size: 556 B |
BIN
src/General/img/emoji/fedora.png
Executable file → Normal file
|
Before Width: | Height: | Size: 631 B After Width: | Height: | Size: 627 B |
BIN
src/General/img/emoji/freebsd.png
Executable file → Normal file
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 919 B |
BIN
src/General/img/emoji/gentoo.png
Executable file → Normal file
|
Before Width: | Height: | Size: 882 B After Width: | Height: | Size: 879 B |
BIN
src/General/img/emoji/gnu.png
Executable file → Normal file
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 607 B |
BIN
src/General/img/emoji/madotsuki.png
Executable file → Normal file
|
Before Width: | Height: | Size: 231 B After Width: | Height: | Size: 230 B |
BIN
src/General/img/emoji/mint.png
Executable file → Normal file
|
Before Width: | Height: | Size: 1006 B After Width: | Height: | Size: 1004 B |
BIN
src/General/img/emoji/ponyo.png
Executable file → Normal file
|
Before Width: | Height: | Size: 884 B After Width: | Height: | Size: 883 B |
BIN
src/General/img/emoji/rabite.png
Executable file → Normal file
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.0 KiB |
BIN
src/General/img/emoji/sabayon.png
Executable file → Normal file
|
Before Width: | Height: | Size: 830 B After Width: | Height: | Size: 829 B |
BIN
src/General/img/emoji/trisquel.png
Executable file → Normal file
|
Before Width: | Height: | Size: 820 B After Width: | Height: | Size: 814 B |
BIN
src/General/img/emoji/ubuntu.png
Executable file → Normal file
|
Before Width: | Height: | Size: 625 B After Width: | Height: | Size: 624 B |
|
Before Width: | Height: | Size: 198 B After Width: | Height: | Size: 106 B |
|
Before Width: | Height: | Size: 198 B After Width: | Height: | Size: 106 B |
|
Before Width: | Height: | Size: 196 B After Width: | Height: | Size: 106 B |
|
Before Width: | Height: | Size: 276 B After Width: | Height: | Size: 171 B |
|
Before Width: | Height: | Size: 198 B After Width: | Height: | Size: 106 B |
|
Before Width: | Height: | Size: 293 B After Width: | Height: | Size: 171 B |
|
Before Width: | Height: | Size: 197 B After Width: | Height: | Size: 106 B |
|
Before Width: | Height: | Size: 284 B After Width: | Height: | Size: 171 B |
BIN
src/General/img/icon16.png
Executable file → Normal file
|
Before Width: | Height: | Size: 157 B After Width: | Height: | Size: 154 B |
BIN
src/General/img/icon48.png
Executable file → Normal file
|
Before Width: | Height: | Size: 204 B After Width: | Height: | Size: 185 B |
BIN
src/General/img/links/gfycat.png
Normal file
|
After Width: | Height: | Size: 324 B |
BIN
src/General/img/links/gist.png
Executable file → Normal file
|
Before Width: | Height: | Size: 683 B After Width: | Height: | Size: 667 B |
BIN
src/General/img/links/installgentoo.png
Executable file → Normal file
|
Before Width: | Height: | Size: 730 B After Width: | Height: | Size: 729 B |
BIN
src/General/img/links/liveleak.png
Executable file → Normal file
|
Before Width: | Height: | Size: 952 B After Width: | Height: | Size: 740 B |
BIN
src/General/img/links/pastebin.png
Executable file → Normal file
|
Before Width: | Height: | Size: 871 B After Width: | Height: | Size: 839 B |
BIN
src/General/img/links/vimeo.png
Executable file → Normal file
|
Before Width: | Height: | Size: 435 B After Width: | Height: | Size: 307 B |
@ -334,6 +334,12 @@ Linkify =
|
|||||||
div = $.el 'iframe',
|
div = $.el 'iframe',
|
||||||
src: "http://pastebin.com/embed_iframe.php?i=#{a.dataset.uid}"
|
src: "http://pastebin.com/embed_iframe.php?i=#{a.dataset.uid}"
|
||||||
|
|
||||||
|
gfycat:
|
||||||
|
regExp: /.*gfycat.com\/(?:iframe\/)?(\S*)/
|
||||||
|
el: (a) ->
|
||||||
|
div = $.el 'iframe',
|
||||||
|
src: "http://gfycat.com/iframe/#{a.dataset.uid}"
|
||||||
|
|
||||||
SoundCloud:
|
SoundCloud:
|
||||||
regExp: /.*(?:soundcloud.com\/|snd.sc\/)([^#\&\?]*).*/
|
regExp: /.*(?:soundcloud.com\/|snd.sc\/)([^#\&\?]*).*/
|
||||||
style: 'height: auto; width: 500px; display: inline-block;'
|
style: 'height: auto; width: 500px; display: inline-block;'
|
||||||
|
|||||||
@ -17,7 +17,7 @@ QR.captcha =
|
|||||||
placeholder: 'Focus to load reCAPTCHA'
|
placeholder: 'Focus to load reCAPTCHA'
|
||||||
autocomplete: 'off'
|
autocomplete: 'off'
|
||||||
spellcheck: false
|
spellcheck: false
|
||||||
tabIndex: 55
|
tabIndex: 45
|
||||||
@nodes =
|
@nodes =
|
||||||
img: imgContainer.firstChild
|
img: imgContainer.firstChild
|
||||||
input: input
|
input: input
|
||||||
|
|||||||
@ -267,49 +267,69 @@ QR =
|
|||||||
QR.open()
|
QR.open()
|
||||||
QR.handleFiles files
|
QR.handleFiles files
|
||||||
$.addClass QR.nodes.el, 'dump'
|
$.addClass QR.nodes.el, 'dump'
|
||||||
|
|
||||||
|
handleBlob: (blob) ->
|
||||||
|
return if blob.type is null
|
||||||
|
QR.error "Unsupported file type."
|
||||||
|
return unless blob.type in QR.mimeTypes
|
||||||
|
QR.error "Unsupported file type."
|
||||||
|
QR.handleFiles([blob])
|
||||||
|
|
||||||
handleUrl: ->
|
handleUrl: ->
|
||||||
<% if (type === 'crx') { %>
|
|
||||||
url = prompt("Insert an url:")
|
url = prompt("Insert an url:")
|
||||||
return if url == null
|
return if url is null
|
||||||
|
<% if (type === 'crx') { %>
|
||||||
xhr = new XMLHttpRequest();
|
xhr = new XMLHttpRequest();
|
||||||
xhr.open('GET', url, true)
|
xhr.open('GET', url, true)
|
||||||
xhr.responseType = 'blob'
|
xhr.responseType = 'blob'
|
||||||
|
|
||||||
xhr.onload = (e) ->
|
xhr.onload = (e) ->
|
||||||
if this.readyState == this.DONE && xhr.status == 200
|
if @readyState is @DONE && xhr.status is 200
|
||||||
urlBlob = new Blob([this.response], {type : this.getResponseHeader('content-type')})
|
urlBlob = new Blob([@response], {type : @getResponseHeader('content-type')})
|
||||||
console.log(urlBlob.type)
|
urlBlob.name = url.substr(url.lastIndexOf('/')+1, url.length)
|
||||||
return if urlBlob.type == null
|
QR.handleBlob(urlBlob)
|
||||||
unless urlBlob.type in QR.mimeTypes
|
|
||||||
QR.error "Unsupported file type."
|
|
||||||
QR.handleFiles([urlBlob])
|
|
||||||
return
|
return
|
||||||
else
|
else
|
||||||
QR.error "Can't load image."
|
QR.error "Can't load image."
|
||||||
return
|
return
|
||||||
|
|
||||||
xhr.onerror = (e) ->
|
xhr.onerror = (e) ->
|
||||||
QR.error "Can't load image."
|
QR.error "Can't load image."
|
||||||
return
|
return
|
||||||
|
|
||||||
xhr.send()
|
xhr.send()
|
||||||
return
|
return
|
||||||
<% } %>
|
<% } %>
|
||||||
<% if (type === 'currently-not-working-userscript') { %>
|
|
||||||
|
<% if (type === 'userscript') { %>
|
||||||
GM_xmlhttpRequest {
|
GM_xmlhttpRequest {
|
||||||
method: "GET",
|
method: "GET",
|
||||||
url: url,
|
url: url,
|
||||||
responseType: 'blob',
|
overrideMimeType: "text/plain; charset=x-user-defined",
|
||||||
onload: (xhr) ->
|
onload: (xhr) ->
|
||||||
urlBlob = new Blob([xhr.response], {type: 'image/png'})
|
r = xhr.responseText
|
||||||
QR.handleFiles([urlBlob])
|
data = new Uint8Array(r.length)
|
||||||
|
i = 0
|
||||||
|
while i < r.length
|
||||||
|
data[i] = r.charCodeAt(i)
|
||||||
|
i++
|
||||||
|
#QUALITY coding at work
|
||||||
|
header = xhr.responseHeaders
|
||||||
|
start = header.indexOf("Content-Type: ") + 14
|
||||||
|
end = header.substr(start, header.length).indexOf("\n") - 1
|
||||||
|
mime = header.substr(start, end)
|
||||||
|
return if mime is null
|
||||||
|
|
||||||
|
urlBlob = new Blob([data], {type: mime})
|
||||||
|
|
||||||
|
urlBlob.name = url.substr(url.lastIndexOf('/')+1, url.length)
|
||||||
|
QR.handleBlob(urlBlob)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
onerror: (xhr) ->
|
||||||
|
QR.error "Can't load image."
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
<% } %>
|
<% } %>
|
||||||
|
|
||||||
|
|
||||||
handleFiles: (files) ->
|
handleFiles: (files) ->
|
||||||
if @ isnt QR # file input
|
if @ isnt QR # file input
|
||||||
|
|||||||
@ -157,7 +157,7 @@ QR.post = class
|
|||||||
return
|
return
|
||||||
|
|
||||||
setFile: (@file) ->
|
setFile: (@file) ->
|
||||||
@filename = file.name || "File from url"
|
@filename = file.name
|
||||||
@filesize = $.bytesToString file.size
|
@filesize = $.bytesToString file.size
|
||||||
@nodes.label.hidden = false if QR.spoiler
|
@nodes.label.hidden = false if QR.spoiler
|
||||||
URL.revokeObjectURL @URL
|
URL.revokeObjectURL @URL
|
||||||
@ -262,4 +262,4 @@ QR.post = class
|
|||||||
(if oldIndex < newIndex then $.after else $.before) @, el
|
(if oldIndex < newIndex then $.after else $.before) @, el
|
||||||
post = QR.posts.splice(oldIndex, 1)[0]
|
post = QR.posts.splice(oldIndex, 1)[0]
|
||||||
QR.posts.splice newIndex, 0, post
|
QR.posts.splice newIndex, 0, post
|
||||||
QR.status()
|
QR.status()
|
||||||
|
|||||||