summaryrefslogtreecommitdiffstats
path: root/module/web
diff options
context:
space:
mode:
Diffstat (limited to 'module/web')
-rw-r--r--module/web/static/js/mobile.js38
-rw-r--r--module/web/templates/mobile/base.html143
-rw-r--r--module/web/templates/mobile/login.html48
3 files changed, 88 insertions, 141 deletions
diff --git a/module/web/static/js/mobile.js b/module/web/static/js/mobile.js
index 21d1be26c..58ccf5800 100644
--- a/module/web/static/js/mobile.js
+++ b/module/web/static/js/mobile.js
@@ -1,18 +1,22 @@
// Sets the require.js configuration for your application.
require.config({
-
- // 3rd party script alias names (Easier to type "jquery" than "libs/jquery-1.7.2.min")
- paths: {
- // Core Libraries
- jquery: "libs/jquery-1.8.0",
- underscore: "libs/lodash-0.4.2",
- backbone: "libs/backbone-0.9.2",
+ paths:{
+
+ jquery:"libs/jquery-1.8.0",
+ jqueryui:"libs/jqueryui",
+ flot:"libs/jquery.flot.min",
+ transit:"libs/jquery.transit-0.1.3",
+ fastClick:"libs/jquery.fastClick-0.2",
+ omniwindow: "libs/jquery.omniwindow",
- // Require.js Plugins
- text: "plugins/text-2.0.0"
+ underscore:"libs/lodash-0.5.2",
+ backbone:"libs/backbone-0.9.2",
- },
+ // Require.js Plugins
+ text:"plugins/text-2.0.3"
+
+ },
// Sets the configuration for your third party scripts that are not AMD compatible
shim: {
@@ -20,15 +24,19 @@ require.config({
"backbone": {
deps: ["underscore", "jquery"],
exports: "Backbone" //attaches "Backbone" to the window object
- }
+ },
+ transit: ["jquery"],
+ fastClick: ["jquery"]
} // end Shim Configuration
});
-// Include Desktop Specific JavaScript files here (or inside of your Desktop router)
-require(['jquery','backbone','routers/mobileRouter'], function($, Backbone, Mobile) {
+define('mobile', ['routers/mobileRouter', 'transit', 'fastClick'], function(Mobile) {
+
+ var init = function(){
+ var router = new Mobile();
+ };
- // Instantiates a new Router
- this.router = new Mobile();
+ return {"init":init};
}); \ No newline at end of file
diff --git a/module/web/templates/mobile/base.html b/module/web/templates/mobile/base.html
index 342a7eb63..1b717ff7b 100644
--- a/module/web/templates/mobile/base.html
+++ b/module/web/templates/mobile/base.html
@@ -1,84 +1,67 @@
<!DOCTYPE html>
<html>
- <head>
- <meta charset="utf-8" />
- <meta name="viewport" content="width=device-width, initial-scale=1" />
- <title>{% block title %}pyLoad {{ _("Webinterface") }}{% endblock %}</title>
- <link href="static/css/mobile/my.css" rel="stylesheet" type="text/css"/>
- <link href="static/css/mobile/jquery.mobile-1.1.1.min.css" rel="stylesheet" type="text/css"/>
- <script type="text/javascript" src="static/js/libs/jquery-1.8.0.min.js"></script>
- <script type="text/javascript" src="static/js/libs/jquery.mobile-1.1.1.min.js"></script>
- <script type="text/javascript" src="static/js/mobile/my.js"></script>
- {% block head %}
- {% endblock %}
- </head>
- <body>
-
-{% block content %}
-<!-- home -->
-<div data-role="page" id="page1" style="background: url('/static/img/default/fancy_deboss.png') repeat">
- <div data-role="content" style="padding: 1%">
- <div data-role="navbar" data-iconpos="bottom">
- <ul>
- <li>
- <a href="#page1" data-theme="a" data-icon="home" class="ui-btn-active ui-state-persist">
- Home
- </a>
- </li>
- <li>
- <a href="#page1" data-theme="a" data-icon="plus">
- Add
- </a>
- </li>
- <li>
- <a href="#page1" data-theme="a" data-icon="gear">
- Settings
- </a>
- </li>
- <li>
- <a href="/logout" data-ajax="false" data-theme="a" data-icon="arrow-r">
- Logout
- </a>
- </li>
- </ul>
- </div>
- <div data-role="collapsible-set" data-theme="a" data-content-theme="d">
- <div data-role="collapsible" data-collapsed="true">
- <h3>
- Package1
- </h3>
- </div>
- <div data-role="collapsible" data-collapsed="true">
- <h3>
- Package2
- </h3>
- </div>
- <div data-role="collapsible" data-collapsed="false">
- <h3>
- Package3
- </h3>
- <ul data-role="listview" data-divider-theme="b" data-inset="true">
- <li data-theme="c">
- <a href="#page1" data-transition="slide">
- File1
- </a>
- </li>
- <li data-theme="c">
- <a href="#page1" data-transition="slide">
- File2
- </a>
- </li>
- <li data-theme="c">
- <a href="#page1" data-transition="slide">
- File3
- </a>
- </li>
- </ul>
- </div>
- </div>
+<head>
+ <meta charset="utf-8">
+ <title>{% block title %}pyLoad {{ _("Webinterface") }}{% endblock %}</title>
+ <meta name="description" content="">
+ <meta name="HandheldFriendly" content="True">
+ <meta name="MobileOptimized" content="320">
+ <meta name="viewport" content="width=device-width">
+ <meta http-equiv="cleartype" content="on">
+
+ <link rel="shortcut icon" href="img/touch/apple-touch-icon.png">
+ <link rel="stylesheet" href="/static/css/mobile/main.css">
+
+ <script type="text/javascript" data-main="static/js/mobile" src="static/js/libs/require-2.0.6.js"></script>
+ {% block head %}
+ {% endblock %}
+ <style>
+ * {
+ margin: 0;
+ }
+
+ .viewport {
+ overflow-x: hidden;
+ }
+
+ #content {
+ position: relative;
+ width: 100%;
+ }
+
+ ul li {
+ display: inline;
+ padding-right: 10px;
+ }
+
+ .page {
+ position: absolute;
+ left: 0;
+ width: 100%;
+ border: 1px solid red;
+ }
+ </style>
+</head>
+<body class="viewport">
+<header>
+ <ul>
+ <li><a id="p1" href="#">Page 1</a></li>
+ <li><a id="p2" href="#">Page 2</a></li>
+ </ul>
+</header>
+<div id="content">
+ <div class="page">
+ <h1>dfgfdg</h1>
+ {% block content %}
+ {% endblock content %}
</div>
</div>
-{% endblock content %}
-
- </body>
-</html> \ No newline at end of file
+<footer>
+</footer>
+<script>
+ require(['mobile'], function (App) {
+ App.init();
+ });
+</script>
+</body>
+</html>
diff --git a/module/web/templates/mobile/login.html b/module/web/templates/mobile/login.html
index 37698cc5c..5a1625f43 100644
--- a/module/web/templates/mobile/login.html
+++ b/module/web/templates/mobile/login.html
@@ -1,49 +1,5 @@
-{% extends 'default_mobile/base.html' %}
+{% extends 'mobile/base.html' %}
{% block title %}{{_("Login")}} - {{super()}} {% endblock %}
{% block content %}
-<!-- Login -->
-<div data-role="page" id="login" style="background: url('/static/img/default_mobile/fancy_deboss.png') repeat">
- <div data-theme="a" data-role="header">
- <h3>
- pyLoad {{_("Login")}}
- </h3>
- </div>
- <div data-role="content" style="padding: 10px">
- {% if logout %}
- <div>
- <b>{{_("You were successfully logged out.")}}</b>
- </div>
- {% endif %}
- <form action="/login" method="POST" data-ajax="false">
- <div data-role="fieldcontain">
- <fieldset data-role="controlgroup">
- <label for="textinput1">
- {{_("Username")}}
- </label>
- <input name="username" id="textinput1" placeholder="" value="" type="text" />
- </fieldset>
- </div>
- <div data-role="fieldcontain">
- <fieldset data-role="controlgroup">
- <label for="textinput2">
- {{_("Password")}}
- </label>
- <input name="password" id="textinput2" placeholder="" value="" type="password" />
- </fieldset>
- </div>
- <input type="submit" data-theme="a" value="Login" />
- </form>
- {% if errors %}
- <div>
- <p>{{_("Your username and password didn't match. Please try again.")}}</p>
- {{ _("To reset your login data or add an user run:") }} <b> python pyLoadCore.py -u</b>
- </div>
- {% endif %}
- <div>
- <a href="/toggle_mobile" data-ajax="false">
- {{_("Desktop Version")}}
- </a>
- </div>
- </div>
-</div>
+<h1>Test test sd</h1>
{% endblock %} \ No newline at end of file