# HG changeset patch # User Michael Schloh von Bennewitz # Date 1430143506 -7200 # Node ID 76acfbeeb09c5785c2d2f33a0230f345d3d20267 Import initial genesis of local project. diff -r 000000000000 -r 76acfbeeb09c manifest.json --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/manifest.json Mon Apr 27 16:05:06 2015 +0200 @@ -0,0 +1,15 @@ +{ + "name": "com.ubuntu.developer.username.timetask", + "description": "description of timetask", + "framework": "ubuntu-sdk-14.04-html", + "architecture": "all", + "title": "timetask", + "hooks": { + "timetask": { + "apparmor": "timetask.json", + "desktop": "timetask.desktop" + } + }, + "version": "0.1", + "maintainer": "" +} \ No newline at end of file diff -r 000000000000 -r 76acfbeeb09c timetask.desktop --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/timetask.desktop Mon Apr 27 16:05:06 2015 +0200 @@ -0,0 +1,7 @@ +[Desktop Entry] +Name=timetask +Exec=ubuntu-html5-app-launcher $@ --www=www +Icon=qmlscene +Terminal=false +Type=Application +X-Ubuntu-Touch=true diff -r 000000000000 -r 76acfbeeb09c timetask.json --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/timetask.json Mon Apr 27 16:05:06 2015 +0200 @@ -0,0 +1,6 @@ +{ + "policy_groups": [ + "networking" + ], + "policy_version": 1.1 +} \ No newline at end of file diff -r 000000000000 -r 76acfbeeb09c timetask.ubuntuhtmlproject --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/timetask.ubuntuhtmlproject Mon Apr 27 16:05:06 2015 +0200 @@ -0,0 +1,53 @@ +/* File generated by Qt Creator (with Ubuntu Plugin), version 3.0.1 */ + +import QmlProject 1.1 + +Project { + mainFile: "www/index.html" + + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } + Files { + filter: "*.desktop" + } + Files { + filter: "www/*.html" + } + Files { + filter: "Makefile" + } + Files { + directory: "www" + filter: "*" + } + Files { + directory: "www/img/" + filter: "*" + } + Files { + directory: "www/css/" + filter: "*" + } + Files { + directory: "www/js/" + filter: "*" + } + Files { + directory: "tests/" + filter: "*" + } + Files { + directory: "debian" + filter: "*" + } + /* List of plugin directories passed to QML runtime */ + importPaths: [ "." ,"/usr/bin","/usr/lib/x86_64-linux-gnu/qt5/qml" ] +} diff -r 000000000000 -r 76acfbeeb09c www/index.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/www/index.html Mon Apr 27 16:05:06 2015 +0200 @@ -0,0 +1,134 @@ + + + + + An Ubuntu HTML5 application + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
    +
  • Hello World
  • +
+
+ +
+ + + +
+ +
+
My List Header
+
    + +
  • + + +

    Jane

    + + + +
  • + +
  • + + +

    Mark

    + + + +
  • + +
  • + + +

    Olivier

    + + + +
  • + +
+ +
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+

+ + + +
+
+ +
+ +
+ +
+ + diff -r 000000000000 -r 76acfbeeb09c www/js/app.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/www/js/app.js Mon Apr 27 16:05:06 2015 +0200 @@ -0,0 +1,63 @@ +/** + * Wait before the DOM has been loaded before initializing the Ubuntu UI layer + */ +window.onload = function () { + var UI = new UbuntuUI(); + UI.init(); + + // Wire all the simple logic + document.getElementById('no').addEventListener('click', function() { + UI.dialog('dialog1').hide(); + }); + + function getContacts() { + return [].slice.call(document.querySelectorAll('#contacts li')); + }; + + var contacts = getContacts(); + contacts.forEach(function (contact) { + contact.addEventListener('click', function() { + contact.classList.add('selected'); + }); + }); + + function getSelectedContacts() { + var selectedContactInputs = [].slice.call(document.querySelectorAll('#contacts li label input:checked')); + return selectedContactInputs.map(function (contactInputElement) { return contactInputElement.parentNode.parentNode; }); + } + + function getContactName(contact) { + return contact.querySelector('p').innerHTML; + } + + function displayMessage(message) { + document.querySelector('#dialog1 h1').innerHTML = message; + UI.dialog('dialog1').show(); + }; + + document.getElementById('call').addEventListener('click', function() { + var sc = getSelectedContacts(); + if (! sc || sc.length !== 1) { + displayMessage('Please select one and only one contact'); + return; + } + displayMessage('Calling: ' + getContactName(sc[0])); + }); + + document.getElementById('text').addEventListener('click', function() { + var sc = getSelectedContacts(); + if (! sc || sc.length !== 1) { + displayMessage('Please select one and only one contact'); + return; + } + displayMessage('Texting: ' + getContactName(sc[0])); + }); + + // Add an event listener that is pending on the initialization + // of the platform layer API, if it is being used. + document.addEventListener("deviceready", function() { + if (console && console.log) + console.log('Platform layer API ready'); + }, false); +}; +