Browse Source

Prepare WebUI resources.

Html/Css/JavaScript files displacement.
Also add new icon.
adaptive-webui-19844
Vladimir Golovnev (Glassez) 10 years ago
parent
commit
3d20f2f670
  1. BIN
      src/Icons/oxygen/system-log-out.png
  2. 5
      src/icons.qrc
  3. 14
      src/webui/webui.pri
  4. 74
      src/webui/webui.qrc
  5. 61
      src/webui/www/private/index.html
  6. 76
      src/webui/www/private/login.html
  7. 0
      src/webui/www/public/about.html
  8. 0
      src/webui/www/public/addtrackers.html
  9. 0
      src/webui/www/public/confirmdeletion.html
  10. 0
      src/webui/www/public/css/Core.css
  11. 0
      src/webui/www/public/css/Layout.css
  12. 0
      src/webui/www/public/css/Tabs.css
  13. 0
      src/webui/www/public/css/Window.css
  14. 0
      src/webui/www/public/css/dynamicTable.css
  15. 0
      src/webui/www/public/css/style.css
  16. 0
      src/webui/www/public/download.html
  17. 0
      src/webui/www/public/downloadlimit.html
  18. 0
      src/webui/www/public/filters.html
  19. 0
      src/webui/www/public/preferences.html
  20. 0
      src/webui/www/public/preferences_content.html
  21. 0
      src/webui/www/public/prop-files.html
  22. 0
      src/webui/www/public/prop-general.html
  23. 0
      src/webui/www/public/prop-trackers.html
  24. 0
      src/webui/www/public/properties.html
  25. 0
      src/webui/www/public/scripts/client.js
  26. 0
      src/webui/www/public/scripts/contextmenu.js
  27. 0
      src/webui/www/public/scripts/download.js
  28. 0
      src/webui/www/public/scripts/dynamicTable.js
  29. 0
      src/webui/www/public/scripts/excanvas-compressed.js
  30. 25
      src/webui/www/public/scripts/mocha-init.js
  31. 0
      src/webui/www/public/scripts/mocha-yc.js
  32. 0
      src/webui/www/public/scripts/mocha.js
  33. 0
      src/webui/www/public/scripts/mootools-1.2-core-yc.js
  34. 0
      src/webui/www/public/scripts/mootools-1.2-more.js
  35. 0
      src/webui/www/public/scripts/parametrics.js
  36. 0
      src/webui/www/public/scripts/progressbar.js
  37. 0
      src/webui/www/public/transferlist.html
  38. 0
      src/webui/www/public/upload.html
  39. 0
      src/webui/www/public/uploadlimit.html

BIN
src/Icons/oxygen/system-log-out.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

5
src/icons.qrc

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
<!DOCTYPE RCC><RCC version="1.0">
<qresource>
<RCC>
<qresource prefix="/">
<file>Icons/3-state-checkbox.gif</file>
<file>Icons/L.gif</file>
<file>Icons/loading.png</file>
@ -349,5 +349,6 @@ @@ -349,5 +349,6 @@
<file>Icons/skin/tabs.gif</file>
<file>Icons/skin/toolbox-divider.gif</file>
<file>Icons/skin/uploading.png</file>
<file>Icons/oxygen/system-log-out.png</file>
</qresource>
</RCC>

14
src/webui/webui.pri

@ -6,10 +6,11 @@ HEADERS += $$PWD/httpserver.h \ @@ -6,10 +6,11 @@ HEADERS += $$PWD/httpserver.h \
$$PWD/httpresponsegenerator.h \
$$PWD/btjson.h \
$$PWD/prefjson.h \
$$PWD/httpheader.h \
$$PWD/httprequestheader.h \
$$PWD/httpresponseheader.h \
$$PWD/jsonutils.h
$$PWD/jsonutils.h \
$$PWD/httptypes.h \
$$PWD/extra_translations.h \
$$PWD/webapplication.h \
$$PWD/requesthandler.h
SOURCES += $$PWD/httpserver.cpp \
$$PWD/httpconnection.cpp \
@ -17,9 +18,8 @@ SOURCES += $$PWD/httpserver.cpp \ @@ -17,9 +18,8 @@ SOURCES += $$PWD/httpserver.cpp \
$$PWD/httpresponsegenerator.cpp \
$$PWD/btjson.cpp \
$$PWD/prefjson.cpp \
$$PWD/httpheader.cpp \
$$PWD/httprequestheader.cpp \
$$PWD/httpresponseheader.cpp
$$PWD/webapplication.cpp \
$$PWD/requesthandler.cpp
# QJson JSON parser/serializer for using with Qt4
lessThan(QT_MAJOR_VERSION, 5) {

74
src/webui/webui.qrc

@ -1,37 +1,39 @@ @@ -1,37 +1,39 @@
<!DOCTYPE RCC><RCC version="1.0">
<qresource prefix="webui/">
<file>html/index.html</file>
<file>html/download.html</file>
<file>html/addtrackers.html</file>
<file>html/upload.html</file>
<file>html/about.html</file>
<file>html/filters.html</file>
<file>html/transferlist.html</file>
<file>html/prop-general.html</file>
<file>html/prop-trackers.html</file>
<file>html/prop-files.html</file>
<file>html/properties.html</file>
<file>html/uploadlimit.html</file>
<file>html/downloadlimit.html</file>
<file>html/preferences.html</file>
<file>html/preferences_content.html</file>
<file>html/confirmdeletion.html</file>
<file>css/Core.css</file>
<file>css/Layout.css</file>
<file>css/Window.css</file>
<file>css/Tabs.css</file>
<file>css/dynamicTable.css</file>
<file>css/style.css</file>
<file>scripts/excanvas-compressed.js</file>
<file>scripts/mocha-yc.js</file>
<file>scripts/mocha-init.js</file>
<file>scripts/mootools-1.2-core-yc.js</file>
<file>scripts/mootools-1.2-more.js</file>
<file>scripts/dynamicTable.js</file>
<file>scripts/client.js</file>
<file>scripts/download.js</file>
<file>scripts/progressbar.js</file>
<file>scripts/contextmenu.js</file>
<file>scripts/parametrics.js</file>
</qresource>
<RCC>
<qresource prefix="/">
<file>www/private/index.html</file>
<file>www/private/login.html</file>
<file>www/public/css/Core.css</file>
<file>www/public/css/dynamicTable.css</file>
<file>www/public/css/Layout.css</file>
<file>www/public/css/style.css</file>
<file>www/public/css/Tabs.css</file>
<file>www/public/css/Window.css</file>
<file>www/public/scripts/client.js</file>
<file>www/public/scripts/contextmenu.js</file>
<file>www/public/scripts/download.js</file>
<file>www/public/scripts/dynamicTable.js</file>
<file>www/public/scripts/excanvas-compressed.js</file>
<file>www/public/scripts/mocha.js</file>
<file>www/public/scripts/mocha-init.js</file>
<file>www/public/scripts/mocha-yc.js</file>
<file>www/public/scripts/mootools-1.2-core-yc.js</file>
<file>www/public/scripts/mootools-1.2-more.js</file>
<file>www/public/scripts/parametrics.js</file>
<file>www/public/scripts/progressbar.js</file>
<file>www/public/about.html</file>
<file>www/public/addtrackers.html</file>
<file>www/public/confirmdeletion.html</file>
<file>www/public/download.html</file>
<file>www/public/downloadlimit.html</file>
<file>www/public/filters.html</file>
<file>www/public/preferences.html</file>
<file>www/public/preferences_content.html</file>
<file>www/public/properties.html</file>
<file>www/public/prop-files.html</file>
<file>www/public/prop-general.html</file>
<file>www/public/prop-trackers.html</file>
<file>www/public/transferlist.html</file>
<file>www/public/upload.html</file>
<file>www/public/uploadlimit.html</file>
</qresource>
</RCC>

61
src/webui/html/index.html → src/webui/www/private/index.html

@ -8,10 +8,10 @@ @@ -8,10 +8,10 @@
<link rel="stylesheet" href="css/dynamicTable.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
<!--<link rel="stylesheet" type="text/css" href="css/Content.css" />-->
<link rel="stylesheet" type="text/css" href="css/Core.css" />
<link rel="stylesheet" type="text/css" href="css/Layout.css" />
<link rel="stylesheet" type="text/css" href="css/Window.css" />
<link rel="stylesheet" type="text/css" href="css/Tabs.css" />
<link rel="stylesheet" type="text/css" href="css/Core.css" />
<link rel="stylesheet" type="text/css" href="css/Layout.css" />
<link rel="stylesheet" type="text/css" href="css/Window.css" />
<link rel="stylesheet" type="text/css" href="css/Tabs.css" />
<script type="text/javascript" src="scripts/mootools-1.2-core-yc.js" charset="utf-8"></script>
<script type="text/javascript" src="scripts/mootools-1.2-more.js" charset="utf-8"></script>
<!--[if IE]>
@ -37,7 +37,8 @@ @@ -37,7 +37,8 @@
<ul>
<li><a id="uploadLink"><img class="MyMenuIcon" src="theme/list-add" width="16" height="16" onload="fixPNG(this)"/>_(&Add torrent file...)</a></li>
<li><a id="downloadLink"><img class="MyMenuIcon" src="theme/insert-link" width="16" height="16" onload="fixPNG(this)"/>_(Add &link to torrent...)</a></li>
<li class="divider"><a id="shutdownLink"><img class="MyMenuIcon" src="theme/application-exit" width="16" height="16" onload="fixPNG(this)"/>_(Exit qBittorrent)</a></li>
<li class="divider"><a id="logoutLink"><img class="MyMenuIcon" src="theme/system-log-out" width="16" height="16" onload="fixPNG(this)"/>_(Logout)</a></li>
<li><a id="shutdownLink"><img class="MyMenuIcon" src="theme/application-exit" width="16" height="16" onload="fixPNG(this)"/>_(Exit qBittorrent)</a></li>
</ul>
</li>
<li>
@ -69,15 +70,15 @@ @@ -69,15 +70,15 @@
</ul>
</div>
<div id="mochaToolbar">
&nbsp;&nbsp;
&nbsp;&nbsp;
<a id="uploadButton"><img class="mochaToolButton" title="_(&Add torrent file...)" src="theme/list-add" width="24" height="24" onload="fixPNG(this)"/></a>
<a id="downloadButton"><img class="mochaToolButton" title="_(Add &link to torrent...)" src="theme/insert-link" width="24" height="24" onload="fixPNG(this)"/></a>
<a id="deleteButton" class="divider"><img class="mochaToolButton" title="_(Delete)" src="theme/list-remove" width="24" height="24" onload="fixPNG(this)"/></a>
<a id="deleteButton" class="divider"><img class="mochaToolButton" title="_(Delete)" src="theme/list-remove" width="24" height="24" onload="fixPNG(this)"/></a>
<a id="resumeButton" class="divider"><img class="mochaToolButton" title="_(Resume)" src="theme/media-playback-start" width="24" height="24" onload="fixPNG(this)"/></a>
<a id="pauseButton"><img class="mochaToolButton" title="_(Pause)" src="theme/media-playback-pause" width="24" height="24" onload="fixPNG(this)"/></a>
<span id="queueingButtons">
<a id="decreasePrioButton" class="divider"><img class="mochaToolButton" title="_(Decrease priority)" src="theme/go-down" width="24" height="24" onload="fixPNG(this)"/></a>
<a id="increasePrioButton"><img class="mochaToolButton" title="_(Increase priority)" src="theme/go-up" width="24" height="24" onload="fixPNG(this)"/></a>
<a id="decreasePrioButton" class="divider"><img class="mochaToolButton" title="_(Decrease priority)" src="theme/go-down" width="24" height="24" onload="fixPNG(this)"/></a>
<a id="increasePrioButton"><img class="mochaToolButton" title="_(Increase priority)" src="theme/go-up" width="24" height="24" onload="fixPNG(this)"/></a>
</span>
<a id="preferencesButton" class="divider"><img class="mochaToolButton" title="_(Options)" src="theme/preferences-system" width="24" height="24" onload="fixPNG(this)"/></a>
</div>
@ -85,28 +86,28 @@ @@ -85,28 +86,28 @@
<div id="pageWrapper"><span id="error_div"></span>
</div>
</div>
<ul id="contextmenu">
<li><a href="#Start"><img src="theme/media-playback-start"/> _(Resume)</a></li>
<li><a href="#Pause"><img src="theme/media-playback-pause"/> _(Pause)</a></li>
<li class="separator"><a href="#Delete""><img src="theme/list-remove"/> _(Delete)</a></li>
<li class="separator"><a href="#priority" class="arrow-right">_(Priority)</a>
<ul>
<li><a href="#prioTop""><img src="theme/go-top"/> _(Move to top)</a></li>
<li><a href="#prioUp"><img src="theme/go-up"/> _(Move up)</a></li>
<li><a href="#prioDown"><img src="theme/go-down"/> _(Move down)</a></li>
<li><a href="#prioBottom"><img src="theme/go-bottom"/> _(Move to bottom)</a></li>
<ul id="contextmenu">
<li><a href="#Start"><img src="theme/media-playback-start"/> _(Resume)</a></li>
<li><a href="#Pause"><img src="theme/media-playback-pause"/> _(Pause)</a></li>
<li class="separator"><a href="#Delete""><img src="theme/list-remove"/> _(Delete)</a></li>
<li class="separator"><a href="#priority" class="arrow-right">_(Priority)</a>
<ul>
<li><a href="#prioTop""><img src="theme/go-top"/> _(Move to top)</a></li>
<li><a href="#prioUp"><img src="theme/go-up"/> _(Move up)</a></li>
<li><a href="#prioDown"><img src="theme/go-down"/> _(Move down)</a></li>
<li><a href="#prioBottom"><img src="theme/go-bottom"/> _(Move to bottom)</a></li>
</ul>
</li>
<li class="separator"><a href="#DownloadLimit"><img src="images/skin/download.png"/> _(Limit download rate...)</a></li>
<li><a href="#UploadLimit"><img src="images/skin/seeding.png"/> _(Limit upload rate...)</a></li>
<li class="separator"><a href="#ForceRecheck"><img src="theme/document-edit-verify"/> _(Force recheck)</a></li>
</ul>
</li>
<li class="separator"><a href="#DownloadLimit"><img src="images/skin/download.png"/> _(Limit download rate...)</a></li>
<li><a href="#UploadLimit"><img src="images/skin/seeding.png"/> _(Limit upload rate...)</a></li>
<li class="separator"><a href="#ForceRecheck"><img src="theme/document-edit-verify"/> _(Force recheck)</a></li>
</ul>
<div id="desktopFooterWrapper">
<div id="desktopFooter">
<table style="position: absolute; right: 5px;">
<tr><td id="DlInfos" style="cursor:pointer;"></td><td style="width: 2px;margin:0;"><img src="images/skin/toolbox-divider.gif" style="height: 18px; padding-left: 10px; padding-right: 10px; margin-bottom: -2px;"/></td><td id="UpInfos" style="cursor:pointer;"></td></tr>
<div id="desktopFooterWrapper">
<div id="desktopFooter">
<table style="position: absolute; right: 5px;">
<tr><td id="DlInfos" style="cursor:pointer;"></td><td style="width: 2px;margin:0;"><img src="images/skin/toolbox-divider.gif" style="height: 18px; padding-left: 10px; padding-right: 10px; margin-bottom: -2px;"/></td><td id="UpInfos" style="cursor:pointer;"></td></tr>
</table>
</div>
</div>
</div>
</div>
</body>
</html>

76
src/webui/www/private/login.html

@ -0,0 +1,76 @@ @@ -0,0 +1,76 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en" dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=8" />
<title>qBittorrent web User Interface</title>
<link rel="stylesheet" type="text/css" href="/css/style.css" />
<script type="text/javascript" src="scripts/mootools-1.2-core-yc.js" charset="utf-8"></script>
<script type="text/javascript">
window.addEvent('domready', function() {
$('loginform').addEvent('submit', function(e) {
new Event(e).stop();
submitLoginForm();
});
});
function submitLoginForm() {
new Request({
url: '/login',
method: 'post',
data: $('loginform').toQueryString(),
onFailure: function() {
alert("_(Unable to log in, qBittorrent is probably unreachable.)");
},
onSuccess: function(text) {
if (text == "Ok.") {
// Session started. Simply reload page.
window.location.reload();
} else {
$('error_msg').set('html', '_(Invalid Username or Password.)');
}
}
}).send();
}
</script>
<style>
.col {
display: inline-block;
vertical-align: middle;
}
.row {
margin-bottom: 5px;
}
#main {
margin-left: auto;
margin-right: auto;
text-align: center;
padding-top: 5em;
}
#formplace {
text-align: left;
padding: 10px;
}
#error_msg {
color: #f00;
}
</style>
</head>
<body>
<div id="main">
<h1>_(qBittorrent web User Interface)</h1>
<div id="logo" class="col">
<img src="images/skin/mascot.png" />
</div>
<div id="formplace" class="col">
<form id="loginform" action="">
<div class="row"><label for="username">_(Name)</label><br /><input type="text" id="username" name="username" /></div>
<div class="row"><label for="password">_(Password)</label><br /><input type="password" id="password" name="password" /></div>
<div class="row"><input type="submit" id="login" value="_(Login)" /></div>
</form>
</div>
<div id="error_msg"></div>
</div>
</body>
</html>

0
src/webui/html/about.html → src/webui/www/public/about.html

0
src/webui/html/addtrackers.html → src/webui/www/public/addtrackers.html

0
src/webui/html/confirmdeletion.html → src/webui/www/public/confirmdeletion.html

0
src/webui/css/Core.css → src/webui/www/public/css/Core.css

0
src/webui/css/Layout.css → src/webui/www/public/css/Layout.css

0
src/webui/css/Tabs.css → src/webui/www/public/css/Tabs.css

0
src/webui/css/Window.css → src/webui/www/public/css/Window.css

0
src/webui/css/dynamicTable.css → src/webui/www/public/css/dynamicTable.css

0
src/webui/css/style.css → src/webui/www/public/css/style.css

0
src/webui/html/download.html → src/webui/www/public/download.html

0
src/webui/html/downloadlimit.html → src/webui/www/public/downloadlimit.html

0
src/webui/html/filters.html → src/webui/www/public/filters.html

0
src/webui/html/preferences.html → src/webui/www/public/preferences.html

0
src/webui/html/preferences_content.html → src/webui/www/public/preferences_content.html

0
src/webui/html/prop-files.html → src/webui/www/public/prop-files.html

0
src/webui/html/prop-general.html → src/webui/www/public/prop-general.html

0
src/webui/html/prop-trackers.html → src/webui/www/public/prop-trackers.html

0
src/webui/html/properties.html → src/webui/www/public/properties.html

0
src/webui/scripts/client.js → src/webui/www/public/scripts/client.js

0
src/webui/scripts/contextmenu.js → src/webui/www/public/scripts/contextmenu.js

0
src/webui/scripts/download.js → src/webui/www/public/scripts/download.js

0
src/webui/scripts/dynamicTable.js → src/webui/www/public/scripts/dynamicTable.js

0
src/webui/scripts/excanvas-compressed.js → src/webui/www/public/scripts/excanvas-compressed.js

25
src/webui/scripts/mocha-init.js → src/webui/www/public/scripts/mocha-init.js

@ -247,15 +247,26 @@ initializeWindows = function(){ @@ -247,15 +247,26 @@ initializeWindows = function(){
});
});
addClickEvent('logout', function(e){
new Event(e).stop();
new Request({
url: '/logout',
method: 'get',
onSuccess: function() {
window.location.reload();
}
}).send();
});
addClickEvent('shutdown', function(e){
new Event(e).stop();
new Request({url: 'command/shutdown',
onSuccess: function() {
document.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?><!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\"><html xmlns=\"http://www.w3.org/1999/xhtml\"><head><title>_(qBittorrent has been shutdown.)</title><style type=\"text/css\">body { text-align: center; }</style></head><body><h1>_(qBittorrent has been shutdown.)</h1></body></html>");
stop();
}
}
).send();
new Request({
url: 'command/shutdown',
onSuccess: function() {
document.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?><!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\"><html xmlns=\"http://www.w3.org/1999/xhtml\"><head><title>_(qBittorrent has been shutdown.)</title><style type=\"text/css\">body { text-align: center; }</style></head><body><h1>_(qBittorrent has been shutdown.)</h1></body></html>");
stop();
}
}).send();
});
// Deactivate menu header links

0
src/webui/scripts/mocha-yc.js → src/webui/www/public/scripts/mocha-yc.js

0
src/webui/scripts/mocha.js → src/webui/www/public/scripts/mocha.js

0
src/webui/scripts/mootools-1.2-core-yc.js → src/webui/www/public/scripts/mootools-1.2-core-yc.js

0
src/webui/scripts/mootools-1.2-more.js → src/webui/www/public/scripts/mootools-1.2-more.js

0
src/webui/scripts/parametrics.js → src/webui/www/public/scripts/parametrics.js

0
src/webui/scripts/progressbar.js → src/webui/www/public/scripts/progressbar.js

0
src/webui/html/transferlist.html → src/webui/www/public/transferlist.html

0
src/webui/html/upload.html → src/webui/www/public/upload.html

0
src/webui/html/uploadlimit.html → src/webui/www/public/uploadlimit.html

Loading…
Cancel
Save