diff options
Diffstat (limited to 'bin/jdownloader/plugins/webinterface')
29 files changed, 1547 insertions, 0 deletions
diff --git a/bin/jdownloader/plugins/webinterface/all_info.tmpl b/bin/jdownloader/plugins/webinterface/all_info.tmpl new file mode 100644 index 0000000..d16740d --- /dev/null +++ b/bin/jdownloader/plugins/webinterface/all_info.tmpl @@ -0,0 +1,44 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html> +<head> +<title>JDownloader - WebInterface v<tmpl_var webinterface_version></title> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> +<meta http-equiv="Content-Style-Type" content="text/css"> +<meta http-equiv="Content-Script-Type" content="text/javascript"> +<link href="jd.css" rel="stylesheet" type="text/css"> +<script type="text/javascript" src="scripts.js"></script> +</head> + +<body> +<div class="hide" style="width:0%;" id="0"> </div><!--package - needed by setProgressBarsColors--> +<table width="95%" align="center" id="infotable"> +<tbody> + <tmpl_loop all_infos> + <tr> + <td class="description"><tmpl_var info_var></td> + + <tmpl_if download_status> + <td class="ladebalken"> + <div class="ladebalken"> + <div class="ladebalkenWrapper"> + <div name="ladebalken" class="<tmpl_var download_status escape>" style="width: <tmpl_var info_percent escape>%;" id="0_<tmpl_var download_id escape>"> </div> + </div> + <span class="ladestatus"><tmpl_var info_value></span><br class="clear"> + </div> + </td> + <tmpl_else> + <td class="value"><tmpl_var info_value></td> + </tmpl_if> + + </tr> + </tmpl_loop> +</tbody> +</table> + +<script type="text/javascript"> + setProgressBarsColors('f5f502', '02CE02'); + startPageReload(<tmpl_var page_refresh>); + resizeInfoWindow("infotable", 600); +</script> +</body> +</html>
\ No newline at end of file diff --git a/bin/jdownloader/plugins/webinterface/bye.tmpl b/bin/jdownloader/plugins/webinterface/bye.tmpl new file mode 100644 index 0000000..01b2bd3 --- /dev/null +++ b/bin/jdownloader/plugins/webinterface/bye.tmpl @@ -0,0 +1,16 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html> +<head> +<title>JDownloader - WebInterface v<tmpl_var webinterface_version></title> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> +<meta http-equiv="Content-Style-Type" content="text/css"> +<meta http-equiv="Content-Script-Type" content="text/javascript"> +<link href="jd.css" rel="stylesheet" type="text/css"> +</head> + +<body> +<div id="message"> +JD will be shut down now ... Good Bye +</div> +</body> +</html>
\ No newline at end of file diff --git a/bin/jdownloader/plugins/webinterface/favicon.png b/bin/jdownloader/plugins/webinterface/favicon.png Binary files differnew file mode 100644 index 0000000..d06d9f2 --- /dev/null +++ b/bin/jdownloader/plugins/webinterface/favicon.png diff --git a/bin/jdownloader/plugins/webinterface/filelist.js b/bin/jdownloader/plugins/webinterface/filelist.js new file mode 100644 index 0000000..b6c53d0 --- /dev/null +++ b/bin/jdownloader/plugins/webinterface/filelist.js @@ -0,0 +1,146 @@ +var packContainer, cookieArray, showArray, cookieName;
+
+function initiate(useCookieName) {
+ var cookieArrayTemp;
+ showArray = new Array();
+ cookieName = useCookieName;
+
+ if(document.cookie) {
+ cookieArray = document.cookie.split(";");
+ cookieArrayTemp = new Array();
+
+ for(i in cookieArray){
+ cookieArrayTemp[cookieArray[i].split("=")[0].replace(/ /g,"")]=cookieArray[i].split("=")[1].replace(/ /g,"");
+ }
+ }
+
+ //get show-value(true, false) for each package
+ cookieArray=(document.cookie.indexOf(cookieName+"=")>=0)?cookieArrayTemp[cookieName].split(","):new Array();
+
+ //contains all packages
+ packContainer=document.getElementById("packageContainer");
+
+ //var cookieCount=0;
+ var currPackageNum = -1;
+
+ // for all table-rows (packages and downloads)
+ for(var i=0; i<packContainer.getElementsByTagName("tr").length; i++){
+
+ var currRow = packContainer.getElementsByTagName("tr")[i];
+
+ // row is package
+ if (startsWith(currRow.className, "package")) {
+ currPackageNum++;
+ currRow.id = "package" + currPackageNum;
+
+ var expander = document.createElement("span");
+ expander.id = "expander" + currPackageNum;
+ expander.className = "symbol";
+
+ // plus- or minus-pic
+ expander.style.backgroundImage = (cookieArray.length>currPackageNum)? ((cookieArray[currPackageNum]=="true")? "url(img/minus.gif)" : "url(img/plus.gif)") : "url(img/plus.gif)";
+
+ expander.onclick= new Function("expanderClick("+currPackageNum+");");
+
+ currRow.getElementsByTagName('td')[1].insertBefore(expander, currRow.getElementsByTagName('td')[1].firstChild);
+
+ showArray[currPackageNum] = (cookieArray.length>currPackageNum)? ((cookieArray[currPackageNum]=="true")? "true" : "false" ) : "false" ;
+
+ } else if (startsWith(currRow.className, "download")) {
+ //row is a download
+ var showVal = (testProperty('display', 'table-row'))? 'table-row' : 'block';
+ var displayVal = (cookieArray.length>currPackageNum)? ((cookieArray[currPackageNum]=="true")? showVal : "none") : "none";
+ currRow.style.display = displayVal;
+ }
+
+ }
+
+}
+
+function expanderClick(currPackageNum) {
+ showhide(currPackageNum);
+ saveListsVisibility();
+}
+
+function startsWith(string, text) {
+ var pos = string.indexOf(text);
+ if (pos == 0) {
+ return true;
+ } else {
+ return false;
+ }
+}
+
+function showhide(packageNum) {
+
+ var package = document.getElementById("package" + packageNum);
+ var expander = document.getElementById("expander" + packageNum);
+
+ var showVal = (testProperty('display', 'table-row'))? 'table-row' : 'block';
+ var displayVal = (showArray[packageNum]=="false")? showVal : "none";
+
+ var nextRow = package.nextSibling;
+
+ while (nextRow != null) {
+ // accept only tr-nodes
+ if (nextRow.tagName == null || nextRow.tagName.toLowerCase() != 'tr') {
+ nextRow = nextRow.nextSibling;
+ continue;
+ }
+
+ // reached next package?
+ if (startsWith(nextRow.className, "package")) {
+ break;
+ }
+
+ nextRow.style.display = displayVal;
+ nextRow = nextRow.nextSibling;
+ }
+
+ expander.style.backgroundImage = (showArray[packageNum]=="false")? "url(img/minus.gif)" : "url(img/plus.gif)";
+ showArray[packageNum] = (showArray[packageNum]=="false")? "true" : "false";
+
+}
+
+
+
+function saveListsVisibility() {
+// save the visibility of the package-lists in a cookie
+
+ cookieArray=new Array();
+ var packNum = -1;
+
+ for(var i=0; i<packContainer.getElementsByTagName("tr").length; i++){
+
+ var currRow = packContainer.getElementsByTagName("tr")[i];
+
+ if (startsWith(currRow.className, "package")) {
+ packNum++;
+ var newShow = (showArray[packNum]=="true");
+ cookieArray[cookieArray.length] = newShow;
+ showArray[packNum] = ""+newShow+"";
+ }
+ }
+
+ document.cookie=cookieName+"="+cookieArray.join(",")+";expires="+new Date(new Date().getTime() + 365*24*60*60*1000).toGMTString();
+
+}
+
+/**
+ * Tests, if the IE supports the property-Value
+ */
+function testProperty(prop, value) {
+ var tempEl = document.createElement("div");
+
+ if(typeof tempEl.style[prop] != 'undefined') {
+ try {
+ tempEl.style[prop] = value;
+ return true;
+ }
+ catch(e) {
+ return false;
+ }
+ } else {
+ return false;
+ }
+}
\ No newline at end of file diff --git a/bin/jdownloader/plugins/webinterface/img/add.png b/bin/jdownloader/plugins/webinterface/img/add.png Binary files differnew file mode 100644 index 0000000..7faef3b --- /dev/null +++ b/bin/jdownloader/plugins/webinterface/img/add.png diff --git a/bin/jdownloader/plugins/webinterface/img/jd_logo.png b/bin/jdownloader/plugins/webinterface/img/jd_logo.png Binary files differnew file mode 100644 index 0000000..364dae9 --- /dev/null +++ b/bin/jdownloader/plugins/webinterface/img/jd_logo.png diff --git a/bin/jdownloader/plugins/webinterface/img/minus.gif b/bin/jdownloader/plugins/webinterface/img/minus.gif Binary files differnew file mode 100644 index 0000000..d5dcc0a --- /dev/null +++ b/bin/jdownloader/plugins/webinterface/img/minus.gif diff --git a/bin/jdownloader/plugins/webinterface/img/page.gif b/bin/jdownloader/plugins/webinterface/img/page.gif Binary files differnew file mode 100644 index 0000000..309dc0a --- /dev/null +++ b/bin/jdownloader/plugins/webinterface/img/page.gif diff --git a/bin/jdownloader/plugins/webinterface/img/plus.gif b/bin/jdownloader/plugins/webinterface/img/plus.gif Binary files differnew file mode 100644 index 0000000..441ddbb --- /dev/null +++ b/bin/jdownloader/plugins/webinterface/img/plus.gif diff --git a/bin/jdownloader/plugins/webinterface/img/progress.png b/bin/jdownloader/plugins/webinterface/img/progress.png Binary files differnew file mode 100644 index 0000000..1ae988f --- /dev/null +++ b/bin/jdownloader/plugins/webinterface/img/progress.png diff --git a/bin/jdownloader/plugins/webinterface/img/reboot.png b/bin/jdownloader/plugins/webinterface/img/reboot.png Binary files differnew file mode 100644 index 0000000..5293ed9 --- /dev/null +++ b/bin/jdownloader/plugins/webinterface/img/reboot.png diff --git a/bin/jdownloader/plugins/webinterface/img/reconnect.png b/bin/jdownloader/plugins/webinterface/img/reconnect.png Binary files differnew file mode 100644 index 0000000..cc765e0 --- /dev/null +++ b/bin/jdownloader/plugins/webinterface/img/reconnect.png diff --git a/bin/jdownloader/plugins/webinterface/img/reconnect_do.png b/bin/jdownloader/plugins/webinterface/img/reconnect_do.png Binary files differnew file mode 100644 index 0000000..ef0ae96 --- /dev/null +++ b/bin/jdownloader/plugins/webinterface/img/reconnect_do.png diff --git a/bin/jdownloader/plugins/webinterface/img/reconnectchecked.png b/bin/jdownloader/plugins/webinterface/img/reconnectchecked.png Binary files differnew file mode 100644 index 0000000..f0c78c7 --- /dev/null +++ b/bin/jdownloader/plugins/webinterface/img/reconnectchecked.png diff --git a/bin/jdownloader/plugins/webinterface/img/refresh.png b/bin/jdownloader/plugins/webinterface/img/refresh.png Binary files differnew file mode 100644 index 0000000..fd7fe09 --- /dev/null +++ b/bin/jdownloader/plugins/webinterface/img/refresh.png diff --git a/bin/jdownloader/plugins/webinterface/img/save.png b/bin/jdownloader/plugins/webinterface/img/save.png Binary files differnew file mode 100644 index 0000000..42bad0b --- /dev/null +++ b/bin/jdownloader/plugins/webinterface/img/save.png diff --git a/bin/jdownloader/plugins/webinterface/img/shutdown.png b/bin/jdownloader/plugins/webinterface/img/shutdown.png Binary files differnew file mode 100644 index 0000000..547a220 --- /dev/null +++ b/bin/jdownloader/plugins/webinterface/img/shutdown.png diff --git a/bin/jdownloader/plugins/webinterface/img/start.png b/bin/jdownloader/plugins/webinterface/img/start.png Binary files differnew file mode 100644 index 0000000..49828e0 --- /dev/null +++ b/bin/jdownloader/plugins/webinterface/img/start.png diff --git a/bin/jdownloader/plugins/webinterface/img/stop.png b/bin/jdownloader/plugins/webinterface/img/stop.png Binary files differnew file mode 100644 index 0000000..fbdd2c7 --- /dev/null +++ b/bin/jdownloader/plugins/webinterface/img/stop.png diff --git a/bin/jdownloader/plugins/webinterface/index.tmpl b/bin/jdownloader/plugins/webinterface/index.tmpl new file mode 100644 index 0000000..8d8c812 --- /dev/null +++ b/bin/jdownloader/plugins/webinterface/index.tmpl @@ -0,0 +1,153 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html> +<head> +<title>JDownloader - WebInterface v<tmpl_var webinterface_version></title> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> +<meta http-equiv="Content-Style-Type" content="text/css"> +<meta http-equiv="Content-Script-Type" content="text/javascript"> +<link rel="shortcut icon" href="favicon.png" type="image/png"/><link rel="icon" href="favicon.png" type="image/png"/> +<link href="jd.css" rel="stylesheet" type="text/css"> +<script type="text/javascript" src="filelist.js"></script> +<script type="text/javascript" src="scripts.js"></script> +<noscript><meta http-equiv="refresh" content="0;URL=nojs.tmpl"></noscript> +</head> + +<body onload="pageLoaded(); allowChars('maxdls', '01234567890'); allowChars('speed', '01234567890');"> +<div id="main"> + <div id="header"> + <h2 class="title">WebInterface<br>(Version <tmpl_var webinterface_version>)</h2> + </div> + + <div id="content"> + <div id="tabs"> + <ul id="tabmenu"> + <li class="active"><a class="active" href="index.tmpl" name="Status Page" target="_self">Status Page</a></li> + <li class="<tmpl_var unrar_available>"><A href="passwd.tmpl" name="Edit Passwords" target="_self">Edit Password-List</A></li> + <li><A href="link_adder.tmpl" name="Link Adder" target="_self">Add Links</A></li> + </ul> + </div> + + <div id="tabcontent"> + + <FORM action="index.tmpl" name="jd" id="jdForm" method="POST" target="_parent"> + + <div id="toolbar"> + <div id="toolbarright"> + <span class="toolbarButton" id="btnClose" title="Close JD" onclick="validateandsubmit('Close JD?','jdForm','bye.tmpl', 'close')"></span> + <span class="toolbarButton" id="btnRestart" title="Restart JD" onclick="validateandsubmit('Restart JD?','jdForm','restart.tmpl', 'restart')"></span> + </div> + <div id="toolbarleft"> + <span class="toolbarButton" id="btnRefresh" title="Refresh Page" onclick="forwardto('index.tmpl')"></span> + <span class="toolbarButton" id="btnDL<tmpl_var config_startstopbutton escape>" title="Start/Stop Downloads" onclick="submitForm('jdForm','index.tmpl','do', '<tmpl_var config_startstopbutton escape>')"></span> + <span class="toolbarButton" id="btnReconnect" title="Reconnect" onclick="submitForm('jdForm','reconnect.tmpl','do','reconnect')"></span> + <span class="toolbarButton" id="btnAutoReconnect<tmpl_var config_autoreconnect escape>" title="Activate/Deactivate Auto-Reconnect" onclick="switchAutoReconnect('jdForm','index.tmpl','<tmpl_var config_autoreconnect escape>')"></span> + <div class="hide"><input type="checkbox" name="autoreconnect" id="autoreconnect" value="on" <tmpl_var config_autoreconnect>></div> + </div> + <div id="toolbarcenter"> + <span id="deactivatedAutoReloadSpace"> </span> <!--Um Spruenge im Design beim IE6 zu vermeiden--> + <span id="deactivatedAutoReload"><a href="index.tmpl">Auto-Reload<br>deactivated</a></span> + </div> + <br class="clear"> + </div> + + <div id="message_<tmpl_var message_status escape>"><tmpl_var message><div><a href="#" class="button" onclick="closeMessage();">Close Message</a></div></div> + + <table class="tabledownload" id="packageContainer"> + <tr> + <td style="width:2%;" class="tabletitle"> + <input type="checkbox" name="checkallbox" onclick="if (this.checked==true) {checkall(document.jd.package_all_downloads,document.jd.package_single_download); } else {uncheckall(document.jd.package_all_downloads,document.jd.package_single_download);}"> + </td> + <td class="tabletitle">File</td> + <td style="width:20%;" class="tabletitle">Hoster</td> + <td style="width:300px;" class="tabletitle">Progress</td> + </tr> + + + <tmpl_loop pakete> + <tr class="package<tmpl_var download_status escape>"> + <td><INPUT type="checkbox" name="package_all_downloads" value="<tmpl_var package_id escape>" onclick="samecheckall(document.jd.package_single_download,this)"></td> + <td><A href="all_info.tmpl?all_info=<tmpl_var package_id escape>" name="PackageInfo" onclick="return popup(this,600,200)"><tmpl_var download_name></A></td> + <td><tmpl_var download_hoster></td> + <td class="ladebalken"> + <div class="ladebalken"> + <div class="ladebalkenWrapper"> + <div name="ladebalken" class="running" style="width: <tmpl_var download_status_percent escape>%;" id="<tmpl_var package_id escape>"> + </div> + </div> + <span class="ladestatus"><tmpl_var download_status_text></span> + <br class="clear"> + </div> + </td> + </tr> + + <tmpl_loop downloads> + <tr class="download<tmpl_var download_status escape>"> + <td><INPUT type="checkbox" name="package_single_download" value="<tmpl_var package_id escape> <tmpl_var download_id escape>" onclick="areallsamechecked(this,document.jd.package_single_download,document.jd.package_all_downloads)"></TD> + <td><A href="single_info.tmpl?single_info=<tmpl_var package_id escape>+<tmpl_var download_id escape>" name="LinkInfo" onclick="return popup(this,600,200)" style="padding-left: 20px;"><tmpl_var download_name></A></TD> + <td><tmpl_var download_hoster></TD> + <td class="ladebalken"> + <div class="ladebalken"> + <div class="ladebalkenWrapper"> + <div name="ladebalken" class="<tmpl_var download_status escape>" style="width: <tmpl_var download_status_percent escape>%;" id="<tmpl_var package_id escape>_<tmpl_var download_id escape>"> + </div> + </div> + <span class="ladestatus"><tmpl_var download_status_text></span> + <br class="clear"> + </div></td> + </tr> + </tmpl_loop> + + </tmpl_loop> + </table> + + <script type="text/javascript"> + // This must be placed immediately after the filelists (packages/downloads). + initiate("statuslist"); + startPageReload(<tmpl_var page_refresh>); + setProgressBarsColors('f5f502', '02CE02'); + </script> + + <div class="rightDLOptions"> + Max. Downloads <INPUT type="text" name="maxdls" id="maxdls" value="<tmpl_var config_max_downloads escape>" maxlength="4" size="4" onkeydown="formElementChanged()"> , SpeedLimit <INPUT type="text" name="speed" id="speed" value="<tmpl_var config_max_speed escape>" maxlength="4" size="4" onkeydown="formElementChanged()"> KB/s (Current: <tmpl_var config_current_speed> KB/s)</TD> + <a href="#" class="button" onclick="submitForm('jdForm','index.tmpl','do','submit')">Go!</a> + </div> + + <DIV class="leftDLOptions"> + <SELECT onchange="formElementChanged()" name="selected_dowhat_index"> + <option>activate</option> + <option>deactivate</option> + <option>reset</option> + <option>abort</option> + <option>remove</option> + </SELECT> + <a href="#" class="button" onclick="submitForm('jdForm','index.tmpl','do','submit')">Go!</a> + </DIV> + <br> + </FORM> + + <h1>Add Links</h1> + <FORM name="add" id="addForm" action="link_adder.tmpl" target="_parent" method="POST"> + <DIV class="linkAddBox"> + <div style="float:right;"> + <a href="#" onclick="submitForm('addForm','link_adder.tmpl','do','Add')" class="addButton">Add</a> + </div> + + <div style="padding-right: 100px;"> + <textarea name="addlinks" cols="90" rows="3" onfocus="formElementChanged(); clean(this);" style="width:100%; float:left;">Paste your Links here (Container URLs, Link URLs, SourceCode from Pages to parse)</textarea> + </div> + <br class="clear"> + </DIV> + </FORM> + + <h1>Upload container file</h1> + <form name="upload" id="uploadForm" action="link_adder.tmpl" method="post" enctype="multipart/form-data"> + <div class="linkAddBox"> + <span style="color: #000; font-weight:bold;">Container upload:</span> <input name="container" type="file" size="50" onclick="formElementChanged()"> <a href="#" class="button" onclick="submitForm('uploadForm','link_adder.tmpl','do','Upload')">Upload!</a> + </div> + </form> + </div> + </div> +</div> +<div id="footer">PlugIn by jiaz, Design (HTML, CSS, JS) by Bo0nZ</div> +</body> +</html> diff --git a/bin/jdownloader/plugins/webinterface/jd.css b/bin/jdownloader/plugins/webinterface/jd.css new file mode 100644 index 0000000..03810e0 --- /dev/null +++ b/bin/jdownloader/plugins/webinterface/jd.css @@ -0,0 +1,476 @@ +body,html {
+ margin: 0;
+ padding: 5px 0 0 0;
+ width: 100%;
+ background-color: #e7e7e7;
+ font-family: Arial, Verdana, Helvetica, sans-serif;
+ font-size: 11px;
+ color: #666666;
+}
+
+table {
+ border-width: 1px;
+ border-spacing: 1px;
+ border-style: solid;
+ border-color: #2c2895;
+ border-collapse: collapse;
+ background-color: #fff;
+}
+
+table td {
+ border-width: 1px;
+ padding:0;
+ border-style: solid;
+ border-color: #2c2895;
+ background-color: #fff;
+}
+
+h1 {
+ font-size: 18px;
+ margin: 20px 0 0 0;
+ border-bottom: 1px dashed #000;
+}
+
+h2 {
+ font-size: 16px;
+ color: #006AC3;
+ padding: 0 25px;
+ letter-spacing: 1px;
+ text-transform: uppercase;
+}
+
+h2.title {
+ text-align:right;
+ color:#000;
+}
+
+/*
+ * Links
+ */
+a {
+ color: #000000;
+ font-family:verdana, arial, helvetica;
+ font-size:11px;
+ text-decoration:none;
+}
+a:visited {
+ color: #000000;
+ font-family:verdana, arial, helvetica;
+ font-size:11px;
+ text-decoration:none;
+}
+a:hover {
+ color: #FF007F;
+ font-family:verdana, arial, helvetica;
+ font-size:11px;
+ text-decoration:none;
+}
+
+.hide {
+ display:none;
+}
+
+.clear {
+ clear:both;
+}
+
+#deactivatedAutoReload {
+ position: relative;
+ top: -30px;
+ height: 30px;
+ width: 100px;
+ margin: 0px auto;
+ background-color:#ffd5d5;
+ border: 1px solid red;
+ text-align: center;
+ line-height:15px;
+ display: none;
+}
+
+#deactivatedAutoReloadSpace {
+ display:block;
+ height: 30px;
+ width: 1px;
+}
+
+#main {
+ min-width: 800px;
+ width:90%;
+ margin: 0 auto;
+ border:1px solid;
+ background-color:#fff;
+}
+
+#header {
+ height: 81px;
+ width: 100%;
+ background-image:url('img/jd_logo.png');
+ background-repeat:no-repeat;
+ background-color: #fff;
+ background-position: 6px 0px;
+}
+
+/* IE FIX*/
+* html #header { background-image: none; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop src='img/jd_logo.png'); }
+
+#content {
+ margin:10px;
+ background-color:#fff;
+}
+
+#footer {
+ width: 90%;
+ text-align: center;
+ margin: 0 auto;
+}
+
+#tabs {
+ background-color: #fff;
+ height: 30px;
+}
+
+#tabmenu {
+ list-style-type: none;
+ margin:0;
+ padding:0;
+}
+
+#tabmenu li {
+ display:inline;
+ margin: 0px 5px 0px 0px;
+}
+
+#tabmenu li a {
+ font-weight:bold;
+ font-size:12px;
+ line-height: 30px;
+ padding: 6px 5px 6px 5px;
+ background-color:#e1e1e1;
+ border-width: 1px 1px 0 1px;
+ border-style: solid;
+ border-color:#8383ff;
+}
+
+#tabmenu li a:hover {
+ background-color:#d3d3ff;
+}
+
+#tabmenu li a.active {
+ padding: 6px 5px 8px 5px;
+ background-color:#d3d3ff;
+}
+
+#tabcontent, #message {
+ border-width: 1px;
+ border-color: #8383ff;
+ border-style:solid;
+ padding: 10px;
+ background-color: #d3d3ff;
+}
+
+#message, #message_show {
+ /*horizontal and vertical centered*/
+ position: absolute;
+ z-index: 999;
+ left: 50%;
+ width: 80%;
+ margin-left: -40%;
+ top: 50%;
+ height: 50px;
+ line-height: 50px;
+ margin-top: -25px;
+
+ text-align: center;
+ font-size: 16px;
+ color: #000;
+ letter-spacing: 1px;
+ text-transform: uppercase;
+ font-weight: bold;
+ font-family:verdana,arial,helvetica;
+ font-size:11px;
+}
+
+#message_show {
+ border-width: 1px;
+ border-color: red;
+ border-style:solid;
+ padding: 10px;
+ background-color: #ffd5d5;
+
+ height: auto;
+ top: 200px;
+ line-height: 20px;
+ text-transform: none;
+}
+
+#message_hide, #message_ {
+ display: none;
+}
+
+#packageContainer .symbol {
+ float:left;
+ width:11px;
+ height: 20px;
+ background-position: center;
+ background-repeat:no-repeat;
+ margin-right: 10px;
+}
+
+div.rightDLOptions {
+ float: right;
+ margin-top:5px;
+}
+
+div.leftDLOptions {
+ text-align:left;
+ margin-top: 5px;
+}
+
+div.linkAddBox {
+ text-align:left;
+ width:100%;
+ margin:20px 0px;
+}
+
+/*
+ * Download-Table
+ */
+table.tabledownload {
+ width: 100%;
+}
+
+table.tabledownload td {
+ padding: 0px 5px;
+ line-height: 20px;
+ color: #000;
+}
+
+table.tabledownload td.tabletitle {
+ background-color: #2c2895;
+ color: #fff;
+ font-weight: bold;
+ padding: 2px 5px;
+}
+
+table.tabledownload td.ladebalken, td.ladebalken, td.description {
+ height: 20px;
+ line-height: 20px;
+ padding: 0px;
+ margin:0;
+}
+
+td.value {
+ text-align: right;
+}
+
+td.value, td.description {
+ padding: 0px 5px;
+}
+
+td.description {
+ width: 20%;
+ height: 20px;
+ line-height: 20px;
+ background-color: #BABAFF;
+ font-weight: bold;
+ color: #000;
+ white-space: nowrap;
+}
+
+/*
+ * Progress Bar
+ */
+div.ladebalken {
+ height: 1.8em;
+ overflow:hidden;
+}
+
+div.ladebalkenWrapper {
+ height: 100%;
+ width: 100%;
+ float:left;
+}
+
+span.ladestatus {
+ float:right;
+ display: block;
+ position: relative;
+ top:-1.8em; left:0;
+ line-height: 1.8em;
+ width: 100%;
+ text-align: center;
+ color:#000;
+ font-weight:bold;
+ white-space: nowrap;
+ padding:0;
+ margin: 0;
+}
+
+/* top-image: gloss */
+div.ladebalken div.finished,
+div.ladebalken div.running,
+div.ladebalken div.activated,
+div.ladebalken div.deactivated {
+ /*float: left;*/
+ background-image:url('img/progress.png');
+}
+
+/* IE FIX*/
+* html div.ladebalken div.finished,
+* html div.ladebalken div.running,
+* html div.ladebalken div.activated,
+* html div.ladebalken div.deactivated {
+ background-image: none;
+ filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=scale src='img/progress.png');
+}
+
+/*
+ * Row-Colors/Images for progressbars
+ */
+div.ladebalken div.deactivated {
+ background-color: #727272; /*gray*/
+}
+div.ladebalken div.activated {
+ background-color: #0275CE; /*blue*/
+}
+div.ladebalken div.running {
+ background-color: #EFED23; /*yellow*/
+}
+div.ladebalken div.finished {
+ background-color: #02CE02; /*green*/
+}
+
+/*
+ * Row-Colors for downloads (not packages)
+ */
+tr.downloadfinished td {
+ background-color:#aaffaa;
+}
+tr.downloadonline td {
+ background-color:#228B22;
+}
+tr.downloadoffline td {
+ background-color:#8B0000;
+}
+tr.downloadrunning td {
+ background-color:#e9e9ff;
+}
+tr.downloadactivated td, tr.download td {
+ background-color:#e9e9ff;
+}
+tr.downloaddeactivated td {
+ background-color:#bababa;
+}
+
+/*
+ * Row-Colors for packages (not downloads)
+ */
+tr.packagefinished td {
+ background-color:#87e376;
+ font-weight: bold;
+}
+tr.packagerunning td {
+ background-color:#babaff;
+ font-weight: bold;
+}
+tr.packageactivated td, tr.package td {
+ background-color:#babaff;
+ font-weight: bold;
+}
+tr.packagedeactivated td {
+ background-color:#999999;
+ font-weight: bold;
+}
+
+/*
+ * Toolbar
+ */
+#toolbar {
+ padding: 2px;
+ height: 34px;
+}
+
+#toolbarright {
+ float:right;
+}
+
+#toolbarleft {
+ float:left;
+}
+
+#toolbarcenter {
+ height: 32px;
+ overflow:hidden;
+}
+
+/*
+ * Toolbar-Buttons
+ */
+span.toolbarButton {
+ float: left;
+ width: 32px;
+ height: 32px;
+ cursor: pointer;
+ background-repeat: no-repeat;
+}
+
+#btnClose { background-image:url('img/shutdown.png'); }
+#btnRestart { background-image:url('img/reboot.png'); }
+#btnRefresh { background-image:url('img/refresh.png'); }
+#btnDLstart { background-image:url('img/start.png'); }
+#btnDLstop { background-image:url('img/stop.png'); }
+#btnReconnect { background-image:url('img/reconnect_do.png'); }
+#btnAutoReconnect { background-image:url('img/reconnect.png'); }
+#btnAutoReconnectchecked { background-image:url('img/reconnectchecked.png'); }
+#btnSave { background-image:url('img/save.png'); }
+
+/* IE FIXes */
+* html #btnClose { background-image: none; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop src='img/shutdown.png'); }
+* html #btnRestart { background-image: none; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop src='img/reboot.png'); }
+* html #btnRefresh { background-image: none; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop src='img/refresh.png'); }
+* html #btnDLstart { background-image: none; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop src='img/start.png'); }
+* html #btnDLstop { background-image: none; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop src='img/stop.png'); }
+* html #btnReconnect { background-image: none; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop src='img/reconnect_do.png'); }
+* html #btnAutoReconnect { background-image: none; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop src='img/reconnect.png'); }
+* html #btnAutoReconnectchecked { background-image: none; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop src='img/reconnect_checked.png'); }
+* html #btnSave { background-image: none; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop src='img/save.png'); }
+
+a.button, a.addButton {
+ display:inline;
+ background-color: #e1e1e1;
+ border-width: 1px 2px 2px 1px;
+ border-style: solid;
+ border-color:gray;
+ padding: 1.5px 5px;
+ font-weight:bold;
+ line-height: 32px;
+}
+
+a.addButton {
+ /*float: left;*/
+ display: block;
+ width: 40px;
+ background-image:url('img/add.png');
+ background-repeat: no-repeat;
+ height: 30px;
+ line-height: 30px;
+ padding-left: 35px;
+ /*padding: 7px 5px 9px 35px;*/
+}
+
+/* IE FIX */
+* html a.addButton { background-image: none; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop src='img/add.png'); }
+
+a.button:hover, a.addButton:hover {
+ border-width: 2px 1px 1px 2px;
+}
+
+/* Show/Hide password list tab */
+
+li.unrarAvailable {
+ display:inline !important;
+}
+
+li.unrarUnavailable {
+ display:none !important;
+}
diff --git a/bin/jdownloader/plugins/webinterface/jdwebinterface b/bin/jdownloader/plugins/webinterface/jdwebinterface Binary files differnew file mode 100644 index 0000000..cc2b45f --- /dev/null +++ b/bin/jdownloader/plugins/webinterface/jdwebinterface diff --git a/bin/jdownloader/plugins/webinterface/link_adder.tmpl b/bin/jdownloader/plugins/webinterface/link_adder.tmpl new file mode 100644 index 0000000..f3e34a8 --- /dev/null +++ b/bin/jdownloader/plugins/webinterface/link_adder.tmpl @@ -0,0 +1,117 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html> +<head> +<title>JDownloader - WebInterface v<tmpl_var webinterface_version></title> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> +<meta http-equiv="Content-Style-Type" content="text/css"> +<meta http-equiv="Content-Script-Type" content="text/javascript"> +<link href="jd.css" rel="stylesheet" type="text/css"> +<script type="text/javascript" src="filelist.js"></script> +<script type="text/javascript" src="scripts.js"></script> +<noscript><meta http-equiv="refresh" content="0;URL=nojs.tmpl"></noscript> +</head> + +<body> +<div id="main"> + + <div id="header"> + <h2 class="title">WebInterface<br>(Version <tmpl_var webinterface_version>)</h2> + </div> + + <div id="content"> + <div id="tabs"> + <ul id="tabmenu"> + <li class="active"><a href="index.tmpl" name="Status Page" target="_self">Status Page</a></li> + <li class="<tmpl_var unrar_available>"><A href="passwd.tmpl" name="Edit Passwords" target="_self">Edit Password-List</A></li> + <li><A class="active" href="link_adder.tmpl" name="Link Adder" target="_self">Add Links</A></li> + </ul> + </div> + + <div id="tabcontent"> + + <FORM action="link_adder.tmpl" name="jd" id="jdForm" method="POST" target="_parent"> + + <div id="toolbar"> + <div id="toolbarright"> + <span class="toolbarButton" id="btnClose" title="Close JD" onclick="validateandsubmit('Close JD?','jdForm','bye.tmpl', 'close')"></span> + <span class="toolbarButton" id="btnRestart" title="Restart JD" onclick="validateandsubmit('Restart JD?','jdForm','restart.tmpl', 'restart')"></span> + </div> + <div id="toolbarleft"> + <div style="height: 30px;"></div> + </div> + <div class="toolbarcenter"> + </div> + <br class="clear"> + </div> + + <div id="message_<tmpl_var message_status escape>"><tmpl_var message><div><a href="#" class="button" onclick="closeMessage();">Close Message</a></div></div> + + <table class="tabledownload" id="packageContainer"> + <tr> + <td style="width:2%;" class="tabletitle"> + <input type="checkbox" name="checkallbox" onclick="if (this.checked==true) {checkall(document.jd.package_all_add,document.jd.package_single_add); } else {uncheckall(document.jd.package_all_add,document.jd.package_single_add);}"> + </td> + <td class="tabletitle">File</td> + <td class="tabletitle">Hoster</td> + </tr> + + + <tmpl_loop pakete> + <tr class="package<tmpl_var download_status escape>"> + <td><INPUT type="checkbox" name="package_all_add" value="<tmpl_var package_id escape>" onclick="samecheckall(document.jd.package_single_add,this)"></td> + <td colspan="2">Package-Name: <INPUT size="35" type="text" name="adder_package_name_<tmpl_var package_id escape>" value="<tmpl_var download_name escape>"> <!--<span style="margin-left: 30px;">Password:</span> <INPUT size="35" type="text" name="adder_password_<tmpl_var package_id escape>" value="">--></td> + </tr> + + <tmpl_loop downloads> + <tr class="download<tmpl_var download_status escape>" banane="sdf"> + <td><INPUT type="checkbox" name="package_single_add" value="<tmpl_var package_id escape> <tmpl_var download_id escape>" onclick="areallsamechecked(this,document.jd.package_single_add,document.jd.package_all_add)"></TD> + <td style="padding-left: 30px;"><tmpl_var download_name></TD> + <td><tmpl_var download_hoster></TD> + </tr> + </tmpl_loop> + + </tmpl_loop> + </table> + + <script type="text/javascript"> + // This must be placed immediately after the filelists (packages/downloads). + initiate('addlinks'); + </script> + + <DIV class="leftDLOptions"> + <SELECT name="selected_dowhat_link_adder"> + <option>add</option> + <option>remove</option> + <option>remove offline</option> + </SELECT> + <a href="#" class="button" onclick="adderSubmit(document.jd.selected_dowhat_link_adder);">Go!</a> + </DIV> + <br> + </FORM> + + <h1>Add Links</h1> + <FORM name="add" id="addForm" action="link_adder.tmpl" target="_parent" method="POST"> + <DIV class="linkAddBox"> + <div style="float:right;"> + <a href="#" onclick="submitForm('addForm','link_adder.tmpl','do','Add')" class="addButton">Add</a> + </div> + + <div style="padding-right: 100px;"> + <textarea name="addlinks" cols="90" rows="3" onfocus="formElementChanged(); clean(this);" style="width:100%; float:left;">Paste your Links here (Container URLs, Link URLs, SourceCode from Pages to parse)</textarea> + </div> + <br class="clear"> + </DIV> + </FORM> + + <h1>Upload container file</h1> + <form name="upload" id="uploadForm" action="link_adder.tmpl" method="post" enctype="multipart/form-data"> + <div class="linkAddBox"> + <span style="color: #000; font-weight:bold;">Container upload:</span> <input name="container" type="file" size="50"> <a href="#" class="button" onclick="submitForm('uploadForm','link_adder.tmpl','do','Upload')">Upload!</a> + </div> + </form> + </div> + </div> +</div> +<div id="footer">Addon by jiaz, Design (HTML, CSS, JS) by Bo0nZ</div> +</body> +</html> diff --git a/bin/jdownloader/plugins/webinterface/nojs.tmpl b/bin/jdownloader/plugins/webinterface/nojs.tmpl new file mode 100644 index 0000000..d8ae222 --- /dev/null +++ b/bin/jdownloader/plugins/webinterface/nojs.tmpl @@ -0,0 +1,16 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html> +<head> +<title>JDownloader - WebInterface v<tmpl_var webinterface_version></title> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> +<meta http-equiv="Content-Style-Type" content="text/css"> +<meta http-equiv="Content-Script-Type" content="text/javascript"> +<link href="jd.css" rel="stylesheet" type="text/css"> +</head> + +<body> +<div id="message"> +<A href="index.tmpl" target="_self">You need to have JavaScript enabled. Click here after you have enabled JavaScript in your WebBrowser.</A> +</div> +</body> +</html>
\ No newline at end of file diff --git a/bin/jdownloader/plugins/webinterface/passwd.tmpl b/bin/jdownloader/plugins/webinterface/passwd.tmpl new file mode 100644 index 0000000..67a32e6 --- /dev/null +++ b/bin/jdownloader/plugins/webinterface/passwd.tmpl @@ -0,0 +1,56 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html> +<head> +<title>JDownloader - WebInterface v<tmpl_var webinterface_version></title> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> +<meta http-equiv="Content-Style-Type" content="text/css"> +<meta http-equiv="Content-Script-Type" content="text/javascript"> +<link href="jd.css" rel="stylesheet" type="text/css"> +<script type="text/javascript" src="filelist.js"></script> +<script type="text/javascript" src="scripts.js"></script> +<noscript><meta http-equiv="refresh" content="0;URL=nojs.tmpl"></noscript> +</head> + +<body> +<div id="main"> + + <div id="header"> + <h2 class="title">WebInterface<br>(Version <tmpl_var webinterface_version>)</h2> + </div> + + <div id="content"> + <div id="tabs"> + <ul id="tabmenu"> + <li class="active"><a href="index.tmpl" name="Status Page" target="_self">Status Page</a></li> + <li class="<tmpl_var unrar_available>"><A class="active" href="passwd.tmpl" name="Edit Passwords" target="_self">Edit Password-List</A></li> + <li><A href="link_adder.tmpl" name="Link Adder" target="_self">Add Links</A></li> + </ul> + </div> + + <div id="tabcontent"> + + <FORM name="jdForm" id="jdForm" action="passwd.tmpl" target="_parent" method="POST"> + + <div id="toolbar"> + <div id="toolbarright"> + <span class="toolbarButton" id="btnClose" title="Close JD" onclick="validateandsubmit('Close JD?','jdForm','bye.tmpl', 'close')"></span> + <span class="toolbarButton" id="btnRestart" title="Restart JD" onclick="validateandsubmit('Restart JD?','jdForm','restart.tmpl', 'restart')"></span> + </div> + <div id="toolbarleft"> + <span class="toolbarButton" id="btnSave" title="Save Password-List" onclick="submitForm('jdForm','passwd.tmpl', 'passwd', 'Save')"></span> + </div> + <div class="toolbarcenter"> + </div> + <br class="clear"> + </div> + + <DIV> + <textarea name="password_list" cols="90" rows="20" style="width:100%;"><tmpl_var password_list></textarea><br> + </DIV> + </FORM> + </div> + </div> +</div> +<div id="footer">Addon by jiaz, Design (HTML, CSS, JS) by Bo0nZ</div> +</body> +</html> diff --git a/bin/jdownloader/plugins/webinterface/reconnect.tmpl b/bin/jdownloader/plugins/webinterface/reconnect.tmpl new file mode 100644 index 0000000..ee0d2c0 --- /dev/null +++ b/bin/jdownloader/plugins/webinterface/reconnect.tmpl @@ -0,0 +1,25 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html> +<head> +<title>JDownloader - WebInterface v<tmpl_var webinterface_version></title> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> +<meta http-equiv="Content-Style-Type" content="text/css"> +<meta http-equiv="Content-Script-Type" content="text/javascript"> +<link href="jd.css" rel="stylesheet" type="text/css"> +<script type="text/javascript" src="scripts.js"></script> +</head> + +<body> + +<div id="message"> +<A href="index.tmpl" name="Wait 30 seconds or Click here" target="_self">Manual Reconnect ... (Wait <span id="countdown">30</span> seconds or click here)</A> +</div> + +<script language="javascript"> +<!-- +countdown(30, 'countdown'); +// --> +</script> + +</body> +</html>
\ No newline at end of file diff --git a/bin/jdownloader/plugins/webinterface/restart.tmpl b/bin/jdownloader/plugins/webinterface/restart.tmpl new file mode 100644 index 0000000..fe8b1e0 --- /dev/null +++ b/bin/jdownloader/plugins/webinterface/restart.tmpl @@ -0,0 +1,25 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html> +<head> +<title>JDownloader - WebInterface v<tmpl_var webinterface_version></title> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> +<meta http-equiv="Content-Style-Type" content="text/css"> +<meta http-equiv="Content-Script-Type" content="text/javascript"> +<link href="jd.css" rel="stylesheet" type="text/css"> +<script type="text/javascript" src="scripts.js"></script> +</head> + +<body> + +<div id="message"> +<A href="index.tmpl" name="Wait 10 seconds or Click here" target="_self">Restarting JD ... (Wait <span id="countdown">10</span> seconds or click here)</A> +</div> + +<script language="javascript"> +<!-- +countdown(10, 'countdown'); +// --> +</script> + +</body> +</html>
\ No newline at end of file diff --git a/bin/jdownloader/plugins/webinterface/scripts.js b/bin/jdownloader/plugins/webinterface/scripts.js new file mode 100644 index 0000000..f3b1826 --- /dev/null +++ b/bin/jdownloader/plugins/webinterface/scripts.js @@ -0,0 +1,429 @@ +var alreadyCleaned = false; +var autoPageReloadActive = true; +var IE = (document.all) ? true : false; + + +function pageLoaded() { + if(document.cookie) { + var cookieArray = document.cookie.split(";"); + + for(i in cookieArray){ + var cookieName = cookieArray[i].split("=")[0].replace(/ /g,""); + var cookieValue = cookieArray[i].split("=")[1].replace(/ /g,""); + + /* show the area of the page that has been shown on the last visit */ + if (cookieName=="scroll") { + //Konqueror needs a delay ?! + window.setTimeout("window.scrollTo("+cookieValue.split(":")[0]+", "+cookieValue.split(":")[1]+")", 1); + //window.scrollTo(cookieValue.split(":")[0], cookieValue.split(":")[1]); + } + } + } +} + +function checkall(field,field2) +{ + /* field.length can be null when + there exist only one package + with only one file */ + formElementChanged(); + + if (field != null) { + if (field.length != null) { + for (i = 0; i < field.length; i++) { + field[i].checked = true ; + } + } else { + field.checked = true; + } + } + + if (field2 != null) { + if (field2.length != null) { + for (i = 0; i < field2.length; i++) { + field2[i].checked = true ; + } + } else { + field2.checked = true; + } + } +} + +function uncheckall(field,field2) +{ + /* field.length can be null when + there exist only one package + with only one file */ + formElementChanged(); + + if (field != null) { + if (field.length != null) { + for (i = 0; i < field.length; i++) { + field[i].checked = false ; + } + } else { + field.checked = false; + } + } + + if (field2 != null) { + if (field2.length != null) { + for (i = 0; i < field2.length; i++) { + field2[i].checked = false ; + } + } else { + field2.checked = false; + } + } +} + +function samecheckall(field,id) +{ + formElementChanged(); + + /* field.length can be null when + there exist only one package + with only one file */ + if (field != null) { + if (field.length != null) { + for (i = 0; i < field.length; i++) { + var name=field[i].value.split(" "); + + if (name[0]==id.value) { + field[i].checked = id.checked; + } + }; + } else { + field.checked = id.checked; + } + } + + areallchecked(field); +} + +function areallsamechecked(id,field,field2) +{ + formElementChanged(); + + /* field.length can be null when + there exist only one package + with only one file */ + var tempid=id.value.split(" "); + var chkid=tempid[0]; + var allchecked=true; + + if (field != null) { + if (field.length != null) { + for (i = 0; i < field.length; i++){ + var name=field[i].value.split(" "); + if (name[0]==chkid) + { + if (field[i].checked==false) allchecked=false; + } + } + } else { + if (field.checked==false) allchecked=false; + } + } + + if (field2 != null) { + if (field2.length != null) { + for (i = 0; i < field2.length; i++){ + if ( field2[i].value==chkid ) + { + field2[i].checked=allchecked; + } + } + } else { + field2.checked=allchecked; + } + } + + areallchecked(field); +} + +function areallchecked(field) +{ + if (field != null) { + if (field.length != null && field.length > 0) { + var allchecked = true; + + // is any field (single download) unchecked? + for (i = 0; i < field.length; i++){ + if (field[i].checked == false) { + allchecked = false; + } + } + + document.jd.checkallbox.checked = allchecked; + + } else { + document.jd.checkallbox.checked = field.checked; + } + } +} + +function adderSubmit(field) +{ + if (field.value=="add") { + field.form.action="index.tmpl"; + } + + submitForm('jdForm',field.form.action,'do','Submit') +} + +function validateandsubmit(msg,jdForm,dest,val) +{ +/* msg anzeigen und bei nein wird vom button der value gelöscht, bei ja zu dest submited*/ + conf=window.confirm(msg); + if (conf == true) + { + submitForm(jdForm, dest, "do", val); + } +} + +/* + * submit the form to the dest with the val as do-Action + */ +function submitForm(jdForm, dest, fieldname, val) { + var hfield = document.createElement("input"); + hfield.type = "hidden"; + hfield.name = fieldname; + hfield.value = val; + + var formular = document.getElementById(jdForm); + formular.insertBefore(hfield,formular.firstChild); + + formular.action=dest; + formular.submit(); +} + +/* + * Switch between Auto-Reconnect on/off + */ +function switchAutoReconnect(jdForm, dest, currentStatus) { + var newChecked = (currentStatus=='checked')? false : true; + document.getElementById('autoreconnect').checked = newChecked; + submitForm(jdForm, dest, 'do', 'submit'); +} + +function clean(whattoclean) +{ +/*delete the value of whattoclean + if it was already cleaned nothin happens*/ + if (alreadyCleaned==false) { + whattoclean.value=""; + alreadyCleaned = true; + } +} + +function forwardto(wohin) { +/*zu seite 'wohin' weiterleiten*/ + window.location.replace( wohin ); +} + +function startPageReload(interval) { + if (interval != 0) { + setTimeout("reloadPage()", interval*1000); + } +} + +function reloadPage() { + if (autoPageReloadActive==true) { + //save coordinates of visible area in a cookie + var cookieExpire = new Date(new Date().getTime() + 365*24*60*60*1000).toGMTString(); + + var diffY, diffX; + if (IE) { diffY = document.documentElement.scrollTop; diffX = document.documentElement.scrollLeft; } + else { diffY = window.pageYOffset; diffX = window.pageXOffset; } + + document.cookie = "scroll="+diffX+":"+diffY+";expires="+cookieExpire; + + //reload + window.location.replace( window.location ); + } +} + +function countdown(sec, eid) { + document.getElementById(eid).innerHTML = sec; + if (sec > 0) { + setTimeout("countdown("+(sec-1)+", '"+eid+"')", 1000); + } else { + forwardto('index.tmpl') + } +} + +function formElementChanged() { +//deactivateAutoPageReload + autoPageReloadActive=false; + + var notify = document.getElementById('deactivatedAutoReload'); + + if (notify != null) { + notify.style.display = "block"; + } +} + +/*popup code*/ +var pop = null; + +function popup(obj,w,h) { + var url = (obj.getAttribute) ? obj.getAttribute('href') : obj.href; + if (!url) return true; + w = (w) ? w += 20 : 150; // 150px*150px is the default size + h = (h) ? h += 25 : 150; + var args = 'width='+w+',height='+h+',resizable,scrollbars'; + //var args = 'width='+w+',height='+h+',resizable,scrollbars,location,menubar,status'; + popdown(); + pop = window.open(url,'',args); + return (pop) ? false : true; +} + +function popdown() { + if (pop && !pop.closed) pop.close(); +} + +function resizeInfoWindow(tableid, currWidth) { + var table = document.getElementById(tableid); + + var newheight = table.getElementsByTagName('tr').length * 20 + 75; + var maxheight = screen.availHeight; + newheight = (newheight > maxheight)? maxheight : newheight; + window.resizeTo(currWidth, newheight); +} + +//window.onunload = popdown; +//window.onfocus = popdown; + +function allowChars(id, chars) { + var obj = document.getElementById(id); + + if(obj.type == "text" || obj.type == "textarea") { + + obj.timer = ""; + obj.chars = chars; + + controllFunc = function() { + //var self = this; + var self = obj; + controll = function() { + //check each char + for(var t='',x=0; x<self.value.length; ++x) { + if(self.chars.indexOf(self.value.charAt(x))>-1) { + t += self.value.charAt(x); + } + } + self.value = t; + }; + self.timer = setTimeout(controll,1); + }; + + clearFunc = function() { + clearTimeout(this.timer); + }; + + // add EventListener + if (obj.addEventListener) { + obj.addEventListener ("keypress", controllFunc, false); + obj.addEventListener ("keydown", controllFunc, false); + obj.addEventListener ("keyup", clearFunc, false); + + } else if (obj.attachEvent) { + // IE + obj.attachEvent("onkeypress", controllFunc); + obj.attachEvent("onkeydown", controllFunc); + obj.attachEvent("onkeyup", clearFunc); + } + } +} + +function closeMessage() { + var msg = document.getElementById("message_show"); + msg.id = "message_hide"; +} + +/********************* + * ProgressBars + *********************/ + + //for running downloads +function setProgressBarsColors(oldColor, newColor) { + //accept only color-values in hex (6 digits) + if (oldColor.length != 6 || newColor.length != 6 || + isNaN(parseInt("0x"+oldColor) || isNan(parseInt("0x"+newColor)))) { + return; + } + + var rOld = parseInt("0x"+oldColor.substr(0,2)); + var gOld = parseInt("0x"+oldColor.substr(2,2)); + var bOld = parseInt("0x"+oldColor.substr(4,2)); + + var rNew = parseInt("0x"+newColor.substr(0,2)); + var gNew = parseInt("0x"+newColor.substr(2,2)); + var bNew = parseInt("0x"+newColor.substr(4,2)); + + var rStep = (rNew - rOld)/100; + var gStep = (gNew - gOld)/100; + var bStep = (bNew - bOld)/100; + + var nextPackage = 0; + + // for all packages incl downloads + while (true) { + var nextDownload = 0; + var pack = document.getElementById(nextPackage); + + //got all packages incl all dls? + if (pack == null) break; + + //package-color + pack.style.backgroundColor = "#" + getProgressBarColor(rOld, gOld, bOld, rStep, gStep, bStep, parseInt(pack.style.width)); + + //dls in this package + while (true) { + var dl = document.getElementById(nextPackage + "_" + nextDownload); + + //got all dls in this package? + if (dl == null) break; + + //download-color + dl.style.backgroundColor = "#" + getProgressBarColor(rOld, gOld, bOld, rStep, gStep, bStep, parseInt(dl.style.width)); + + nextDownload++; + } + + nextPackage++; + } +} + +function getProgressBarColor(rOld, gOld, bOld, rStep, gStep, bStep, progress) { + var rNew = rOld + rStep*progress; + var gNew = gOld + gStep*progress; + var bNew = bOld + bStep*progress; + + rNew = (rNew>255)? 255 : rNew; + gNew = (gNew>255)? 255 : gNew; + bNew = (bNew>255)? 255 : bNew; + + rNew = (rNew<0)? 0 : rNew; + gNew = (gNew<0)? 0 : gNew; + bNew = (bNew<0)? 0 : bNew; + + return intToHex(rNew)+intToHex(gNew)+intToHex(bNew); +} + +function intToHex(int) { + var chars = new Array('0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'); + var hex = ""; + + var temp = parseInt(int); + while (temp > 0) { + hex = chars[temp % 16] + hex; + temp = parseInt(temp / 16) + } + + if (hex.length == 0) hex = "00"; + if (hex.length % 2 != 0) hex = "0"+hex; + + return hex; +}
\ No newline at end of file diff --git a/bin/jdownloader/plugins/webinterface/single_info.tmpl b/bin/jdownloader/plugins/webinterface/single_info.tmpl new file mode 100644 index 0000000..c23a815 --- /dev/null +++ b/bin/jdownloader/plugins/webinterface/single_info.tmpl @@ -0,0 +1,44 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html> +<head> +<title>JDownloader - WebInterface v<tmpl_var webinterface_version></title> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> +<meta http-equiv="Content-Style-Type" content="text/css"> +<meta http-equiv="Content-Script-Type" content="text/javascript"> +<link href="jd.css" rel="stylesheet" type="text/css"> +<script type="text/javascript" src="scripts.js"></script> +</head> + +<body> +<div class="hide" style="width:0%;" id="0"> </div><!--package - needed by setProgressBarsColors--> +<table width="95%" align="center" id="infotable"> +<tbody> + <tmpl_loop single_infos> + <tr> + <td class="description"><tmpl_var info_var></td> + + <tmpl_if download_status> + <td class="ladebalken"> + <div class="ladebalken"> + <div class="ladebalkenWrapper"> + <div name="ladebalken" class="<tmpl_var download_status escape>" style="width: <tmpl_var info_percent escape>%;" id="0_<tmpl_var download_id escape>"> </div> + </div> + <span class="ladestatus"><tmpl_var info_value></span><br class="clear"> + </div> + </td> + <tmpl_else> + <td class="value"><tmpl_var info_value></td> + </tmpl_if> + + </tr> + </tmpl_loop> +</tbody> +</table> + +<script type="text/javascript"> + setProgressBarsColors('f5f502', '02CE02'); + startPageReload(<tmpl_var page_refresh>); + resizeInfoWindow("infotable", 600); +</script> +</body> +</html>
\ No newline at end of file |