Mon, 27 Apr 2015 16:05:06 +0200
Import initial genesis of local project.
manifest.json | file | annotate | diff | comparison | revisions | |
timetask.desktop | file | annotate | diff | comparison | revisions | |
timetask.json | file | annotate | diff | comparison | revisions | |
timetask.ubuntuhtmlproject | file | annotate | diff | comparison | revisions | |
www/index.html | file | annotate | diff | comparison | revisions | |
www/js/app.js | file | annotate | diff | comparison | revisions |
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/manifest.json Mon Apr 27 16:05:06 2015 +0200 1.3 @@ -0,0 +1,15 @@ 1.4 +{ 1.5 + "name": "com.ubuntu.developer.username.timetask", 1.6 + "description": "description of timetask", 1.7 + "framework": "ubuntu-sdk-14.04-html", 1.8 + "architecture": "all", 1.9 + "title": "timetask", 1.10 + "hooks": { 1.11 + "timetask": { 1.12 + "apparmor": "timetask.json", 1.13 + "desktop": "timetask.desktop" 1.14 + } 1.15 + }, 1.16 + "version": "0.1", 1.17 + "maintainer": "" 1.18 +} 1.19 \ No newline at end of file
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/timetask.desktop Mon Apr 27 16:05:06 2015 +0200 2.3 @@ -0,0 +1,7 @@ 2.4 +[Desktop Entry] 2.5 +Name=timetask 2.6 +Exec=ubuntu-html5-app-launcher $@ --www=www 2.7 +Icon=qmlscene 2.8 +Terminal=false 2.9 +Type=Application 2.10 +X-Ubuntu-Touch=true
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 3.2 +++ b/timetask.json Mon Apr 27 16:05:06 2015 +0200 3.3 @@ -0,0 +1,6 @@ 3.4 +{ 3.5 + "policy_groups": [ 3.6 + "networking" 3.7 + ], 3.8 + "policy_version": 1.1 3.9 +} 3.10 \ No newline at end of file
4.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 4.2 +++ b/timetask.ubuntuhtmlproject Mon Apr 27 16:05:06 2015 +0200 4.3 @@ -0,0 +1,53 @@ 4.4 +/* File generated by Qt Creator (with Ubuntu Plugin), version 3.0.1 */ 4.5 + 4.6 +import QmlProject 1.1 4.7 + 4.8 +Project { 4.9 + mainFile: "www/index.html" 4.10 + 4.11 + /* Include .qml, .js, and image files from current directory and subdirectories */ 4.12 + QmlFiles { 4.13 + directory: "." 4.14 + } 4.15 + JavaScriptFiles { 4.16 + directory: "." 4.17 + } 4.18 + ImageFiles { 4.19 + directory: "." 4.20 + } 4.21 + Files { 4.22 + filter: "*.desktop" 4.23 + } 4.24 + Files { 4.25 + filter: "www/*.html" 4.26 + } 4.27 + Files { 4.28 + filter: "Makefile" 4.29 + } 4.30 + Files { 4.31 + directory: "www" 4.32 + filter: "*" 4.33 + } 4.34 + Files { 4.35 + directory: "www/img/" 4.36 + filter: "*" 4.37 + } 4.38 + Files { 4.39 + directory: "www/css/" 4.40 + filter: "*" 4.41 + } 4.42 + Files { 4.43 + directory: "www/js/" 4.44 + filter: "*" 4.45 + } 4.46 + Files { 4.47 + directory: "tests/" 4.48 + filter: "*" 4.49 + } 4.50 + Files { 4.51 + directory: "debian" 4.52 + filter: "*" 4.53 + } 4.54 + /* List of plugin directories passed to QML runtime */ 4.55 + importPaths: [ "." ,"/usr/bin","/usr/lib/x86_64-linux-gnu/qt5/qml" ] 4.56 +}
5.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 5.2 +++ b/www/index.html Mon Apr 27 16:05:06 2015 +0200 5.3 @@ -0,0 +1,134 @@ 5.4 +<!DOCTYPE html> 5.5 +<html> 5.6 + <head> 5.7 + <meta charset="utf-8"> 5.8 + <title>An Ubuntu HTML5 application</title> 5.9 + <meta name="description" content="An Ubuntu HTML5 application"> 5.10 + <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"> 5.11 + 5.12 + <!-- Ubuntu UI Style imports - Ambiance theme --> 5.13 + <link href="/usr/share/ubuntu-html5-ui-toolkit/0.1/ambiance/css/appTemplate.css" rel="stylesheet" type="text/css" /> 5.14 + 5.15 + <!-- Ubuntu UI javascript imports - Ambiance theme --> 5.16 + <script src="/usr/share/ubuntu-html5-ui-toolkit/0.1/ambiance/js/fast-buttons.js"></script> 5.17 + <script src="/usr/share/ubuntu-html5-ui-toolkit/0.1/ambiance/js/core.js"></script> 5.18 + <script src="/usr/share/ubuntu-html5-ui-toolkit/0.1/ambiance/js/buttons.js"></script> 5.19 + <script src="/usr/share/ubuntu-html5-ui-toolkit/0.1/ambiance/js/dialogs.js"></script> 5.20 + <script src="/usr/share/ubuntu-html5-ui-toolkit/0.1/ambiance/js/page.js"></script> 5.21 + <script src="/usr/share/ubuntu-html5-ui-toolkit/0.1/ambiance/js/pagestacks.js"></script> 5.22 + <script src="/usr/share/ubuntu-html5-ui-toolkit/0.1/ambiance/js/tabs.js"></script> 5.23 + 5.24 + <!-- Cordova platform API access - Uncomment this to have access to the Javascript APIs --> 5.25 + <!-- <script src="cordova/cordova.js"></script> --> 5.26 + 5.27 + <!-- Application script --> 5.28 + <script src="js/app.js"></script> 5.29 + </head> 5.30 + 5.31 + <body> 5.32 + 5.33 + <div data-role="mainview"> 5.34 + 5.35 + <header data-role="header"> 5.36 + <ul data-role="tabs"> 5.37 + <li data-role="tabitem" data-page="hello-page">Hello World</li> 5.38 + </ul> 5.39 + </header> 5.40 + 5.41 + <div data-role="content"> 5.42 + 5.43 + <!-- The application main page --> 5.44 + 5.45 + <div data-role="page" id="hello-page"> 5.46 + 5.47 + <section data-role="list"> 5.48 + <header class="large-font">My List Header</header> 5.49 + <ul data-role="listview" id="contacts"> 5.50 + 5.51 + <li> 5.52 + <aside> 5.53 + <img alt="placeholder" src="/usr/share/ubuntu-html5-ui-toolkit/0.1/ambiance/img/avatar_contacts_list@8.png"> 5.54 + </aside> 5.55 + 5.56 + <p>Jane</p> 5.57 + 5.58 + <!-- A list item side control --> 5.59 + <label> 5.60 + <input type="checkbox" data-type="switch"> 5.61 + <span class="toggle"> 5.62 + <span class="toggle-handle"></span> 5.63 + <span class="toggle-bg"></span> 5.64 + </span> 5.65 + </label> 5.66 + </li> 5.67 + 5.68 + <li> 5.69 + <aside> 5.70 + <img alt="placeholder" src="/usr/share/ubuntu-html5-ui-toolkit/0.1/ambiance/img/avatar_contacts_list@8.png"> 5.71 + </aside> 5.72 + 5.73 + <p>Mark</p> 5.74 + 5.75 + <!-- A list item side control --> 5.76 + <label> 5.77 + <input type="checkbox" data-type="switch"> 5.78 + <span class="toggle"> 5.79 + <span class="toggle-handle"></span> 5.80 + <span class="toggle-bg"></span> 5.81 + </span> 5.82 + </label> 5.83 + </li> 5.84 + 5.85 + <li> 5.86 + <aside> 5.87 + <img alt="placeholder" src="/usr/share/ubuntu-html5-ui-toolkit/0.1/ambiance/img/avatar_contacts_list@8.png"> 5.88 + </aside> 5.89 + 5.90 + <p>Olivier</p> 5.91 + 5.92 + <!-- A list item side control --> 5.93 + <label> 5.94 + <input type="checkbox" data-type="switch"> 5.95 + <span class="toggle"> 5.96 + <span class="toggle-handle"></span> 5.97 + <span class="toggle-bg"></span> 5.98 + </span> 5.99 + </label> 5.100 + </li> 5.101 + 5.102 + </ul> 5.103 + 5.104 + </section> 5.105 + 5.106 + <div class="inset" style="margin-top: 1em; text-align: center" > 5.107 + 5.108 + <div style="margin: 0em 1em 1em 1em"> 5.109 + <button id="text" data-role="button" class="ubuntu" style="width: 100%"> 5.110 + Text 5.111 + </button> 5.112 + </div> 5.113 + <div style="margin: 0em 1em 1em 1em"> 5.114 + <button id="call" data-role="button" class="ubuntu" style="width: 100%"> 5.115 + Call 5.116 + <span class="icon icon-call"></span> 5.117 + </button> 5.118 + </div> 5.119 + 5.120 + </div> 5.121 + 5.122 + <div data-role="dialog" id="dialog1"> 5.123 + <section> 5.124 + <h1></h1> 5.125 + <menu> 5.126 + <button data-role="button" id="no">OK</button> 5.127 + </menu> 5.128 + </section> 5.129 + </div> 5.130 + 5.131 + </div> 5.132 + 5.133 + </div> 5.134 + 5.135 + </div> 5.136 + </body> 5.137 +</html>
6.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 6.2 +++ b/www/js/app.js Mon Apr 27 16:05:06 2015 +0200 6.3 @@ -0,0 +1,63 @@ 6.4 +/** 6.5 + * Wait before the DOM has been loaded before initializing the Ubuntu UI layer 6.6 + */ 6.7 +window.onload = function () { 6.8 + var UI = new UbuntuUI(); 6.9 + UI.init(); 6.10 + 6.11 + // Wire all the simple logic 6.12 + document.getElementById('no').addEventListener('click', function() { 6.13 + UI.dialog('dialog1').hide(); 6.14 + }); 6.15 + 6.16 + function getContacts() { 6.17 + return [].slice.call(document.querySelectorAll('#contacts li')); 6.18 + }; 6.19 + 6.20 + var contacts = getContacts(); 6.21 + contacts.forEach(function (contact) { 6.22 + contact.addEventListener('click', function() { 6.23 + contact.classList.add('selected'); 6.24 + }); 6.25 + }); 6.26 + 6.27 + function getSelectedContacts() { 6.28 + var selectedContactInputs = [].slice.call(document.querySelectorAll('#contacts li label input:checked')); 6.29 + return selectedContactInputs.map(function (contactInputElement) { return contactInputElement.parentNode.parentNode; }); 6.30 + } 6.31 + 6.32 + function getContactName(contact) { 6.33 + return contact.querySelector('p').innerHTML; 6.34 + } 6.35 + 6.36 + function displayMessage(message) { 6.37 + document.querySelector('#dialog1 h1').innerHTML = message; 6.38 + UI.dialog('dialog1').show(); 6.39 + }; 6.40 + 6.41 + document.getElementById('call').addEventListener('click', function() { 6.42 + var sc = getSelectedContacts(); 6.43 + if (! sc || sc.length !== 1) { 6.44 + displayMessage('Please select one and only one contact'); 6.45 + return; 6.46 + } 6.47 + displayMessage('Calling: ' + getContactName(sc[0])); 6.48 + }); 6.49 + 6.50 + document.getElementById('text').addEventListener('click', function() { 6.51 + var sc = getSelectedContacts(); 6.52 + if (! sc || sc.length !== 1) { 6.53 + displayMessage('Please select one and only one contact'); 6.54 + return; 6.55 + } 6.56 + displayMessage('Texting: ' + getContactName(sc[0])); 6.57 + }); 6.58 + 6.59 + // Add an event listener that is pending on the initialization 6.60 + // of the platform layer API, if it is being used. 6.61 + document.addEventListener("deviceready", function() { 6.62 + if (console && console.log) 6.63 + console.log('Platform layer API ready'); 6.64 + }, false); 6.65 +}; 6.66 +