ubuntu-html5-theme-0.1.2+14.04.20140404/0000755000015301777760000000000012317537133017564 5ustar pbusernogroup00000000000000ubuntu-html5-theme-0.1.2+14.04.20140404/Gruntfile.js0000644000015301777760000000526712317536560022076 0ustar pbusernogroup00000000000000/* * Copyright (C) 2013 Adnane Belmadiaf * Licese granted by Canonical Limited * * This file is part of ubuntu-html5-ui-toolkit. * * This package is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 3 of the * License, or * (at your option) any later version. * This package 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 Lesser General Public * License along with this program. If not, see * . */ /*global module:false*/ module.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), meta: { banner: '/*!\n' + ' * app.js <%= pkg.version %> (<%= grunt.template.today("yyyy-mm-dd, HH:MM") %>)\n' + ' * https://launchpad.net/ubuntu-html5-theme\n' + ' * GNU LGPL v3\n' + ' */' }, jshint: { options: { curly: false, eqeqeq: true, immed: true, latedef: true, newcap: true, noarg: true, sub: true, undef: true, eqnull: true, browser: true, expr: true, globals: { head: false, module: false, console: false } }, files: [ 'Gruntfile.js', 'js/app.js' ] }, concat: { options:{ separator: ';' }, js: { src: ['ambiance/js/*.js'], dest: 'build/app.js' }, css:{ src: ['ambiance/css/*.css'], dest: 'build/app.css' } }, uglify: { options: { banner: '<%= meta.banner %>\n' }, build: { src: '<%= concat.js.dest %>', dest: 'build/app.min.js' } }, cssmin: { options: { banner: '/*!\n' + ' * app.min.css <%= pkg.version %> (<%= grunt.template.today("yyyy-mm-dd, HH:MM") %>)\n' + ' * https://launchpad.net/ubuntu-html5-theme\n' + ' * GNU LGPL v3\n' + ' */' }, compress: { files: { 'build/app.min.css': [ '<%= concat.css.dest %>' ] } } } }); grunt.loadNpmTasks( 'grunt-contrib-jshint' ); grunt.loadNpmTasks( 'grunt-contrib-cssmin' ); grunt.loadNpmTasks( 'grunt-contrib-uglify' ); grunt.loadNpmTasks( 'grunt-contrib-concat' ); // Default task. grunt.registerTask( 'default', [ 'jshint', 'concat', 'cssmin', 'uglify' ] ); }; ubuntu-html5-theme-0.1.2+14.04.20140404/examples/0000755000015301777760000000000012317537133021402 5ustar pbusernogroup00000000000000ubuntu-html5-theme-0.1.2+14.04.20140404/examples/html5-theme/0000755000015301777760000000000012317537133023533 5ustar pbusernogroup00000000000000ubuntu-html5-theme-0.1.2+14.04.20140404/examples/html5-theme/widgets/0000755000015301777760000000000012317537133025201 5ustar pbusernogroup00000000000000ubuntu-html5-theme-0.1.2+14.04.20140404/examples/html5-theme/widgets/TextInputs.html0000644000015301777760000000443712317536560030231 0ustar pbusernogroup00000000000000 Ubuntu UI HTML5: TextInputs
ubuntu-html5-theme-0.1.2+14.04.20140404/examples/html5-theme/widgets/Typography.html0000644000015301777760000000501612317536637030247 0ustar pbusernogroup00000000000000 Ubuntu HTML5 UI SDK: Typography

Headings

Extra large Heading

large Heading

Body text

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur vitae bibendum urna. Nulla facilisi. Nunc erat urna, ultricies id orci at, malesuada ornare orci. Cras urna risus, volutpat nec odio id, luctus ullamcorper dui. Nullam tincidunt a nisl in aliquet. Praesent dui velit, imperdiet et condimentum sit amet, tincidunt vel metus. Nunc blandit rutrum volutpat. Praesent leo ipsum, rhoncus sit amet felis non, faucibus cursus sem. Nulla sit amet auctor nisi, eu rhoncus diam. Nulla massa lacus, sagittis ut risus ut, lacinia pulvinar eros. Nullam ac ipsum lectus. Donec ut lacus justo. Donec adipiscing lectus vitae dui euismod congue. Fusce consequat turpis nec velit hendrerit bibendum at vel lacus. Mauris sodales velit neque, quis ultricies neque cursus ac. Nunc risus orci, pulvinar quis sodales id, luctus in est.

Sub text

Lorem ipsum dolor sit amet.

Lorem ipsum dolor sit amet.

ubuntu-html5-theme-0.1.2+14.04.20140404/examples/html5-theme/widgets/Indexbar.html0000644000015301777760000001452112317536560027631 0ustar pbusernogroup00000000000000 Ubuntu UI HTML5: Application Template
  • Ubuntu HTML5 UI Toolkit
A - Standard
  • Label

  • Label

  • Label

  • Label

  • Label

  • Label

B - Standard
  • Label

  • Label

  • Label

  • Label

  • Label

  • Label

C - Standard
  • Label

  • Label

  • Label

  • Label

  • Label

  • Label

D - Standard
  • Label

  • Label

  • Label

  • Label

  • Label

  • Label

E - Standard
  • Label

  • Label

  • Label

  • Label

  • Label

  • Label

  1. A
  2. B
  3. C
  4. D
  5. E
  6. F
  7. G
  8. H
  9. I
  10. J
  11. K
  12. L
  13. M
  14. N
  15. O
  16. P
  17. Q
  18. R
  19. S
  20. T
  21. U
  22. V
  23. W
  24. X
  25. Y
  26. Z
ubuntu-html5-theme-0.1.2+14.04.20140404/examples/html5-theme/widgets/UbuntuShape.html0000644000015301777760000000467412317536560030350 0ustar pbusernogroup00000000000000 Ubuntu UI HTML5: UbuntuShape
Ubuntu Shape
Color
Image
Radius
small
ubuntu-html5-theme-0.1.2+14.04.20140404/examples/html5-theme/widgets/Toggles.html0000644000015301777760000001003512317536560027475 0ustar pbusernogroup00000000000000 Ubuntu UI HTML5: Toggles
Checkbox
Unchecked
Checked
Disabled
Switch
Unchecked
Checked
Disabled
ubuntu-html5-theme-0.1.2+14.04.20140404/examples/html5-theme/widgets/OptionSelector.html0000644000015301777760000001343012317536560031044 0ustar pbusernogroup00000000000000 Ubuntu UI HTML5: ListItems

Collapsed

  • Label 1

  • Label 2

  • Label 3

  • Label 4

  • Label 5

Expanded with a multiple selections

  • Label 1

    Subtext 1

  • Label 2

    Subtext 2

  • Label 3

    Subtext 3

  • Label 4

    Subtext 4

  • Label 5

    Subtext 5

Expanded with a unique selection

  • Label 1

  • Label 2

  • Label 3

  • Label 4

  • Label 5

ubuntu-html5-theme-0.1.2+14.04.20140404/examples/html5-theme/widgets/ProgressBars.html0000644000015301777760000000447112317536560030514 0ustar pbusernogroup00000000000000 Ubuntu UI HTML5: ProgressBars

Progress Bar

Standard

Infinite

Activity indicator

ubuntu-html5-theme-0.1.2+14.04.20140404/examples/html5-theme/widgets/Pagestack.html0000644000015301777760000001206312317536560027776 0ustar pbusernogroup00000000000000 Ubuntu UI HTML5: PageStack
  • Ubuntu HTML5 UI Toolkit
1 - Standard
  • Label

  • Label

  • Label

2 - Subtitled
  • Label

    Secondary Label

  • Label

    Secondary Label

  • Label

    Secondary Label

3 - Multiple Value
  • Label

    Value 1, Value 2

  • Label

    Value 1, Value 2

  • Label

    Value 1, Value 2

  • Label

    Value 1, Value 2

ubuntu-html5-theme-0.1.2+14.04.20140404/examples/html5-theme/widgets/Buttons.html0000644000015301777760000001015712317536560027534 0ustar pbusernogroup00000000000000 Ubuntu HTML5 UI SDK: Buttons
  • Buttons
ubuntu-html5-theme-0.1.2+14.04.20140404/examples/html5-theme/widgets/ListItems.html0000644000015301777760000001431112317536560030007 0ustar pbusernogroup00000000000000 Ubuntu UI HTML5: ListItems
Standard
  • Label

  • Label

  • Label

Subtitled
  • Label

    Secondary Label

  • Label

    Secondary Label

  • Label

    Secondary Label

Multiple Value
  • Label

    Value 1, Value 2

  • Label

    Value 1, Value 2

  • Label

    Value 1, Value 2

  • Label

    Value 1, Value 2

Progression
Icon
Control
  • Label

  • Label

  • Label

ubuntu-html5-theme-0.1.2+14.04.20140404/examples/html5-theme/widgets/Toolbar.html0000644000015301777760000000542012317536560027475 0ustar pbusernogroup00000000000000 Ubuntu UI HTML5: Toolbars
ubuntu-html5-theme-0.1.2+14.04.20140404/examples/html5-theme/widgets/Popovers.html0000644000015301777760000001057012317536560027712 0ustar pbusernogroup00000000000000 Ubuntu UI HTML5: Popovers
  • Item1
  • Item2
  • Item3
  • Item4
  • Item1
  • Item2
  • Item3
  • Item4
  • Item1
  • Item2
  • Item3
  • Item4
ubuntu-html5-theme-0.1.2+14.04.20140404/examples/html5-theme/widgets/Dialog-Spinner.html0000644000015301777760000000322012317536560030702 0ustar pbusernogroup00000000000000 Ubuntu UI HTML5: Dialog + Spinner
  • Ubuntu HTML5 UI Toolkit
ubuntu-html5-theme-0.1.2+14.04.20140404/examples/html5-theme/widgets/Dialog.html0000644000015301777760000000364612317536637027307 0ustar pbusernogroup00000000000000 Ubuntu HTML5 UI SDK: Dialogs

Simple Dialog

Are you sure you want to delete this file?

ubuntu-html5-theme-0.1.2+14.04.20140404/examples/html5-theme/widgets/Dialog-Spinner@2.html0000644000015301777760000000336012317536560031071 0ustar pbusernogroup00000000000000 Ubuntu HTML5 UI SDK: Dialog + Big Spinner
  • Ubuntu HTML5 UI Toolkit
ubuntu-html5-theme-0.1.2+14.04.20140404/examples/html5-theme/widgets/Sliders.html0000644000015301777760000000432712317536560027505 0ustar pbusernogroup00000000000000 Ubuntu UI HTML5: Sliders
0
23
50
ubuntu-html5-theme-0.1.2+14.04.20140404/examples/html5-theme/apps/0000755000015301777760000000000012317537133024476 5ustar pbusernogroup00000000000000ubuntu-html5-theme-0.1.2+14.04.20140404/examples/html5-theme/apps/rss-reader/0000755000015301777760000000000012317537133026545 5ustar pbusernogroup00000000000000ubuntu-html5-theme-0.1.2+14.04.20140404/examples/html5-theme/apps/rss-reader/styles.css0000644000015301777760000000211512317536560030604 0ustar pbusernogroup00000000000000/* * Copyright (C) 2013 Adnane Belmadiaf * License granted by Canonical Limited * * This file is part of ubuntu-html5-ui-toolkit. * * This package is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 3 of the * License, or * (at your option) any later version. * This package 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 Lesser General Public * License along with this program. If not, see * . */ #articleinfo { padding: 10px; -webkit-box-sizing: border-box; box-sizing: border-box; } #articleinfo iframe { max-width: 100%; } #articleinfo p { margin: 7px 0; } #articleinfo a{ text-decoration: none; color: #787878; font-weight: bold; }ubuntu-html5-theme-0.1.2+14.04.20140404/examples/html5-theme/apps/rss-reader/index.html0000644000015301777760000001017612317536560030552 0ustar pbusernogroup00000000000000 RSS Mobile Reader - Ubuntu UI Example

Add a new feed

Type the url feed you want to add

ubuntu-html5-theme-0.1.2+14.04.20140404/examples/html5-theme/apps/rss-reader/app.js0000644000015301777760000001057712317536560027700 0ustar pbusernogroup00000000000000/* * Copyright (C) 2013 Adnane Belmadiaf * License granted by Canonical Limited * * This file is part of ubuntu-html5-ui-toolkit. * * This package is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 3 of the * License, or * (at your option) any later version. * This package 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 Lesser General Public * License along with this program. If not, see * */ var UI = new UbuntuUI(); document.addEventListener('deviceready', function() { console.log('device ready') }, true); $(document).ready(function () { UI.init(); UI.pagestack.push("main"); if (typeof localStorage["feeds"] == "undefined") { restoreDefault(); } //load local storage feeds var feeds = eval(localStorage["feeds"]); if (feeds !== null) { var feeds_list = UI.list('#yourfeeds'); feeds_list.removeAllItems(); feeds_list.setHeader('My feeds'); for (var i = 0; i < feeds.length; i++) { feeds_list.append(feeds[i], null, null, function (target, thisfeed) { loadFeed(thisfeed); }, feeds[i]); } } UI.button('yes').click(function (e) { var url = $("#rssFeed").val(); if (url === "") { if (!$("#addfeeddialog section").hasClass("shake")) { $("#addfeeddialog section").addClass("shake"); } else { $('#addfeeddialog section').css('animation-name', 'none'); $('#addfeeddialog section').css('-moz-animation-name', 'none'); $('#addfeeddialog section').css('-webkit-animation-name', 'none'); setTimeout(function () { $('#addfeeddialog section').css('-webkit-animation-name', 'shake'); }, 0); } } else { var feeds = eval(localStorage["feeds"]); feeds.push(url); localStorage.setItem("feeds", JSON.stringify(feeds)); window.location.reload(); } }); UI.button('addfeed').click(function () { $('#addfeeddialog').show(); }); UI.button('no').click(function () { $('#addfeeddialog').hide(); }); }); //FUNCS function restoreDefault() { localStorage.clear(); var feeds = []; feeds.push("http://daker.me/feed.xml"); feeds.push("http://www.omgubuntu.co.uk/feed"); feeds.push("http://hespress.com/feed/index.rss"); feeds.push("http://rss.slashdot.org/Slashdot/slashdot"); feeds.push("http://www.reddit.com/.rss"); try { localStorage.setItem("feeds", JSON.stringify(feeds)); window.location.reload(); } catch (e) { if (e == QUOTA_EXCEEDED_ERR) { console.log("Error: Local Storage limit exceeds."); } else { console.log("Error: Saving to local storage."); } } } function loadFeed(url) { UI.pagestack.push("results"); UI.dialog("loading").show(); var feed = new google.feeds.Feed(url); feed.setNumEntries(30); feed.load(function (result) { if (!result.error) { UI.dialog("loading").hide(); var results_list = UI.list('#resultscontent'); results_list.removeAllItems(); results_list.setHeader(result.feed.title); for (var i = 0; i < result.feed.entries.length; i++) { results_list.append(result.feed.entries[i].title.replace(/"/g, "'"), null, null, function (target, result_infos) { showArticle.apply(null, result_infos); }, [escape(result.feed.entries[i].title), escape(result.feed.entries[i].link), escape(result.feed.entries[i].content)] ); } } else alert('feed error'); }); } function showArticle(title, url, desc) { UI.pagestack.push("article"); if (typeof desc == "undefined") desc = "(No description provided)"; $("#articleinfo").html("

" + unescape(title) + "

" + unescape(desc) + "

" + unescape(url) + "

"); } google.load("feeds", "1"); ubuntu-html5-theme-0.1.2+14.04.20140404/examples/html5-theme/ui-gallery/0000755000015301777760000000000012317537133025605 5ustar pbusernogroup00000000000000ubuntu-html5-theme-0.1.2+14.04.20140404/examples/html5-theme/ui-gallery/index.html0000644000015301777760000000434012317536637027613 0ustar pbusernogroup00000000000000 Ubuntu HTML5 SDK: UI Gallery
  • Ubuntu HTML5 UI Toolkit
ubuntu-html5-theme-0.1.2+14.04.20140404/examples/html5-theme/ui-gallery/widgets.html0000644000015301777760000000605512317536637030157 0ustar pbusernogroup00000000000000 Ubuntu HTML5 SDK ubuntu-html5-theme-0.1.2+14.04.20140404/examples/html5-theme/ui-gallery/qml/0000755000015301777760000000000012317537133026376 5ustar pbusernogroup00000000000000ubuntu-html5-theme-0.1.2+14.04.20140404/examples/html5-theme/ui-gallery/qml/main.qml0000644000015301777760000000164212317536560030043 0ustar pbusernogroup00000000000000/* * Copyright (C) 2013 Canonical * * This file is part of ubuntu-html5-ui-toolkit. * * This package is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 3 of the * License, or * (at your option) any later version. * This package 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 Lesser General Public * License along with this program. If not, see * . */ import QtQuick 2.0 import QtWebKit 3.0 Item { width: 800 height: 600 WebView { anchors.fill: parent url: '../index.html' } }ubuntu-html5-theme-0.1.2+14.04.20140404/examples/html5-theme/ubuntu-html5-ui-gallery.desktop0000644000015301777760000000030312317536560031546 0ustar pbusernogroup00000000000000[Desktop Entry] Name=Ubuntu HTML5 UI Gallery Type=Application Exec=qmlscene /usr/share/ubuntu-html5-ui-toolkit/0.1/examples/ui-gallery/qml/main.qml Icon=ubuntu Terminal=false X-Ubuntu-Touch=true ubuntu-html5-theme-0.1.2+14.04.20140404/examples/container/0000755000015301777760000000000012317537133023364 5ustar pbusernogroup00000000000000ubuntu-html5-theme-0.1.2+14.04.20140404/examples/container/simple/0000755000015301777760000000000012317537133024655 5ustar pbusernogroup00000000000000ubuntu-html5-theme-0.1.2+14.04.20140404/examples/container/simple/www/0000755000015301777760000000000012317537133025501 5ustar pbusernogroup00000000000000ubuntu-html5-theme-0.1.2+14.04.20140404/examples/container/simple/www/img/0000755000015301777760000000000012317537133026255 5ustar pbusernogroup00000000000000ubuntu-html5-theme-0.1.2+14.04.20140404/examples/container/simple/www/img/logo.png0000644000015301777760000005246612317536560027743 0ustar pbusernogroup00000000000000‰PNG  IHDRªÈxJzÓ pHYs  šœ OiCCPPhotoshop ICC profilexÚSgTSé=÷ÞôBKˆ€”KoR RB‹€‘&*! Jˆ!¡ÙQÁEEÈ ˆŽŽ€ŒQ, Š Øä!¢Žƒ£ˆŠÊûá{£kÖ¼÷æÍþµ×>ç¬ó³ÏÀ –H3Q5€ ©BàƒÇÄÆáä.@ $p³d!sý#ø~<<+"À¾xÓ ÀM›À0‡ÿêB™\€„Àt‘8K€@zŽB¦@F€˜&S `ËcbãP-`'æÓ€ø™{[”! ‘ eˆDh;¬ÏVŠEX0fKÄ9Ø-0IWfH°·ÀÎ ² 0Qˆ…){`È##x„™FòW<ñ+®ç*x™²<¹$9E[-qWW.(ÎI+6aaš@.Ây™24àóÌ ‘àƒóýxήÎÎ6޶_-ê¿ÿ"bbãþåÏ«p@át~Ñþ,/³€;€mþ¢%îh^  u÷‹f²@µ éÚWópø~<ß5°j>{‘-¨]cöK'XtÀâ÷ò»oÁÔ(€hƒáÏwÿï?ýG %€fI’q^D$.Tʳ?ÇD *°AôÁ,ÀÁÜÁ ü`6„B$ÄÂBB d€r`)¬‚B(†Í°*`/Ô@4ÀQh†“p.ÂU¸=púažÁ(¼ AÈa!ÚˆbŠX#Ž™…ø!ÁH‹$ ɈQ"K‘5H1RŠT UHò=r9‡\Fº‘;È2‚ü†¼G1”²Q=Ô µC¹¨7„F¢ Ðdt1š ›Ðr´=Œ6¡çЫhÚ>CÇ0Àè3Äl0.ÆÃB±8, “c˱"¬ «Æ°V¬»‰õcϱwEÀ 6wB aAHXLXNØH¨ $4Ú 7 „QÂ'"“¨K´&ºùÄb21‡XH,#Ö/{ˆCÄ7$‰C2'¹I±¤TÒÒFÒnR#é,©›4H#“ÉÚdk²9”, +È…ääÃä3ää!ò[ b@q¤øSâ(RÊjJåå4åe˜2AU£šRݨ¡T5ZB­¡¶R¯Q‡¨4uš9̓IK¥­¢•Óhh÷i¯ètºÝ•N—ÐWÒËéGè—èôw †ƒÇˆg(›gw¯˜L¦Ó‹ÇT071ë˜ç™™oUX*¶*|‘Ê •J•&•*/T©ª¦ªÞª UóUËT©^S}®FU3Sã© Ô–«UªPëSSg©;¨‡ªg¨oT?¤~Yý‰YÃLÃOC¤Q ±_ã¼Æ c³x,!k «†u5Ä&±ÍÙ|v*»˜ý»‹=ª©¡9C3J3W³Ró”f?ã˜qøœtN ç(§—ó~ŠÞï)â)¦4L¹1e\kª–—–X«H«Q«Gë½6®í§¦½E»YûAÇJ'\'GgÎçSÙSݧ §M=:õ®.ªk¥¡»Dw¿n§î˜ž¾^€žLo§Þy½çú}/ýTýmú§õG X³ $Û Î<Å5qo</ÇÛñQC]Ã@C¥a•a—á„‘¹Ñ<£ÕFFŒiÆ\ã$ãmÆmÆ£&&!&KMêMîšRM¹¦)¦;L;LÇÍÌÍ¢ÍÖ™5›=1×2ç›ç›×›ß·`ZxZ,¶¨¶¸eI²äZ¦Yî¶¼n…Z9Y¥XUZ]³F­­%Ö»­»§§¹N“N«žÖgðñ¶É¶©·°åØÛ®¶m¶}agbg·Å®Ã“}º}ý= ‡Ù«Z~s´r:V:ޚΜî?}Åô–é/gXÏÏØ3ã¶Ë)ÄiS›ÓGgg¹sƒóˆ‹‰K‚Ë.—>.›ÆÝȽäJtõq]ázÒõ›³›Âí¨Û¯î6îiî‡ÜŸÌ4Ÿ)žY3sÐÃÈCàQåÑ? Ÿ•0k߬~OCOgµç#/c/‘W­×°·¥wª÷aï>ö>rŸã>ã<7Þ2ÞY_Ì7À·È·ËOÃož_…ßC#ÿdÿzÿѧ€%g‰A[ûøz|!¿Ž?:Ûeö²ÙíAŒ ¹AA‚­‚åÁ­!hÈì­!÷ç˜Î‘Îi…P~èÖÐaæa‹Ã~ '…‡…W†?ŽpˆXÑ1—5wÑÜCsßDúD–DÞ›g1O9¯-J5*>ª.j<Ú7º4º?Æ.fYÌÕXXIlK9.*®6nl¾ßüíó‡ââ ã{˜/È]py¡ÎÂô…§©.,:–@LˆN8”ðA*¨Œ%òw%Ž yÂÂg"/Ñ6шØC\*NòH*Mz’쑼5y$Å3¥,幄'©¼L LÝ›:žšv m2=:½1ƒ’‘qBª!M“¶gêgæfvˬe…²þÅn‹·/•Ék³¬Y- ¶B¦èTZ(×*²geWf¿Í‰Ê9–«ž+Íí̳ÊÛ7œïŸÿíÂá’¶¥†KW-X潬j9²‰Š®Û—Ø(Üxå‡oÊ¿™Ü”´©«Ä¹dÏfÒféæÞ-ž[–ª—æ—n ÙÚ´ ßV´íõöEÛ/—Í(Û»ƒ¶C¹£¿<¸¼e§ÉÎÍ;?T¤TôTúT6îÒݵa×ønÑî{¼ö4ìÕÛ[¼÷ý>ɾÛUUMÕfÕeûIû³÷?®‰ªéø–ûm]­NmqíÇÒý#¶×¹ÔÕÒ=TRÖ+ëGǾþïw- 6 UœÆâ#pDyäé÷ ß÷ :ÚvŒ{¬áÓvg/jBšòšF›Sšû[b[ºOÌ>ÑÖêÞzüGÛœ499â?rýéü§CÏdÏ&žþ¢þË®/~øÕë×Îјѡ—ò—“¿m|¥ýêÀë¯ÛÆÂƾÉx31^ôVûíÁwÜwï£ßOä| (ÿhù±õSЧû“““ÿ˜óüc3-Û cHRMz%€ƒùÿ€éu0ê`:˜o’_ÅFJaIDATxÚì½i%Ùuö›™oµö6XÃÎ`Xƒ²CæÒ$¦-;H*L+d;d‡×ð”à "eX *¨)É ”)¬$†,öÙº»ªº»º»ºª«»ö·ärïñÜnæËõÕ«šš™Ê˜š~Kf¾Ì¼ß=Ëw–KÌŒóí|;ë›8çÛ«a3ÏúzÒûmV¼ EÒÚïŽ{lÖþùÇP¸˜DTú;'©ñˆÌŒ£££ß ÿ\¿ž³¶ÑYVýRÉ_ð<ïoKOFƒZe@Ã×é}«2ýº.гögV ÀfïÃ'>‘Ò‡ˆá8î¸Óé¼a~~~÷ÌÕuݳi“ñ¨ôä OzB—>ià„¯CéµoÙ±e`ÅûàÃÄ[u&À (¥Ðívgnnîg„8›Ö 9Žsæ.*xðÌÌ?œ%O `EçxÏ‚d%"(¥à‡<Ïû¢”ò\õWÜþªã8ÿ”2׎›p§ ÖÉÏ8-Xψ0óm۶߀Ϛd=s@e掔rSJÙ/ÀW¬³‘¤g¬Ì Ã0~åÊ•+¿p.QËí¥ßð<ï¯+¥r¨s°ž XC{¾×ë½M±rÔüõ}žçýY`/ÍDç6k}°2óŸyž÷oŽÇãs fÒQR^•R¾} œƒu¶f€ã8ÿ±eYÿ̲¬s ¦Tþ/H)ÿv‘Ê?ëéUJytåÊ•7Y–µÔx{LJ¹ª”Çøs6`6`ef˜¦ù1!Ä_= 9@UJ='¥üÁYI©skv’Õó¼F_Èò^g@埑RývúAœƒõl€Õó¼õV«õx¯×“¯g ö”R·•R ÓÚn¯3à,Û¬RJôûýÿcaaázÝ•™ÿ©”òçg=ˆçÖì3Â<¡”ºúJ™¯$Pÿ¢Rê_ÕåLÏÁzú` r¾:¿ï•ÂË+T¥Ô 3¿õ´õµV0ƒO¬J)X–õ7._¾ü¯ 2óÿ¬”ú¥“–¤çÖìÀäØsss!v_@}L)u£êC=ëÙ«Rêw¥”ÿÞi§‡ž:P™ù‹Ìüuê9XÏŽÍJD°mûÇ„_0 ã5 ÔŸUJýÖ4õÜÁ:;`UJ­_¹rå1Ó4ùµÔ3ßfæ…iô9XÏX™–e}È4ÍÿñµÔßb柭óðÎÙ€³Ë03<Ï{z4½p:- þ%fþÒ´éµh³Îæ>_9‹ˆà8οnµZßÛn·_@eæUçž;Xg¬RJ,,,ügý~ÿï þ¯Ìü¿Õ}ç`}ÕPW6½Q)õðÕ ÔǬÎBÝŸ6à,›¯”ƒ„W?1~ZOzµõ‹~`V¶iú³¼’Þ€˜.lDQæ((¥P·§À´`%¢‰éfágYך¼Oìï÷»ð?+ŸÇ«R ¦i¾ïÒ¥KÏžžN¨?à·;£‹§˜pæ 3 ù-ŸXS|ö‘9ø‚çºp=o$³«R B4›œkªyîðߪbÆxl£¬ÌgZ°Õ÷ß$„PU™ƒ³Ô>€ ½ã‚2O’zž‡»wîàÁÎ.LÓ¹˜®™è#•5 À`åƒõòå˸tñ„dMK<­ÓH-°„ <|¸ƒõÛw ¤¤R°‚'¾š<àðx.ææñøc%î¸`eæÿSJù?œD›¨“êæ÷ëy -RcE³=<&T“‡‡øü¿ü^¼vÝNC)ŽUâP¾hŸ³Ä@RðZ1À,Á ž’¸sï>þËÿäçð–Gß ÇqJûVUéè’Öf³ Ïóð÷?ü[X]ßÀb¿Å ÿØ¿¿O3T8 Â®€ðïÑ5*HéÿÖh4B£ÕÂGþáßÁ»žúììîG×Z4y€,:†ˆþ{Ïó>bšæ ³¶UO¨?¨ýR®îÈ¿S¸ºr·6 ÓnCˆÐPP¨~V  j`„öÀðS0 ._¾X:qêÜgú"‚çI,/-áò…e<í&æ{>ÜÁÇž} m mÁ¡®gÿ¾X)Ÿà4šM\¿µÏ<û%¼ûé'!„¨dûN3>AÄê#W®\yï¬óN¨ÿ¤²ÝQóa„ÒtçáC¼ðÒ*˜V«IHÃP*<Šö)fþ ²6 Xu «˜AÌð\—.,bqa~öNAÆ}5› ¼á‘Ëh5h6Á÷¡ð[V2Ç,”´¾ìÀ Ìäÿç?€¡ð¶ÇÞ€O~öOðÿA¼ãÉïÆîî~lÄάÁgïÙßßÿ›¦iþ£³ Ôÿ=‹ØŸX}/ŸqõúÖ7î£ÓnAzNÊ4ˆ}¨Ø”K¼É¿–t],--`~®l)Zå}£ÑÀ… ‹m¬]jâfì@Ñw%úÝ6Öî>Äïî9<ýäÛa¤T•Uz]°ŽF£¿+¥üØh4z0«Ò•Yõ­þ—YI™¼ïövvðüË+ŠÑ2”Ì/òmMN¼§È¡ÈëÏä à¸.–æ±0?.xÐej½Ê{f†iY¸rñ‚~≛"„Nëþ}Þ¾AP2¶ÑßôÈ2~ïsÏáÿÎáéw¼ »»û÷?+° !Úžçý_½^ ¯Î¨¿9k•˜Vùã¥k«¾mÚiœa3`"1>±úçBÊ)ö•µA'ØàJ‰‹ËK`VØÞ¾áp !â)'Ñ½ä šD(^}%Ü7yŸ@·ÓF¯Ó†!Œ"¦É·¥Ó6x¥‡`U1{ã%üî§ÿ%~êýïÃ;Ÿ|îìÎçìÁ$X¿gssóo*¥þÑ´ Y¨¿à1œÂöòµUÜÞ|€N·=‰ÀPÖL<4J¸ûDÁÐrl«f9TV cÛÆ¯ÿÆïÀq?¢Ê(Å`¨ ¨묂hG¹Qà!*D¯ÃŒ&„Q$<¦i`kðý¿¸råʦ ¯N+Q§´½tu·7·Ñm·4Û.齇'ƒVŒ}©ÐaA3¤’ÿNA„f³HaVÉ-IÉ©ç„;Ç %±DÆ…òmÎñx {ì`ìÚÒMI”Øþ̲³ÓÄd“nüpl«vZ¸yç>~ïÓÏâ™§žðé¾”Z>›õ/½ß²¬O•{@ýyñ4@º·»ƒ^^ƒ`dʶcÝP9•™s_2ƒ„ð%Ô„.M™¤¹iœg„¾TÚõ íB‰I‡Jw‘$þ)]}ZÁt•Ò·Uï³Ïáƒ?ñ#xæé'°»w€tYˬÀ&Ã}Øó¼ÏÇc÷$%ê<€_;-iúòõUÜÙzˆN«¥³é^m?œÎáI[”’•˜3czø5Ú˜©&yÛHæ;M8sÉØnÒÅ M„ ˆÿÍ–ûј3)|õßk·ñüêM|ò3ŒgžŽyÕô¬Ÿ¥d%¢G˜ùCNç¿i4'ÔÂ<ÓYÛ¦/¼äó¦Â™& "ƒ†|UÏý’ÈñH‚7â5J3¸Úñ©gñîw> !’Œ ºpl@^ý­ápøoTµSÍÊúø¿O ¤û{;xþåU0 Ãð9ÌDFM2T…2*•ëP%‚Bú4`hˆÍ*aw±PfJä!¨ÐþM…g‹€G Vþ2åQž ô±FüYRBÇräx!©yô‰\öw½é2>ú©gñï¾ÿ}x÷ÓOàÁÎ^"ˆÓöø1ÁØ«ïFÿùx<þ‡žçÍ ¨¿à-§Ô_^ÁÝÍmt;0«ŒxƒÌŸ¬DÅê¿ ï‡ y@ýQ?}šÒô¥«+¸·õ@šN„œR¯‰Þ5”42=&Šg¢l$Éd8 ˆ²änJN°V”Dîè_@ã5ãýHø]T’´Z¶*˜¼ßØ¡ o)íìÓD¡ ŸÚÒë´°±ýÿý?©š§N&…Âô’UÀÞþÞo`0ààà ñ'rÚ?;Mîî<Ä‹×Ömp&”i¶iÊßÎs@(×È˰ ˆ4YEB(ms&.9ot *MÒ¦°,FÓÈá5„ is ʼnjvjÍuø2jYcûUJ‰Çßتßz óýÉbÄb‰w !þ«v»~¿ŸøËê/xÓiõåk«¸wÿ!Ú­Vv©ºæX§œ(Jzعæ$e9TEh22åGe(ƒ‰ „ÏY‹²Ù«HõÇðÑ&›HIxªh§ *·ß‹Â$½Nwïïâãð‡@ªÝI‚Uñxüw øÒëõ ÿ¥óQŸðÍÓéÎÃøø|÷ì¢×iÇ9š@W ­cG}—ü÷*ÈÕsAÃÖ61Ýä¢JSp|°ÒzPɨ ‰ÿ–eƹ¬@ ­¿§‚°¤Þ J…!_¥Rûq|8È3•äóE~Áu\ØŽí3Ê?§/.¥ßG*:÷©wNe˜…]aÂÏ…aE-"­¤‚øœŒõ”_[Å Gðãw>üwðžgÞ‰ýƒÃ‚Æo~òÄdáúk (¥Ðl6?Ýh4ÞŸˆLéá+"ú{§Ðp&ݽwñ‹Ë–ýN(œŠ³'n.!a¥ •Œ2Çæ­~Llæ²æ'±–ˆ—Ì# Ç2  ¨PX+•?«F“LÅù *TçA>j,àØów¥ßâÒ?B£ÑÀöƒ¬ß½ç×mqp¦(ñqn¬VÞ6¼u(À°,¿W8¹'qëuUá=µÛm|ãÅüá³_Á÷½÷=½h''2!¥Ê;êk UrggçG‰èÙ¨ú±R)”О’©ócÁê׈è‡NÃó­f#&¨k‚” $ê¤ š±f#&ëŸ|•%T\³IZ9É$(Cª, MÂÆ’1)]Ì ×uqçÎ=ßáK¥Eâ53BãL#ª”9#Ý vè(UçUf2¹®Äòâ" +âwO —z}Bó†³E‹ \·, ³ji]îˆ,ËÁ_DÔšôTž4! µ•žÙP*XÂQÑÎ9)9ir`Ç%W 0M‡÷pïþ6ZMË¢éÆ ÇŬ›# ê"¼ŠX.WBñ¸„‹Ë‹ñ 24yOuV¬êL)¥WÓ‚2òúÃ…a¬f•"Ÿ˜úÐjµ`6 8ŽªÓî%U"ÏÈ®&MK™l°iàšñ«¤pÜPMAÅ 4Û:-¥Ÿ7gèŸû!P›[°í1z.TÄ'wbZ€A)\ ( ÅnØTKÓ¬4 ð©^öŠáÂò"„ÀL8Ó¬ÀšišÃ4•ðúƒY³v ZåݳB·ÓF»ÙÄ``Em5˜Ô‚¢?¥ƒä—˜ˆ³”X±{Ö8ÎðØp²Š¤$Õ½khæŠÖW*Épö¾À…Øß?ÂÆæ6†ŸpŠK`Óµ»Vj0™îZ áì:ÚÊ„œ(‡NŠå@%Â…¥ÅD¾@îtÚ*x}=«ïÂë÷íºà þé€h˜L! ¤°Y ¨JË‹àD?Ê€w ËŒ Øj€¤ô¥Œ!×{nX•°á"!4áõ§$iB‚"i?&È~$ئ)p{‡G´Ú­ ‘[à0 µ: ÞÄÜŒŸø^ààÞ7¿eZ~Às£dž8qr˪›ãz˜ïu0×ïÁ úµN«æëðªD)åjVù´™¦ˆh¤”ZðîS«~·9Ë‚T“}™Ê¼ý„ ÈiGK+Ö#4ÛVî¥+€Ì{›ð 0žvL &Á2A5±JQSúo!)]u›qBº‹ 9ÚÆÖ¶_/ÑNLÈ´@ÝDoÖO¼í÷=)ñïô`åOA® ¶m°çi]T’ ­»m–ÐëuaÛnnCŠi$jÙº°V³&•™Óðº’òÝê­¬ëب–e¡×mC)?’‹UÊdñµž$¯™6M Ñ€ÙhÂ}Ëã|ß» L ûÕ—`]¿ ·é=ǧÇ8Žõûb"™COäHÆ­S^zeç„“ã_¯i6°µ½½}4­`á^–Á*‚´Z Vüô3Xú·ŸÁ»Œ à?òp×ï@¹càèäØ`ö™à¬ØÑØÆòÂæú°íñÔ^|€¦÷B\ËÂ\:{Êk¶Z>á*å)T†i ôºí(G´8¼Tô@tÊ'°;…‘X ¸ ËO=‰',?çúÓOÀÞÝÝsÀ€RˆrQ£”7ÒÎÄó“Ñ)NÙ¨šC£å$AƒÙs6î?K¶„ a€-pwâ™§ñT xŸ xøH ;O½´±n4: 3úŽ½ÙŽƒåÅ9t»mì¥ú¦ž@pª£££ëY½þMÃLJTƒ !VˆN>æ_!dòùÛIžµÌ.Šú`6a?ò¼qÑÂ{0w «o|#šÛÛbà«vO%bÞaǪ(ßTiIÉȦk&=û¤™~gYööñpg–i {¨²!`4ÛàK—1÷¦+ønÀüVß/¾åͰ{ Ímx"túTý¤þ éËX^Z€F!%5z/zÍÌë†alfµÛé¦mT(¥V<Ï ‹O ¤XAh·Z0MOz©>ö7EM¥=k"0ÁÍpa op €)€7¸±¼¯Óö (¨‘/W…Fª=­¾¨lg*NÒNÕ`ÆÖöCŒÆZ +b)T öÉl&ÔÅKXœïà2€yáO²Gô/,b¼°Úl¦ ØáS¡ruT°Iéáâ…%"hB<¥ó4…ýºÒl63/tÂëÀºôÐI4I#1z½ZÍC%&lÁ<©šªNJ«ˆ„iAv»h÷{XÐ#À° Óïb¿×ƒ±cA…-*•æÒi)p¬eœèI(…6uUŸ¼vN™†ŽFØÞÝõWêS= ¿ Å,0à‹±Ôh’oŽ,307ßÅý ËàF0,&-×QýžÄ¥ K0 RªZK¼©úœþtÕ¿–·E¦3ED›J©u¢Ù5F+"ˆ•Th6°L®+a¦®)¨qw²äC %Ÿ ›QAv{è´-ÌhÀ÷Sú tZ„‡ý9a@ áÇÏ•Š@¯·°dÝNIÒ(}.ë×H]]ªš¦‰Ý] ްLIAh† X-4zX4üëEpýóæÚÍÏÍÈ4ÀBø\yœ,ÓÄÂÂ\°ªu>ÀªØ¬%ª>ýÝjžóžçõ+×¥”o9Î"Veñäè&É8–iøg*®›Odûh#ÅœhŽËZÖz\Ñ4N ªÓA«áwÔ0‚Ûi3еtÛPÂùµF*N|NdµkTTRýg”‡¤ö×Ù"‚3¶±µý0JËKPnÃ! ÜêÀìõ0 M„Ñe`ÎŒ9¨0‚ÈUP+ŠTÇqqaqs½lÛ®2&®ŸÚ®æsÂëšv»½&„À4ëUÉM_°eYè´Zð¤ô ïœá ÐÊ:4IFQ}œX¦¿±F“ n5Ñ@S3áš–l·!…¯úýÕGdTOÑúRq˜4\à7+m麤4wªF»{{Ø?8„i™PR%h¶HŠ ÔjÁì¶Ñ%_’†[‹ük§^0€i”Ò€•Ô¾íbyy ó°r²¿Žt-ûζí•<-S¢ CD+@=²@'Ôean® ÏóÀQe©F–Op¦aK^š( æ(ÊôN2¸Ù@€©ÝA@š<ÓH@)ßÑRÕ ¸,%ÔDú'¤£Jüä›í‡»RlGZú*0 °iB5h4h#™ÍÞd @´€e„ääÁ´TG®ƒ¥…>æû=Øc{&Q¨Šßí!ÖC‡~¨Ýn7ËF…Rêºëº¹>d–Õr33 Ó@«ÕK驉öæael¢‚2ÑY'áƒÌg#®Â–TýæÃÁ7MH!¢þý!—gàS´žSb²„Yúáwœ¶aµ˜Vp*Ã0qxt„Ýý}˜†é¯7¥q¯>èÀd!°Õ€a™h¤€jÐbÀjZf°¢5Õ éDªçJ,-. Ù°°0š0N auîšÕ°sU–×€õ:•©ÓJÐìÏ–iA‚”2è%ŸtT˜Ã… ´<Ë@Š„QZœ3,Öã„ØwˆùX„é;R¿ Eèõ³..I_uÁÚR˜°OõòÀ„D6 ÆÎî>lÛA³ÑÐòKIËv’ˆº³¦!üëLºZ°(Ð~!HéøÊßu\XZ„[ÒÏH½ñ̾EmÞòœ)Ñm)å.‹' Pf†”Êè÷»° xž„iñ·A2³šÈ·¤Ôg¬-ZFfð ˜BÀH ¶\PÃ$Ñé .1O«Röi¼0ðdŒ_7Yˆƶݽ}ŸÙ NÔ:ª#êîÇ 0 3uíľéb„©‰…ϦgÇŽ‹+—–Ѱ,(%gfV²«Eþ™¿ÜXUJ½wO¾ @“\*0×ë Õ°°7¶£Ö†i€ E¬G„¼â‡ò¡ÄoŒÔ Ä 3¨ ^*µºáTmT¢N£§(±Š!™L_«eØÛ=Äx4‚iYZ!Ù>Z© såKʨëi¤òOy+<×Ã…¥E˜¦Hp¨'ÐR?×ëOÒn·oÑ{Ë꬙¿¯‚aX°LžçúÅm*ƒ{K÷º‡­ š–¨,%„ò.èKÝd)EÉ R )UD‘E’“åÔ`dr·i|¡‰ð¶Žãbo?3é:Ja½ÂQ%è0Îp(È©ÍOÛ~® ZÐó$ZÝ6ææúp]ϯŠ˜ZÅWÁA8Ž¡Ç_—G ·•TäàKÌfÓB«Õ„Ô‘§«;}sQÅå ¡4“É$håWw†…u2c°üêWÉ ¡¤¿Hoèà(dF¥ÔX‘Ð,Ã4qxx„ƒÁ ÃLØ·H'uågñK†Dª­9ûKE&½úé%«'%..Ìaa®ñx8ÓŸ+VX˜›C˲0²ø4·o[&ò:3Ë?ôÌ©`)A®ë«ÃÁƒ@]†ãh+` o8Ûc°çAz^ª`È8›*+K?ìKŠŒn)–a`x4‚3v Œ¬2Î6N™Á® ŒGpް`\· ?ËÿÀäÁ¡_ (%¦îÁJé‘K—Ñl4 =™‘™6}ªÌRÊ•2ag–eF°ÂŒ© ÒiL½-v»Ý€Õ0p8ô`šÆd$œÑˉ“¡°]¸jaá 8PÀH›¸cöp=„t}õÉA‰0‰™dPÈœLÝã¸öž3ÖŠbë;]­Ôx ÁRF¦„J(09¢tS×¥X)ø‹¨9®ƒñØ ´BÅ"§PJøN•”þd …bò¤Ö*½â&ÄDˆU)†Ùjan®Ô¬)¦ig½ê‰özÀJ@­¸ªÈ² ›•Y ”B»ÕD¯ÛÆ{[°,#*Ñ`Å #XöF%k•ÂÁó³ UìØp5å¹€ô|ÇC>÷ ¤òdœ ÊH”’°fß)"žÒú¥©î\×gj cFý;Ø/O’Ù°&Ô &("(©¢è”’èv[X^\‚뺥ѨªL@-»Võª«Ú¨kDdh΂7Í;FKøô»],Ìõ1Ñë´â†g ðœ¬4§)ÎlÒ”%Öd “°]ÝKÏküp•ŠbîzôIj¬C`<éÂõN`ãzÒ8 ¦Ñòê J‰ „©ÐmµpáÂb´JY<¿_š;þTœÕŸê8È’)Ùî†qÀãÇáQ«€UJ‰fÃB¿×ô<(©‚Dö‹Ý‚¶Šz5ªBF%•̦ÞÅËÛ„|ÚRx †DfT‚Õ» D™ñ'Ò´k6ç$2@ZzŽëyè÷»èw:p\§p|ëø!e!ÐJÕ[ªªú9ÓÏÊëÏ;>¬|ívÛ Apƒ…l™%HåÅJÅT¯jvº“¥ëifJµ„Tñ~œ‚ '#ae@ap öif š¹Lfòëb´¶ëâ±¥E4š 8®[ÛƒŸÆ, Þ¯T-ã6›Íf¥•RטùG‹"T³tªæça”ëE\ª"@Ê™}õYi= T*Á:RœR[õ;YêœXpWÅ }cÌqBð<’UíŇO©B@‚’ £á—/^@·ÛÁÁþîÌÔ{Ùx+¥nT½ì*‘©˜×§¡'¦±YÀÒÂ< CÀ•,`ø îBÛT'ö£¬{¥SK**ÉÁªRœ’Ù ÅẸ\OÛ2MÕþèÔ7 {ÇùEÀظ´¼ˆn»…ÛÞq¼ø:ûR¨5Zfß8q€Fv§B»Ý‚e™°mÔ°‚.&±÷c.œŠ­~"à=UrÕ=ÄU|µNÚú Aj_M{P_d§$Cx`•@†á'ì+JÏÍõÀÌðuh»¸pa óýloã8Ž×_×ë¬ÍZ×ë­0³df#±Ãt„o.@•R~Ì¿ÕD¿×RìgØK-¥óïbòñúô:.cªøìÆß_!¨Âj6077ç·Û¬¸Êqh+¥LÓ\3M³²ÇTõ‡Û&€[bþÇ ™–ÕÚH¥0??VÖ±<ß×r@“‰%Je$2G½ÒnýÉKœiÃ7û¾ÛXZZ‚ Ê]œ÷¸jZ )¥®ë‰E•€*ê?Ý"z\J9ù_uÝ!Çqqqy?þà ßõØ:û½DRJõxJyL9ª>öù³Œ²aŽ.¡ê Šö£Š¿‡š[ùDŒÃ£ÞõÔdz ¡²šRêºmÛµ–…ªB gÜê”tD­ï¤ç„Àúýh·;“¶ij‘ºä“œ9¨œÌNÉ_ãN›L´c%6MöêÏ:†™d’ g'¯SwYvýéûfÎtû ûûغ¡Ð:)€FÚRÊëu¥c]Õyþy«e”Ù Ú»Ä3OJìïïc?®ðÄdÕ§ŽˆÌ~þyþ:kPÔ…qâή£š8WAœqM&W@ÉðÆÓ«½f¦—ÛL‡“¹ÈÚ5†-ЋìÓY4Øv„·kõÑG­uÀp8¼¾±±13€–QZ~º^õNruö«K§å%Ÿ@››ZÇwß²jÓÔäXÖÊòòò ¶×ÿ¡}¨ÖO=õÔõïýÞïÅÁÁÁÔµ5ÓPZúçU;¶õ3JÊŽKWt| s’ *×Qå÷òl¿¬ß9ŽMZ áfYF£ÑÍ~ô£Ñò•'Æ­ÌÏÏw¿óïÜrg9½VfÉuÒ¤*ÃPõø¬ïŽÓvqšë8.É~BqúZ ÷»|ù2>õ©Oýò¯üʯü­Úª¿î‹‹‹"Zeæå*«]”ÕÙL³°Öit–Îáqz\šè¸€>@uIODµ)Ÿñ­)}G£677o6›ÍtW¶Ä_ý”÷>}ŽôwYû–]CÕßÉú­ô9ªÜG•ãòî£ÌD*:Oë-;_èªrŸYç$"ŒÇclnn^›F›×%Qikk _ùÊWV*Ýpúæ¦A Ö=WÞµ£ìÚŽ Ði€^wÒÔñŽ P½ä`0°Ÿ{î¹ÛÓ˜žfinNç•D2faVe ²LŒªfÄ´×:ö‹S]ó¬Tþ,œ¤ª Õ¦iÞlµZ÷¦Qýf]Àáááõ02Uälœ4@«H‹YØ„'Ñvñ¤z^|æÎê_wýzò4¾JPÔ)|⟸µ»»k‡‰Uíž2»°®}U¦‚«ö4ª¹ §:½]f3Ïú½þY_Ƕ×?ŸŸŸÇ·¿ýí••••©Ø's1<7-˺5 Þ^¦óÔò4žú¬h—®4óÕìN[zV•öU¯3ïsÃ0@D+À,”¬æ4ëÞÞžwÿþý[ý~ÿí®ë–¦†·Ü,i¡“âAgÕßþ4xÐ:êý¸ 7×u±µµu­‚ç:@-Å´¶¶Æ_ûÚ×Ö>ðàðððÄV_ÖDz,4›Í̵CýbÀBÊ,ü‡ØÙÙAVîã¬z\gÚk ò;±¼¼ó™o0³ËÌÁ E?þÖ÷Z Ëò"N®ÏEB`a~®òªáušGÓ4·šÍæí j>ó;³®4 _ܽ{7jî;ë…]Óû4›Mܼy _þò—ÑîtW¹¹9üÚ?øµÜ½}ûÓÞ8‰[üàîû¿ÿûÿÆ­[·ŽÅ0LÐY2 EïÛí6¶··wññWhÀ_bðsíçõ‰'žx÷ÁÁA¢×¯mÛ¸xáÞü¦7b0»çmÙç–eaooïöööön]o?Ïë¯R€Ï}îs7G£Qn˜4Ï‹¯Bæ§o\J‰V«…ùùytÚmt:èonn£ñØÞÞÚzàÞ€õñf³i†6tÕXUg«ª§^—™&¢gÛöÀ÷ÿ€ùû[÷V»½.Z­&ZÍø¯aY˜Ÿ›C£Ñ˜rTq8ëÚ½½^+++7nܸâ‡JðFEµ’$ _ÑmÓ4·˜ùr¾sµ*¥„e™0 c"¹¾Ùl`}}ý†ã8{ú¬`¶÷ööÇq`FT³~RqøãHÈ㘆a`0 ƒÇÒ þ5ônݺuÓ±ýu®<Ͷgf„]J޳~XÆÀ²¬ë~ªHÓÄ>UB¨:ú…¦úw677o·ÛídcÝsúëO0 c™²¬ÖoÝZàh@µ´>|èŽÇãhMÏiâáUãðU8â²ß­ÍÒ߆ƒƒƒ°ÙXS»ÿùkׯmìîîÌT“f†Õ0Ú°ŽT&0pûöíë)ÌQ)ª®©Í¸zõ*^~ùåý~¿6@ëRXRJ˜¦-â«Û§Žcc}ýÖ:€n0@fÔ g<{Yª¿JDë´âðU9µGB`ww7ª¥=ƒ®’òàþýû7Ó=p3VÃ/–Ì`QfÐ0"ÅÌøó?ÿó[¥ªø5ìÒ ÉÚjµV²$Ê´EEÓ4afBa˜¦‰ýýCû¥—^º¨}#$@cssÓ‡Žaµr’Àúg!Àˆv0& íþ›äÛë·ŒTï`šF.HgPý8Ã0Æ­Vk=ÇŒ¤*½ŽêŸ8ùÍ›7W§u*ª|—|M0-JëqÒlµ°µµyÛqœÝ€–²´²¤”‡#}9ï¬ßÒŠãd_ Uòt3‹Èïr= 옆¦QLßN½¹> ‚ž§>pL˜¦ ÉêXNREÛ»»»wïÞ½[–5U(0E*ýïŸþéŸÜ,š}DZ{Ò‚`šVbÉOÓ0pçÎíÛoØH ’Ãápœ'QóRët/}š÷yqx×u1 œ”45‚¿îµk×îïïï­@ª†ö¾eZž<1€†[§ÓÁúúúÍ«W¯:)S“*‚´Ð™ÊSùú ü#„×h0dH¡a™ÑZ¥a´ãÆë:©2 òÁÁî \'‰»ª³5ëD‘¢ÏuGÊu]ìîî:D5SæOG)µ¿¹¹¹ÞjµÂ“Â4cÇ4º›å&„XÕX&*~T¨y*?ñþúõë·¶¶¶6ÂÐæ´YûyRCÿŽ„€©5~5MãkW¯n@5R`5`ß6M³’z¯"UNZ½çMÖ!pÛkk«Û{û{ƒä7ƒ|‰ÓXÅ…ˆÐh4nPR•¤jjznܸq3/:KRLËH©"Ò?t"Ön¬Ý @ªO ¡Ñnæáá¡£V —NKÔWµƒ•RÇ.˜‡¶mÛ¬©ÕôshKélnmn´Z¾‰ÖhX…=fµÿîÊÊÊí G9¶–ê/#e#.õ«_ýꬫY¼äq ûü0ªo«ìïWWVîÑ(#5Pá¿æÞÞžíy^¢¯RYœý¸D}Ùùêt²+:g>u˜YjÚdâP÷|íHT †FÙÔÖjµ°µµu륗^ÚÖJ]˜ë/³Q³ «ÐIdÓ+¥ D­f7oÜØÇ{JZŒ[7QŒÝÝ]Çu]! ¥œÙZXuŽ/˨Cº§•€Cõ´±L `­­­Þµm?ß¡Ùh ¢1èWÈο\_7#ξÖ{¦_s¸+¥"YáŸùüóÏßÚÞÞÞMgâäIŽië‘X)4,+Œ„»wïÜ €Q ălÇq*WË'jTµ »Žô,:¯"ŒJy9QÆðY´oÞ¼±½··;0,–åÛúu:9N³ùé™7×´ðnÚÏ©¾¯BOýÛüÖ·¾µ³±±ñtulÐ:áV¨:Ó4á¹nÜXÛ(ôѹÿ¾cÛ¶z¥£H³¨ž9uttde‘Ý×ðqžÔûð؉Öëõðo|ýàöíÛa¢4§«Òç‚ó•ááX¨YáaTñйâŸnR†4•ç) ×Šžå8‡|Æ%,WP‘\"]UÆ¿ªÀ&MK×*ü§*p´¸Äήd>˜5Oa‰ Gf¨{Nq}Œd2´Àd;e*ÊŒö"[‰ÏXyÊý³þU<«Lù\Ô<ó í_‘÷EÔÏ ¨™™×SHQ¬YN’®òÓÎåHS ;—Ψ¤< Ps‰´Ê¢®Š˜UÖ,iÊ9Ü.*·ðþÌD3W²Y´R‘3Ãö¨J‘ÉY Õ) €Y'ñjv¨ªHÖ:ÔU# +˜K<3ÕŸV}yQœtˆ*ˆ*˜ñFŠ  )*JT=!?4G%*^# åm§?¨å´„”9À•ÀURšk‚x+f@ËÀ›p‘³$ ('ÖÏ&}½ªü*&¡8&ŸgÔ‘²e@­c›rÚë¯JM©o™VÿéÙ!0¥â `Ö‘¢U½zzƒ³*#rÍ"î‹h¦¢:-T˜¥±Yƒ;MÛ~œ«ÊàA9CKd7³¨£êQðšQ/WöµTÎxUmV”€µHÒªp—IS”yýi@RÝC)‰¨ßX™Š¦Œß¡ s /vœó¤?¯"Mé5(9«HUByµ@–f,ª(b Pàh—¥r–3UÕHO;SY›Ê¡•ªß9KuÕü¹ê/Wÿ¨ Ž«ä¹æ1>eŸq¾‰ëÌã#³Ô¬(P–ç‹–ÙžUjᤵ$.*²<%`óX„²ß(ú¼²ÀZæä”³Ê)³EÏ:=P«Ú®U’[PÄe’eÎU•º{*ù®¬ðj‚½®NG½r¶ ˜ Ò2 ¢‚·]X`²Þ5Ž¥úZ‹Tñ÷6@S74[ •@ T/|«"]QŒU¨¦º <—®Ó›eÎVH«ršr•R Vk`ÕcóuwÈÓ/×mú³¢„¥Ê -êãuëä«€0ëiú«Žtå×!°¹æ„®BaqމÁö/sÔÊè²cµŽ„Ð')=_¯@µ³•gßV4ñ”×ÍÓ¿Ñ £ ÇÏÂÙ97 fâ¢mU%âÔ4½ïq9¦‰ÍÒ“?ßNà\ó8>椉Ž1f”Yf3ͤ³Æù650ù˜ >ŽôÌ=nÖ=™ò˜_ ½ŸÎ·z’–gù;§ISN¯M—Oã÷h†@;w~ÎA{bç¥W!¸ÎÁ}vAwb×pNo¯Š rš6èùvÎ3®sОó5¨s@Ÿƒ°ÒöÿÔL[xEøZmIEND®B`‚ubuntu-html5-theme-0.1.2+14.04.20140404/examples/container/simple/www/index.html0000644000015301777760000000411012317536560027475 0ustar pbusernogroup00000000000000 Hello World

Apache Cordova

ubuntu-html5-theme-0.1.2+14.04.20140404/examples/container/simple/www/css/0000755000015301777760000000000012317537133026271 5ustar pbusernogroup00000000000000ubuntu-html5-theme-0.1.2+14.04.20140404/examples/container/simple/www/css/index.css0000644000015301777760000000714312317536560030122 0ustar pbusernogroup00000000000000/* * Copyright (C) 2013 Canonical Ltd. * * This file is part of ubuntu-html5-ui-toolkit. * * This package is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 3 of the * License, or * (at your option) any later version. * This package 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 Lesser General Public * License along with this program. If not, see * */ */ * { -webkit-tap-highlight-color: rgba(0,0,0,0); /* make transparent link selection, adjust last value opacity 0 to 1.0 */ } body { -webkit-touch-callout: none; /* prevent callout to copy image, etc when tap to hold */ -webkit-text-size-adjust: none; /* prevent webkit from resizing text to fit */ -webkit-user-select: none; /* prevent copy paste, to allow, change 'none' to 'text' */ background-color:#E4E4E4; background-image:linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%); background-image:-webkit-linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%); background-image:-ms-linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%); background-image:-webkit-gradient( linear, left top, left bottom, color-stop(0, #A7A7A7), color-stop(0.51, #E4E4E4) ); background-attachment:fixed; font-family:'HelveticaNeue-Light', 'HelveticaNeue', Helvetica, Arial, sans-serif; font-size:12px; height:100%; margin:0px; padding:0px; text-transform:uppercase; width:100%; } /* Portrait layout (default) */ .app { background:url(../img/logo.png) no-repeat center top; /* 170px x 200px */ position:absolute; /* position in the center of the screen */ left:50%; top:50%; height:50px; /* text area height */ width:225px; /* text area width */ text-align:center; padding:180px 0px 0px 0px; /* image height is 200px (bottom 20px are overlapped with text) */ margin:-115px 0px 0px -112px; /* offset vertical: half of image height and text area height */ /* offset horizontal: half of text area width */ } /* Landscape layout (with min-width) */ @media screen and (min-aspect-ratio: 1/1) and (min-width:400px) { .app { background-position:left center; padding:75px 0px 75px 170px; /* padding-top + padding-bottom + text area = image height */ margin:-90px 0px 0px -198px; /* offset vertical: half of image height */ /* offset horizontal: half of image width and text area width */ } } h1 { font-size:24px; font-weight:normal; margin:0px; overflow:visible; padding:0px; text-align:center; } .event { border-radius:4px; -webkit-border-radius:4px; color:#FFFFFF; font-size:12px; margin:0px 30px; padding:2px 0px; } .event.listening { background-color:#333333; display:block; } .event.received { background-color:#4B946A; display:none; } @keyframes fade { from { opacity: 1.0; } 50% { opacity: 0.4; } to { opacity: 1.0; } } @-webkit-keyframes fade { from { opacity: 1.0; } 50% { opacity: 0.4; } to { opacity: 1.0; } } .blink { animation:fade 3000ms infinite; -webkit-animation:fade 3000ms infinite; } ubuntu-html5-theme-0.1.2+14.04.20140404/examples/container/simple/simple.qml0000644000015301777760000000147312317536560026671 0ustar pbusernogroup00000000000000/* * Copyright 2013 Canonical Ltd. * * This file is part of ubuntu-html5-ui-toolkit. * * ubuntu-html5-ui-toolkit 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. * * ubuntu-html5-ui-toolkit 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 Ubuntu.WebApps 0.1 WebAppContainer { height: 400 width: 400 htmlIndexDirectory: 'www' }ubuntu-html5-theme-0.1.2+14.04.20140404/ubuntu-html5-container.qmlproject0000644000015301777760000000064512317536560026227 0ustar pbusernogroup00000000000000import QmlProject 1.1 Project { QmlFiles {} JavaScriptFiles {} ImageFiles {} Files { directory: "." filter: "CMakeLists.txt" } Files { directory: "src" filter: "*.h;*.h.in;*.cpp;qmldir" } Files { directory: "tests" filter: "*.h;*.cpp;*.py" } /* List of plugin directories passed to QML runtime */ importPaths: [ "src" ] } ubuntu-html5-theme-0.1.2+14.04.20140404/tests/0000755000015301777760000000000012317537133020726 5ustar pbusernogroup00000000000000ubuntu-html5-theme-0.1.2+14.04.20140404/tests/autopilot/0000755000015301777760000000000012317537133022746 5ustar pbusernogroup00000000000000ubuntu-html5-theme-0.1.2+14.04.20140404/tests/autopilot/tools/0000755000015301777760000000000012317537133024106 5ustar pbusernogroup00000000000000ubuntu-html5-theme-0.1.2+14.04.20140404/tests/autopilot/tools/qml/0000755000015301777760000000000012317537133024677 5ustar pbusernogroup00000000000000ubuntu-html5-theme-0.1.2+14.04.20140404/tests/autopilot/tools/qml/webview.qml0000644000015301777760000001407312317536574027077 0ustar pbusernogroup00000000000000/* * Copyright 2013 Canonical Ltd. * * This file is part of ubuntu-html5-ui-toolkit. * * ubuntu-html5-ui-toolkit 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 QtWebKit 3.0 import QtWebKit.experimental 1.0 Item { id: root objectName: "webviewContainer" width: 640 height: 640 property string url signal resultUpdated(string message) function __gentid() { return Math.random() + ''; } function __wrapJsCommands(commands) { return '(function() { ' + commands + ' })();' } function __createResult(result, tid) { return JSON.stringify({result: result, tid: tid}); } function __dumpValue(v) { if (typeof(v) === "string") { return "'" + v + "'"; } return v; } function __setupClosedVariables(variables) { var variableDeclStatements = ''; for (var variable in variables) { if (variables.hasOwnProperty(variable)) { variableDeclStatements += 'var ' + variable + ' = ' + __dumpValue(variables[variable]) + ';'; } } return variableDeclStatements; } function clickElementById(id) { var tid = __gentid(); var statement = 'document.getElementById("' + id + '").click();'; webview.experimental.evaluateJavaScript(__wrapJsCommands(statement), function(result) { root.resultUpdated(root.__createResult(result)); }); } function evalInPageUnsafe(expr) { var tid = __gentid(); webview.experimental.evaluateJavaScript(__wrapJsCommands(expr), function(result) { root.resultUpdated(root.__createResult(result)); }); } function clickAnyElementBySelector(selector) { var tid = __gentid(); var statement = 'document.querySelectorAll("' + selector + '")[0].click();'; webview.experimental.evaluateJavaScript(__wrapJsCommands(statement), function(result) { root.resultUpdated(root.__createResult(result)); }); } function elementWithIdHasAttribute(id,attribute,value) { var tid = __gentid(); var hasAttributeWithIdFunc = ' function __hasAttributeWithId() { try { return document.querySelector("#" + id).getAttribute(attribute) === value; } catch (e) {}; return false; };'; var statement = __setupClosedVariables({'id': id, 'attribute': attribute, 'value': value}); statement += hasAttributeWithIdFunc; statement += "; return __hasAttributeWithId(id,attribute,value); " webview.experimental.evaluateJavaScript(__wrapJsCommands(statement), function(result) { root.resultUpdated(root.__createResult(result, tid)); }); } function isNodeWithIdVisible(id) { var tid = __gentid(); var isNodeWithIdVisibleFunc = ' function __isNodeWithIdVisible() { try { return document.getElementById(id).style.display !== "none"; } catch (e) { return e.toString(); }; return false; };'; var statement = __setupClosedVariables({'id': id}); statement += isNodeWithIdVisibleFunc; statement += "; return __isNodeWithIdVisible(id); " webview.experimental.evaluateJavaScript(__wrapJsCommands(statement), function(result) { root.resultUpdated(root.__createResult(result, tid)); }); } function getAttributeForElementWithId(id,attribute) { var tid = __gentid(); var getAttributeWithIdFunc = ' function __getAttributeWithId() { try { var value = document.querySelector("#" + id).getAttribute(attribute); return value || ""; } catch (e) { return e.toString(); }; return ""; };'; var statement = __setupClosedVariables({'id': id, 'attribute': attribute}); statement += getAttributeWithIdFunc; statement += "; return __getAttributeWithId(); " webview.experimental.evaluateJavaScript(__wrapJsCommands(statement), function(result) { root.resultUpdated(root.__createResult(result, tid)); }); } WebView { objectName: "webview" id: webview url: parent.url width: parent.width height: parent.height - 100 anchors { top: parent.top bottom: addressbar.top right: parent.right left: parent.left } experimental.userScripts: [] experimental.preferences.navigatorQtObjectEnabled: true experimental.preferences.developerExtrasEnabled: true experimental.userAgent: { return "Mozilla/5.0 (iPad; CPU OS 5_0 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9A334 Safari/7534.48.3" } } TextInput { id: addressbar objectName: "addressbar" width: parent.width - 100 height: parent.height - 100 inputMethodHints: Qt.ImhNoPredictiveText | Qt.ImhUrlCharactersOnly focus: true enabled: true readOnly: false color: "red" anchors { top: webview.bottom bottom: parent.bottom left: parent.left } Rectangle { objectName: "browseButton" id: browseButton border.color: "black" border.width: 5 width: 100 height: 100 anchors { top: parent.top bottom: parent.bottom left: parent.right } MouseArea { anchors.fill: parent onClicked: { root.url = addressbar.text } } } } } ubuntu-html5-theme-0.1.2+14.04.20140404/tests/autopilot/ubuntu_html5_container/0000755000015301777760000000000012317537133027443 5ustar pbusernogroup00000000000000ubuntu-html5-theme-0.1.2+14.04.20140404/tests/autopilot/ubuntu_html5_container/tests/0000755000015301777760000000000012317537133030605 5ustar pbusernogroup00000000000000ubuntu-html5-theme-0.1.2+14.04.20140404/tests/autopilot/ubuntu_html5_container/tests/__init__.py0000644000015301777760000000252012317536560032720 0ustar pbusernogroup00000000000000# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- # Copyright 2014 Canonical # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License version 3, as published # by the Free Software Foundation. """Tests for the Ubuntu HTML5 Launcher package """ import os from autopilot.testcase import AutopilotTestCase LAUNCHER_EXEC_NAME = 'ubuntu-html5-app-launcher' LOCAL_LAUNCHER_PATH = os.path.abspath("%s/%s" % (os.path.dirname(os.path.realpath(__file__)) , '../../../../src/ubuntu-html5-app-launcher/' + LAUNCHER_EXEC_NAME)) INSTALLED_LAUNCHER_PATH = '/usr/bin/' + LAUNCHER_EXEC_NAME class UbuntuHtml5LauncherTestCase (AutopilotTestCase): def setUp(self): self.app = None super(UbuntuHtml5LauncherTestCase, self).setUp() def tearDown(self): super(UbuntuHtml5LauncherTestCase, self).tearDown() def get_launcher_path(self): if os.path.exists(LOCAL_LAUNCHER_PATH): return LOCAL_LAUNCHER_PATH return INSTALLED_LAUNCHER_PATH def get_app(self): return self.app def launch_with_argument(self, args): try: self.app = self.launch_test_application(self.get_launcher_path(), args) except Exception, e: pass ././@LongLink0000000000000000000000000000014700000000000011217 Lustar 00000000000000ubuntu-html5-theme-0.1.2+14.04.20140404/tests/autopilot/ubuntu_html5_container/tests/test_appLaunch.pyubuntu-html5-theme-0.1.2+14.04.20140404/tests/autopilot/ubuntu_html5_container/tests/test_appLaunch.0000644000015301777760000000135012317536560033562 0ustar pbusernogroup00000000000000# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- # Copyright 2014 Canonical # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License version 3, as published # by the Free Software Foundation. from __future__ import absolute_import from testtools.matchers import Equals from ubuntu_html5_container.tests import UbuntuHtml5LauncherTestCase class UbuntuHtml5LauncherAppLaunchTestCase(UbuntuHtml5LauncherTestCase): def setUp(self): super(UbuntuHtml5LauncherAppLaunchTestCase, self).setUp() def test_launcherFailsWithNoWWW(self): self.launch_with_argument('') self.assertThat(self.get_app(), Equals(None)) ubuntu-html5-theme-0.1.2+14.04.20140404/tests/autopilot/ubuntu_html5_container/__init__.py0000644000015301777760000000053612317536560031563 0ustar pbusernogroup00000000000000# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- # Copyright 2014 Canonical # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License version 3, as published # by the Free Software Foundation. """Tests for the Ubuntu HTML5 Launcher package """ ubuntu-html5-theme-0.1.2+14.04.20140404/tests/autopilot/ubuntu_html5_container/emulators/0000755000015301777760000000000012317537133031456 5ustar pbusernogroup00000000000000ubuntu-html5-theme-0.1.2+14.04.20140404/tests/autopilot/ubuntu_html5_container/emulators/__init__.py0000644000015301777760000000053612317536560033576 0ustar pbusernogroup00000000000000# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- # Copyright 2014 Canonical # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License version 3, as published # by the Free Software Foundation. """Tests for the Ubuntu HTML5 Launcher package """ ubuntu-html5-theme-0.1.2+14.04.20140404/tests/autopilot/CMakeLists.txt0000644000015301777760000000062112317536560025510 0ustar pbusernogroup00000000000000execute_process(COMMAND python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()" OUTPUT_VARIABLE PYTHON_PACKAGE_DIR OUTPUT_STRIP_TRAILING_WHITESPACE) install(DIRECTORY ubuntu_html5_container ubuntu_html5_ui_toolkit DESTINATION ${PYTHON_PACKAGE_DIR} ) install(DIRECTORY tools DESTINATION ${CMAKE_INSTALL_DATADIR}/ubuntu-html5-ui-toolkit/tests ) ubuntu-html5-theme-0.1.2+14.04.20140404/tests/autopilot/ubuntu_html5_ui_toolkit/0000755000015301777760000000000012317537133027643 5ustar pbusernogroup00000000000000ubuntu-html5-theme-0.1.2+14.04.20140404/tests/autopilot/ubuntu_html5_ui_toolkit/tests/0000755000015301777760000000000012317537133031005 5ustar pbusernogroup00000000000000ubuntu-html5-theme-0.1.2+14.04.20140404/tests/autopilot/ubuntu_html5_ui_toolkit/tests/__init__.py0000644000015301777760000002102212317536560033116 0ustar pbusernogroup00000000000000# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- # Copyright 2013 Canonical # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License version 3, as published # by the Free Software Foundation. """Tests for the Ubuntu HTML5 package """ import os import json import BaseHTTPServer import threading import subprocess HTTP_SERVER_PORT = 8383 from testtools.matchers import Contains, Equals, GreaterThan from autopilot.matchers import Eventually from autopilot.testcase import AutopilotTestCase from autopilot.input import Mouse, Touch, Pointer from autopilot import platform # from autopilot.introspection.qt import QtIntrospectionTestMixin class RequestHandler(BaseHTTPServer.BaseHTTPRequestHandler): BASE_PATH_FOR_SERVED_APPS = {'rss-reader': "%s/%s" % (os.path.dirname(os.path.realpath(__file__)), '../../../../0.1/examples/apps/rss-reader')} def get_served_filename(self, appname, filename): if len(filename) == 0 or filename == '/': filename = 'autopilot.html' print os.path.join(self.BASE_PATH_FOR_SERVED_APPS[appname], filename) return os.path.join(self.BASE_PATH_FOR_SERVED_APPS[appname], filename) def serve_file(self, filename): import mimetypes content_type = mimetypes.guess_type(filename)[0] f = open(filename, 'rb') self.send_response(200) self.send_header('Content-length', os.fstat(f.fileno())[6]) self.send_header('Content-type', content_type) self.end_headers() self.wfile.write(f.read()) def do_GET(self): # FIXME: more generic & cleaner if self.path.startswith('/rss-reader'): filename = self.path[len('/rss-reader'):] self.send_response(200) self.serve_file(self.get_served_filename('rss-reader', filename)) else: self.send_error(404) class UbuntuHTML5HTTPServer(threading.Thread): def __init__(self, port): super(UbuntuHTML5HTTPServer, self).__init__() self.server = BaseHTTPServer.HTTPServer(("", port), RequestHandler) self.server.allow_reuse_address = True def run(self): self.server.serve_forever() def shutdown(self): self.server.shutdown() self.server.server_close() class UbuntuHTML5TestCaseBase(AutopilotTestCase): BROWSER_CONTAINER_PATH = "%s/%s" % (os.path.dirname(os.path.realpath(__file__)), '../../tools/qml/webview.qml') INSTALLED_BROWSER_CONTAINER_PATH = '/usr/share/ubuntu-html5-ui-toolkit/tests/tools/qml/webview.qml' arch = subprocess.check_output( ["dpkg-architecture", "-qDEB_HOST_MULTIARCH"]).strip() BROWSER_QML_APP_LAUNCHER = "/usr/lib/" + arch + "/qt5/bin/qmlscene" # TODO: fix version LOCAL_HTML_EXAMPLES_PATH = os.path.abspath("%s/%s" % (os.path.dirname(os.path.realpath(__file__)), '../../../../tests')) INSTALLED_HTML_EXAMPLES_PATH = '/usr/share/ubuntu-html5-ui-toolkit/tests/' APPS_SUBFOLDER_NAME = 'apps' BASE_PATH = '' def get_browser_container_path(self): if os.path.exists(self.BROWSER_CONTAINER_PATH): return self.BROWSER_CONTAINER_PATH return self.INSTALLED_BROWSER_CONTAINER_PATH def create_file_url_from(self, filepath): return 'file://' + filepath def setup_base_path(self): if os.path.exists(self.LOCAL_HTML_EXAMPLES_PATH): self.BASE_PATH = self.LOCAL_HTML_EXAMPLES_PATH else: self.BASE_PATH = self.INSTALLED_HTML_EXAMPLES_PATH def setUp(self): self.setup_base_path() if platform.model() == "Desktop": self.pointer = Pointer(Mouse.create()) else: self.pointer = Pointer(Touch.create()) params = [self.BROWSER_QML_APP_LAUNCHER, self.get_browser_container_path()] if (platform.model() <> 'Desktop'): params.append('--desktop_file_hint=/usr/share/applications/unitywebappsqmllauncher.desktop') self.app = self.launch_test_application( *params, app_type='qt') self.webviewContainer = self.get_webviewContainer() self.watcher = self.webviewContainer.watch_signal('resultUpdated(QString)') super(UbuntuHTML5TestCaseBase, self).setUp() def tearDown(self): super(UbuntuHTML5TestCaseBase, self).tearDown() def pick_app_launcher(self, app_path): # force Qt app introspection: from autopilot.introspection.qt import QtApplicationLauncher return QtApplicationLauncher() def get_webviewContainer(self): return self.app.select_single(objectName="webviewContainer") def get_webview(self): return self.app.select_single(objectName="webview") def get_addressbar(self): return self.app.select_single(objectName="addressbar") def get_button(self): return self.app.select_single(objectName="browseButton") def get_title(self): return self.get_webview().title def assert_url_eventually_loaded(self, url): webview = self.get_webview() self.assertThat(webview.loadProgress, Eventually(Equals(100))) self.assertThat(webview.loading, Eventually(Equals(False))) self.assertThat(webview.url, Eventually(Equals(url))) def click_dom_node_with_id(self, id): webview = self.get_webviewContainer() webview.slots.clickElementById(id) self.assertThat(lambda: self.watcher.num_emissions, Eventually(Equals(1))) def click_any_dom_node_by_selector(self, selector): webview = self.get_webviewContainer() webview.slots.clickAnyElementBySelector(selector) self.assertThat(lambda: self.watcher.num_emissions, Eventually(Equals(1))) def is_dom_node_visible(self, id): webview = self.get_webviewContainer() prev_emissions = self.watcher.num_emissions webview.slots.isNodeWithIdVisible(id) self.assertThat(lambda: self.watcher.num_emissions, Eventually(GreaterThan(prev_emissions))) return json.loads(webview.get_signal_emissions('resultUpdated(QString)')[-1][0])['result'] def eval_expression_in_page_unsafe(self, expr): webview = self.get_webviewContainer() prev_emissions = self.watcher.num_emissions webview.slots.evalInPageUnsafe(expr) self.assertThat(lambda: self.watcher.num_emissions, Eventually(GreaterThan(prev_emissions))) return json.loads(webview.get_signal_emissions('resultUpdated(QString)')[-1][0])['result'] def get_dom_node_id_attribute(self, id, attribute): webview = self.get_webviewContainer() prev_emissions = self.watcher.num_emissions webview.slots.getAttributeForElementWithId(id, attribute) self.assertThat(lambda: self.watcher.num_emissions, Eventually(GreaterThan(prev_emissions))) return json.loads(webview.get_signal_emissions('resultUpdated(QString)')[-1][0])['result'] def get_address_bar_action_button(self): addressbar = self.get_addressbar() return addressbar.select_single(objectName="browseButton") def browse_to_url(self, url): import time addressbar = self.get_addressbar() self.assertThat(addressbar.activeFocus, Eventually(Equals(True))) self.keyboard.type(url, 0.001) self.pointer.click_object(self.get_webview()) time.sleep(1) button = self.get_address_bar_action_button(); self.pointer.move_to_object(button) self.pointer.press() time.sleep(1) self.pointer.release() self.assert_url_eventually_loaded(url); def browse_to_app(self, appname): appfilepath = os.path.abspath(self.BASE_PATH + '/data/html/' + self.APPS_SUBFOLDER_NAME + '/' + appname + '/index.html') APP_HTML_PATH = self.create_file_url_from(appfilepath) self.browse_to_url(APP_HTML_PATH) def browse_to_test_html(self, html_filename): self.browse_to_url(self.create_file_url_from(os.path.abspath(self.BASE_PATH + '/data/html/' + html_filename))) class UbuntuThemeWithHttpServerTestCaseBase(UbuntuHTML5TestCaseBase): def setUp(self): self.server = UbuntuHTML5HTTPServer(HTTP_SERVER_PORT) self.server.start() super(UbuntuThemeWithHttpServerTestCaseBase, self).setUp() def tearDown(self): super(UbuntuThemeWithHttpServerTestCaseBase, self).tearDown() self.server.shutdown() class UbuntuThemeRemotePageTestCaseBase(UbuntuThemeWithHttpServerTestCaseBase): def setUp(self): super(UbuntuThemeRemotePageTestCaseBase, self).setUp() ././@LongLink0000000000000000000000000000015000000000000011211 Lustar 00000000000000ubuntu-html5-theme-0.1.2+14.04.20140404/tests/autopilot/ubuntu_html5_ui_toolkit/tests/test_pagestack.pyubuntu-html5-theme-0.1.2+14.04.20140404/tests/autopilot/ubuntu_html5_ui_toolkit/tests/test_pagestack0000644000015301777760000000600212317536560033732 0ustar pbusernogroup00000000000000# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- # Copyright 2013 Canonical # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License version 3, as published # by the Free Software Foundation. from __future__ import absolute_import import time from testtools.matchers import Contains, Equals from autopilot.matchers import Eventually from ubuntu_html5_ui_toolkit.tests import UbuntuHTML5TestCaseBase, UbuntuThemeRemotePageTestCaseBase class UbuntuThemePageStackTestCase(UbuntuHTML5TestCaseBase): def setUp(self): super(UbuntuThemePageStackTestCase, self).setUp() def test_pageLoadsWithNoPageStacks(self): self.browse_to_test_html('test-nopagestack-in-app.html') self.assertThat(self.eval_expression_in_page_unsafe('var UI = new UbuntuUI(); UI.init(); return "ok";'), Equals('ok')); def test_pageLoadsWithPageStacks(self): self.browse_to_test_html('test-pagestack-in-app.html') self.assertThat(self.eval_expression_in_page_unsafe('var UI = new UbuntuUI(); UI.init(); return "ok";'), Equals('ok')); self.assertThat(self.is_dom_node_visible('main'), Equals(True)) def test_pageChangeWithPageStackPush(self): self.browse_to_test_html('test-pagestack-in-app.html') self.assertThat(self.eval_expression_in_page_unsafe('var UI = new UbuntuUI(); UI.init(); UI.pagestack.push("results"); return "ok";'), Equals('ok')); self.assertThat(self.is_dom_node_visible('main'), Equals(False)) self.assertThat(self.is_dom_node_visible('results'), Equals(True)) def test_pageChangeWithPageStackPopped(self): self.browse_to_test_html('test-pagestack-in-app.html') self.assertThat(self.eval_expression_in_page_unsafe('var UI = new UbuntuUI(); UI.init(); UI.pagestack.push("main"); UI.pagestack.push("results"); UI.pagestack.push("article"); UI.pagestack.pop(); return "ok";'), Equals('ok')); self.assertThat(self.is_dom_node_visible('main'), Equals(False)) self.assertThat(self.is_dom_node_visible('results'), Equals(True)) self.assertThat(self.is_dom_node_visible('article'), Equals(False)) def test_pagePushWithProperties(self): self.browse_to_test_html('test-pagestack-in-app.html') expression = """ var ui = new UbuntuUI(); ui.init(); ui.pagestack.push('main'); (new Page('results')).onactivated( function(properties) { document.getElementById('results').innerHTML = JSON.stringify(properties); }); ui.pagestack.push('results', 'WORKS'); return 'ok'; """ self.assertThat(self.eval_expression_in_page_unsafe(expression), Equals('ok')); self.assertThat(lambda: self.is_dom_node_visible('results'), Eventually(Equals(True))) results_html_content = "return document.getElementById('results').innerHTML;" self.assertThat(self.eval_expression_in_page_unsafe(results_html_content), Equals('"WORKS"')); ././@LongLink0000000000000000000000000000015100000000000011212 Lustar 00000000000000ubuntu-html5-theme-0.1.2+14.04.20140404/tests/autopilot/ubuntu_html5_ui_toolkit/tests/test_rss_reader.pyubuntu-html5-theme-0.1.2+14.04.20140404/tests/autopilot/ubuntu_html5_ui_toolkit/tests/test_rss_reade0000644000015301777760000000263212317536560033744 0ustar pbusernogroup00000000000000# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- # Copyright 2013 Canonical # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License version 3, as published # by the Free Software Foundation. from __future__ import absolute_import import time from testtools.matchers import Contains, Equals from autopilot.matchers import Eventually from ubuntu_html5_ui_toolkit.tests import UbuntuHTML5TestCaseBase, UbuntuThemeRemotePageTestCaseBase class UbuntuThemeRSSReaderTestCase(UbuntuHTML5TestCaseBase): def setUp(self): super(UbuntuThemeRSSReaderTestCase, self).setUp() self.browse_to_app('rss-reader') def test_appDoesLoads(self): self.assertThat(self.get_title(), Contains("RSS Mobile Reader")) def test_initialState(self): self.assertThat(self.is_dom_node_visible('main'), Equals(True)) self.assertThat(self.is_dom_node_visible('article'), Equals(False)) self.assertThat(self.is_dom_node_visible('results'), Equals(False)) def test_switchToFeedView(self): self.click_any_dom_node_by_selector('#yourfeeds li a') self.assertThat(lambda: self.is_dom_node_visible('main'), Eventually(Equals(False))) self.assertThat(self.is_dom_node_visible('article'), Equals(False)) self.assertThat(self.is_dom_node_visible('results'), Equals(True)) ubuntu-html5-theme-0.1.2+14.04.20140404/tests/autopilot/ubuntu_html5_ui_toolkit/tests/test_tabs.py0000644000015301777760000000247412317536560033361 0ustar pbusernogroup00000000000000# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- # Copyright 2014 Canonical # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License version 3, as published # by the Free Software Foundation. from __future__ import absolute_import import time from testtools.matchers import Contains, Equals from autopilot.matchers import Eventually from ubuntu_html5_ui_toolkit.tests import UbuntuHTML5TestCaseBase class UbuntuUIToolkitTabsTestCase(UbuntuHTML5TestCaseBase): def setUp(self): super(UbuntuUIToolkitTabsTestCase, self).setUp() def test_programaticTabSelectIndex(self): self.browse_to_test_html('test-tabs-in-app.html') self.assertThat(self.eval_expression_in_page_unsafe('var UI = new UbuntuUI(); UI.init(); UI.tabs.selectedTabIndex = 1; return "ok";'), Equals('ok')); self.assertThat(lambda: self.is_dom_node_visible('tab1'), Eventually(Equals(False))) self.assertThat(lambda: self.is_dom_node_visible('tab2'), Eventually(Equals(True))) self.assertThat(lambda: self.is_dom_node_visible('tab3'), Eventually(Equals(False))) self.assertThat(self.eval_expression_in_page_unsafe('var UI = new UbuntuUI(); UI.init(); return UI.tabs.selectedTabIndex = 1;'), Equals(1)); ubuntu-html5-theme-0.1.2+14.04.20140404/tests/autopilot/ubuntu_html5_ui_toolkit/__init__.py0000644000015301777760000000053312317536560031760 0ustar pbusernogroup00000000000000# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- # Copyright 2013 Canonical # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License version 3, as published # by the Free Software Foundation. """Tests for the Ubuntu HTML5 UI SDK package """ ubuntu-html5-theme-0.1.2+14.04.20140404/tests/autopilot/ubuntu_html5_ui_toolkit/emulators/0000755000015301777760000000000012317537133031656 5ustar pbusernogroup00000000000000././@LongLink0000000000000000000000000000014600000000000011216 Lustar 00000000000000ubuntu-html5-theme-0.1.2+14.04.20140404/tests/autopilot/ubuntu_html5_ui_toolkit/emulators/__init__.pyubuntu-html5-theme-0.1.2+14.04.20140404/tests/autopilot/ubuntu_html5_ui_toolkit/emulators/__init__.p0000644000015301777760000000053412317536560033603 0ustar pbusernogroup00000000000000# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- # Copyright 2013 Canonical # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License version 3, as published # by the Free Software Foundation. """Tests for the Ubuntu HTML5 UI SDK package """ ubuntu-html5-theme-0.1.2+14.04.20140404/tests/data/0000755000015301777760000000000012317537133021637 5ustar pbusernogroup00000000000000ubuntu-html5-theme-0.1.2+14.04.20140404/tests/data/html/0000755000015301777760000000000012317537133022603 5ustar pbusernogroup00000000000000ubuntu-html5-theme-0.1.2+14.04.20140404/tests/data/html/test-tabs-in-app.html0000644000015301777760000000547612317536560026600 0ustar pbusernogroup00000000000000 Ubuntu UI HTML5: Application Template
  • Tab 1
  • Tab 2
  • Tab 3
ubuntu-html5-theme-0.1.2+14.04.20140404/tests/data/html/apps/0000755000015301777760000000000012317537133023546 5ustar pbusernogroup00000000000000ubuntu-html5-theme-0.1.2+14.04.20140404/tests/data/html/apps/rss-reader/0000755000015301777760000000000012317537133025615 5ustar pbusernogroup00000000000000ubuntu-html5-theme-0.1.2+14.04.20140404/tests/data/html/apps/rss-reader/styles.css0000644000015301777760000000211512317536560027654 0ustar pbusernogroup00000000000000/* * Copyright (C) 2013 Adnane Belmadiaf * License granted by Canonical Limited * * This file is part of ubuntu-html5-ui-toolkit. * * This package is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 3 of the * License, or * (at your option) any later version. * This package 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 Lesser General Public * License along with this program. If not, see * . */ #articleinfo { padding: 10px; -webkit-box-sizing: border-box; box-sizing: border-box; } #articleinfo iframe { max-width: 100%; } #articleinfo p { margin: 7px 0; } #articleinfo a{ text-decoration: none; color: #787878; font-weight: bold; }ubuntu-html5-theme-0.1.2+14.04.20140404/tests/data/html/apps/rss-reader/index.html0000644000015301777760000001042212317536560027614 0ustar pbusernogroup00000000000000 RSS Mobile Reader - Ubuntu UI Example
  • RSS Mobile Reader
  • RSS Feed
  • Article

Add a new feed

Type the url feed you want to add

ubuntu-html5-theme-0.1.2+14.04.20140404/tests/data/html/apps/rss-reader/app.js0000644000015301777760000001052712317536560026743 0ustar pbusernogroup00000000000000/* * Copyright (C) 2013 Adnane Belmadiaf * License granted by Canonical Limited * * This file is part of ubuntu-html5-ui-toolkit. * * This package is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 3 of the * License, or * (at your option) any later version. * This package 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 Lesser General Public * License along with this program. If not, see * */ var UI = new UbuntuUI(); $(document).ready(function () { UI.init(); UI.pagestack.push("main"); if (typeof localStorage["feeds"] == "undefined") { restoreDefault(); } //load local storage feeds var feeds = eval(localStorage["feeds"]); if (feeds !== null) { var feeds_list = UI.list('#yourfeeds'); feeds_list.removeAllItems(); feeds_list.setHeader('My feeds'); for (var i = 0; i < feeds.length; i++) { feeds_list.append(feeds[i], null, null, function (target, thisfeed) { console.log('load'); loadFeed(thisfeed); }, feeds[i]); } } UI.button('yes').click(function (e) { var url = $("#rssFeed").val(); if (url === "") { if (!$("#addfeeddialog section").hasClass("shake")) { $("#addfeeddialog section").addClass("shake"); } else { $('#addfeeddialog section').css('animation-name', 'none'); $('#addfeeddialog section').css('-moz-animation-name', 'none'); $('#addfeeddialog section').css('-webkit-animation-name', 'none'); setTimeout(function () { $('#addfeeddialog section').css('-webkit-animation-name', 'shake'); }, 0); } } else { var feeds = eval(localStorage["feeds"]); feeds.push(url); localStorage.setItem("feeds", JSON.stringify(feeds)); window.location.reload(); } }); UI.button('addfeed').click(function () { $('#addfeeddialog').show(); }); UI.button('no').click(function () { $('#addfeeddialog').hide(); }); }); //FUNCS function restoreDefault() { localStorage.clear(); var feeds = []; feeds.push("http://daker.me/feed.xml"); feeds.push("http://www.omgubuntu.co.uk/feed"); feeds.push("http://hespress.com/feed/index.rss"); feeds.push("http://rss.slashdot.org/Slashdot/slashdot"); feeds.push("http://www.reddit.com/.rss"); try { localStorage.setItem("feeds", JSON.stringify(feeds)); window.location.reload(); } catch (e) { if (e == QUOTA_EXCEEDED_ERR) { console.log("Error: Local Storage limit exceeds."); } else { console.log("Error: Saving to local storage."); } } } function loadFeed(url) { UI.pagestack.push("results"); UI.dialog("loading").show(); var feed = new google.feeds.Feed(url); feed.setNumEntries(30); feed.load(function (result) { if (!result.error) { UI.dialog("loading").hide(); var results_list = UI.list('#resultscontent'); console.log(results_list); results_list.removeAllItems(); results_list.setHeader(result.feed.title); for (var i = 0; i < result.feed.entries.length; i++) { results_list.append(result.feed.entries[i].title.replace(/"/g, "'"), null, null, function (target, result_infos) { showArticle.apply(null, result_infos); }, [escape(result.feed.entries[i].title), escape(result.feed.entries[i].link), escape(result.feed.entries[i].content)] ); } } else alert('feed error'); }); } function showArticle(title, url, desc) { UI.pagestack.push("article"); if (typeof desc == "undefined") desc = "(No description provided)"; $("#articleinfo").html("

" + unescape(title) + "

" + unescape(desc) + "

" + unescape(url) + "

"); } google.load("feeds", "1"); ubuntu-html5-theme-0.1.2+14.04.20140404/tests/data/html/test-pagestack-in-app.html0000644000015301777760000000746112317536560027605 0ustar pbusernogroup00000000000000 Ubuntu UI HTML5: Application Template
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
ubuntu-html5-theme-0.1.2+14.04.20140404/tests/data/html/test-nopagestack-in-app.html0000644000015301777760000000625012317536560030135 0ustar pbusernogroup00000000000000 Ubuntu UI HTML5: Application Template
  • RSS Mobile Reader
  • RSS Feed
  • Article
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
ubuntu-html5-theme-0.1.2+14.04.20140404/tests/CMakeLists.txt0000644000015301777760000000021112317536560023463 0ustar pbusernogroup00000000000000add_subdirectory(autopilot) install(DIRECTORY data DESTINATION ${CMAKE_INSTALL_DATADIR}/ubuntu-html5-ui-toolkit/tests ) ubuntu-html5-theme-0.1.2+14.04.20140404/0.1/0000755000015301777760000000000012317537133020062 5ustar pbusernogroup00000000000000ubuntu-html5-theme-0.1.2+14.04.20140404/0.1/ambiance/0000755000015301777760000000000012317537133021621 5ustar pbusernogroup00000000000000ubuntu-html5-theme-0.1.2+14.04.20140404/0.1/ambiance/js/0000755000015301777760000000000012317537133022235 5ustar pbusernogroup00000000000000ubuntu-html5-theme-0.1.2+14.04.20140404/0.1/ambiance/js/tab.js0000644000015301777760000001063112317536560023345 0ustar pbusernogroup00000000000000/* * Copyright (C) 2014 Canonical Ltd * * This file is part of ubuntu-html5-ui-toolkit. * * This package is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 3 of the * License, or * (at your option) any later version. * This package 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 Lesser General Public * License along with this program. If not, see * . */ /** * One of the navigation pattern that can be used within an Ubuntu App is the flat navigation. Tabs are the standard way to provide such a navigation pattern from within your application. A Tab represents the UI element that hosts your tab content. This UI element is being activated by the user selecting it as part of the Header element. * @class Tab * @constructor * @namespace UbuntuUI * @example
  • Main
  • Two
[...]
[...]
JavaScript access: var tab = UI.tab("tabID"); */ var Tab = function (id) { this.id = id; }; Tab.prototype = { /** * Returns the DOM element associated with the selector this widget is bind to. * @method element * @return {DOMElement} * @example var mytab = UI.tab("tabid").element(); */ element: function () { return document.getElementById(this.id); }, /** * Deactivates the current tab. * @method {} deactivate */ deactivate: function () { this.__updateVisibleState('none', function(footer) { if (!footer) return; footer.style.display = 'none'; footer.classList.remove('revealed'); }); }, /** * Activates the current tab. * @method {} activate */ activate: function (id) { this.__hideVisibleSibling(); this.__updateVisibleState('block', function(footer) { if (!footer) return; footer.style.display = 'block'; footer.classList.add('revealed'); }); }, /** * Validates that a given DOM node element is a Ubuntu UI Tab. * @method {DOM Element} isTab * @return {Boolean} if the DOM element is a tab */ isTab: function (element) { return element.tagName.toLowerCase() === 'div' && element.hasAttribute('data-role') && element.getAttribute('data-role') === 'tab'; }, /** * @private */ __updateVisibleState: function(displayStyle, footerHandlerFunc) { if (!this.__isValidId(this.id)) return; var tab = document.getElementById(this.id); if (!this.isTab(tab)) { return; } tab.style.display = displayStyle; if (tab.querySelector(this.__thisSelector + ' > footer')) { var footer = tab.querySelector('footer'); footerHandlerFunc(footer); } }, /** * @private */ __hideVisibleSibling: function() { if (!this.__isValidId(this.id)) return; var tab = document.getElementById(this.id); if (!this.isTab(tab)) { return; } var children = tab.parentNode.children; for (var idx = 0; idx < children.length; ++idx) { if (this.isTab(children[idx])) { children[idx].style.display = 'none'; } } }, /** * @private */ __isValidId: function (id) { return id && typeof(id) === 'string'; }, /** * @private */ get __thisSelector () { return "#" + this.id; } }; ubuntu-html5-theme-0.1.2+14.04.20140404/0.1/ambiance/js/progress.js0000644000015301777760000000615312317536560024447 0ustar pbusernogroup00000000000000/* * Copyright (C) 2013 Adnane Belmadiaf * License granted by Canonical Limited * * This file is part of ubuntu-html5-ui-toolkit. * * This package is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 3 of the * License, or * (at your option) any later version. * This package 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 Lesser General Public * License along with this program. If not, see * . */ /** * A Progress. Note the Ubuntu CSS style classes: infinite * @class Progress * @constructor * @namespace UbuntuUI * @example Javascript access: var pre = UI.progrss("progressID"); */ var Progress = (function () { function Progress(id) { this.id = id; this.max = 1; this.ele = this.element(); this.__setupMessage(); } Progress.prototype = { /** * Returns the DOM element associated with the id this widget is bind to. * @method element * @example var myprogress = UI.progress("progressid").element(); */ element: function() { if(document.getElementById(this.id)) { return document.getElementById(this.id); } }, /** * Updates the value of the progress bar * @method update * @example myprogress.update(30); */ update: function(value) { if(value != null && this.__IsNumeric(value)) { this.ele.value = value; this.__updateMessage(value); }else{ console.error('Progress bar value element is NaN - ID:', this.id); } }, /** * @private */ __setupMessage: function() { if(this.ele) { if(this.ele.getAttribute("max") && this.__IsNumeric(this.ele.getAttribute("max"))) { this.max = this.ele.getAttribute("max"); }else{ console.error('Progress bar max element is NaN - ID:', this.id); } if(this.ele.getAttribute("value")) { this.update(this.ele.getAttribute("value")); } }else{ console.error('Progress bar missing - ID:', this.id); } }, /** * @private */ __updateMessage: function(value) { this.ele.setAttribute('data-percentage', Math.max(0, Math.min(100, Math.floor((100 / this.max) * value))) + '%'); }, /** * @private */ __IsNumeric: function(n) { return !isNaN(parseFloat(n)) && isFinite(n); }, }; return Progress; })(); ubuntu-html5-theme-0.1.2+14.04.20140404/0.1/ambiance/js/popovers.js0000644000015301777760000001761112317536560024461 0ustar pbusernogroup00000000000000/* * Copyright (C) 2013 Adnane Belmadiaf * License granted by Canonical Limited * * This file is part of ubuntu-html5-ui-toolkit. * * This package is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 3 of the * License, or * (at your option) any later version. * This package 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 Lesser General Public * License along with this program. If not, see * . */ /** * A Popover is a div containng markup that can pop up and disappear. (Unlike a Dialog, Popovers are not full screen.) A Popoves often contain a List whose items are connected to useful JavaScript functions. ######Popover Position The Popover's position is set relative to a specified base element with the data-gravity="LETTER" attribute. LETTER values: - 'n': the base element is above the Popover - 's': the base element is below the Popover - 'e': the base element is to the east of (to the right of) the Popover (in right-to-left locales) - 'w': the base element is to the west of (to the left of) the Popover (in right-to-left locale) * @class Popover * @constructor * @namespace UbuntuUI * @param {String} elem - The element to which the Popover's position is relative * @param {ID} id - The id attribute of the Popover in HTML * @example

Text

Javascript: var popBase = document.getElementByID("popoverBase"); var popover = UI.popover(popBase, "popover"); */ var Popover = function (elem, id) { this.id = id; this.popover = document.getElementById(id); this.elem = elem; this.parent = elem.parentNode.parentNode.parentNode.parentNode; this.is_parent_footer = (this.parent.nodeName.toLowerCase() === "footer"); }; Popover.prototype = { /** * Display a Popover * @method show */ show: function () { if (this.popover === null) { console.error('The popover with the ID #' + this.id + ' doesn\'t exist'); return; } var de = document.documentElement, w = (de&&de.clientWidth) || document.body.clientWidth, ot = 0, ol = 0, gravity = "s", pos_top = 0, pos_left = 0, pos_right = 0; this.popover.classList.add('active'); popoverWidth = this.popover.offsetWidth; popoverHeight = this.popover.offsetHeight; gravity = this.popover.getAttribute("data-gravity"); if (this.is_parent_footer) { ot = this.parent.offsetTop; ol = this.elem.offsetLeft; } else { ot = this.elem.offsetTop; ol = this.elem.offsetLeft; } switch (gravity) { case 'n': pos_top = this.elem.offsetTop + this.elem.offsetHeight + 10; pos_left = this.elem.offsetLeft + this.elem.offsetWidth / 2 - popoverWidth / 2; break; case 's': if (this.is_parent_footer) { pos_top = ot - popoverHeight - 90; pos_left = ol + this.elem.offsetWidth / 2 - popoverWidth / 2; if (pos_left < 0) pos_left = 5; else { if (pos_left + popoverWidth > w) { pos_left = -1; pos_right = 5; } } } else { pos_top = ot - popoverHeight - 10; pos_left = ol + this.elem.offsetWidth / 2 - popoverWidth / 2; } break; case 'e': pos_top = this.elem.offsetTop + this.elem.offsetHeight / 2 - popoverHeight / 2; pos_left = this.elem.offsetLeft - popoverWidth - 10; break; case 'w': pos_top = this.elem.offsetTop + this.elem.offsetHeight / 2 - popoverHeight / 2; pos_left = this.elem.offsetLeft + this.elem.offsetWidth + 10; break; } this.popover.style.top = pos_top + 'px'; if (pos_left === -1) { this.popover.style.left = 'auto'; this.popover.style.right = pos_right+ 'px'; } else this.popover.style.left = pos_left+ 'px'; return this.popover; }, /** * Hide a Popover * @method hide */ hide: function () { this.popover.classList.remove('active'); this.popover.style.top = '0px'; this.popover.style.left = '0px'; return this.popover; }, /** * Toggle show/hide status of a Popover * @method toggle */ toggle: function () { if (this.popover === null) { console.error('The popover with the ID #' + this.id + ' doesn\'t exist'); return; } var de = document.documentElement, w = (de&&de.clientWidth) || document.body.clientWidth, ot = 0, ol = 0, gravity = "s", pos_top = 0, pos_left = 0, pos_right = 0; this.popover.classList.toggle('active'); popoverWidth = this.popover.offsetWidth; popoverHeight = this.popover.offsetHeight; gravity = this.popover.getAttribute("data-gravity"); if (this.is_parent_footer) { ot = this.parent.offsetTop; ol = this.elem.offsetLeft; } else { ot = this.elem.offsetTop; ol = this.elem.offsetLeft; } switch (gravity) { case 'n': pos_top = ot + this.elem.offsetHeight + 10; pos_left = ol + this.elem.offsetWidth / 2 - popoverWidth / 2; break; case 's': if (this.is_parent_footer) { pos_top = ot - popoverHeight - 90; pos_left = ol + this.elem.offsetWidth / 2 - popoverWidth / 2; if (pos_left < 0) pos_left = 5; else { if (pos_left + popoverWidth > w) { pos_left = -1; pos_right = 5; } } } else { pos_top = ot - popoverHeight - 10; pos_left = ol + this.elem.offsetWidth / 2 - popoverWidth / 2; } break; case 'e': pos_top = ot + this.elem.offsetHeight / 2 - popoverHeight / 2; pos_left = ol - popoverWidth - 10; break; case 'w': pos_top = ot + this.elem.offsetHeight / 2 - popoverHeight / 2; pos_left = ol + this.elem.offsetWidth + 10; break; } this.popover.style.top = pos_top + 'px'; if (pos_left === -1) { this.popover.style.left = 'auto'; this.popover.style.right = pos_right+ 'px'; } else this.popover.style.left = pos_left+ 'px'; return this.popover; }, /** * Returns the DOM element associated with the id this widget is bind to. * @method element * @example var mypopover = UI.popover("popoverid").element(); */ element: function () { return this.popover; } }; ubuntu-html5-theme-0.1.2+14.04.20140404/0.1/ambiance/js/header.js0000644000015301777760000000550112317536560024027 0ustar pbusernogroup00000000000000/* * Copyright (C) 2013 Adnane Belmadiaf * License granted by Canonical Limited * * This file is part of ubuntu-html5-ui-toolkit. * * This package is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 3 of the * License, or * (at your option) any later version. * This package 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 Lesser General Public * License along with this program. If not, see * . */ /** * An Ubuntu Header wraps the general Tabs definitions and interaction in the case of a Tab navigation pattern or is used to display the title of the current page when using a PageStack navigation pattern. In the case of a Tab navigation pattern, declare the Header and its Tabs in HTML as a direct child of the top level MainView as a sibling to the content div. In the case of a PageStack navigation pattern, the Ubuntu Header HTML element should be present and can be left empty. It will be automatically updated to hold the Title of the current Page being visited. The value of such a title is taken from the data-title attribute of the currently visited Page as it is being pushed at the top of the stack (see PageStack.push()). ######Contained list provides Page navigation A contained unordered list has list items, each of which has "data-page" data attribute whose value of a Page ID that it targets. Clicking the Header/Tabs allows the user to navigate to the Pages identified by these IDs. * @class Header * @constructor * @namespace UbuntuUI * @example
  • Main
  • Two
[...]
[...]
JavaScript access: var header = UI.header("headerID"); */ var Header= function (id) { this.id = id; }; Header.prototype = { /** * Returns the DOM element associated with the id this widget is bind to. * @method element * @return {DOMElement} * @example var myheader = UI.header("headerid").element(); */ element: function () { return document.getElementById(this.id); } }; ubuntu-html5-theme-0.1.2+14.04.20140404/0.1/ambiance/js/DOCSREADME.txt0000644000015301777760000000072012317536616024410 0ustar pbusernogroup00000000000000The docs build systems is yudocjs. Info: http://yui.github.io/yuidoc/syntax/ Yuidocjs is installed via npm, globally: # install npm sudo apt-get install npm nodejs-legacy # use npm to install yuidocjs globally sudo npm -g install yuidocjs # get ubuntu-html5-theme source branch bzr branch lp:ubuntu-html5-theme # move to the js dir cd ubuntu-html5-theme/0.1/ambiance/js # generate the docs from source ./yuidoc-build.sh # docs are in new ./docsbuild/ dir ubuntu-html5-theme-0.1.2+14.04.20140404/0.1/ambiance/js/yuidoc-theme/0000755000015301777760000000000012317537133024631 5ustar pbusernogroup00000000000000ubuntu-html5-theme-0.1.2+14.04.20140404/0.1/ambiance/js/yuidoc-theme/layouts/0000755000015301777760000000000012317537133026331 5ustar pbusernogroup00000000000000ubuntu-html5-theme-0.1.2+14.04.20140404/0.1/ambiance/js/yuidoc-theme/layouts/main.handlebars0000644000015301777760000000227612317536560031314 0ustar pbusernogroup00000000000000 {{htmlTitle}}
API Docs for: {{projectVersion}}
{{>layout_content}}
ubuntu-html5-theme-0.1.2+14.04.20140404/0.1/ambiance/js/yuidoc-theme/assets/0000755000015301777760000000000012317537133026133 5ustar pbusernogroup00000000000000ubuntu-html5-theme-0.1.2+14.04.20140404/0.1/ambiance/js/yuidoc-theme/assets/js/0000755000015301777760000000000012317537133026547 5ustar pbusernogroup00000000000000ubuntu-html5-theme-0.1.2+14.04.20140404/0.1/ambiance/js/yuidoc-theme/assets/js/yui-prettify.js0000644000015301777760000000377512317536560031576 0ustar pbusernogroup00000000000000/* * Copyright 2011 Yahoo! Inc. * All rights reserved. *- * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of the Yahoo! Inc. nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. *- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL YAHOO! INC. BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ YUI().use('node', function(Y) { var code = Y.all('.prettyprint.linenums'); if (code.size()) { code.each(function(c) { var lis = c.all('ol li'), l = 1; lis.each(function(n) { n.prepend(''); l++; }); }); var h = location.hash; location.hash = ''; h = h.replace('LINE_', 'LINENUM_'); location.hash = h; } }); ubuntu-html5-theme-0.1.2+14.04.20140404/0.1/ambiance/js/yuidoc-theme/assets/js/tabs.js0000644000015301777760000000537412317536560030052 0ustar pbusernogroup00000000000000/* * Copyright 2011 Yahoo! Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of the Yahoo! Inc. nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL YAHOO! INC. BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ YUI({ insertBefore: 'site_styles' }).use('tabview', function(Y) { var classdocs = Y.one('#classdocs'), tabviewIndexTable = {}; if (classdocs) { if (classdocs.all('li').size()) { var tabview = new Y.TabView({ srcNode: classdocs }); tabview.render(); classdocs.all('li a').each(function (item, index) { var hash = item.get(['hash']); type = hash.substring(1); if (!tabviewIndexTable[type]) { tabviewIndexTable[type] = index; } }) Y.all('.sidebox.on-page').each(function (item, index) { var children = item.all('li a'); children.each(function (cItem, cIndex) { return function () { var handleClick = function (e) { var node = Y.one(this), hash = node.get(['hash']), hashValue = hash.substring(1).split('_'), type = hashValue.shift(), ogKey = hashValue.join('_'); // in case the hash had other underscores if (tabviewIndexTable[type] > -1 && tabviewIndexTable[type] !== currentTab) { currentTab = tabviewIndexTable[type]; tabview.selectChild(tabviewIndexTable[type]); } } Y.on('click', handleClick, cItem) }() }) }); } } }); ubuntu-html5-theme-0.1.2+14.04.20140404/0.1/ambiance/js/yuidoc-theme/assets/vendor/0000755000015301777760000000000012317537133027430 5ustar pbusernogroup00000000000000ubuntu-html5-theme-0.1.2+14.04.20140404/0.1/ambiance/js/yuidoc-theme/assets/vendor/prettify/0000755000015301777760000000000012317537133031276 5ustar pbusernogroup00000000000000././@LongLink0000000000000000000000000000015400000000000011215 Lustar 00000000000000ubuntu-html5-theme-0.1.2+14.04.20140404/0.1/ambiance/js/yuidoc-theme/assets/vendor/prettify/prettify-min.jsubuntu-html5-theme-0.1.2+14.04.20140404/0.1/ambiance/js/yuidoc-theme/assets/vendor/prettify/prettify0000644000015301777760000004564712317536560033112 0ustar pbusernogroup00000000000000/* * Copyright 2011 Yahoo! Inc. * All rights reserved. *- * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of the Yahoo! Inc. nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. *- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL YAHOO! INC. BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;atau[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); ././@LongLink0000000000000000000000000000015100000000000011212 Lustar 00000000000000ubuntu-html5-theme-0.1.2+14.04.20140404/0.1/ambiance/js/yuidoc-theme/assets/vendor/prettify/CHANGES.htmlubuntu-html5-theme-0.1.2+14.04.20140404/0.1/ambiance/js/yuidoc-theme/assets/vendor/prettify/CHANGES.0000644000015301777760000001370412317536560032357 0ustar pbusernogroup00000000000000 Change Log README

Known Issues

  • Perl formatting is really crappy. Partly because the author is lazy and partly because Perl is hard to parse.
  • On some browsers, <code> elements with newlines in the text which use CSS to specify white-space:pre will have the newlines improperly stripped if the element is not attached to the document at the time the stripping is done. Also, on IE 6, all newlines will be stripped from <code> elements because of the way IE6 produces innerHTML. Workaround: use <pre> for code with newlines.

Change Log

29 March 2007

  • Added tests for PHP support to address issue 3.
  • Fixed bug: prettyPrintOne was not halting. This was not reachable through the normal entry point.
  • Fixed bug: recursing into a script block or PHP tag that was not properly closed would not silently drop the content. (test)
  • Fixed bug: was eating tabs (test)
  • Fixed entity handling so that the caveat

    Caveats: please properly escape less-thans. x&lt;y instead of x<y, and use " instead of &quot; for string delimiters.

    is no longer applicable.
  • Added noisefree's C# patch
  • Added a distribution that has comments and whitespace removed to reduce download size from 45.5kB to 12.8kB.

4 Jul 2008

  • Added language specific formatters that are triggered by the presence of a lang-<language-file-extension>
  • Fixed bug: python handling of '''string'''
  • Fixed bug: / in regex [charsets] should not end regex

5 Jul 2008

  • Defined language extensions for Lisp and Lua

14 Jul 2008

  • Language handlers for F#, OCAML, SQL
  • Support for nocode spans to allow embedding of line numbers and code annotations which should not be styled or otherwise affect the tokenization of prettified code. See the issue 22 testcase.

6 Jan 2009

  • Language handlers for Visual Basic, Haskell, CSS, and WikiText
  • Added .mxml extension to the markup style handler for Flex MXML files. See issue 37.
  • Added .m extension to the C style handler so that Objective C source files properly highlight. See issue 58.
  • Changed HTML lexer to use the same embedded source mechanism as the wiki language handler, and changed to use the registered CSS handler for STYLE element content.

21 May 2009

  • Rewrote to improve performance on large files. See benchmarks.
  • Fixed bugs with highlighting of Haskell line comments, Lisp number literals, Lua strings, C preprocessor directives, newlines in Wiki code on Windows, and newlines in IE6.

14 August 2009

  • Fixed prettifying of <code> blocks with embedded newlines.

3 October 2009

  • Fixed prettifying of XML/HTML tags that contain uppercase letters.

19 July 2010

  • Added support for line numbers. Bug 22
  • Added YAML support. Bug 123
  • Added VHDL support courtesy Le Poussin.
  • IE performance improvements. Bug 102 courtesy jacobly.
  • A variety of markup formatting fixes courtesy smain and thezbyg.
  • Fixed copy and paste in IE[678].
  • Changed output to use &#160; instead of &nbsp; so that the output works when embedded in XML. Bug 108.
././@LongLink0000000000000000000000000000015500000000000011216 Lustar 00000000000000ubuntu-html5-theme-0.1.2+14.04.20140404/0.1/ambiance/js/yuidoc-theme/assets/vendor/prettify/prettify-min.cssubuntu-html5-theme-0.1.2+14.04.20140404/0.1/ambiance/js/yuidoc-theme/assets/vendor/prettify/prettify0000644000015301777760000000124312317536560033072 0ustar pbusernogroup00000000000000.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee}ubuntu-html5-theme-0.1.2+14.04.20140404/0.1/ambiance/js/yuidoc-theme/assets/vendor/prettify/COPYING0000644000015301777760000002613612317536560032344 0ustar pbusernogroup00000000000000 Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ././@LongLink0000000000000000000000000000015000000000000011211 Lustar 00000000000000ubuntu-html5-theme-0.1.2+14.04.20140404/0.1/ambiance/js/yuidoc-theme/assets/vendor/prettify/README.htmlubuntu-html5-theme-0.1.2+14.04.20140404/0.1/ambiance/js/yuidoc-theme/assets/vendor/prettify/README.h0000644000015301777760000001735012317536560032415 0ustar pbusernogroup00000000000000 Javascript code prettifier Languages : CH

Javascript code prettifier

Setup

  1. Download a distribution
  2. Include the script and stylesheets in your document (you will need to make sure the css and js file are on your server, and adjust the paths in the script and link tag)
    <link href="prettify.css" type="text/css" rel="stylesheet" />
    <script type="text/javascript" src="prettify.js"></script>
  3. Add onload="prettyPrint()" to your document's body tag.
  4. Modify the stylesheet to get the coloring you prefer

Usage

Put code snippets in <pre class="prettyprint">...</pre> or <code class="prettyprint">...</code> and it will automatically be pretty printed.
The original Prettier
class Voila {
public:
  // Voila
  static const string VOILA = "Voila";

  // will not interfere with embedded tags.
}
class Voila {
public:
  // Voila
  static const string VOILA = "Voila";

  // will not interfere with embedded tags.
}

FAQ

Which languages does it work for?

The comments in prettify.js are authoritative but the lexer should work on a number of languages including C and friends, Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. It works passably on Ruby, PHP, VB, and Awk and a decent subset of Perl and Ruby, but, because of commenting conventions, doesn't work on Smalltalk, or CAML-like languages.

LISPy languages are supported via an extension: lang-lisp.js.

And similarly for CSS, Haskell, Lua, OCAML, SML, F#, Visual Basic, SQL, Protocol Buffers, and WikiText..

If you'd like to add an extension for your favorite language, please look at src/lang-lisp.js and file an issue including your language extension, and a testcase.

How do I specify which language my code is in?

You don't need to specify the language since prettyprint() will guess. You can specify a language by specifying the language extension along with the prettyprint class like so:

<pre class="prettyprint lang-html">
  The lang-* class specifies the language file extensions.
  File extensions supported by default include
    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html",
    "java", "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh",
    "xhtml", "xml", "xsl".
</pre>

It doesn't work on <obfuscated code sample>?

Yes. Prettifying obfuscated code is like putting lipstick on a pig — i.e. outside the scope of this tool.

Which browsers does it work with?

It's been tested with IE 6, Firefox 1.5 & 2, and Safari 2.0.4. Look at the test page to see if it works in your browser.

What's changed?

See the change log

Why doesn't Prettyprinting of strings work on WordPress?

Apparently wordpress does "smart quoting" which changes close quotes. This causes end quotes to not match up with open quotes.

This breaks prettifying as well as copying and pasting of code samples. See WordPress's help center for info on how to stop smart quoting of code snippets.

How do I put line numbers in my code?

You can use the linenums class to turn on line numbering. If your code doesn't start at line number 1, you can add a colon and a line number to the end of that class as in linenums:52.

For example

<pre class="prettyprint linenums:4"
>// This is line 4.
foo();
bar();
baz();
boo();
far();
faz();
<pre>
produces
// This is line 4.
foo();
bar();
baz();
boo();
far();
faz();

How do I prevent a portion of markup from being marked as code?

You can use the nocode class to identify a span of markup that is not code.

<pre class=prettyprint>
int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
  Continuation of comment */
int y = bar();
</pre>
produces
int x = foo();  /* This is a comment  This is not code
  Continuation of comment */
int y = bar();

For a more complete example see the issue22 testcase.

I get an error message "a is not a function" or "opt_whenDone is not a function"

If you are calling prettyPrint via an event handler, wrap it in a function. Instead of doing

addEventListener('load', prettyPrint, false);
wrap it in a closure like
addEventListener('load', function (event) { prettyPrint() }, false);
so that the browser does not pass an event object to prettyPrint which will confuse it.


ubuntu-html5-theme-0.1.2+14.04.20140404/0.1/ambiance/js/yuidoc-theme/assets/css/0000755000015301777760000000000012317537133026723 5ustar pbusernogroup00000000000000ubuntu-html5-theme-0.1.2+14.04.20140404/0.1/ambiance/js/yuidoc-theme/assets/css/external-small.png0000644000015301777760000000075312317536560032371 0ustar pbusernogroup00000000000000‰PNG  IHDRóÿatEXtSoftwareAdobe ImageReadyqÉe<IDATxÚbüÿÿ?%€‰B@±,0†]ÂVVV0æååaffæýÈŠÞ=8§JÄ«ÈàóçO ÿþy %ÊùpJ¹¼üջߴ•¹Â+ïÚ30ˆàö¿ÿ‚ÿþ}ˆÿs±þ¼ÿáÃù˜Ê‹`Ín|dxóæ ¦m Xaƒ ­ |ïȹWÿý¿pãí¿ìÿAÀ+c˜Êÿ‡©‡a¸¾|ù¢Íuî=zϰpý-†õ“l\w0üý÷ŸÁ1nûC yœ±ðÿ? þòáé‹Ï •É* Yõ‡rÃ%þÿcfxüâ»Ã¿ Ž8 `gçãÿÿþ2ȉ³0œºøž!ÖG†A[EˆáõV66¾ïï­>€Ó€Ç'˸¹Eô—]€AOCŠAY^’áæ#.°ø“S• ïï­Â>¿>#þññ¶‰ £ "üúÿïÃOvöå%€¼w@ü ÙFX^`ddäR|8Ü …òw ú¿X º™ ÀµàÃOÏÆ“IEND®B`‚ubuntu-html5-theme-0.1.2+14.04.20140404/0.1/ambiance/js/yuidoc-theme/assets/css/main.css0000644000015301777760000002421212317536560030365 0ustar pbusernogroup00000000000000/* Font sizes for all selectors other than the body are given in percentages, with 100% equal to 13px. To calculate a font size percentage, multiply the desired size in pixels by 7.6923076923. Here's a quick lookup table: 10px - 76.923% 11px - 84.615% 12px - 92.308% 13px - 100% 14px - 107.692% 15px - 115.385% 16px - 123.077% 17px - 130.769% 18px - 138.462% 19px - 146.154% 20px - 153.846% */ html { background: #fff; color: #333; overflow-y: scroll; } body { font: 13px/1.4 'Lucida Grande', 'Lucida Sans Unicode', 'DejaVu Sans', 'Bitstream Vera Sans', 'Helvetica', 'Arial', sans-serif; margin: 0; padding: 0; } /* -- Links ----------------------------------------------------------------- */ a { color: #DD4814; text-decoration: none; } a:hover { text-decoration: underline; } /* "Jump to Table of Contents" link is shown to assistive tools, but hidden from sight until it's focused. */ .jump { position: absolute; padding: 3px 6px; left: -99999px; top: 0; } .jump:focus { left: 40%; } /* -- Paragraphs ------------------------------------------------------------ */ p { margin: 1.3em 0; } dd p, td p { margin-bottom: 0; } dd p:first-child, td p:first-child { margin-top: 0; } /* -- Headings -------------------------------------------------------------- */ h1, h2, h3, h4, h5, h6 { color: #DD4814 font-family: 'Ubuntu', sans-serif; font-weight: bold; line-height: 1.1; margin: 1.1em 0 0.5em; } h1 { font-size: 184.6%; color: #30418C; margin: 0.75em 0 0.5em; } h2 { font-size: 153.846%; color: #E48A2B; } h3 { font-size: 138.462%; } h4 { border-bottom: 1px solid #DBDFEA; color: #E48A2B; font-size: 115.385%; font-weight: normal; padding-bottom: 2px; } h5, h6 { font-size: 107.692%; } /* -- Code and examples ----------------------------------------------------- */ code, kbd, pre, samp { font-family: Menlo, Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; font-size: 92.308%; line-height: 1.35; } p code, p kbd, p samp { background: #FCFBFA; border: 1px solid #EFEEED; padding: 0 3px; } a code, a kbd, a samp, pre code, pre kbd, pre samp, table code, table kbd, table samp, .intro code, .intro kbd, .intro samp, .toc code, .toc kbd, .toc samp { background: none; border: none; padding: 0; } pre.code, pre.terminal, pre.cmd { overflow-x: auto; *overflow-x: scroll; padding: 0.3em 0.6em; } pre.code { background: #FCFBFA; border: 1px solid #EFEEED; border-left-width: 5px; } pre.terminal, pre.cmd { background: #F0EFFC; border: 1px solid #D0CBFB; border-left: 5px solid #D0CBFB; } /* Don't reduce the font size of // elements inside
   blocks. */
pre code, pre kbd, pre samp { font-size: 100%; }

/* Used to denote text that shouldn't be selectable, such as line numbers or
   shell prompts. Guess which browser this doesn't work in. */
.noselect {
    -moz-user-select: -moz-none;
    -khtml-user-select: none;
    -webkit-user-select: none;
    -o-user-select: none;
    user-select: none;
}

/* -- Lists ----------------------------------------------------------------- */
dd { margin: 0.2em 0 0.7em 1em; }
dl { margin: 1em 0; }
dt { font-weight: bold; }

/* -- Tables ---------------------------------------------------------------- */
caption, th { text-align: left; }

table {
    border-collapse: collapse;
    width: 100%;
}

td, th {
    border: 1px solid #fff;
    padding: 5px 12px;
    vertical-align: top;
}

td { background: #E6E9F5; }
td dl { margin: 0; }
td dl dl { margin: 1em 0; }
td pre:first-child { margin-top: 0; }

th {
    background: #D2D7E6;/*#97A0BF*/
    border-bottom: none;
    border-top: none;
    color: #000;/*#FFF1D5*/
    font-family: 'Trebuchet MS', sans-serif;
    font-weight: bold;
    line-height: 1.3;
    white-space: nowrap;
}


/* -- Layout and Content ---------------------------------------------------- */
#doc {
    margin: auto;
    min-width: 1024px;
}

#main { width: 754px; }
#sidebar { width: 270px; margin: 0 15px; }

.content { padding: 0 20px 0 25px; }

/* -- Sidebar --------------------------------------------------------------- */
.sidebox {
    background: #F9F9FC;/*E6E9F5*/
    border: 1px solid #D4D8EB;

    -moz-border-radius: 4px;
    -webkit-border-radius: 4px;
    border-radius: 4px;
    -moz-box-shadow: 0 0 6px rgba(0, 0, 0, 0.15);
    -webkit-box-shadow: 0 0 6px rgba(0, 0, 0, 0.15);
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.15);
    font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', 'Helvetica', 'Arial', sans-serif;
    margin: 0 0 15px 0;
    padding-bottom: 1px;
}

.sidebox h2 {
    background: #E5E6F1;
    -moz-border-radius: 4px 4px 0 0;
    -webkit-border-radius: 4px 4px 0 0;
    border-radius: 4px 4px 0 0;
    color: #5E6BA4;
    font-weight: bold;
    font-size: 107.692%;
    margin: 0;
    padding: 4px 7px 5px;
}

.sidebox .bd {
    font-size: 84.615%;
    padding: 0 5px 0 8px;
}

.sidebox li { list-style-type: disc; color:#D4D5E3; }

.sidebox ol, .sidebox ul {
    margin-left: 0;
    padding-left: 16px;
}

.sidebox ol ol, .sidebox ol ul,
.sidebox ul ol, .sidebox ul ul {
    margin: 0;
    padding-left: 16px;
}

/* -- Table of Contents ----------------------------------------------------- */

/* The #toc id refers to the single global table of contents, while the .toc
   class refers to generic TOC lists that could be used throughout the page. */

.toc code, .toc kbd, .toc samp { font-size: 100%; }
.toc li { font-weight: bold; }
.toc li li { font-weight: normal; }

/* -- Intro and Example Boxes ----------------------------------------------- */
.intro, .example { margin-bottom: 2em; }

.example {
    -moz-border-radius: 4px;
    -webkit-border-radius: 4px;
    border-radius: 4px;
    -moz-box-shadow: 0 0 5px #bfbfbf;
    -webkit-box-shadow: 0 0 5px #bfbfbf;
    box-shadow: 0 0 5px #bfbfbf;
    padding: 1em;
}

.intro {
    background: none repeat scroll 0 0 #F0F1F8; border: 1px solid #D4D8EB; padding: 0 1em;
}

/* -- Other Styles ---------------------------------------------------------- */

/* These are probably YUI-specific, and should be moved out of Selleck's default
   theme. */

.button {
    border: 1px solid #dadada;
    -moz-border-radius: 3px;
    -webkit-border-radius: 3px;
    border-radius: 3px;
    color: #444;
    display: inline-block;
    font-family: Helvetica, Arial, sans-serif;
    font-size: 92.308%;
    font-weight: bold;
    padding: 4px 13px 3px;
    -moz-text-shadow: 1px 1px 0 #fff;
    -webkit-text-shadow: 1px 1px 0 #fff;
    text-shadow: 1px 1px 0 #fff;
    white-space: nowrap;

    background: #EFEFEF; /* old browsers */
    background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
}

.button:hover {
    border-color: #466899;
    color: #fff;
    text-decoration: none;
    -moz-text-shadow: 1px 1px 0 #222;
    -webkit-text-shadow: 1px 1px 0 #222;
    text-shadow: 1px 1px 0 #222;

    background: #6396D8; /* old browsers */
    background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
}

.newwindow { text-align: center; }

.header .version em {
    display: block;
    text-align: right;
}

.yui3-skin-sam #classdocs .yui3-tabview-panel {
    background-color: transparent;
}

.yui3-skin-sam #classdocs .yui3-tabview-panel {
    border: none;
}

.yui3-skin-sam .yui3-tabview .yui3-tab,
.yui3-skin-sam .yui3-tabview .yui3-tab-selected,
.yui3-skin-sam .yui3-tabview .yui3-tab-hover {
    background: -moz-linear-gradient(center top , #F4F0EC 0%, #D6D2CE 100%) repeat scroll 0 0 transparent;
    border-bottom: 1px solid #DEDCD9;
    border-right: 1px solid #CDCBC8;
    border-left: 1px solid #CDCBC8;
    border-top: 1px solid #DADADA;
    color: #333333;
    text-decoration: none;
}
.yui3-skin-sam .yui3-tabview .yui3-tab-label,
.yui3-skin-sam .yui3-tabview .yui3-tab-selected .yui3-tab-label {
    border: none;
    background: none;
    font-size: 100%;
    color: #000;
}

.yui3-skin-sam .yui3-tabview .yui3-tab-selected,
.yui3-skin-sam .yui3-tabview .yui3-tab-hover {
    background: none;
    background-color: #fff;
    border-bottom-color: #FFFFFF;
    border-top: 2px solid #8193C9;
    font-weight: bold;
    color: #000;

}

.yui3-skin-sam .yui3-tabview-list {
    border-color: #DFDFDF;
    border-width: 0 0 1px; 
}


a.external {
    background-image: url(external-small.png);
    background-repeat: no-repeat;
    background-position: 0 0;
    padding-left: 16px;
}

#classdocs .item {
    border-bottom: 1px solid #466899;
    margin: 1em 0;
    padding: 1.5em;
}

#classdocs .item .params p,
    #classdocs .item .returns p,{
    display: inline;
}

#classdocs .item em code, #classdocs .item em.comment {
    color: green;
}

#classdocs .item em.comment a {
    color: green;
    text-decoration: underline;
}

#classdocs .foundat {
    font-size: 11px;
    font-style: normal;
}

.attrs .emits {
    margin-left: 2em;
    padding: .5em;
    border-left: 1px dashed #ccc;
}

abbr {
    border-bottom: 1px dashed #ccc;
    font-size: 80%;
    cursor: help;
}

.prettyprint li.L0, 
.prettyprint li.L1, 
.prettyprint li.L2, 
.prettyprint li.L3, 
.prettyprint li.L5, 
.prettyprint li.L6, 
.prettyprint li.L7, 
.prettyprint li.L8 {
    list-style: decimal;
}

ul li p {
    margin-top: 0;
}

.method .name {
    font-size: 110%;
}

#hd {
    background: -moz-linear-gradient(center top , #DCDBD9 0%, #F6F5F3 100%) repeat scroll 0 0 transparent;
    border-bottom: 1px solid #DFDFDF;
    padding: 0 15px 1px 20px;
    margin-bottom: 15px;
}

#hd img {
    margin-right: 10px;
    vertical-align: middle;
}

ubuntu-html5-theme-0.1.2+14.04.20140404/0.1/ambiance/js/yuidoc-theme/assets/css/logo.png0000644000015301777760000000135512317536560030400 0ustar  pbusernogroup00000000000000‰PNG


IHDR¤=2ø9PLTEöÑÄ÷ÑÄævOá_1ßS#ýôðôƶêlòº§ì˜{è]ûèâãj@ð¯˜ùÝÓÿÿÿÝHÙ9Þ	pHYsšœtIMEÝ
&	fEúGIDAThÞíØév« àeQ†÷Ø;,.i]®	9µ=Ü	Qüˆþã”ÏxÿBHB’„$$!	IÈ¿‚TobHÙ
É<ˆw…,¦o‚Ä–Þ!FÝ™!Œ˜ŸCÚŽ±ƒ±N#ÍʈƒnÉp(÷íÐ…ã2rS¤Êè!‡÷D‚‹Ò¥Ç²KŠ›"ûŠ4"\FZÎí—[êÓ ™«ÉBpÎãc({Î0¡‚ŸB¤ç¹à`–Ï\J˜‡?à™á^õ
a)ºtŸu˜.YC¶:hˆ5âa4JhÒÄéÇnˆîúÄ9FÖlqŒ¬Êc䔂¢|"í »^•eLË]¤Žz²™ZD.jY’9c› kW]ž{H>ŸêëÄùŽL™²,‹LµAŠ¥JŸ!ûzü2Šü@{}ƒqŒ´%>D*(á)29…zf«vŒ0v'Èxùä¦÷Y„|©~2Íܾ¤¢ËHÞ¹ºIÈ”ÛdY.ÄÒ¬‘º$ØFH[îÕ62MîT%a¾æ>’—œº$XÕ™®ï‡m¤ÐSæUhiKºÂY.kUdY­î§ps6#Èæ+Ù¼V`ñ»HU2zÄ/©[Y¤
«ýÌ·]P·îÊT¶‘ù&çê”[o‹^|ƒ¡€§±­ß—u–ëÇžl §ÖåáçÂÐà5î²±Øe]6U¸Ç¶EÞu‹º©Äá‚<…*5d§úÁ¥úÿÿ+BoÕIHB’„$$!	ùJùnÉ’îÇÅ‘IEND®B`‚ubuntu-html5-theme-0.1.2+14.04.20140404/0.1/ambiance/js/yuidoc-theme/partials/0000755000015301777760000000000012317537133026450 5ustar  pbusernogroup00000000000000ubuntu-html5-theme-0.1.2+14.04.20140404/0.1/ambiance/js/yuidoc-theme/partials/props.handlebars0000644000015301777760000000062712317536560031650 0ustar  pbusernogroup00000000000000
`{{name}}` <{{#crossLink type}}{{/crossLink}}>{{#if final}} (final){{/if}}{{#if static}} (static){{/if}}
`{{file}}:{{line}}` {{{propertyDescription}}} {{#if example}}
Example
{{{example}}} {{/if}}
ubuntu-html5-theme-0.1.2+14.04.20140404/0.1/ambiance/js/yuidoc-theme/partials/module.handlebars0000644000015301777760000000155012317536560031766 0ustar pbusernogroup00000000000000

{{moduleName}}

{{{moduleDescription}}}
{{#if moduleClasses}}

This module has the following classes:

{{/if}}
{{#if subModules}}

This module has the following submodules:

{{/if}}


Module description found: `{{file}}:{{line}}` ubuntu-html5-theme-0.1.2+14.04.20140404/0.1/ambiance/js/yuidoc-theme/partials/method.handlebars0000644000015301777760000000423412317536560031763 0ustar pbusernogroup00000000000000
{{#if final}}final {{/if}}{{#if returnType}}{{#crossLink returnType}}{{/crossLink}} {{/if}}`{{name}}`( `{{paramsList}} ` ) {{#if access}}`/* {{access}} method */`{{/if}}
{{#if overwritten_from}} Defined in {{overwritten_from/class}} but overwritten locally: {{else}} {{#if extended_from}} Defined in {{extended_from}}: {{/if}} {{/if}} `{{file}}:{{line}}`
{{{methodDescription}}} {{#if params}} Parameters:
    {{#params}}
  • {{#if optional}} `[{{name}}{{#if optdefault}}={{optdefault}}{{/if}}]` <{{#crossLink type}}{{/crossLink}}> {{else}} `{{name}}` <{{#crossLink type}}{{/crossLink}}> {{/if}} {{#if multiple}} (*..n) {{/if}} {{{description}}} {{#if props}}
      {{#props}}
    • `{{name}}` <{{#crossLink type}}{{/crossLink}}> {{{description}}} {{#if props}}
        {{#props}}
      • `{{name}}` <{{#crossLink type}}{{/crossLink}}> {{{description}}}
      • {{/props}}
      {{/if}}
    • {{/props}}
    {{/if}}
  • {{/params}}
{{/if}} {{#if return}} {{#return}}
Returns: {{#if type}}<{{#crossLink type}}{{/crossLink}}> {{/if}}{{{description}}}
{{/return}} {{/if}} {{#if example}}
Example
{{{example}}} {{/if}}
ubuntu-html5-theme-0.1.2+14.04.20140404/0.1/ambiance/js/yuidoc-theme/partials/index.handlebars0000644000015301777760000000756012317536616031621 0ustar pbusernogroup00000000000000

Welcome to Ubuntu HTML5 API Docs version 0.1

These pages provide reference docs for the Ubunbtu HTML5 framework.

See developer.ubuntu.com for more information on writing Ubuntu HTML5 apps, including: using the Ubuntu SDK, creating HTML5 app projects, importing Ubuntu HTML5 CSS and JavaScript into your app, and more.

Ubuntu HTML5 widgets

The Ubuntun HTML5 framework provides a set of "widgets" you use to build an application in the Ubuntu style (see design.ubuntu.com for descriptions of Ubuntu app "building blocks" with links to APIs for each supported implementation toolkit). For example, an Ubuntu HTML5 app has a dynamic Header with Tabs that together provide navigation through the app's Pages. Pages may contain Lists, Popovers, Buttons, Shapes, and a lot more. The app has a Footer (also called a Toolbar) to which you can add Buttons. There are many options and the list keeps growing!

Each widget has its HTML part, a corresponding JavaScript object (many of which provide additional methods), and CSS styles.

What you need to know

To write Ubuntu HTML5 apps, you need to know:

  • How to declare each widget type in HTML
  • How to acces the JavaScript widget objects and use their methods
  • How to initialize the Ubuntu HTML5 framework at app load time

These topics are introduced here and explained in the class documentation.

Elements and special attributes

Ubuntu HTML5 apps use normal HTML/HTML5 elements (like <div>, <section>, <ul>, and so on). However, special attributes are added to some key elements to declare them as Ubuntu HTML5 elements. This connects them with the Ubuntu HTML5 JavaScript framework. The data-role attribute is often used. Its value indicates the type of Ubuntu HTML5 element. For example, here's a button: <button data-role="button">.

Making correct HTML declarations is necessary to connect your DOM elements to the Ubuntu HTML5 JavaScript framework and to Ubuntu HTML CSS styles. See the JavaScript class docs for sample HTML declarations.

id attributes

You can declare most Ubuntu HTML5 elements without id attributes. They will pick up the CSS styles and look fine. But, you generally need an id attribute to access the corresponding JavaScript objects. So it's a good idea to add them.

JavaScript classes and methods

Almost every Ubuntu HTML5 DOM element has a corresponding Ubuntu HTML5 JavaScript object. These are created automatically when you create an UbuntuUI object and execute its init() method. (This is usually done at startup, for example in the window.onload function).

Many of these classes/objects have additional methods. For example, the List class provides methods to add items to the list, remove an item, apply a function to all items, and more.

How these docs are organized

These pages or organized by the Ubuntu HTML5 JavaScript classes. Each class has an example showing how the corresponding HTML is declared (as needed). And of course each class has API documentation explaining usage of all (public) methods.

The single most important class is UbuntuUI, so start there.

Then, an Ubuntu HTML5 app is structured as a PageStack of Pages, so be sure to visit those classes.

Ubuntu HTML5 CSS

Be sure to check out the Ubuntu HTML5 CSS files you import into your app. They provide a set of styles that theme the HTML5 widgets to the Ubuntu app design and style.

Let's grow this!

Let's work together to keep HTML5 as a top-notch app development framework on Ubuntu. Everyone can help by filing bugs, triaging them, and of course, fixing them. So let's get to work writing apps!

ubuntu-html5-theme-0.1.2+14.04.20140404/0.1/ambiance/js/yuidoc-theme/partials/attrs.handlebars0000644000015301777760000000257512317536560031646 0ustar pbusernogroup00000000000000
`{{name}}` {{#if type}}<{{#crossLink type}}{{/crossLink}}>{{/if}} {{#if extended_from}}`/* Extended from {{extended_from}} */`{{/if}} {{#if overwritten_from}}`/* Overwritten from {{name}} */`{{/if}}
`{{file}}:{{line}}` {{{attrDescription}}} {{#if emit}}
Fires: `{{name}}Change(e)`

Fires when the value for the configuration attribute `{{name}}` is changed. You can listen for the event using the `on` method if you wish to be notified before the attribute's value has changed, or using the `after` method if you wish to be notified after the attribute's value has changed.

Parameters:
`e` <EventFacade> An Event Facade object with the following attribute specific properties added:
  • `prevVal` The value of the attribute, prior to it being set
  • `newVal` The value the attribute is to be set to
  • `attrName` The name of the attribute being set
  • `subAttrName` If setting a property within the attribute's value, the name of the sub-attribute property being set
{{/if}}
ubuntu-html5-theme-0.1.2+14.04.20140404/0.1/ambiance/js/yuidoc-theme/partials/files.handlebars0000644000015301777760000000012412317536560031577 0ustar pbusernogroup00000000000000

{{fileName}}

{{fileData}}
ubuntu-html5-theme-0.1.2+14.04.20140404/0.1/ambiance/js/yuidoc-theme/partials/events.handlebars0000644000015301777760000000234412317536560032007 0ustar pbusernogroup00000000000000
`{{name}}` {{#if type}}<{{#crossLink type}}{{/crossLink}}>{{/if}} {{#if extended_from}}`/* Extended from {{extended_from}} */`{{/if}} {{#if overwritten_from}}`/* Overwritten from {{name}} */`{{/if}}
`{{file}}:{{line}}` {{{eventDescription}}} {{#if params}} Extra event object properties:
    {{#params}}
  • {{#if optional}} `[{{name}}{{#if optdefault}}={{optdefault}}{{/if}}]` <{{#crossLink type}}{{/crossLink}}> {{else}} `{{name}}` <{{#crossLink type}}{{/crossLink}}> {{/if}} {{#if multiple}} (*..n) {{/if}} {{{description}}} {{#if props}}
      {{#props}}
    • `{{name}}` <{{#crossLink type}}{{/crossLink}}> {{{description}}} {{/props}}
    {{/if}}
  • {{/params}}
{{/if}}
ubuntu-html5-theme-0.1.2+14.04.20140404/0.1/ambiance/js/yuidoc-theme/partials/classes.handlebars0000644000015301777760000000324112317536560032135 0ustar pbusernogroup00000000000000

Class {{moduleName}}

{{#if uses}} Uses: {{#each uses}} {{this}} {{/each}}
{{/if}} {{#if extension_for}} Extension For: {{#each extension_for}} {{this}} {{/each}}
{{/if}} {{#if extends}} Extends: {{#crossLink extends}}{{/crossLink}}
{{/if}} Class defined in: `{{file}}:{{line}}`
{{{classDescription}}}
{{#if is_constructor}} {{#is_constructor}} {{>method}} {{/is_constructor}} {{/if}}
{{#if methods}}
{{#methods}} {{>method}} {{/methods}}
{{/if}} {{#if properties}}
{{#properties}} {{>props}} {{/properties}}
{{/if}} {{#if attrs}}
{{#attrs}} {{>attrs}} {{/attrs}}
{{/if}} {{#if events}}
{{#events}} {{>events}} {{/events}}
{{/if}}
ubuntu-html5-theme-0.1.2+14.04.20140404/0.1/ambiance/js/yuidoc-theme/partials/sidebar.handlebars0000644000015301777760000000474212317536560032120 0ustar pbusernogroup00000000000000 {{#if methods}} {{/if}} {{#if events}} {{/if}} {{#if props}} {{/if}} {{#if attributes}} {{/if}} {{#if fileTree}} {{/if}} ubuntu-html5-theme-0.1.2+14.04.20140404/0.1/ambiance/js/yuidoc-theme/theme.json0000644000015301777760000000025512317536560026633 0ustar pbusernogroup00000000000000{ "yuiGridsUrl": "http://yui.yahooapis.com/3.8.0pr2/build/cssgrids/cssgrids-min.css", "yuiSeedUrl": "http://yui.yahooapis.com/combo?3.8.0pr2/build/yui/yui-min.js" } ubuntu-html5-theme-0.1.2+14.04.20140404/0.1/ambiance/js/option-selector.js0000644000015301777760000001533412317536560025732 0ustar pbusernogroup00000000000000/* * Copyright (C) 2013 Adnane Belmadiaf * License granted by Canonical Limited * * This file is part of ubuntu-html5-ui-toolkit. * * This package is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 3 of the * License, or * (at your option) any later version. * This package 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 Lesser General Public * License along with this program. If not, see * */ /** * OptionSelector is a component displaying either a single selected value or expanded multiple choice with an optional image and subtext when not expanded, when expanding it opens a listing of all the possible values for selection with an additional option of always being expanded. If multiple choice is selected the list is expanded automatically. * @class OptionSelector * @constructor * @namespace UbuntuUI * @example
  • Label 1

  • Label 2

  • Label 3

JavaScript: UI.optionselector.METHOD(); */ var OptionSelector = (function () { var __values = ""; function OptionSelector (id, expanded, multiSelection) { this.currentIndex = 0; this.currentlyExpanded = false; this.expanded = typeof expanded !== 'undefined' ? expanded : false; this.multiSelection = typeof multiSelection !== 'undefined' ? multiSelection : false; if (this.multiSelection) this.expanded = true; this.optionselector = document.getElementById(id); if (this.optionselector == null) { console.error('The OptionSelector with the ID #' + this.id + ' doesn\'t exist'); return; } this.optionselector_ul = this.optionselector.querySelectorAll('ul')[0]; if (this.optionselector_ul == null) return; if (this.optionselector_ul.length == 0) return; this.optionselector_ul_li = this.optionselector.querySelectorAll('li'); if (this.optionselector_ul == null) return; if (this.optionselector_ul_li.length == 0) return; [].forEach.call(this.optionselector_ul_li, function (elm) { elm.addEventListener('click', this.__onClicked.bind(this, elm), false); }.bind(this)); if (this.expanded) { this.__open(); this.optionselector_ul_li[0].classList.add('active'); } else { if (this.currentlyExpanded) { this.__open(); this.optionselector_ul_li[0].classList.add('active'); } else { this.__close(this.currentIndex); this.optionselector_ul_li[0].classList.add('closed'); } } } OptionSelector.prototype = { /** * @private */ __onClicked: function (elm, e) { __values = ""; this.currentIndex = 0; if (this.expanded) { if (!this.multiSelection) { [].forEach.call(this.optionselector_ul_li, function (elm) { elm.classList.remove('active'); }); elm.classList.toggle('active'); } else { elm.classList.toggle('active'); } } else { for(i = 0, max = this.optionselector_ul_li.length; i < max; i++) { if (this.optionselector_ul_li[i]==elm) break; this.currentIndex++; } if (this.currentlyExpanded) { this.__close(this.currentIndex); elm.classList.add('active'); elm.classList.add('closed'); elm.style.borderTop = '0'; } else { elm.classList.add('active'); elm.classList.remove('closed'); this.__open(); elm.style.borderTop = '1px solid #C7C7C7'; } } k = 0; for (i = 0, max = this.optionselector_ul_li.length; i < max; i++) { var li = this.optionselector_ul_li[i]; if ((li.className).indexOf('active') > -1) { if (k === 0) { __values = li.getAttribute("data-value"); } else { __values = __values + ", " + li.getAttribute("data-value"); } k++; } } if (!this.currentlyExpanded && !this.expanded) { this.__ClickEvent(elm); } else { if (this.expanded) { this.__ClickEvent(elm); } } e.preventDefault(); }, /** * @private */ __ClickEvent: function (elm) { elm._evt = document.createEvent('Event'); elm._evt.initEvent('onclicked', true, true); elm._evt.values = __values; elm.dispatchEvent(elm._evt); }, /** * @private */ __open: function () { this.optionselector_ul.style['-webkit-transition-duration'] = '.4s'; this.optionselector_ul.style.webkitTransform = 'translate3d(0, 0rem,0)'; this.optionselector.style.height = 3.07*this.optionselector_ul_li.length + 'rem'; this.currentlyExpanded = true; }, /** * @private */ __close: function (currentIndex) { this.optionselector_ul.style['-webkit-transition-duration'] = '.4s'; this.optionselector_ul.style.webkitTransform = 'translate3d(0,' + -3*currentIndex + 'rem,0)'; this.optionselector.style.height = '3rem'; [].forEach.call(this.optionselector_ul_li, function (elm) { elm.classList.remove('active'); }); this.currentlyExpanded = false; }, onClicked : function(callback){ this.optionselector_ul.addEventListener("onclicked", callback); } }; return OptionSelector; })(); ubuntu-html5-theme-0.1.2+14.04.20140404/0.1/ambiance/js/docslib.py0000755000015301777760000000222712317536616024241 0ustar pbusernogroup00000000000000#!/usr/bin/python3 # # Copyright 2014 Canonical Ltd # Authors: # Kyle Nitzsche # # 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, version 3 of the License. # # 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, see * License granted by Canonical Limited * * This file is part of ubuntu-html5-ui-toolkit. * * This package is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 3 of the * License, or * (at your option) any later version. * This package 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 Lesser General Public * License along with this program. If not, see * . */ (function () { /** * From: http://code.this.com/mobile/articles/fast_buttons.html * Also see: http://stackoverflow.com/questions/6300136/trying-to-implement-googles-fast-button */ /** For IE8 and earlier compatibility: https://developer.mozilla.org/en/DOM/element.addEventListener */ function addListener(el, type, listener, useCapture) { if (el.addEventListener) { el.addEventListener(type, listener, useCapture); return { destroy: function () { el.removeEventListener(type, listener, useCapture); } }; } else { // see: http://stackoverflow.com/questions/5198845/javascript-this-losing-context-in-ie var handler = function (e) { listener.handleEvent(window.event, listener); }; el.attachEvent('on' + type, handler); return { destroy: function () { el.detachEvent('on' + type, handler); } }; } } var isTouch = "ontouchstart" in window; /* Construct the FastButton with a reference to the element and click handler. */ this.FastButton = function (element, handler, useCapture) { // collect functions to call to cleanup events this.events = []; this.touchEvents = []; this.element = element; this.handler = handler; this.useCapture = useCapture; if (isTouch) this.events.push(addListener(element, 'touchstart', this, this.useCapture)); this.events.push(addListener(element, 'click', this, this.useCapture)); }; /* Remove event handling when no longer needed for this button */ this.FastButton.prototype.destroy = function () { for (var i = this.events.length - 1; i >= 0; i -= 1) this.events[i].destroy(); this.events = this.touchEvents = this.element = this.handler = this.fastButton = null; }; /* acts as an event dispatcher */ this.FastButton.prototype.handleEvent = function (event) { switch (event.type) { case 'touchstart': this.onTouchStart(event); break; case 'touchmove': this.onTouchMove(event); break; case 'touchend': this.onClick(event); break; case 'click': this.onClick(event); break; } }; /* Save a reference to the touchstart coordinate and start listening to touchmove and touchend events. Calling stopPropagation guarantees that other behaviors don’t get a chance to handle the same click event. This is executed at the beginning of touch. */ this.FastButton.prototype.onTouchStart = function (event) { event.stopPropagation ? event.stopPropagation() : (event.cancelBubble = true); this.touchEvents.push(addListener(this.element, 'touchend', this, this.useCapture)); this.touchEvents.push(addListener(document.body, 'touchmove', this, this.useCapture)); this.startX = event.touches[0].clientX; this.startY = event.touches[0].clientY; }; /* When /if touchmove event is invoked, check if the user has dragged past the threshold of 10px. */ this.FastButton.prototype.onTouchMove = function (event) { if (Math.abs(event.touches[0].clientX - this.startX) > 10 || Math.abs(event.touches[0].clientY - this.startY) > 10) { this.reset(); //if he did, then cancel the touch event } }; /* Invoke the actual click handler and prevent ghost clicks if this was a touchend event. */ this.FastButton.prototype.onClick = function (event) { event.stopPropagation ? event.stopPropagation() : (event.cancelBubble = true); this.reset(); // Use .call to call the method so that we have the correct "this": https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Function/call var result = this.handler.call(this.element, event); if (event.type == 'touchend') clickbuster.preventGhostClick(this.startX, this.startY); return result; }; this.FastButton.prototype.reset = function () { for (var i = this.touchEvents.length - 1; i >= 0; i -= 1) this.touchEvents[i].destroy(); this.touchEvents = []; }; this.clickbuster = function () {}; /* Call preventGhostClick to bust all click events that happen within 25px of the provided x, y coordinates in the next 2.5s. */ this.clickbuster.preventGhostClick = function (x, y) { clickbuster.coordinates.push(x, y); window.setTimeout(clickbuster.pop, 2500); }; this.clickbuster.pop = function () { clickbuster.coordinates.splice(0, 2); }; /* If we catch a click event inside the given radius and time threshold then we call stopPropagation and preventDefault. Calling preventDefault will stop links from being activated. */ this.clickbuster.onClick = function (event) { for (var i = 0; i < clickbuster.coordinates.length; i += 2) { var x = clickbuster.coordinates[i]; var y = clickbuster.coordinates[i + 1]; if (Math.abs(event.clientX - x) < 25 && Math.abs(event.clientY - y) < 25) { event.stopPropagation ? event.stopPropagation() : (event.cancelBubble = true); event.preventDefault ? event.preventDefault() : (event.returnValue = false); } } }; if (isTouch) { // Don't need to use our custom addListener function since we only bust clicks on touch devices document.addEventListener('click', clickbuster.onClick, true); clickbuster.coordinates = []; } })(this); ubuntu-html5-theme-0.1.2+14.04.20140404/0.1/ambiance/js/buttons.js0000644000015301777760000000376412317536560024306 0ustar pbusernogroup00000000000000/* * Copyright (C) 2013 Adnane Belmadiaf * License granted by Canonical Limited * * This file is part of ubuntu-html5-ui-toolkit. * * This package is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 3 of the * License, or * (at your option) any later version. * This package 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 Lesser General Public * License along with this program. If not, see * . */ /** * A Button. Note the Ubuntu CSS style classes: positive, information, secondary, and negative * @class Button * @constructor * @namespace UbuntuUI * @example Javascript access: var button = UI.button("buttonID"); */ var Button = function (id) { this.id = id; }; Button.prototype = { /** * Associate a function with the button's Click event * @method click * @param {Function} callback - The function to execute on click * @example UI.button("buttonid").click(function(){ console.log("clicked"); }); */ click: function (callback) { if ( ! document.getElementById(this.id)) { throw "Invalid button ID: " + String(this.id); } new FastButton(document.getElementById(this.id), callback); }, /** * Returns the DOM element associated with the id this widget is bind to. * @method element * @return {DOMElement} * @example var mybutton = UI.button("buttonid").element(); */ element: function() { return document.getElementById(this.id); } }; ubuntu-html5-theme-0.1.2+14.04.20140404/0.1/ambiance/js/pagestacks.js0000644000015301777760000001472412317536560024733 0ustar pbusernogroup00000000000000/* * Copyright (C) 2013 Adnane Belmadiaf * License granted by Canonical Limited * * This file is part of ubuntu-html5-ui-toolkit. * * This package is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 3 of the * License, or * (at your option) any later version. * This package 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 Lesser General Public * License along with this program. If not, see * . */ /** * The Pagestack manages all Pages in a stack data structure. Initially, the Pagestack contains no Pages. The push() method is normally executed on load to display the app starting page. UI.pagestack.push("pageID") The topmost Page on the Pagestack is always displayed. The Pagestack is declared as a direct child of the content div. #####Default application wide footer The Pagestack contains a default footer (represented in JavaScript as a Toolbar), even if you do not declare one in HTML. The footer has a single Back button. #####Customized application wide footer This application-wide footer can be customized (for example, you can add Buttons) by declaring a footer as a direct child of the pagestack div (see example). ######Page specific footers A page may declare a page-specific footer as a child element. * @class Pagestack * @namespace UbuntuUI * @constructor * @example
[...]
[...]
[...]
JavaScript: UI.pagestack.METHOD(); */ var Pagestack = (function () { function __safeCall(f, args, errorfunc) { if (typeof (f) !== 'function') return; try { f.apply(null, args); } catch (e) { if (errorfunc && typeof (errorfunc) === 'function') errorfunc(e) } }; function Pagestack(pagestack) { this._pages = []; this._pagestack = pagestack; }; Pagestack.prototype = { /** * Push a page to the top of this pagestack * @method push * @param {String} id - The id attribute of the page element to be pushed * @param {Object} properties - A list of properties passed down to the page that is to be activated */ push: function (id, properties) { try { __safeCall(this.__setAllPagesVisibility.bind(this), [false]); (new Page(id)).activate(properties); this._pages.push(id); this.__dispatchPageChanged(this.currentPage()); } catch (e) {} }, /** * Checks for zero pages in this pagestack * @method isEmpty * @return {Boolean} - True when this pagestack has no pages, else false */ isEmpty: function () { return this._pages.length === 0; }, /** * Gets the id attribute of the page element on top of this pagestack * @method currentPage * @return {PageID|Null} - The topmost page's id attribute, else null when there are no pages on this pagestack */ currentPage: function () { return this.isEmpty() ? null : this._pages[this._pages.length - 1]; }, /** * Gets the number of pages in this pagestack * @method depth * @return {Number} - The number of pages in this pagestack */ depth: function () { return this._pages.length; }, /** * Clears the whole page stack * @method clear */ clear: function () { if (this.isEmpty()) return; __safeCall(Page.prototype.deactivate.bind(new Page(this.currentPage())), []); this._pages = []; }, /** * Pops the current page off this pagestack, which causes the next page to become the top page and to display * @method pop */ pop: function () { if (this.isEmpty()) return; __safeCall(Page.prototype.deactivate.bind(new Page(this.currentPage())), []); this._pages.pop(); __safeCall(Page.prototype.activate.bind(new Page(this.currentPage())), []); this.__dispatchPageChanged(this.currentPage()); }, onPageChanged : function(callback){ this._pagestack.addEventListener("pagechanged", callback); }, /** * @private */ __setAllPagesVisibility: function (visible) { var visibility = visible ? "block" : "none"; var children = [].slice.call(this._pagestack.children); children.forEach(function(element) { var pageHelper = new Page(); if (pageHelper.isPage(element)) { el.style.display = visibility; // treat footers separately var footer = el.querySelector('footer'); if (footer) footer.style.display = visibility; } }); }, /** * @private */ __isPage: function (element) { return element.getAttribute('data-role') === 'page'; }, /** * @private */ __dispatchPageChanged: function (page) { var event = document.createEvent('Event'); event.initEvent('pagechanged',true,true); event.page = page; this._pagestack.dispatchEvent(event); }, }; return Pagestack; })(); ubuntu-html5-theme-0.1.2+14.04.20140404/0.1/ambiance/js/list.js0000644000015301777760000001535412317536560023561 0ustar pbusernogroup00000000000000/* * Copyright (C) 2013 Adnane Belmadiaf * License granted by Canonical Limited * * This file is part of ubuntu-html5-ui-toolkit. * * This package is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 3 of the * License, or * (at your option) any later version. * This package 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 Lesser General Public * License along with this program. If not, see * . */ /** * A List comes with various options, including: a header, main text (pushed left), an icon (pushed left), and a secondary label (pushed right). * @class List * @constructor * @namespace UbuntuUI * @example
My header text
JavaScript access: var list = UI.list('[id="testlist"]'); */ var List = (function () { var LIST_DATA_ROLE = 'list'; var __addUlIfNotFound = function (list) { if (list) { var uls = list.querySelectorAll('ul'); if (uls == null || uls.length == 0) { var ul = document.createElement('ul'); list.appendChild(ul); } } }; var List = function (selector) { var list = document.querySelector(selector); if (list == null || list.nodeName.toLowerCase() !== 'section' || list.getAttribute('data-role') != LIST_DATA_ROLE) { throw new Error('Element with selector "' + selector + '" does not exist or not declared as a "list"
'); } this._selector = selector; this._list = list; __addUlIfNotFound(this._list); }; List.prototype = { /** * Add or Set the List Header * @method setHeader * @param {String} text - The header text */ setHeader: function (text) { if (typeof (text) == 'string') { var header = this._list.querySelectorAll('header'); if (header) { if (header.length > 1) { // more than one
detected throw new Error("More than one
tag detected"); } if (header.length == 1) header = header[0]; else header = null; } if (!header) header = document.createElement('header'); header.innerText = text; } }, /** * Append an item to a list * @method append * @param {String} text - The main text, flushed left (no markup) * @param {[String]} label - Additional text, flushed right (no markup) * @param {[ID]} id - An id attribute value set for the new list item (must be unique in DOM) * @param {[Function]} onclick - The click callback function * @param {[Object*]} user_data - Additional data that is passed to the click callback * @return {Element} - The created list item, or null on failure ot create */ append: function (text, label, id, onclick, user_data) { var li = document.createElement('li'); var a = document.createElement('a'); a.setAttribute('href', '#'); if (onclick && typeof (onclick) == 'function') { li.addEventListener('click', function (event) { onclick(event ? event.target : null, user_data); if (event) event.preventDefault(); }); } //FIXME: no real checks on text content a.innerText = text; li.appendChild(a); if (label && typeof (label) == 'string') { var n = document.createElement('label'); n.innerText = label; li.appendChild(n); } if (id && typeof (id) == 'string') { if (!document.getElementById(id)) li.setAttribute('id', id); } this._list.querySelector('ul').appendChild(li); return li; }, /** * Gets a list item <li> by its index, where index counting starts from 1 * @method at * @param {Number} index * @return The list item, or null on failure */ at: function (index) { if (typeof (index) != 'number') return null; return this._list.querySelector('ul').querySelector('li:nth-child(' + index + ')'); }, /** * Removes a list item <li> by its index, where index counting starts from 1 * @method remove * @param {Number} index */ remove: function (index) { var item = this.at(index); if (item) { item.parentNode.removeChild(item); } }, /** * Removes all items from a list * @method removeAllItems */ removeAllItems: function () { if (this._list.querySelector('ul')) this._list.querySelector('ul').innerHTML = ''; }, /** * Iterates over all list items and runs a provided function on each * @method forEach * @param {Function} func - The function to run on each list item */ forEach: function (func) { if (typeof (func) !== 'function') return; var items = this._list.querySelector('ul').querySelectorAll('li'); Array.prototype.forEach.call(items, function (element, index) { func(element, index); }); }, /** * Returns the DOM element associated with the selector this widget is bind to. * @method element * @return {DOMElement} * @example var mylist = UI.list("#listid").element(); */ element: function () { return this._list; } }; return List; })(); ubuntu-html5-theme-0.1.2+14.04.20140404/0.1/ambiance/js/tabs.js0000644000015301777760000003627512317536560023544 0ustar pbusernogroup00000000000000/* * Copyright (C) 2013 Adnane Belmadiaf * License granted by Canonical Limited * * This file is part of ubuntu-html5-ui-toolkit. * * This package is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 3 of the * License, or * (at your option) any later version. * This package 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 Lesser General Public * License along with this program. If not, see * */ /** * One of the navigation pattern that can be used within an Ubuntu App is the flat navigation. Tabs are the standard way to provide such a navigation pattern from within your application. Tabs are defined from within the Header part of your application HTML. See the Header class for more information. Declare the Header and Tabs in HTML as a direct child of the top level Page as a sibling to the content div. * @class Tabs * @constructor * @namespace UbuntuUI * @example
  • Main
  • Two
[...]
[...]
JavaScript: UI.tabs.METHOD(); */ var Tabs = (function () { var pageX, pageY, isScrolling, deltaX, deltaY, offsetX, resistance, tabsWidth, activeTab, navigationTimer, t2, startTimestamp; var STATES = { basic: 0, transitioning_to_navigation: 1, navigating: 2, }; var state = STATES.basic; function Tabs (tabs, touchInfoDelegate) { if (tabs == null || touchInfoDelegate == null) { return; } this._touchDown = false; this._tabs = tabs; this._infos = { width: this.__getTabHeadersWidth(), count: this._tabs.querySelectorAll('li').length }; this._touchInfoDelegate = touchInfoDelegate; var touchEvents = touchInfoDelegate.touchEvents; touchInfoDelegate.registerTouchEvent( touchEvents.touchStart, this._tabs, this.__onTouchStart.bind(this)); touchInfoDelegate.registerTouchEvent( touchEvents.touchMove, this._tabs, this.__onTouchMove.bind(this)); touchInfoDelegate.registerTouchEvent( touchEvents.touchEnd, this._tabs, this.__onTouchEnd.bind(this)); // initialize default page this.__setupInitialTabVisibility(); }; Tabs.prototype = { /** * Return the index of the selected tab * @property selectedTabIndex * @return {Integer} - The zero based index of the element in the list of tabs or -1 */ get selectedTabIndex() { return Array.prototype.slice.call(this._tabs.querySelectorAll('li')).indexOf(activeTab); }, /** * Sets the index of the selected tab * @property selectedTabIndex * @param {Integer} - The zero based index of the element in the list of tabs */ set selectedTabIndex(index) { var tabs = Array.prototype.slice.call(this._tabs.querySelectorAll('li')); if (index < 0 || index >= tabs.length) return; this.__doSelectTab(tabs[index], true); }, /** * Return the page associated with the currently selected tab * * @deprecated * * @property currentPage * @return {Element} - Page DOM element associated with the currently selected tab or null */ get currentPage() { return this.selectedTab ? this.selectedTab.querySelector('page') : null; }, /** * Return the currently selected tab element * * @property selectedTab * @return {Element} - The currently selected element or null */ get selectedTab() { var selected = null; if (activeTab) { try { selected = document.getElementBydId(activeTab.getAttribute('data-page')); } catch(e) {}; } return selected; }, /** * Return the number of tab elements in the header * @property count * @return {Integer} - Number of tab elements */ get count() { return this.tabChildren.length; }, /** * Return the list of DOM elements of the tab * * @deprecated * * @property tabChildren * @return {Elements} - List of DOM elements in the tab */ get tabChildren() { return this._tabs.querySelectorAll('li'); }, /** * @private */ __setupInitialTabVisibility: function() { var tab = this._tabs.querySelector('[data-role="tabitem"]:first-child'); tab.classList.remove('inactive'); tab.classList.add('active'); var updateDisplayStyle = function(tab, value) { var targetPage = document.getElementById(tab.getAttribute('data-page')); if (targetPage) targetPage.style.display=value; }; updateDisplayStyle(tab, 'block'); [].slice. call(this._tabs.querySelectorAll('[data-role="tabitem"]:not(:first-child)')). forEach(function(element) { element.classList.remove('inactive'); updateDisplayStyle(element, 'none'); }); }, /** * @private */ __getScroll: function () { var translate3d = this._tabs.style.webkitTransform.match(/translate3d\(([^,]*)/); return parseInt(translate3d ? translate3d[1] : 0) }, /** * @private */ __getTabHeadersWidth: function() { return Array.prototype.slice.call(document.querySelectorAll('header li')).reduce(function(prev, cur) { return prev + cur.clientWidth;}, 0); }, /** * @private */ __getHeaderWidth: function() { return this._tabs.clientWidth; }, /** * @private */ __clearInternalState: function() { if (navigationTimer) window.clearTimeout(navigationTimer); if (t2) window.clearTimeout(t2); navigationTimer = undefined; t2 = undefined; isScrolling = undefined; tabsWidth = this._tabs.offsetWidth; resistance = 10; startTimestamp = 0; }, /** * @private */ __onTouchStart: function (e) { if (!this._tabs) return; e.preventDefault(); this.__clearInternalState(); if (state === STATES.basic) { state = STATES.transitioning_to_navigation; this.__showNavigation(); } var _e = this._touchInfoDelegate.translateTouchEvent(e); pageX = _e.touches[0].pageX; pageY = _e.touches[0].pageY; startTimestamp = _e.timeStamp; this._tabs.style['-webkit-transition-duration'] = 0; this._touchDown = true; }, /** * @private */ __onTouchMove: function (e) { if (!this._touchDown) { return; } e.preventDefault(); var _e = this._touchInfoDelegate.translateTouchEvent(e); deltaX = _e.touches[0].pageX - pageX; deltaY = _e.touches[0].pageY - pageY; // TODO: account for DPR var MIN_JITTER_THRESHOLD = 20; var plusDeltaX = Math.abs(deltaX); var plusDeltaY = Math.abs(deltaY); // Account for clicks w/ slight touch jitter isScrolling = plusDeltaY > plusDeltaX && plusDeltaY > MIN_JITTER_THRESHOLD; if (isScrolling) return; offsetX = (deltaX / resistance) + this.__getScroll(); var firstTab = this._tabs.querySelector('li:first-child'); var maxRightScrollReached = firstTab.getBoundingClientRect().left >= 0 && deltaX > 0; var lastTab = this._tabs.querySelector('li:last-child'); var maxLeftScrollReached = lastTab.getBoundingClientRect().right <= this.__getHeaderWidth() && deltaX < 0; if (!maxRightScrollReached && !maxLeftScrollReached) { this._tabs.style.webkitTransform = 'translate3d(' + offsetX + 'px,0,0)'; } }, /** * @private */ __onTouchEnd: function (e) { if (!this._tabs || isScrolling) return; e.preventDefault(); this._touchDown = false; var _e = this._touchInfoDelegate.translateTouchEvent(e); var MIN_JITTER_THRESHOLD = 20; if (state === STATES.transitioning_to_navigation) { state = STATES.navigating; } else if (state === STATES.navigating && Math.abs((_e.changedTouches[0].pageX - pageX)) < MIN_JITTER_THRESHOLD) { this.__onClicked(_e); // Timer should have been cancelled, back to basic state = STATES.basic; } var self = this; navigationTimer = window.setTimeout(function () { self.__endNavigation(); state = STATES.basic; }, 3000); }, /** * @private */ __endNavigation: function () { if (state !== STATES.navigating) return; var activeTab = document.querySelector('[data-role="tabitem"].active'); if (! activeTab) return; var offsetX = activeTab.offsetLeft; this._tabs.style['-webkit-transition-duration'] = '.3s'; this._tabs.style.webkitTransform = 'translate3d(-' + offsetX + 'px,0,0)'; [].forEach.call(document.querySelectorAll('[data-role="tabitem"]:not(.active)'), function (el) { el.classList.toggle('inactive'); }); }, /** * @private */ __showNavigation: function () { if (state !== STATES.transitioning_to_navigation) return; // TODO constraint a bit the selector [].forEach.call(document.querySelectorAll('[data-role="tabitem"]:not(.active)'), function (el) { el.classList.toggle('inactive'); }); }, /** * @private */ __updateActiveTab: function(newActiveTab, oldActiveTab) { // TODO avoid reflow oldActiveTab.classList.remove('inactive'); oldActiveTab.classList.remove('active'); newActiveTab.classList.remove('inactive'); newActiveTab.classList.add('active'); }, /** * @private */ __onTouchLeave: function (e) {}, /** * @private */ __dispatchTabChangedEvent: function (tabId) { this._evt = document.createEvent('Event'); this._evt.initEvent('tabchanged',true,true); this._evt.infos = {tabId: tabId}; this._tabs.dispatchEvent(this._evt); }, /** * @private */ __onClicked: function (e) { if (state !== STATES.navigating) return; if (e.changedTouches.length === 0) return; var touch = e.changedTouches[0]; var selectedTab = document.elementFromPoint(touch.pageX, touch.pageY); if (selectedTab == null) return; this.__doSelectTab(selectedTab); e.preventDefault(); }, /** * @private */ __doSelectTab: function(tabElement, forcedSelection) { if ( ! tabElement) return; if (tabElement.getAttribute("data-role") !== 'tabitem') return; if (forcedSelection || (Array.prototype.slice.call(tabElement.classList)).indexOf('inactive') > -1) { window.clearTimeout(t2); activeTab = this._tabs.querySelector('[data-role="tabitem"].active'); offsetX = this.offsetLeft; this._tabs.style['-webkit-transition-duration'] = '.3s'; this._tabs.style.webkitTransform = 'translate3d(-' + offsetX + 'px,0,0)'; this.__updateActiveTab(tabElement, activeTab); [].forEach.call(this._tabs.querySelectorAll('[data-role="tabitem"]:not(.active)'), function (e) { e.classList.remove('inactive'); }); var targetPageId = tabElement.getAttribute('data-page'); this.activate(targetPageId); this.__dispatchTabChangedEvent(targetPageId); } else { [].forEach.call(this._tabs.querySelectorAll('[data-role="tabitem"]:not(.active)'), function (el) { el.classList.toggle('inactive'); }); var self = this; t2 = window.setTimeout(function () { var nonActiveTabs = self._tabs.querySelectorAll('[data-role="tabitem"]:not(.active)'); [].forEach.call(nonActiveTabs, function (el) { el.classList.toggle('inactive'); }); }, 3000); } }, /** * @private */ activate: function (id) { if (!id || typeof (id) !== 'string') return; activeTab = this._tabs.querySelector('[data-page="'+ id +'"]'); if (!activeTab) return; [].forEach.call(this._tabs.querySelectorAll('[data-role="tabitem"]'), function (e) { e.classList.remove('active'); e.classList.remove('inactive'); }); activeTab.classList.add('active'); offsetX = activeTab.offsetLeft; this._tabs.style['-webkit-transition-duration'] = '.3s'; this._tabs.style.webkitTransform = 'translate3d(-' + offsetX + 'px,0,0)'; }, /** * @private */ onTabChanged: function(callback){ this._tabs.addEventListener("tabchanged", callback); } }; return Tabs; })(); ubuntu-html5-theme-0.1.2+14.04.20140404/0.1/ambiance/js/page.js0000644000015301777760000001721712317536560023522 0ustar pbusernogroup00000000000000/* * Copyright (C) 2013, 2014 Adnane Belmadiaf * License granted by Canonical Limited * * This file is part of ubuntu-html5-ui-toolkit. * * This package is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 3 of the * License, or * (at your option) any later version. * This package 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 Lesser General Public * License along with this program. If not, see * . */ /** * One of the navigation pattern that can be used within an Ubuntu App is the deep navigation. This pattern is implemented by the Pagestack. A Pagestack contains one or more Pages. Each page displays full-screen. See the Pagestack class. Each Page must have id and data-title attributes. The id attribute is used a unique reference to push the Page to the top of the Pagestack (see the Pagestack class). The data-title attribute is used to update the Header title as pages are pushed and poped. * @class Page * @constructor * @namespace UbuntuUI * @example
[...]
[...]
JavaScript access: var page = UI.page("pageID"); */ var Page = function (id) { this.id = id; this.onActivatedCallbacks = []; this.__setup(); }; Page.PAGE_ACTIVATED_EVENT = 'ubuntu-html5-on-page-activated'; Page.prototype = { /** * Returns the DOM element associated with the selector this widget is bind to. * @method element * @example var mypage = UI.page("pageid").element(); */ element: function () { return document.getElementById(this.id); }, /** * actions property. * @property {List} actions */ get actions() { // TODO: Not implemented yet return []; }, set actions(value) { // TODO: Not implemented yet }, /** * title property. * @property {String} title */ get title() { // TODO: Not implemented yet return ""; }, set title(value) { // TODO: Not implemented yet }, /** * Deactivates the current page. * @method {} deactivate */ deactivate: function () { this.__updateVisibleState('none', function (footer) { if (!footer) return; footer.style.display = 'none'; footer.classList.remove('revealed'); }); }, /** * Activates the current page. * @method {} activate * @param {Object} properties - Data to be passed down to any activation callback listening for the page activation (see Page.onactivated) */ activate: function (properties) { this.__hideVisibleSibling(); this.__updateVisibleState('block', function (footer) { if (!footer) return; footer.style.display = 'block'; footer.classList.add('revealed'); }); this.__updateHeaderTitle(); this.__dispatchActivatedEvent(properties); }, /** * Activates the current page. * @method {} onactivated * @param {Function} callback - Callback function called with activation properties (from Pagestack.push) when the page is activated */ onactivated: function(callback) { if (callback && typeof callback === 'function') this.onActivatedCallbacks.push(callback); }, /** * @private */ __setup: function() { var self = this; if (this.id && this.element() != null) { this.element().addEventListener( Page.PAGE_ACTIVATED_EVENT, function(event) { if (! event.target || self.onActivatedCallbacks.length === 0) return; self.onActivatedCallbacks.forEach( function(callback) { callback(event.data); }); }); } }, /** * @private */ __dispatchActivatedEvent: function (data) { if ( ! this.element()) return; var event = document.createEvent('Event'); event.initEvent(Page.PAGE_ACTIVATED_EVENT,true,true); event.data = data; this.element().dispatchEvent(event); }, /** * @private */ __updateHeaderTitle: function () { if (!this.element().getAttribute('data-title')) return; var header = document.querySelector('div[data-role="mainview"] header'); if (!header) return; var ul = header.querySelector('ul'); if (!ul) { ul = document.createElement('ul'); ul.setAttribute('data-role', 'tabs'); header.appendChild(ul); } var titles = header.querySelectorAll('ul li'); for (var i = 0; i < titles.length; ++i) { ul.removeChild(titles[i]); } var li = document.createElement('li'); li.setAttribute('data-role', 'tabitem'); li.setAttribute('data-page', this.id); li.classList.add('active'); var DEFAULT_TITLE = 'Unknown'; var title = DEFAULT_TITLE; try { title = this.element().getAttribute('data-title'); } catch (e) {} title = title || DEFAULT_TITLE; var text = document.createTextNode(title); li.appendChild(text); ul.appendChild(li); }, /** * Validates that a given DOM node element is a Ubuntu UI Page. * @method {DOM Element} isPage * @return {Boolean} if the DOM element is a page */ isPage: function (element) { return element.tagName === 'DIV' && element.hasAttribute('data-role') && element.getAttribute('data-role') === 'page'; }, /** * @private */ __updateVisibleState: function (displayStyle, footerHandlerFunc) { if (!this.__isValidId(this.id)) return; var page = document.getElementById(this.id); if (!this.isPage(page)) { return; } page.style.display = displayStyle; if (page.querySelector(this.__thisSelector + ' > footer')) { var footer = page.querySelector('footer'); footerHandlerFunc(footer); } }, /** * @private */ __hideVisibleSibling: function () { if (!this.__isValidId(this.id)) return; var page = document.getElementById(this.id); if (!this.isPage(page)) { return; } var children = page.parentNode.children; for (var idx = 0; idx < children.length; ++idx) { if (this.isPage(children[idx])) { children[idx].style.display = 'none'; } } }, /** * @private */ __isValidId: function (id) { return id && typeof (id) === 'string'; }, /** * @private */ get __thisSelector() { return "#" + this.id; } }; ubuntu-html5-theme-0.1.2+14.04.20140404/0.1/ambiance/js/core.js0000644000015301777760000004137212317536560023535 0ustar pbusernogroup00000000000000/* * Copyright (C) 2013 Adnane Belmadiaf * License granted by Canonical Limited * * This file is part of ubuntu-html5-ui-toolkit. * * This package is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 3 of the * License, or * (at your option) any later version. * This package 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 Lesser General Public * License along with this program. If not, see * */ /** * @module UbuntuUI */ /** * UbuntuUI is the critical Ubuntu HTML5 framework class. You need to construct an UbuntuUI object and initialize it to have an Ubuntu HTML5 app. You then use this object to access Ubuntu HTML5 objects (and object methods) that correspond to the Ubuntu HTML5 DOM elements. Note: The UbuntuUI object is "UI" in all API doc examples. * @class UbuntuUI * @constructor * @example var UI = new UbuntuUI(); window.onload = function () { UI.init(); UI.pagestack.push('pageid'); [...] }; */ var UbuntuUI = (function () { PAGESTACK_BACK_ID = 'ubuntu-pagestack-back'; function __hasPageStack(document) { return document.querySelectorAll("[data-role='pagestack']") != null; }; function __hasTabs(document) { return document.querySelectorAll("[data-role='tabs']") != null; }; function __createBackButtonListItem(d) { var a = d.createElement('a'); a.setAttribute('href', '#'); a.setAttribute('data-role', 'back'); a.setAttribute('id', PAGESTACK_BACK_ID + '-' + Math.random()); var img = d.createElement('img'); img.setAttribute('src', '/usr/share/ubuntu-html5-ui-toolkit/0.1/ambiance/img/back@18.png'); // TODO: translation? img.setAttribute('alt', 'Back'); a.appendChild(img); var span = d.createElement('span'); var text = d.createTextNode('Back'); span.appendChild(text); a.appendChild(span); var li = d.createElement('li'); li.appendChild(a); return li; }; function __appendBackButtonToFooter(self, d, footer) { var li = __createBackButtonListItem(d); var ul = null; if (footer.querySelectorAll('ul').length == 0) { ul = d.createElement('ul'); } else { ul = footer.querySelectorAll('ul')[0]; } ul.appendChild(li); if (footer.querySelectorAll('nav').length == 0) { var nav = d.createElement('nav'); nav.appendChild(ul); footer.appendChild(nav); } var a = li.querySelector('a'); a.onclick = function (e) { if (self._pageStack.depth() > 1){ self._pageStack.pop(); } e.preventDefault(); }; } function UbuntuUI() { var U = this; U.isTouch = "ontouchstart" in window; U.touchEvents = { touchStart: ['touchstart','mousedown'], touchMove: ['touchmove','mousemove'], touchEnd: ['touchend','mouseup'], touchLeave: ['mouseleave'], }; }; UbuntuUI.prototype = { __setupPageStack: function (d) { // TODO validate no more than one page stack etc. // d.querySelectorAll("[data-role='pagestack']") // FIXME: support multiple page stack & complex docs? var pagestacks = d.querySelectorAll("[data-role='pagestack']"); if (pagestacks.length == 0) return; var pagestack = pagestacks[0]; this._pageStack = new Pagestack(pagestack); var pages = pagestack.querySelectorAll("[data-role='page']"); if (pages.length > 0) { this._pageStack.push(pages[0].getAttribute('id')); } var immediateFooters = [].filter.call(pagestack.children, function (e) { return e.nodeName.toLowerCase() === 'footer'; }); if (immediateFooters.length !== 0) { // There is a main footer for the whole pagestack, // FIXME: only consider the first (there should be only 1 anyway) var footer = immediateFooters[0]; __appendBackButtonToFooter(this, d, footer); return; } // try to find subpages & append back button there for (var idx = 0; idx < pages.length; ++idx) { var page = pages[idx]; // TODO: only add the footer for now, but need to sync w/ title // , properties & header var footer; if (page.querySelectorAll("[data-role='footer']").length == 0) { footer = d.createElement('footer'); footer.setAttribute('data-role', 'footer'); footer.setAttribute('class', 'revealed'); page.appendChild(footer); } else { // TODO: validate footer count: should be 1 footer footer = page.querySelectorAll("[data-role='footer']")[0]; } __appendBackButtonToFooter(this, d, footer); } }, __setupPage: function (document) { if (this._pageStack != null) return; if (__hasPageStack(document)) { this.__setupPageStack(document); } }, __getTabInfosDelegate: function () { var self = this; var __createTouchObject = function(event) { return { identifier: event.timeStamp, target: event.target, screenX: event.screenX, screenY: event.screenY, clientX: event.clientX, clientY: event.clientY, pageX: event.pageX, pageY: event.pageY, }; }; return { get isTouch() { return self.isTouch; }, registerTouchEvent: function(eventId, element, callback) { if ( ! eventId || typeof(eventId) !== 'object' || eventId.length === 0) { console.log('Invalid or empty eventId for registerTouchEvent: ' + eventId.toString() + ' ' + typeof(eventId)); return; } for (var i = 0; i < eventId.length; ++i) { element.addEventListener(eventId[i], callback); } }, touchEvents: { get touchStart() { return self.touchEvents.touchStart; }, get touchMove() { return self.touchEvents.touchMove; }, get touchEnd() { return self.touchEvents.touchEnd; }, get touchLeave() { return self.touchEvents.touchLeave; }, }, translateTouchEvent: function(event) { var touch = __createTouchObject(event); var translatedTouchEvent = event; translatedTouchEvent.changedTouches = [touch]; // keep the properties even for e.g. 'touchend' translatedTouchEvent.touches = [touch]; translatedTouchEvent.targetTouches = [touch]; return translatedTouchEvent; } }; }, __setupToolbars: function(document) { var toolbars = document.querySelectorAll('footer[data-role="footer"]'); for (var i = 0; i < toolbars.length; ++i) { var id = toolbars[i].getAttribute('id'); if ( !id) continue; var toolbar = new Toolbar( id, this.__getTabInfosDelegate()); } }, __setupTabs: function (document) { if (this._tabs != null) return; if (__hasTabs(document)) { if (typeof Tabs != 'undefined' && Tabs) { var apptabsElements = document.querySelectorAll('[data-role=tabs]'); if (apptabsElements.length == 0) return; this._tabs = new Tabs(apptabsElements[0], this.__getTabInfosDelegate()); this._tabs.onTabChanged(function (e) { if (!e || !e.infos) return; if (e.infos.tabId) { (new Tab(e.infos.tabId)).activate(); } }.bind(this)); } } }, /** * Required call that initializes the UbuntuUI object * @method {} init */ init: function () { this.__setupTabs(document); this.__setupPage(document); this.__setupToolbars(document); }, /** * Gets an Ubuntu Page object * @method page * @param {ID} id - The element's id attribute * @return {Page} - The Page with the specified id */ page: function (id) { if (typeof Page != 'undefined' && Page ) { return new Page(id); } else { console.error('Could not find the Page element. You might be missing the "page.js" Page definition script. Please add a