Start working on remote upload (Chrome-only so far)
This commit is contained in:
parent
d22dceea5a
commit
f0bd6b1b04
2
LICENSE
2
LICENSE
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* 4chan X - Version 1.3.5 - 2014-02-10
|
* 4chan X - Version 1.3.5 - 2014-02-11
|
||||||
*
|
*
|
||||||
* 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
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
BIN
builds/crx.crx
BIN
builds/crx.crx
Binary file not shown.
@ -17,6 +17,8 @@
|
|||||||
"homepage_url": "http://seaweedchan.github.io/4chan-x/",
|
"homepage_url": "http://seaweedchan.github.io/4chan-x/",
|
||||||
"minimum_chrome_version": "31",
|
"minimum_chrome_version": "31",
|
||||||
"permissions": [
|
"permissions": [
|
||||||
"storage"
|
"storage",
|
||||||
|
"http://*/",
|
||||||
|
"https://*/"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@ -783,6 +783,7 @@ span.hide-announcement {
|
|||||||
}
|
}
|
||||||
#qr select,
|
#qr select,
|
||||||
#dump-button,
|
#dump-button,
|
||||||
|
#url-button,
|
||||||
.remove,
|
.remove,
|
||||||
.captcha-img {
|
.captcha-img {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
@ -837,6 +838,14 @@ span.hide-announcement {
|
|||||||
padding: 1px 0px 2px;
|
padding: 1px 0px 2px;
|
||||||
opacity: 0.6;
|
opacity: 0.6;
|
||||||
}
|
}
|
||||||
|
#url-button {
|
||||||
|
width: 10%;
|
||||||
|
margin: 0;
|
||||||
|
margin-right: 4px;
|
||||||
|
font: 13px sans-serif;
|
||||||
|
padding: 1px 0px 2px;
|
||||||
|
opacity: 0.6;
|
||||||
|
}
|
||||||
.persona .field:not(#dump) {
|
.persona .field:not(#dump) {
|
||||||
width: 95px;
|
width: 95px;
|
||||||
min-width: 33.3%;
|
min-width: 33.3%;
|
||||||
|
|||||||
@ -28,6 +28,7 @@
|
|||||||
<input id="qr-filename" data-name="filename" spellcheck="false">
|
<input id="qr-filename" data-name="filename" spellcheck="false">
|
||||||
<span id=qr-extras-container>
|
<span id=qr-extras-container>
|
||||||
<a id=qr-filerm href=javascript:; title='Remove file'>×</a>
|
<a id=qr-filerm href=javascript:; title='Remove file'>×</a>
|
||||||
|
<a id=url-button title='Post from url'>!</a>
|
||||||
<a id=dump-button title='Dump list'>+</a>
|
<a id=dump-button title='Dump list'>+</a>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@ -17,6 +17,8 @@
|
|||||||
"homepage_url": "<%= meta.page %>",
|
"homepage_url": "<%= meta.page %>",
|
||||||
"minimum_chrome_version": "<%= meta.min.chrome %>",
|
"minimum_chrome_version": "<%= meta.min.chrome %>",
|
||||||
"permissions": [
|
"permissions": [
|
||||||
"storage"
|
"storage",
|
||||||
|
"http://*/",
|
||||||
|
"https://*/"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -111,7 +111,7 @@ QR.captcha =
|
|||||||
@clear()
|
@clear()
|
||||||
|
|
||||||
count: ->
|
count: ->
|
||||||
count = @captchas.length
|
count = if @captchas then @captchas.length else 0
|
||||||
@nodes.input.placeholder = switch count
|
@nodes.input.placeholder = switch count
|
||||||
when 0
|
when 0
|
||||||
'Verification (Shift + Enter to cache)'
|
'Verification (Shift + Enter to cache)'
|
||||||
|
|||||||
@ -268,6 +268,26 @@ QR =
|
|||||||
QR.handleFiles files
|
QR.handleFiles files
|
||||||
$.addClass QR.nodes.el, 'dump'
|
$.addClass QR.nodes.el, 'dump'
|
||||||
|
|
||||||
|
handleUrl: ->
|
||||||
|
url = prompt("insert url")
|
||||||
|
xhr = new XMLHttpRequest();
|
||||||
|
xhr.open('GET', url, true)
|
||||||
|
xhr.responseType = 'blob'
|
||||||
|
|
||||||
|
xhr.onload = (e) ->
|
||||||
|
if this.readyState == this.DONE && xhr.status == 200
|
||||||
|
urlBlob = new Blob([this.response], {type: 'image/jpeg'})
|
||||||
|
QR.handleFiles([urlBlob])
|
||||||
|
null
|
||||||
|
|
||||||
|
xhr.onerror = (e) ->
|
||||||
|
console.log("error" + e)
|
||||||
|
null
|
||||||
|
|
||||||
|
xhr.send()
|
||||||
|
null
|
||||||
|
|
||||||
|
|
||||||
handleFiles: (files) ->
|
handleFiles: (files) ->
|
||||||
if @ isnt QR # file input
|
if @ isnt QR # file input
|
||||||
files = [@files...]
|
files = [@files...]
|
||||||
@ -343,6 +363,7 @@ QR =
|
|||||||
close: '.close'
|
close: '.close'
|
||||||
form: 'form'
|
form: 'form'
|
||||||
dumpButton: '#dump-button'
|
dumpButton: '#dump-button'
|
||||||
|
urlButton: '#url-button'
|
||||||
name: '[data-name=name]'
|
name: '[data-name=name]'
|
||||||
email: '[data-name=email]'
|
email: '[data-name=email]'
|
||||||
sub: '[data-name=sub]'
|
sub: '[data-name=sub]'
|
||||||
@ -412,6 +433,7 @@ QR =
|
|||||||
$.on nodes.autohide, 'change', QR.toggleHide
|
$.on nodes.autohide, 'change', QR.toggleHide
|
||||||
$.on nodes.close, 'click', QR.close
|
$.on nodes.close, 'click', QR.close
|
||||||
$.on nodes.dumpButton, 'click', -> nodes.el.classList.toggle 'dump'
|
$.on nodes.dumpButton, 'click', -> nodes.el.classList.toggle 'dump'
|
||||||
|
$.on nodes.urlButton, 'click', QR.handleUrl
|
||||||
$.on nodes.addPost, 'click', -> new QR.post true
|
$.on nodes.addPost, 'click', -> new QR.post true
|
||||||
$.on nodes.form, 'submit', QR.submit
|
$.on nodes.form, 'submit', QR.submit
|
||||||
$.on nodes.fileRM, 'click', -> QR.selected.rmFile()
|
$.on nodes.fileRM, 'click', -> QR.selected.rmFile()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user