Skip to content
Browse files

Added Apps to a better location, and for demo purposes

  • Loading branch information...
1 parent a65f2eb commit ff585c442242441cd5f6df9134a9a0d455a8b7d9 @robnyman committed Apr 17, 2012
View
746 mozilla/apps/TweetView/css/base.css
@@ -0,0 +1,746 @@
+/* General font styles */
+html {
+ font: 100%/1.3 Verdana, Helvetica, Arial, sans-serif;
+}
+
+body {
+ font: 70%/1.3 Verdana, Helvetica, Arial, sans-serif;
+}
+
+select, table {
+ font-size: 1em;
+}
+
+h1 {
+ font: bold 2em Arial, sans-serif;
+}
+
+h2 {
+ font: bold 1.5em Arial, sans-serif;
+}
+
+h3 {
+ font: bold 1.25em Arial, sans-serif;
+}
+
+h4 {
+ font: bold 1.1em Arial, sans-serif;
+}
+
+/* Default resetting */
+html, body, form, fieldset, legend, dt, dd {
+ margin: 0;
+ padding: 0;
+}
+
+h1, h2, h3, h4, h5, h6, p, ul, ol, dl {
+ margin: 0 0 1em;
+ padding: 0;
+}
+
+h1, h2, h3, h4, h5, h6 {
+ margin-bottom: 0.5em;
+}
+
+pre {
+ font-size: 1.5em;
+}
+
+li, dd {
+ margin-left: 1.5em;
+}
+
+img {
+ border: none;
+ vertical-align: middle;
+}
+
+/* Basic element styles */
+a {
+ color: #000;
+}
+
+a:hover {
+ text-decoration: underline;
+}
+
+html {
+ color: #000;
+ background: #555;
+
+ /* For WebKit (Safari, Google Chrome etc) */
+ background: -webkit-gradient(linear, left top, left bottom, from(#222), to(#555));
+ /* For Mozilla/Gecko (Firefox etc) */
+ background: -moz-linear-gradient(top, #222, #555);
+ /* For Internet Explorer 5.5 - 7 */
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#FF222222, endColorstr=#FF555555);
+ /* For Internet Explorer 8 */
+ -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#FF222222, endColorstr=#FF555555)";
+ min-height: 100%;
+}
+
+body {
+ margin-bottom: 30px;
+}
+
+h1 {
+ color: #6c9af8;
+}
+
+h1 a {
+ position: relative;
+ left: 20px;
+ top: -0.4em;
+ color: #6c9af8;
+ font-size: 0.5em;
+ line-height: 0.5em;
+}
+
+h2 {
+ margin: 1em 0 0.5em;
+ border-bottom: 1px solid #000;
+}
+
+#index-page h3 {
+ border-bottom: 1px solid #000;
+ padding-bottom: 0.5em;
+ margin: 2em 0 1.5em;
+}
+
+pre{
+ background: #eee;
+ padding: 1em;
+ overflow: auto;
+}
+
+dl {
+ overflow: hidden;
+}
+
+dt {
+ font-weight: bold;
+}
+
+input {
+ vertical-align: middle;
+}
+
+table {
+ width: 100%;
+ margin: 0 0 1em;
+}
+
+th, td {
+ text-align: left;
+ padding: 0.5em;
+ border-bottom: 1px solid #ccc;
+}
+
+td {
+ width: 500px;
+ vertical-align: top;
+}
+
+th {
+ width: 180px;
+ border-right: 1px solid #ccc;
+}
+
+thead th {
+ border-color: #000;
+}
+
+th.last {
+ border-right: none;
+}
+
+th.section-title {
+ text-align: center;
+ border-right: none;
+ padding: 1em 0.5em;
+}
+
+tr.even {
+ background: #eee;
+}
+
+
+
+/* Structure */
+#container {
+ width: 760px;
+ min-height: 600px;
+ background: #fff;
+ border: 1px solid #ccc;
+ border-top: none;
+ margin: 20px auto;
+ padding: 20px;
+ -moz-border-radius: 10px;
+ -webkit-border-radius: 10px;
+ border-radius: 10px;
+ -moz-box-shadow: 1px 1px 10px #000;
+ -webkit-box-shadow: 1px 1px 5px #000;
+ box-shadow: 1px 1px 10px #000;
+}
+
+@media screen and (max-width: 320px) {
+ #container {
+ width: 280px;
+ padding: 10px;
+ }
+}
+
+#main-content {
+ overflow: hidden;
+}
+
+.navigation {
+ background: #eee;
+ -moz-border-radius: 5px;
+ -webkit-border-radius: 5px;
+ border-radius: 5px;
+ margin-bottom: 2em;
+ padding: 1em;
+}
+
+.navigation li {
+ margin-bottom: 0.5em;
+}
+
+.navigation h2 {
+ border-bottom: none;
+}
+
+.section {
+ border-bottom: 1px solid #ccc;
+ margin: 2em 0;
+ padding-bottom: 1em;
+}
+
+.browsers {
+ list-display: none;
+ margin: 0;
+}
+
+.browsers li {
+ display: inline-block;
+ width: 60px;
+ text-align: center;
+ vertical-align: top;
+ margin: 0 10px 0 0;
+}
+
+.browsers li img {
+ display: block;
+ margin: 0 auto;
+}
+
+.failed {
+ color: #f00;
+}
+
+
+.statcounter {
+ position: absolute;
+ left: -99999px;
+}
+
+/* HTML5 demos */
+header,
+nav,
+section,
+article,
+aside,
+footer {
+ display: block;
+}
+
+time {
+ display: inline;
+}
+
+#demo-top-nav {
+ margin-bottom: 2em;
+ border-bottom: 1px solid #000;
+}
+
+#demo-main {
+ overflow: hidden;
+}
+
+#demo-main-content {
+ float: left;
+ width: 70%;
+}
+
+#demo-main-content h2,
+#demo-main-content h3 {
+ border-bottom: none;
+ margin: 0 0 5px;
+ padding: 0;
+}
+
+#demo-aside-content {
+ float: right;
+ width: 25%;
+ color: #fff;
+ background: #6c9af8;
+ padding: 5px;
+ -moz-border-radius: 5px;
+ -webkit-border-radius: 5px;
+ border-radius: 5px;
+}
+
+#page-footer {
+ border-top: 1px solid #000;
+ margin-top: 4em;
+ padding-top: 1em;
+}
+
+
+/**
+ * SyntaxHighlighter
+ * http://alexgorbatchev.com/
+ *
+ * SyntaxHighlighter is donationware. If you are using it, please donate.
+ * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
+ *
+ * @version
+ * 2.0.296 (March 01 2009)
+ *
+ * @copyright
+ * Copyright (C) 2004-2009 Alex Gorbatchev.
+ *
+ * @license
+ * This file is part of SyntaxHighlighter.
+ *
+ * SyntaxHighlighter 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, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * SyntaxHighlighter 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 SyntaxHighlighter. If not, see <http://www.gnu.org/licenses/>.
+ */
+.syntaxhighlighter,
+.syntaxhighlighter div,
+.syntaxhighlighter code,
+.syntaxhighlighter span {
+ margin: 0 !important;
+ padding: 0 !important;
+ border: 0 !important;
+ outline: 0 !important;
+ background: none !important;
+ text-align: left !important;
+ float: none !important;
+ vertical-align: baseline !important;
+ position: static !important;
+ left: auto !important;
+ top: auto !important;
+ right: auto !important;
+ bottom: auto !important;
+ height: auto !important;
+ width: auto !important;
+ line-height: 1.2em !important;
+ font-family: "Consolas", "Monaco", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important;
+ font-weight: normal !important;
+ font-style: normal !important;
+ font-size: 13px !important;
+}
+
+.syntaxhighlighter {
+ width: 100% !important;
+ margin: 1em 0 1em 0 !important;
+ padding: 1px !important; /* adds a little border on top and bottom */
+ position: relative !important;
+}
+
+.syntaxhighlighter .bold {
+ font-weight: bold !important;
+}
+
+.syntaxhighlighter .italic {
+ font-style: italic !important;
+}
+
+.syntaxhighlighter .line .number {
+ float: left !important;
+ width: 3em !important;
+ padding-right: .3em !important;
+ text-align: right !important;
+ display: block !important;
+}
+
+/* Disable numbers when no gutter option is set */
+.syntaxhighlighter.nogutter .line .number {
+ display: none !important;
+}
+
+.syntaxhighlighter .line .content {
+ margin-left: 3.3em !important;
+ padding-left: .5em !important;
+ display: block !important;
+}
+
+.syntaxhighlighter .line .content .block {
+ display: block !important;
+ padding-left: 1.5em !important;
+ text-indent: -1.5em !important;
+}
+
+.syntaxhighlighter .line .content .spaces {
+ display: none !important;
+}
+
+/* Disable border and margin on the lines when no gutter option is set */
+.syntaxhighlighter.nogutter .line .content {
+ margin-left: 0 !important;
+ border-left: none !important;
+}
+
+.syntaxhighlighter .bar {
+}
+
+.syntaxhighlighter.collapsed .bar {
+
+}
+
+.syntaxhighlighter.nogutter .ruler {
+ margin-left: 0 !important;
+ padding-left: 0 !important;
+}
+
+.syntaxhighlighter .ruler {
+ padding: 0 0 .5em .5em !important;
+ margin-left: 3.3em !important;
+ overflow: hidden !important;
+}
+
+/* Adjust some properties when collapsed */
+
+.syntaxhighlighter.collapsed .lines,
+.syntaxhighlighter.collapsed .ruler {
+ display: none !important;
+}
+
+/* Styles for the toolbar */
+
+.syntaxhighlighter .toolbar {
+ position: absolute !important;
+ right: 0px !important;
+ top: 0px !important;
+ font-size: 1px !important;
+ padding: 8px 8px 8px 0 !important; /* in px because images don't scale with ems */
+}
+
+.syntaxhighlighter.collapsed .toolbar {
+ font-size: 80% !important;
+ padding: .2em 0 .5em .5em !important;
+ position: static !important;
+}
+
+.syntaxhighlighter .toolbar a.item,
+.syntaxhighlighter .toolbar .item {
+ display: block !important;
+ float: left !important;
+ margin-left: 8px !important;
+ background-repeat: no-repeat !important;
+ overflow: hidden !important;
+ text-indent: -5000px !important;
+}
+
+.syntaxhighlighter.collapsed .toolbar .item {
+ display: none !important;
+}
+
+.syntaxhighlighter.collapsed .toolbar .item.expandSource {
+ background-image: url(../syntax-highlighter/styles/magnifier.png) !important;
+ display: inline !important;
+ text-indent: 0 !important;
+ width: auto !important;
+ float: none !important;
+ height: 16px !important;
+ padding-left: 20px !important;
+}
+
+.syntaxhighlighter .toolbar .item.viewSource {
+ background-image: url(../syntax-highlighter/styles/page_white_code.png) !important;
+}
+
+.syntaxhighlighter .toolbar .item.printSource {
+ background-image: url(../syntax-highlighter/styles/printer.png) !important;
+}
+
+.syntaxhighlighter .toolbar .item.copyToClipboard {
+ text-indent: 0 !important;
+ background: none !important;
+ overflow: visible !important;
+}
+
+.syntaxhighlighter .toolbar .item.about {
+ background-image: url(../syntax-highlighter/styles/help.png) !important;
+}
+
+/**
+ * Print view.
+ * Colors are based on the default theme without background.
+ */
+
+.syntaxhighlighter.printing,
+.syntaxhighlighter.printing .line.alt1 .content,
+.syntaxhighlighter.printing .line.alt2 .content,
+.syntaxhighlighter.printing .line.highlighted .number,
+.syntaxhighlighter.printing .line.highlighted.alt1 .content,
+.syntaxhighlighter.printing .line.highlighted.alt2 .content,
+.syntaxhighlighter.printing .line .content .block {
+ background: none !important;
+}
+
+/* Gutter line numbers */
+.syntaxhighlighter.printing .line .number {
+ color: #bbb !important;
+}
+
+/* Add border to the lines */
+.syntaxhighlighter.printing .line .content {
+ color: #000 !important;
+}
+
+/* Toolbar when visible */
+.syntaxhighlighter.printing .toolbar,
+.syntaxhighlighter.printing .ruler {
+ display: none !important;
+}
+
+.syntaxhighlighter.printing a {
+ text-decoration: none !important;
+}
+
+.syntaxhighlighter.printing .plain,
+.syntaxhighlighter.printing .plain a {
+ color: #000 !important;
+}
+
+.syntaxhighlighter.printing .comments,
+.syntaxhighlighter.printing .comments a {
+ color: #008200 !important;
+}
+
+.syntaxhighlighter.printing .string,
+.syntaxhighlighter.printing .string a {
+ color: blue !important;
+}
+
+.syntaxhighlighter.printing .keyword {
+ color: #069 !important;
+ font-weight: bold !important;
+}
+
+.syntaxhighlighter.printing .preprocessor {
+ color: gray !important;
+}
+
+.syntaxhighlighter.printing .variable {
+ color: #a70 !important;
+}
+
+.syntaxhighlighter.printing .value {
+ color: #090 !important;
+}
+
+.syntaxhighlighter.printing .functions {
+ color: #ff1493 !important;
+}
+
+.syntaxhighlighter.printing .constants {
+ color: #0066CC !important;
+}
+
+.syntaxhighlighter.printing .script {
+ font-weight: bold !important;
+}
+
+.syntaxhighlighter.printing .color1,
+.syntaxhighlighter.printing .color1 a {
+ color: #808080 !important;
+}
+
+.syntaxhighlighter.printing .color2,
+.syntaxhighlighter.printing .color2 a {
+ color: #ff1493 !important;
+}
+
+.syntaxhighlighter.printing .color3,
+.syntaxhighlighter.printing .color3 a {
+ color: red !important;
+}
+
+/**
+ * SyntaxHighlighter
+ * http://alexgorbatchev.com/
+ *
+ * SyntaxHighlighter is donationware. If you are using it, please donate.
+ * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
+ *
+ * @version
+ * 2.0.296 (March 01 2009)
+ *
+ * @copyright
+ * Copyright (C) 2004-2009 Alex Gorbatchev.
+ *
+ * @license
+ * This file is part of SyntaxHighlighter.
+ *
+ * SyntaxHighlighter 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, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * SyntaxHighlighter 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 SyntaxHighlighter. If not, see <http://www.gnu.org/licenses/>.
+ */
+/************************************
+ * Default Syntax Highlighter theme.
+ *
+ * Interface elements.
+ ************************************/
+
+.syntaxhighlighter {
+ background-color: #E7E5DC !important;
+}
+
+/* Highlighed line number */
+.syntaxhighlighter .line.highlighted .number {
+ background-color: #6CE26C !important;
+ color: black !important;
+}
+
+/* Highlighed line */
+.syntaxhighlighter .line.highlighted.alt1 .content,
+.syntaxhighlighter .line.highlighted.alt2 .content {
+ background-color: #6CE26C !important;
+}
+
+/* Gutter line numbers */
+.syntaxhighlighter .line .number {
+ color: #5C5C5C !important;
+}
+
+/* Add border to the lines */
+.syntaxhighlighter .line .content {
+ border-left: 3px solid #6CE26C !important;
+ color: #000 !important;
+}
+
+.syntaxhighlighter.printing .line .content {
+ border: 0 !important;
+}
+
+/* First line */
+.syntaxhighlighter .line.alt1 .content {
+ background-color: #fff !important;
+}
+
+/* Second line */
+.syntaxhighlighter .line.alt2 .content {
+ background-color: #F8F8F8 !important;
+}
+
+.syntaxhighlighter .line .content .block {
+ background: url(/syntax-highlighter/styles/wrapping.png) 0 1.1em no-repeat !important;
+}
+
+.syntaxhighlighter .ruler {
+ color: silver !important;
+ background-color: #F8F8F8 !important;
+ border-left: 3px solid #6CE26C !important;
+}
+
+.syntaxhighlighter.nogutter .ruler {
+ border: 0 !important;
+}
+
+.syntaxhighlighter .toolbar {
+ background-color: #F8F8F8 !important;
+ border: #E7E5DC solid 1px !important;
+}
+
+.syntaxhighlighter .toolbar a {
+ color: #a0a0a0 !important;
+}
+
+.syntaxhighlighter .toolbar a:hover {
+ color: red !important;
+}
+
+/************************************
+ * Actual syntax highlighter colors.
+ ************************************/
+.syntaxhighlighter .plain,
+.syntaxhighlighter .plain a {
+ color: #000 !important;
+}
+
+.syntaxhighlighter .comments,
+.syntaxhighlighter .comments a {
+ color: #008200 !important;
+}
+
+.syntaxhighlighter .string,
+.syntaxhighlighter .string a {
+ color: blue !important;
+}
+
+.syntaxhighlighter .keyword {
+ color: #069 !important;
+ font-weight: bold !important;
+}
+
+.syntaxhighlighter .preprocessor {
+ color: gray !important;
+}
+
+.syntaxhighlighter .variable {
+ color: #a70 !important;
+}
+
+.syntaxhighlighter .value {
+ color: #090 !important;
+}
+
+.syntaxhighlighter .functions {
+ color: #ff1493 !important;
+}
+
+.syntaxhighlighter .constants {
+ color: #0066CC !important;
+}
+
+.syntaxhighlighter .script {
+ background-color: yellow !important;
+}
+
+.syntaxhighlighter .color1,
+.syntaxhighlighter .color1 a {
+ color: #808080 !important;
+}
+
+.syntaxhighlighter .color2,
+.syntaxhighlighter .color2 a {
+ color: #ff1493 !important;
+}
+
+.syntaxhighlighter .color3,
+.syntaxhighlighter .color3 a {
+ color: red !important;
+}
View
39 mozilla/apps/TweetView/index.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>TweetView</title>
+ <link rel="stylesheet" href="css/base.css" type="text/css" media="screen">
+ </head>
+
+ <body>
+
+ <div id="container">
+ </div>
+
+
+ <script type="text/javascript">
+ (function () {
+ window.addEventListener("keydown", function (evt) {
+ if (evt.keyCode === 82) {
+ location.reload();
+ }
+ }, false);
+ })();
+
+ function twitterCallback (response) {
+ var results = response.results;
+ for (var i = 0, l=results.length; i<l; i++) {
+ results[i]
+ }
+ console.log(JSON.stringify(response));
+ }
+ </script>
+
+
+ <script src="http://search.twitter.com/search.json?q=@robertnyman&callback=twitterCallback">
+
+ </script>
+
+ </body>
+</html>
View
22 mozilla/apps/TweetView/manifest.webapp
@@ -0,0 +1,22 @@
+{
+ "version": "1.0",
+ "name": "TweetView",
+ "description": "Overlook of tweets",
+ "icons": {
+ "16": "/img/icon-16.png",
+ "48": "/img/icon-48.png",
+ "128": "/img/icon-128.png"
+ },
+ "developer": {
+ "name": "Robert Nyman",
+ "url": "http://robertnyman.com"
+ },
+ "installs_allowed_from": [
+ "*"
+ ],
+ "launch_path": "/tweetview/index.html",
+ "locales": {
+ },
+ "default_locale": "en"
+}
+
View
22 mozilla/apps/TweetView/manifest.webapp.php
@@ -0,0 +1,22 @@
+<?php header("Content-Type: application/x-web-app-manifest+json"); ?>
+{
+ "version": "1.0",
+ "name": "TweetView",
+ "description": "Overlook of tweets",
+ "icons": {
+ "16": "/img/icon-16.png",
+ "48": "/img/icon-48.png",
+ "128": "/img/icon-128.png"
+ },
+ "developer": {
+ "name": "Robert Nyman",
+ "url": "http://robertnyman.com"
+ },
+ "installs_allowed_from": [
+ "*"
+ ],
+ "launch_path": "/tweetview/index.html",
+ "locales": {
+ },
+ "default_locale": "en"
+}
View
20 mozilla/apps/abbainfo/band.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html class="info-content">
+ <head>
+ <meta charset="utf-8">
+ <title>The Band - ABBAInfo</title>
+ <link rel="stylesheet" href="css/base.css" type="text/css" media="screen">
+ </head>
+
+ <body>
+
+ <div>
+ <p>ABBA was a Swedish pop group formed in Stockholm in 1970, comprising Anni-Frid Lyngstad, Björn Ulvaeus, Benny Andersson and Agnetha Fältskog. They became one of the most commercially successful acts in the history of pop music, topping the charts worldwide from 1972 to 1982. ABBA has sold over 370 million records worldwide,[1][2] which makes them the fourth best-selling music artists in the history of recorded music, behind only The Beatles, Elvis Presley and Michael Jackson. They still sell between two to three million albums a year.[3] ABBA was the first pop group to come from a non-English-speaking country that enjoyed consistent success in the charts of English-speaking countries, including the UK, Ireland, the U.S., Canada, Australia, New Zealand, South Africa and the Philippines. The group also enjoyed significant success in Latin American markets (particularly Mexico, Chile, Peru, Colombia and Argentina), and recorded a collection of their hit songs in Spanish.</p>
+
+ <p>During the band's active years, Fältskog and Ulvaeus were a married couple, as were Lyngstad and Andersson–although both couples later divorced. At the height of their popularity, both relationships were suffering strain which ultimately resulted in the collapse of the Ulvaeus-Fältskog marriage in 1979 and the Andersson-Lyngstad marriage in 1981. As a result, these relationship changes began appearing in the group's music, as they produced more introspective lyrics with different compositions.</p>
+
+ <p>After ABBA broke up in early 1983, Andersson and Ulvaeus achieved success writing music for the stage while Lyngstad and Fältskog pursued individual solo careers with varying success. ABBA's music declined in popularity until several films, notably Muriel's Wedding and The Adventures of Priscilla, Queen of the Desert, revived interest in the group, spawning several tribute bands. In 1999, ABBA's music was adapted into the successful musical Mamma Mia! that toured worldwide. A film of the same name released in 2008 became the highest-grossing film in the United Kingdom that year. The group was inducted into the Rock and Roll Hall of Fame on 15 March 2010.</p>
+ </div>
+ </body>
+</html>
+
View
135 mozilla/apps/abbainfo/css/base.css
@@ -0,0 +1,135 @@
+/* General font styles */
+html {
+ font: 100%/1.3 Verdana, Helvetica, Arial, sans-serif;
+}
+
+body {
+ font: 70%/1.3 Verdana, Helvetica, Arial, sans-serif;
+}
+
+h1 {
+ font: bold 2em Arial, sans-serif;
+}
+
+h2 {
+ font: bold 1.5em Arial, sans-serif;
+}
+
+h3 {
+ font: bold 1.25em Arial, sans-serif;
+}
+
+h4 {
+ font: bold 1.1em Arial, sans-serif;
+}
+
+/* Default resetting */
+html, body, form, fieldset, legend, dt, dd {
+ margin: 0;
+ padding: 0;
+}
+
+h1, h2, h3, h4, h5, h6, p, ul, ol, dl {
+ margin: 0 0 1em;
+ padding: 0;
+}
+
+h1, h2, h3, h4, h5, h6 {
+ margin-bottom: 0.5em;
+}
+
+pre {
+ font-size: 1.5em;
+}
+
+li, dd {
+ margin-left: 1.5em;
+}
+
+img {
+ border: none;
+ vertical-align: middle;
+}
+
+/* Basic element styles */
+a {
+ color: #000;
+}
+
+a:hover {
+ text-decoration: underline;
+}
+
+html {
+ color: #000;
+ background: gold;
+ min-height: 100%;
+}
+
+body {
+ margin-bottom: 30px;
+}
+
+ul {
+ margin: 10px 0;
+}
+
+
+/* Structure */
+.container {
+ min-width: 400px;
+ max-width: 760px;
+ min-height: 600px;
+ background: #fff;
+ border: 1px solid #ccc;
+ border-top: none;
+ margin: 20px auto;
+ padding: 20px;
+ -moz-border-radius: 10px;
+ -webkit-border-radius: 10px;
+ border-radius: 10px;
+ -moz-box-shadow: 1px 1px 10px #000;
+ -webkit-box-shadow: 1px 1px 5px #000;
+ box-shadow: 1px 1px 10px #000;
+}
+
+@media screen and (max-width: 320px) {
+ #container {
+ width: 280px;
+ padding: 10px;
+ }
+}
+
+.nav {
+ float: left;
+ width: 30%;
+}
+
+.main-content {
+ float: right;
+ width: 70%;
+}
+
+.content-frame {
+ width: 100%;
+ height: 500px;
+ /*border: 1px solid red;*/
+}
+
+.info-content {
+ background: #fff;
+}
+
+/* Fullscreen */
+html:-moz-full-screen,
+html:-webkit-full-screen {
+ background: red;
+}
+
+html:-moz-full-screen {
+ background: red;
+}
+
+html:-webkit-full-screen {
+ background: red;
+}
View
15 mozilla/apps/abbainfo/hits.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Biggest hits - ABBAInfo</title>
+ <link rel="stylesheet" href="css/base.css" type="text/css" media="screen">
+ </head>
+
+ <body>
+
+
+ </body>
+ </html>
+
+
View
BIN mozilla/apps/abbainfo/images/icon-128.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN mozilla/apps/abbainfo/images/icon-16.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN mozilla/apps/abbainfo/images/icon-48.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN mozilla/apps/abbainfo/images/icon.psd
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN mozilla/apps/abbainfo/images/logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
46 mozilla/apps/abbainfo/index.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>ABBAInfo</title>
+ <link rel="stylesheet" href="css/base.css" type="text/css" media="screen">
+ <base target="content-frame">
+ </head>
+
+ <body>
+
+ <div class="container">
+ <h1>
+ <img src="images/logo.png" alt="ABBA">
+ </h1>
+
+ <nav id="nav" class="nav">
+ <input type="text">
+ <button id="view-fullscreen">Fullscreen</button>
+ <ul>
+ <li><a href="band.html">The Band</a></li>
+ <li><a href="">Biggest hits</a></li>
+ <li><a href="http://en.wikipedia.org/wiki/ABBA">Wikipedia</a></li>
+ <li><a href="">YouTube</a></li>
+ <li><a href="">Flickr</a></li>
+ <li><a href="">Music service?</a></li>
+ </ul>
+ </nav>
+
+ <section class="main-content">
+ <h2>Welcome to AbbaInfo!</h2>
+ <div>
+ <p>ABBA was a Swedish pop group formed in Stockholm in 1970, comprising Anni-Frid Lyngstad, Björn Ulvaeus, Benny Andersson and Agnetha Fältskog. They became one of the most commercially successful acts in the history of pop music, topping the charts worldwide from 1972 to 1982. ABBA has sold over 370 million records worldwide,[1][2] which makes them the fourth best-selling music artists in the history of recorded music, behind only The Beatles, Elvis Presley and Michael Jackson. They still sell between two to three million albums a year.[3] ABBA was the first pop group to come from a non-English-speaking country that enjoyed consistent success in the charts of English-speaking countries, including the UK, Ireland, the U.S., Canada, Australia, New Zealand, South Africa and the Philippines. The group also enjoyed significant success in Latin American markets (particularly Mexico, Chile, Peru, Colombia and Argentina), and recorded a collection of their hit songs in Spanish.</p>
+
+ <p>During the band's active years, Fältskog and Ulvaeus were a married couple, as were Lyngstad and Andersson–although both couples later divorced. At the height of their popularity, both relationships were suffering strain which ultimately resulted in the collapse of the Ulvaeus-Fältskog marriage in 1979 and the Andersson-Lyngstad marriage in 1981. As a result, these relationship changes began appearing in the group's music, as they produced more introspective lyrics with different compositions.</p>
+
+ <p>After ABBA broke up in early 1983, Andersson and Ulvaeus achieved success writing music for the stage while Lyngstad and Fältskog pursued individual solo careers with varying success. ABBA's music declined in popularity until several films, notably Muriel's Wedding and The Adventures of Priscilla, Queen of the Desert, revived interest in the group, spawning several tribute bands. In 1999, ABBA's music was adapted into the successful musical Mamma Mia! that toured worldwide. A film of the same name released in 2008 became the highest-grossing film in the United Kingdom that year. The group was inducted into the Rock and Roll Hall of Fame on 15 March 2010.</p>
+ </section>
+ </div>
+
+
+ <script src="js/base.js"></script>
+
+
+ </body>
+ </html>
View
21 mozilla/apps/abbainfo/js/base.js
@@ -0,0 +1,21 @@
+(function () {
+ var viewFullScreen = document.getElementById("view-fullscreen");
+ if (viewFullScreen) {
+ viewFullScreen.addEventListener("click", function () {
+ var docElm = document.documentElement;
+ if (docElm.mozRequestFullScreen) {
+ docElm.mozRequestFullScreen();
+ }
+ else if (docElm.webkitRequestFullScreen) {
+ docElm.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT);
+ }
+ }, false);
+ }
+ // Press the R key to reload the page
+ window.addEventListener("keydown", function (evt) {
+ if (evt.keyCode === 82) {
+ location.reload();
+ }
+ }, false);
+})();
+
View
21 mozilla/apps/abbainfo/manifest.webapp
@@ -0,0 +1,21 @@
+{
+ "version": "1.0",
+ "name": "ABBAInfo",
+ "description": "Getting some ABBA info",
+ "icons": {
+ "16": "/abbainfo/images/icon-16.png",
+ "48": "/abbainfo/images/icon-48.png",
+ "128": "/abbainfo/images/icon-128.png"
+ },
+ "developer": {
+ "name": "Robert Nyman",
+ "url": "http://robertnyman.com"
+ },
+ "installs_allowed_from": [
+ "*"
+ ],
+ "launch_path": "/abbainfo/",
+ "locales": {
+ },
+ "default_locale": "en"
+}
View
746 mozilla/apps/css/base.css
@@ -0,0 +1,746 @@
+/* General font styles */
+html {
+ font: 100%/1.3 Verdana, Helvetica, Arial, sans-serif;
+}
+
+body {
+ font: 70%/1.3 Verdana, Helvetica, Arial, sans-serif;
+}
+
+select, table {
+ font-size: 1em;
+}
+
+h1 {
+ font: bold 2em Arial, sans-serif;
+}
+
+h2 {
+ font: bold 1.5em Arial, sans-serif;
+}
+
+h3 {
+ font: bold 1.25em Arial, sans-serif;
+}
+
+h4 {
+ font: bold 1.1em Arial, sans-serif;
+}
+
+/* Default resetting */
+html, body, form, fieldset, legend, dt, dd {
+ margin: 0;
+ padding: 0;
+}
+
+h1, h2, h3, h4, h5, h6, p, ul, ol, dl {
+ margin: 0 0 1em;
+ padding: 0;
+}
+
+h1, h2, h3, h4, h5, h6 {
+ margin-bottom: 0.5em;
+}
+
+pre {
+ font-size: 1.5em;
+}
+
+li, dd {
+ margin-left: 1.5em;
+}
+
+img {
+ border: none;
+ vertical-align: middle;
+}
+
+/* Basic element styles */
+a {
+ color: #000;
+}
+
+a:hover {
+ text-decoration: underline;
+}
+
+html {
+ color: #000;
+ background: #555;
+
+ /* For WebKit (Safari, Google Chrome etc) */
+ background: -webkit-gradient(linear, left top, left bottom, from(#222), to(#555));
+ /* For Mozilla/Gecko (Firefox etc) */
+ background: -moz-linear-gradient(top, #222, #555);
+ /* For Internet Explorer 5.5 - 7 */
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#FF222222, endColorstr=#FF555555);
+ /* For Internet Explorer 8 */
+ -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#FF222222, endColorstr=#FF555555)";
+ min-height: 100%;
+}
+
+body {
+ margin-bottom: 30px;
+}
+
+h1 {
+ color: #6c9af8;
+}
+
+h1 a {
+ position: relative;
+ left: 20px;
+ top: -0.4em;
+ color: #6c9af8;
+ font-size: 0.5em;
+ line-height: 0.5em;
+}
+
+h2 {
+ margin: 1em 0 0.5em;
+ border-bottom: 1px solid #000;
+}
+
+#index-page h3 {
+ border-bottom: 1px solid #000;
+ padding-bottom: 0.5em;
+ margin: 2em 0 1.5em;
+}
+
+pre{
+ background: #eee;
+ padding: 1em;
+ overflow: auto;
+}
+
+dl {
+ overflow: hidden;
+}
+
+dt {
+ font-weight: bold;
+}
+
+input {
+ vertical-align: middle;
+}
+
+table {
+ width: 100%;
+ margin: 0 0 1em;
+}
+
+th, td {
+ text-align: left;
+ padding: 0.5em;
+ border-bottom: 1px solid #ccc;
+}
+
+td {
+ width: 500px;
+ vertical-align: top;
+}
+
+th {
+ width: 180px;
+ border-right: 1px solid #ccc;
+}
+
+thead th {
+ border-color: #000;
+}
+
+th.last {
+ border-right: none;
+}
+
+th.section-title {
+ text-align: center;
+ border-right: none;
+ padding: 1em 0.5em;
+}
+
+tr.even {
+ background: #eee;
+}
+
+
+
+/* Structure */
+#container {
+ width: 760px;
+ min-height: 600px;
+ background: #fff;
+ border: 1px solid #ccc;
+ border-top: none;
+ margin: 20px auto;
+ padding: 20px;
+ -moz-border-radius: 10px;
+ -webkit-border-radius: 10px;
+ border-radius: 10px;
+ -moz-box-shadow: 1px 1px 10px #000;
+ -webkit-box-shadow: 1px 1px 5px #000;
+ box-shadow: 1px 1px 10px #000;
+}
+
+@media screen and (max-width: 320px) {
+ #container {
+ width: 280px;
+ padding: 10px;
+ }
+}
+
+#main-content {
+ overflow: hidden;
+}
+
+.navigation {
+ background: #eee;
+ -moz-border-radius: 5px;
+ -webkit-border-radius: 5px;
+ border-radius: 5px;
+ margin-bottom: 2em;
+ padding: 1em;
+}
+
+.navigation li {
+ margin-bottom: 0.5em;
+}
+
+.navigation h2 {
+ border-bottom: none;
+}
+
+.section {
+ border-bottom: 1px solid #ccc;
+ margin: 2em 0;
+ padding-bottom: 1em;
+}
+
+.browsers {
+ list-display: none;
+ margin: 0;
+}
+
+.browsers li {
+ display: inline-block;
+ width: 60px;
+ text-align: center;
+ vertical-align: top;
+ margin: 0 10px 0 0;
+}
+
+.browsers li img {
+ display: block;
+ margin: 0 auto;
+}
+
+.failed {
+ color: #f00;
+}
+
+
+.statcounter {
+ position: absolute;
+ left: -99999px;
+}
+
+/* HTML5 demos */
+header,
+nav,
+section,
+article,
+aside,
+footer {
+ display: block;
+}
+
+time {
+ display: inline;
+}
+
+#demo-top-nav {
+ margin-bottom: 2em;
+ border-bottom: 1px solid #000;
+}
+
+#demo-main {
+ overflow: hidden;
+}
+
+#demo-main-content {
+ float: left;
+ width: 70%;
+}
+
+#demo-main-content h2,
+#demo-main-content h3 {
+ border-bottom: none;
+ margin: 0 0 5px;
+ padding: 0;
+}
+
+#demo-aside-content {
+ float: right;
+ width: 25%;
+ color: #fff;
+ background: #6c9af8;
+ padding: 5px;
+ -moz-border-radius: 5px;
+ -webkit-border-radius: 5px;
+ border-radius: 5px;
+}
+
+#page-footer {
+ border-top: 1px solid #000;
+ margin-top: 4em;
+ padding-top: 1em;
+}
+
+
+/**
+ * SyntaxHighlighter
+ * http://alexgorbatchev.com/
+ *
+ * SyntaxHighlighter is donationware. If you are using it, please donate.
+ * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
+ *
+ * @version
+ * 2.0.296 (March 01 2009)
+ *
+ * @copyright
+ * Copyright (C) 2004-2009 Alex Gorbatchev.
+ *
+ * @license
+ * This file is part of SyntaxHighlighter.
+ *
+ * SyntaxHighlighter 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, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * SyntaxHighlighter 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 SyntaxHighlighter. If not, see <http://www.gnu.org/licenses/>.
+ */
+.syntaxhighlighter,
+.syntaxhighlighter div,
+.syntaxhighlighter code,
+.syntaxhighlighter span {
+ margin: 0 !important;
+ padding: 0 !important;
+ border: 0 !important;
+ outline: 0 !important;
+ background: none !important;
+ text-align: left !important;
+ float: none !important;
+ vertical-align: baseline !important;
+ position: static !important;
+ left: auto !important;
+ top: auto !important;
+ right: auto !important;
+ bottom: auto !important;
+ height: auto !important;
+ width: auto !important;
+ line-height: 1.2em !important;
+ font-family: "Consolas", "Monaco", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important;
+ font-weight: normal !important;
+ font-style: normal !important;
+ font-size: 13px !important;
+}
+
+.syntaxhighlighter {
+ width: 100% !important;
+ margin: 1em 0 1em 0 !important;
+ padding: 1px !important; /* adds a little border on top and bottom */
+ position: relative !important;
+}
+
+.syntaxhighlighter .bold {
+ font-weight: bold !important;
+}
+
+.syntaxhighlighter .italic {
+ font-style: italic !important;
+}
+
+.syntaxhighlighter .line .number {
+ float: left !important;
+ width: 3em !important;
+ padding-right: .3em !important;
+ text-align: right !important;
+ display: block !important;
+}
+
+/* Disable numbers when no gutter option is set */
+.syntaxhighlighter.nogutter .line .number {
+ display: none !important;
+}
+
+.syntaxhighlighter .line .content {
+ margin-left: 3.3em !important;
+ padding-left: .5em !important;
+ display: block !important;
+}
+
+.syntaxhighlighter .line .content .block {
+ display: block !important;
+ padding-left: 1.5em !important;
+ text-indent: -1.5em !important;
+}
+
+.syntaxhighlighter .line .content .spaces {
+ display: none !important;
+}
+
+/* Disable border and margin on the lines when no gutter option is set */
+.syntaxhighlighter.nogutter .line .content {
+ margin-left: 0 !important;
+ border-left: none !important;
+}
+
+.syntaxhighlighter .bar {
+}
+
+.syntaxhighlighter.collapsed .bar {
+
+}
+
+.syntaxhighlighter.nogutter .ruler {
+ margin-left: 0 !important;
+ padding-left: 0 !important;
+}
+
+.syntaxhighlighter .ruler {
+ padding: 0 0 .5em .5em !important;
+ margin-left: 3.3em !important;
+ overflow: hidden !important;
+}
+
+/* Adjust some properties when collapsed */
+
+.syntaxhighlighter.collapsed .lines,
+.syntaxhighlighter.collapsed .ruler {
+ display: none !important;
+}
+
+/* Styles for the toolbar */
+
+.syntaxhighlighter .toolbar {
+ position: absolute !important;
+ right: 0px !important;
+ top: 0px !important;
+ font-size: 1px !important;
+ padding: 8px 8px 8px 0 !important; /* in px because images don't scale with ems */
+}
+
+.syntaxhighlighter.collapsed .toolbar {
+ font-size: 80% !important;
+ padding: .2em 0 .5em .5em !important;
+ position: static !important;
+}
+
+.syntaxhighlighter .toolbar a.item,
+.syntaxhighlighter .toolbar .item {
+ display: block !important;
+ float: left !important;
+ margin-left: 8px !important;
+ background-repeat: no-repeat !important;
+ overflow: hidden !important;
+ text-indent: -5000px !important;
+}
+
+.syntaxhighlighter.collapsed .toolbar .item {
+ display: none !important;
+}
+
+.syntaxhighlighter.collapsed .toolbar .item.expandSource {
+ background-image: url(../syntax-highlighter/styles/magnifier.png) !important;
+ display: inline !important;
+ text-indent: 0 !important;
+ width: auto !important;
+ float: none !important;
+ height: 16px !important;
+ padding-left: 20px !important;
+}
+
+.syntaxhighlighter .toolbar .item.viewSource {
+ background-image: url(../syntax-highlighter/styles/page_white_code.png) !important;
+}
+
+.syntaxhighlighter .toolbar .item.printSource {
+ background-image: url(../syntax-highlighter/styles/printer.png) !important;
+}
+
+.syntaxhighlighter .toolbar .item.copyToClipboard {
+ text-indent: 0 !important;
+ background: none !important;
+ overflow: visible !important;
+}
+
+.syntaxhighlighter .toolbar .item.about {
+ background-image: url(../syntax-highlighter/styles/help.png) !important;
+}
+
+/**
+ * Print view.
+ * Colors are based on the default theme without background.
+ */
+
+.syntaxhighlighter.printing,
+.syntaxhighlighter.printing .line.alt1 .content,
+.syntaxhighlighter.printing .line.alt2 .content,
+.syntaxhighlighter.printing .line.highlighted .number,
+.syntaxhighlighter.printing .line.highlighted.alt1 .content,
+.syntaxhighlighter.printing .line.highlighted.alt2 .content,
+.syntaxhighlighter.printing .line .content .block {
+ background: none !important;
+}
+
+/* Gutter line numbers */
+.syntaxhighlighter.printing .line .number {
+ color: #bbb !important;
+}
+
+/* Add border to the lines */
+.syntaxhighlighter.printing .line .content {
+ color: #000 !important;
+}
+
+/* Toolbar when visible */
+.syntaxhighlighter.printing .toolbar,
+.syntaxhighlighter.printing .ruler {
+ display: none !important;
+}
+
+.syntaxhighlighter.printing a {
+ text-decoration: none !important;
+}
+
+.syntaxhighlighter.printing .plain,
+.syntaxhighlighter.printing .plain a {
+ color: #000 !important;
+}
+
+.syntaxhighlighter.printing .comments,
+.syntaxhighlighter.printing .comments a {
+ color: #008200 !important;
+}
+
+.syntaxhighlighter.printing .string,
+.syntaxhighlighter.printing .string a {
+ color: blue !important;
+}
+
+.syntaxhighlighter.printing .keyword {
+ color: #069 !important;
+ font-weight: bold !important;
+}
+
+.syntaxhighlighter.printing .preprocessor {
+ color: gray !important;
+}
+
+.syntaxhighlighter.printing .variable {
+ color: #a70 !important;
+}
+
+.syntaxhighlighter.printing .value {
+ color: #090 !important;
+}
+
+.syntaxhighlighter.printing .functions {
+ color: #ff1493 !important;
+}
+
+.syntaxhighlighter.printing .constants {
+ color: #0066CC !important;
+}
+
+.syntaxhighlighter.printing .script {
+ font-weight: bold !important;
+}
+
+.syntaxhighlighter.printing .color1,
+.syntaxhighlighter.printing .color1 a {
+ color: #808080 !important;
+}
+
+.syntaxhighlighter.printing .color2,
+.syntaxhighlighter.printing .color2 a {
+ color: #ff1493 !important;
+}
+
+.syntaxhighlighter.printing .color3,
+.syntaxhighlighter.printing .color3 a {
+ color: red !important;
+}
+
+/**
+ * SyntaxHighlighter
+ * http://alexgorbatchev.com/
+ *
+ * SyntaxHighlighter is donationware. If you are using it, please donate.
+ * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
+ *
+ * @version
+ * 2.0.296 (March 01 2009)
+ *
+ * @copyright
+ * Copyright (C) 2004-2009 Alex Gorbatchev.
+ *
+ * @license
+ * This file is part of SyntaxHighlighter.
+ *
+ * SyntaxHighlighter 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, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * SyntaxHighlighter 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 SyntaxHighlighter. If not, see <http://www.gnu.org/licenses/>.
+ */
+/************************************
+ * Default Syntax Highlighter theme.
+ *
+ * Interface elements.
+ ************************************/
+
+.syntaxhighlighter {
+ background-color: #E7E5DC !important;
+}
+
+/* Highlighed line number */
+.syntaxhighlighter .line.highlighted .number {
+ background-color: #6CE26C !important;
+ color: black !important;
+}
+
+/* Highlighed line */
+.syntaxhighlighter .line.highlighted.alt1 .content,
+.syntaxhighlighter .line.highlighted.alt2 .content {
+ background-color: #6CE26C !important;
+}
+
+/* Gutter line numbers */
+.syntaxhighlighter .line .number {
+ color: #5C5C5C !important;
+}
+
+/* Add border to the lines */
+.syntaxhighlighter .line .content {
+ border-left: 3px solid #6CE26C !important;
+ color: #000 !important;
+}
+
+.syntaxhighlighter.printing .line .content {
+ border: 0 !important;
+}
+
+/* First line */
+.syntaxhighlighter .line.alt1 .content {
+ background-color: #fff !important;
+}
+
+/* Second line */
+.syntaxhighlighter .line.alt2 .content {
+ background-color: #F8F8F8 !important;
+}
+
+.syntaxhighlighter .line .content .block {
+ background: url(/syntax-highlighter/styles/wrapping.png) 0 1.1em no-repeat !important;
+}
+
+.syntaxhighlighter .ruler {
+ color: silver !important;
+ background-color: #F8F8F8 !important;
+ border-left: 3px solid #6CE26C !important;
+}
+
+.syntaxhighlighter.nogutter .ruler {
+ border: 0 !important;
+}
+
+.syntaxhighlighter .toolbar {
+ background-color: #F8F8F8 !important;
+ border: #E7E5DC solid 1px !important;
+}
+
+.syntaxhighlighter .toolbar a {
+ color: #a0a0a0 !important;
+}
+
+.syntaxhighlighter .toolbar a:hover {
+ color: red !important;
+}
+
+/************************************
+ * Actual syntax highlighter colors.
+ ************************************/
+.syntaxhighlighter .plain,
+.syntaxhighlighter .plain a {
+ color: #000 !important;
+}
+
+.syntaxhighlighter .comments,
+.syntaxhighlighter .comments a {
+ color: #008200 !important;
+}
+
+.syntaxhighlighter .string,
+.syntaxhighlighter .string a {
+ color: blue !important;
+}
+
+.syntaxhighlighter .keyword {
+ color: #069 !important;
+ font-weight: bold !important;
+}
+
+.syntaxhighlighter .preprocessor {
+ color: gray !important;
+}
+
+.syntaxhighlighter .variable {
+ color: #a70 !important;
+}
+
+.syntaxhighlighter .value {
+ color: #090 !important;
+}
+
+.syntaxhighlighter .functions {
+ color: #ff1493 !important;
+}
+
+.syntaxhighlighter .constants {
+ color: #0066CC !important;
+}
+
+.syntaxhighlighter .script {
+ background-color: yellow !important;
+}
+
+.syntaxhighlighter .color1,
+.syntaxhighlighter .color1 a {
+ color: #808080 !important;
+}
+
+.syntaxhighlighter .color2,
+.syntaxhighlighter .color2 a {
+ color: #ff1493 !important;
+}
+
+.syntaxhighlighter .color3,
+.syntaxhighlighter .color3 a {
+ color: red !important;
+}
View
1,094 mozilla/apps/include.complete.js
@@ -0,0 +1,1094 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (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.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is include.js; substantial portions derived
+ * from XAuth code originally produced by Meebo, Inc., and provided
+ * under the Apache License, Version 2.0; see http://github.com/xauth/xauth
+ *
+ * Contributor(s):
+ * Michael Hanson <mhanson@mozilla.com>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+/**
+ 2010-07-14
+ First version of app client code
+ -Michael Hanson. Mozilla
+
+ 2010-10-29
+ Major revision of app client code, using jschannel for cross
+ document communication.
+ -Lloyd Hilaiel. Mozilla
+**/
+
+// inject into navigator.mozApps if it doesn't exist
+if (!navigator.mozApps) {
+ navigator.mozApps = {};
+}
+
+// inject if navigator.mozApps.install isn't defined or if
+// navigator.mozApps.html5Implementation is true (this latter check
+// works around bad firefox behavior which doesn't properly
+// restoring navigator.XXX to a pristine state upon reload)
+if (!navigator.mozApps.install || navigator.mozApps.html5Implementation) {
+ navigator.mozApps = (function() {
+
+ ////////////////////////////////////////////////////////////
+ // an inline copy of jschannel - http://github.com/mozilla/jschannel
+ // this library simplifies communication with an iframe served from
+ // myapps.mozillalabs.com - the "application repository"
+ // START jschannel.js
+ /**
+ * js_channel is a very lightweight abstraction on top of
+ * postMessage which defines message formats and semantics
+ * to support interactions more rich than just message passing
+ * js_channel supports:
+ * + query/response - traditional rpc
+ * + query/update/response - incremental async return of results
+ * to a query
+ * + notifications - fire and forget
+ * + error handling
+ *
+ * js_channel is based heavily on json-rpc, but is focused at the
+ * problem of inter-iframe RPC.
+ *
+ * Message types:
+ * There are 5 types of messages that can flow over this channel,
+ * and you may determine what type of message an object is by
+ * examining its parameters:
+ * 1. Requests
+ * + integer id
+ * + string method
+ * + (optional) any params
+ * 2. Callback Invocations (or just "Callbacks")
+ * + integer id
+ * + string callback
+ * + (optional) params
+ * 3. Error Responses (or just "Errors)
+ * + integer id
+ * + string error
+ * + (optional) string message
+ * 4. Responses
+ * + integer id
+ * + (optional) any result
+ * 5. Notifications
+ * + string method
+ * + (optional) any params
+ */
+
+ var Channel = (function() {
+ // current transaction id, start out at a random *odd* number between 1 and a million
+ // There is one current transaction counter id per page, and it's shared between
+ // channel instances. That means of all messages posted from a single javascript
+ // evaluation context, we'll never have two with the same id.
+ var s_curTranId = Math.floor(Math.random()*1000001);
+
+ // no two bound channels in the same javascript evaluation context may have the same origin & scope.
+ // futher if two bound channels have the same scope, they may not have *overlapping* origins
+ // (either one or both support '*'). This restriction allows a single onMessage handler to efficiently
+ // route messages based on origin and scope. The s_boundChans maps origins to scopes, to message
+ // handlers. Request and Notification messages are routed using this table.
+ // Finally, channels are inserted into this table when built, and removed when destroyed.
+ var s_boundChans = { };
+
+ // add a channel to s_boundChans, throwing if a dup exists
+ function s_addBoundChan(origin, scope, handler) {
+ // does she exist?
+ var exists = false;
+ if (origin === '*') {
+ // we must check all other origins, sadly.
+ for (var k in s_boundChans) {
+ if (!s_boundChans.hasOwnProperty(k)) continue;
+ if (k === '*') continue;
+ if (typeof s_boundChans[k][scope] === 'object') {
+ exists = true;
+ }
+ }
+ } else {
+ // we must check only '*'
+ if ((s_boundChans['*'] && s_boundChans['*'][scope]) ||
+ (s_boundChans[origin] && s_boundChans[origin][scope]))
+ {
+ exists = true;
+ }
+ }
+ if (exists) throw "A channel already exists which overlaps with origin '"+ origin +"' and has scope '"+scope+"'";
+
+ if (typeof s_boundChans[origin] != 'object') s_boundChans[origin] = { };
+ s_boundChans[origin][scope] = handler;
+ }
+
+ function s_removeBoundChan(origin, scope) {
+ delete s_boundChans[origin][scope];
+ // possibly leave a empty object around. whatevs.
+ }
+
+ function s_isArray(obj) {
+ if (Array.isArray) return Array.isArray(obj);
+ else {
+ return (obj.constructor.toString().indexOf("Array") != -1);
+ }
+ }
+
+ // No two outstanding outbound messages may have the same id, period. Given that, a single table
+ // mapping "transaction ids" to message handlers, allows efficient routing of Callback, Error, and
+ // Response messages. Entries are added to this table when requests are sent, and removed when
+ // responses are received.
+ var s_transIds = { };
+
+ // class singleton onMessage handler
+ // this function is registered once and all incoming messages route through here. This
+ // arrangement allows certain efficiencies, message data is only parsed once and dispatch
+ // is more efficient, especially for large numbers of simultaneous channels.
+ var s_onMessage = function(e) {
+ var m = JSON.parse(e.data);
+ if (typeof m !== 'object') return;
+
+ var o = e.origin;
+ var s = null;
+ var i = null;
+ var meth = null;
+
+ if (typeof m.method === 'string') {
+ var ar = m.method.split('::');
+ if (ar.length == 2) {
+ s = ar[0];
+ meth = ar[1];
+ } else {
+ meth = m.method;
+ }
+ }
+
+ if (typeof m.id !== 'undefined') i = m.id;
+
+ // o is message origin
+ // m is parsed message
+ // s is message scope
+ // i is message id (or null)
+ // meth is unscoped method name
+ // ^^ based on these factors we can route the message
+
+ // if it has a method it's either a notification or a request,
+ // route using s_boundChans
+ if (typeof meth === 'string') {
+ if (s_boundChans[o] && s_boundChans[o][s]) {
+ s_boundChans[o][s](o, meth, m);
+ } else if (s_boundChans['*'] && s_boundChans['*'][s]) {
+ s_boundChans['*'][s](o, meth, m);
+ }
+ }
+ // otherwise it must have an id (or be poorly formed
+ else if (typeof i != 'undefined') {
+ if (s_transIds[i]) s_transIds[i](o, meth, m);
+ }
+ };
+
+ // Setup postMessage event listeners
+ if (window.addEventListener) window.addEventListener('message', s_onMessage, false);
+ else if(window.attachEvent) window.attachEvent('onmessage', s_onMessage);
+
+ /* a messaging channel is constructed from a window and an origin.
+ * the channel will assert that all messages received over the
+ * channel match the origin
+ *
+ * Arguments to Channel.build(cfg):
+ *
+ * cfg.window - the remote window with which we'll communication
+ * cfg.origin - the expected origin of the remote window, may be '*'
+ * which matches any origin
+ * cfg.scope - the 'scope' of messages. a scope string that is
+ * prepended to message names. local and remote endpoints
+ * of a single channel must agree upon scope. Scope may
+ * not contain double colons ('::').
+ * cfg.debugOutput - A boolean value. If true and window.console.log is
+ * a function, then debug strings will be emitted to that
+ * function.
+ * cfg.debugOutput - A boolean value. If true and window.console.log is
+ * a function, then debug strings will be emitted to that
+ * function.
+ * cfg.postMessageObserver - A function that will be passed two arguments,
+ * an origin and a message. It will be passed these immediately
+ * before messages are posted.
+ * cfg.gotMessageObserver - A function that will be passed two arguments,
+ * an origin and a message. It will be passed these arguments
+ * immediately after they pass scope and origin checks, but before
+ * they are processed.
+ * cfg.onReady - A function that will be invoked when a channel becomes "ready",
+ * this occurs once both sides of the channel have been
+ * instantiated and an application level handshake is exchanged.
+ * the onReady function will be passed a single argument which is
+ * the channel object that was returned from build().
+ */
+ return {
+ build: function(cfg) {
+ var debug = function(m) {
+ if (cfg.debugOutput && window.console && window.console.log) {
+ // try to stringify, if it doesn't work we'll let javascript's built in toString do its magic
+ try { if (typeof m !== 'string') m = JSON.stringify(m); } catch(e) { }
+ console.log("["+chanId+"] " + m);
+ }
+ }
+
+ /* browser capabilities check */
+ if (!window.postMessage) throw("jschannel cannot run this browser, no postMessage");
+ if (!window.JSON || !window.JSON.stringify || ! window.JSON.parse) {
+ throw("jschannel cannot run this browser, no JSON parsing/serialization");
+ }
+
+ /* basic argument validation */
+ if (typeof cfg != 'object') throw("Channel build invoked without a proper object argument");
+
+ if (!cfg.window || !cfg.window.postMessage) throw("Channel.build() called without a valid window argument");
+
+ /* we'd have to do a little more work to be able to run multiple channels that intercommunicate the same
+ * window... Not sure if we care to support that */
+ if (window === cfg.window) throw("target window is same as present window -- not allowed");
+
+ // let's require that the client specify an origin. if we just assume '*' we'll be
+ // propagating unsafe practices. that would be lame.
+ var validOrigin = false;
+ if (typeof cfg.origin === 'string') {
+ var oMatch;
+ if (cfg.origin === "*") validOrigin = true;
+ // allow valid domains under http and https. Also, trim paths off otherwise valid origins.
+ else if (null !== (oMatch = cfg.origin.match(/^https?:\/\/(?:[-a-zA-Z0-9\.])+(?::\d+)?/))) {
+ cfg.origin = oMatch[0];
+ validOrigin = true;
+ }
+ }
+
+ if (!validOrigin) throw ("Channel.build() called with an invalid origin");
+
+ if (typeof cfg.scope !== 'undefined') {
+ if (typeof cfg.scope !== 'string') throw 'scope, when specified, must be a string';
+ if (cfg.scope.split('::').length > 1) throw "scope may not contain double colons: '::'"
+ }
+
+ /* private variables */
+ // generate a random and psuedo unique id for this channel
+ var chanId = (function () {
+ var text = "";
+ var alpha = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
+ for(var i=0; i < 5; i++) text += alpha.charAt(Math.floor(Math.random() * alpha.length));
+ return text;
+ })();
+
+ // registrations: mapping method names to call objects
+ var regTbl = { };
+ // current oustanding sent requests
+ var outTbl = { };
+ // current oustanding received requests
+ var inTbl = { };
+ // are we ready yet? when false we will block outbound messages.
+ var ready = false;
+ var pendingQueue = [ ];
+
+ var createTransaction = function(id,origin,callbacks) {
+ var shouldDelayReturn = false;
+ var completed = false;
+
+ return {
+ origin: origin,
+ invoke: function(cbName, v) {
+ // verify in table
+ if (!inTbl[id]) throw "attempting to invoke a callback of a non-existant transaction: " + id;
+ // verify that the callback name is valid
+ var valid = false;
+ for (var i = 0; i < callbacks.length; i++) if (cbName === callbacks[i]) { valid = true; break; }
+ if (!valid) throw "request supports no such callback '" + cbName + "'";
+
+ // send callback invocation
+ postMessage({ id: id, callback: cbName, params: v});
+ },
+ error: function(error, message) {
+ completed = true;
+ // verify in table
+ if (!inTbl[id]) throw "error called for non-existant message: " + id;
+
+ // remove transaction from table
+ delete inTbl[id];
+
+ // send error
+ postMessage({ id: id, error: error, message: message });
+ },
+ complete: function(v) {
+ completed = true;
+ // verify in table
+ if (!inTbl[id]) throw "complete called for non-existant message: " + id;
+ // remove transaction from table
+ delete inTbl[id];
+ // send complete
+ postMessage({ id: id, result: v });
+ },
+ delayReturn: function(delay) {
+ if (typeof delay === 'boolean') {
+ shouldDelayReturn = (delay === true);
+ }
+ return shouldDelayReturn;
+ },
+ completed: function() {
+ return completed;
+ }
+ };
+ }
+
+ var onMessage = function(origin, method, m) {
+ // if an observer was specified at allocation time, invoke it
+ if (typeof cfg.gotMessageObserver === 'function') {
+ // pass observer a clone of the object so that our
+ // manipulations are not visible (i.e. method unscoping).
+ // This is not particularly efficient, but then we expect
+ // that message observers are primarily for debugging anyway.
+ try {
+ cfg.gotMessageObserver(origin, m);
+ } catch (e) {
+ debug("gotMessageObserver() raised an exception: " + e.toString());
+ }
+ }
+
+ // now, what type of message is this?
+ if (m.id && method) {
+ // a request! do we have a registered handler for this request?
+ if (regTbl[method]) {
+ var trans = createTransaction(m.id, origin, m.callbacks ? m.callbacks : [ ]);
+ inTbl[m.id] = { };
+ try {
+ // callback handling. we'll magically create functions inside the parameter list for each
+ // callback
+ if (m.callbacks && s_isArray(m.callbacks) && m.callbacks.length > 0) {
+ for (var i = 0; i < m.callbacks.length; i++) {
+ var path = m.callbacks[i];
+ var obj = m.params;
+ var pathItems = path.split('/');
+ for (var j = 0; j < pathItems.length - 1; j++) {
+ var cp = pathItems[j];
+ if (typeof obj[cp] !== 'object') obj[cp] = { };
+ obj = obj[cp];
+ }
+ obj[pathItems[pathItems.length - 1]] = (function() {
+ var cbName = path;
+ return function(params) {
+ return trans.invoke(cbName, params);
+ }
+ })();
+ }
+ }
+ var resp = regTbl[method](trans, m.params);
+ if (!trans.delayReturn() && !trans.completed()) trans.complete(resp);
+ } catch(e) {
+ // automagic handling of exceptions:
+ var error = "runtime_error";
+ var message = null;
+ // * if its a string then it gets an error code of 'runtime_error' and string is the message
+ if (typeof e === 'string') {
+ message = e;
+ } else if (typeof e === 'object') {
+ // either an array or an object
+ // * if its an array of length two, then array[0] is the code, array[1] is the error message
+ if (e && s_isArray(e) && e.length == 2) {
+ error = e[0];
+ message = e[1];
+ }
+ // * if its an object then we'll look form error and message parameters
+ else if (typeof e.error === 'string') {
+ error = e.error;
+ if (!e.message) message = "";
+ else if (typeof e.message === 'string') message = e.message;
+ else e = e.message; // let the stringify/toString message give us a reasonable verbose error string
+ }
+ }
+
+ // message is *still* null, let's try harder
+ if (message === null) {
+ try {
+ message = JSON.stringify(e);
+ } catch (e2) {
+ message = e.toString();
+ }
+ }
+
+ trans.error(error,message);
+ }
+ }
+ } else if (m.id && m.callback) {
+ if (!outTbl[m.id] ||!outTbl[m.id].callbacks || !outTbl[m.id].callbacks[m.callback])
+ {
+ debug("ignoring invalid callback, id:"+m.id+ " (" + m.callback +")");
+ } else {
+ // XXX: what if client code raises an exception here?
+ outTbl[m.id].callbacks[m.callback](m.params);
+ }
+ } else if (m.id) {
+ if (!outTbl[m.id]) {
+ debug("ignoring invalid response: " + m.id);
+ } else {
+ // XXX: what if client code raises an exception here?
+ if (m.error) {
+ (1,outTbl[m.id].error)(m.error, m.message);
+ } else {
+ if (m.result !== undefined) (1,outTbl[m.id].success)(m.result);
+ else (1,outTbl[m.id].success)();
+ }
+ delete outTbl[m.id];
+ delete s_transIds[m.id];
+ }
+ } else if (method) {
+ // tis a notification.
+ if (regTbl[method]) {
+ // yep, there's a handler for that.
+ // transaction is null for notifications.
+ regTbl[method](null, m.params);
+ // if the client throws, we'll just let it bubble out
+ // what can we do? Also, here we'll ignore return values
+ }
+ }
+ }
+
+ // now register our bound channel for msg routing
+ s_addBoundChan(cfg.origin, ((typeof cfg.scope === 'string') ? cfg.scope : ''), onMessage);
+
+ // scope method names based on cfg.scope specified when the Channel was instantiated
+ var scopeMethod = function(m) {
+ if (typeof cfg.scope === 'string' && cfg.scope.length) m = [cfg.scope, m].join("::");
+ return m;
+ }
+
+ // a small wrapper around postmessage whose primary function is to handle the
+ // case that clients start sending messages before the other end is "ready"
+ var postMessage = function(msg, force) {
+ if (!msg) throw "postMessage called with null message";
+
+ // delay posting if we're not ready yet.
+ var verb = (ready ? "post " : "queue ");
+ debug(verb + " message: " + JSON.stringify(msg));
+ if (!force && !ready) {
+ pendingQueue.push(msg);
+ } else {
+ if (typeof cfg.postMessageObserver === 'function') {
+ try {
+ cfg.postMessageObserver(cfg.origin, msg);
+ } catch (e) {
+ debug("postMessageObserver() raised an exception: " + e.toString());
+ }
+ }
+
+ cfg.window.postMessage(JSON.stringify(msg), cfg.origin);
+ }
+ }
+
+ var onReady = function(trans, type) {
+ debug('ready msg received');
+ if (ready) throw "received ready message while in ready state. help!";
+
+ if (type === 'ping') {
+ chanId += '-R';
+ } else {
+ chanId += '-L';
+ }
+
+ obj.unbind('__ready'); // now this handler isn't needed any more.
+ ready = true;
+ debug('ready msg accepted.');
+
+ if (type === 'ping') {
+ obj.notify({ method: '__ready', params: 'pong' });
+ }
+
+ // flush queue
+ while (pendingQueue.length) {
+ postMessage(pendingQueue.pop());
+