From 9ad5c7b5e23b4940e7a3ea3ca3a6fb77e6a8fab0 Mon Sep 17 00:00:00 2001 From: tpearson Date: Wed, 20 Jan 2010 02:37:40 +0000 Subject: Updated to final KDE3 ktorrent release (2.2.6) git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/ktorrent@1077377 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- plugins/webinterface/www/Makefile.am | 5 + plugins/webinterface/www/coldmilk/Makefile.am | 8 + plugins/webinterface/www/coldmilk/favicon.ico | Bin 0 -> 1406 bytes plugins/webinterface/www/coldmilk/icon.png | Bin 0 -> 26977 bytes .../www/coldmilk/icons/16x16/Makefile.am | 6 + .../www/coldmilk/icons/16x16/edit_user.png | Bin 0 -> 954 bytes .../www/coldmilk/icons/16x16/high_priority.png | Bin 0 -> 232 bytes .../www/coldmilk/icons/16x16/low_priority.png | Bin 0 -> 242 bytes .../www/coldmilk/icons/16x16/normal_priority.png | Bin 0 -> 215 bytes .../www/coldmilk/icons/16x16/only_seed.png | Bin 0 -> 237 bytes .../www/coldmilk/icons/22x22/Makefile.am | 6 + .../webinterface/www/coldmilk/icons/22x22/exit.png | Bin 0 -> 1397 bytes .../www/coldmilk/icons/22x22/ktstart_all.png | Bin 0 -> 1399 bytes .../www/coldmilk/icons/22x22/ktstop_all.png | Bin 0 -> 1128 bytes .../www/coldmilk/icons/22x22/remove.png | Bin 0 -> 1526 bytes .../www/coldmilk/icons/22x22/start.png | Bin 0 -> 1232 bytes .../webinterface/www/coldmilk/icons/22x22/stop.png | Bin 0 -> 963 bytes .../www/coldmilk/icons/32x32/Makefile.am | 6 + .../www/coldmilk/icons/32x32/configure.png | Bin 0 -> 1838 bytes .../www/coldmilk/icons/32x32/extender_opened.png | Bin 0 -> 1627 bytes .../www/coldmilk/icons/32x32/fileopen.png | Bin 0 -> 2231 bytes .../www/coldmilk/icons/32x32/folder1.png | Bin 0 -> 2698 bytes .../www/coldmilk/icons/48x48/Makefile.am | 6 + .../webinterface/www/coldmilk/icons/48x48/exit.png | Bin 0 -> 3109 bytes .../www/coldmilk/icons/48x48/switchuser.png | Bin 0 -> 3164 bytes .../www/coldmilk/icons/64x64/Makefile.am | 6 + .../webinterface/www/coldmilk/icons/64x64/down.png | Bin 0 -> 5486 bytes .../www/coldmilk/icons/64x64/folder1_man.png | Bin 0 -> 6388 bytes .../www/coldmilk/icons/64x64/looknfeel.png | Bin 0 -> 5512 bytes .../webinterface/www/coldmilk/icons/Makefile.am | 1 + plugins/webinterface/www/coldmilk/interface.js | 44 ++ plugins/webinterface/www/coldmilk/interface.php | 251 ++++++++++ plugins/webinterface/www/coldmilk/login.html | 55 +++ plugins/webinterface/www/coldmilk/page_update.js | 429 +++++++++++++++++ plugins/webinterface/www/coldmilk/rest.php | 265 +++++++++++ plugins/webinterface/www/coldmilk/shutdown.php | 21 + plugins/webinterface/www/coldmilk/style.css | 212 +++++++++ plugins/webinterface/www/default/Makefile.am | 9 + plugins/webinterface/www/default/details.php | 89 ++++ plugins/webinterface/www/default/favicon.ico | Bin 0 -> 1406 bytes plugins/webinterface/www/default/grad1.jpg | Bin 0 -> 367 bytes plugins/webinterface/www/default/grad2.jpg | Bin 0 -> 362 bytes plugins/webinterface/www/default/header_tile.png | Bin 0 -> 180 bytes plugins/webinterface/www/default/high_priority.png | Bin 0 -> 232 bytes plugins/webinterface/www/default/icon.png | Bin 0 -> 26977 bytes plugins/webinterface/www/default/interface.php | 152 ++++++ .../www/default/ktorrentwebinterfacelogo.png | Bin 0 -> 97320 bytes plugins/webinterface/www/default/login.html | 29 ++ plugins/webinterface/www/default/low_priority.png | Bin 0 -> 242 bytes plugins/webinterface/www/default/menu_bg.png | Bin 0 -> 249 bytes .../webinterface/www/default/normal_priority.png | Bin 0 -> 215 bytes plugins/webinterface/www/default/only_seed.png | Bin 0 -> 237 bytes plugins/webinterface/www/default/remove.png | Bin 0 -> 1039 bytes plugins/webinterface/www/default/shutdown.php | 13 + plugins/webinterface/www/default/start.png | Bin 0 -> 868 bytes plugins/webinterface/www/default/stop.png | Bin 0 -> 711 bytes plugins/webinterface/www/default/style.css | 13 + plugins/webinterface/www/default/stylen.css | 164 +++++++ plugins/webinterface/www/default/wz_tooltip.js | 509 +++++++++++++++++++++ plugins/webinterface/www/mobile/Makefile.am | 8 + plugins/webinterface/www/mobile/favicon.ico | Bin 0 -> 1406 bytes plugins/webinterface/www/mobile/interface.php | 113 +++++ .../www/mobile/ktorrentwebinterfacelogo.png | Bin 0 -> 97320 bytes plugins/webinterface/www/mobile/login.html | 24 + plugins/webinterface/www/mobile/remove.png | Bin 0 -> 1039 bytes plugins/webinterface/www/mobile/settings.php | 44 ++ plugins/webinterface/www/mobile/start.png | Bin 0 -> 868 bytes plugins/webinterface/www/mobile/stop.png | Bin 0 -> 711 bytes plugins/webinterface/www/mobile/torrent.php | 91 ++++ 69 files changed, 2579 insertions(+) create mode 100644 plugins/webinterface/www/Makefile.am create mode 100644 plugins/webinterface/www/coldmilk/Makefile.am create mode 100644 plugins/webinterface/www/coldmilk/favicon.ico create mode 100644 plugins/webinterface/www/coldmilk/icon.png create mode 100644 plugins/webinterface/www/coldmilk/icons/16x16/Makefile.am create mode 100644 plugins/webinterface/www/coldmilk/icons/16x16/edit_user.png create mode 100644 plugins/webinterface/www/coldmilk/icons/16x16/high_priority.png create mode 100644 plugins/webinterface/www/coldmilk/icons/16x16/low_priority.png create mode 100644 plugins/webinterface/www/coldmilk/icons/16x16/normal_priority.png create mode 100644 plugins/webinterface/www/coldmilk/icons/16x16/only_seed.png create mode 100644 plugins/webinterface/www/coldmilk/icons/22x22/Makefile.am create mode 100644 plugins/webinterface/www/coldmilk/icons/22x22/exit.png create mode 100644 plugins/webinterface/www/coldmilk/icons/22x22/ktstart_all.png create mode 100644 plugins/webinterface/www/coldmilk/icons/22x22/ktstop_all.png create mode 100644 plugins/webinterface/www/coldmilk/icons/22x22/remove.png create mode 100644 plugins/webinterface/www/coldmilk/icons/22x22/start.png create mode 100644 plugins/webinterface/www/coldmilk/icons/22x22/stop.png create mode 100644 plugins/webinterface/www/coldmilk/icons/32x32/Makefile.am create mode 100644 plugins/webinterface/www/coldmilk/icons/32x32/configure.png create mode 100644 plugins/webinterface/www/coldmilk/icons/32x32/extender_opened.png create mode 100644 plugins/webinterface/www/coldmilk/icons/32x32/fileopen.png create mode 100644 plugins/webinterface/www/coldmilk/icons/32x32/folder1.png create mode 100644 plugins/webinterface/www/coldmilk/icons/48x48/Makefile.am create mode 100644 plugins/webinterface/www/coldmilk/icons/48x48/exit.png create mode 100644 plugins/webinterface/www/coldmilk/icons/48x48/switchuser.png create mode 100644 plugins/webinterface/www/coldmilk/icons/64x64/Makefile.am create mode 100644 plugins/webinterface/www/coldmilk/icons/64x64/down.png create mode 100644 plugins/webinterface/www/coldmilk/icons/64x64/folder1_man.png create mode 100644 plugins/webinterface/www/coldmilk/icons/64x64/looknfeel.png create mode 100644 plugins/webinterface/www/coldmilk/icons/Makefile.am create mode 100644 plugins/webinterface/www/coldmilk/interface.js create mode 100644 plugins/webinterface/www/coldmilk/interface.php create mode 100644 plugins/webinterface/www/coldmilk/login.html create mode 100644 plugins/webinterface/www/coldmilk/page_update.js create mode 100644 plugins/webinterface/www/coldmilk/rest.php create mode 100644 plugins/webinterface/www/coldmilk/shutdown.php create mode 100644 plugins/webinterface/www/coldmilk/style.css create mode 100644 plugins/webinterface/www/default/Makefile.am create mode 100644 plugins/webinterface/www/default/details.php create mode 100644 plugins/webinterface/www/default/favicon.ico create mode 100644 plugins/webinterface/www/default/grad1.jpg create mode 100644 plugins/webinterface/www/default/grad2.jpg create mode 100644 plugins/webinterface/www/default/header_tile.png create mode 100644 plugins/webinterface/www/default/high_priority.png create mode 100644 plugins/webinterface/www/default/icon.png create mode 100644 plugins/webinterface/www/default/interface.php create mode 100644 plugins/webinterface/www/default/ktorrentwebinterfacelogo.png create mode 100644 plugins/webinterface/www/default/login.html create mode 100644 plugins/webinterface/www/default/low_priority.png create mode 100644 plugins/webinterface/www/default/menu_bg.png create mode 100644 plugins/webinterface/www/default/normal_priority.png create mode 100644 plugins/webinterface/www/default/only_seed.png create mode 100644 plugins/webinterface/www/default/remove.png create mode 100644 plugins/webinterface/www/default/shutdown.php create mode 100644 plugins/webinterface/www/default/start.png create mode 100644 plugins/webinterface/www/default/stop.png create mode 100644 plugins/webinterface/www/default/style.css create mode 100644 plugins/webinterface/www/default/stylen.css create mode 100644 plugins/webinterface/www/default/wz_tooltip.js create mode 100644 plugins/webinterface/www/mobile/Makefile.am create mode 100644 plugins/webinterface/www/mobile/favicon.ico create mode 100644 plugins/webinterface/www/mobile/interface.php create mode 100644 plugins/webinterface/www/mobile/ktorrentwebinterfacelogo.png create mode 100644 plugins/webinterface/www/mobile/login.html create mode 100644 plugins/webinterface/www/mobile/remove.png create mode 100644 plugins/webinterface/www/mobile/settings.php create mode 100644 plugins/webinterface/www/mobile/start.png create mode 100644 plugins/webinterface/www/mobile/stop.png create mode 100644 plugins/webinterface/www/mobile/torrent.php (limited to 'plugins/webinterface/www') diff --git a/plugins/webinterface/www/Makefile.am b/plugins/webinterface/www/Makefile.am new file mode 100644 index 0000000..8a92573 --- /dev/null +++ b/plugins/webinterface/www/Makefile.am @@ -0,0 +1,5 @@ +METASOURCES = AUTO +SUBDIRS = default mobile coldmilk + + + diff --git a/plugins/webinterface/www/coldmilk/Makefile.am b/plugins/webinterface/www/coldmilk/Makefile.am new file mode 100644 index 0000000..d6a5f08 --- /dev/null +++ b/plugins/webinterface/www/coldmilk/Makefile.am @@ -0,0 +1,8 @@ +INCLUDES = -I$(srcdir)/../../libktorrent $(all_includes) +METASOURCES = AUTO + +ktdatadir = $(kde_datadir)/ktorrent/www/coldmilk + +ktdata_DATA = favicon.ico icon.png interface.js interface.php login.html page_update.js rest.php shutdown.php style.css + +SUBDIRS= icons diff --git a/plugins/webinterface/www/coldmilk/favicon.ico b/plugins/webinterface/www/coldmilk/favicon.ico new file mode 100644 index 0000000..3213b23 Binary files /dev/null and b/plugins/webinterface/www/coldmilk/favicon.ico differ diff --git a/plugins/webinterface/www/coldmilk/icon.png b/plugins/webinterface/www/coldmilk/icon.png new file mode 100644 index 0000000..6cb2185 Binary files /dev/null and b/plugins/webinterface/www/coldmilk/icon.png differ diff --git a/plugins/webinterface/www/coldmilk/icons/16x16/Makefile.am b/plugins/webinterface/www/coldmilk/icons/16x16/Makefile.am new file mode 100644 index 0000000..7380c25 --- /dev/null +++ b/plugins/webinterface/www/coldmilk/icons/16x16/Makefile.am @@ -0,0 +1,6 @@ +METASOURCES = AUTO + +ktdatadir = $(kde_datadir)/ktorrent/www/coldmilk/icons/16x16/ + +ktdata_DATA = edit_user.png high_priority.png low_priority.png normal_priority.png only_seed.png + diff --git a/plugins/webinterface/www/coldmilk/icons/16x16/edit_user.png b/plugins/webinterface/www/coldmilk/icons/16x16/edit_user.png new file mode 100644 index 0000000..9e5173f Binary files /dev/null and b/plugins/webinterface/www/coldmilk/icons/16x16/edit_user.png differ diff --git a/plugins/webinterface/www/coldmilk/icons/16x16/high_priority.png b/plugins/webinterface/www/coldmilk/icons/16x16/high_priority.png new file mode 100644 index 0000000..bcde52b Binary files /dev/null and b/plugins/webinterface/www/coldmilk/icons/16x16/high_priority.png differ diff --git a/plugins/webinterface/www/coldmilk/icons/16x16/low_priority.png b/plugins/webinterface/www/coldmilk/icons/16x16/low_priority.png new file mode 100644 index 0000000..966e22b Binary files /dev/null and b/plugins/webinterface/www/coldmilk/icons/16x16/low_priority.png differ diff --git a/plugins/webinterface/www/coldmilk/icons/16x16/normal_priority.png b/plugins/webinterface/www/coldmilk/icons/16x16/normal_priority.png new file mode 100644 index 0000000..d39228b Binary files /dev/null and b/plugins/webinterface/www/coldmilk/icons/16x16/normal_priority.png differ diff --git a/plugins/webinterface/www/coldmilk/icons/16x16/only_seed.png b/plugins/webinterface/www/coldmilk/icons/16x16/only_seed.png new file mode 100644 index 0000000..254d74a Binary files /dev/null and b/plugins/webinterface/www/coldmilk/icons/16x16/only_seed.png differ diff --git a/plugins/webinterface/www/coldmilk/icons/22x22/Makefile.am b/plugins/webinterface/www/coldmilk/icons/22x22/Makefile.am new file mode 100644 index 0000000..2bd411f --- /dev/null +++ b/plugins/webinterface/www/coldmilk/icons/22x22/Makefile.am @@ -0,0 +1,6 @@ +METASOURCES = AUTO + +ktdatadir = $(kde_datadir)/ktorrent/www/coldmilk/icons/22x22/ + +ktdata_DATA = exit.png ktstart_all.png ktstop_all.png remove.png start.png stop.png + diff --git a/plugins/webinterface/www/coldmilk/icons/22x22/exit.png b/plugins/webinterface/www/coldmilk/icons/22x22/exit.png new file mode 100644 index 0000000..7ca3753 Binary files /dev/null and b/plugins/webinterface/www/coldmilk/icons/22x22/exit.png differ diff --git a/plugins/webinterface/www/coldmilk/icons/22x22/ktstart_all.png b/plugins/webinterface/www/coldmilk/icons/22x22/ktstart_all.png new file mode 100644 index 0000000..1c55069 Binary files /dev/null and b/plugins/webinterface/www/coldmilk/icons/22x22/ktstart_all.png differ diff --git a/plugins/webinterface/www/coldmilk/icons/22x22/ktstop_all.png b/plugins/webinterface/www/coldmilk/icons/22x22/ktstop_all.png new file mode 100644 index 0000000..8086b69 Binary files /dev/null and b/plugins/webinterface/www/coldmilk/icons/22x22/ktstop_all.png differ diff --git a/plugins/webinterface/www/coldmilk/icons/22x22/remove.png b/plugins/webinterface/www/coldmilk/icons/22x22/remove.png new file mode 100644 index 0000000..3da332f Binary files /dev/null and b/plugins/webinterface/www/coldmilk/icons/22x22/remove.png differ diff --git a/plugins/webinterface/www/coldmilk/icons/22x22/start.png b/plugins/webinterface/www/coldmilk/icons/22x22/start.png new file mode 100644 index 0000000..c7995a0 Binary files /dev/null and b/plugins/webinterface/www/coldmilk/icons/22x22/start.png differ diff --git a/plugins/webinterface/www/coldmilk/icons/22x22/stop.png b/plugins/webinterface/www/coldmilk/icons/22x22/stop.png new file mode 100644 index 0000000..5b59e46 Binary files /dev/null and b/plugins/webinterface/www/coldmilk/icons/22x22/stop.png differ diff --git a/plugins/webinterface/www/coldmilk/icons/32x32/Makefile.am b/plugins/webinterface/www/coldmilk/icons/32x32/Makefile.am new file mode 100644 index 0000000..a2b93df --- /dev/null +++ b/plugins/webinterface/www/coldmilk/icons/32x32/Makefile.am @@ -0,0 +1,6 @@ +METASOURCES = AUTO + +ktdatadir = $(kde_datadir)/ktorrent/www/coldmilk/icons/32x32/ + +ktdata_DATA = configure.png extender_opened.png fileopen.png folder1.png + diff --git a/plugins/webinterface/www/coldmilk/icons/32x32/configure.png b/plugins/webinterface/www/coldmilk/icons/32x32/configure.png new file mode 100644 index 0000000..b45d80a Binary files /dev/null and b/plugins/webinterface/www/coldmilk/icons/32x32/configure.png differ diff --git a/plugins/webinterface/www/coldmilk/icons/32x32/extender_opened.png b/plugins/webinterface/www/coldmilk/icons/32x32/extender_opened.png new file mode 100644 index 0000000..b8e652b Binary files /dev/null and b/plugins/webinterface/www/coldmilk/icons/32x32/extender_opened.png differ diff --git a/plugins/webinterface/www/coldmilk/icons/32x32/fileopen.png b/plugins/webinterface/www/coldmilk/icons/32x32/fileopen.png new file mode 100644 index 0000000..e4064bb Binary files /dev/null and b/plugins/webinterface/www/coldmilk/icons/32x32/fileopen.png differ diff --git a/plugins/webinterface/www/coldmilk/icons/32x32/folder1.png b/plugins/webinterface/www/coldmilk/icons/32x32/folder1.png new file mode 100644 index 0000000..f1a0279 Binary files /dev/null and b/plugins/webinterface/www/coldmilk/icons/32x32/folder1.png differ diff --git a/plugins/webinterface/www/coldmilk/icons/48x48/Makefile.am b/plugins/webinterface/www/coldmilk/icons/48x48/Makefile.am new file mode 100644 index 0000000..9318a0c --- /dev/null +++ b/plugins/webinterface/www/coldmilk/icons/48x48/Makefile.am @@ -0,0 +1,6 @@ +METASOURCES = AUTO + +ktdatadir = $(kde_datadir)/ktorrent/www/coldmilk/icons/48x48/ + +ktdata_DATA = exit.png switchuser.png + diff --git a/plugins/webinterface/www/coldmilk/icons/48x48/exit.png b/plugins/webinterface/www/coldmilk/icons/48x48/exit.png new file mode 100644 index 0000000..fd44eb0 Binary files /dev/null and b/plugins/webinterface/www/coldmilk/icons/48x48/exit.png differ diff --git a/plugins/webinterface/www/coldmilk/icons/48x48/switchuser.png b/plugins/webinterface/www/coldmilk/icons/48x48/switchuser.png new file mode 100644 index 0000000..e85c801 Binary files /dev/null and b/plugins/webinterface/www/coldmilk/icons/48x48/switchuser.png differ diff --git a/plugins/webinterface/www/coldmilk/icons/64x64/Makefile.am b/plugins/webinterface/www/coldmilk/icons/64x64/Makefile.am new file mode 100644 index 0000000..3ff3ae0 --- /dev/null +++ b/plugins/webinterface/www/coldmilk/icons/64x64/Makefile.am @@ -0,0 +1,6 @@ +METASOURCES = AUTO + +ktdatadir = $(kde_datadir)/ktorrent/www/coldmilk/icons/64x64/ + +ktdata_DATA = down.png folder1_man.png looknfeel.png + diff --git a/plugins/webinterface/www/coldmilk/icons/64x64/down.png b/plugins/webinterface/www/coldmilk/icons/64x64/down.png new file mode 100644 index 0000000..a855ecc Binary files /dev/null and b/plugins/webinterface/www/coldmilk/icons/64x64/down.png differ diff --git a/plugins/webinterface/www/coldmilk/icons/64x64/folder1_man.png b/plugins/webinterface/www/coldmilk/icons/64x64/folder1_man.png new file mode 100644 index 0000000..a0951d6 Binary files /dev/null and b/plugins/webinterface/www/coldmilk/icons/64x64/folder1_man.png differ diff --git a/plugins/webinterface/www/coldmilk/icons/64x64/looknfeel.png b/plugins/webinterface/www/coldmilk/icons/64x64/looknfeel.png new file mode 100644 index 0000000..2d2bba2 Binary files /dev/null and b/plugins/webinterface/www/coldmilk/icons/64x64/looknfeel.png differ diff --git a/plugins/webinterface/www/coldmilk/icons/Makefile.am b/plugins/webinterface/www/coldmilk/icons/Makefile.am new file mode 100644 index 0000000..cbe7db5 --- /dev/null +++ b/plugins/webinterface/www/coldmilk/icons/Makefile.am @@ -0,0 +1 @@ +SUBDIRS= 16x16 22x22 32x32 48x48 64x64 diff --git a/plugins/webinterface/www/coldmilk/interface.js b/plugins/webinterface/www/coldmilk/interface.js new file mode 100644 index 0000000..2f361a5 --- /dev/null +++ b/plugins/webinterface/www/coldmilk/interface.js @@ -0,0 +1,44 @@ + function validate(action) + { + var msg; + if (action == "remove_torrent") { + msg = "Are you sure that you want remove this torrent?"; + } + else if (action == "quit_program") { + msg = "Are you sure you want to quit ktorrent?"; + } + else { + msg = "Do it?"; + } + return confirm(msg); + }; + + function show(id) + { + var items = new Array(); + items[0] = "torrent_list"; + items[1] = "torrents_details"; + items[2] = "preferences"; + items[3] = "torrent_add"; + items[4] = "action"; + + hide_divs(items); + + + // Show selected + var item_show = document.getElementById(id); + item_show.style.display = ""; + + }; + + function hide_divs(items) { + for (var i in items) { + var item_hide = document.getElementById(items[i]); + if (item_hide != null && !item_hide.style.display) { // not means it's showing.. + item_hide.style.display = "none"; + } + } + return true; + } + + diff --git a/plugins/webinterface/www/coldmilk/interface.php b/plugins/webinterface/www/coldmilk/interface.php new file mode 100644 index 0000000..246f347 --- /dev/null +++ b/plugins/webinterface/www/coldmilk/interface.php @@ -0,0 +1,251 @@ + + + + + + ktorrent web interface + + + + + + + + + + + + + + +
+ + +
+ +
+ + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/webinterface/www/coldmilk/login.html b/plugins/webinterface/www/coldmilk/login.html new file mode 100644 index 0000000..fa95faf --- /dev/null +++ b/plugins/webinterface/www/coldmilk/login.html @@ -0,0 +1,55 @@ + + + + + + ktorrent - web interface + + + + + + + + + + +
+
+ + logo + +

Log in

+ + +
+ Username: +
+ +
+
+ +
+ Password: +
+
+ +
+ +
+ +
+
+
+ + + +
+
+ + \ No newline at end of file diff --git a/plugins/webinterface/www/coldmilk/page_update.js b/plugins/webinterface/www/coldmilk/page_update.js new file mode 100644 index 0000000..c004456 --- /dev/null +++ b/plugins/webinterface/www/coldmilk/page_update.js @@ -0,0 +1,429 @@ + /*************************************************************************** + * Copyright (C) 2007 by Dagur Valberg Johannsson * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * + ***************************************************************************/ + +var details_of_torrent = null; //id of torrent which details are displayed + +function update_interval(time) { + update_all(); + if (!time) { + return; + } + var seconds = time * 1000; + window.setInterval(update_all, seconds); +} + +function update_all() { + fetch_xml("rest.php?global_status", new Array("update_status_bar", "update_title")); + fetch_xml("rest.php?download_status", new Array("update_torrent_table")); +} + +function fetch_xml(url, callback_functions) { + var request = false; + + if (window.XMLHttpRequest) { // most browsers + request = new XMLHttpRequest(); +// if (request.overrideMimeType) { +// request.overrideMimeType('text/xml'); +// } + } + + else if (window.ActiveXObject) { //ie + try { + request = new ActiveXObject("Msxml2.XMLHTTP"); + } + catch(e) { + try { request = new ActiveXObject("Microsoft.XMLHTTP"); } + catch(e) { } + } + } + + if (!request) { + // Browser doesn't support XMLHttpRequest + return false; + } + request.onreadystatechange = function() { + if (request.readyState == 4) { + if (request.status == 200) { + //overrideMimeType didn't work in Konqueror, + //so we'll have to parse the response into XML + //object ourselfs. responseXML won't work. + var xmlstring = request.responseText; + var xmldoc; + if (window.DOMParser) { + xmldoc = (new DOMParser()) + .parseFromString(xmlstring, "text/xml"); + } + else if (window.ActiveXObject) { //ie + xmldoc = new ActiveXObject("Microsoft.XMLDOM"); + xmldoc.async = false; + xmldoc.loadXML(xmlstring); + } + + for (var i in callback_functions) { + eval(callback_functions[i] + "(xmldoc)"); + } + + } + else { + // could not fetch + } + } + } + + request.open('GET', url, true); + request.send(null); +} + +function update_title(xmldoc) { + var down = _get_text(xmldoc, 'download_speed').data; + var up = _get_text(xmldoc, 'upload_speed').data; + var new_title = "(D: " + down + ") (U: " + up + ") - ktorrent web interface"; + document.title = new_title; +} + +function update_status_bar(xmldoc) { + var newtable = document.createElement('table'); + newtable.setAttribute('id', 'status_bar_table'); + + + //dht and encryption + { + var row = newtable.insertRow(0); + var cell = row.insertCell(0); + var dht = _get_text_from_attribute(xmldoc, 'dht', 'status').data; + var encryption = _get_text_from_attribute(xmldoc, 'encryption', 'status').data; + cell.appendChild( + document.createTextNode("DHT : " +dht)); + cell = row.insertCell(1); + cell.appendChild( + document.createTextNode("Encryption : " + encryption)); + } + //speed down/up + { + var row = newtable.insertRow(1); + var cell = row.insertCell(0); + cell.appendChild( + document.createTextNode("Speed")); + + cell = row.insertCell(1); + var down = _get_text(xmldoc, 'download_speed').data; + var up = _get_text(xmldoc, 'upload_speed').data; + cell.appendChild( + document.createTextNode("down: " + down + " / up: " + up)); + } + //transferred + { + var row = newtable.insertRow(2); + var cell = row.insertCell(0); + cell.appendChild( + document.createTextNode("Transferred")); + + cell = row.insertCell(1); + var down = _get_text(xmldoc, 'downloaded_total').data; + var up = _get_text(xmldoc, 'uploaded_total').data; + cell.appendChild( + document.createTextNode("down: " + down + " / up: " + up)); + } + var oldtable = document.getElementById('status_bar_table'); + oldtable.parentNode.replaceChild(newtable, oldtable); +} + +function update_torrent_table(xmldoc) { + + var newtable = document.createElement('table'); + newtable.setAttribute('id', 'torrent_list_table'); + newtable.className='list_table'; + + var torrents = xmldoc.getElementsByTagName('torrent'); + var i = 0; + while (torrents[i]) { + _torrent_table_row(torrents[i], newtable, i); + i++; + } + _torrent_table_header(newtable.insertRow(0)); + + var oldtable = document.getElementById('torrent_list_table'); + oldtable.parentNode.replaceChild(newtable, oldtable); +} + +function _torrent_table_row(torrent, table, i) { + var row = table.insertRow(i); + var row_color = (i % 2) ? + "#ffffff" : "#dce4f9"; + row.setAttribute("style", "background-color : " + row_color); + + //actions + { + var cell = row.insertCell(0); + var can_start = (_get_text(torrent, 'running').data) ? 0 : 1; //if torrent is running we can't start it + var can_stop = (can_start==1) ? 0 : 1; //opposite of can_start + var start_button = _create_action_button('Start', 'start.png', (can_start==1) ? 'start='+i : ''); + var stop_button = _create_action_button('Stop', 'stop.png', (can_stop==1) ? 'stop='+i : ''); + var remove_button = _create_action_button('Remove', 'remove.png', 'remove='+i); + remove_button.setAttribute("onclick", "return validate('remove_torrent')"); + + cell.appendChild(start_button); + cell.appendChild(stop_button); + cell.appendChild(remove_button); + } + + //file + { + var cell = row.insertCell(1); + var file = document.createElement('a'); + file.setAttribute('href', '#'); + file.appendChild(_get_text(torrent, 'name')); + file.onclick = function() + { + show('torrents_details'); + fetch_xml("rest.php?torrents_details="+i, new Array("get_torrents_details")); + details_of_torrent = i; + }; + cell.appendChild(file); + } + + //status + { + var cell = row.insertCell(2); + cell.appendChild( + _get_text(torrent, 'status')); + } + + //speed + { + var cell = row.insertCell(3); + + cell.appendChild( + _get_text(torrent, 'download_rate')); + cell.appendChild(document.createElement('br')); + cell.appendChild( + _get_text(torrent, 'upload_rate')); + } + + //size + { + var cell = row.insertCell(4); + cell.appendChild( + _get_text(torrent, 'size')); + } + + //peers + { + var cell = row.insertCell(5); + cell.appendChild( + _get_text(torrent, 'peers')); + } + + //transferred + { + var cell = row.insertCell(6); + + cell.appendChild( + _get_text(torrent, 'downloaded')); + cell.appendChild(document.createElement('br')); + cell.appendChild( + _get_text(torrent, 'uploaded')); + } + + //done + { + var cell = row.insertCell(7); + cell.setAttribute("style", "padding-right : 2px;"); + + var percent_done + = _get_text_from_attribute(torrent, 'downloaded', 'percent').data; + + var bar = document.createElement('div'); + bar.setAttribute("class", "percent_bar"); + bar.setAttribute("style", "width : " + percent_done + "%;"); + cell.appendChild(bar); + + var bar_text = document.createElement('div'); + bar_text.appendChild( + document.createTextNode(percent_done + "%")); + + bar.appendChild(bar_text); + } +} + +//function called after changing file priority to refresh list of files (and priorities) +function just_refresh_details(xmldoc) { + if (details_of_torrent!=null) + fetch_xml("rest.php?torrents_details="+details_of_torrent, new Array("get_torrents_details")); +} + +function get_torrents_details(xmldoc) { + var newtable = document.createElement('table'); + newtable.setAttribute('id', 'torrents_details_files'); + newtable.className='list_table'; + + var id = xmldoc.getElementsByTagName('torrents_details')[0].getAttribute('id'); + var files = xmldoc.getElementsByTagName('file'); + for(var i=0; i + Usage: rest.php?command
+ Available commands: "; + foreach ($rest_commands as $command) + print "$command "; + + print ""; +} + +else { + header("Content-Type: text/xml"); + $rest = new RestInterface(); + foreach($_REQUEST as $command=>$arg) + { + if (in_array($command, $rest_commands)) + print $rest->$command($arg); + else + print "Unknown command " . htmlentities($command) . "
"; + + } +} + +// classes + +class RestInterface { + public function global_status() { + $info = globalinfo(); + $common = new Common(); + + $down_speed = $info['download_speed']; + $up_speed = $info['upload_speed']; + + $down_total + = $common->bytes_to_readable($info['bytes_downloaded']); + $up_total + = $common->bytes_to_readable($info['bytes_uploaded']); + + $dht = $info['dht_support'] ? "on" : "off"; + $encryption = $info['use_encryption'] ? "on" : "off"; + + $xml = new KTorrentXML('status_bar'); + + $elements = array( + $xml->new_element('download_speed' , $down_speed), + $xml->new_element('upload_speed' , $up_speed), + $xml->new_element('downloaded_total', $down_total), + $xml->new_element('uploaded_total', $up_total), + + $xml->new_element('dht', null, array('status' => $dht)), + $xml->new_element('encryption', null, array('status' => $encryption)), + ); + + foreach($elements as $element) { + $xml->append_to_root($element); + } + + return $xml->saveXML(); + + } + + public function download_status() { + $download_status = downloadstatus(); + $xml = new KTorrentXML('download_status'); + foreach($download_status as $torrent) { + $torrent_xml = $xml->new_element('torrent'); + $xml->append_to_root($torrent_xml); + +// foreach(array_keys($torrent) as $key) { +// $torrent_xml->appendChild( +// $xml->new_element("raw_$key", $torrent[$key])); +// } + + $status = $torrent['status']; + $done = $torrent['bytes_downloaded']; + $total_bytes = $torrent['total_bytes_to_download']; + $bytes_left = $torrent['bytes_left_to_download']; + $elements = array( + + $xml->new_element('name', + $this->_clean_name($torrent['torrent_name'])), + + $xml->new_element('status', + $this->_torrent_status($status), array('id' => $status)), + + $xml->new_element('running', $torrent['running']), + $xml->new_element('download_rate', $torrent['download_rate']." down"), + $xml->new_element('upload_rate', $torrent['upload_rate']." up"), + $xml->new_element('size', $torrent['total_bytes']), + $xml->new_element('peers', $torrent['num_peers']), + $xml->new_element('uploaded', $torrent['bytes_uploaded']." uploaded"), + + + $xml->new_element('downloaded', + "$done downloaded", + array('percent' => $this->_get_percent_done($total_bytes, $bytes_left))), + ); + + foreach($elements as $element) { + $torrent_xml->appendChild($element); + } + } + + return $xml->saveXML(); + + } + + public function torrents_details($torrent_id) { + $xml = new KTorrentXML('torrents_details', null, array('id'=>$torrent_id)); + $download_status = downloadstatus(); + if (isset($download_status[$torrent_id])) + foreach($download_status[$torrent_id]['files'] as $id=>$info) + { + $file_xml = $xml->new_element('file', '', array('id'=>$id)); + $xml->append_to_root($file_xml); + foreach($info as $key=>$val) + $file_xml->appendChild($xml->new_element($key, $val)); + } + return $xml->saveXML(); + } + + // Helper function for download_status + private function _torrent_status($status_id) { + $status = array( + 0 => "Not started", + 1 => "Seeding Complete", + 2 => "Download Complete", + 3 => "Seeding", + 4 => "Downloading", + 5 => "Stalled", + 6 => "Stopped", + 7 => "Allocating Diskspace", + 8 => "Error", + 9 => "Queued", + 10 => "Checking Data" + ); + + return $status[$status_id]; + } + + + // Truncate long torrent name, and HTML escape it. + // This is a helper function for download_status. + private function _clean_name($name) { + $name = str_replace("'", "\'", $name); + if (strlen($name) > 30) { + $name = substr($name, 0, 27); + $name .= "..."; + } + $name = htmlspecialchars($name); + return $name; + } + + // Calculate percent done. + // Helper function for download_status + private function _get_percent_done($bytes_total, $bytes_left) { + if($bytes_total) { + $perc_done = round(100.0 - ($bytes_left / $bytes_total) * 100); + return $perc_done; + } + else { + return 0; + } + } +} + + +/** + * Class to build a xml tree + */ +class KTorrentXML extends DomDocument { + private $root_element; + public function __construct($root, $value = null, $attributes = null) { + parent::__construct('1.0'); + $this->root_element = $this->createElement($root); + $this->appendChild($this->root_element); + $this->formatOutput = true; + + if ($attributes) + foreach($attributes as $key=>$val) + $this->root_element->setAttribute($key, $val); + } + + // Creates an element, and returns it. + public function new_element($name, $value = null, $attributes = null) { + $element = $this->createElement($name); + if ($value) { + $element->appendChild($this->createTextNode($value)); + } + if ($attributes) { + foreach(array_keys($attributes) as $key) { + $element->setAttribute($key, $attributes[$key]); + } + } + return $element; + } + + // Append a given element to the root element of the xml file. + public function append_to_root($element) { + $this->root_element->appendChild($element); + } + +} + +/** + * Generic functions + */ +class Common { + function bytes_to_readable($bytes) { + if ($bytes < 1024) { + return round($bytes, 2) . " bytes"; + } + + else if (($kb = ($bytes / 1024)) < 1024) { + return round($kb, 2) . " KB"; + } + + else if (($mb = ($kb / 1024)) < 1024) { + return round($mb, 2) . " MB"; + } + + else { + $gb = round($mb / 1024, 2); + return "$gb GB"; + } + } + + function kb_to_readable($kbytes) { + return Common::bytes_to_readable($kbytes * 1024); + } +} + +?> \ No newline at end of file diff --git a/plugins/webinterface/www/coldmilk/shutdown.php b/plugins/webinterface/www/coldmilk/shutdown.php new file mode 100644 index 0000000..92862c4 --- /dev/null +++ b/plugins/webinterface/www/coldmilk/shutdown.php @@ -0,0 +1,21 @@ + + + + + ktorrent - web interface + + + + + + + + +
+ + Goodbye! +
+ + + + diff --git a/plugins/webinterface/www/coldmilk/style.css b/plugins/webinterface/www/coldmilk/style.css new file mode 100644 index 0000000..69010dc --- /dev/null +++ b/plugins/webinterface/www/coldmilk/style.css @@ -0,0 +1,212 @@ +body { + font-family : sans-serif; + color : black; + background-color : white; + } + +A:link { color : blue; } +A:visited { color : blue; } +A:active { color : blue; } + + + +#header { + min-height : 130px; + } + + +#header #logout { + position : absolute; + top : 1px; + right : 0.5em; + } + + +#header #header_icon { + float : left; + margin-left : 1em; + border : 0px solid; + } + +#header ul { + display : inline; + font-size : large; + list-style-type : none; +} + + +#header li { + display : inline; + margin-right : 0.5em; + } + + +#header #status_bar { + font-family : monospace; + font-size : small; + color : #636363; + border : 1px solid; + border-color : silver; + background-color : white; + } + + +.list_table { + border-collapse : collapse; + width : 100%; + } + + +.list_table th { + text-align : left; + } + + +.list_table img { + border : 0px solid; + padding : 2px; + } + + +.list_table .percent_bar { + background-color : #a5d3b4; + float : left; + position : relative; + color : inherit; +} + +.list_table img { + opacity: 0.4; +} + +.list_table a img { + opacity: 1.0; +} + +#bottom-menu { + margin-top : 1em; + } + + +#bottom-menu ul { + list-style-type : none; + padding : 0; + margin : 0; + } + + +#bottom-menu li { + padding : 0.5em; + border : 1px solid; + border-color : silver; + display : inline; + position : relative; + background-color : #f5f5f5; + margin-right : 0.5em; + color : blue; +} + + +#bottom-menu img { + position : absolute; + top : 0.2em; + left : 0.5em; + } + + +#bottom-menu span { + vertical-align : middle; + margin-left : 30px; + } + + +.simple_form { + border : 1px solid; + border-color : silver; + width : 60%; + float : left; + padding : 1em; + background-color : #f5f5f5; + clear : left; + color : black; + } + +.simple_form h2, .simple_form h3 { + margin : 0 0 0.5em 0; + padding : 0; +} + + +.simple_form img { + float : right; + margin-right : 1em; + border : 0px solid; + } + + +.simple_form .item { + position : relative; + margin-top : 0.5em; + } + + +.simple_form .item .option { + position : absolute; + top : 0px; + left: 30%; + } + + +.simple_form .item .option span { + font-size : small; + color : #333333; + background-color : inherit; + } + +.simple_form .hints { + font-size : small; + background-color : #FDFDFD; + color : inherit; +} + +#action { + border : 1px solid; + border-color : silver; + clear : both; + width : 60%; + margin-left : 20%; + padding : 1em; + background-color : #f5f5f5; + color : inherit; +} + +#action ul { + list-style-type : none; + margin : 0; + padding-left : 0; + padding-bottom : 1em; +} + +#action li { + margin-top : 0.25em; + margin-bottom : 0.25em; + border : 1px solid; + border-color : silver; + min-height : 48px; + padding : 0.5em; + background-color : #FDFDFD; + color : inherit; + +} + +#action li span { + font-size : x-large; + vertical-align : middle; + padding-top : 20px; +} + +#action img { + float : left; + clear : both; + border : 0px solid; +} \ No newline at end of file diff --git a/plugins/webinterface/www/default/Makefile.am b/plugins/webinterface/www/default/Makefile.am new file mode 100644 index 0000000..01f09df --- /dev/null +++ b/plugins/webinterface/www/default/Makefile.am @@ -0,0 +1,9 @@ +INCLUDES = -I$(srcdir)/../../libktorrent $(all_includes) +METASOURCES = AUTO + +ktdatadir = $(kde_datadir)/ktorrent/www/default + +ktdata_DATA = details.php only_seed.png favicon.ico grad1.jpg grad2.jpg menu_bg.png \ + header_tile.png high_priority.png icon.png interface.php ktorrentwebinterfacelogo.png \ + login.html low_priority.png normal_priority.png remove.png shutdown.php start.png \ + stop.png style.css stylen.css wz_tooltip.js diff --git a/plugins/webinterface/www/default/details.php b/plugins/webinterface/www/default/details.php new file mode 100644 index 0000000..a19d57e --- /dev/null +++ b/plugins/webinterface/www/default/details.php @@ -0,0 +1,89 @@ +30) return substr($string, 0, 30).'...'; + else return $string; +} + +function get_file_status_name($status_id) +{ + $table = array( + 60 => 'PREVIEW_PRIORITY', + 50 => 'Download First', + 40 => 'Download Normally', + 30 => 'Download Last', + 20 => 'Only Seed', + 10 => 'Do Not Download' + ); + if (array_key_exists($status_id, $table)) return $table[$status_id]; + else return 'Not supported file status'; +} + +function generate_file_prior_button_code($img, $alt, $href='') +{ + $img = ''.htmlspecialchars($alt).''; + if (empty($href)) return $img; + else return ''.$img.''; +} + +$display_name=cut_name_if_long($stats[$num_torrent]['torrent_name']); + +?> + + + + + + + +<?php echo 'KTorrent: Details for '.$display_name; ?> + + +
WebInterface KTorrent plugin
+
+ + +
+ + + + + + + + + $file) + { + echo "\t\t".''."\n\t\t\t"; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo "\n\t\t".''."\n"; + } + ?> +
ActionsFileStatusSizeComplete
'; + echo generate_file_prior_button_code('/high_priority.png', 'High Priority', $file['status']==50?'':"details.php?file_hp=$num_torrent-$id&torrent=$num_torrent"); + echo generate_file_prior_button_code('/normal_priority.png', 'Normal Priority', $file['status']==40?'':"details.php?file_np=$num_torrent-$id&torrent=$num_torrent"); + echo generate_file_prior_button_code('/low_priority.png', 'Low Priority', $file['status']==30?'':"details.php?file_lp=$num_torrent-$id&torrent=$num_torrent"); + echo generate_file_prior_button_code('/only_seed.png', 'Stop downloading (Only Seed Priority)', ($file['status']==20||$file['status']==10)?'':"details.php?file_stop=$num_torrent-$id&torrent=$num_torrent"); + echo ''.htmlspecialchars(cut_name_if_long($file['name'])).''.get_file_status_name($file['status']).''.$file['size'].''.round($file['perc_done'], 2).' %
+
+ + + diff --git a/plugins/webinterface/www/default/favicon.ico b/plugins/webinterface/www/default/favicon.ico new file mode 100644 index 0000000..3213b23 Binary files /dev/null and b/plugins/webinterface/www/default/favicon.ico differ diff --git a/plugins/webinterface/www/default/grad1.jpg b/plugins/webinterface/www/default/grad1.jpg new file mode 100644 index 0000000..762baa0 Binary files /dev/null and b/plugins/webinterface/www/default/grad1.jpg differ diff --git a/plugins/webinterface/www/default/grad2.jpg b/plugins/webinterface/www/default/grad2.jpg new file mode 100644 index 0000000..bc4d77e Binary files /dev/null and b/plugins/webinterface/www/default/grad2.jpg differ diff --git a/plugins/webinterface/www/default/header_tile.png b/plugins/webinterface/www/default/header_tile.png new file mode 100644 index 0000000..0bad736 Binary files /dev/null and b/plugins/webinterface/www/default/header_tile.png differ diff --git a/plugins/webinterface/www/default/high_priority.png b/plugins/webinterface/www/default/high_priority.png new file mode 100644 index 0000000..bcde52b Binary files /dev/null and b/plugins/webinterface/www/default/high_priority.png differ diff --git a/plugins/webinterface/www/default/icon.png b/plugins/webinterface/www/default/icon.png new file mode 100644 index 0000000..6cb2185 Binary files /dev/null and b/plugins/webinterface/www/default/icon.png differ diff --git a/plugins/webinterface/www/default/interface.php b/plugins/webinterface/www/default/interface.php new file mode 100644 index 0000000..6432798 --- /dev/null +++ b/plugins/webinterface/www/default/interface.php @@ -0,0 +1,152 @@ + 'Not Started', + 1 => 'Seeding Complete', + 2 => 'Download Complete', + 3 => 'Seeding', + 4 => 'Downloading', + 5 => 'Stalled', + 6 => 'Stopped', + 7 => 'Allocating Diskspace', + 8 => 'Error', + 9 => 'Queued', + 10 => 'Checking Data' + ); + if (array_key_exists($status_id, $table)) return $table[$status_id]; + else return 'Not supported Status'; +} + +function generate_button_code($img, $alt, $href='') +{ + $img = ''.htmlspecialchars($alt).''; + if (empty($href)) return $img; + else return ''.$img.''; +} +?> + + + + + + + +<?php echo '(D:'.$globalinfo['download_speed'].') (U:'.$globalinfo['upload_speed'].') KTorrent'; ?> + + + +
WebInterface KTorrent plugin
+
+ + + +
+ + + + + + + + + + + + + +'."\n\t\t\t"; + + $torrent_name = str_replace("'", "\'", $torrent['torrent_name']); + if($torrent['total_bytes_to_download']!=0) $perc = round(100.0 - ($torrent['bytes_left_to_download'] / $torrent['total_bytes_to_download']) * 100.0, 2); + else $perc = 0; + if(strlen($torrent['torrent_name'])>30) $display_name=substr($torrent['torrent_name'], 0, 30)." ..."; + else $display_name=$torrent['torrent_name']; + if ($torrent['num_files']>1) $file_td_content = ''.$display_name.''; + else $file_td_content = $display_name; + + echo ''; + echo ""; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo "\n\t\t".''."\n"; + $a++; + } + ?> +
ActionsFileStatusDownloadedSizeUploadedDown SpeedUp SpeedPeersComplete
'; + echo generate_button_code('/stop.png', 'stop', ($torrent['running'])?'interface.php?stop='.$a:''); + echo generate_button_code('/start.png', 'start', ($torrent['running'])?'':'interface.php?start='.$a); + echo 'remove'; + echo '$file_td_content'.get_torrent_status_name($torrent['status']).''.$torrent['bytes_downloaded'].''.$torrent['total_bytes'].''.$torrent['bytes_uploaded'].''.$torrent['download_rate'].''.$torrent['upload_rate'].''.$torrent['num_peers'].''.$perc.'%
+
+ + + + diff --git a/plugins/webinterface/www/default/ktorrentwebinterfacelogo.png b/plugins/webinterface/www/default/ktorrentwebinterfacelogo.png new file mode 100644 index 0000000..bc235b5 Binary files /dev/null and b/plugins/webinterface/www/default/ktorrentwebinterfacelogo.png differ diff --git a/plugins/webinterface/www/default/login.html b/plugins/webinterface/www/default/login.html new file mode 100644 index 0000000..93ac1e6 --- /dev/null +++ b/plugins/webinterface/www/default/login.html @@ -0,0 +1,29 @@ + + + +KTorrent WebInterface - Login + + + + + +
+ + + + +
Username:
Password:
+
+ + diff --git a/plugins/webinterface/www/default/low_priority.png b/plugins/webinterface/www/default/low_priority.png new file mode 100644 index 0000000..966e22b Binary files /dev/null and b/plugins/webinterface/www/default/low_priority.png differ diff --git a/plugins/webinterface/www/default/menu_bg.png b/plugins/webinterface/www/default/menu_bg.png new file mode 100644 index 0000000..d33169a Binary files /dev/null and b/plugins/webinterface/www/default/menu_bg.png differ diff --git a/plugins/webinterface/www/default/normal_priority.png b/plugins/webinterface/www/default/normal_priority.png new file mode 100644 index 0000000..d39228b Binary files /dev/null and b/plugins/webinterface/www/default/normal_priority.png differ diff --git a/plugins/webinterface/www/default/only_seed.png b/plugins/webinterface/www/default/only_seed.png new file mode 100644 index 0000000..254d74a Binary files /dev/null and b/plugins/webinterface/www/default/only_seed.png differ diff --git a/plugins/webinterface/www/default/remove.png b/plugins/webinterface/www/default/remove.png new file mode 100644 index 0000000..5d40f9f Binary files /dev/null and b/plugins/webinterface/www/default/remove.png differ diff --git a/plugins/webinterface/www/default/shutdown.php b/plugins/webinterface/www/default/shutdown.php new file mode 100644 index 0000000..f87a199 --- /dev/null +++ b/plugins/webinterface/www/default/shutdown.php @@ -0,0 +1,13 @@ + + + + Shutdown page + + + + +
KTorrent closed successfully
+ + + diff --git a/plugins/webinterface/www/default/start.png b/plugins/webinterface/www/default/start.png new file mode 100644 index 0000000..3aac1a5 Binary files /dev/null and b/plugins/webinterface/www/default/start.png differ diff --git a/plugins/webinterface/www/default/stop.png b/plugins/webinterface/www/default/stop.png new file mode 100644 index 0000000..530639f Binary files /dev/null and b/plugins/webinterface/www/default/stop.png differ diff --git a/plugins/webinterface/www/default/style.css b/plugins/webinterface/www/default/style.css new file mode 100644 index 0000000..3af4bb5 --- /dev/null +++ b/plugins/webinterface/www/default/style.css @@ -0,0 +1,13 @@ +/* styles for login.html */ + +body { + background: url(ktorrentwebinterfacelogo.png) no-repeat 120px 120px; + font-family: verdana, arial, sans-serif; + color: #000000; + font-size: 12px; +} + +input, textarea { + border: 1px solid #000000; + width: 120px; +} diff --git a/plugins/webinterface/www/default/stylen.css b/plugins/webinterface/www/default/stylen.css new file mode 100644 index 0000000..68966fd --- /dev/null +++ b/plugins/webinterface/www/default/stylen.css @@ -0,0 +1,164 @@ +/* styles for interface.php and details.php */ + +html, body { + background-color: #a2d2b1; + font-family: sans-serif; + font-size: 12px; +} +html, body, h1, h2, h3, h4, form { + margin: 0; + padding: 0; +} +img { + border: 0; +} +h2 { + font-size: 12px; + min-height: 18px; + padding-top: 2px; + margin-bottom: 10px; + background-image: url(grad1.jpg); + font-weight: bold; + border-bottom: 1px solid #000; + text-align: center; +} +form { + text-align: right; +} +label { + display: block; + text-align: right; + margin: 4px 0 4px 0; +} +input { + margin: 0 5% 0 1%; + width: 30%; +} +label.wide { + text-align: left; + padding-left: 5%; +} +label.wide input { + margin: 0 0 0 0; + width: 95%; +} +input[type="submit"] { + width: auto; +} +th { + padding: 2px; + text-align: left; +} +a { + color: #0C45FF; + text-decoration: none; +} +a:visited { + color: #0C45FF; +} +a:hover { + color: #FFFFFF; + text-decoration: none; +} + + +.actions img { + width: 16px; + height: 16px; + margin: 2px; +} + + +.box { + width: 254px; + margin: 0 auto; + border: 1px solid black; + background-color: #d5d5d5; + padding-bottom: 10px; + margin-bottom: 10px; + text-align: center; +} + + +#top_bar { + background-color: #b72916; + border: 1px solid #868686; + text-align: right; +} + + +#icon { + position: absolute; + left: 5px; + top: 2px; +} + + +#header { + background-color: #42ac64; + padding: 15px 0 5px 140px; + font-size: 45px; +} +#header strong { + text-shadow: 3px 3px 5px #bbb; +} +#header small { + font-size: 13px; +} + + +#menu { + list-style-type: none; + margin: 0; + padding: 0 0 0 140px; + background-image: url(menu_bg.png); + height: 24px; +} +#menu li { + display: inline; + margin-right: 10px; +} +#menu a { + color: #fff; + font-size: 16px; +} +#menu a:hover { + color: #000; + text-decoration: none; +} +#menu .shutdown { + margin-right: 290px; +} + + +#sidebar { + background: #42AC64; + float: right; + width: 280px; + border-left: 1px solid #000; + border-bottom: 1px solid #000; + padding: 10px 0 5px 0; +} +#sidebar a:hover { + color: #000; +} + + +#content { + background: #a2d2b1; + text-align: left; + margin-right: 280px; + padding: 10px; +} +#content img { opacity: 0.4; } +#content a img { opacity: 1.0; } + + +#footer { + clear: both; + background: #b72916; + min-height: 25px; + text-align: center; + font-size: 14px; + padding-top: 5px; +} diff --git a/plugins/webinterface/www/default/wz_tooltip.js b/plugins/webinterface/www/default/wz_tooltip.js new file mode 100644 index 0000000..1329a1b --- /dev/null +++ b/plugins/webinterface/www/default/wz_tooltip.js @@ -0,0 +1,509 @@ +/* This notice must be untouched at all times. + +wz_tooltip.js v. 3.45 + +The latest version is available at +http://www.walterzorn.com +or http://www.devira.com +or http://www.walterzorn.de + +Copyright (c) 2002-2005 Walter Zorn. All rights reserved. +Created 1. 12. 2002 by Walter Zorn (Web: http://www.walterzorn.com ) +Last modified: 22. 1. 2007 + +Cross-browser tooltips working even in Opera 5 and 6, +as well as in NN 4, Gecko-Browsers, IE4+, Opera 7+ and Konqueror. +No onmouseouts required. +Appearance of tooltips can be individually configured +via commands within the onmouseovers. + +LICENSE: LGPL + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License (LGPL) as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +For more details on the GNU Lesser General Public License, +see http://www.gnu.org/copyleft/lesser.html +*/ + + + +//////////////// GLOBAL TOOPTIP CONFIGURATION ///////////////////// +var ttAbove = false; // tooltip above mousepointer? Alternative: true +var ttBgColor = "#D5D5D5"; +var ttBgImg = ""; // path to background image; +var ttBorderColor = "#D00000"; +var ttBorderWidth = 1; +var ttDelay = 350; // time span until tooltip shows up [milliseconds] +var ttClickClose = false; +var ttFontColor = "#000000"; +var ttFontFace = "arial,helvetica,sans-serif"; +var ttFontSize = "11px"; +var ttFontWeight = "normal"; // alternative: "bold"; +var ttLeft = false; // tooltip on the left of the mouse? Alternative: true +var ttOffsetX = 12; // horizontal offset of left-top corner from mousepointer +var ttOffsetY = 15; // vertical offset " +var ttOpacity = 70; // opacity of tooltip in percent (must be integer between 0 and 100) +var ttPadding = 3; // spacing between border and content +var ttShadowColor = ""; +var ttShadowWidth = 0; +var ttStatic = false; // tooltip NOT move with the mouse? Alternative: true +var ttSticky = false; // do NOT hide tooltip on mouseout? Alternative: true +var ttTemp = 0; // time span after which the tooltip disappears; 0 (zero) means "infinite timespan" +var ttTextAlign = "left"; +var ttTitleColor = "#ffffff"; // color of caption text +var ttWidth = 300; +//////////////////// END OF TOOLTIP CONFIG //////////////////////// + + + +////////////// TAGS WITH TOOLTIP FUNCTIONALITY //////////////////// +// List may be extended or shortened: +var tt_tags = new Array("a","area","b","big","caption","center","code","dd","div","dl","dt","em","h1","h2","h3","h4","h5","h6","i","img","input","li","map","ol","p","pre","s", "select", "small","span","strike","strong","sub","sup","table","td","textarea","th","tr","tt","u","var","ul","layer"); +///////////////////////////////////////////////////////////////////// + + + +///////// DON'T CHANGE ANYTHING BELOW THIS LINE ///////////////////// +var tt_obj = null, // current tooltip +tt_ifrm = null, // iframe to cover windowed controls in IE +tt_objW = 0, tt_objH = 0, // width and height of tt_obj +tt_objX = 0, tt_objY = 0, +tt_offX = 0, tt_offY = 0, +xlim = 0, ylim = 0, // right and bottom borders of visible client area +tt_sup = false, // true if T_ABOVE cmd +tt_sticky = false, // tt_obj sticky? +tt_wait = false, +tt_act = false, // tooltip visibility flag +tt_sub = false, // true while tooltip below mousepointer +tt_u = "undefined", +tt_mf = null, // stores previous mousemove evthandler +// Opera: disable href when hovering +tt_tag = null; // stores hovered dom node, href and previous statusbar txt + + +var tt_db = (document.compatMode && document.compatMode != "BackCompat")? document.documentElement : document.body? document.body : null, +tt_n = navigator.userAgent.toLowerCase(), +tt_nv = navigator.appVersion; +// Browser flags +var tt_op = !!(window.opera && document.getElementById), +tt_op6 = tt_op && !document.defaultView, +tt_op7 = tt_op && !tt_op6, +tt_ie = tt_n.indexOf("msie") != -1 && document.all && tt_db && !tt_op, +tt_ie7 = tt_ie && typeof document.body.style.maxHeight != tt_u, +tt_ie6 = tt_ie && !tt_ie7 && parseFloat(tt_nv.substring(tt_nv.indexOf("MSIE")+5)) >= 5.5, +tt_n4 = (document.layers && typeof document.classes != tt_u), +tt_n6 = (!tt_op && document.defaultView && typeof document.defaultView.getComputedStyle != tt_u), +tt_w3c = !tt_ie && !tt_n6 && !tt_op && document.getElementById, +tt_ce = document.captureEvents && !tt_n6; + +function tt_Int(t_x) +{ + var t_y; + return isNaN(t_y = parseInt(t_x))? 0 : t_y; +} +function wzReplace(t_x, t_y) +{ + var t_ret = "", + t_str = this, + t_xI; + while((t_xI = t_str.indexOf(t_x)) != -1) + { + t_ret += t_str.substring(0, t_xI) + t_y; + t_str = t_str.substring(t_xI + t_x.length); + } + return t_ret+t_str; +} +String.prototype.wzReplace = wzReplace; +function tt_N4Tags(tagtyp, t_d, t_y) +{ + t_d = t_d || document; + t_y = t_y || new Array(); + var t_x = (tagtyp=="a")? t_d.links : t_d.layers; + for(var z = t_x.length; z--;) t_y[t_y.length] = t_x[z]; + for(z = t_d.layers.length; z--;) t_y = tt_N4Tags(tagtyp, t_d.layers[z].document, t_y); + return t_y; +} +function tt_Htm(tt, t_id, txt) +{ + var t_bgc = (typeof tt.T_BGCOLOR != tt_u)? tt.T_BGCOLOR : ttBgColor, + t_bgimg = (typeof tt.T_BGIMG != tt_u)? tt.T_BGIMG : ttBgImg, + t_bc = (typeof tt.T_BORDERCOLOR != tt_u)? tt.T_BORDERCOLOR : ttBorderColor, + t_bw = (typeof tt.T_BORDERWIDTH != tt_u)? tt.T_BORDERWIDTH : ttBorderWidth, + t_ff = (typeof tt.T_FONTFACE != tt_u)? tt.T_FONTFACE : ttFontFace, + t_fc = (typeof tt.T_FONTCOLOR != tt_u)? tt.T_FONTCOLOR : ttFontColor, + t_fsz = (typeof tt.T_FONTSIZE != tt_u)? tt.T_FONTSIZE : ttFontSize, + t_fwght = (typeof tt.T_FONTWEIGHT != tt_u)? tt.T_FONTWEIGHT : ttFontWeight, + t_opa = (typeof tt.T_OPACITY != tt_u)? tt.T_OPACITY : ttOpacity, + t_padd = (typeof tt.T_PADDING != tt_u)? tt.T_PADDING : ttPadding, + t_shc = (typeof tt.T_SHADOWCOLOR != tt_u)? tt.T_SHADOWCOLOR : (ttShadowColor || 0), + t_shw = (typeof tt.T_SHADOWWIDTH != tt_u)? tt.T_SHADOWWIDTH : (ttShadowWidth || 0), + t_algn = (typeof tt.T_TEXTALIGN != tt_u)? tt.T_TEXTALIGN : ttTextAlign, + t_tit = (typeof tt.T_TITLE != tt_u)? tt.T_TITLE : "", + t_titc = (typeof tt.T_TITLECOLOR != tt_u)? tt.T_TITLECOLOR : ttTitleColor, + t_w = (typeof tt.T_WIDTH != tt_u)? tt.T_WIDTH : ttWidth; + if(t_shc || t_shw) + { + t_shc = t_shc || "#c0c0c0"; + t_shw = t_shw || 5; + } + if(tt_n4 && (t_fsz == "10px" || t_fsz == "11px")) t_fsz = "12px"; + + var t_optx = (tt_n4? '' : tt_n6? ('-moz-opacity:'+(t_opa/100.0)) : tt_ie? ('filter:Alpha(opacity='+t_opa+')') : ('opacity:'+(t_opa/100.0))) + ';'; + var t_y = '
' + + ''; + if(t_tit) + { + t_y += ''; + } + t_y += '
' + + (tt_n4? ' ' : '')+t_tit+'
' + + ''; + if(t_fwght == 'bold') t_y += ''; + t_y += txt; + if(t_fwght == 'bold') t_y += ''; + t_y += '
'; + if(t_shw) + { + var t_spct = Math.round(t_shw*1.3); + if(tt_n4) + { + t_y += '' + + ''; + } + else + { + t_optx = tt_n6? '-moz-opacity:0.85;' : tt_ie? 'filter:Alpha(opacity=85);' : 'opacity:0.85;'; + t_y += '
' + + '
'; + } + } + return(t_y+'
'); +} +function tt_EvX(t_e) +{ + var t_y = tt_Int(t_e.pageX || t_e.clientX || 0) + + tt_Int(tt_ie? tt_db.scrollLeft : 0) + + tt_offX; + if(t_y > xlim) t_y = xlim; + var t_scr = tt_Int(window.pageXOffset || (tt_db? tt_db.scrollLeft : 0) || 0); + if(t_y < t_scr) t_y = t_scr; + return t_y; +} +function tt_EvY(t_e) +{ + var t_y2; + + var t_y = tt_Int(t_e.pageY || t_e.clientY || 0) + + tt_Int(tt_ie? tt_db.scrollTop : 0); + if(tt_sup && (t_y2 = t_y - (tt_objH + tt_offY - 15)) >= tt_Int(window.pageYOffset || (tt_db? tt_db.scrollTop : 0) || 0)) + t_y -= (tt_objH + tt_offY - 15); + else if(t_y > ylim || !tt_sub && t_y > ylim-24) + { + t_y -= (tt_objH + 5); + tt_sub = false; + } + else + { + t_y += tt_offY; + tt_sub = true; + } + return t_y; +} +function tt_ReleasMov() +{ + if(document.onmousemove == tt_Move) + { + if(!tt_mf && tt_ce) document.releaseEvents(Event.MOUSEMOVE); + document.onmousemove = tt_mf; + } +} +function tt_ShowIfrm(t_x) +{ + if(!tt_obj || !tt_ifrm) return; + if(t_x) + { + tt_ifrm.style.width = tt_objW+'px'; + tt_ifrm.style.height = tt_objH+'px'; + tt_ifrm.style.display = "block"; + } + else tt_ifrm.style.display = "none"; +} +function tt_GetDiv(t_id) +{ + return( + tt_n4? (document.layers[t_id] || null) + : tt_ie? (document.all[t_id] || null) + : (document.getElementById(t_id) || null) + ); +} +function tt_GetDivW() +{ + return tt_Int( + tt_n4? tt_obj.clip.width + : (tt_obj.style.pixelWidth || tt_obj.offsetWidth) + ); +} +function tt_GetDivH() +{ + return tt_Int( + tt_n4? tt_obj.clip.height + : (tt_obj.style.pixelHeight || tt_obj.offsetHeight) + ); +} + +// Compat with DragDrop Lib: Ensure that z-index of tooltip is lifted beyond toplevel dragdrop element +function tt_SetDivZ() +{ + var t_i = tt_obj.style || tt_obj; + if(t_i) + { + if(window.dd && dd.z) + t_i.zIndex = Math.max(dd.z+1, t_i.zIndex); + if(tt_ifrm) tt_ifrm.style.zIndex = t_i.zIndex-1; + } +} +function tt_SetDivPos(t_x, t_y) +{ + var t_i = tt_obj.style || tt_obj; + var t_px = (tt_op6 || tt_n4)? '' : 'px'; + t_i.left = (tt_objX = t_x) + t_px; + t_i.top = (tt_objY = t_y) + t_px; + // window... to circumvent the FireFox Alzheimer Bug + if(window.tt_ifrm) + { + tt_ifrm.style.left = t_i.left; + tt_ifrm.style.top = t_i.top; + } +} +function tt_ShowDiv(t_x) +{ + tt_ShowIfrm(t_x); + if(tt_n4) tt_obj.visibility = t_x? 'show' : 'hide'; + else tt_obj.style.visibility = t_x? 'visible' : 'hidden'; + tt_act = t_x; +} +function tt_DeAlt(t_tag) +{ + if(t_tag) + { + if(t_tag.alt) t_tag.alt = ""; + if(t_tag.title) t_tag.title = ""; + var t_c = t_tag.children || t_tag.childNodes || null; + if(t_c) + { + for(var t_i = t_c.length; t_i; ) + tt_DeAlt(t_c[--t_i]); + } + } +} +function tt_OpDeHref(t_e) +{ + var t_tag; + if(t_e) + { + t_tag = t_e.target; + while(t_tag) + { + if(t_tag.hasAttribute("href")) + { + tt_tag = t_tag + tt_tag.t_href = tt_tag.getAttribute("href"); + tt_tag.removeAttribute("href"); + tt_tag.style.cursor = "hand"; + tt_tag.onmousedown = tt_OpReHref; + tt_tag.stats = window.status; + window.status = tt_tag.t_href; + break; + } + t_tag = t_tag.parentElement; + } + } +} +function tt_OpReHref() +{ + if(tt_tag) + { + tt_tag.setAttribute("href", tt_tag.t_href); + window.status = tt_tag.stats; + tt_tag = null; + } +} +function tt_Show(t_e, t_id, t_sup, t_clk, t_delay, t_fix, t_left, t_offx, t_offy, t_static, t_sticky, t_temp) +{ + if(tt_obj) tt_Hide(); + tt_mf = document.onmousemove || null; + if(window.dd && (window.DRAG && tt_mf == DRAG || window.RESIZE && tt_mf == RESIZE)) return; + var t_sh, t_h; + + tt_obj = tt_GetDiv(t_id); + if(tt_obj) + { + t_e = t_e || window.event; + tt_sub = !(tt_sup = t_sup); + tt_sticky = t_sticky; + tt_objW = tt_GetDivW(); + tt_objH = tt_GetDivH(); + tt_offX = t_left? -(tt_objW+t_offx) : t_offx; + tt_offY = t_offy; + if(tt_op7) tt_OpDeHref(t_e); + if(tt_n4) + { + if(tt_obj.document.layers.length) + { + t_sh = tt_obj.document.layers[0]; + t_sh.clip.height = tt_objH - Math.round(t_sh.clip.width*1.3); + } + } + else + { + t_sh = tt_GetDiv(t_id+'R'); + if(t_sh) + { + t_h = tt_objH - tt_Int(t_sh.style.pixelTop || t_sh.style.top || 0); + if(typeof t_sh.style.pixelHeight != tt_u) t_sh.style.pixelHeight = t_h; + else t_sh.style.height = t_h+'px'; + } + } + + xlim = tt_Int((tt_db && tt_db.clientWidth)? tt_db.clientWidth : window.innerWidth) + + tt_Int(window.pageXOffset || (tt_db? tt_db.scrollLeft : 0) || 0) - + tt_objW - + (tt_n4? 21 : 0); + ylim = tt_Int(window.innerHeight || tt_db.clientHeight) + + tt_Int(window.pageYOffset || (tt_db? tt_db.scrollTop : 0) || 0) - + tt_objH - tt_offY; + + tt_SetDivZ(); + if(t_fix) tt_SetDivPos(tt_Int((t_fix = t_fix.split(','))[0]), tt_Int(t_fix[1])); + else tt_SetDivPos(tt_EvX(t_e), tt_EvY(t_e)); + + var t_txt = 'tt_ShowDiv(\'true\');'; + if(t_sticky) t_txt += '{'+ + 'tt_ReleasMov();'+ + (t_clk? ('window.tt_upFunc = document.onmouseup || null;'+ + 'if(tt_ce) document.captureEvents(Event.MOUSEUP);'+ + 'document.onmouseup = new Function("window.setTimeout(\'tt_Hide();\', 10);");') : '')+ + '}'; + else if(t_static) t_txt += 'tt_ReleasMov();'; + if(t_temp > 0) t_txt += 'window.tt_rtm = window.setTimeout(\'tt_sticky = false; tt_Hide();\','+t_temp+');'; + window.tt_rdl = window.setTimeout(t_txt, t_delay); + + if(!t_fix) + { + if(tt_ce) document.captureEvents(Event.MOUSEMOVE); + document.onmousemove = tt_Move; + } + } +} +var tt_area = false; +function tt_Move(t_ev) +{ + if(!tt_obj) return; + if(tt_n6 || tt_w3c) + { + if(tt_wait) return; + tt_wait = true; + setTimeout('tt_wait = false;', 5); + } + var t_e = t_ev || window.event; + tt_SetDivPos(tt_EvX(t_e), tt_EvY(t_e)); + if(window.tt_op6) + { + if(tt_area && t_e.target.tagName != 'AREA') tt_Hide(); + else if(t_e.target.tagName == 'AREA') tt_area = true; + } +} +function tt_Hide() +{ + if(window.tt_obj) + { + if(window.tt_rdl) window.clearTimeout(tt_rdl); + if(!tt_sticky || !tt_act) + { + if(window.tt_rtm) window.clearTimeout(tt_rtm); + tt_ShowDiv(false); + tt_SetDivPos(-tt_objW, -tt_objH); + tt_obj = null; + if(typeof window.tt_upFunc != tt_u) document.onmouseup = window.tt_upFunc; + } + tt_sticky = false; + if(tt_op6 && tt_area) tt_area = false; + tt_ReleasMov(); + if(tt_op7) tt_OpReHref(); + } +} +function tt_Init() +{ + if(!(tt_op || tt_n4 || tt_n6 || tt_ie || tt_w3c)) return; + + var htm = tt_n4? '
' : '', + tags, + t_tj, + over, + t_b, + esc = 'return escape('; + for(var i = tt_tags.length; i;) + {--i; + tags = tt_ie? (document.all.tags(tt_tags[i]) || 1) + : document.getElementsByTagName? (document.getElementsByTagName(tt_tags[i]) || 1) + : (!tt_n4 && tt_tags[i]=="a")? document.links + : 1; + if(tt_n4 && (tt_tags[i] == "a" || tt_tags[i] == "layer")) tags = tt_N4Tags(tt_tags[i]); + for(var j = tags.length; j;) + {--j; + if(typeof (t_tj = tags[j]).onmouseover == "function" && t_tj.onmouseover.toString().indexOf(esc) != -1 && !tt_n6 || tt_n6 && (over = t_tj.getAttribute("onmouseover")) && over.indexOf(esc) != -1) + { + if(over) t_tj.onmouseover = new Function(over); + var txt = unescape(t_tj.onmouseover()); + htm += tt_Htm( + t_tj, + "tOoLtIp"+i+""+j, + txt.wzReplace("& ","&") + ); + // window. to circumvent the FF Alzheimer Bug + t_tj.onmouseover = new Function('e', + 'if(window.tt_Show && tt_Show) tt_Show(e,'+ + '"tOoLtIp' +i+''+j+ '",'+ + ((typeof t_tj.T_ABOVE != tt_u)? t_tj.T_ABOVE : ttAbove)+','+ + ((typeof t_tj.T_CLICKCLOSE != tt_u)? t_tj.T_CLICKCLOSE : ttClickClose)+','+ + ((typeof t_tj.T_DELAY != tt_u)? t_tj.T_DELAY : ttDelay)+','+ + ((typeof t_tj.T_FIX != tt_u)? '"'+t_tj.T_FIX+'"' : '""')+','+ + ((typeof t_tj.T_LEFT != tt_u)? t_tj.T_LEFT : ttLeft)+','+ + ((typeof t_tj.T_OFFSETX != tt_u)? t_tj.T_OFFSETX : ttOffsetX)+','+ + ((typeof t_tj.T_OFFSETY != tt_u)? t_tj.T_OFFSETY : ttOffsetY)+','+ + ((typeof t_tj.T_STATIC != tt_u)? t_tj.T_STATIC : ttStatic)+','+ + ((typeof t_tj.T_STICKY != tt_u)? t_tj.T_STICKY : ttSticky)+','+ + ((typeof t_tj.T_TEMP != tt_u)? t_tj.T_TEMP : ttTemp)+ + ');' + ); + t_tj.onmouseout = tt_Hide; + tt_DeAlt(t_tj); + } + } + } + if(tt_ie6) htm += ''; + t_b = document.getElementsByTagName? document.getElementsByTagName("body")[0] : tt_db; + if(t_b && t_b.insertAdjacentHTML) t_b.insertAdjacentHTML("AfterBegin", htm); + else if(t_b && typeof t_b.innerHTML != tt_u && document.createElement && t_b.appendChild) + { + var t_el = document.createElement("div"); + t_b.appendChild(t_el); + t_el.innerHTML = htm; + } + else + document.write(htm); + if(document.getElementById) tt_ifrm = document.getElementById("TTiEiFrM"); +} +tt_Init(); diff --git a/plugins/webinterface/www/mobile/Makefile.am b/plugins/webinterface/www/mobile/Makefile.am new file mode 100644 index 0000000..3aae8b4 --- /dev/null +++ b/plugins/webinterface/www/mobile/Makefile.am @@ -0,0 +1,8 @@ +INCLUDES = -I$(srcdir)/../../libktorrent $(all_includes) +METASOURCES = AUTO + +ktdatadir = $(kde_datadir)/ktorrent/www/mobile + + + +ktdata_DATA = favicon.ico interface.php ktorrentwebinterfacelogo.png login.html remove.png start.png stop.png settings.php torrent.php diff --git a/plugins/webinterface/www/mobile/favicon.ico b/plugins/webinterface/www/mobile/favicon.ico new file mode 100644 index 0000000..3213b23 Binary files /dev/null and b/plugins/webinterface/www/mobile/favicon.ico differ diff --git a/plugins/webinterface/www/mobile/interface.php b/plugins/webinterface/www/mobile/interface.php new file mode 100644 index 0000000..57582de --- /dev/null +++ b/plugins/webinterface/www/mobile/interface.php @@ -0,0 +1,113 @@ + + +KTorrent WebInterface + + + + + + + + + + + + +
ktorrent->transfersrefresh
+
+ + + "; + $perc = round(100.0 - ($torrent['bytes_left_to_download'] / $torrent['total_bytes_to_download']) * 100.0, 2); + echo ""; + switch ($torrent['status']) { + case 0: + echo ""; + break; + case 1: + echo ""; + break; + case 2: + echo ""; + break; + case 3: + echo ""; + break; + case 4: + echo ""; + break; + case 5: + echo ""; + break; + case 6: + echo ""; + break; + case 7: + echo ""; + break; + case 8: + echo ""; + break; + case 9: + echo ""; + break; + case 10: + echo ""; + break; + default: + echo ""; + } + echo ""; + $a=$a+1; + echo ""; + } + ?> + + + + + + + + + Speed"; + echo ""; + echo ""; + ?> + + + + + + + + + + + + + + + + + + +
{$torrent['torrent_name']}Not StartedSeeding CompleteDownload CompleteSeedingDownloadingStalledStoppedAllocating DiskspaceErrorQueuedChecking DataNot supported Status$perc%
 
 
Down: {$globalinfo['download_speed']}Up: {$globalinfo['upload_speed']}
 
 
Start All Stop All
 Settings 
+
+ + +
+
+Local File: + +
+ + + + diff --git a/plugins/webinterface/www/mobile/ktorrentwebinterfacelogo.png b/plugins/webinterface/www/mobile/ktorrentwebinterfacelogo.png new file mode 100644 index 0000000..bc235b5 Binary files /dev/null and b/plugins/webinterface/www/mobile/ktorrentwebinterfacelogo.png differ diff --git a/plugins/webinterface/www/mobile/login.html b/plugins/webinterface/www/mobile/login.html new file mode 100644 index 0000000..359c44c --- /dev/null +++ b/plugins/webinterface/www/mobile/login.html @@ -0,0 +1,24 @@ + + + + + KTorrent WebInterface - Login + + + + + + +
+ + + + + + + + +
Username
Password
+ + + diff --git a/plugins/webinterface/www/mobile/remove.png b/plugins/webinterface/www/mobile/remove.png new file mode 100644 index 0000000..a7080ac Binary files /dev/null and b/plugins/webinterface/www/mobile/remove.png differ diff --git a/plugins/webinterface/www/mobile/settings.php b/plugins/webinterface/www/mobile/settings.php new file mode 100644 index 0000000..b763bb1 --- /dev/null +++ b/plugins/webinterface/www/mobile/settings.php @@ -0,0 +1,44 @@ + + +KTorrent WebInterface + + + + + + + + + + +
ktorrent->transfers->settingsrefresh
+ + +"; + echo ""; + echo ""; + echo ""; + echo " "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo""; + echo ""; + echo ""; + echo ""; + echo""; + echo ""; + echo ""; +?> + +
Upload Speed (0 is no limit):
Download Speed (0 is no limit):
Maximum downloads (0 is no limit):
Maximum seeds (0 is no limit):
+ + + + diff --git a/plugins/webinterface/www/mobile/start.png b/plugins/webinterface/www/mobile/start.png new file mode 100644 index 0000000..ead5c73 Binary files /dev/null and b/plugins/webinterface/www/mobile/start.png differ diff --git a/plugins/webinterface/www/mobile/stop.png b/plugins/webinterface/www/mobile/stop.png new file mode 100644 index 0000000..7c6d824 Binary files /dev/null and b/plugins/webinterface/www/mobile/stop.png differ diff --git a/plugins/webinterface/www/mobile/torrent.php b/plugins/webinterface/www/mobile/torrent.php new file mode 100644 index 0000000..a1e451d --- /dev/null +++ b/plugins/webinterface/www/mobile/torrent.php @@ -0,0 +1,91 @@ + + +KTorrent WebInterface + + + + + + + ktorrent->transfers->{$t['torrent_name']}"; + echo ""; + ?> + + +
refresh
+ + + + "; + echo ""; + echo ""; + ?> + + +
+ + + "; + echo ""; + switch ($t['status']) { + case 0: + echo ""; + break; + case 1: + echo ""; + break; + case 2: + echo ""; + break; + case 3: + echo ""; + break; + case 4: + echo ""; + break; + case 5: + echo ""; + break; + case 6: + echo ""; + break; + case 7: + echo ""; + break; + case 8: + echo ""; + break; + case 9: + echo ""; + break; + case 10: + echo ""; + break; + default: + echo ""; + } + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + $perc = round(100.0 - ($t['bytes_left_to_download'] / $t['total_bytes_to_download']) * 100.0, 2); + echo ""; + echo ""; + ?> + +
Status: NOT_STARTEDSEEDING_COMPLETEDOWNLOAD_COMPLETESEEDINGDOWNLOADINGSTALLEDSTOPPEDALLOCATING_DISKSPACEERRORQUEUEDCHECKING_DATANot supported Status
Down speed: {$t['download_rate']}
Up speed: {$t['upload_rate']}
Complete: $perc %
+ + + -- cgit v1.2.1