diff --git a/web/index.html b/web/index.html index e5771e373..09d3d609d 100755 --- a/web/index.html +++ b/web/index.html @@ -255,8 +255,10 @@
- Please select a torrent file to upload: + + +
Upload Cancel diff --git a/web/javascript/transmission.js b/web/javascript/transmission.js index 5503b39da..d7cb9bd86 100644 --- a/web/javascript/transmission.js +++ b/web/javascript/transmission.js @@ -1164,16 +1164,20 @@ Transmission.prototype = } else { var tr = this; var args = { }; - args.url = '/transmission/upload?paused=' + (this[Prefs._AutoStart] ? 'false' : 'true'); - args.type = 'POST'; - args.dataType = 'xml'; - args.iframe = true; - args.success = function( data ) { - tr.remote.loadTorrents( ); - tr.togglePeriodicRefresh( true ); - }; - this.togglePeriodicRefresh( false ); - $('#torrent_upload_form').ajaxSubmit( args ); + if ('' != $('#torrent_upload_url').val()) { + tr.remote.addTorrentByUrl($('#torrent_upload_url').val(), { paused: !this[Prefs._Autostart] }); + } else { + args.url = '/transmission/upload?paused=' + (this[Prefs._AutoStart] ? 'false' : 'true'); + args.type = 'POST'; + args.dataType = 'xml'; + args.iframe = true; + args.success = function( data ) { + tr.remote.loadTorrents( ); + tr.togglePeriodicRefresh( true ); + }; + this.togglePeriodicRefresh( false ); + $('#torrent_upload_form').ajaxSubmit( args ); + } } }, diff --git a/web/javascript/transmission.remote.js b/web/javascript/transmission.remote.js index fc4d63840..37bd34804 100644 --- a/web/javascript/transmission.remote.js +++ b/web/javascript/transmission.remote.js @@ -121,7 +121,15 @@ TransmissionRemote.prototype = removeTorrents: function( torrents ) { this.sendTorrentCommand( 'torrent-remove', torrents ); }, - + addTorrentByUrl: function( url, options ) { + this.sendRequest( RPC._Root, $.toJSON({ + method: 'torrent-add', + arguments: { + paused: (options.paused ? 'true' : 'false'), + filename: url + } + }) ); + }, savePrefs: function( args ) { var remote = this; var o = { }; diff --git a/web/stylesheets/common.css b/web/stylesheets/common.css index 56d6ff665..f75aa54fe 100644 --- a/web/stylesheets/common.css +++ b/web/stylesheets/common.css @@ -726,7 +726,7 @@ div#upload_container div.dialog_window div.dialog_message label { div#upload_container div.dialog_window div.dialog_message input { width: 249px; - margin: 10px 0 0 0; + margin: 3px 0 0 0; display: block; }