diff --git a/deluge/ui/webui/templates/ajax/render/html/window_add_torrent_file.html b/deluge/ui/webui/templates/ajax/render/html/window_add_torrent_file.html new file mode 100644 index 000000000..1e886342f --- /dev/null +++ b/deluge/ui/webui/templates/ajax/render/html/window_add_torrent_file.html @@ -0,0 +1,11 @@ + +
+ + + + + + diff --git a/deluge/ui/webui/templates/ajax/static/js/deluge-add.js b/deluge/ui/webui/templates/ajax/static/js/deluge-add.js index 0752e984e..6e1622975 100644 --- a/deluge/ui/webui/templates/ajax/static/js/deluge-add.js +++ b/deluge/ui/webui/templates/ajax/static/js/deluge-add.js @@ -42,6 +42,13 @@ Deluge.Widgets.AddWindow = new Class({ url: '/template/render/html/add_torrent_options.html' })); + this.fileWindow = new Deluge.Widgets.AddTorrent.File(); + this.fileWindow.addEvent('torrentAdded', this.bound.onTorrentAdded); + this.fileButton = this.content.getElement('button.file'); + this.fileButton.addEvent('click', function(e) { + this.fileWindow.show(); + }.bindWithEvent(this)); + this.urlWindow = new Deluge.Widgets.AddTorrent.Url(); this.urlWindow.addEvent('torrentAdded', this.bound.onTorrentAdded); this.urlButton = this.content.getElement('button.url'); @@ -89,6 +96,26 @@ Deluge.Widgets.AddWindow = new Class({ Deluge.Widgets.AddTorrent = {} +Deluge.Widgets.AddTorrent.File = new Class({ + Extends: Widgets.Window, + + options: { + width: 300, + height: 100, + title: _('From File') + }, + + initialize: function() { + this.parent(); + this.iframe = new Element('iframe', { + src: '/template/render/html/window_add_torrent_file.html', + height: 100, + width: 300 + }); + this.content.grab(this.iframe); + } +}); + Deluge.Widgets.AddTorrent.Url = new Class({ Extends: Widgets.Window, diff --git a/deluge/ui/webui/templates/ajax/static/themes/classic/iframe.css b/deluge/ui/webui/templates/ajax/static/themes/classic/iframe.css new file mode 100644 index 000000000..3b1b65d46 --- /dev/null +++ b/deluge/ui/webui/templates/ajax/static/themes/classic/iframe.css @@ -0,0 +1,60 @@ +body { + font-family: trebuchet ms; + font-size: 0.7em; + color: White; +} + +/* forms */ +form fieldset { + border: none; + float: left; +} + +form legend { + font-weight: bold; +} + +form label { + width: 150px; + line-height: 20px; + float: left; +} + +form input, form select { + float: left; + margin-right: 5px; + border:1px solid #23344b; + background: #99acc3; + color: #000; + line-height: 20px; +} + +form textarea { + border:1px solid #23344b; + background: #99acc3; + width:480px; +} + +form .disabled { + color: Gray; +} + +form .deluge_button, button { + background-color: #37506f; + border:1px solid #68a; + cursor: pointer; + background: #99acc3; + color: #000; + vertical-align:middle; + -moz-border-radius:7px; + -webkit-border-radius:7px; + margin: 2px; +} + +form .deluge_button:hover, button:hover { + background-color:#68a; +} + +form br { + clear: left; +} diff --git a/deluge/ui/webui/templates/ajax/static/themes/classic/style.css b/deluge/ui/webui/templates/ajax/static/themes/classic/style.css index 351f84669..edccb2b00 100644 --- a/deluge/ui/webui/templates/ajax/static/themes/classic/style.css +++ b/deluge/ui/webui/templates/ajax/static/themes/classic/style.css @@ -17,6 +17,10 @@ body { color: White; } +iframe { + border: none; +} + #toolbar { background: url(/static/images/simple_line.jpg) repeat-x 0px 69px; height: 75px;