HOWTO: Press ENTER on URL field to add torrent
Posted: Sun Jan 17, 2016 6:04 pm
I'm using version 2.84. When adding a torrent in the web interface by pasting a magnet link in the URL field, you have to click the Upload button to make it go. Pressing the ENTER key does nothing. The following modifications to transmission.js make pressing the ENTER key while the cursor is in the URL field behave the same as clicking the Upload button.
** Warning ** Make a backup copy of any files before you change them so that you can put them back if you make a mistake!
As root, edit transmission.js with your favorite text editor. On my system, transmission.js is located in /usr/share/transmission/web/javascript
Near the top of transmission.js (under the heading "// Set up user events") add the following line:
Next, find the section that looks like this (on my system it starts around line number 565):
Add the following below it:
The finished product should look like this:
Save the file. Refresh the transmission web interface page and enjoy.
I would love for this tiny feature to be available in future releases.
** Disclaimer ** This worked for me but might not for you. I'm not a web developer. I can use Google and be dangerous with what I find. There may be a better/cleaner way to accomplish this. If you can clean up or streamline this code, please do. Remember to make a backup copy of any files before you modify them! I take no responsibility if you break your stuff. But seriously it worked for me
** Warning ** Make a backup copy of any files before you change them so that you can put them back if you make a mistake!
As root, edit transmission.js with your favorite text editor. On my system, transmission.js is located in /usr/share/transmission/web/javascript
Near the top of transmission.js (under the heading "// Set up user events") add the following line:
Code: Select all
$('#torrent_upload_url').keypress($.proxy(this.confirmUploadEnter,this));
Code: Select all
confirmUploadClicked: function() {
this.uploadTorrentFile(true);
this.hideUploadDialog();
},
Code: Select all
confirmUploadEnter: function (e) {
if (e.which == 13) {
this.uploadTorrentFile(true);
this.hideUploadDialog();
}
},
Code: Select all
...
confirmUploadClicked: function() {
this.uploadTorrentFile(true);
this.hideUploadDialog();
},
confirmUploadEnter: function (e) {
if (e.which == 13) {
this.uploadTorrentFile(true);
this.hideUploadDialog();
}
},
hideMoveDialog: function() {
...
I would love for this tiny feature to be available in future releases.
** Disclaimer ** This worked for me but might not for you. I'm not a web developer. I can use Google and be dangerous with what I find. There may be a better/cleaner way to accomplish this. If you can clean up or streamline this code, please do. Remember to make a backup copy of any files before you modify them! I take no responsibility if you break your stuff. But seriously it worked for me