mirror of
https://github.com/ronggang/transmission-web-control.git
synced 2025-04-14 16:00:15 +00:00
Updated mobile UI
This commit is contained in:
parent
67849cf613
commit
24bfd070f4
Binary file not shown.
|
@ -118,7 +118,7 @@
|
|||
<button onclick="system.showContent('home');"><label system-lang="dialog['public']['button-cancel']"></label></button>
|
||||
</div>
|
||||
</div>
|
||||
<div data-theme="c" data-role="footer" data-position="fixed" data-tap-toggle="false">
|
||||
<div data-theme="c" data-role="footer" data-position="fixed" data-tap-toggle="false" style="background:#f3f3f3;">
|
||||
<!-- 种子操作工具栏 -->
|
||||
<div id="torrent-toolbar" data-role="content" style="display:none;padding:0px 10px;" data-theme="a">
|
||||
<div data-role="controlgroup" data-type="horizontal">
|
||||
|
|
2
src/tr-web-control/script/min/system.min.js
vendored
2
src/tr-web-control/script/min/system.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,3 +1,3 @@
|
|||
/*! transmission-web-control 2017-06-06 */
|
||||
/*! transmission-web-control 2017-09-29 */
|
||||
|
||||
var transmission={SessionId:"",isInitialized:!1,host:"",port:"9091",path:"/transmission/rpc",rpcpath:"../rpc",fullpath:"",on:{torrentCountChange:null,postError:null},username:"",password:"",_status:{stopped:0,checkwait:1,check:2,downloadwait:3,download:4,seedwait:5,seed:6,actively:101},_trackerStatus:{inactive:0,waiting:1,queued:2,active:3},options:{getFolders:!0,getTarckers:!0},headers:{},trackers:{},islocal:!1,downloadDirs:new Array,getSessionId:function(a,b){var c={type:"POST",url:this.fullpath,error:function(c,d,e){var f="";409===c.status&&(f=c.getResponseHeader("X-Transmission-Session-Id"))&&(a.isInitialized=!0,a.SessionId=f,a.headers["X-Transmission-Session-Id"]=f,b&&b())},headers:this.headers};jQuery.ajax(c)},init:function(a,b){jQuery.extend(this,a),this.username&&this.password&&(this.headers.Authorization="Basic "+(new Base64).encode(this.username+":"+this.password)),this.fullpath=this.rpcpath,this.getSessionId(this,b)},exec:function(a,b,c){if(!this.isInitialized)return!1;var d={method:"",arguments:{},tag:""};jQuery.extend(d,a);var e={type:"POST",url:this.fullpath,dataType:"json",data:JSON.stringify(d),success:function(a,d){b&&b(a,c)},error:function(a,b,c){var d="";409===a.status&&(d=a.getResponseHeader("X-Transmission-Session-Id"))?(transmission.SessionId=d,transmission.headers["X-Transmission-Session-Id"]=d,jQuery.ajax(e)):transmission.on.postError&&transmission.on.postError(a)},headers:this.headers};jQuery.ajax(e)},getStatus:function(a){this.exec({method:"session-stats"},function(b){"success"==b.result&&(a&&a(b.arguments),transmission.torrents.count==b.arguments.torrentCount&&transmission.torrents.activeTorrentCount==b.arguments.activeTorrentCount&&transmission.torrents.pausedTorrentCount==b.arguments.pausedTorrentCount||(transmission.torrents.count=b.arguments.torrentCount,transmission.torrents.activeTorrentCount=b.arguments.activeTorrentCount,transmission.torrents.pausedTorrentCount=b.arguments.pausedTorrentCount,transmission._onTorrentCountChange()))})},getSession:function(a){this.exec({method:"session-get"},function(b){"success"==b.result&&a&&a(b.arguments)})},addTorrentFromUrl:function(a,b,c,d){a.match(/^[0-9a-f]{40}$/i)&&(a="magnet:?xt=urn:btih:"+a);var e={method:"torrent-add",arguments:{filename:a,paused:!c}};b&&(e.arguments["download-dir"]=b),this.exec(e,function(a){switch(a.result){case"success":d&&(a.arguments["torrent-added"]?d(a.arguments["torrent-added"]):a.arguments["torrent-duplicate"]&&d({status:"duplicate",torrent:a.arguments["torrent-duplicate"]}));break;case"duplicate torrent":default:d&&d(a.result)}})},addTorrentFromFile:function(a,b,c,d,e){var f=new FileReader;f.onload=function(a){var f=a.target.result,g=f.indexOf("base64,");if(-1!=g){var h=f.substring(g+"base64,".length);transmission.exec({method:"torrent-add",arguments:{metainfo:h,"download-dir":b,paused:c}},function(a){switch(a.result){case"success":d&&d(a.arguments["torrent-added"],e);break;case"duplicate torrent":d&&d("duplicate")}})}},f.readAsDataURL(a)},_onTorrentCountChange:function(){this.torrents.loadSimpleInfo=!1,this.on.torrentCountChange&&this.on.torrentCountChange()},removeTorrent:function(a,b,c){this.exec({method:"torrent-remove",arguments:{ids:a,"delete-local-data":b}},function(a){c&&c(a.result)})},getFreeSpace:function(a,b){this.exec({method:"free-space",arguments:{path:a}},function(a){b&&b(a)})},updateBlocklist:function(a){this.exec({method:"blocklist-update"},function(b){a&&a(b.result)})},renameTorrent:function(a,b,c,d){var e=this.torrents.all[a];if(!e)return!1;this.exec({method:"torrent-rename-path",arguments:{ids:[a],path:b||e.name,name:c}},function(a){d&&d(a)})},closeSession:function(a){this.exec({method:"session-close"},function(b){a&&a(b)})}};
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -517,7 +517,7 @@ var system = {
|
|||
}
|
||||
else
|
||||
{
|
||||
system.control.torrentlist.find("a[name='torrent']").css("marginLeft","-35px");
|
||||
system.control.torrentlist.find("a[name='torrent']").css("marginLeft","0px");
|
||||
}
|
||||
}).checkboxradio();
|
||||
}
|
||||
|
@ -539,7 +539,7 @@ var system = {
|
|||
};
|
||||
|
||||
// 由于不能以对象的方式来创建 listview 子项,所以只能用拼接字符串的方式
|
||||
var templates = "<li id='li-torrent-$id$' torrentid='$id$' style='padding:0px;'><a name='torrent' style='padding:0px;margin-left:-35px;'>"+
|
||||
var templates = "<li id='li-torrent-$id$' torrentid='$id$' style='padding:0px;'><a name='torrent' style='padding:0px;margin-left:0px;'>"+
|
||||
"<label data-corners='false' style='margin:0px;border:0px;padding:0px;'>"+
|
||||
"<input type='checkbox' id='torrent-$id$'/><label for='torrent-$id$'>"+
|
||||
"<h3 style='margin:0px;'>$name$</h3>"+
|
||||
|
@ -562,7 +562,7 @@ var system = {
|
|||
});
|
||||
li.on("swipeleft",function(event){
|
||||
//system.control.torrentlist.find("#torrent-"+$(this).attr("torrentid")).click();
|
||||
system.control.torrentlist.find("a[name='torrent']").css("marginLeft","-35px");
|
||||
system.control.torrentlist.find("a[name='torrent']").css("marginLeft","0px");
|
||||
});
|
||||
|
||||
li.appendTo(this.control.torrentlist);
|
||||
|
|
Loading…
Reference in New Issue
Block a user