unity-webapps-qml-0.1+14.04.20140408/ 0000755 0000153 0177776 00000000000 12320723226 017347 5 ustar pbuser nogroup 0000000 0000000 unity-webapps-qml-0.1+14.04.20140408/tools/ 0000755 0000153 0177776 00000000000 12320723226 020507 5 ustar pbuser nogroup 0000000 0000000 unity-webapps-qml-0.1+14.04.20140408/tools/js-idl/ 0000755 0000153 0177776 00000000000 12320723226 021671 5 ustar pbuser nogroup 0000000 0000000 unity-webapps-qml-0.1+14.04.20140408/tools/js-idl/unity-webapps.idl 0000644 0000153 0177776 00000004643 12320722666 025210 0 ustar pbuser nogroup 0000000 0000000 dictionary UnityIndicatorProperties { Integer count; Date time; String iconURI; Callback onIndicatorActivated; }; interface UnityMessagingIndicatorInterface { method showIndicator (String name, optional UnityIndicatorProperties indicatorProperties); method clearIndicator (String name); method clearIndicators (); method addAction (String name, Callback onActionInvoked); method removeAction (String name); method removeActions (String name); method onPresenceChanged (Callback onPresenceChanged); readonly attribute String presence; }; interface UnityLauncherInterface { method setCount (Integer count); method clearCount (); method setProgress (Number progress); method clearProgress (); method setUrgent (Boolean urgnet); method addAction (String name, Callback onActionInvoked); method removeAction (String name); method removeActions (); }; interface UnityNotificationInterface { method showNotification (String summary, String body, optional String iconUrl); }; enum UnityPlaybackState { "Playing", "Paused" }; dictionary UnityTrackMetadata { String title; String? album; String? artist; String? artLocation; }; interface UnityMediaPlayerInterface { method setTrack (UnityTrackMetadata trackMetadata); method onPrevious (Callback onPreviousCallback); method onNext (Callback onNextCallback); method onPlayPause (Callback onPlayPauseCallback); method onPrevious (Callback onPreviousCallback); method onNext (Callback onNextCallback); method onPlayPause (Callback onPlayPauseCallback); method getPlaybackstate (Callback response); method setPlaybackstate (UnityPlaybackState state); method setCanGoNext (boolean cangonext); method setCanGoPrev (boolean cangoprev); method setCanPlay (boolean canplay); method setCanPause (boolean canpause); }; dictionary UnityInitParameters { String name; String iconUrl; Callback onInit; String? homepage; String? domain; }; interface Unity { method init (UnityInitParameters initializationParameters); method addAction (String actionName, Callback onActionInvoked); method removeAction (String actionName); method removeActions (); attribute UnityNotificationInterface Notification; attribute UnityMessagingIndicatorInterface MessagingIndicator; attribute UnityMediaPlayerInterface MediaPlayer; attribute UnityLauncherInterface Launcher; }; unity-webapps-qml-0.1+14.04.20140408/tools/js-idl/gen-api-from-idl.js 0000755 0000153 0177776 00000003456 12320722666 025300 0 ustar pbuser nogroup 0000000 0000000 #!/usr/bin/nodejs var WebIDL2 = require("webidl2"); var fs = require('fs'); if (process.argv.length < 3) { console.log('Invalid number of args'); process.exit(1); } var IDL_FILE = process.argv[2]; var _defs = {}; var processInterfaceDefinition = function(interfaceAst) { var name = interfaceAst.name; console.log('Interface "' + name + '"'); _defs.interfaces = _defs.interfaces || []; var iface = {name: name, members: { attributes: [], methods: [] }}; for (var i = 0; i < interfaceAst.members.length; ++i) { var member = interfaceAst.members[i]; console.log("\t" + member.name); console.log("\t\t" + member.type); if (member.type === 'operation') { var method = {name: member.name, args: []}; for (var j = 0; j < member.arguments.length; ++j) { console.log("\t\t\t" + member.arguments[j].name + ':' + member.arguments[j].idlType.idlType); method.args.push({name: member.arguments[j].name}); } iface.members.methods.push(method); } else { iface.members.attributes.push({name: member.name, type: member.idlType.idlType}); } }; _defs.interfaces.push(iface); } var generateUnityBindings = function(defs) { var unityif = defs.interfaces.filter(function (ifc) { return ifc.name === 'Unity'; }); if (!unityif.length) { console.log('Could not generate bindings'); return; } }; var processIdlFile = function (data) { var ast = WebIDL2.parse(data); for (var i = 0; i < ast.length; ++i) { console.log(ast[i].type); if (ast[i].type === "interface") { processInterfaceDefinition(ast[i]); } } generateUnityBindings(_defs); }; fs.readFile(IDL_FILE, 'utf8', function (err, data) { if (err) { console.log('Error while opening IDL file: ' + err); process.exit(1); } processIdlFile(data); }); unity-webapps-qml-0.1+14.04.20140408/tools/js-idl/README 0000644 0000153 0177776 00000000073 12320722666 022560 0 ustar pbuser nogroup 0000000 0000000 - requires nodejs - install WebIDL2: npm install webidl2 unity-webapps-qml-0.1+14.04.20140408/tools/tools.pro 0000644 0000153 0177776 00000000125 12320722666 022376 0 ustar pbuser nogroup 0000000 0000000 TEMPLATE=subdirs SUBDIRS = qml-launcher OTHER_FILES = \ $$system(ls ./js-idl/*) unity-webapps-qml-0.1+14.04.20140408/tools/inject-js-utils.py 0000755 0000153 0177776 00000001336 12320722666 024122 0 ustar pbuser nogroup 0000000 0000000 #!/usr/bin/env python import os import sys import re if len(sys.argv) < 3: print "Usage: FILE_TO_INSPECT OUT_FILENAME" sys.exit(1) FILE_TO_INSPECT=sys.argv[1] OUT_FILE=sys.argv[2] #read and parse content = open(FILE_TO_INSPECT).read() include_re = re.compile('\s*//@include\s+(.*)') includes = re.findall(include_re, content) injected_includes = {} for include in includes: try: injected_includes[include] = open(include).read().replace('.pragma library', '') except: print "Could not find file: ", include sys.exit(1) for include in includes: content = content.replace('//@include ' + include, injected_includes[include]) open(OUT_FILE, "w+").write(content) print OUT_FILE unity-webapps-qml-0.1+14.04.20140408/tools/qml-launcher/ 0000755 0000153 0177776 00000000000 12320723226 023077 5 ustar pbuser nogroup 0000000 0000000 unity-webapps-qml-0.1+14.04.20140408/tools/qml-launcher/qml-launcher.pro 0000644 0000153 0177776 00000000652 12320722666 026223 0 ustar pbuser nogroup 0000000 0000000 include(../../common-project-config.pri) include(../../common-vars.pri) TEMPLATE = app TARGET = unity-webapps-qml-launcher CONFIG += \ debug QT += \ core \ qml \ testlib \ quick SOURCES += \ qml-launcher.cpp include(../../common-installs-config.pri) desktop_files_installs.files = $$system(ls ./*.desktop) desktop_files_installs.path = /usr/share/applications INSTALLS += desktop_files_installs unity-webapps-qml-0.1+14.04.20140408/tools/qml-launcher/unitywebappsqmllauncher.desktop 0000644 0000153 0177776 00000000263 12320722666 031470 0 ustar pbuser nogroup 0000000 0000000 [Desktop Entry] Type=Application Terminal=false Exec=/usr/bin/unity-webapps-qml-launcher $@ Name=Unity Webapps QML Test Launcher Icon=qmlscene NoDisplay=true X-Ubuntu-Touch=true unity-webapps-qml-0.1+14.04.20140408/tools/qml-launcher/qml-launcher.cpp 0000644 0000153 0177776 00000013276 12320722666 026213 0 ustar pbuser nogroup 0000000 0000000 /* * Copyright 2013 Canonical Ltd. * * This file is part of unity-webapps-qml. * * unity-webapps-qml 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; version 3. * * unity-webapps-qml 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, see . */ #include #include #include #include #include #include #include #include #include namespace { void loadQtTestability(const QStringList & arguments) { // The testability driver is only loaded by QApplication but not by QGuiApplication. // However, QApplication depends on QWidget which would add some unneeded overhead => Let's load the testability driver on our own. if (arguments.contains(QLatin1String("-testability"))) { QLibrary testLib(QLatin1String("qttestability")); if (testLib.load()) { typedef void (*TasInitialize)(void); TasInitialize initFunction = (TasInitialize)testLib.resolve("qt_testability_init"); if (initFunction) { initFunction(); } else { qCritical("Library qttestability resolve failed!"); } } else { qCritical("Library qttestability load failed!"); } } } } // namespace int main(int argc, char *argv[]) { QGuiApplication app(argc, argv); if (!app.arguments().count()) { qDebug() << "Invalid inputs args"; return EXIT_FAILURE; } loadQtTestability(app.arguments()); const QString QML_MAXIMIZED_ARG = "--maximized"; const QString QML_FILE_ARG_HEADER = "--qml="; const QString QML_FILE_IMPORT_ARG_HEADER = "--import="; const QString QML_APP_ID_ARG_HEADER = "--app-id="; const QString QML_INSPECTOR_ARG_HEADER = "--inspector="; const QString ARG_HEADER = "--"; const QString VALUE_HEADER = "="; QHash properties; QString qmlfile; QString appid; QString importPath; QString inspector; bool maximized = false; Q_FOREACH(QString argument, app.arguments()) { if (argument.contains(QML_FILE_ARG_HEADER)) { qmlfile = argument.right(argument.count() - QML_FILE_ARG_HEADER.count()); } else if (argument.contains(QML_FILE_IMPORT_ARG_HEADER)) { importPath = argument.right(argument.count() - QML_FILE_IMPORT_ARG_HEADER.count()); } else if (argument.contains(QML_APP_ID_ARG_HEADER)) { appid = argument.right(argument.count() - QML_APP_ID_ARG_HEADER.count()); } else if (argument.contains(QML_INSPECTOR_ARG_HEADER)) { inspector = argument.right(argument.count() - QML_INSPECTOR_ARG_HEADER.count()); } else if (argument.contains(QML_MAXIMIZED_ARG)) { maximized = true; } else if (argument.startsWith(ARG_HEADER) && argument.right(argument.count() - ARG_HEADER.count()).contains("=")) { QString property = argument.right(argument.count() - ARG_HEADER.count()); property = property.left(property.indexOf(VALUE_HEADER)); QString value = argument.right(argument.count() - argument.indexOf(VALUE_HEADER) - 1); qDebug() << "Adding property: " << property << ", " << "value: " << value; properties.insert(property, value); } else { qDebug() << "Ignoring argument: " << argument; } } if (qmlfile.isEmpty()) { qDebug() << "No (or empty) QML file specified"; return EXIT_FAILURE; } if (!qmlfile.endsWith(".qml")) { qDebug() << "Invalid QML file name"; return EXIT_FAILURE; } QFileInfo f(qmlfile); if (!f.exists() || !f.isFile()) { qDebug() << "QML file not found or not a file: " << qmlfile; return EXIT_FAILURE; } if ( ! importPath.isEmpty()) { qDebug() << "Setting import path to: " << importPath; qputenv("QML2_IMPORT_PATH", importPath.toLatin1()); } if ( ! appid.isEmpty()) { qputenv("APP_ID", appid.toLatin1()); } if ( ! inspector.isEmpty()) { qDebug() << "Inspector server being set to: " << inspector; qputenv("QTWEBKIT_INSPECTOR_SERVER", inspector.toLatin1()); } QQmlEngine engine; QQmlContext *context = new QQmlContext(engine.rootContext()); QQmlComponent component(&engine, qmlfile); QObject *object = component.create(context); if (!component.isReady()) { qWarning() << component.errorString(); return -1; } if ( ! object) { qCritical() << "Cannot create object from qml base file"; return -1; } QQuickWindow* window = qobject_cast(object); QHash::iterator it; for(it = properties.begin(); properties.end() != it; ++it) { object->setProperty(it.key().toStdString().c_str(), QUrl(it.value())); } if (window) { if (maximized) window->showMaximized(); else window->show(); } return app.exec(); } unity-webapps-qml-0.1+14.04.20140408/common-project-config.pri 0000644 0000153 0177776 00000000636 12320722666 024276 0 ustar pbuser nogroup 0000000 0000000 #----------------------------------------------------------------------------- # Common configuration for all projects. #----------------------------------------------------------------------------- # we don't like warnings... QMAKE_CXXFLAGS += -Werror -Wno-write-strings # Disable RTTI QMAKE_CXXFLAGS += -fno-rtti TOP_SRC_DIR = $$PWD TOP_BUILD_DIR = $${TOP_SRC_DIR}/$${BUILD_DIR} include(coverage.pri) unity-webapps-qml-0.1+14.04.20140408/examples/ 0000755 0000153 0177776 00000000000 12320723226 021165 5 ustar pbuser nogroup 0000000 0000000 unity-webapps-qml-0.1+14.04.20140408/examples/unity-webapps-qml-facebookmessenger-example.desktop 0000644 0000153 0177776 00000000657 12320722666 033306 0 ustar pbuser nogroup 0000000 0000000 [Desktop Entry] Name=FacebookMessengerWebappsQMLExample Type=Application Exec=/usr/bin/unity-webapps-qml-launcher --qml=/usr/share/unity-webapps-qml/examples/unity-webapps-example-facebookmessenger/main.qml --app-id=unity-webapps-qml-facebookmessenger-example Path=/usr/share/unity-webapps-qml/examples/unity-webapps-example-facebookmessenger GenericName=FacebookMessenger WebBrowser Container Example Icon=qmlscene Terminal=false unity-webapps-qml-0.1+14.04.20140408/examples/unity-webapps-qml-basic-example.desktop 0000644 0000153 0177776 00000000523 12320722666 030675 0 ustar pbuser nogroup 0000000 0000000 [Desktop Entry] Type=Application Exec=qmlscene /usr/share/unity-webapps-qml/examples/basic-webview/main.qml Path=/usr/share/unity-webapps-qml/examples/basic-webview Name=Unity WebApp QML Comonent - Basic API Showcase App GenericName=Unity WebApp QML Comonent for Ubuntu Basic API Showcase App Icon=drive-multidisk-symbolicx Terminal=false unity-webapps-qml-0.1+14.04.20140408/examples/unity-webapps-example-facebookmessenger/ 0000755 0000153 0177776 00000000000 12320723226 031105 5 ustar pbuser nogroup 0000000 0000000 unity-webapps-qml-0.1+14.04.20140408/examples/unity-webapps-example-facebookmessenger/main.qml 0000644 0000153 0177776 00000002750 12320722666 032557 0 ustar pbuser nogroup 0000000 0000000 /* * Copyright 2013 Canonical Ltd. * * This file is part of unity-webapps-qml. * * unity-webapps-qml 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; version 3. * * webbrowser-app 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, see . */ import QtQuick 2.0 import QtQuick.Window 2.0 import QtWebKit 3.0 import QtWebKit.experimental 1.0 import Ubuntu.UnityWebApps 0.1 Window { width: 640 height: 640 WebView { id: webView anchors.fill: parent width: parent.width height: parent.height experimental.userScripts: [] experimental.preferences.navigatorQtObjectEnabled: true experimental.preferences.developerExtrasEnabled: true function getUnityWebappsProxies() { return UnityWebAppsUtils.makeProxiesForQtWebViewBindee(webView); } UnityWebApps { id: webapps name: "FacebookMessenger" bindee: webView model: UnityWebappsAppModel { searchPath: '/usr/share/unity-webapps-qml/examples/data/userscripts'} } } } unity-webapps-qml-0.1+14.04.20140408/examples/examples.pro 0000644 0000153 0177776 00000004336 12320722666 023542 0 ustar pbuser nogroup 0000000 0000000 TEMPLATE = subdirs SUBDIRS += api-bindings OTHER_FILES += \ $$system(ls */*.qml) EXAMPLE_DATA_FILES = $$system(find ./data -type f | xargs) for(file, EXAMPLE_DATA_FILES) { OTHER_FILES += $$file } DESKTOP_EXAMPLE_FILES = \ unity-webapps-qml-basic-example.desktop \ unity-webapps-qml-bbcnews-example.desktop \ unity-webapps-qml-facebookmessenger-example.desktop \ unity-webapps-qml-model-example.desktop OTHER_FILES += $$DESKTOP_EXAMPLE_FILES desktop_files.path = /usr/share/applications desktop_files.files = $$DESKTOP_EXAMPLE_FILES common_data_files.path = /usr/share/unity-webapps-qml/examples/data/userscripts/common common_data_files.files = $$system(ls data/userscripts/common/*) html_data_files.path = /usr/share/unity-webapps-qml/examples/data/html html_data_files.files = $$system(ls data/html/*) bbcnews_userscript_data_files.path = /usr/share/unity-webapps-qml/examples/data/userscripts/unity-webapps-bbcnews bbcnews_userscript_data_files.files = $$system(ls data/userscripts/unity-webapps-bbcnews/*) bbcnews_example_install.path = /usr/share/unity-webapps-qml/examples/unity-webapps-example-bbcnews bbcnews_example_install.files = $$system(ls unity-webapps-example-bbcnews/*) facebookmessenger_userscript_data_files.path = /usr/share/unity-webapps-qml/examples/data/userscripts/unity-webapps-facebookmessenger facebookmessenger_userscript_data_files.files = $$system(ls data/userscripts/unity-webapps-facebookmessenger/*) facebookmessenger_example_install.path = /usr/share/unity-webapps-qml/examples/unity-webapps-example-facebookmessenger facebookmessenger_example_install.files = $$system(ls unity-webapps-example-facebookmessenger/*) basic_webview_install.path = /usr/share/unity-webapps-qml/examples/basic-webview basic_webview_install.files = $$system(ls basic-webview/*) webapps_apps_model_install.path = /usr/share/unity-webapps-qml/examples/webapps-apps-model webapps_apps_model_install.files = $$system(ls webapps-app-model/*) INSTALLS += desktop_files \ webapps_apps_model_install \ basic_webview_install \ common_data_files \ bbcnews_example_install \ bbcnews_userscript_data_files \ facebookmessenger_example_install \ facebookmessenger_userscript_data_files \ html_data_files unity-webapps-qml-0.1+14.04.20140408/examples/data/ 0000755 0000153 0177776 00000000000 12320723226 022076 5 ustar pbuser nogroup 0000000 0000000 unity-webapps-qml-0.1+14.04.20140408/examples/data/userscripts/ 0000755 0000153 0177776 00000000000 12320723226 024464 5 ustar pbuser nogroup 0000000 0000000 unity-webapps-qml-0.1+14.04.20140408/examples/data/userscripts/unity-webapps-bbcnews/ 0000755 0000153 0177776 00000000000 12320723226 030714 5 ustar pbuser nogroup 0000000 0000000 unity-webapps-qml-0.1+14.04.20140408/examples/data/userscripts/unity-webapps-bbcnews/BBCNews.user.js0000644 0000153 0177776 00000002565 12320722666 033471 0 ustar pbuser nogroup 0000000 0000000 // ==UserScript== // @include http://www.bbc.co.uk/news/ // @include http://www.bbc.com/news/ // @require utils.js // ==/UserScript== // This placeholder gets munged with real data at build time. const WebappsGettextDict = JSON.parse(unescape( "[]" )); window.Unity = external.getUnityObject('1.0'); function isCorrectPage() { var i, ids = ['tickerHolder']; for (i = 0; i < ids.length; i++) { if (!document.getElementById(ids[i])) { return false; } } return true; } function messagingIndicatorSetup() { if (!isCorrectPage()) { return; } var recent = document.getElementById('tickerHolder'); recent.addEventListener('DOMSubtreeModified', wrapCallback(function () { var title = null, node = document.evaluate('div/div/p/a', recent, null, XPathResult.ANY_UNORDERED_NODE_TYPE, null).singleNodeValue; if (node) { title = node.textContent; } if (title && !localStorage.getItem(title)) { localStorage.setItem(title, true); Unity.Notification.showNotification("BBC", title, null); } }), false); } Unity.init({ name: "BBC News", domain: 'bbc.co.uk', homepage: 'http://www.bbc.co.uk/news/', iconUrl: "icon://unity-webapps-bbc", onInit: wrapCallback(messagingIndicatorSetup) }); unity-webapps-qml-0.1+14.04.20140408/examples/data/userscripts/unity-webapps-bbcnews/manifest.json 0000644 0000153 0177776 00000000643 12320722666 033427 0 ustar pbuser nogroup 0000000 0000000 { "includes": ["http://www.bbc.co.uk/news/"], "requires": ["utils.js"], "name": "BBCNews", "scripts": ["BBCNews.user.js"], "maintainer": "Webapps Team ", "manifest-version": "1.0", "integration-version": "2.3", "package-name": "BBCNews", "icons": { }, "domain": "bbc.co.uk", "homepage": "http://www.bbc.co.uk/news/", "license": "GPL-3" } unity-webapps-qml-0.1+14.04.20140408/examples/data/userscripts/unity-webapps-facebookmessenger/ 0000755 0000153 0177776 00000000000 12320723226 032753 5 ustar pbuser nogroup 0000000 0000000 ././@LongLink 0000000 0000000 0000000 00000000171 00000000000 011214 L ustar 0000000 0000000 unity-webapps-qml-0.1+14.04.20140408/examples/data/userscripts/unity-webapps-facebookmessenger/FacebookMessenger.user.js unity-webapps-qml-0.1+14.04.20140408/examples/data/userscripts/unity-webapps-facebookmessenger/Faceb0000644 0000153 0177776 00000027540 12320722666 033715 0 ustar pbuser nogroup 0000000 0000000 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- // ==UserScript== // @include http://*.facebook.com/* // @include https://*.facebook.com/* // @include https://*.facebook.com // @require utils.js // ==/UserScript== // This placeholder gets munged with real data at build time. var WebappsGettextDict = JSON.parse(unescape( "%7B%22am%22%3A%20%7B%22Messages%22%3A%20%22%5Cu1218%5Cu120d%5Cu12a5%5Cu12ad%5Cu1276%5Cu127d%22%2C%20%22Notifications%22%3A%20%22%5Cu121b%5Cu1235%5Cu1273%5Cu12c8%5Cu1242%5Cu12eb%5Cu12ce%5Cu127d%22%7D%2C%20%22ar%22%3A%20%7B%22Messages%22%3A%20%22%5Cu0627%5Cu0644%5Cu0631%5Cu0633%5Cu0627%5Cu0626%5Cu0644%22%2C%20%22Notifications%22%3A%20%22%5Cu0627%5Cu0644%5Cu062a%5Cu0646%5Cu0628%5Cu064a%5Cu0647%5Cu0627%5Cu062a%22%7D%2C%20%22ast%22%3A%20%7B%22Messages%22%3A%20%22Mensaxes%22%2C%20%22Notifications%22%3A%20%22Notificaciones%22%7D%2C%20%22be%22%3A%20%7B%22Messages%22%3A%20%22%5Cu041f%5Cu0430%5Cu0432%5Cu0435%5Cu0434%5Cu0430%5Cu043c%5Cu043b%5Cu0435%5Cu043d%5Cu043d%5Cu0456%22%2C%20%22Notifications%22%3A%20%22%5Cu0410%5Cu043f%5Cu0430%5Cu0432%5Cu044f%5Cu0448%5Cu0447%5Cu044d%5Cu043d%5Cu043d%5Cu0456%22%7D%2C%20%22bem%22%3A%20%7B%22Messages%22%3A%20%22Amashiwi%22%2C%20%22Notifications%22%3A%20%22Ifishibisho%22%7D%2C%20%22bg%22%3A%20%7B%22Messages%22%3A%20%22%5Cu0421%5Cu044a%5Cu043e%5Cu0431%5Cu0449%5Cu0435%5Cu043d%5Cu0438%5Cu044f%22%2C%20%22Notifications%22%3A%20%22%5Cu0418%5Cu0437%5Cu0432%5Cu0435%5Cu0441%5Cu0442%5Cu044f%5Cu0432%5Cu0430%5Cu043d%5Cu0438%5Cu044f%22%7D%2C%20%22bs%22%3A%20%7B%22Messages%22%3A%20%22Poruke%22%2C%20%22Notifications%22%3A%20%22Obavje%5Cu0161tenja%22%7D%2C%20%22ca%22%3A%20%7B%22Messages%22%3A%20%22Missatges%22%2C%20%22Notifications%22%3A%20%22Notificacions%22%7D%2C%20%22ca%40valencia%22%3A%20%7B%22Messages%22%3A%20%22Missatges%22%2C%20%22Notifications%22%3A%20%22Notificacions%22%7D%2C%20%22cs%22%3A%20%7B%22Messages%22%3A%20%22Zpr%5Cu00e1vy%22%2C%20%22Notifications%22%3A%20%22Ozn%5Cu00e1men%5Cu00ed%22%7D%2C%20%22cy%22%3A%20%7B%22Messages%22%3A%20%22Negeseuon%22%2C%20%22Notifications%22%3A%20%22Hysbysiadau%22%7D%2C%20%22da%22%3A%20%7B%22Messages%22%3A%20%22Beskeder%22%2C%20%22Notifications%22%3A%20%22P%5Cu00e5mindelser%22%7D%2C%20%22de%22%3A%20%7B%22Messages%22%3A%20%22Mitteilungen%22%2C%20%22Notifications%22%3A%20%22Benachrichtigungen%22%7D%2C%20%22el%22%3A%20%7B%22Messages%22%3A%20%22%5Cu039c%5Cu03b7%5Cu03bd%5Cu03cd%5Cu03bc%5Cu03b1%5Cu03c4%5Cu03b1%22%2C%20%22Notifications%22%3A%20%22%5Cu0395%5Cu03b9%5Cu03b4%5Cu03bf%5Cu03c0%5Cu03bf%5Cu03b9%5Cu03ae%5Cu03c3%5Cu03b5%5Cu03b9%5Cu03c2%22%7D%2C%20%22en_AU%22%3A%20%7B%7D%2C%20%22en_CA%22%3A%20%7B%7D%2C%20%22en_GB%22%3A%20%7B%7D%2C%20%22en_US%22%3A%20%7B%7D%2C%20%22eo%22%3A%20%7B%22Messages%22%3A%20%22Mesa%5Cu011doj%22%2C%20%22Notifications%22%3A%20%22Atentigoj%22%7D%2C%20%22es%22%3A%20%7B%22Messages%22%3A%20%22Mensajes%22%2C%20%22Notifications%22%3A%20%22Notificaciones%22%7D%2C%20%22et%22%3A%20%7B%22Messages%22%3A%20%22S%5Cu00f5numid%22%2C%20%22Notifications%22%3A%20%22Teavitused%22%7D%2C%20%22eu%22%3A%20%7B%22Messages%22%3A%20%22Mezuak%22%2C%20%22Notifications%22%3A%20%22Jakinarazpenak%22%7D%2C%20%22fa%22%3A%20%7B%22Messages%22%3A%20%22%5Cu067e%5Cu06cc%5Cu0627%5Cu0645%5Cu200c%5Cu0647%5Cu0627%22%2C%20%22Notifications%22%3A%20%22%5Cu0622%5Cu06af%5Cu0627%5Cu0647%5Cu200c%5Cu0633%5Cu0627%5Cu0632%5Cu06cc%5Cu200c%5Cu0647%5Cu0627%22%7D%2C%20%22fi%22%3A%20%7B%22Messages%22%3A%20%22Viestit%22%2C%20%22Notifications%22%3A%20%22Ilmoitukset%22%7D%2C%20%22fr%22%3A%20%7B%7D%2C%20%22gd%22%3A%20%7B%22Messages%22%3A%20%22Teachdaireachdan%22%2C%20%22Notifications%22%3A%20%22Fiosan%22%7D%2C%20%22gl%22%3A%20%7B%22Messages%22%3A%20%22Mensaxes%22%2C%20%22Notifications%22%3A%20%22Notificaci%5Cu00f3ns%22%7D%2C%20%22gu%22%3A%20%7B%7D%2C%20%22he%22%3A%20%7B%22Messages%22%3A%20%22%5Cu05d4%5Cu05d5%5Cu05d3%5Cu05e2%5Cu05d5%5Cu05ea%22%2C%20%22Notifications%22%3A%20%22%5Cu05d4%5Cu05ea%5Cu05e8%5Cu05e2%5Cu05d5%5Cu05ea%22%7D%2C%20%22hi%22%3A%20%7B%7D%2C%20%22hr%22%3A%20%7B%7D%2C%20%22hu%22%3A%20%7B%22Messages%22%3A%20%22%5Cu00dczenetek%22%2C%20%22Notifications%22%3A%20%22%5Cu00c9rtes%5Cu00edt%5Cu00e9sek%22%7D%2C%20%22id%22%3A%20%7B%22Messages%22%3A%20%22Pesan%22%2C%20%22Notifications%22%3A%20%22Pemberitahuan%22%7D%2C%20%22is%22%3A%20%7B%22Messages%22%3A%20%22Skilabo%5Cu00f0%22%2C%20%22Notifications%22%3A%20%22Tilkynningar%22%7D%2C%20%22it%22%3A%20%7B%22Messages%22%3A%20%22Messaggi%22%2C%20%22Notifications%22%3A%20%22Notifiche%22%7D%2C%20%22ja%22%3A%20%7B%22Messages%22%3A%20%22%5Cu30e1%5Cu30c3%5Cu30bb%5Cu30fc%5Cu30b8%22%2C%20%22Notifications%22%3A%20%22%5Cu901a%5Cu77e5%22%7D%2C%20%22jbo%22%3A%20%7B%22Messages%22%3A%20%22notci%22%7D%2C%20%22ko%22%3A%20%7B%22Messages%22%3A%20%22%5Cuba54%5Cuc2dc%5Cuc9c0%22%2C%20%22Notifications%22%3A%20%22%5Cuc54c%5Cub9bc%22%7D%2C%20%22lt%22%3A%20%7B%22Messages%22%3A%20%22%5Cu017dinut%5Cu0117s%22%2C%20%22Notifications%22%3A%20%22Prane%5Cu0161imai%22%7D%2C%20%22lv%22%3A%20%7B%22Messages%22%3A%20%22Zi%5Cu0146ojumi%22%2C%20%22Notifications%22%3A%20%22Pazi%5Cu0146ojumi%22%7D%2C%20%22mhr%22%3A%20%7B%22Messages%22%3A%20%22%5Cu041a%5Cu0430%5Cu043b%5Cu0430%5Cu0441%5Cu044b%5Cu043c%5Cu0430%5Cu0448-%5Cu0432%5Cu043b%5Cu0430%5Cu043a%22%2C%20%22Notifications%22%3A%20%22%5Cu0423%5Cu0432%5Cu0435%5Cu0440%5Cu0442%5Cu0430%5Cu0440%5Cu044b%5Cu043c%5Cu0430%5Cu0448-%5Cu0432%5Cu043b%5Cu0430%5Cu043a%22%7D%2C%20%22mk%22%3A%20%7B%7D%2C%20%22ml%22%3A%20%7B%22Messages%22%3A%20%22%5Cu0d38%5Cu0d28%5Cu0d4d%5Cu0d26%5Cu0d47%5Cu0d36%5Cu0d19%5Cu0d4d%5Cu0d19%5Cu0d7e%22%2C%20%22Notifications%22%3A%20%22%5Cu0d05%5Cu0d31%5Cu0d3f%5Cu0d2f%5Cu0d3f%5Cu0d2a%5Cu0d4d%5Cu0d2a%5Cu0d41%5Cu0d15%5Cu0d7e%22%7D%2C%20%22mr%22%3A%20%7B%22Messages%22%3A%20%22%5Cu0938%5Cu0902%5Cu0926%5Cu0947%5Cu0936%22%7D%2C%20%22ms%22%3A%20%7B%22Messages%22%3A%20%22Mesej%22%2C%20%22Notifications%22%3A%20%22Pemberitahuan%22%7D%2C%20%22my%22%3A%20%7B%22Messages%22%3A%20%22%5Cu1005%5Cu102c%5Cu1019%5Cu103b%5Cu102c%5Cu1038%22%2C%20%22Notifications%22%3A%20%22%5Cu1021%5Cu101e%5Cu102d%5Cu1015%5Cu1031%5Cu1038%5Cu1001%5Cu103b%5Cu1000%5Cu103a%22%7D%2C%20%22nb%22%3A%20%7B%7D%2C%20%22nl%22%3A%20%7B%22Messages%22%3A%20%22Berichten%22%2C%20%22Notifications%22%3A%20%22Notificaties%22%7D%2C%20%22oc%22%3A%20%7B%22Messages%22%3A%20%22Messatges%22%2C%20%22Notifications%22%3A%20%22Notificacions%22%7D%2C%20%22os%22%3A%20%7B%7D%2C%20%22pl%22%3A%20%7B%22Messages%22%3A%20%22Wiadomo%5Cu015bci%22%2C%20%22Notifications%22%3A%20%22Powiadomienia%22%7D%2C%20%22pt%22%3A%20%7B%22Messages%22%3A%20%22Mensagens%22%2C%20%22Notifications%22%3A%20%22Notifica%5Cu00e7%5Cu00f5es%22%7D%2C%20%22pt_BR%22%3A%20%7B%22Messages%22%3A%20%22Mensagens%22%2C%20%22Notifications%22%3A%20%22Notifica%5Cu00e7%5Cu00f5es%22%7D%2C%20%22ro%22%3A%20%7B%22Messages%22%3A%20%22Mesaje%22%2C%20%22Notifications%22%3A%20%22Notific%5Cu0103ri%22%7D%2C%20%22ru%22%3A%20%7B%22Messages%22%3A%20%22%5Cu0421%5Cu043e%5Cu043e%5Cu0431%5Cu0449%5Cu0435%5Cu043d%5Cu0438%5Cu044f%22%2C%20%22Notifications%22%3A%20%22%5Cu0423%5Cu0432%5Cu0435%5Cu0434%5Cu043e%5Cu043c%5Cu043b%5Cu0435%5Cu043d%5Cu0438%5Cu044f%22%7D%2C%20%22se%22%3A%20%7B%22Messages%22%3A%20%22Reivvet%22%2C%20%22Notifications%22%3A%20%22Muittuhusat%22%7D%2C%20%22shn%22%3A%20%7B%22Messages%22%3A%20%22%5Cu101c%5Cu102d%5Cu1075%5Cu103a%5Cu1088%5Cu1075%5Cu1082%5Cu1062%5Cu1019%5Cu103a%5Cu1038%5Cu1015%5Cu103d%5Cu1010%5Cu103a%5Cu1038%22%2C%20%22Notifications%22%3A%20%22%5Cu1076%5Cu1031%5Cu1083%5Cu1088%5Cu107d%5Cu1062%5Cu1004%5Cu1037%5Cu103a%5Cu1015%5Cu107c%5Cu103a%22%7D%2C%20%22sk%22%3A%20%7B%22Messages%22%3A%20%22Spr%5Cu00e1vy%22%2C%20%22Notifications%22%3A%20%22Ozn%5Cu00e1menia%22%7D%2C%20%22sl%22%3A%20%7B%22Messages%22%3A%20%22Sporo%5Cu010dila%22%2C%20%22Notifications%22%3A%20%22Obvestila%22%7D%2C%20%22sq%22%3A%20%7B%22Messages%22%3A%20%22Mesazhet%22%2C%20%22Notifications%22%3A%20%22Njoftime%22%7D%2C%20%22sr%22%3A%20%7B%22Messages%22%3A%20%22%5Cu041f%5Cu043e%5Cu0440%5Cu0443%5Cu043a%5Cu0435%22%2C%20%22Notifications%22%3A%20%22%5Cu041e%5Cu0431%5Cu0430%5Cu0432%5Cu0435%5Cu0448%5Cu0442%5Cu0435%5Cu045a%5Cu0430%22%7D%2C%20%22sv%22%3A%20%7B%7D%2C%20%22tg%22%3A%20%7B%22Messages%22%3A%20%22%5Cu041f%5Cu0430%5Cu0451%5Cu043c%5Cu04b3%5Cu043e%22%2C%20%22Notifications%22%3A%20%22%5Cu041e%5Cu0433%5Cu043e%5Cu04b3%5Cu0438%5Cu04b3%5Cu043e%22%7D%2C%20%22th%22%3A%20%7B%7D%2C%20%22tr%22%3A%20%7B%22Messages%22%3A%20%22%5Cu0130letiler%22%2C%20%22Notifications%22%3A%20%22Bildirimler%22%7D%2C%20%22ug%22%3A%20%7B%22Messages%22%3A%20%22%5Cu0626%5Cu06c7%5Cu0686%5Cu06c7%5Cu0631%5Cu0644%5Cu0627%5Cu0631%22%2C%20%22Notifications%22%3A%20%22%5Cu0626%5Cu06c7%5Cu0642%5Cu062a%5Cu06c7%5Cu0631%5Cu06c7%5Cu0634%5Cu0644%5Cu0627%5Cu0631%22%7D%2C%20%22uk%22%3A%20%7B%22Messages%22%3A%20%22%5Cu041f%5Cu043e%5Cu0432%5Cu0456%5Cu0434%5Cu043e%5Cu043c%5Cu043b%5Cu0435%5Cu043d%5Cu043d%5Cu044f%22%2C%20%22Notifications%22%3A%20%22%5Cu0421%5Cu043f%5Cu043e%5Cu0432%5Cu0456%5Cu0449%5Cu0435%5Cu043d%5Cu043d%5Cu044f%22%7D%2C%20%22uz%22%3A%20%7B%22Messages%22%3A%20%22Xabarlar%22%2C%20%22Notifications%22%3A%20%22Eslatmalar%22%7D%2C%20%22vi%22%3A%20%7B%22Messages%22%3A%20%22Tin%20nh%5Cu1eafn%22%2C%20%22Notifications%22%3A%20%22Th%5Cu00f4ng%20b%5Cu00e1o%22%7D%2C%20%22zh_CN%22%3A%20%7B%22Messages%22%3A%20%22%5Cu6d88%5Cu606f%22%2C%20%22Notifications%22%3A%20%22%5Cu901a%5Cu77e5%22%7D%2C%20%22zh_HK%22%3A%20%7B%22Messages%22%3A%20%22%5Cu8a0a%5Cu606f%22%2C%20%22Notifications%22%3A%20%22%5Cu901a%5Cu77e5%22%7D%2C%20%22zh_TW%22%3A%20%7B%22Messages%22%3A%20%22%5Cu8a0a%5Cu606f%22%2C%20%22Notifications%22%3A%20%22%5Cu901a%5Cu77e5%22%7D%2C%20%22zn_CN%22%3A%20%7B%7D%7D" )); window.Unity = external.getUnityObject('1.0'); function isCorrectPage() { var i, ids = ['mercurymessagesCountValue']; for (i = 0; i < ids.length; i++) { if (!document.getElementById(ids[i])) { return false; } } return true; } function getMessageCountElement() { return document.getElementById('mercurymessagesCountValue'); } function getNotificationCountElement() { return document.getElementById('notificationsCountValue'); } function selfTest() { if (!getMessageCountElement()) { reportTestState('FAILED: getMessageCountElement is null'); return; } if (!getNotificationCountElement()) { reportTestState('FAILED: getNotificationCountElement is null'); return; } reportTestState('PASS SELF TEST'); } function messagingIndicatorSetup() { if (!isCorrectPage()) { return; } var countElement = getMessageCountElement(); var notificationElement = getNotificationCountElement(); function checkMessagesCount() { var indicators = []; function makeCallback(node) { return function () { launchClickEvent(node.parentNode); }; } indicators.push({ name: _("Messages"), count: countElement.textContent, callback: makeCallback(countElement) }); indicators.push({ name: _("Notifications"), count: notificationElement.textContent, callback: makeCallback(notificationElement) }); return indicators; } var indicatorsController = new Indicators(checkMessagesCount); if (document.location.hostname === 'apps.facebook.com') { var name = document.evaluate('//div[@role="contentinfo"]/div/span', document, null, XPathResult.ANY_UNORDERED_NODE_TYPE, null).singleNodeValue.textContent; linkVisited(document.location.toString(), name); } console.log(JSON.stringify(checkMessagesCount())); selfTest(); } if (document.getElementById('email')) { var email = document.getElementById('email'); window.onunload = function () { localStorage.setItem('login', email.value); }; } var login = localStorage.getItem('login'); if (!login) { login = null; } Unity.init({ name: "facebook", iconUrl: "icon://unity-webapps-facebook", login: login, domain: 'facebook.com', homepage: 'https://www.facebook.com/', onInit: wrapCallback(messagingIndicatorSetup) }); ././@LongLink 0000000 0000000 0000000 00000000155 00000000000 011216 L ustar 0000000 0000000 unity-webapps-qml-0.1+14.04.20140408/examples/data/userscripts/unity-webapps-facebookmessenger/manifest.json unity-webapps-qml-0.1+14.04.20140408/examples/data/userscripts/unity-webapps-facebookmessenger/manif0000644 0000153 0177776 00000001161 12320722666 033776 0 ustar pbuser nogroup 0000000 0000000 {"includes":["http://*.facebook.com/*","https://*.facebook.com/*","https://*.facebook.com"],"requires":["utils.js"],"name":"FacebookMessenger","scripts":["FacebookMessenger.user.js"],"maintainer":"Webapps Team ","license":"GPL-3","manifest-version":"1.0","integration-version":"2.4.12","package-name":"FacebookMessenger","description":"Unity Webapp for FacebookMessenger","icons":{"128":"128/unity-webapps-facebook.png","48":"48/unity-webapps-facebook.png","52":"52/unity-webapps-facebook.png","64":"64/unity-webapps-facebook.png"},"domain":"facebook.com","homepage":"https://www.facebook.com/"} unity-webapps-qml-0.1+14.04.20140408/examples/data/userscripts/common/ 0000755 0000153 0177776 00000000000 12320723226 025754 5 ustar pbuser nogroup 0000000 0000000 unity-webapps-qml-0.1+14.04.20140408/examples/data/userscripts/common/utils.js 0000644 0000153 0177776 00000022477 12320722666 027475 0 ustar pbuser nogroup 0000000 0000000 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- function _(strid) { var lang = unsafeWindow.navigator.language; lang = lang.toLowerCase().replace(/-/g, '_'); while (lang) { if (WebappsGettextDict.hasOwnProperty(lang) && WebappsGettextDict[lang].hasOwnProperty(strid)) { return WebappsGettextDict[lang][strid]; } lang = lang.substr(0, lang.lastIndexOf('_')); } console.log('Gettext _() failed to find translation.') return strid; } /** * WARNING: this is only kept here for backward compatibility reasons. * This needs to be as soon as the individual scripts are SRUed and * updated to use the latest mechanism */ var _previousIndicators = []; function showIndicators(list) { if (list.length == _previousIndicators.length) { var same = true; for (var i = 0; i < list.length; i++) { if (list[i].name != _previousIndicators[i].name) same = false; if (list[i].count != _previousIndicators[i].count) same = false; } if (same) return; } _previousIndicators = list; Unity.MessagingIndicator.clearIndicators(); for (var i = 0; i < list.length; i++) { Unity.MessagingIndicator.showIndicator(list[i].name, { count: list[i].count, callback: list[i].callback }); } } function trim(str) { return str.replace(/^\s+|\s+$/g, ""); } var KEY_NAME = '____unity_indicators_sync'; function Indicators(getCounters, combineFromMultipleTabs) { this._init(getCounters, combineFromMultipleTabs); } Indicators.prototype = { _prevIndicators: null, _getCountersCb: null, _init: function(getCounters, combineFromMultipleTabs) { this._last = {}; this._timestamp = new Date(); this._prevIndicators = []; this._getCountersCb = getCounters; this._combineFromMultipleTabs = combineFromMultipleTabs; window.addEventListener('blur', this._onBlur.bind(this)); window.addEventListener('focus', this._onFocus.bind(this)); setInterval(this._updateIndicators.bind(this), 8000); this._updateIndicators(true); }, _onBlur: function() { }, _onFocus: function() { this._timestamp = new Date(); this.visited(this._currentLabel); }, _updateTotal: function(total) { if (this._combineFromMultipleTabs) { return; } if (total) { Unity.Launcher.setCount(Number(total)); } else { Unity.Launcher.clearCount(); } }, _updateIndicators: function(firstRun) { var state = localStorage.getItem(KEY_NAME); var updateState = false; try { var list = this._getCountersCb(); } catch (e) { return; } if (state) { if (!this._combineFromMultipleTabs) { state = JSON.parse(state); if (state.timestamp > this._timestamp) { this._timestamp = state.timestamp; this._prevIndicators = state.prevIndicators; this._last = state.lastValue; } else { updateState = true; } } } else { updateState = true; } if (!firstRun && !this._forceUpdate && list.length == this._prevIndicators.length) { var same = true; for (var i = 0; i < list.length; i++) { if (list[i].name != this._prevIndicators[i].name) same = false; if (list[i].count != this._prevIndicators[i].count) same = false; } if (same) return; } this._forceUpdate = false; var total = 0; if (!this._combineFromMultipleTabs) { Unity.MessagingIndicator.clearIndicators(); } for (var i = 0; i < list.length; i++) { var count = 0; if (!this._last[list[i].name]) { this._last[list[i].name] = 0; } if (this._last[list[i].name]) { if (this._last[list[i].name] < Number(list[i].count)) { count = Number(list[i].count) - this._last[list[i].name]; } else { count = 0; } } else { this._last[list[i].name] = list[i].count; } if (!count) { if (this._combineFromMultipleTabs) { Unity.MessagingIndicator.clearIndicator(list[i].name); } continue; } total += count; if (!firstRun) { Unity.MessagingIndicator.showIndicator(list[i].name, { count: count, callback: list[i].callback }); } else { this._last[list[i].name] = Number(list[i].count); } } if (!firstRun) { this._updateTotal(total); } this._prevIndicators = list; try { if (updateState) { this._saveState(); } else { localStorage.setItem(KEY_NAME, JSON.stringify(state)); } } catch (e) { setTimeout((function () {this._updateIndicators(firstRun)}).bind(this), 500); } }, _saveState: function() { localStorage.setItem(KEY_NAME, JSON.stringify({ timestamp: new Date(), prevIndicators: this._prevIndicators, lastValue: this._last })); }, visited: function(labelName) { this._currentLabel = labelName; var count = 0; for (var i = 0; i < this._prevIndicators.length; i++) { if (this._prevIndicators[i].name == labelName) { count = this._prevIndicators[i].count; } } this._forceUpdate = true; this._last[labelName] = count; this._saveState(); this._updateIndicators(false); } }; /** * On Chrommium v18 (and maybe earlier versions) the click() function * does not seem to work on otherwise proper DOM elements (that are supposed * to support click() as per the spec), e.g. SPAN elements etc. */ function launchClickEvent(node) { var doclick = node.click ? node.click.bind(node) : function () { var e = unsafeWindow.document.createEvent('MouseEvents'); e.initMouseEvent("click", true, true, unsafeWindow, 1, 1, 1, 1, 1, false, false, false, false, 0, node); node.dispatchEvent(e); }; doclick(); } function click(node) { var event = unsafeWindow.document.createEvent("MouseEvents"); event.initMouseEvent("mousedown", true, true, unsafeWindow, 0, 0, 0, 0, 0, false, false, false, false, 0, null); node.dispatchEvent(event); event = unsafeWindow.document.createEvent("MouseEvents"); event.initMouseEvent("mouseup", true, true, unsafeWindow, 0, 0, 0, 0, 0, false, false, false, false, 0, null); node.dispatchEvent(event); } function evalInPageContext(func) { var script = document.createElement('script'); script.appendChild(document.createTextNode('(' + func + ')();')); (document.body || document.head || document.documentElement).appendChild(script); } function makeRedirector(link) { return function () { evalInPageContext('function() {window.location = "' + link + '";}'); }; } function wrapCallback(callback) { return function () { try { callback.apply(window, arguments); } catch (x) { console.log(x); } }; } var MAX_PINS = 10; var FAVORITES = '____unity_favorites'; function addFavoritesInLauncher(links) { var i; if (!links) { return; } Unity.Launcher.removeActions(); links.sort(function (a, b) { if (a.count > b.count) { return -1; } if (a.count < b.count) { return 1; } return 0; }); links.splice(MAX_PINS); for (i = 0; i < links.length; i++) { if (links[i].name) { Unity.Launcher.addAction(links[i].name, makeRedirector(links[i].url)); } } } if (!window.reportTestState) { window.reportTestState = function (msg) { console.log(msg); }; } function linkVisited(url, name, second) { var i, links = localStorage.getItem(FAVORITES); if (!links) { links = []; if (!second) { setTimeout(wrapCallback(function () { linkVisited(url, name, true); }), 1000); return; } } else { links = JSON.parse(links); } if (!name) { addFavoritesInLauncher(links); return; } var obj = null; for (i = 0; i < links.length; i++) { if (links[i].url === url) { obj = links[i]; } } if (!obj) { obj = { url: url, name: name, count: 0 }; links.push(obj); } obj.count++; localStorage.setItem(FAVORITES, JSON.stringify(links)); addFavoritesInLauncher(links); } unity-webapps-qml-0.1+14.04.20140408/examples/data/html/ 0000755 0000153 0177776 00000000000 12320723226 023042 5 ustar pbuser nogroup 0000000 0000000 unity-webapps-qml-0.1+14.04.20140408/examples/data/html/big-test.html 0000644 0000153 0177776 00000017507 12320722666 025467 0 ustar pbuser nogroup 0000000 0000000 Unity Web API Tests Unity Web API Tests Initialize Unity API Notification Tests Indicator Tests Music Player Tests Launcher Tests HUD Tests Back Unity Web Launcher Actions (Quicklist) Tests remove Actions (bulk variant) remove Action (remove first only) Add Actions (and Listen for Callbacks) Active Test Quicklist Entries from the Launcher (1 and 2) Back Unity Launcher Web API Tests To use the Launcher tests you will first have to add the desktop file for the test application to the launcher! The easiest way to do this is to drag it from your user applications directly, likely ~/.local/share/applications Clear Launcher Properties Set Count Set Progress Set Urgent Quicklist Back Unity Web Music Player Callback Tests Listen for Callbacks Activate Test Music Player Callbacks from the Sound Menu Back Unity Web Music Player API Tests Initialize Music Player Set Track Set Track Image Set Track Image (data URI) Toggle Playback State Music Player Callbacks Back Unity Web Indicator Callback Tests Add Indicators (with Callbacks) Activate Indicator with Callback 1 and 2 from the Messaging Indicator Indicator Callback 1: Waiting Indicator Callback 2: Waiting Back Unity Web Indicator Action Callback Tests Add Actions (with Callbacks) Activate Actions with Callback 1 and 2 from the Messaging Indicator Action Callback 1: Waiting Action Callback 2: Waiting Back Unity Web Indicator API Tests Clear Indicators Simple Indicator Indicator with Count Property Indicator with Time Property Indicator with Icon Property Indicator with Icon Property (Data URI) Indicator Action Indicator Callbacks Indicator Action Callbacks Back Unity Web Notification API Tests Simple Notification Notification with Image Notification with Data URI Image Back Unity Web Notification API Tests Add HUD actions remove HUD actions unity-webapps-qml-0.1+14.04.20140408/examples/data/html/big-test.js 0000644 0000153 0177776 00000021325 12320722666 025130 0 ustar pbuser nogroup 0000000 0000000 var Unity = external.getUnityObject('1.0'); var data_uri = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sKBw0vIqzujI4AAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAGhklEQVRo3t2bT0gbeRTHv/MnMRl3XAoNC81hipeOs0cTTyUFpbsbwZquWHpJKHRprYUKXiK4Pe2G6qXQlka3bEFiD7KSVldoKksKHXpK4nHH9FIa2AjdLJQ1NZpkMtmDras1ycykxiS+o87vl/nMe/N+3/fm9yOKxSJqZG0ATiupZKeSWhMKq5F2ACcAHAPQCkABsAngHcXxa2DaXtOCXQKwAuAlgPVa3BRxwMCckkoOyrFwn7zy3FF4E0cxk9Y1AcXxoIQu0B02kbb1LAGYB5BoKOBiJt2bf/HkSl5c7C8k4gfnDYYFbeuB0elepDj+AYCndQUuZtK9uVDAmwvNOvR6Uq/Rgh3G76+LtGCf/BzwaoG5XCgwkQ36L9YatBS46apvjrRYx6oJdd3AhUT88tb0+J1CIt6KOhnBsDA63RstA9dHADysGXBeXPBvTo9fQ4MYLdhhHr03RTDs8EEDt21Oj/+WFxe+RYMZabHCPHp3meL4C1qWMlXgYib91VZg4ve8uNCFBjWCYcHcnIlQHH8OwNvPAW7L/HzpD1mKNixsCeizlTxdEXhzevyZnjA2OFww2LpBCV0gGBYAoKSSkGNh5J49gpJKVhxH23p2J0cUpEjFcWWglymO/043cDZ4358N+jUlKIrjYRrygeL4itdlg/eRDfp1jStm0sgG/ciFAprf6dZbwbKJrCSwHAtfzty+8atWWObmzI5HNWR6bE6PVz1Oa/Zmfpz5odSStQ+4mElz72+c/bOYSbdqCaHWW0GQFquu9y0XCsBw5rxm2I+2NTup2dMmt3fD6PR8/ak4IUu8txNaYAHA6HTrht0e59ENCwAtA8Oax2WD/lYllZzYF/J7QlmK9sqx8EU9N37Ymdhw5rxWnY+t2cmLAHrLAuce3/fqUTnVeOmz1VVnt+Zr5VgYshT1lgSWpWivLEUdmhUO11EnZXVCX754fN+x28vkrn9c0RdeX9RNSuoxWYpCSSWv7AFWUklOlqL9uqqm1WhdgGVJ/+9mg/5+ANwOsBwLD+qdpPAmXhdgJbGq/yHFwgAwuAOcFxf7quh2fJzoUC337BGqvNc+ACAKf//V9n7km3/1ZGeDwwWqw17VGnxQYS2vPEf+xRPNTUKj0wOT2/slXViNnta6BppH74EW7A1R+NOCHS0Dw9gKTCAvLqi/glIEAE7ThcSrTo2CvC7rrqoThnw7WlulNQUAnaSSWBXUJjaP3m042D33N+TbU1pWgBZIJbXWrqZf1cq+RoFWc0pxI91OKqnkCbWivhnsY9O+snaInCCx/a2nbK1br0xcjRlsqjr7GAnAXPapNREsAIBpU4188iB1azMYie1Plgcm4xrcNkkA7xpNL9dQZ78jAaxV0qBaVEyjmJrOJi3WNZIW7K9VSqvmgA0FVPvXxHHra5I4bpUqhkkqqbk9Wi8rJOKaHEOd5CWS4k6tqF2opydcD9jMT5dUqyaCYUEw7ApNCV0vtUycFxdQWI3C5PZq0q01T1CpJLJBv+YcQwldAPCSpjh+nWBYsZhJO7T8SOb2DRAMC+okD6rDXgfQNSiJOPTuJTHYukUA6zQA0Laepby4oLljWcykt4twKYpmMarDvrTT4jHYuudxhI0W7CAt1vkdYNrWkyAt1sWjCmxwuBbx4RsT+f8f+x8cRViCYWFwuB7s1tIAAKPT85RgWPGoARudbhG79nWRu5+E0emePGreNTo9k59WS9jtZdJinTsqwCbP2BzBsE/LAhMMC5PbOwZg4whk5g2DwzVWqh7ee6GtJ2FwuEaaPZRNV30jKLE1kSwTCg8pjp9qVmDzkG+KtFgflut4lH5CQ75hgmGXmy8re5ZpW89wpRZPaSm2vcvmAsGwkSYSGBGT23uhYhOgov7k+HXm5sy5ZoA2OFwR85DvHFT2W5Kqopvj3zI3Z842cngbHK5l85DvLFT2WQI6tg8XEnFsTY/7C4n4tUaCNbm9U0an58C3D++Uhdmg/3IuFLiD7ZMpdTPSYt0wj94doTi+dhvEP5osRbmtX8YnlFTyYj1gjU7PXMvA8BjBsLU/ArDb27lQoDcXmvVq6ZYckHoSW9xjkxTHH/ohj33geXHxipJK9tcoKS0aHK4HtGCv7zGefaEeC3P52PNBORbu+1yv04JdpDu7lwxnzs9XE7qHAvxJVm8rSJHThcSrzuI/SUFJrbV/+Ba97ygeLdjXwLS9prhTEsXxK5TQ9ZJg2JocxfsPlPjVREHRwK4AAAAASUVORK5CYII="; var icon_uri = "http://www.ubuntu.com/sites/www.ubuntu.com/files/active/02_ubuntu/U_homepage/picto-server.png"; function addLauncherTests() { $("#launcherTest1Button").click(function (){ Unity.Launcher.setCount(7); }); $("#launcherTest2Button").click(function (){ Unity.Launcher.setProgress(0.3); }); $("#launcherTest3Button").click(function (){ Unity.Launcher.setUrgent(); }); $("#launcherClearButton").click(function (){ Unity.Launcher.clearCount(); Unity.Launcher.clearProgress(); }); $("#launcherRemoveActionsBulk").click(function(){ Unity.Launcher.removeActions(); }); $("#launcherRemoveAction").click(function(){ Unity.Launcher.removeAction("Test Action 1"); }); $("#launcherAddActionsButton").click(function(){ var makeLauncherCallback = function(label) { return function () { $("#launcherCallbackLog").html($("#launcherCallbackLog").html()+label+""); } }; Unity.Launcher.addAction("Test Action 1", makeLauncherCallback("Test Action 1")); Unity.Launcher.addAction("Test Action 2", makeLauncherCallback("Test Action 2")); }); } function addNotificationTests(){ $("#notificationTest1Button").click(function (){ Unity.Notification.showNotification("Test notification", "Showing a simple test notification", null); }); $("#notificationTest2Button").click(function (){ Unity.Notification.showNotification("Test notification", "Showing a test notification with an image URL", "http://www.ubuntu.com/sites/www.ubuntu.com/files/active/02_ubuntu/U_homepage/picto-desktop.png"); }); $("#notificationTest3Button").click(function (){ Unity.Notification.showNotification("Test notification", "Showing a test notification with a data URI", data_uri); }); } function addMediaPlayerTests(){ $("#musicPlayerInitButton").click(function(){ Unity.MediaPlayer.init("Wha"); }); $("#musicPlayerTest1Button").click(function(){ Unity.MediaPlayer.setTrack({artist: "Test artist", album: "Test album", title: "Test", artLocation: null}); }); $("#musicPlayerTest2Button").click(function(){ Unity.MediaPlayer.setTrack({artist: "Test artist", album: "Test album", title: "Test", artLocation: icon_uri}); }); $("#musicPlayerTest3Button").click(function(){ Unity.MediaPlayer.setTrack({artist: "Test artist", album: "Test album", title: "Test", artLocation: data_uri}); }); $("#musicPlayerPlaybackStateButton").click(function(){ Unity.MusicPlayer.getPlaybackState( function (playbackstate) { Unity.MediaPlayer.setPlaybackState( ! playbackstate); } ); }); $("#musicPlayerAddCallbacksButton").click(function(){ Unity.MediaPlayer.onNext(function() { $("#musicPlayerCallbackLog").html($("#musicPlayerCallbackLog").html()+"Next"); }); Unity.MediaPlayer.onPrevious(function() { $("#musicPlayerCallbackLog").html($("#musicPlayerCallbackLog").html()+"Previous"); }); Unity.MediaPlayer.onPlayPause(function() { $("#musicPlayerCallbackLog").html($("#musicPlayerCallbackLog").html()+"Play/Pause"); }); }); } function addIndicatorTests() { $("#clearButton").click(function (){ Unity.MessagingIndicator.clearIndicator("Simple test indicator"); Unity.MessagingIndicator.clearIndicator("Indicator with Count"); Unity.MessagingIndicator.clearIndicator("Indicator with Time"); Unity.MessagingIndicator.clearIndicator("Indicator with Icon"); Unity.MessagingIndicator.clearIndicator("Indicator with Icon (Data URI)"); Unity.MessagingIndicator.clearIndicator("Indicator with Callback (1)"); Unity.MessagingIndicator.clearIndicator("Indicator with Callback (2)"); }); $("#indicatorTest1Button").click(function (){ Unity.MessagingIndicator.showIndicator("Simple test indicator"); }); $("#indicatorTest2Button").click(function(){ Unity.MessagingIndicator.showIndicator("Indicator with Count", {count: "103"}); }); $("#indicatorTest3Button").click(function(){ Unity.MessagingIndicator.showIndicator("Indicator with Time", {time: new Date()}); }); $("#indicatorTest4Button").click(function(){ Unity.MessagingIndicator.showIndicator("Indicator with Icon", {icon: icon_uri}); }); $("#indicatorTest5Button").click(function(){ Unity.MessagingIndicator.showIndicator("Indicator with Icon (Data URI)", {icon: data_uri}); }); $("#indicatorTest6Button").click(function(){ Unity.MessagingIndicator.addAction("Test action", function(){}); }); $("#indicatorCallbackAddButton").click(function(){ var callback1 = function() { $("#indicatorCallback1Label").text("Indicator Callback 1: Success"); } var callback2 = function() { $("#indicatorCallback2Label").text("Indicator Callback 2: Success"); } Unity.MessagingIndicator.showIndicator("Indicator with Callback (1)", callback1); Unity.MessagingIndicator.showIndicator("Indicator with Callback (2)", callback2); }); $("#indicatorActionCallbackAddButton").click(function(){ var callback1 = function() { $("#indicatorActionCallback1Label").text("Action Callback 1: Success"); } var callback2 = function() { $("#indicatorActionCallback2Label").text("Action Callback 2: Success"); } Unity.MessagingIndicator.addAction("Action with Callback (1)", callback1); Unity.MessagingIndicator.addAction("Action with Callback (2)", callback2); }); } function addHUDTest() { $("#HUDAddActions").click(function(){ function addAction(name) { Unity.addAction(name, function() { $("#indicatorActionCallback2Label").text(name); }); } addAction('/HUD/haveAniceDay'); addAction('/HUD/dontBeEvil'); addAction('/HUD/Bender/killAllHumans'); }); $("#HUDRemoveActions").click(function(){ Unity.clearActions(); }); } function initializeUnityAPI () { var name = "BigUnityWebTest"; var iconUrl = "http://www.ubuntu.com/sites/www.ubuntu.com/files/active/02_ubuntu/U_business/pictograms-cloud.png"; function init() { addNotificationTests(); addIndicatorTests(); addMediaPlayerTests(); addLauncherTests(); addHUDTest(); } Unity.init ({ name: name, iconUrl: iconUrl, onInit: init }); } $().ready( function() { $("#initButton").click(initializeUnityAPI); }); unity-webapps-qml-0.1+14.04.20140408/examples/api-bindings/ 0000755 0000153 0177776 00000000000 12320723226 023531 5 ustar pbuser nogroup 0000000 0000000 unity-webapps-qml-0.1+14.04.20140408/examples/api-bindings/api-bindings.pro 0000644 0000153 0177776 00000000376 12320722666 026634 0 ustar pbuser nogroup 0000000 0000000 TEMPLATE = aux SUBDIRS= QML_IN_FILES = $$system(ls ./*/*.qml.in) OTHER_FILES += \ $$QML_IN_FILES \ $$system(ls ./*/www/*.html) \ $$system(ls ./*/www/js/*.js) QMAKE_SUBSTITUTES += $$QML_IN_FILES OTHER_FILES += \ $$system(ls ./*/*.qml) unity-webapps-qml-0.1+14.04.20140408/examples/api-bindings/content-hub/ 0000755 0000153 0177776 00000000000 12320723226 025757 5 ustar pbuser nogroup 0000000 0000000 unity-webapps-qml-0.1+14.04.20140408/examples/api-bindings/content-hub/main.qml.in 0000644 0000153 0177776 00000001246 12320722666 030035 0 ustar pbuser nogroup 0000000 0000000 import QtQuick 2.0 import QtWebKit 3.0 import QtWebKit.experimental 1.0 import Ubuntu.Components 0.1 import Ubuntu.UnityWebApps 0.1 MainView { id: root focus: true applicationName: \"helloworld\" width: units.gu(100) height: units.gu(100) WebView { id: webview anchors.fill: parent url: \"file://$$OUT_PWD/content-hub/www/index.html\" experimental.preferences.navigatorQtObjectEnabled: true experimental.preferences.developerExtrasEnabled: true function getUnityWebappsProxies() { return UnityWebAppsUtils.makeProxiesForQtWebViewBindee(webview); } UnityWebApps { id: webapps bindee: webview } } } unity-webapps-qml-0.1+14.04.20140408/examples/api-bindings/content-hub/www/ 0000755 0000153 0177776 00000000000 12320723226 026603 5 ustar pbuser nogroup 0000000 0000000 unity-webapps-qml-0.1+14.04.20140408/examples/api-bindings/content-hub/www/js/ 0000755 0000153 0177776 00000000000 12320723226 027217 5 ustar pbuser nogroup 0000000 0000000 unity-webapps-qml-0.1+14.04.20140408/examples/api-bindings/content-hub/www/js/app.js 0000644 0000153 0177776 00000012300 12320722666 030340 0 ustar pbuser nogroup 0000000 0000000 window.onload = function() { var api = external.getUnityObject('1.0'); var hub = api.ContentHub; var transferState = hub.ContentTransfer.State; var pictureContentType = hub.ContentType.Pictures; var sourcePeers = {}; hub.getPeers( {contentType: hub.ContentType.Pictures} , function (peers) { if ( ! peers.length) return; for (var j = 0; j < peers.length; ++j) { addPeerElement(peers[j].appId(), peers[j].name()); sourcePeers[peers[j].appId()] = peers[j]; } document.getElementById('importdiv').style.display = 'block'; document.getElementById('lowLevelImportdiv').style.display = 'block'; }); document.getElementById('import').addEventListener('click', doSimpleApiImport); document.getElementById('lowLevelImport').addEventListener('click', doLowLevelImport); function addPeerElement(appId, name) { var peers = document.querySelector('#known-peers ul'); var li = document.createElement('li'); var span = document.createElement('span'); var text = document.createTextNode('appId: ' + appId + ', name: ' + name) span.appendChild(text); li.appendChild(span); li.addEventListener('click', function (e) { li.classList.toggle('selected'); }); li.setAttribute('data-appid', appId); peers.appendChild(li); }; var results = []; function addResult(item) { results.push({name: item.name, url: item.url}); renderResults(results); }; function displayImages(images) { var res = document.getElementById('results'); for (var i = 0; i < images.length; ++i) { var img = document.createElement('img'); img.setAttribute('src', images[i].url); img.setAttribute('height', '100px'); img.setAttribute('width', '100px'); if (images[i].name && images[i].name.length !== 0) img.setAttribute('alt', images[i].name); res.appendChild(img); } }; function aborted() { setResults('Transfer aborted'); }; function nopeers() { setResults('No peers found'); }; function selectonlyonepeer() { setResults('Please select only one peer'); }; function pleaseselectonepeer() { setResults('Please select one peer'); }; function setResults(results) { var resultEl = document.getElementById('results'); resultEl.innerHTML = results; }; function formatResults(results) { var content = ''; for (var i = 0; i < results.length; ++i) { content += '' + results[i].name + ', ' + results[i].url + ''; } content += ''; return content; }; function renderResults(results) { setResults(formatResults(results)); displayImages(results); }; function doSimpleApiImport() { var peers = document.querySelectorAll('#known-peers ul li.selected'); if (peers.length > 1) { selectonlyonepeer(); return; } if (peers.length === 0) { pleaseselectonepeer(); return; } var peer = sourcePeers[peers[0].getAttribute('data-appid')]; if (! peer) { return; } hub.api.importContent(pictureContentType , peer , {scope: hub.ContentScope.App} , function(items) { for (var i = 0; i < items.length; ++i) { addResult(items[i]); } } , function() { aborted(); }); }; function doLowLevelImport() { var peers = document.querySelectorAll('#known-peers ul li.selected'); if (peers.length > 1) { selectonlyonepeer(); return; } if (peers.length === 0) { pleaseselectonepeer(); return; } var peer = sourcePeers[peers[0].getAttribute('data-appid')]; if (! peer) { return; } hub.getStore(hub.ContentScope.App, function(store) { peer.requestForStore(store, function(transfer) { transfer.start(function(state) { if (transferState.Aborted === state) { transfer.finalize(); peer.destroy(); transfer.destroy(); aborted(); return; } if (transferState.Charged === state) { transfer.items(function(items) { for (var i = 0; i < items.length; ++i) { addResult(items[i]); } transfer.finalize(); peer.destroy(); transfer.destroy(); }); } }); }); }); }; }; unity-webapps-qml-0.1+14.04.20140408/examples/api-bindings/content-hub/www/index.html 0000644 0000153 0177776 00000001770 12320722666 030614 0 ustar pbuser nogroup 0000000 0000000 Content Hub example Known source peers (click on one and only one of them to set as the target of the import): Perform an import using the high level API call. Import: Perform an import using the lower level API call. Import: Results: unity-webapps-qml-0.1+14.04.20140408/examples/api-bindings/online-accounts/ 0000755 0000153 0177776 00000000000 12320723226 026632 5 ustar pbuser nogroup 0000000 0000000 unity-webapps-qml-0.1+14.04.20140408/examples/api-bindings/online-accounts/main.qml.in 0000644 0000153 0177776 00000001204 12320722666 030702 0 ustar pbuser nogroup 0000000 0000000 import QtQuick 2.0 import QtWebKit 3.0 import QtWebKit.experimental 1.0 import Ubuntu.Components 0.1 import Ubuntu.UnityWebApps 0.1 Item { id: root focus: true width: units.gu(100) height: units.gu(100) WebView { id: webview anchors.fill: parent url: \"file://$$OUT_PWD/online-accounts/www/index.html\" experimental.preferences.navigatorQtObjectEnabled: true experimental.preferences.developerExtrasEnabled: true function getUnityWebappsProxies() { return UnityWebAppsUtils.makeProxiesForQtWebViewBindee(webview); } UnityWebApps { id: webapps bindee: webview } } } unity-webapps-qml-0.1+14.04.20140408/examples/api-bindings/online-accounts/www/ 0000755 0000153 0177776 00000000000 12320723226 027456 5 ustar pbuser nogroup 0000000 0000000 unity-webapps-qml-0.1+14.04.20140408/examples/api-bindings/online-accounts/www/js/ 0000755 0000153 0177776 00000000000 12320723226 030072 5 ustar pbuser nogroup 0000000 0000000 unity-webapps-qml-0.1+14.04.20140408/examples/api-bindings/online-accounts/www/js/app.js 0000644 0000153 0177776 00000003640 12320722666 031222 0 ustar pbuser nogroup 0000000 0000000 window.onload = function() { document.getElementById('refreshAccounts').addEventListener('click', listAccounts); var api = external.getUnityObject('1.0'); var oa = api.OnlineAccounts; function listAccounts() { var filters = {}; var service = document.getElementById('service').value; if (service) { filters['service'] = service } var provider = document.getElementById('provider').value; if (provider) { filters['provider'] = provider } oa.api.getAccounts(filters, function(accounts) { var ul = document.querySelector('#accounts ul'); if (accounts.length === 0) { var li = document.createElement('li'); li.appendChild(document.createTextNode('No accounts found')); ul.appendChild(li); } else { for(var i = 0; i < accounts.length; ++i) { var li = document.createElement('li'); li.innerHTML = 'id: ' + accounts[i].accountId() + ', name: ' + accounts[i].displayName() + ', provider: ' + JSON.stringify(accounts[i].provider()) + ', service: ' + JSON.stringify(accounts[i].service()); ul.appendChild(li); (function(i) { function authcallback(results) { setResults('Authentication result: ' + JSON.stringify(results)); }; li.addEventListener('click', function() { accounts[i].authenticate(authcallback); }); })(i); } } }); } function setResults(data) { var results = document.getElementById('results'); results.innerHTML += data; }; }; unity-webapps-qml-0.1+14.04.20140408/examples/api-bindings/online-accounts/www/index.html 0000644 0000153 0177776 00000001357 12320722666 031470 0 ustar pbuser nogroup 0000000 0000000 Content Hub example Results: Provider: Service: Accounts (click on an account to authenticate): unity-webapps-qml-0.1+14.04.20140408/examples/api-bindings/content-hub-exporter/ 0000755 0000153 0177776 00000000000 12320723226 027625 5 ustar pbuser nogroup 0000000 0000000 unity-webapps-qml-0.1+14.04.20140408/examples/api-bindings/content-hub-exporter/content-hub/ 0000755 0000153 0177776 00000000000 12320723226 032053 5 ustar pbuser nogroup 0000000 0000000 ././@LongLink 0000000 0000000 0000000 00000000174 00000000000 011217 L ustar 0000000 0000000 unity-webapps-qml-0.1+14.04.20140408/examples/api-bindings/content-hub-exporter/content-hub/content-hub-html5-exporter.json unity-webapps-qml-0.1+14.04.20140408/examples/api-bindings/content-hub-exporter/content-hub/content-0000644 0000153 0177776 00000000055 12320722666 033534 0 ustar pbuser nogroup 0000000 0000000 { "source": [ "pictures" ] } unity-webapps-qml-0.1+14.04.20140408/examples/api-bindings/content-hub-exporter/main.qml.in 0000644 0000153 0177776 00000001211 12320722666 031673 0 ustar pbuser nogroup 0000000 0000000 import QtQuick 2.0 import QtWebKit 3.0 import QtWebKit.experimental 1.0 import Ubuntu.Components 0.1 import Ubuntu.UnityWebApps 0.1 Item { id: root focus: true width: units.gu(100) height: units.gu(100) WebView { id: webview anchors.fill: parent url: \"file://$$OUT_PWD/content-hub-exporter/www/index.html\" experimental.preferences.navigatorQtObjectEnabled: true experimental.preferences.developerExtrasEnabled: true function getUnityWebappsProxies() { return UnityWebAppsUtils.makeProxiesForQtWebViewBindee(webview); } UnityWebApps { id: webapps bindee: webview } } } unity-webapps-qml-0.1+14.04.20140408/examples/api-bindings/content-hub-exporter/www/ 0000755 0000153 0177776 00000000000 12320723226 030451 5 ustar pbuser nogroup 0000000 0000000 unity-webapps-qml-0.1+14.04.20140408/examples/api-bindings/content-hub-exporter/www/js/ 0000755 0000153 0177776 00000000000 12320723226 031065 5 ustar pbuser nogroup 0000000 0000000 unity-webapps-qml-0.1+14.04.20140408/examples/api-bindings/content-hub-exporter/www/js/app.js 0000644 0000153 0177776 00000001721 12320722666 032213 0 ustar pbuser nogroup 0000000 0000000 window.onload = function() { var api = external.getUnityObject('1.0'); var hub = api.ContentHub; var transferState = hub.ContentTransfer.State; function _exportRequested(transfer) { log('Received an export request'); var url = window.location.href; url = url.substr(0, url.lastIndexOf('/')+1) + 'img/ubuntuone-music.png'; log('item url: ' + url); transfer.setItems([{name: 'Ubuntu One', url: url}], function() { log('The items have been set in the ContentTransfer'); transfer.setState(hub.ContentTransfer.State.Charged); log('State set to "Charged"'); }); }; hub.onExportRequested(_exportRequested); function log(content) { var resultEl = document.getElementById('results'); resultEl.innerHTML = resultEl.innerHTML + '' + content; }; }; unity-webapps-qml-0.1+14.04.20140408/examples/api-bindings/content-hub-exporter/www/img/ 0000755 0000153 0177776 00000000000 12320723226 031225 5 ustar pbuser nogroup 0000000 0000000 ././@LongLink 0000000 0000000 0000000 00000000154 00000000000 011215 L ustar 0000000 0000000 unity-webapps-qml-0.1+14.04.20140408/examples/api-bindings/content-hub-exporter/www/img/ubuntuone-music.png unity-webapps-qml-0.1+14.04.20140408/examples/api-bindings/content-hub-exporter/www/img/ubuntuone-mu0000644 0000153 0177776 00000021762 12320722666 033632 0 ustar pbuser nogroup 0000000 0000000 PNG IHDR >a sBIT|d pHYs B(x tEXtSoftware www.inkscape.org< #oIDATx}idWuw}[fm]K6L#!l#B@1l03`a%b,',2BZ-ZjIz-3_wϙo|YRԍ9;|{-vmvl+vV m[۶lmn 0@#"@ێVmgȱ*=TV) E궫>;^{/ն۲=ʲgllaYֽoۯ}}U aR wot~d"R0 ھ@q ښ-~ e[>1u >*5ģo+.7nJFEB'Tiq_ &82n;i?w*55 [_{^n`DE #%V* 'M[N~}n A@p9롭HL YƒT?*Or^ǗGZ:_ssN;?V}EN)@|Nvww "@7]7ڿWs4`;} ұuNy|+*]ulK^%MlasνSe/K>^]@U9\9>ƛg?HD6@p:se+瀕3 f{!@|xJA@Y#XrMj풷N(ESH~)87q} 5`y8KGSon,<9KKg_Xvr-xBca'wKa@c2z畗|x@ }W?mߧU, < >6Aq_?(srnțBE}^h_+*Ϥpg Y^gl1*ڤӣ|{|'ԙ3kp;Hm7@;8蓒7$X.!^;yA=B5҄>c!8^!R(@2 kTN3n?^dKy1]R^B|2t|ח Rm/ '['}O-z44c8>a80QWimp&fp$aJWA=!.]xbM#k a+(=DHh0a)_9[ph{WM!R rRblPK.O@&.|}Q㻫6NH_<)5{4렦78e9|y.ߥSB)U ςoYYzm0v Ն 6"|Qh gB 3¹PwqO3gNx^ύkf%J#RE=xҳ{9:ث[Z%ǜ YV4)(Q,A#d N45~qr cM||M 7i]M݁ xq<1AYO SϲZ4Qt,Qj5y')f`'6N6j<w^pƫ/vYx,R b ^ z%c[*Mj븥IRV7_A`ƴYw0?i 3~x-x0a;'=x(jĊFlz }XS {0Vc˝ Z :jhuq`k[5Kcʱ37%!T};СiLڪKpo._& EEV=|ߎ,\oY{; ~pbt,b']y|-*ՇH2bNƟl {$v gq`d5[C{gCj b5v-8nO^e>hvt}e^9e^߸- >T++EYںK |LX.Zh/`!?