├── splash.9.png
├── www
├── assets
│ ├── 1.jpg
│ ├── 2.jpg
│ ├── 3.jpg
│ ├── 4.jpg
│ ├── 5.jpg
│ ├── mcfly.jpg
│ ├── delorean.jpg
│ ├── search.svg
│ ├── home.svg
│ ├── gear.svg
│ └── cog.svg
├── lang
│ ├── local-he.json
│ └── local-en.json
├── scripts
│ └── application.js
├── js
│ ├── models
│ │ └── NoteModel.js
│ ├── common
│ │ ├── catchall
│ │ │ └── catchall.js
│ │ ├── localizer
│ │ │ ├── libs
│ │ │ │ └── jquery-loader.js
│ │ │ └── dist
│ │ │ │ └── jquery.localize.js
│ │ ├── gsap
│ │ │ ├── plugins
│ │ │ │ ├── EndArrayPlugin.js
│ │ │ │ ├── AttrPlugin.js
│ │ │ │ ├── RoundPropsPlugin.js
│ │ │ │ ├── DirectionalRotationPlugin.js
│ │ │ │ ├── TextPlugin.js
│ │ │ │ ├── CSSRulePlugin.js
│ │ │ │ ├── ColorPropsPlugin.js
│ │ │ │ ├── ScrollToPlugin.js
│ │ │ │ ├── TEMPLATE_Plugin.js
│ │ │ │ ├── EaselPlugin.js
│ │ │ │ └── KineticPlugin.js
│ │ │ ├── jquery.gsap.js
│ │ │ └── easing
│ │ │ │ └── EasePack.js
│ │ ├── rc4
│ │ │ ├── RC4V2.js
│ │ │ └── RC4.js
│ │ ├── base64
│ │ │ └── jquery.base64.js
│ │ ├── backbone-controller
│ │ │ └── backbone.controller.js
│ │ ├── backbone-stickit
│ │ │ ├── backbone.stickit.min.js
│ │ │ └── docs
│ │ │ │ └── annotated
│ │ │ │ └── docco.css
│ │ └── comBroker
│ │ │ └── ComBroker.js
│ ├── elements
│ │ ├── DrawerElems.js
│ │ ├── SettingsElems.js
│ │ ├── CommPageElems.js
│ │ ├── CoolAnimElems.js
│ │ └── Elems.js
│ ├── CommPage.js
│ ├── CoolAnim.js
│ ├── setup.js
│ ├── views
│ │ ├── PageView.js
│ │ ├── LanguageSelectorView.js
│ │ ├── CommPageView.js
│ │ └── CoolAnimView.js
│ ├── collections
│ │ ├── AuthCollection.js
│ │ └── LocalCollection.js
│ ├── Settings.js
│ ├── Drawer.js
│ └── Index.js
├── loading.html
├── native-styles
│ ├── ios.css
│ └── android.css
├── pages
│ ├── CommPage.html
│ ├── Drawer.html
│ ├── Modal.html
│ ├── Settings.html
│ └── CoolAnimPage.html
├── init.js
├── index.html
└── stylesheets
│ └── application.css
├── .gitignore
├── .idea
└── dictionaries
│ └── Sean.xml
├── bower.json
├── package.json
├── Gruntfile.js
├── BackSteroids.iml
├── config
├── app.coffee
└── structure.coffee
└── README.md
/splash.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/born2net/BackSteroids/HEAD/splash.9.png
--------------------------------------------------------------------------------
/www/assets/1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/born2net/BackSteroids/HEAD/www/assets/1.jpg
--------------------------------------------------------------------------------
/www/assets/2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/born2net/BackSteroids/HEAD/www/assets/2.jpg
--------------------------------------------------------------------------------
/www/assets/3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/born2net/BackSteroids/HEAD/www/assets/3.jpg
--------------------------------------------------------------------------------
/www/assets/4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/born2net/BackSteroids/HEAD/www/assets/4.jpg
--------------------------------------------------------------------------------
/www/assets/5.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/born2net/BackSteroids/HEAD/www/assets/5.jpg
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | /dist
3 | node_modules
4 | bower_components
5 | .sass-cache/
6 | logs/
--------------------------------------------------------------------------------
/www/assets/mcfly.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/born2net/BackSteroids/HEAD/www/assets/mcfly.jpg
--------------------------------------------------------------------------------
/www/assets/delorean.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/born2net/BackSteroids/HEAD/www/assets/delorean.jpg
--------------------------------------------------------------------------------
/www/lang/local-he.json:
--------------------------------------------------------------------------------
1 | {
2 | "toToAnimPage": "לעבור לדף אנימציה",
3 | "navBarTitleLocal": "ברוכים הבאים",
4 | "getServerTime": "זמן שרת"
5 | }
6 |
7 |
8 |
--------------------------------------------------------------------------------
/www/lang/local-en.json:
--------------------------------------------------------------------------------
1 | {
2 | "toToAnimPage": "Go to Animation page",
3 | "navBarTitleLocal": "Welcome to BackRoids",
4 | "getServerTime": "Get Server Time"
5 | }
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/dictionaries/Sean.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | gyver's
5 |
6 |
7 |
--------------------------------------------------------------------------------
/bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "mobFasterQ",
3 | "version": "0.0.0",
4 | "private": true,
5 | "dependencies": {
6 | "angular": "1.3.x",
7 | "supersonic": "1.x"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "mobFasterQ",
3 | "version": "0.0.0",
4 | "private": true,
5 | "dependencies": {},
6 | "devDependencies": {
7 | "grunt-steroids": "1.x"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/www/scripts/application.js:
--------------------------------------------------------------------------------
1 | angular.module('SteroidsApplication', [
2 | 'supersonic'
3 | ])
4 | .controller('IndexController', function($scope, supersonic) {
5 | //$scope.navbarTitle = "Welcome to FasterQ";
6 | });
7 |
--------------------------------------------------------------------------------
/Gruntfile.js:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | Default Gruntfile for AppGyver Steroids
4 | http://www.appgyver.com
5 | Licensed under the MIT license.
6 |
7 | */
8 |
9 | module.exports = function(grunt) {
10 | grunt.loadNpmTasks("grunt-steroids");
11 | grunt.registerTask("default", [
12 | "steroids-make-fresh"
13 | ]);
14 | }
15 |
--------------------------------------------------------------------------------
/www/assets/search.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/www/assets/home.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/BackSteroids.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/www/js/models/NoteModel.js:
--------------------------------------------------------------------------------
1 | /**
2 | Settings Backbone > View
3 | @class NoteModel
4 | @constructor
5 | @return {Object} instantiated FQCreatorView
6 | **/
7 | define(['jquery', 'backbone'], function ($, Backbone) {
8 |
9 |
10 | var NoteModel = Backbone.Model.extend({
11 | urlRoot: 'https://secure.digitalsignage.com:443/GetDateTime'
12 | });
13 |
14 | return NoteModel;
15 | });
16 |
17 |
18 |
--------------------------------------------------------------------------------
/www/assets/gear.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/www/js/common/catchall/catchall.js:
--------------------------------------------------------------------------------
1 | window.onerror = function (msg, url, line, col, error) {
2 | if (window.debug == undefined || window.debug){
3 | var extra = !col ? '' : '\ncolumn: ' + col;
4 | extra += !error ? '' : '\nerror: ' + error;
5 | alert("err 1: " + msg + "\nurl: " + url + "\nline: " + line + extra);
6 | var suppressErrorAlert = true;
7 | // If you return true, then error alerts (like in older versions of
8 | // Internet Explorer) will be suppressed.
9 | return suppressErrorAlert;
10 | }
11 | };
12 |
--------------------------------------------------------------------------------
/www/js/common/localizer/libs/jquery-loader.js:
--------------------------------------------------------------------------------
1 | (function() {
2 | // Default to the local version.
3 | var path = '../libs/jquery/jquery.js';
4 | // Get any jquery=___ param from the query string.
5 | var jqversion = location.search.match(/[?&]jquery=(.*?)(?=&|$)/);
6 | // If a version was specified, use that version from code.jquery.com.
7 | if (jqversion) {
8 | path = 'http://code.jquery.com/jquery-' + jqversion[1] + '.js';
9 | }
10 | // This is the only time I'll ever use document.write, I promise!
11 | document.write('');
12 | }());
13 |
--------------------------------------------------------------------------------
/www/js/elements/DrawerElems.js:
--------------------------------------------------------------------------------
1 | /**
2 | Settings Backbone > View
3 | @class DrawerElems
4 | @constructor
5 | @return {Object} instantiated FQCreatorView
6 | **/
7 | define(['jquery', 'backbone'], function ($, Backbone) {
8 |
9 | var DrawerElems = Backbone.View.extend({
10 |
11 | initialize: function () {
12 | // elements
13 | this.PASS1 = '#pass1';
14 | this.PASS2 = '#pass2';
15 | this.DRAWER_CLOSE = '#drawerClose';
16 |
17 | // templates
18 |
19 | // classes
20 | }
21 | });
22 |
23 | return DrawerElems;
24 | });
25 |
26 |
27 |
--------------------------------------------------------------------------------
/www/js/elements/SettingsElems.js:
--------------------------------------------------------------------------------
1 | /**
2 | SettingsElems Backbone > View
3 | @class SettingsElems elements
4 | @constructor
5 | @return {Object} instantiated SettingsElems
6 | **/
7 | define(['jquery', 'backbone'], function ($, Backbone) {
8 |
9 | var SettingsElems = Backbone.View.extend({
10 |
11 | initialize: function () {
12 |
13 | // elements
14 | this.TOGGLE_TABS = '#toggleTabs';
15 | this.OPEN_MODEL_VIEW = '#openModelView';
16 |
17 | // templates
18 |
19 | // classes
20 | }
21 | });
22 |
23 | return SettingsElems;
24 | });
25 |
26 |
27 |
--------------------------------------------------------------------------------
/www/js/elements/CommPageElems.js:
--------------------------------------------------------------------------------
1 | /**
2 | CommPageElems Backbone > View
3 | @class CommPageElems elements
4 | @constructor
5 | @return {Object} instantiated CommPageElems
6 | **/
7 | define(['jquery', 'backbone'], function ($, Backbone) {
8 |
9 | var CommPageElems = Backbone.View.extend({
10 |
11 | initialize: function () {
12 |
13 | // elements
14 | this.FIELD1 = '#field1';
15 | this.FIELD2 = '#field2';
16 | this.FIELD3 = '#field3';
17 |
18 | // templates
19 |
20 | // classes
21 |
22 |
23 | }
24 | });
25 |
26 | return CommPageElems;
27 | });
28 |
29 |
30 |
--------------------------------------------------------------------------------
/www/js/CommPage.js:
--------------------------------------------------------------------------------
1 | /**
2 | CommPage
3 | @class CommPage
4 | @constructor
5 | @return {Object} instantiated CommPage
6 | **/
7 | define(['Setup', 'CommPageElems'], function (Setup, CommPageElems) {
8 | var CommPage = Backbone.Controller.extend({
9 | initialize: function () {
10 | var self = this;
11 | window.BB.Elements = new CommPageElems();
12 |
13 | require(['StackView', 'CommPageView'], function (StackView, CommPageView) {
14 |
15 | self.m_coolAnimView = new CommPageView({
16 | el: 'body'
17 | }).initializePage();
18 | });
19 | }
20 | });
21 | return CommPage;
22 | });
--------------------------------------------------------------------------------
/www/js/CoolAnim.js:
--------------------------------------------------------------------------------
1 | /**
2 | CoolAnim
3 | @class CoolAnim
4 | @constructor
5 | @return {Object} instantiated CoolAnim
6 | **/
7 | define(['Setup', 'CoolAnimElems'], function (Setup, CoolAnimElems) {
8 | var CoolAnim = Backbone.Controller.extend({
9 | initialize: function () {
10 | var self = this;
11 | window.BB.Elements = new CoolAnimElems();
12 |
13 | require(['StackView', 'CoolAnimView'], function (StackView, CoolAnimView) {
14 |
15 | self.m_coolAnimView = new CoolAnimView({
16 | el: 'body'
17 | }).initializePage();
18 | });
19 | }
20 | });
21 | return CoolAnim;
22 | });
--------------------------------------------------------------------------------
/config/app.coffee:
--------------------------------------------------------------------------------
1 | # Read more about app configs at http://docs.appgyver.com
2 |
3 | module.exports =
4 | app:
5 | name: "mobFasterQ"
6 |
7 | # steroidsAppId and steroidsApiKey headers are required by Supersonic Data
8 | # network:
9 | # extraResponseHeaders:
10 | # "Access-Control-Allow-Origin": "*"
11 | # "Access-Control-Allow-Headers": "Content-Type, X-Requested-With, steroidsAppId, steroidsApiKey"
12 |
13 | webView:
14 | viewsIgnoreStatusBar: false
15 | enableDoubleTapToFocus: false
16 | disableOverscroll: false
17 | enableViewportScale: false
18 | enablePopGestureRecognition: true
19 | allowInlineMediaPlayback: true
20 |
21 | # Applies on iOS only
22 | statusBar:
23 | enabled: true
24 | style: "default"
25 |
--------------------------------------------------------------------------------
/www/js/elements/CoolAnimElems.js:
--------------------------------------------------------------------------------
1 | /**
2 | CoolAnimElems Backbone > View
3 | @class CoolAnimElems elements
4 | @constructor
5 | @return {Object} instantiated CoolAnimElems
6 | **/
7 | define(['jquery', 'backbone'], function ($, Backbone) {
8 |
9 | var CoolAnimElems = Backbone.View.extend({
10 |
11 | initialize: function () {
12 |
13 | // elements
14 | this.LIKE = '#like';
15 | this.LINE_NAME = '#lineName';
16 | this.USER_NAME = '#userName';
17 | this.NEXT_FADE = '#nextFade';
18 | this.PREV_FADE = '#prevFade';
19 | this.NEXT_SLIDE = '#next';
20 | this.PREV_SLIDE = '#prev';
21 |
22 | // templates
23 |
24 | // classes
25 |
26 |
27 | }
28 | });
29 |
30 | return CoolAnimElems;
31 | });
32 |
33 |
34 |
--------------------------------------------------------------------------------
/www/js/setup.js:
--------------------------------------------------------------------------------
1 | /**
2 | Setup globals per App view
3 | @class Setup
4 | @constructor
5 | @return {Object} instantiated Setup
6 | **/
7 | define(['underscore', 'jquery', 'backbone', 'backbone.controller', 'ComBroker', 'Lib'], function (_, $, Backbone, backbonecontroller, ComBroker, Lib) {
8 |
9 | window.BB = Backbone;
10 | window.lang = 'en';
11 | window.debug = 1;
12 | BB.globs = {};
13 | BB.SERVICES = {};
14 | BB.EVENTS = {};
15 | BB.LOADING = {};
16 | BB.CONSTS = {};
17 | BB.lib = new Lib();
18 | window.log = BB.lib.log;
19 | window.jlog = BB.lib.jlog;
20 | BB.lib.addBackboneOptions();
21 | BB.lib.addBackboneCollectionSave();
22 | BB.comBroker = new ComBroker();
23 |
24 | $.ajaxSetup({cache: false});
25 | $.ajaxSetup({
26 | headers: {'Authorization': 'somePasswordHere'}
27 | });
28 | });
29 |
30 |
31 |
--------------------------------------------------------------------------------
/www/loading.html:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
11 |
12 | Loading...
13 |
14 |
15 |
16 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/config/structure.coffee:
--------------------------------------------------------------------------------
1 | # Read more about app structure at http://docs.appgyver.com
2 |
3 | module.exports =
4 |
5 | rootView:
6 | location: "http://localhost/index.html"
7 |
8 | # See styling options for tabs and other native components in app/common/native-styles/ios.css or app/common/native-styles/android.css
9 | tabs: [
10 | {
11 | title: "Index"
12 | id: "index"
13 | location: "http://localhost/index.html"
14 | }
15 | {
16 | title: "Internet"
17 | id: "internet"
18 | location: "http://www.JavaScriptNinja.io" # URLs are supported!
19 | }
20 | {
21 | title: "Settings"
22 | id: "settings"
23 | location: "http://localhost/pages/Settings.html"
24 | }
25 | ]
26 |
27 | drawers:
28 | left:
29 | id: "leftDrawer"
30 | location: "http://localhost/pages/Drawer.html"
31 | # uncomment following line to create the drawer manually
32 | # location: ""
33 | showOnAppLoad: false
34 | options:
35 | animation: "swingingDoor"
--------------------------------------------------------------------------------
/www/native-styles/ios.css:
--------------------------------------------------------------------------------
1 | /***********************************************************
2 | * These styles apply for native components on iOS.
3 | * Read more about native styles at http://docs.appgyver.com
4 | ***********************************************************/
5 |
6 | navigation-bar {
7 | background-color: #00B5FF;
8 | color: #ffffff;
9 | }
10 |
11 | navigation-bar title {
12 | color: #ffffff;
13 | font-size: 18px;
14 | font-weight: 600;
15 | }
16 |
17 | navigation-bar button, navigation-bar back-bar-button {
18 | color: #ffffff;
19 | font-weight: 300;
20 | }
21 |
22 | tab-bar {
23 | background-color: #ffffff;
24 | border-top: 1px #d8d8d8 solid;
25 | }
26 |
27 | tab-bar tab-bar-item {
28 | color: #b0b1b4;
29 | font-family: "Avenir";
30 | font-size: 10px;
31 | }
32 |
33 | tab-bar tab-bar-item:selected {
34 | color: #1596f7;
35 | }
36 |
37 | tab-bar-item#settings {
38 | background-image: url(assets/cog.svg);
39 | }
40 |
41 | tab-bar-item#index {
42 | background-image: url(assets/home.svg);
43 | }
44 |
45 | tab-bar-item#internet {
46 | background-image: url(assets/search.svg);
47 | }
48 |
--------------------------------------------------------------------------------
/www/js/views/PageView.js:
--------------------------------------------------------------------------------
1 | /**
2 | Settings Backbone > View
3 | @class FQCreatorView
4 | @constructor
5 | @return {Object} instantiated FQCreatorView
6 | **/
7 | define(['jquery', 'backbone'], function ($, Backbone) {
8 |
9 | var PageView = Backbone.View.extend({
10 |
11 | /**
12 | Create the Steroids page / view identity
13 | @method initializePage
14 | **/
15 | initializePage: function () {
16 | var self = this;
17 | self.m_page = new supersonic.ui.View({
18 | location: self.location,
19 | id: self.pageID
20 | });
21 | self.m_page.start();
22 | if (self.options && self.options.init == false)
23 | return self;
24 | self._initialize();
25 | return self;
26 | },
27 |
28 | /**
29 | Get page / view instance
30 | @method getPageView
31 | **/
32 | getPageView: function () {
33 | var self = this;
34 | return self.m_page;
35 | }
36 | });
37 |
38 | return PageView;
39 | });
40 |
41 |
42 |
--------------------------------------------------------------------------------
/www/js/elements/Elems.js:
--------------------------------------------------------------------------------
1 | /**
2 | Settings Backbone > View
3 | @class LineListView
4 | @constructor
5 | @return {Object} instantiated FQCreatorView
6 | **/
7 | define(['jquery', 'backbone'], function ($, Backbone) {
8 |
9 | var Elems = Backbone.View.extend({
10 |
11 | initialize: function () {
12 |
13 | this.GO_TO_ANIM_PAGE = '#toToAnimPage';
14 | this.LOCATION_ID_INPUT = '#locationIdInput';
15 | this.GET_SERVER_TIME= '#getServerTime';
16 | this.FIELD1 = '#field1';
17 | this.FIELD2 = '#field2';
18 | this.FIELD3 = '#field3';
19 | this.SEND_PING = '#sendPing';
20 | this.GO_TO_COMM_PAGE = '#goToCommPage';
21 | this.SAVE_TO_SERVER ='#saveToServer';
22 | this.LANGUAGE_SELECTOR = '#languageSelector';
23 | this.NAV_BAR_TITLE = '#navBarTitle';
24 | this.NAV_BAR_TITLE_LOCAL = '#navBarTitleLocal';
25 | this.OPEN_MODAL = '#openModal';
26 |
27 | // templates
28 | this.LANGUAGE_SELECTOR_TEMPLATE = '#ccc';
29 |
30 | // classes
31 | this.CLASS_CAMPIGN_LIST_ITEM = '.dddd';
32 | }
33 | });
34 |
35 | return Elems;
36 | });
37 |
38 |
39 |
--------------------------------------------------------------------------------
/www/assets/cog.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/www/js/views/LanguageSelectorView.js:
--------------------------------------------------------------------------------
1 | /**
2 | Create language selector widget
3 | @class LanguageSelectorView
4 | @constructor
5 | @return {Object} instantiated LanguageSelectorView
6 | **/
7 | define(['jquery', 'backbone', 'localizer'], function ($, Backbone, localizer) {
8 |
9 | var LanguageSelectorView = BB.View.extend({
10 |
11 | /**
12 | Init the ChannelList component and enable sortable channels UI via drag and drop operations.
13 | @method initialize
14 | **/
15 | initialize: function () {
16 | var self = this;
17 | self._listenLangSelection();
18 | self._setLanguage('en');
19 | },
20 |
21 | _listenLangSelection: function () {
22 | var self = this;
23 | self.$('select').on('change', function (e) {
24 | var selected = self.$('select').val();
25 | self._setLanguage(selected);
26 | })
27 | },
28 |
29 | /**
30 | Set specified language and reload the application to apply selection
31 | @method _setLanguage
32 | @param {String} i_language
33 | **/
34 | _setLanguage: function (i_language) {
35 | var self = this;
36 | var opts = {language: i_language, pathPrefix: "./lang"};
37 | $("[data-localize]").localize("local", opts);
38 |
39 | // Set the title bar text per language
40 | $(BB.Elements.NAV_BAR_TITLE).text($(BB.Elements.NAV_BAR_TITLE_LOCAL).text());
41 | }
42 | });
43 |
44 | return LanguageSelectorView;
45 |
46 | });
--------------------------------------------------------------------------------
/www/pages/CommPage.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | CommPage
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/www/native-styles/android.css:
--------------------------------------------------------------------------------
1 | /***********************************************************
2 | * These styles apply for native components on Android.
3 | * Read more about native styles at http://docs.appgyver.com
4 | ***********************************************************/
5 |
6 | navigation-bar {
7 | background-color: #00B5FF;
8 | color: #ffffff;
9 | padding-left: 6px;
10 | padding-right: 6px;
11 | }
12 |
13 | navigation-bar title {
14 | color: #ffffff;
15 | font-size: 18px;
16 | font-weight: 600;
17 | }
18 |
19 | navigation-bar button {
20 | color: #ffffff;
21 | font-weight: 300;
22 | margin-left: 6px;
23 | margin-right: 6px;
24 | }
25 |
26 | navigation-bar back-indicator {
27 | background-image: url(default_back_icon.png);
28 | background-size: 18;
29 | }
30 |
31 | navigation-bar back-button {
32 | color: #ffffff;
33 | font-weight: 300;
34 | }
35 |
36 | /**************************************
37 | * Tab Bar
38 | *************************************/
39 |
40 | tab-bar {
41 | background-color: #ffffff;
42 | border-top: 1px #d8d8d8 solid;
43 | }
44 |
45 | tab-bar tab-bar-item {
46 | color: #b0b1b4;
47 | font-family: "Roboto";
48 | font-size: 10px;
49 | }
50 |
51 | tab-bar tab-bar-item:selected {
52 | color: #1596f7;
53 | }
54 |
55 | tab-bar divider {
56 | background-color: #D8D8D8;
57 | }
58 |
59 | tab-bar tab-bar-item marker-top:selected {
60 | background-color: #1596f7;
61 | }
62 |
63 | tab-bar-item#settings {
64 | background-image: url(/assets/cog.svg);
65 | }
66 |
67 | tab-bar-item#index {
68 | background-image: url(/assets/home.svg);
69 | }
70 |
71 | tab-bar-item#internet {
72 | background-image: url(/assets/search.svg);
73 | }
--------------------------------------------------------------------------------
/www/js/collections/AuthCollection.js:
--------------------------------------------------------------------------------
1 | /**
2 | AuthCollection Backbone > View
3 | @class AuthCollection
4 | @constructor
5 | @return {Object} instantiated AuthCollection
6 | **/
7 | define(['jquery', 'backbone', 'LocalCollection'], function ($, Backbone, LocalCollection) {
8 |
9 | var AuthCollection = LocalCollection.extend({
10 | model: Backbone.Model,
11 |
12 | initialize: function (options) {
13 | var self = this;
14 | LocalCollection.prototype.initialize.apply(this, arguments);
15 | },
16 |
17 | onUpdates: function (e) {
18 | // log('onUpdates: ' + JSON.stringify(e));
19 | },
20 |
21 | onSync: function (e) {
22 | var self = this;
23 | var changedModelId = e.data.id;
24 | self.fetch();
25 | log('Auth on sync: modelID: ' + changedModelId + ' locationURL: ' + self.locationUrl + ' JSON: ' + JSON.stringify(e) + ' models: ' + self.models);
26 | var changedData = self.get(changedModelId).get('foo');
27 | // alert('change data ' + changedData);
28 |
29 | switch (self.locationUrl){
30 | case '/cat': {
31 | $(BB.Elements.FIELD1).val(changedData);
32 | break;
33 | }
34 | case '/dog': {
35 | $(BB.Elements.FIELD2).val(changedData);
36 | break;
37 | }
38 | case '/lion': {
39 | $(BB.Elements.FIELD3).val(changedData);
40 | break;
41 | }
42 | }
43 | }
44 | });
45 |
46 | return AuthCollection;
47 | });
48 |
49 |
50 |
--------------------------------------------------------------------------------
/www/pages/Drawer.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Drawer
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
19 |
20 |
21 |
22 |
23 |
24 |
Drawer
25 |
26 |
27 |
mvvm 2-way data binding
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/www/pages/Modal.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Modal
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
I am a modal
20 | click back button to return
21 |
22 |
23 |
24 |
52 |
53 |
54 |
55 |
56 |
--------------------------------------------------------------------------------
/www/js/common/gsap/plugins/EndArrayPlugin.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * VERSION: 0.1.2
3 | * DATE: 2014-07-17
4 | * UPDATES AND DOCS AT: http://www.greensock.com
5 | *
6 | * @license Copyright (c) 2008-2014, GreenSock. All rights reserved.
7 | * This work is subject to the terms at http://www.greensock.com/terms_of_use.html or for
8 | * Club GreenSock members, the software agreement that was issued with your membership.
9 | *
10 | * @author: Jack Doyle, jack@greensock.com
11 | */
12 | var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(global) !== "undefined") ? global : this || window; //helps ensure compatibility with AMD/RequireJS and CommonJS/Node
13 | (_gsScope._gsQueue || (_gsScope._gsQueue = [])).push( function() {
14 |
15 | "use strict";
16 |
17 | _gsScope._gsDefine.plugin({
18 | propName: "endArray",
19 | API: 2,
20 | version: "0.1.2",
21 |
22 | //called when the tween renders for the first time. This is where initial values should be recorded and any setup routines should run.
23 | init: function(target, value, tween) {
24 | var i = value.length,
25 | a = this.a = [],
26 | start, end;
27 | this.target = target;
28 | this._round = false;
29 | if (!i) {
30 | return false;
31 | }
32 | while (--i > -1) {
33 | start = target[i];
34 | end = value[i];
35 | if (start !== end) {
36 | a.push({i:i, s:start, c:end - start});
37 | }
38 | }
39 | return true;
40 | },
41 |
42 | round: function(lookup) {
43 | if ("endArray" in lookup) {
44 | this._round = true;
45 | }
46 | },
47 |
48 | //called each time the values should be updated, and the ratio gets passed as the only parameter (typically it's a value between 0 and 1, but it can exceed those when using an ease like Elastic.easeOut or Back.easeOut, etc.)
49 | set: function(ratio) {
50 | var target = this.target,
51 | a = this.a,
52 | i = a.length,
53 | e, val;
54 | if (this._round) {
55 | while (--i > -1) {
56 | e = a[i];
57 | target[e.i] = Math.round(e.s + e.c * ratio);
58 | }
59 | } else {
60 | while (--i > -1) {
61 | e = a[i];
62 | val = e.s + e.c * ratio;
63 | target[e.i] = (val < 0.000001 && val > -0.000001) ? 0 : val;
64 | }
65 | }
66 | }
67 |
68 | });
69 |
70 | }); if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); }
--------------------------------------------------------------------------------
/www/js/common/gsap/plugins/AttrPlugin.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * VERSION: 0.3.3
3 | * DATE: 2014-07-17
4 | * UPDATES AND DOCS AT: http://www.greensock.com
5 | *
6 | * @license Copyright (c) 2008-2014, GreenSock. All rights reserved.
7 | * This work is subject to the terms at http://www.greensock.com/terms_of_use.html or for
8 | * Club GreenSock members, the software agreement that was issued with your membership.
9 | *
10 | * @author: Jack Doyle, jack@greensock.com
11 | */
12 | var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(global) !== "undefined") ? global : this || window; //helps ensure compatibility with AMD/RequireJS and CommonJS/Node
13 | (_gsScope._gsQueue || (_gsScope._gsQueue = [])).push( function() {
14 |
15 | "use strict";
16 |
17 | _gsScope._gsDefine.plugin({
18 | propName: "attr",
19 | API: 2,
20 | version: "0.3.3",
21 |
22 | //called when the tween renders for the first time. This is where initial values should be recorded and any setup routines should run.
23 | init: function(target, value, tween) {
24 | var p, start, end;
25 | if (typeof(target.setAttribute) !== "function") {
26 | return false;
27 | }
28 | this._target = target;
29 | this._proxy = {};
30 | this._start = {}; // we record start and end values exactly as they are in case they're strings (not numbers) - we need to be able to revert to them cleanly.
31 | this._end = {};
32 | for (p in value) {
33 | this._start[p] = this._proxy[p] = start = target.getAttribute(p);
34 | end = this._addTween(this._proxy, p, parseFloat(start), value[p], p);
35 | this._end[p] = end ? end.s + end.c : value[p];
36 | this._overwriteProps.push(p);
37 | }
38 | return true;
39 | },
40 |
41 | //called each time the values should be updated, and the ratio gets passed as the only parameter (typically it's a value between 0 and 1, but it can exceed those when using an ease like Elastic.easeOut or Back.easeOut, etc.)
42 | set: function(ratio) {
43 | this._super.setRatio.call(this, ratio);
44 | var props = this._overwriteProps,
45 | i = props.length,
46 | lookup = (ratio === 1) ? this._end : ratio ? this._proxy : this._start,
47 | p;
48 | while (--i > -1) {
49 | p = props[i];
50 | this._target.setAttribute(p, lookup[p] + "");
51 | }
52 | }
53 |
54 | });
55 |
56 | }); if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); }
--------------------------------------------------------------------------------
/www/pages/Settings.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Settings
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
19 |
20 |
21 |
22 |
23 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
54 |
55 |
56 | Open a modal dialog
57 |
58 |
59 |
60 |
61 |
62 |
--------------------------------------------------------------------------------
/www/js/common/gsap/plugins/RoundPropsPlugin.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * VERSION: beta 1.4.1
3 | * DATE: 2014-07-17
4 | * UPDATES AND DOCS AT: http://www.greensock.com
5 | *
6 | * @license Copyright (c) 2008-2014, GreenSock. All rights reserved.
7 | * This work is subject to the terms at http://www.greensock.com/terms_of_use.html or for
8 | * Club GreenSock members, the software agreement that was issued with your membership.
9 | *
10 | * @author: Jack Doyle, jack@greensock.com
11 | **/
12 | var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(global) !== "undefined") ? global : this || window; //helps ensure compatibility with AMD/RequireJS and CommonJS/Node
13 | (_gsScope._gsQueue || (_gsScope._gsQueue = [])).push( function() {
14 |
15 | "use strict";
16 |
17 | var RoundPropsPlugin = _gsScope._gsDefine.plugin({
18 | propName: "roundProps",
19 | version: "1.4.1",
20 | priority: -1,
21 | API: 2,
22 |
23 | //called when the tween renders for the first time. This is where initial values should be recorded and any setup routines should run.
24 | init: function(target, value, tween) {
25 | this._tween = tween;
26 | return true;
27 | }
28 |
29 | }),
30 | p = RoundPropsPlugin.prototype;
31 |
32 | p._onInitAllProps = function() {
33 | var tween = this._tween,
34 | rp = (tween.vars.roundProps instanceof Array) ? tween.vars.roundProps : tween.vars.roundProps.split(","),
35 | i = rp.length,
36 | lookup = {},
37 | rpt = tween._propLookup.roundProps,
38 | prop, pt, next;
39 | while (--i > -1) {
40 | lookup[rp[i]] = 1;
41 | }
42 | i = rp.length;
43 | while (--i > -1) {
44 | prop = rp[i];
45 | pt = tween._firstPT;
46 | while (pt) {
47 | next = pt._next; //record here, because it may get removed
48 | if (pt.pg) {
49 | pt.t._roundProps(lookup, true);
50 | } else if (pt.n === prop) {
51 | this._add(pt.t, prop, pt.s, pt.c);
52 | //remove from linked list
53 | if (next) {
54 | next._prev = pt._prev;
55 | }
56 | if (pt._prev) {
57 | pt._prev._next = next;
58 | } else if (tween._firstPT === pt) {
59 | tween._firstPT = next;
60 | }
61 | pt._next = pt._prev = null;
62 | tween._propLookup[prop] = rpt;
63 | }
64 | pt = next;
65 | }
66 | }
67 | return false;
68 | };
69 |
70 | p._add = function(target, p, s, c) {
71 | this._addTween(target, p, s, s + c, p, true);
72 | this._overwriteProps.push(p);
73 | };
74 |
75 | }); if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); }
--------------------------------------------------------------------------------
/www/js/Settings.js:
--------------------------------------------------------------------------------
1 | /**
2 | SettingsView Backbone > View
3 | @class SettingsView
4 | @constructor
5 | @return {Object} instantiated SettingsView
6 | **/
7 | define(['PageView', 'Setup', 'SettingsElems'], function (PageView, Setup, SettingsElems) {
8 |
9 | var SettingsView = PageView.extend({
10 |
11 | /**
12 | Initialize PageView
13 | **/
14 | initialize: function () {
15 | var self = this;
16 | window.BB.Elements = new SettingsElems();
17 | self._listenToggleTabs();
18 | self._listenOpenModelView();
19 | },
20 |
21 | /**
22 | Open a model view
23 | @method this.OPEN_MODEL_VIEW
24 | **/
25 | _listenOpenModelView: function(){
26 | var self = this;
27 | self.m_modalPage = new supersonic.ui.View({
28 | location: "/pages/Modal.html",
29 | id: "modalView"
30 | });
31 |
32 | // don't start the modal right off the start, so we don't choke the os
33 | setTimeout(function(){
34 | self.m_modalPage.start();
35 | },2000);
36 |
37 | $(BB.Elements.OPEN_MODEL_VIEW).on('click',function(){
38 | // a bit of delay before open modal so we don't choke the os
39 | setTimeout(function(){
40 | supersonic.ui.modal.show(self.m_modalPage, {animate: false});
41 | },1200);
42 | })
43 | },
44 |
45 | /**
46 | Listen to change in checkbox for toggling boot app tab bar
47 | @method setPlayerData
48 | @param {Number} i_playerData
49 | @return {Number} Unique clientId.
50 | **/
51 | _listenToggleTabs: function () {
52 | var self = this;
53 | $(BB.Elements.TOGGLE_TABS).on('change', function (e) {
54 | var v = $(e.target).prop('checked') == true ? 1 : 0;
55 | if (v) {
56 | self._showTabs();
57 | } else {
58 | self._hideTabs();
59 | }
60 | });
61 | },
62 |
63 | /**
64 | Hide the app tabs
65 | @method _hideTabs
66 | **/
67 | _hideTabs: function () {
68 | supersonic.ui.tabs.show();
69 | },
70 |
71 | /**
72 | Show the app tabs
73 | @method _hideTabs
74 | **/
75 | _showTabs: function () {
76 | supersonic.ui.tabs.hide();
77 | }
78 | });
79 |
80 | return SettingsView;
81 | });
82 |
83 |
84 |
--------------------------------------------------------------------------------
/www/js/Drawer.js:
--------------------------------------------------------------------------------
1 | /**
2 | Settings Backbone > View
3 | @class Drawer
4 | @constructor
5 | @return {Object} instantiated FQCreatorView
6 | **/
7 | define(['jquery', 'backbone', 'PageView', 'Setup', 'DrawerElems', 'backbone.stickit'], function ($, Backbone, PageView, Setup, DrawerElems, backbonestickit) {
8 |
9 | var Drawer = PageView.extend({
10 |
11 | /**
12 | Initialize PageView
13 | @method initialize
14 | **/
15 | initialize: function () {
16 | var self = this;
17 | self.$el = $('body');
18 |
19 | window.BB.Elements = new DrawerElems();
20 | $(BB.Elements.PASS1).val('type password');
21 |
22 | supersonic.ui.views.find("Drawer.html").then(function (view) {
23 | self.drawerView = view;
24 | });
25 |
26 | var changedValues = _.debounce(function () {
27 | log('stickit changed model');
28 | }, 450);
29 |
30 | self.model = new Backbone.Model({
31 | password: 'some pass'
32 | });
33 |
34 | self.model.on('change', changedValues);
35 | self._bindings();
36 | self._listenCloseDrawer();
37 | },
38 |
39 | /**
40 | Listen Close Drawer
41 | @method _listenCloseDrawer
42 | **/
43 | _listenCloseDrawer: function(){
44 | var self = this;
45 | $(BB.Elements.DRAWER_CLOSE).on('click', function () {
46 | self.closeDrawer();
47 | })
48 | },
49 |
50 | /**
51 | Stickit mvvm 2-way binding with model
52 | @method _bindings
53 | **/
54 | _bindings: function () {
55 | var self = this;
56 | self.addBinding(self.model, BB.Elements.PASS1, 'password');
57 | self.addBinding(self.model, BB.Elements.PASS2, 'password');
58 | self.stickit();
59 | },
60 |
61 | /**
62 | Open the side drawer
63 | @method openDrawer
64 | **/
65 | openDrawer: function () {
66 | supersonic.ui.drawers.open("leftDrawer").then(function () {
67 | supersonic.logger.debug("Drawer was shown");
68 | });
69 | },
70 |
71 | /**
72 | Close the side drawer
73 | @method closeDrawer
74 | **/
75 | closeDrawer: function () {
76 | supersonic.ui.drawers.close("leftDrawer").then(function () {
77 | supersonic.logger.debug("Drawer was shown");
78 | });
79 | }
80 | });
81 |
82 | return Drawer;
83 | });
84 |
85 |
86 |
--------------------------------------------------------------------------------
/www/init.js:
--------------------------------------------------------------------------------
1 | /**
2 | Require js initialization module definition file
3 | @class Require init js
4 | **/
5 | require.config({
6 | waitSeconds: 25,
7 | baseUrl: '/js',
8 | paths: {
9 | 'jquery': 'common/jq/jq1.9.1',
10 | 'backbone': 'common/backbone/backbone',
11 | 'text': 'common/requirejs/text',
12 | 'underscore': 'common/underscore/underscore',
13 | 'backbone.controller': 'common/backbone-controller/backbone.controller',
14 | 'backbone.localstorage': 'common/backbone-localstorage/backbone.dualstorage.amd',
15 | 'backbone.stickit': 'common/backbone-stickit/backbone.stickit',
16 | 'TimelineMax': 'common/gsap/TimelineMax',
17 | 'TweenMax': 'common/gsap/TweenMax',
18 | 'TweenLite': 'common/gsap/TweenLite',
19 | 'CSSPlugin': 'common/gsap/plugins/CSSPlugin',
20 | 'localizer': 'common/localizer/dist/jquery.localize',
21 | 'RC4': 'common/rc4/RC4',
22 | 'Lib': 'common/libs/Lib',
23 | 'ComBroker': 'common/comBroker/ComBroker',
24 | 'Elems': 'elements/Elems',
25 | 'CoolAnimElems': 'elements/CoolAnimElems',
26 | 'CommPageElems': 'elements/CommPageElems',
27 | 'DrawerElems': 'elements/DrawerElems',
28 | 'SettingsElems': 'elements/SettingsElems',
29 | 'NoteModel' : 'models/NoteModel',
30 | 'LocalCollection': 'collections/LocalCollection',
31 | 'AuthCollection': 'collections/AuthCollection',
32 | 'Setup': 'setup',
33 | 'LanguageSelectorView': 'views/LanguageSelectorView',
34 | 'CoolAnimView': 'views/CoolAnimView',
35 | 'CommPageView': 'views/CommPageView',
36 | 'PageView': 'views/PageView',
37 | 'StackView': 'common/stackview/StackView'
38 | },
39 |
40 | shim: {
41 | 'backbone': {
42 | deps: ['underscore', 'jquery'],
43 | exports: 'Backbone'
44 | },
45 | 'backbone.controller': {
46 | deps: ['underscore', 'jquery']
47 | },
48 | 'underscore': {
49 | exports: '_'
50 | },
51 | 'ComBroker': {
52 | deps: ['backbone', 'jquery']
53 | },
54 | 'RC4': {
55 | exports: 'RC4'
56 | },
57 | 'TweenMax': {
58 | exports: 'TweenMax'
59 | },
60 | 'TweenLite': {
61 | exports: 'TweenLite'
62 | },
63 | 'TimelineMax': {
64 | dep: ['TweenLite'],
65 | exports: 'TimelineMax'
66 | },
67 | 'CSSPlugin': {
68 | dep: ['TweenLite'],
69 | exports: 'CSSPlugin'
70 | },
71 | }
72 | });
73 |
74 | // Kick off application per loader domain set in HTML page
75 | require([window.webViewer], function (WebViewer) {
76 | new WebViewer();
77 | });
--------------------------------------------------------------------------------
/www/js/views/CommPageView.js:
--------------------------------------------------------------------------------
1 | /**
2 | CommPageView Backbone > View
3 | @class CommPageView
4 | @constructor
5 | @return {Object} instantiated CommPageView
6 | **/
7 | define(['jquery', 'backbone', 'PageView', 'AuthCollection', 'NoteModel'], function ($, Backbone, PageView, AuthCollection, NoteModel) {
8 |
9 | var CommPageView = PageView.extend({
10 |
11 | location: "/pages/CommPage.html",
12 | pageID: "CommPage",
13 |
14 | /**
15 | Init called from PageView base class
16 | @method _initialize
17 | **/
18 | _initialize: function () {
19 | var self = this;
20 | self._listenSendPong();
21 | self._initModelsCollection();
22 | },
23 |
24 | /**
25 | Create all the models and collections that we use to communicate with other pages and to server
26 | @method _initModelsCollection
27 | **/
28 | _initModelsCollection: function() {
29 | var self = this;
30 | self.myNotes1 = new AuthCollection([], {locationUrl: '/cat'});
31 | var note = new NoteModel();
32 | self.myNotes1.add(note);
33 | note.save();
34 | self.myNotes1.fetch();
35 |
36 | self.myNotes2 = new AuthCollection([], {locationUrl: '/dog'});
37 | var note = new Backbone.Model({'foo': 'bar3'});
38 | self.myNotes2.add(note);
39 | note.save();
40 | self.myNotes2.fetch();
41 |
42 | self.myNotes3 = new AuthCollection([], {locationUrl: '/lion'});
43 | var note = new Backbone.Model({'foo': 'bar4'});
44 | self.myNotes3.add(note);
45 | note.save();
46 |
47 | $(BB.Elements.FIELD1).on('blur', function (e) {
48 | var val = $(this).val();
49 | self.myNotes1.at(0).set('foo', val);
50 | self.myNotes1.at(0).save();
51 | });
52 |
53 | $(BB.Elements.FIELD2).on('blur', function (e) {
54 | var val = $(this).val();
55 | self.myNotes2.at(0).set('foo', val);
56 | self.myNotes2.at(0).save();
57 | });
58 |
59 | $(BB.Elements.FIELD3).on('blur', function (e) {
60 | var val = $(this).val();
61 | self.myNotes3.at(0).set('foo', val);
62 | self.myNotes3.at(0).save();
63 | });
64 | },
65 |
66 | /**
67 | Listen to click on pong channel events
68 | @method _listenSendPong
69 | **/
70 | _listenSendPong: function () {
71 | var self = this;
72 | var unsubscribe = BB.comBroker.listenWebViews('pingpong', function (e, reply) {
73 | log(e.fromWebView);
74 | log(e.event);
75 | log(e.data);
76 | reply('echo reply...'); // need to setup listener on other side
77 | });
78 | }
79 | });
80 |
81 | return CommPageView;
82 | });
83 |
84 |
85 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # BackSteroids
2 | A solid Mobile App architecture for AppGyver's Steroids framework that's powered by Backbone + Steroids (BackSteroids)
3 |
4 | AppGyver’s Steroids framework is built on top of the very popular open source Apache Cordova frame work which allows anyone to build a professional, cross OS mobile Apps (iOS, Android, Windows phone etc..) using CSS, HTML and JavaScript.
5 | AppGyver’s Steroids adds a layer of Native UIs so you get awesome native performance and none of that HTML choppiness.
6 |
7 | While AppGyver developed some application structure on top of Angular, I believe Angular is a move in the wrong direction as it mixes business logic and presentation, extremely slow (even more so on mobile) and does way way way (waaaaay) too much “magic” (good luck debugging google’s code).
8 |
9 | Backbone on the other hand is un-opinionated, has thousands of plugins to choose from and it just so happens to be the world's most popular JavaScript app library!
10 |
11 | And so BackSteroids was born.
12 |
13 | current version: 0.89
14 |
15 | Benefits:
16 | ------------------------------------------------------------------------
17 |
18 | Note: a View is a separate DOM, essentially a new page.
19 | In a single Mobile App you will most likely have multiple Views.
20 | Since Views are separate pages (think separate Tabs in a browser), we need a way to handle communication and data synchronization of models between Views.
21 |
22 | BackSteroids is a collection of libraries (I guess you can consider it a framework) that delivers on the following patterns:
23 |
24 | - A global setup.js that is shared among all Views (Single change propagates to all Views)
25 | - Elements (HTML IDs) definition file per View
26 | - Uses require.js and some trickery to load only the modules needed per View and reuse the same init.js for the entire application
27 | - GPU powered smooth transition within a View (Fade / Slide) powered by StackView
28 | - Stickit MVVM two way model / view binding
29 | - A communication channel with set members
30 | - Support for Localization (dynamic multi language)
31 | - Support CORS server commands via Pre-flight checks, required for server communication (node.js)
32 | - Uses a commBroker as a moderator and service provider within a View
33 | - Uses a commBroker as a moderator for event communication between Views
34 | - Ability to share models in different Views (through LocalStore)
35 | - Ability to save the same LocalStore models to the server
36 | - General utilities such as log, jlog, global error catch for debugging etc…
37 | - Application architecture based on separation of concerns and pure OOP
38 |
39 | To use the project simply use the Steroids command to create a new project:
40 |
41 |
42 | steroids create [YOUR_PROJECT_NAME]
43 |
44 |
45 | Once created, override the entire project with the content of this BackSteroids.
46 | Note that you will still use your config.json for your unique application id.
47 |
48 | Screencast
49 | ------------------------------------------------------------------------
50 |
51 |
--------------------------------------------------------------------------------
/www/js/common/gsap/plugins/DirectionalRotationPlugin.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * VERSION: beta 0.2.1
3 | * DATE: 2014-07-17
4 | * UPDATES AND DOCS AT: http://www.greensock.com
5 | *
6 | * @license Copyright (c) 2008-2014, GreenSock. All rights reserved.
7 | * This work is subject to the terms at http://www.greensock.com/terms_of_use.html or for
8 | * Club GreenSock members, the software agreement that was issued with your membership.
9 | *
10 | * @author: Jack Doyle, jack@greensock.com
11 | **/
12 | var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(global) !== "undefined") ? global : this || window; //helps ensure compatibility with AMD/RequireJS and CommonJS/Node
13 | (_gsScope._gsQueue || (_gsScope._gsQueue = [])).push( function() {
14 |
15 | "use strict";
16 |
17 | _gsScope._gsDefine.plugin({
18 | propName: "directionalRotation",
19 | version: "0.2.1",
20 | API: 2,
21 |
22 | //called when the tween renders for the first time. This is where initial values should be recorded and any setup routines should run.
23 | init: function(target, value, tween) {
24 | if (typeof(value) !== "object") {
25 | value = {rotation:value};
26 | }
27 | this.finals = {};
28 | var cap = (value.useRadians === true) ? Math.PI * 2 : 360,
29 | min = 0.000001,
30 | p, v, start, end, dif, split;
31 | for (p in value) {
32 | if (p !== "useRadians") {
33 | split = (value[p] + "").split("_");
34 | v = split[0];
35 | start = parseFloat( (typeof(target[p]) !== "function") ? target[p] : target[ ((p.indexOf("set") || typeof(target["get" + p.substr(3)]) !== "function") ? p : "get" + p.substr(3)) ]() );
36 | end = this.finals[p] = (typeof(v) === "string" && v.charAt(1) === "=") ? start + parseInt(v.charAt(0) + "1", 10) * Number(v.substr(2)) : Number(v) || 0;
37 | dif = end - start;
38 | if (split.length) {
39 | v = split.join("_");
40 | if (v.indexOf("short") !== -1) {
41 | dif = dif % cap;
42 | if (dif !== dif % (cap / 2)) {
43 | dif = (dif < 0) ? dif + cap : dif - cap;
44 | }
45 | }
46 | if (v.indexOf("_cw") !== -1 && dif < 0) {
47 | dif = ((dif + cap * 9999999999) % cap) - ((dif / cap) | 0) * cap;
48 | } else if (v.indexOf("ccw") !== -1 && dif > 0) {
49 | dif = ((dif - cap * 9999999999) % cap) - ((dif / cap) | 0) * cap;
50 | }
51 | }
52 | if (dif > min || dif < -min) {
53 | this._addTween(target, p, start, start + dif, p);
54 | this._overwriteProps.push(p);
55 | }
56 | }
57 | }
58 | return true;
59 | },
60 |
61 | //called each time the values should be updated, and the ratio gets passed as the only parameter (typically it's a value between 0 and 1, but it can exceed those when using an ease like Elastic.easeOut or Back.easeOut, etc.)
62 | set: function(ratio) {
63 | var pt;
64 | if (ratio !== 1) {
65 | this._super.setRatio.call(this, ratio);
66 | } else {
67 | pt = this._firstPT;
68 | while (pt) {
69 | if (pt.f) {
70 | pt.t[pt.p](this.finals[pt.p]);
71 | } else {
72 | pt.t[pt.p] = this.finals[pt.p];
73 | }
74 | pt = pt._next;
75 | }
76 | }
77 | }
78 |
79 | })._autoCSS = true;
80 |
81 | }); if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); }
--------------------------------------------------------------------------------
/www/js/collections/LocalCollection.js:
--------------------------------------------------------------------------------
1 | /**
2 | Settings Backbone > View
3 | @class LocalCollection
4 | @constructor
5 | @return {Object} instantiated FQCreatorView
6 | **/
7 | define(['jquery', 'backbone', 'backbone.localstorage'], function ($, Backbone, backbonelocalstorage) {
8 |
9 | var uuid = function () {
10 | var d = new Date().getTime();
11 | var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
12 | var r = (d + Math.random() * 16) % 16 | 0;
13 | d = Math.floor(d / 16);
14 | return (c == 'x' ? r : (r & 0x3 | 0x8)).toString(16);
15 | });
16 | return uuid;
17 | };
18 |
19 | var LocalCollection = Backbone.Collection.extend({
20 | local: true,
21 | remote: false,
22 | initialize: function (models, options) {
23 | var self = this;
24 | self.locationUrl = options.locationUrl;
25 | self.collectionID = uuid(); // we use the collection id so we ignore our own events
26 | log('creating ' + self.locationUrl + ' collection id: ' + self.collectionID);
27 | self._listenStorageCollectionEvents();
28 | self._listenToAllMyEvents();
29 | },
30 | url: function () {
31 | var self = this;
32 | return self.locationUrl;
33 | },
34 | _listenToAllMyEvents: function () {
35 | var self = this;
36 | this.listenTo(this, 'all', function (event, model) {
37 | if (_.isUndefined(model.id))
38 | return;
39 | log('announcing event: ' + event + ' ' + self.locationUrl + ' model id: ' + model.id);
40 | BB.comBroker.fireWebViews(self.locationUrl, window.webViewer, {
41 | id: model.id,
42 | event: event,
43 | locationUrl: self.locationUrl,
44 | collectionID: self.collectionID,
45 | model: JSON.stringify(model)
46 | });
47 | });
48 | },
49 |
50 | _listenStorageCollectionEvents: function () {
51 | var self = this;
52 | BB.comBroker.listenWebViews(self.locationUrl, function (e) {
53 | if (e.data.collectionID == self.collectionID)
54 | return;
55 | if (e.data && e.data.event == 'sync') {
56 | self.onSync(e);
57 | } else {
58 | self.onUpdates(e)
59 | }
60 | });
61 | },
62 |
63 | saveToServer: function (i_state) {
64 | var self = this;
65 | if (i_state) {
66 | self.local = false;
67 | self.remote = true;
68 | } else {
69 | self.local = true;
70 | self.remote = false;
71 | }
72 | },
73 |
74 | deleteStorage: function () {
75 | var self = this;
76 | localStorage.clear();
77 | Store.prototype.clear;
78 | },
79 |
80 | onUpdates: function (e) {
81 | //log(JSON.stringify(e));
82 | },
83 |
84 | onSync: function (e) {
85 | //log(JSON.stringify(e));
86 | }//,
87 | });
88 |
89 | return LocalCollection;
90 | });
91 |
92 |
93 |
--------------------------------------------------------------------------------
/www/pages/CoolAnimPage.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | CoolAnimPage
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
Marty McFly
39 |
40 |
November 05, 1955
41 |
42 |
43 |
44 |
45 |
46 | This is a "Facebook" styled Card. The header is created from a Thumbnail List item,
47 | and the content is from a card-body consisting of an image and paragraph text.
48 |
49 |
50 |
51 | 1 Like
52 | 5 Comments
53 |
54 |
55 |
56 |
57 |
58 | GPU Slider
59 |
60 |
64 |
65 |
66 |
I am page 1
67 |
68 |
69 |
I am page 2
70 |
71 |
72 |
I am page 3
73 |
74 |
75 |
76 |
77 | Smooth Fader
78 |
79 |
83 |
84 |
85 |
86 |
I am page 1
87 |
88 |
89 |
I am page 2
90 |
91 |
92 |
I am page 3
93 |
94 |
95 |
96 |
97 |
--------------------------------------------------------------------------------
/www/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | My Steroids App
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
34 |
35 |
36 |
37 | Welcome to BackRoids
38 |
39 |
40 |
41 |
42 |
43 |
44 | Select language
45 |
46 |
47 | Hebrew
48 | English
49 |
50 |
51 |
52 |
53 |
54 | Go to Animation page
55 |
56 |
57 |
58 | Get Server Time
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 | Save Cat model to server
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 | Go to Comm page
87 |
88 |
89 |
90 |
91 |
92 | Send Ping
93 |
94 |
95 |
version 0.85 | http://www.JavaScriptNinja.io
96 |
97 | Welcome to BackRoids 0
98 |
99 |
--------------------------------------------------------------------------------
/www/stylesheets/application.css:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | #drawerClose {
5 | float: right;
6 | position: relative;
7 | top: -45px
8 | }
9 |
10 | /************************************
11 | StackView styling
12 | ************************************/
13 |
14 | #stackContainer {
15 | margin-top: 30px;
16 | padding: 0px;
17 | position: relative;
18 | height: 200px;
19 | overflow: hidden;
20 | }
21 |
22 | #stackContainerFader div {
23 | background-color: #d1d1d1;
24 | height: 200px;
25 | border: 1px solid #b9b9b9;
26 | }
27 |
28 | .page {
29 | position: absolute;
30 | padding: 12px;
31 | top: 0;
32 | left: 0;
33 | width: 100%;
34 | height: 100%;
35 | background-color: #d1d1d1;
36 | border: 1px solid #b9b9b9;
37 | }
38 |
39 | /************************************
40 | StackView sliders
41 | /************************************
42 |
43 | /************************************
44 | Hardware accelerated horizontal
45 | /************************************
46 |
47 | .page.left {
48 | -webkit-transform: translate3d(-100%, 0, 0);
49 | transform: translate3d(-100%, 0, 0);
50 | }
51 | .page.center {
52 | -webkit-transform: translate3d(0, 0, 0);
53 | transform: translate3d(0, 0, 0);
54 | }
55 | .page.right {
56 | -webkit-transform: translate3d(100%, 0, 0);
57 | transform: translate3d(100%, 0, 0);
58 | }
59 | .page.transition {
60 | -webkit-transition-duration: .25s;
61 | transition-duration: .25s;
62 | }
63 |
64 | /************************************
65 | Software accelerated horizontal
66 | /************************************
67 |
68 | .page.left {
69 | left: -100%;
70 | }
71 |
72 | .page.center {
73 | left: 0;
74 | }
75 |
76 | .page.right {
77 | left: 100%;
78 | }
79 |
80 | .page.transition {
81 | -webkit-transition-duration: .25s;
82 | transition-duration: .25s;
83 | }
84 |
85 | /************************************
86 | Software accelerated vertical
87 | /************************************
88 |
89 | .page.left {
90 | top: -100%;
91 | }
92 | .page.center {
93 | top: 0;
94 | }
95 | .page.right {
96 | top: 100%;
97 | }
98 | .page.transition {
99 | -webkit-transition-duration: 3.25s;
100 | transition-duration: 0.65s;
101 | }
102 |
103 | /************************************
104 | Hardware accelerated vertical
105 | /************************************
106 |
107 | .page.left {
108 | -webkit-transform: translate3d(0, -100%, 0);
109 | transform: translate3d(0, -100%, 0);
110 | }
111 | .page.center {
112 | -webkit-transform: translate3d(0, 0, 0);
113 | transform: translate3d(0, 0, 0);
114 | }
115 | .page.right {
116 | -webkit-transform: translate3d(0, 100%, 0);
117 | transform: translate3d(0, 100%, 0);
118 | }
119 | .page.transition {
120 | -webkit-transition-duration: 3.25s;
121 | transition-duration: 3.25s;
122 | }
123 | */
124 |
125 | .page.left {
126 | -webkit-transform: translate3d(-100%, 0, 0);
127 | transform: translate3d(-100%, 0, 0);
128 | }
129 | .page.center {
130 | -webkit-transform: translate3d(0, 0, 0);
131 | transform: translate3d(0, 0, 0);
132 | }
133 | .page.right {
134 | -webkit-transform: translate3d(100%, 0, 0);
135 | transform: translate3d(100%, 0, 0);
136 | }
137 | .page.transition {
138 | -webkit-transition-duration: .55s;
139 | transition-duration: .55s;
140 | }
141 |
142 |
143 |
144 |
145 |
146 | .images { position: relative; padding: 0; cursor: pointer; }
147 | .images li { list-style: none; }
148 | .images li img {
149 | position: absolute;
150 | top: 0; left: 0;
151 | display: none;
152 | }
--------------------------------------------------------------------------------
/www/js/common/gsap/plugins/TextPlugin.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * VERSION: 0.5.1
3 | * DATE: 2014-07-17
4 | * UPDATES AND DOCS AT: http://www.greensock.com
5 | *
6 | * @license Copyright (c) 2008-2014, GreenSock. All rights reserved.
7 | * This work is subject to the terms at http://www.greensock.com/terms_of_use.html or for
8 | * Club GreenSock members, the software agreement that was issued with your membership.
9 | *
10 | * @author: Jack Doyle, jack@greensock.com
11 | */
12 | var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(global) !== "undefined") ? global : this || window; //helps ensure compatibility with AMD/RequireJS and CommonJS/Node
13 | (_gsScope._gsQueue || (_gsScope._gsQueue = [])).push( function() {
14 |
15 | "use strict";
16 |
17 | var _getText = function(e) {
18 | var type = e.nodeType,
19 | result = "";
20 | if (type === 1 || type === 9 || type === 11) {
21 | if (typeof(e.textContent) === "string") {
22 | return e.textContent;
23 | } else {
24 | for ( e = e.firstChild; e; e = e.nextSibling ) {
25 | result += _getText(e);
26 | }
27 | }
28 | } else if (type === 3 || type === 4) {
29 | return e.nodeValue;
30 | }
31 | return result;
32 | },
33 | TextPlugin = _gsScope._gsDefine.plugin({
34 | propName: "text",
35 | API: 2,
36 | version:"0.5.1",
37 |
38 | //called when the tween renders for the first time. This is where initial values should be recorded and any setup routines should run.
39 | init: function(target, value, tween) {
40 | var i, shrt;
41 | if (!("innerHTML" in target)) {
42 | return false;
43 | }
44 | this._target = target;
45 | if (typeof(value) !== "object") {
46 | value = {value:value};
47 | }
48 | if (value.value === undefined) {
49 | this._text = this._original = [""];
50 | return true;
51 | }
52 | this._delimiter = value.delimiter || "";
53 | this._original = _getText(target).replace(/\s+/g, " ").split(this._delimiter);
54 | this._text = value.value.replace(/\s+/g, " ").split(this._delimiter);
55 | this._runBackwards = (tween.vars.runBackwards === true);
56 | if (this._runBackwards) {
57 | i = this._original;
58 | this._original = this._text;
59 | this._text = i;
60 | }
61 | if (typeof(value.newClass) === "string") {
62 | this._newClass = value.newClass;
63 | this._hasClass = true;
64 | }
65 | if (typeof(value.oldClass) === "string") {
66 | this._oldClass = value.oldClass;
67 | this._hasClass = true;
68 | }
69 | i = this._original.length - this._text.length,
70 | shrt = (i < 0) ? this._original : this._text;
71 | this._fillChar = value.fillChar || (value.padSpace ? " " : "");
72 | if (i < 0) {
73 | i = -i;
74 | }
75 | while (--i > -1) {
76 | shrt.push(this._fillChar);
77 | }
78 | return true;
79 | },
80 |
81 | //called each time the values should be updated, and the ratio gets passed as the only parameter (typically it's a value between 0 and 1, but it can exceed those when using an ease like Elastic.easeOut or Back.easeOut, etc.)
82 | set: function(ratio) {
83 | if (ratio > 1) {
84 | ratio = 1;
85 | } else if (ratio < 0) {
86 | ratio = 0;
87 | }
88 | if (this._runBackwards) {
89 | ratio = 1 - ratio;
90 | }
91 | var l = this._text.length,
92 | i = (ratio * l + 0.5) | 0,
93 | applyNew, applyOld, str;
94 | if (this._hasClass) {
95 | applyNew = (this._newClass && i !== 0);
96 | applyOld = (this._oldClass && i !== l);
97 | str = (applyNew ? "" : "") + this._text.slice(0, i).join(this._delimiter) + (applyNew ? " " : "") + (applyOld ? "" : "") + this._delimiter + this._original.slice(i).join(this._delimiter) + (applyOld ? " " : "");
98 | } else {
99 | str = this._text.slice(0, i).join(this._delimiter) + this._delimiter + this._original.slice(i).join(this._delimiter);
100 | }
101 | this._target.innerHTML = (this._fillChar === " " && str.indexOf(" ") !== -1) ? str.split(" ").join(" ") : str;
102 | }
103 |
104 | }),
105 | p = TextPlugin.prototype;
106 |
107 | p._newClass = p._oldClass = p._delimiter = "";
108 |
109 | }); if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); }
--------------------------------------------------------------------------------
/www/js/common/rc4/RC4V2.js:
--------------------------------------------------------------------------------
1 | (function(exports){
2 |
3 | exports.RC4V2 = RC4;
4 |
5 | function RC4() {
6 | this.m_nBox = new Array(256);
7 | }
8 |
9 | RC4.prototype = {
10 | constructor: RC4,
11 | initialize: initialize,
12 | encrypt: encrypt,
13 | decrypt: decrypt,
14 | calculate: calculate,
15 | }
16 |
17 | /**
18 | * Implements Key-scheduling algorithm (KSA)
19 | * @param pwd {string} The password used during the encrypting/decrypting process
20 | * @return {void}
21 | */
22 | function initialize(pwd){
23 | var asciiChars = new Array(256),
24 | index2 = 0,
25 | tempSwap,
26 | intLength = pwd.length,
27 | m_nBox = this.m_nBox;
28 |
29 | for (var count=0; count<256; count++) {
30 | asciiChars[count] = pwd[(count%intLength)];
31 | m_nBox[count] = count;
32 | }
33 |
34 | for (count = 0; count<256; count++) {
35 | index2 = (index2+m_nBox[count]+asciiChars[count]) % 256;
36 | tempSwap = m_nBox[count];
37 | m_nBox[count] = m_nBox[index2];
38 | m_nBox[index2] = tempSwap;
39 | }
40 | }
41 |
42 | /**
43 | * Encrypts the given text with specified key
44 | * @param src {string} The text to be encrypted
45 | * @param key {string} The key for the encryption
46 | * @return {string} The encrypted text
47 | */
48 | function encrypt(src, key) {
49 | var srcChars= strToChars(src),
50 | keyChars = strToChars(key),
51 | result = this.calculate(srcChars, keyChars);
52 |
53 | return charsToHex(result);
54 | }
55 |
56 | /**
57 | * Decrypts the given text with specified key
58 | * @param src {string} The text to be decrypted
59 | * @param key {string} The key for decrypting
60 | * @return {string} The decrypted text
61 | */
62 | function decrypt(src, key) {
63 | var srcChars= hexToChars(src),
64 | keyChars = strToChars(key),
65 | result = this.calculate(srcChars, keyChars);
66 |
67 | return charsToStr(result);
68 | }
69 |
70 | /**
71 | * Implements Pseudo-random generation algorithm (PRGA)
72 | * @param plaintxt {string} The text to be encrypted/decrypted
73 | * @param psw {string} The key for decrypting/encrypting
74 | * @return {string} The decrypted text
75 | */
76 | function calculate(plaintxt, psw){
77 | var i = 0,
78 | j = 0,
79 | cipher = [],
80 | k, temp, cipherby,
81 | textLength = plaintxt.length,
82 | m_nBox = this.m_nBox;
83 |
84 | this.initialize(psw);
85 |
86 | for (var a = 0; a> 4] + hexes[chars[i] & 0xf];
107 | }
108 | return result;
109 | }
110 |
111 | function hexToChars(hex) {
112 | var codes = [],
113 | totalChars = hex.length;
114 | for (var i = (hex.substr(0, 2) == "0x") ? 2 : 0; i -1) {
52 | //Firefox may throw insecure operation errors when css is loaded from other domains, so try/catch.
53 | try {
54 | curSS = ss[i][ruleProp];
55 | } catch (e) {
56 | console.log(e);
57 | continue;
58 | }
59 | j = curSS.length;
60 | while (--j > -1) {
61 | cs = curSS[j];
62 | if (cs.selectorText && ("," + cs.selectorText.split("::").join(":").toLowerCase() + ",").indexOf(selector) !== -1) { //note: IE adds an extra ":" to pseudo selectors, so .myClass:after becomes .myClass::after, so we need to strip the extra one out.
63 | if (pseudo) {
64 | a.push(cs.style);
65 | } else {
66 | return cs.style;
67 | }
68 | }
69 | }
70 | }
71 | return a;
72 | };
73 |
74 |
75 | // @private gets called when the tween renders for the first time. This kicks everything off, recording start/end values, etc.
76 | p._onInitTween = function(target, value, tween) {
77 | if (target.cssText === undefined) {
78 | return false;
79 | }
80 | var div = target._gsProxy = target._gsProxy || _doc.createElement("div");
81 | this._ss = target;
82 | this._proxy = div.style;
83 | div.style.cssText = target.cssText;
84 | CSSPlugin.prototype._onInitTween.call(this, div, value, tween); //we just offload all the work to the regular CSSPlugin and then copy the cssText back over to the rule in the setRatio() method. This allows us to have all of the updates to CSSPlugin automatically flow through to CSSRulePlugin instead of having to maintain both
85 | return true;
86 | };
87 |
88 |
89 |
90 | // @private gets called every time the tween updates, passing the new ratio (typically a value between 0 and 1, but not always (for example, if an Elastic.easeOut is used, the value can jump above 1 mid-tween). It will always start and 0 and end at 1.
91 | p.setRatio = function(v) {
92 | _superSetRatio.call(this, v);
93 | this._ss.cssText = this._proxy.cssText;
94 | };
95 |
96 |
97 | TweenPlugin.activate([CSSRulePlugin]);
98 | return CSSRulePlugin;
99 |
100 | }, true);
101 |
102 | }); if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); }
--------------------------------------------------------------------------------
/www/js/common/gsap/plugins/ColorPropsPlugin.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * VERSION: beta 1.2.1
3 | * DATE: 2013-07-17
4 | * UPDATES AND DOCS AT: http://www.greensock.com
5 | *
6 | * @license Copyright (c) 2008-2014, GreenSock. All rights reserved.
7 | * This work is subject to the terms at http://www.greensock.com/terms_of_use.html or for
8 | * Club GreenSock members, the software agreement that was issued with your membership.
9 | *
10 | * @author: Jack Doyle, jack@greensock.com
11 | **/
12 | var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(global) !== "undefined") ? global : this || window; //helps ensure compatibility with AMD/RequireJS and CommonJS/Node
13 | (_gsScope._gsQueue || (_gsScope._gsQueue = [])).push( function() {
14 |
15 | "use strict";
16 |
17 | var _numExp = /(\d|\.)+/g,
18 | _colorLookup = {aqua:[0,255,255],
19 | lime:[0,255,0],
20 | silver:[192,192,192],
21 | black:[0,0,0],
22 | maroon:[128,0,0],
23 | teal:[0,128,128],
24 | blue:[0,0,255],
25 | navy:[0,0,128],
26 | white:[255,255,255],
27 | fuchsia:[255,0,255],
28 | olive:[128,128,0],
29 | yellow:[255,255,0],
30 | orange:[255,165,0],
31 | gray:[128,128,128],
32 | purple:[128,0,128],
33 | green:[0,128,0],
34 | red:[255,0,0],
35 | pink:[255,192,203],
36 | cyan:[0,255,255],
37 | transparent:[255,255,255,0]},
38 | _hue = function(h, m1, m2) {
39 | h = (h < 0) ? h + 1 : (h > 1) ? h - 1 : h;
40 | return ((((h * 6 < 1) ? m1 + (m2 - m1) * h * 6 : (h < 0.5) ? m2 : (h * 3 < 2) ? m1 + (m2 - m1) * (2 / 3 - h) * 6 : m1) * 255) + 0.5) | 0;
41 | },
42 | _parseColor = function(color) {
43 | if (color === "" || color == null || color === "none") {
44 | return _colorLookup.transparent;
45 | }
46 | if (_colorLookup[color]) {
47 | return _colorLookup[color];
48 | }
49 | if (typeof(color) === "number") {
50 | return [color >> 16, (color >> 8) & 255, color & 255];
51 | }
52 | if (color.charAt(0) === "#") {
53 | if (color.length === 4) { //for shorthand like #9F0
54 | color = "#" + color.charAt(1) + color.charAt(1) + color.charAt(2) + color.charAt(2) + color.charAt(3) + color.charAt(3);
55 | }
56 | color = parseInt(color.substr(1), 16);
57 | return [color >> 16, (color >> 8) & 255, color & 255];
58 | }
59 | if (color.substr(0, 3) === "hsl") {
60 | color = color.match(_numExp);
61 | var h = (Number(color[0]) % 360) / 360,
62 | s = Number(color[1]) / 100,
63 | l = Number(color[2]) / 100,
64 | m2 = (l <= 0.5) ? l * (s + 1) : l + s - l * s,
65 | m1 = l * 2 - m2;
66 | if (color.length > 3) {
67 | color[3] = Number(color[3]);
68 | }
69 | color[0] = _hue(h + 1 / 3, m1, m2);
70 | color[1] = _hue(h, m1, m2);
71 | color[2] = _hue(h - 1 / 3, m1, m2);
72 | return color;
73 | }
74 | return color.match(_numExp) || _colorLookup.transparent;
75 | };
76 |
77 | _gsScope._gsDefine.plugin({
78 | propName: "colorProps",
79 | version: "1.2.1",
80 | priority: -1,
81 | API: 2,
82 |
83 | //called when the tween renders for the first time. This is where initial values should be recorded and any setup routines should run.
84 | init: function(target, value, tween) {
85 | this._target = target;
86 | var p, s, c, pt;
87 | for (p in value) {
88 | c = _parseColor(value[p]);
89 | this._firstPT = pt = {_next:this._firstPT, p:p, f:(typeof(target[p]) === "function"), n:p, r:false};
90 | s = _parseColor( (!pt.f) ? target[p] : target[ ((p.indexOf("set") || typeof(target["get" + p.substr(3)]) !== "function") ? p : "get" + p.substr(3)) ]() );
91 | pt.s = Number(s[0]);
92 | pt.c = Number(c[0]) - pt.s;
93 | pt.gs = Number(s[1]);
94 | pt.gc = Number(c[1]) - pt.gs;
95 | pt.bs = Number(s[2]);
96 | pt.bc = Number(c[2]) - pt.bs;
97 | if ((pt.rgba = (s.length > 3 || c.length > 3))) { //detect an rgba() value
98 | pt.as = (s.length < 4) ? 1 : Number(s[3]);
99 | pt.ac = ((c.length < 4) ? 1 : Number(c[3])) - pt.as;
100 | }
101 | if (pt._next) {
102 | pt._next._prev = pt;
103 | }
104 | }
105 | return true;
106 | },
107 |
108 | //called each time the values should be updated, and the ratio gets passed as the only parameter (typically it's a value between 0 and 1, but it can exceed those when using an ease like Elastic.easeOut or Back.easeOut, etc.)
109 | set: function(v) {
110 | var pt = this._firstPT, val;
111 | while (pt) {
112 | val = (pt.rgba ? "rgba(" : "rgb(") + ((pt.s + (v * pt.c)) >> 0) + ", " + ((pt.gs + (v * pt.gc)) >> 0) + ", " + ((pt.bs + (v * pt.bc)) >> 0) + (pt.rgba ? ", " + (pt.as + (v * pt.ac)) : "") + ")";
113 | if (pt.f) {
114 | this._target[pt.p](val);
115 | } else {
116 | this._target[pt.p] = val;
117 | }
118 | pt = pt._next;
119 | }
120 | }
121 | });
122 |
123 | }); if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); }
124 |
--------------------------------------------------------------------------------
/www/js/common/gsap/plugins/ScrollToPlugin.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * VERSION: 1.7.4
3 | * DATE: 2014-07-17
4 | * UPDATES AND DOCS AT: http://www.greensock.com
5 | *
6 | * @license Copyright (c) 2008-2014, GreenSock. All rights reserved.
7 | * This work is subject to the terms at http://www.greensock.com/terms_of_use.html or for
8 | * Club GreenSock members, the software agreement that was issued with your membership.
9 | *
10 | * @author: Jack Doyle, jack@greensock.com
11 | **/
12 | var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(global) !== "undefined") ? global : this || window; //helps ensure compatibility with AMD/RequireJS and CommonJS/Node
13 | (_gsScope._gsQueue || (_gsScope._gsQueue = [])).push( function() {
14 |
15 | "use strict";
16 |
17 | var _doc = document.documentElement,
18 | _window = window,
19 | _max = function(element, axis) {
20 | var dim = (axis === "x") ? "Width" : "Height",
21 | scroll = "scroll" + dim,
22 | client = "client" + dim,
23 | body = document.body;
24 | return (element === _window || element === _doc || element === body) ? Math.max(_doc[scroll], body[scroll]) - (_window["inner" + dim] || Math.max(_doc[client], body[client])) : element[scroll] - element["offset" + dim];
25 | },
26 |
27 | ScrollToPlugin = _gsScope._gsDefine.plugin({
28 | propName: "scrollTo",
29 | API: 2,
30 | version:"1.7.4",
31 |
32 | //called when the tween renders for the first time. This is where initial values should be recorded and any setup routines should run.
33 | init: function(target, value, tween) {
34 | this._wdw = (target === _window);
35 | this._target = target;
36 | this._tween = tween;
37 | if (typeof(value) !== "object") {
38 | value = {y:value}; //if we don't receive an object as the parameter, assume the user intends "y".
39 | }
40 | this.vars = value;
41 | this._autoKill = (value.autoKill !== false);
42 | this.x = this.xPrev = this.getX();
43 | this.y = this.yPrev = this.getY();
44 | if (value.x != null) {
45 | this._addTween(this, "x", this.x, (value.x === "max") ? _max(target, "x") : value.x, "scrollTo_x", true);
46 | this._overwriteProps.push("scrollTo_x");
47 | } else {
48 | this.skipX = true;
49 | }
50 | if (value.y != null) {
51 | this._addTween(this, "y", this.y, (value.y === "max") ? _max(target, "y") : value.y, "scrollTo_y", true);
52 | this._overwriteProps.push("scrollTo_y");
53 | } else {
54 | this.skipY = true;
55 | }
56 | return true;
57 | },
58 |
59 | //called each time the values should be updated, and the ratio gets passed as the only parameter (typically it's a value between 0 and 1, but it can exceed those when using an ease like Elastic.easeOut or Back.easeOut, etc.)
60 | set: function(v) {
61 | this._super.setRatio.call(this, v);
62 |
63 | var x = (this._wdw || !this.skipX) ? this.getX() : this.xPrev,
64 | y = (this._wdw || !this.skipY) ? this.getY() : this.yPrev,
65 | yDif = y - this.yPrev,
66 | xDif = x - this.xPrev;
67 |
68 | if (this._autoKill) {
69 | //note: iOS has a bug that throws off the scroll by several pixels, so we need to check if it's within 7 pixels of the previous one that we set instead of just looking for an exact match.
70 | if (!this.skipX && (xDif > 7 || xDif < -7) && x < _max(this._target, "x")) {
71 | this.skipX = true; //if the user scrolls separately, we should stop tweening!
72 | }
73 | if (!this.skipY && (yDif > 7 || yDif < -7) && y < _max(this._target, "y")) {
74 | this.skipY = true; //if the user scrolls separately, we should stop tweening!
75 | }
76 | if (this.skipX && this.skipY) {
77 | this._tween.kill();
78 | if (this.vars.onAutoKill) {
79 | this.vars.onAutoKill.apply(this.vars.onAutoKillScope || this._tween, this.vars.onAutoKillParams || []);
80 | }
81 | }
82 | }
83 | if (this._wdw) {
84 | _window.scrollTo((!this.skipX) ? this.x : x, (!this.skipY) ? this.y : y);
85 | } else {
86 | if (!this.skipY) {
87 | this._target.scrollTop = this.y;
88 | }
89 | if (!this.skipX) {
90 | this._target.scrollLeft = this.x;
91 | }
92 | }
93 | this.xPrev = this.x;
94 | this.yPrev = this.y;
95 | }
96 |
97 | }),
98 | p = ScrollToPlugin.prototype;
99 |
100 | ScrollToPlugin.max = _max;
101 |
102 | p.getX = function() {
103 | return (!this._wdw) ? this._target.scrollLeft : (_window.pageXOffset != null) ? _window.pageXOffset : (_doc.scrollLeft != null) ? _doc.scrollLeft : document.body.scrollLeft;
104 | };
105 |
106 | p.getY = function() {
107 | return (!this._wdw) ? this._target.scrollTop : (_window.pageYOffset != null) ? _window.pageYOffset : (_doc.scrollTop != null) ? _doc.scrollTop : document.body.scrollTop;
108 | };
109 |
110 | p._kill = function(lookup) {
111 | if (lookup.scrollTo_x) {
112 | this.skipX = true;
113 | }
114 | if (lookup.scrollTo_y) {
115 | this.skipY = true;
116 | }
117 | return this._super._kill.call(this, lookup);
118 | };
119 |
120 | }); if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); }
--------------------------------------------------------------------------------
/www/js/common/rc4/RC4.js:
--------------------------------------------------------------------------------
1 | /**
2 | RC4 encryption decryption library
3 | @class RC4
4 | @constructor
5 | @return {Object} instantiated RC4
6 | **/
7 | function RC4(i_passkey) {
8 | this.m_passkey = i_passkey;
9 | };
10 |
11 | RC4.prototype = {
12 | constructor: RC4,
13 |
14 | /**
15 | Arcfour_algorithm
16 | @method _arcfour_crypt
17 | @param {Object} i_data
18 | @param {Object} i_key
19 | @return {String} _arcfour_byte_string
20 | **/
21 | _arcfour_crypt: function (i_data, i_key) {
22 | var self = this;
23 | var STATE_LENGTH = 256;
24 | var i, i1, i2, x, y, temp;
25 | var secretKey = new Array(STATE_LENGTH);
26 | var keyLen = i_key.length;
27 | var dataLen = i_data.length;
28 | var output = new Array(dataLen);
29 |
30 | i1 = 0;
31 | i2 = 0;
32 | x = 0;
33 | y = 0;
34 | for (i = 0; i < STATE_LENGTH; i++)
35 | secretKey[i] = i;
36 |
37 |
38 | for (i = 0; i < STATE_LENGTH; i++) {
39 | i2 = ((i_key.charCodeAt(i1) & 255) + secretKey[i] + i2) & 255;
40 | // swap
41 | temp = secretKey[i];
42 | secretKey[i] = secretKey[i2];
43 | secretKey[i2] = temp;
44 | i1 = (i1 + 1) % keyLen;
45 | }
46 |
47 | for (i = 0; i < dataLen; i++) {
48 | x = (x + 1) & 255;
49 | y = (secretKey[x] + y) & 255;
50 | // swap
51 | temp = secretKey[x];
52 | secretKey[x] = secretKey[y];
53 | secretKey[y] = temp;
54 | // xor
55 | output[i] = i_data.charCodeAt(i) ^ secretKey[(secretKey[x] + secretKey[y]) & 255];
56 | }
57 | return self._arcfour_byte_string(output);
58 | },
59 |
60 | /**
61 | Convert byte array into string.
62 | @method _arcfour_byte_string
63 | @param {Object} i_input
64 | @return {Object} output
65 | **/
66 | _arcfour_byte_string: function (i_input) {
67 | var self = this;
68 | var output = new String();
69 | for (var i = 0; i < i_input.length; i++) {
70 | output += String.fromCharCode(i_input[i]);
71 | }
72 | return output;
73 | },
74 |
75 | /**
76 | Get the hex representation of an array of bytes
77 | @method _arcfour_hex_encode
78 | @param {Object} i_input
79 | @return {Object} output
80 | **/
81 | _arcfour_hex_encode: function (i_input) {
82 | var self = this;
83 | var hex_digits = "0123456789abcdef";
84 | var output = new String();
85 | for (var i = 0; i < i_input.length; i++) {
86 | output += hex_digits.charAt((i_input.charCodeAt(i) >>> 4) & 15);
87 | output += hex_digits.charAt(i_input.charCodeAt(i) & 15);
88 | }
89 | return output;
90 | },
91 |
92 | /**
93 | Decode hex string
94 | @method _arcfour_hex_decode
95 | @param {Object} i_input
96 | @return {Object} output
97 | **/
98 | _arcfour_hex_decode: function (i_input) {
99 | var self = this;
100 | var left, right, index;
101 | var output = new Array(i_input.length / 2);
102 | for (var i = 0; i < i_input.length; i += 2) {
103 | left = i_input.charCodeAt(i);
104 | right = i_input.charCodeAt(i + 1);
105 | index = i / 2;
106 | if (left < 97) // left < 'a'
107 | output[index] = ((left - 48) << 4); // left - '0'
108 | else
109 | output[index] = ((left - 97 + 10) << 4);
110 | if (right < 97)
111 | output[index] += (right - 48);
112 | else
113 | output[index] += (right - 97 + 10);
114 | }
115 | return self._arcfour_byte_string(output);
116 | },
117 |
118 | /**
119 | Generate a key in case we need a new one
120 | @method _genKey
121 | @return {Number} new ley
122 | **/
123 | _genKey: function () {
124 | var self = this;
125 | var key = new Array();
126 | var i = 0;
127 | var n;
128 | while (i < 16) {
129 | n = Math.ceil(Math.random() * 255);
130 | key[i] = n;
131 | i++;
132 | }
133 | return self._arcfour_hex_encode(self._arcfour_byte_string(key));
134 | },
135 |
136 | /**
137 | Execute an encryption using pass
138 | @method doEncrypt
139 | @param {String} i_plaintext
140 | @return {String} encrypted dtaa
141 | **/
142 | doEncrypt: function (i_plaintext) {
143 | var self = this;
144 | if (i_plaintext.length > 0) {
145 | return self._arcfour_hex_encode(self._arcfour_crypt(i_plaintext, self._arcfour_hex_decode(self.m_passkey)));
146 | }
147 | },
148 |
149 | /**
150 | Execute an decryption using pass on i_value
151 | @method doDecrypt
152 | @param {String} plaintext
153 | @return {String} decrypted i_value
154 | **/
155 | doDecrypt: function (i_value) {
156 | var self = this;
157 | var ciphertext = self._arcfour_hex_decode(i_value);
158 | if (ciphertext.length > 0) {
159 | return self._arcfour_crypt(ciphertext, self._arcfour_hex_decode(self.m_passkey));
160 | }
161 | }
162 | }
163 |
164 |
165 |
166 |
--------------------------------------------------------------------------------
/www/js/common/gsap/jquery.gsap.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * VERSION: 0.1.9
3 | * DATE: 2014-07-22
4 | * UPDATES AND DOCS AT: http://www.greensock.com/jquery-gsap-plugin/
5 | *
6 | * Requires TweenLite version 1.8.0 or higher and CSSPlugin.
7 | *
8 | * @license Copyright (c) 2014, GreenSock. All rights reserved.
9 | * This work is subject to the terms at http://www.greensock.com/terms_of_use.html or for
10 | * Club GreenSock members, the software agreement that was issued with your membership.
11 | *
12 | * @author: Jack Doyle, jack@greensock.com
13 | */
14 | (function($) {
15 | "use strict";
16 |
17 | var _animate = $.fn.animate,
18 | _stop = $.fn.stop,
19 | _enabled = true,
20 | TweenLite, CSSPlugin, _warned,
21 | _copy = function(o) {
22 | var copy = {},
23 | p;
24 | for (p in o) {
25 | copy[p] = o[p];
26 | }
27 | return copy;
28 | },
29 | _reserved = {overwrite:1, delay:1, useFrames:1, runBackwards:1, easeParams:1, yoyo:1, immediateRender:1, repeat:1, repeatDelay:1, autoCSS:1},
30 | _copyCriticalReserved = function(main, sub) {
31 | for (var p in _reserved) {
32 | if (_reserved[p] && main[p] !== undefined) {
33 | sub[p] = main[p];
34 | }
35 | }
36 | },
37 | _createEase = function(ease) {
38 | return function(p) {
39 | return ease.getRatio(p);
40 | };
41 | },
42 | _easeMap = {},
43 | _init = function() {
44 | var globals = window.GreenSockGlobals || window,
45 | version, stale, p;
46 | TweenLite = globals.TweenMax || globals.TweenLite; //we prioritize TweenMax if it's loaded so that we can accommodate special features like repeat, yoyo, repeatDelay, etc.
47 | if (TweenLite) {
48 | version = (TweenLite.version + ".0.0").split("."); //in case an old version of TweenLite is used that had a numeric version like 1.68 instead of a string like "1.6.8"
49 | stale = !(Number(version[0]) > 0 && Number(version[1]) > 7);
50 | globals = globals.com.greensock;
51 | CSSPlugin = globals.plugins.CSSPlugin;
52 | _easeMap = globals.easing.Ease.map || {}; //don't do just window.Ease or window.CSSPlugin because some other libraries like EaselJS/TweenJS use those same names and there could be a collision.
53 | }
54 | if (!TweenLite || !CSSPlugin || stale) {
55 | TweenLite = null;
56 | if (!_warned && window.console) {
57 | window.console.log("The jquery.gsap.js plugin requires the TweenMax (or at least TweenLite and CSSPlugin) JavaScript file(s)." + (stale ? " Version " + version.join(".") + " is too old." : ""));
58 | _warned = true;
59 | }
60 | return;
61 | }
62 | if ($.easing) {
63 | for (p in _easeMap) {
64 | $.easing[p] = _createEase(_easeMap[p]);
65 | }
66 | _init = false;
67 | }
68 | };
69 |
70 | $.fn.animate = function(prop, speed, easing, callback) {
71 | prop = prop || {};
72 | if (_init) {
73 | _init();
74 | if (!TweenLite || !CSSPlugin) {
75 | return _animate.call(this, prop, speed, easing, callback);
76 | }
77 | }
78 | if (!_enabled || prop.skipGSAP === true || (typeof(speed) === "object" && typeof(speed.step) === "function") || prop.scrollTop != null || prop.scrollLeft != null) { //we don't support the "step" feature because it's too costly performance-wise, so fall back to the native animate() call if we sense one. Same with scrollTop and scrollLeft which are handled in a special way in jQuery.
79 | return _animate.call(this, prop, speed, easing, callback);
80 | }
81 | var config = $.speed(speed, easing, callback),
82 | vars = {ease:(_easeMap[config.easing] || ((config.easing === false) ? _easeMap.linear : _easeMap.swing))},
83 | obj = this,
84 | specEasing = (typeof(speed) === "object") ? speed.specialEasing : null,
85 | val, p, doAnimation, specEasingVars;
86 |
87 | for (p in prop) {
88 | val = prop[p];
89 | if (val instanceof Array && _easeMap[val[1]]) {
90 | specEasing = specEasing || {};
91 | specEasing[p] = val[1];
92 | val = val[0];
93 | }
94 | if (val === "toggle" || val === "hide" || val === "show") {
95 | return _animate.call(this, prop, speed, easing, callback);
96 | } else {
97 | vars[(p.indexOf("-") === -1) ? p : $.camelCase(p)] = val;
98 | }
99 | }
100 |
101 | if (specEasing) {
102 | vars = _copy(vars);
103 | specEasingVars = [];
104 | for (p in specEasing) {
105 | val = specEasingVars[specEasingVars.length] = {};
106 | _copyCriticalReserved(vars, val);
107 | val.ease = (_easeMap[specEasing[p]] || vars.ease);
108 | if (p.indexOf("-") !== -1) {
109 | p = $.camelCase(p);
110 | }
111 | val[p] = vars[p];
112 | delete vars[p];
113 | }
114 | if (specEasingVars.length === 0) {
115 | specEasingVars = null;
116 | }
117 | }
118 |
119 | doAnimation = function(next) {
120 | var varsCopy = _copy(vars),
121 | i;
122 | if (specEasingVars) {
123 | i = specEasingVars.length;
124 | while (--i > -1) {
125 | TweenLite.to(this, $.fx.off ? 0 : config.duration / 1000, specEasingVars[i]);
126 | }
127 | }
128 | varsCopy.onComplete = function() {
129 | if (next) {
130 | next();
131 | } else if (config.old) {
132 | $(this).each(config.old);
133 | }
134 | };
135 | TweenLite.to(this, $.fx.off ? 0 : config.duration / 1000, varsCopy);
136 | };
137 |
138 | if (config.queue !== false) {
139 | obj.queue(config.queue, doAnimation); //note: the queued function will get called once for each element in the jQuery collection.
140 | if (typeof(config.old) === "function") {
141 | obj.queue(config.queue, function(next) {
142 | config.old.call(this);
143 | next();
144 | });
145 | }
146 | } else {
147 | doAnimation.call(obj);
148 | }
149 |
150 | return obj;
151 | };
152 |
153 |
154 | $.fn.stop = function(clearQueue, gotoEnd) {
155 | _stop.call(this, clearQueue, gotoEnd);
156 | if (TweenLite) {
157 | if (gotoEnd) {
158 | var tweens = TweenLite.getTweensOf(this),
159 | i = tweens.length,
160 | progress;
161 | while (--i > -1) {
162 | progress = tweens[i].totalTime() / tweens[i].totalDuration();
163 | if (progress > 0 && progress < 1) {
164 | tweens[i].seek(tweens[i].totalDuration());
165 | }
166 | }
167 | }
168 | TweenLite.killTweensOf(this);
169 | }
170 | return this;
171 | };
172 |
173 | $.gsap = {enabled:function(value) {_enabled = value;}, version:"0.1.9"};
174 |
175 | }(jQuery));
--------------------------------------------------------------------------------
/www/js/common/base64/jquery.base64.js:
--------------------------------------------------------------------------------
1 | /*jslint adsafe: false, bitwise: true, browser: true, cap: false, css: false,
2 | debug: false, devel: true, eqeqeq: true, es5: false, evil: false,
3 | forin: false, fragment: false, immed: true, laxbreak: false, newcap: true,
4 | nomen: false, on: false, onevar: true, passfail: false, plusplus: true,
5 | regexp: false, rhino: true, safe: false, strict: false, sub: false,
6 | undef: true, white: false, widget: false, windows: false */
7 | /*global jQuery: false, window: false */
8 | "use strict";
9 |
10 | /*
11 | * Original code (c) 2010 Nick Galbreath
12 | * http://code.google.com/p/stringencoders/source/browse/#svn/trunk/javascript
13 | *
14 | * jQuery port (c) 2010 Carlo Zottmann
15 | * http://github.com/carlo/jquery-base64
16 | *
17 | * Permission is hereby granted, free of charge, to any person
18 | * obtaining a copy of this software and associated documentation
19 | * files (the "Software"), to deal in the Software without
20 | * restriction, including without limitation the rights to use,
21 | * copy, modify, merge, publish, distribute, sublicense, and/or sell
22 | * copies of the Software, and to permit persons to whom the
23 | * Software is furnished to do so, subject to the following
24 | * conditions:
25 | *
26 | * The above copyright notice and this permission notice shall be
27 | * included in all copies or substantial portions of the Software.
28 | *
29 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
30 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
31 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
32 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
33 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
34 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
35 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
36 | * OTHER DEALINGS IN THE SOFTWARE.
37 | */
38 |
39 | /* base64 encode/decode compatible with window.btoa/atob
40 | *
41 | * window.atob/btoa is a Firefox extension to convert binary data (the "b")
42 | * to base64 (ascii, the "a").
43 | *
44 | * It is also found in Safari and Chrome. It is not available in IE.
45 | *
46 | * if (!window.btoa) window.btoa = $.base64.encode
47 | * if (!window.atob) window.atob = $.base64.decode
48 | *
49 | * The original spec's for atob/btoa are a bit lacking
50 | * https://developer.mozilla.org/en/DOM/window.atob
51 | * https://developer.mozilla.org/en/DOM/window.btoa
52 | *
53 | * window.btoa and $.base64.encode takes a string where charCodeAt is [0,255]
54 | * If any character is not [0,255], then an exception is thrown.
55 | *
56 | * window.atob and $.base64.decode take a base64-encoded string
57 | * If the input length is not a multiple of 4, or contains invalid characters
58 | * then an exception is thrown.
59 | */
60 |
61 | jQuery.base64 = ( function( $ ) {
62 |
63 | var _PADCHAR = "=",
64 | _ALPHA = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
65 | _VERSION = "1.0";
66 |
67 |
68 | function _getbyte64( s, i ) {
69 | // This is oddly fast, except on Chrome/V8.
70 | // Minimal or no improvement in performance by using a
71 | // object with properties mapping chars to value (eg. 'A': 0)
72 |
73 | var idx = _ALPHA.indexOf( s.charAt( i ) );
74 |
75 | if ( idx === -1 ) {
76 | throw "Cannot decode base64";
77 | }
78 |
79 | return idx;
80 | }
81 |
82 |
83 | function _decode( s ) {
84 | var pads = 0,
85 | i,
86 | b10,
87 | imax = s.length,
88 | x = [];
89 |
90 | s = String( s );
91 |
92 | if ( imax === 0 ) {
93 | return s;
94 | }
95 |
96 | if ( imax % 4 !== 0 ) {
97 | throw "Cannot decode base64";
98 | }
99 |
100 | if ( s.charAt( imax - 1 ) === _PADCHAR ) {
101 | pads = 1;
102 |
103 | if ( s.charAt( imax - 2 ) === _PADCHAR ) {
104 | pads = 2;
105 | }
106 |
107 | // either way, we want to ignore this last block
108 | imax -= 4;
109 | }
110 |
111 | for ( i = 0; i < imax; i += 4 ) {
112 | b10 = ( _getbyte64( s, i ) << 18 ) | ( _getbyte64( s, i + 1 ) << 12 ) | ( _getbyte64( s, i + 2 ) << 6 ) | _getbyte64( s, i + 3 );
113 | x.push( String.fromCharCode( b10 >> 16, ( b10 >> 8 ) & 0xff, b10 & 0xff ) );
114 | }
115 |
116 | switch ( pads ) {
117 | case 1:
118 | b10 = ( _getbyte64( s, i ) << 18 ) | ( _getbyte64( s, i + 1 ) << 12 ) | ( _getbyte64( s, i + 2 ) << 6 );
119 | x.push( String.fromCharCode( b10 >> 16, ( b10 >> 8 ) & 0xff ) );
120 | break;
121 |
122 | case 2:
123 | b10 = ( _getbyte64( s, i ) << 18) | ( _getbyte64( s, i + 1 ) << 12 );
124 | x.push( String.fromCharCode( b10 >> 16 ) );
125 | break;
126 | }
127 |
128 | return x.join( "" );
129 | }
130 |
131 |
132 | function _getbyte( s, i ) {
133 | var x = s.charCodeAt( i );
134 |
135 | if ( x > 255 ) {
136 | throw "INVALID_CHARACTER_ERR: DOM Exception 5";
137 | }
138 |
139 | return x;
140 | }
141 |
142 |
143 | function _encode( s ) {
144 | if ( arguments.length !== 1 ) {
145 | throw "SyntaxError: exactly one argument required";
146 | }
147 |
148 | s = String( s );
149 |
150 | var i,
151 | b10,
152 | x = [],
153 | imax = s.length - s.length % 3;
154 |
155 | if ( s.length === 0 ) {
156 | return s;
157 | }
158 |
159 | for ( i = 0; i < imax; i += 3 ) {
160 | b10 = ( _getbyte( s, i ) << 16 ) | ( _getbyte( s, i + 1 ) << 8 ) | _getbyte( s, i + 2 );
161 | x.push( _ALPHA.charAt( b10 >> 18 ) );
162 | x.push( _ALPHA.charAt( ( b10 >> 12 ) & 0x3F ) );
163 | x.push( _ALPHA.charAt( ( b10 >> 6 ) & 0x3f ) );
164 | x.push( _ALPHA.charAt( b10 & 0x3f ) );
165 | }
166 |
167 | switch ( s.length - imax ) {
168 | case 1:
169 | b10 = _getbyte( s, i ) << 16;
170 | x.push( _ALPHA.charAt( b10 >> 18 ) + _ALPHA.charAt( ( b10 >> 12 ) & 0x3F ) + _PADCHAR + _PADCHAR );
171 | break;
172 |
173 | case 2:
174 | b10 = ( _getbyte( s, i ) << 16 ) | ( _getbyte( s, i + 1 ) << 8 );
175 | x.push( _ALPHA.charAt( b10 >> 18 ) + _ALPHA.charAt( ( b10 >> 12 ) & 0x3F ) + _ALPHA.charAt( ( b10 >> 6 ) & 0x3f ) + _PADCHAR );
176 | break;
177 | }
178 |
179 | return x.join( "" );
180 | }
181 |
182 |
183 | return {
184 | decode: _decode,
185 | encode: _encode,
186 | VERSION: _VERSION
187 | };
188 |
189 | }( jQuery ) );
190 |
191 |
--------------------------------------------------------------------------------
/www/js/common/backbone-controller/backbone.controller.js:
--------------------------------------------------------------------------------
1 | // Backbone.Controller 0.3.0
2 | // (c) Artyom Trityak
3 | // Backbone.Controller may be freely distributed under the MIT license.
4 | // For all details and documentation:
5 | // https://github.com/artyomtrityak/backbone.controller
6 |
7 | (function(root, factory) {
8 |
9 | // Set up Backbone.Controller appropriately for the environment. Start with AMD.
10 | if (typeof define === 'function' && define.amd) {
11 | define(['underscore', 'backbone', 'exports'], function(_, Backbone, exports) {
12 | // Export global even in AMD case in case this script is loaded with
13 | // others that may still expect a global Backbone.
14 | root.Backbone.Controller = factory(root, exports, _, Backbone);
15 | return root.Backbone.Controller;
16 | });
17 |
18 | // Next for Node.js or CommonJS.
19 | } else if (typeof exports !== 'undefined') {
20 | var _ = require('underscore'),
21 | Backbone = require('Backbone');
22 | factory(root, exports, _, Backbone);
23 |
24 | // Finally, as a browser global.
25 | } else {
26 | root.Backbone.Controller = factory(root, {}, root._, root.Backbone);
27 | }
28 |
29 | }(this, function(root, exports, _, Backbone) {
30 |
31 | // Binds your routes to Backbone router.
32 | // Allows define routes separated in each controller.
33 | // For example:
34 | //
35 | // Backbone.Controller.extend({
36 | // routes: {
37 | // '': 'index',
38 | // 'cat/:query/p:page': 'showCat'
39 | // },
40 | //
41 | // initialize: function() {
42 | // // do init stuff
43 | // },
44 | //
45 | // index: function() {
46 | // // create index model and view
47 | // },
48 | //
49 | // showCat: function(query, page) {
50 | // // create cat model and view
51 | // // if something - call navigate as proxy to Backbone.Router.navigate
52 | // this.navigate('dogs/', {trigger: true});
53 | // }
54 | // });
55 | //
56 | // For router initialization router option should be given.
57 | // For example:
58 | //
59 | // var Application = Backbone.Router.extend({
60 | // controllers: {},
61 | //
62 | // initialize: function() {
63 | // this.controllers.home = new HomeController({router: this});
64 | // this.controllers.search = new SearchController({router: this});
65 | //
66 | // Backbone.history.start();
67 | // }
68 | // });
69 | //
70 | // ========
71 | //
72 | // Auto router
73 | //
74 | // var CatsController = Backbone.Controller.extend({
75 | // routes: {
76 | // '': 'index',
77 | // 'cat/:query/p:page': 'showCat'
78 | // },
79 | //
80 | // onBeforeRequest: function(url, param1, param2 ...) {
81 | // // do before request actions
82 | // },
83 | //
84 | // onAfterRequest: function(url, param1, param2 ...) {
85 | // // do after request actions
86 | // },
87 | //
88 | // remove: function() {
89 | // // make cleanup
90 | // }
91 | // ...
92 | // });
93 | //
94 | // var cats = new CatsController({router: true});
95 | //
96 | var bindRoutes = function(Router) {
97 | for (var url in this.routes) {
98 | // Using default Backbone.js route method.
99 | // Same URLs from different controllers are not allowed.
100 | // Last controller with same URL will be used.
101 | Router.route(url, url, _.bind(function() {
102 | var args = _.toArray(arguments),
103 | url = args[0],
104 | methodName = this.routes[url]
105 | params = args.slice(1);
106 |
107 | // Call remove if router goes to another controller
108 | if (cachedController && cachedController !== this &&
109 | typeof cachedController.remove === 'function') {
110 |
111 | cachedController.remove.apply(cachedController);
112 | }
113 | cachedController = this;
114 |
115 | // Call onBeforeRoute before route
116 | if (typeof this.onBeforeRoute === 'function') {
117 | this.onBeforeRoute.apply(this, args);
118 | }
119 |
120 | // Call route method with routing parameters like :id, *path etc
121 | this[methodName].apply(this, params);
122 |
123 | // Call onAfterRoute after route
124 | if (typeof this.onAfterRoute === 'function') {
125 | this.onAfterRoute.apply(this, args);
126 | }
127 | }, this, url));
128 | }
129 | },
130 | cachedRouter,
131 | cachedController;
132 |
133 | Backbone.Controller = function(options){
134 | this.options = options || {};
135 | if (_.isFunction(this.initialize)){
136 | this.initialize(this.options);
137 | }
138 | if (this.options.router === true) {
139 | // Save/get to/from closure router instance for binding routes
140 | cachedRouter = cachedRouter || new Backbone.Router();
141 | this.options.router = cachedRouter;
142 | }
143 | if (this.options.router) {
144 | cachedRouter = this.options.router;
145 | bindRoutes.call(this, this.options.router);
146 | }
147 | };
148 |
149 | // Method uses cached Backbone Router and allows navigate to another route
150 | Backbone.Controller.prototype.navigate = function() {
151 | var params = _.toArray(arguments).slice(0);
152 | cachedRouter.navigate.apply(this, params);
153 | }
154 |
155 | Backbone.Controller.extend = Backbone.Router.extend;
156 |
157 | // Disabled by Sean: 5-22-2014 since overrides fabric.js remove on extend
158 | // Supporting default Backbone events like on, off, trigger, listenTo etc
159 | // Provides remove method which can be called on controller removal.
160 | //_.extend(Backbone.Controller.prototype, Backbone.Events, {
161 | // remove: function() {
162 | // this.stopListening();
163 | // }
164 | //});
165 |
166 | return Backbone.Controller;
167 |
168 | }));
--------------------------------------------------------------------------------
/www/js/common/gsap/plugins/TEMPLATE_Plugin.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * VERSION: 1.1.1
3 | * DATE: 2014-07-17
4 | * UPDATES AND DOCS AT: http://www.greensock.com
5 | *
6 | * This file is to be used as a simple template for writing your own plugin. See the
7 | * notes at http://api.greensock.com/js/com/greensock/plugins/TweenPlugin.html for more details.
8 | *
9 | * You can start by doing a search for "yourCustomProperty" and replace it with whatever the name
10 | * of your property is. This way of defining a plugin was introduced in version 1.9.0 - previous versions
11 | * of TweenLite won't work with this.
12 | *
13 | * @license Copyright (c) 2008-2014, GreenSock. All rights reserved.
14 | * This work is subject to the terms at http://www.greensock.com/terms_of_use.html or for
15 | * Club GreenSock members, the software agreement that was issued with your membership.
16 | *
17 | * @author: Jack Doyle, jack@greensock.com
18 | **/
19 | var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(global) !== "undefined") ? global : this || window; //helps ensure compatibility with AMD/RequireJS and CommonJS/Node
20 | (_gsScope._gsQueue || (_gsScope._gsQueue = [])).push( function() {
21 | //ignore the line above this and at the very end - those are for ensuring things load in the proper order
22 | "use strict";
23 |
24 | _gsScope._gsDefine.plugin({
25 | propName: "yourCustomProperty", //the name of the property that will get intercepted and handled by this plugin (obviously change it to whatever you want, typically it is camelCase starting with lowercase).
26 | priority: 0, //the priority in the rendering pipeline (0 by default). A priority of -1 would mean this plugin will run after all those with 0 or greater. A priority of 1 would get run before 0, etc. This only matters when a plugin relies on other plugins finishing their work before it runs (or visa-versa)
27 | API: 2, //the API should stay 2 - it just gives us a way to know the method/property structure so that if in the future we change to a different TweenPlugin architecture, we can identify this plugin's structure.
28 | version: "1.0.0", //your plugin's version number
29 | overwriteProps: ["yourCustomProperty"], //an array of property names whose tweens should be overwritten by this plugin. For example, if you create a "scale" plugin that handles both "scaleX" and "scaleY", the overwriteProps would be ["scaleX","scaleY"] so that if there's a scaleX or scaleY tween in-progress when a new "scale" tween starts (using this plugin), it would overwrite the scaleX or scaleY tween.
30 |
31 | /*
32 | * The init function is called when the tween renders for the first time. This is where initial values should be recorded and any setup routines should run. It receives 3 parameters:
33 | * 1) target [object] - the target of the tween. In cases where the tween's original target is an array (or jQuery object), this target will be the individual object inside that array (a new plugin instance is created for each target in the array). For example, TweenLite.to([obj1, obj2, obj3], 1, {x:100}) the target will be obj1 or obj2 or obj3 rather than the array containing them.
34 | * 2) value [*] - whatever value is passed as the special property value. For example, TweenLite.to(element, 1, {yourCustomProperty:3}) the value would be 3. Or for TweenLite.to(element, 1, {yourCustomProperty:{subProp1:3, subProp2:"whatever"}});, value would be {subProp1:3, subProp2:"whatever"}.
35 | * 3) tween [TweenLite] - the TweenLite (or TweenMax) instance that is managing this plugin instance. This can be useful if you need to check certain state-related properties on the tween (maybe in the set method) like its duration or time. Most of the time, however, you don't need to do anything with the tween. It is provided just in case you want to reference it.
36 | *
37 | * This function should return true unless you want to have TweenLite/Max skip the plugin altogether and instead treat the property/value like a normal tween (as if the plugin wasn't activated). This is rarely useful, so you should almost always return true.
38 | */
39 | init: function(target, value, tween) {
40 | this._target = target; //we record the target so that we can refer to it in the set method when doing updates.
41 |
42 | /* Next, we create a property tween for "scaleX" and "scaleY" properties of our target
43 | * (we're just using them as a examples of how to set up a property tween with a name, start, and end value).
44 | * the _addTween() method accepts the following parameters:
45 | * 1) target [object] - target object whose property this tween will control.
46 | * 2) property [string] - the name of the property, like "scaleX" or "scaleY"
47 | * 3) start [number] - The starting value of the property. For example, if you're tweening from 0 to 100, start would be 0.
48 | * 4) end [number] - the ending value of the property. For example, if you're tweening from 0 to 100, end would be 100.
49 | * 5) overwriteProperty [string] - the name that gets registered as the overwrite property so that if another concurrent tween of the same target gets created and it is tweening a property with this name, this one will be overwritten. Typically this is the same as "property".
50 | * 6) round [boolean] - if true, the updated value on each update will be rounded to the nearest integer. [false by default]
51 | * You do NOT need to use _addTween() at all. It is merely a convenience. You can record your own values internally or whatever you want.
52 | */
53 | this._addTween(target, "scaleX", target.scaleX, value, "scaleX", false);
54 | this._addTween(target, "scaleY", target.scaleY, value, "scaleY", false);
55 |
56 | //now, just for kicks, we'll record the starting "alpha" value and amount of change so that we can manage this manually rather than _addTween() (again, totally fictitious, just for an example)
57 | this._alphaStart = target.alpha;
58 | this._alphaChange = value.alpha - target.alpha;
59 |
60 | //always return true unless we want to scrap the plugin and have the value treated as a normal property tween (very uncommon)
61 | return true;
62 | },
63 |
64 | //[optional] - called each time the values should be updated, and the ratio gets passed as the only parameter (typically it's a value between 0 and 1, but it can exceed those when using an ease like Elastic.easeOut or Back.easeOut, etc.). If you're using this._super._addTween() for all your tweens and you don't need to do anything special on each frame besides updating those values, you can omit this "set" function altogether.
65 | set: function(ratio) {
66 | //since we used _addTween() inside init function, it created some property tweens that we'll update by calling the parent prototype's setRatio() (otherwise, the property tweens wouldn't get their values updated). this._super refers to the TweenPlugin prototype from which the plugin inherits (not that you need to worry about that).
67 | this._super.setRatio.call(this, ratio);
68 |
69 | //now manually set the alpha
70 | this._target.alpha = this._alphaStart + this._alphaChange * ratio;
71 | }
72 |
73 | });
74 |
75 | }); if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); }
--------------------------------------------------------------------------------
/www/js/common/backbone-stickit/backbone.stickit.min.js:
--------------------------------------------------------------------------------
1 | //
2 | // backbone.stickit - v0.8.0
3 | // The MIT License
4 | // Copyright (c) 2012 The New York Times, CMS Group, Matthew DeLambo
5 | //
6 | (function(t){"function"==typeof define&&define.amd?define(["underscore","backbone","exports"],t):"object"==typeof exports?t(require("underscore"),require("backbone"),exports):t(_,Backbone,{})})(function(t,e,n){n._handlers=[],n.addHandler=function(e){e=t.map(t.flatten([e]),function(e){return t.extend({updateModel:!0,updateView:!0,updateMethod:"text"},e)}),this._handlers=this._handlers.concat(e)},n.ViewMixin={_modelBindings:null,unstickit:function(e,n){if(t.isObject(n))return t.each(t.keys(n),function(t){this.unstickit(e,t)},this),void 0;var i=[],a=[];t.each(this._modelBindings,function(t,o){e&&t.model!==e||n&&t.config.selector!=n||(a.push(t.config._destroy),t.model.off(t.event,t.fn),i.push(t.model),delete this._modelBindings[o])},this),t.invoke(t.uniq(i),"trigger","stickit:unstuck",this.cid),t.each(t.uniq(a),function(t){t.call(this)},this),this._modelBindings=t.compact(this._modelBindings),this.$el.off(".stickit"+(e?"."+e.cid:""),n)},stickit:function(e,n){var i=e||this.model,a=n||t.result(this,"bindings")||{};this._modelBindings||(this._modelBindings=[]),this.addBinding(i,a);var o=this.remove;o.stickitWrapped||(this.remove=function(){var t=this;return this.unstickit(),o&&(t=o.apply(this,arguments)),t}),this.remove.stickitWrapped=!0},addBinding:function(e,n,i){var o,f,v,g,b,m=e||this.model,_=".stickit."+m.cid,k=i||{},y=t.uniqueId();if(!t.isString(n)){var x=n;return t.each(x,function(t,e){this.addBinding(m,e,x[e])},this),void 0}b=n,o=":el"===b?this.$el:this.$(b),this.unstickit(m,b),o.length&&(t.isString(k)&&(k={observe:k}),t.isFunction(k.observe)&&(k.observe=k.observe.call(this)),g=c(o,k),g.selector=b,v=g.observe,g.bindId=y,g.view=this,f=t.extend({stickitChange:g},g.setOptions),g._destroy=function(){a(this,g.destroy,o,m,g)},d(this,o,g,m,v),h(this,o,g,m,v),v&&(t.each(g.events,function(e){var n=e+_,i=function(e){var n=g.getVal.call(this,o,e,g,t.rest(arguments));r(this,g.updateModel,n,e,g)&&u(m,v,n,f,this,g)};i=t.bind(i,this),":el"===b?this.$el.on(n,i):this.$el.on(n,b,i)},this),t.each(t.flatten([v]),function(t){s(m,this,"change:"+t,g,function(t,e,n){var i=n&&n.stickitChange&&n.stickitChange.bindId||null;i!==y&&p(this,o,g,l(t,v,g,this),t)})},this),p(this,o,g,l(m,v,g,this),m,!0)),a(this,g.initialize,o,m,g))}},t.extend(e.View.prototype,n.ViewMixin);var i=function(e,n){var i=(n||"").split("."),a=t.reduce(i,function(t,e){return t[e]},e);return null==a?e:a},a=function(e,n){return n?(t.isString(n)?i(e,n):n).apply(e,t.rest(arguments,2)):void 0},o=function(t){return t.find("option").not(function(){return!this.selected})},r=function(e,n){return t.isBoolean(n)?n:t.isFunction(n)||t.isString(n)?a.apply(this,arguments):!1},s=function(t,e,n,i,a){t.on(n,a,e),e._modelBindings.push({model:t,event:n,fn:a,config:i})},u=function(e,n,i,o,r,s){var u={};s.onSet&&(i=a(r,s.onSet,i,s)),s.set?a(r,s.set,n,i,o,s):(u[n]=i,t.isArray(n)&&t.isArray(i)&&(u=t.reduce(n,function(e,n,a){return e[n]=t.has(i,a)?i[a]:null,e},{})),e.set(u,o))},l=function(e,n,i,o){var r,s=function(t){return e[i.escape?"escape":"get"](t)},u=function(t){return null==t?"":t};return r=t.isArray(n)?t.map(n,s):s(n),i.onGet&&(r=a(o,i.onGet,r,i)),t.isArray(r)?t.map(r,u):u(r)},c=n.getConfiguration=function(e,i){var a=[{updateModel:!1,updateMethod:"text",update:function(t,e,n,i){t[i.updateMethod]&&t[i.updateMethod](e)},getVal:function(t,e,n){return t[n.updateMethod]()}}];a=a.concat(t.filter(n._handlers,function(t){return e.is(t.selector)})),a.push(i);var o=t.extend.apply(t,a);return o.visible&&!t.has(o,"updateView")?o.updateView=!1:t.has(o,"updateView")||(o.updateView=!0),o},d=function(e,n,i,a,o){var r=["autofocus","autoplay","async","checked","controls","defer","disabled","hidden","indeterminate","loop","multiple","open","readonly","required","scoped","selected"];t.each(i.attributes||[],function(u){var c,d,h="";u=t.clone(u),c=u.observe||(u.observe=o),d=function(){var i=t.indexOf(r,u.name,!0)>-1?"prop":"attr",o=l(a,c,u,e);"class"===u.name?(n.removeClass(h).addClass(o),h=o):n[i](u.name,o)},t.each(t.flatten([c]),function(t){s(a,e,"change:"+t,i,d)}),d()})},h=function(e,n,i,o,r){if(null!=i.visible){var u=function(){var s=i.visible,u=i.visibleFn,c=l(o,r,i,e),d=!!c;(t.isFunction(s)||t.isString(s))&&(d=!!a(e,s,c,i)),u?a(e,u,n,d,i):n.toggle(d)};t.each(t.flatten([r]),function(t){s(o,e,"change:"+t,i,u)}),u()}},p=function(t,e,n,i,o,s){r(t,n.updateView,i,n)&&(a(t,n.update,e,i,o,n),s||a(t,n.afterUpdate,e,i,n))};return n.addHandler([{selector:'[contenteditable="true"]',updateMethod:"html",events:["input","change"]},{selector:"input",events:["propertychange","input","change"],update:function(t,e){t.val(e)},getVal:function(t){return t.val()}},{selector:"textarea",events:["propertychange","input","change"],update:function(t,e){t.val(e)},getVal:function(t){return t.val()}},{selector:'input[type="radio"]',events:["change"],update:function(t,e){t.filter('[value="'+e+'"]').prop("checked",!0)},getVal:function(t){return t.filter(":checked").val()}},{selector:'input[type="checkbox"]',events:["change"],update:function(n,i){if(n.length>1)i||(i=[]),n.each(function(n,a){var o=e.$(a),r=t.indexOf(i,o.val())>-1;o.prop("checked",r)});else{var a=t.isBoolean(i)?i:i===n.val();n.prop("checked",a)}},getVal:function(n){var i;if(n.length>1)i=t.reduce(n,function(t,n){var i=e.$(n);return i.prop("checked")&&t.push(i.val()),t},[]);else{i=n.prop("checked");var a=n.val();"on"!==a&&null!=a&&(i=i?n.val():null)}return i}},{selector:"select",events:["change"],update:function(n,o,r,s){var u,l=s.selectOptions,c=l&&l.collection||void 0,d=n.prop("multiple");if(!l){l={};var h=function(t){return t.map(function(){return{value:this.value,label:this.text}}).get()};n.find("optgroup").length?(c={opt_labels:[]},n.find("> option").length&&(c.opt_labels.push(void 0),t.each(n.find("> option"),function(t){c[void 0]=h(e.$(t))})),t.each(n.find("optgroup"),function(t){var n=e.$(t).attr("label");c.opt_labels.push(n),c[n]=h(e.$(t).find("option"))})):c=h(n.find("option"))}l.valuePath=l.valuePath||"value",l.labelPath=l.labelPath||"label";var p=function(n,a,o){t.each(n,function(n){var r=e.$(" "),s=n,u=function(e,n){r.text(e),s=n,r.data("stickit_bind_val",s),t.isArray(s)||t.isObject(s)||r.val(s)};"__default__"===n?u(l.defaultOption.label,l.defaultOption.value):u(i(n,l.labelPath),i(n,l.valuePath)),!d&&null!=s&&null!=o&&s===o||t.isObject(o)&&t.isEqual(s,o)?r.prop("selected",!0):d&&t.isArray(o)&&t.each(o,function(e){t.isObject(e)&&(e=i(e,l.valuePath)),(e===s||t.isObject(e)&&t.isEqual(s,e))&&r.prop("selected",!0)}),a.append(r)})};n.find("*").remove();var f=function(t,e){var n=window;return 0===e.indexOf("this.")&&(n=t),e=e.replace(/^[a-z]*\.(.+)$/,"$1"),i(n,e)};if(u=t.isString(c)?f(this,c):t.isFunction(c)?a(this,c,n,s):c,u instanceof e.Collection&&(u=u.toJSON()),l.defaultOption&&p(["__default__"],n),t.isArray(u))p(u,n,o);else if(u.opt_labels)t.each(u.opt_labels,function(t){var i=e.$(" ").attr("label",t);p(u[t],i,o),n.append(i)});else{var v,g=[];for(var b in u)v={},v[l.valuePath]=b,v[l.labelPath]=u[b],g.push(v);p(t.sortBy(g,l.comparator||l.labelPath),n,o)}},getVal:function(t){var n;return n=t.prop("multiple")?e.$(o(t).map(function(){return e.$(this).data("stickit_bind_val")})).get():o(t).data("stickit_bind_val")}}]),e.Stickit=n,e.Stickit});
--------------------------------------------------------------------------------
/www/js/views/CoolAnimView.js:
--------------------------------------------------------------------------------
1 | /**
2 | CoolAnimView Backbone > View
3 | @class CoolAnimView
4 | @constructor
5 | @return {Object} instantiated CoolAnimView
6 | **/
7 | define(['jquery', 'backbone', 'PageView', 'CSSPlugin', 'TweenMax', 'StackView'], function ($, Backbone, PageView, CSSPlugin, TweenMax, StackView) {
8 |
9 | var CoolAnimView = PageView.extend({
10 |
11 | location: "/pages/CoolAnimPage.html",
12 | pageID: "CoolAnim",
13 |
14 | /**
15 | Init called from PageView base class
16 | @method _initialize
17 | **/
18 | _initialize: function () {
19 | var self = this;
20 | self.m_slideIndex = 1;
21 | self.m_fadeIndex = 1;
22 | self.m_like = 1;
23 |
24 | self.model = new Backbone.Model({
25 | userName: 'Sean Levy'
26 | });
27 |
28 | // BB.comBroker.fireWebViews('event1', window.webViewer, {hello: 'world'});
29 |
30 | self._listenLikeClick();
31 | self._initStackViewSlider();
32 | self._initStackViewFader();
33 | self._initImageAnimation();
34 | },
35 |
36 | /**
37 | Listen to FB like clicks and increase counter
38 | @method _listenLikeClick
39 | **/
40 | _listenLikeClick: function(){
41 | var self = this;
42 | $(BB.Elements.LIKE).on('click', function (e) {
43 | $(BB.Elements.LIKE).text((self.m_like++) +' like');
44 | e.preventDefault();
45 | e.stopImmediatePropagation();
46 | return false;
47 | });
48 | },
49 |
50 | /**
51 | Use the amazing StackView.Slider to scroll through pages using GPU animation
52 | @method _initStackViewFader
53 | **/
54 | _initStackViewFader: function () {
55 | var self = this;
56 |
57 | self.m_faderContainer = new StackView.Fader({
58 | el: '#stackContainerFader'
59 | });
60 |
61 | self.f1 = new Backbone.View({
62 | el: "#f1"
63 | });
64 | self.f2 = new Backbone.View({
65 | el: "#f2"
66 | });
67 | self.f3 = new Backbone.View({
68 | el: "#f3"
69 | });
70 |
71 | self.m_faderContainer.addView(self.f1);
72 | self.m_faderContainer.addView(self.f2);
73 | self.m_faderContainer.addView(self.f3);
74 | self.m_faderContainer.selectView(self.f1);
75 |
76 | $(BB.Elements.NEXT_FADE).on('click', function () {
77 | self.m_fadeIndex = self.m_fadeIndex == 3 ? 1 : self.m_fadeIndex + 1;
78 | self.m_faderContainer.selectView('#f' + self.m_fadeIndex);
79 | });
80 |
81 | $(BB.Elements.PREV_FADE).on('click', function () {
82 | self.m_fadeIndex = self.m_fadeIndex == 1 ? 3 : self.m_fadeIndex - 1;
83 | self.m_faderContainer.selectView('#f' + self.m_fadeIndex);
84 | });
85 | },
86 |
87 | /**
88 | Use the amazing StackView.Fader to scroll through pages using fade animation
89 | @method _initStackViewSlider
90 | **/
91 | _initStackViewSlider: function () {
92 | var self = this;
93 |
94 | self.m_slideContainer = new StackView.Slider({
95 | el: '#stackContainer'
96 | });
97 | self.p1 = new StackView.Slider({
98 | stackView: self.m_slideContainer,
99 | from: "#p3",
100 | el: "#p1",
101 | to: "#p2"
102 | });
103 |
104 | self.p2 = new StackView.Slider({
105 | stackView: self.m_slideContainer,
106 | from: "#p1",
107 | el: "#p2",
108 | to: "#p3"
109 | });
110 |
111 | self.p3 = new StackView.Slider({
112 | stackView: self.m_slideContainer,
113 | from: "#p2",
114 | el: "#p3",
115 | to: "#p1"
116 | });
117 |
118 | self.m_slideContainer.addView(self.p1);
119 | self.m_slideContainer.addView(self.p2);
120 | self.m_slideContainer.addView(self.p3);
121 | self.m_slideContainer.selectView(self.p1);
122 |
123 | $(BB.Elements.NEXT_SLIDE).on('click', function () {
124 | self.m_slideIndex = self.m_slideIndex == 3 ? 1 : self.m_slideIndex + 1;
125 | self.m_slideContainer.slideToPage(self['p' + self.m_slideIndex], 'right');
126 | });
127 |
128 | $(BB.Elements.PREV_SLIDE).on('click', function () {
129 | self.m_slideIndex = self.m_slideIndex == 1 ? 3 : self.m_slideIndex - 1;
130 | self.m_slideContainer.slideToPage(self['p' + self.m_slideIndex], 'left');
131 | });
132 |
133 | /*
134 | BB.comBroker.setService(BB.SERVICES.CAMPAIGN_SELECTOR, self.m_campaignSelectorView);
135 | supersonic.ui.tabs.updateCurrentTab({title: "aaaa"});
136 |
137 | supersonic.ui.views.find("CommPage").then(function (view) {
138 | supersonic.logger.log("view location: " + view.getLocation());
139 | supersonic.ui.layers.push(view);
140 | //supersonic.ui.modal.show(view);
141 | setTimeout(function () {
142 | supersonic.ui.layers.pop(view);
143 | // supersonic.ui.modal.hide(view);
144 | }, 6000)
145 | });
146 | */
147 |
148 | },
149 |
150 | /**
151 | Use the GPU powered transition, powered by the amazing GSAP lib: http://greensock.com
152 | @method _initStackViewSlider
153 | **/
154 | _initImageAnimation: function () {
155 | var self = this;
156 |
157 | CSSPlugin.defaultTransformPerspective = 1500;
158 |
159 | var $imgWrap = $('.images'),
160 | $images = $imgWrap.find('img'),
161 | $currImg = $images.eq(0),
162 | index = 0,
163 | numImgs = $images.length,
164 | isAnimating = false;
165 |
166 | // Animation properties
167 | var flipDepth = -500,
168 | flipDur = 1;
169 |
170 | var flip = function (e) {
171 | // Ignore click until any current animations have completed.
172 | if (isAnimating) return;
173 |
174 | isAnimating = true;
175 |
176 | // Add +1 to index or loop back to 0 if we've reached the end
177 | index = (index++ >= numImgs - 1) ? 0 : index;
178 |
179 | // Get a random value between -25 and 25
180 | var randomVal = Math.random() * 50 - 25;
181 |
182 | var tl = new TimelineLite({
183 | onComplete: function () {
184 | $currImg = $images.eq(index);
185 | isAnimating = false;
186 | }
187 | });
188 |
189 | tl.to($currImg, flipDur / 2, {
190 | css: {rotationY: 90, z: flipDepth, rotationX: randomVal, alpha: 0.3},
191 | ease: Expo.easeIn
192 | });
193 |
194 | tl.append(function () {
195 | $currImg.hide();
196 | $images.eq(index).show();
197 | })
198 |
199 | tl.fromTo($images.eq(index), flipDur / 2,
200 | // We need to flip the number sign fo rotationX, so we do -randomVal instead of randomVal
201 | {css: {rotationY: -90, z: flipDepth, rotationX: -randomVal, alpha: 0.3}},
202 | {css: {rotationY: 0, z: 0, rotationX: 0, alpha: 1}, ease: Expo.easeOut}
203 | );
204 | };
205 |
206 | // Animate first image in
207 | TweenMax.fromTo($currImg, 1.8,
208 | {css: {rotationY: -110, rotationX: Math.random() * 35, z: -1000, alpha: 0}},
209 | {
210 | css: {rotationY: 0, rotationX: 0, z: 0, alpha: 1}, ease: Power3.easeInOut, onComplete: function () {
211 | $imgWrap.on('click', flip);
212 | }
213 | });
214 |
215 | $currImg.show();
216 | }
217 | });
218 |
219 | return CoolAnimView;
220 | });
221 |
222 |
223 |
--------------------------------------------------------------------------------
/www/js/Index.js:
--------------------------------------------------------------------------------
1 | /**
2 | BackSteroids, License MIT
3 | Visit Github https://github.com/born2net/BackSteroids
4 | @class App
5 | @constructor
6 | @return {Object} instantiated App
7 | **/
8 | define(['Setup', 'LocalCollection', 'AuthCollection', 'Elems', 'StackView', 'NoteModel'], function (Setup, LocalCollection, AuthCollection, Elems, StackView, NoteModel) {
9 | var App = Backbone.Controller.extend({
10 | initialize: function () {
11 | var self = this;
12 | log('======================================');
13 | window.BB.Elements = new Elems();
14 | // localization
15 | require(['LanguageSelectorView'], function (LanguageSelectorView) {
16 | new LanguageSelectorView({el: BB.Elements.LANGUAGE_SELECTOR});
17 | });
18 |
19 | LocalCollection.prototype.deleteStorage();
20 | self._initDrawer();
21 | self._initPages();
22 | self._initModelsCollection();
23 | self._listenOrientationChange();
24 | self._listenGoToCommPage();
25 | self._listenGetServerTime();
26 | self._listenSendPing();
27 |
28 | $(BB.Elements.GO_TO_ANIM_PAGE).on('click', function (e) {
29 | supersonic.ui.layers.push(self.m_coolAnimView.getPageView());
30 | });
31 | },
32 |
33 | /**
34 | Create all the models and collections that we use to communicate with other pages and to server
35 | @method _initModelsCollection
36 | **/
37 | _initModelsCollection: function() {
38 | var self = this, note
39 |
40 | self.myNotes1 = new AuthCollection([], {locationUrl: '/cat'});
41 | var note = new NoteModel();
42 | self.myNotes1.add(note);
43 | note.save();
44 | self.myNotes1.fetch();
45 |
46 | self.myNotes2 = new AuthCollection([], {locationUrl: '/dog'});
47 | var note = new Backbone.Model({'foo': 'bar1'});
48 | self.myNotes2.add(note);
49 | note.save();
50 | self.myNotes2.fetch();
51 |
52 | self.myNotes3 = new AuthCollection([], {locationUrl: '/lion'});
53 | var note = new Backbone.Model({'foo': 'bar2'});
54 | self.myNotes3.add(note);
55 | note.save();
56 |
57 | $(BB.Elements.FIELD1).on('blur', function (e) {
58 | var val = $(this).val();
59 | self.myNotes1.at(0).set('foo', val);
60 | self.myNotes1.at(0).save();
61 | });
62 |
63 | $(BB.Elements.FIELD2).on('blur', function (e) {
64 | var val = $(this).val();
65 | self.myNotes2.at(0).set('foo', val);
66 | self.myNotes2.at(0).save();
67 | });
68 |
69 | $(BB.Elements.FIELD3).on('blur', function (e) {
70 | var val = $(this).val();
71 | self.myNotes3.at(0).set('foo', val);
72 | self.myNotes3.at(0).save();
73 | });
74 |
75 | $(BB.Elements.SAVE_TO_SERVER).on('click', function (e) {
76 | self.myNotes1.saveToServer(true);
77 | self.myNotes1.at(0).save({}, {
78 | success: function (model) {
79 | jlog(model);
80 | alert('save success ' + model.get('date'));
81 | },
82 | error: function (model, e) {
83 | alert('err 2 ' + e.responseText);
84 | setTimeout(function () {
85 | log(JSON.stringify(e));
86 | }, 3000)
87 | },
88 | complete: function () {
89 | self.myNotes1.saveToServer(false);
90 | }
91 | });
92 | });
93 | },
94 |
95 | /**
96 | Listen get server time
97 | @method _listenGetServerTime
98 | **/
99 | _listenGetServerTime: function(){
100 | var self = this;
101 | $(BB.Elements.GET_SERVER_TIME).on('click', function (e) {
102 | $.ajax({
103 | url: 'https://secure.digitalsignage.com:443/GetDateTime',
104 | success: function (dateTime) {
105 | alert('time is ' + dateTime.time)
106 | },
107 | error: function (e) {
108 | alert('err 3 ' + JSON.stringify(e));
109 | },
110 | dataType: 'json'
111 | });
112 | });
113 | },
114 |
115 | /**
116 | Listen to go to CommPage
117 | @method _listenGoToCommPage
118 | **/
119 | _listenGoToCommPage: function(){
120 | var self = this;
121 | $(BB.Elements.GO_TO_COMM_PAGE).on('click',function(){
122 | supersonic.ui.layers.push(self.m_commPageView.getPageView());
123 | });
124 | },
125 |
126 | /**
127 | Init the CoolAnim page and Comm page
128 | @method _initPages
129 | **/
130 | _initPages: function(){
131 | var self = this;
132 | require(['StackView', 'CoolAnimView', 'CommPageView'], function (StackView, CoolAnimView, CommPageView) {
133 |
134 |
135 | self.m_coolAnimView = new CoolAnimView({
136 | init: false
137 | }).initializePage();
138 |
139 | self.m_commPageView = new CommPageView({
140 | init: false
141 | }).initializePage();
142 |
143 | //self.m_coolAnimView = (new CoolAnimView({init: false}));
144 | //self.m_coolAnimView.initializePage();
145 |
146 | // self.m_commPageView = new CommPageView({init: false});
147 | // self.m_commPageView.initializePage();
148 |
149 | // self.m_stackView = new StackView.Fader({duration: 1});
150 |
151 | //var unsubscribe = supersonic.data.channel('events').subscribe(function (message, reply) {
152 | // alert('from : ' + message.from + ' ' + message.data);
153 | // var msg = {
154 | // from: 'app3',
155 | // data: 'message 2'
156 | // };
157 | // reply(msg);
158 | //});
159 | });
160 | },
161 |
162 | /**
163 | Init the Drawer Module on left side of app, we use timer to let app settle down
164 | @method _initDrawer
165 | **/
166 | _initDrawer: function () {
167 | var self = this;
168 | /*
169 | Uncomment the following lines if you wish to create the drawer manually
170 | Be sure to change the the location entry under structure.coffee to: location: ""
171 | so you can create the drawer in code instead...
172 | */
173 |
174 | //setTimeout(function () {
175 | // self.m_leftDrawer = new steroids.views.WebView("/pages/Drawer.html");
176 | // function updateDrawer() {
177 | // steroids.drawers.update({
178 | // left: self.m_leftDrawer
179 | // });
180 | // }
181 | // self.m_leftDrawer.preload({}, {
182 | // onSuccess: updateDrawer
183 | // });
184 | //}, 50);
185 | },
186 |
187 | /**
188 | Listen to click on ping button
189 | @method _listenOrientationChange
190 | **/
191 | _listenSendPing: function(){
192 | var self = this;
193 | $(BB.Elements.SEND_PING).on('click', function () {
194 | BB.comBroker.fireWebViews('pingpong', window.webViewer, {ping: 'echo'});
195 | });
196 | },
197 |
198 | /**
199 | Listen application orientation changess
200 | @method _listenOrientationChange
201 | **/
202 | _listenOrientationChange: function () {
203 | window.addEventListener('orientationchange', function () {
204 | switch (window.orientation) {
205 | case -90:
206 | case 90:
207 | alert('landscape');
208 | break;
209 | default:
210 | alert('portrait');
211 | break;
212 | }
213 | });
214 | }
215 | });
216 | return App;
217 | });
--------------------------------------------------------------------------------
/www/js/common/comBroker/ComBroker.js:
--------------------------------------------------------------------------------
1 | /**
2 | The ComBroker is lite weight event bus that can be used inside MV* frameworks and offer services for the application.
3 | Services provided include registration and query of data members, registration and query of
4 | instances (often registered instances are service providers themselves) and a central location
5 | for binding and triggering of events.
6 | @class ComBroker
7 | @constructor
8 | @return {Object} instantiated ComBroker
9 | @example
10 |
11 | Backbone.comBroker = new ComBroker.bus();
12 | Backbone.comBroker.setService('me',function(i_var){
13 | alert('I am a service ' + i_var)});
14 | var g = com.getService('me');
15 | g("hello again");
16 | $(com).bind('change',function(e){
17 | alert('pop ' +e);
18 | });
19 | $(Backbone.comBroker).triggerHandler('change');
20 | example: Backbone.comBroker.fire(loginManager.LOGINBUTTON, this, '#loginButton', "hellow world" );
21 | example: Backbone.comBroker.listen(loginManager.AUTHENITCATING,loginManager.LOGINBUTTON,function(e){});
22 |
23 | **/
24 | define(['jquery', 'backbone'], function ($, Backbone) {
25 |
26 | Backbone.EVENTS = Backbone.EVENTS ? Backbone.EVENTS : {};
27 | Backbone.EVENTS.SERVICE_REGISTERED = 'SERVICE_REGISTERED';
28 |
29 | var ComBroker = Backbone.Controller.extend({
30 |
31 | /**
32 | Constructor
33 | @method initialize
34 | **/
35 | initialize: function () {
36 | this.m_services = [];
37 | Backbone.EVENTS.SERVICE_REGISTERED = 'SERVICE_REGISTERED'
38 | },
39 |
40 | masterListener: function () {
41 | var self = this;
42 |
43 | var unsubscribe = supersonic.data.channel('events').subscribe(function (message, reply) {
44 | // alert('from : ' + message.from + ' ' + message.data);
45 | var msg = {
46 | from: 'app3',
47 | data: 'message 2'
48 | };
49 | // reply(msg);
50 | });
51 |
52 | supersonic.data.channel('events').publish(msg);
53 | },
54 |
55 | /**
56 | Register a data member that others can query.
57 | @method setValue
58 | @param {String} i_name
59 | @param {Object} i_value
60 | @param {Event} i_fireEvent
61 | @return none
62 | **/
63 | setValue: function (i_name, i_value, i_fireEvent) {
64 | this.m_services[i_name] = i_value;
65 | if (i_fireEvent)
66 | this.fire(i_name, this, null, {edata: i_value})
67 | },
68 |
69 | /**
70 | Get a registered data member.
71 | @method getValue
72 | @param {String} i_name
73 | @return {Object} m_services member
74 | **/
75 | getValue: function (i_name) {
76 | if (this.m_services[i_name]) {
77 | return this.m_services[i_name]
78 | } else {
79 | return undefined;
80 | }
81 | },
82 |
83 | /**
84 | Register a service that others can query.
85 | @method setService
86 | @param {String} i_name
87 | @param {Object} i_service
88 | @return none
89 | **/
90 | setService: function (i_name, i_service) {
91 | this.m_services[i_name] = i_service;
92 | this.fire(Backbone.EVENTS['SERVICE_REGISTERED'], this, null, {name: i_name, service: i_service})
93 | },
94 |
95 | /**
96 | Get a registered service.
97 | @method getService
98 | @param {String} i_name
99 | @return {Object} m_services member
100 | **/
101 | getService: function (i_name) {
102 | if (i_name == undefined) {
103 | log('cant get set undefined service ' + i_name);
104 | return undefined;
105 | }
106 | if (this.m_services[i_name]) {
107 | return this.m_services[i_name]
108 | } else {
109 | return undefined;
110 | }
111 | },
112 |
113 | /**
114 | Expose all services and data members.
115 | @method getAllServices
116 | @return {Object} m_services
117 | **/
118 | getAllServices: function () {
119 | return this.m_services;
120 | },
121 |
122 | /**
123 | Clear all current registered services
124 | @method clearServices
125 | **/
126 | clearServices: function () {
127 | var self = this;
128 | // delete self.m_services;
129 | self.m_services = undefined;
130 | },
131 |
132 | /**
133 | Trigger an event within the context of the CommBroker thus reducing DOM capture / bubble.
134 | @method fire
135 | @param {Event} i_event
136 | @param {Event} i_context
137 | @param {Event} i_caller
138 | @param {Event} i_data
139 | @return none
140 | **/
141 | fire: function (i_event, i_context, i_caller, i_data) {
142 | $(this).trigger(this.event(i_event, i_context, i_caller, i_data));
143 |
144 |
145 | },
146 |
147 | /**
148 | Listen to events within the context of the CommBroker thus reducing DOM capture / bubble.
149 | Once the even is triggered func will get called back.
150 | @method listen
151 | @param {Event} events
152 | @param {Function} func
153 | @return none
154 | **/
155 | listen: function (events, func) {
156 | if (arguments.length > 2) {
157 | var totalArgs = Number([arguments.length - 1]);
158 | var events = $(arguments).splice(0, totalArgs);
159 | var func = arguments[totalArgs]
160 |
161 | for (var i = 0; i < events.length; i++) {
162 | events[i] = "'" + events[i] + "'";
163 | }
164 | events = events.join(',');
165 | return $(this).bind(eval(events), func);
166 | } else {
167 | return $(this).bind(events, func);
168 | }
169 | },
170 |
171 | listenWebViews: function (event, func) {
172 | var self = this;
173 | return supersonic.data.channel(event).subscribe(function (data, reply) {
174 | //log(JSON.stringify(data));
175 | //reply({msg: 'rx'});
176 | func(data, reply);
177 | });
178 | },
179 |
180 | fireWebViews: function (event, fromWebView, data) {
181 | var self = this;
182 | supersonic.data.channel(event).publish({
183 | fromWebView: fromWebView,
184 | event: event,
185 | data: data
186 | });
187 | },
188 |
189 | /**
190 | Listen to events within the context of the CommBroker thus reducing DOM capture / bubble.
191 | However we only listen within the namespace of a unique context id so we can remove it
192 | later for a specific listener instance.
193 | @method listenWithNamespace
194 | @param {Event} events
195 | @param {Object} caller
196 | @param {Function} call back
197 | @return none
198 | **/
199 | listenWithNamespace: function (event, caller, func) {
200 | if (caller.eventNamespace == undefined)
201 | caller.eventNamespace = _.uniqueId();
202 | var namespacEvent = event + '.' + caller.eventNamespace;
203 | $(this).bind(namespacEvent, func);
204 | },
205 |
206 | /**
207 | Stop listening to an event but only within the context of a specific listener instance.
208 | @method stopListenWithNamespace
209 | @param {String} event
210 | @param {Function} func
211 | @return none
212 | **/
213 | stopListenWithNamespace: function (event, caller) {
214 | var namespacEvent = event + '.' + caller.eventNamespace;
215 | $(this).unbind(namespacEvent);
216 | },
217 |
218 | /**
219 | Listen only once to an event and unbind.
220 | Once the event is triggered func will get called back.
221 | @method listenOnce
222 | @param {Event} events
223 | @param {Function} func
224 | @return none
225 | **/
226 | listenOnce: function (events, func) {
227 | $(this).one(events, func);
228 | },
229 |
230 | /**
231 | Stop listening to an event.
232 | @method stopListen
233 | @param {Event} events
234 | @param {Function} func
235 | @return none
236 | **/
237 | stopListen: function (events, func) {
238 | if (func == false) {
239 | $(this).unbind(events);
240 | } else {
241 | $(this).unbind(events, func);
242 | }
243 | },
244 |
245 | /**
246 | The jQuery.Event constructor is exposed and can be used when calling trigger. The new operator is optional.
247 | @method event
248 | @param {Event} i_event
249 | @param {Object} i_context
250 | @param {Object} i_caller
251 | @param {Object} i_data
252 | @return none.
253 | **/
254 | event: function (i_event, i_context, i_caller, i_data) {
255 | return $.Event(i_event, {context: i_context, caller: i_caller, edata: i_data});
256 | }
257 | });
258 |
259 | return ComBroker;
260 | });
261 |
262 |
263 |
--------------------------------------------------------------------------------
/www/js/common/localizer/dist/jquery.localize.js:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | Copyright (c) Jim Garvin (http://github.com/coderifous), 2008.
4 | Dual licensed under the GPL (http://dev.jquery.com/browser/trunk/jquery/GPL-LICENSE.txt) and MIT (http://dev.jquery.com/browser/trunk/jquery/MIT-LICENSE.txt) licenses.
5 | Written by Jim Garvin (@coderifous) for use on LMGTFY.com.
6 | http://github.com/coderifous/jquery-localize
7 | Based off of Keith Wood's Localisation jQuery plugin.
8 | http://keith-wood.name/localisation.html
9 | */
10 | (function($) {
11 | var normaliseLang;
12 | normaliseLang = function(lang) {
13 | lang = lang.replace(/_/, '-').toLowerCase();
14 | if (lang.length > 3) {
15 | lang = lang.substring(0, 3) + lang.substring(3).toUpperCase();
16 | }
17 | return lang;
18 | };
19 | $.defaultLanguage = normaliseLang(navigator.language || navigator.userLanguage);
20 | $.localize = function(pkg, options) {
21 |
22 | var defaultCallback, fileExtension, intermediateLangData, jsonCall, lang, loadLanguage, localizeElement, localizeForSpecialKeys, localizeImageElement, localizeInputElement, localizeOptgroupElement, notifyDelegateLanguageLoaded, regexify, setAttrFromValueForKey, setTextFromValueForKey, valueForKey, wrappedSet, localizeToolTipForElement;
23 | if (options == null) {
24 | options = {};
25 | }
26 | wrappedSet = this;
27 | intermediateLangData = {};
28 | fileExtension = options.fileExtension || "json";
29 | loadLanguage = function(pkg, lang, level) {
30 | var file;
31 | if (level == null) {
32 | level = 1;
33 | }
34 | switch (level) {
35 | case 1:
36 | intermediateLangData = {};
37 | if (options.loadBase) {
38 | file = pkg + ("." + fileExtension);
39 | return jsonCall(file, pkg, lang, level);
40 | } else {
41 | return loadLanguage(pkg, lang, 2);
42 | }
43 | break;
44 | case 2:
45 | if (lang.length >= 2) {
46 | file = "" + pkg + "-" + (lang.substring(0, 2)) + "." + fileExtension;
47 | return jsonCall(file, pkg, lang, level);
48 | }
49 | break;
50 | case 3:
51 | if (lang.length >= 5) {
52 | file = "" + pkg + "-" + (lang.substring(0, 5)) + "." + fileExtension;
53 | return jsonCall(file, pkg, lang, level);
54 | }
55 | }
56 | };
57 | jsonCall = function(file, pkg, lang, level) {
58 |
59 |
60 | /* in distribution mode add code below to load from remote web service */
61 | // if (1) { // enable to test localization in dev env
62 | if (window.location.href.indexOf('dist') > -1) {
63 | //pepper.getLocalization(lang, function(e){
64 | // var d = e['studiolite'];
65 | // $.extend(intermediateLangData, d);
66 | // notifyDelegateLanguageLoaded(intermediateLangData);
67 | // return loadLanguage(pkg, lang, level + 1);
68 | //});
69 | } else {
70 |
71 | // in development mode load through local file (english only supported)
72 | file = 'local-' + lang + '.json';
73 | var ajaxOptions, errorFunc, successFunc;
74 | if (options.pathPrefix != null) {
75 | file = "" + options.pathPrefix + "/" + file;
76 | }
77 | successFunc = function(d) {
78 | $.extend(intermediateLangData, d);
79 | notifyDelegateLanguageLoaded(intermediateLangData);
80 | return loadLanguage(pkg, lang, level + 1);
81 | };
82 | errorFunc = function() {
83 | if (options.fallback && options.fallback !== lang) {
84 | return loadLanguage(pkg, options.fallback);
85 | }
86 | };
87 | ajaxOptions = {
88 | url: file,
89 | dataType: "json",
90 | async: false,
91 | timeout: options.timeout != null ? options.timeout : 500,
92 | success: successFunc,
93 | error: errorFunc
94 | };
95 | if (window.location.protocol === "file:") {
96 | ajaxOptions.error = function(xhr) {
97 | return successFunc($.parseJSON(xhr.responseText));
98 | };
99 | }
100 | return $.ajax(ajaxOptions);
101 | }
102 |
103 |
104 |
105 | };
106 | notifyDelegateLanguageLoaded = function(data) {
107 | if (options.callback != null) {
108 | return options.callback(data, defaultCallback);
109 | } else {
110 | return defaultCallback(data);
111 | }
112 | };
113 | defaultCallback = function(data) {
114 | $.localize.data[pkg] = data;
115 | return wrappedSet.each(function() {
116 | var elem, key, value, toolTipKey, toolTipValue;
117 | elem = $(this);
118 | key = elem.data("localize");
119 | key || (key = elem.attr("rel").match(/localize\[(.*?)\]/)[1]);
120 | value = valueForKey(key, data);
121 | toolTipKey = elem.attr('data-localize-tooltip');
122 | if(toolTipKey)
123 | toolTipValue = valueForKey(toolTipKey, data);
124 | else
125 | toolTipValue = false;
126 | if(toolTipValue)
127 | elem.attr('title', toolTipValue);
128 | if (value != null) {
129 | return localizeElement(elem, key, value);
130 | }
131 | });
132 | };
133 | localizeElement = function(elem, key, value) {
134 | if (elem.is('input')) {
135 | localizeInputElement(elem, key, value);
136 | } else if (elem.is('img')) {
137 | localizeImageElement(elem, key, value);
138 | } else if (elem.is('optgroup')) {
139 | localizeOptgroupElement(elem, key, value);
140 | } else if (!$.isPlainObject(value)) {
141 | elem.html(value);
142 | }
143 | if ($.isPlainObject(value)) {
144 | return localizeForSpecialKeys(elem, value);
145 | }
146 | };
147 | localizeInputElement = function(elem, key, value) {
148 | var val;
149 | val = $.isPlainObject(value) ? value.value : value;
150 | if (elem.is("[placeholder]")) {
151 | return elem.attr("placeholder", val);
152 | } else {
153 | return elem.val(val);
154 | }
155 | };
156 | localizeForSpecialKeys = function(elem, value) {
157 | setAttrFromValueForKey(elem, "title", value);
158 | return setTextFromValueForKey(elem, "text", value);
159 | };
160 | localizeOptgroupElement = function(elem, key, value) {
161 | return elem.attr("label", value);
162 | };
163 | localizeImageElement = function(elem, key, value) {
164 | setAttrFromValueForKey(elem, "alt", value);
165 | return setAttrFromValueForKey(elem, "src", value);
166 | };
167 | localizeToolTipForElement = function(elem, key, value) {
168 | return setAttrFromValueForKey(elem, "title", value);
169 | };
170 | valueForKey = function(key, data) {
171 | var keys, value, _i, _len;
172 | keys = key.split(/\./);
173 | value = data;
174 | for (_i = 0, _len = keys.length; _i < _len; _i++) {
175 | key = keys[_i];
176 | value = value != null ? value[key] : null;
177 | }
178 | return value;
179 | };
180 | setAttrFromValueForKey = function(elem, key, value) {
181 | value = valueForKey(key, value);
182 | if (value != null) {
183 | return elem.attr(key, value);
184 | }
185 | };
186 | setTextFromValueForKey = function(elem, key, value) {
187 | value = valueForKey(key, value);
188 | if (value != null) {
189 | return elem.text(value);
190 | }
191 | };
192 | regexify = function(string_or_regex_or_array) {
193 | var thing;
194 | if (typeof string_or_regex_or_array === "string") {
195 | return "^" + string_or_regex_or_array + "$";
196 | } else if (string_or_regex_or_array.length != null) {
197 | return ((function() {
198 | var _i, _len, _results;
199 | _results = [];
200 | for (_i = 0, _len = string_or_regex_or_array.length; _i < _len; _i++) {
201 | thing = string_or_regex_or_array[_i];
202 | _results.push(regexify(thing));
203 | }
204 | return _results;
205 | })()).join("|");
206 | } else {
207 | return string_or_regex_or_array;
208 | }
209 | };
210 | lang = normaliseLang(options.language ? options.language : $.defaultLanguage);
211 | if (!(options.skipLanguage && lang.match(regexify(options.skipLanguage)))) {
212 | loadLanguage(pkg, lang, 1);
213 | }
214 | return wrappedSet;
215 | };
216 | $.fn.localize = $.localize;
217 | return $.localize.data = {};
218 | })(jQuery);
--------------------------------------------------------------------------------
/www/js/common/gsap/plugins/EaselPlugin.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * VERSION: 0.1.6
3 | * DATE: 2014-07-17
4 | * UPDATES AND DOCS AT: http://www.greensock.com
5 | *
6 | * @license Copyright (c) 2008-2014, GreenSock. All rights reserved.
7 | * This work is subject to the terms at http://www.greensock.com/terms_of_use.html or for
8 | * Club GreenSock members, the software agreement that was issued with your membership.
9 | *
10 | * @author: Jack Doyle, jack@greensock.com
11 | **/
12 | var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(global) !== "undefined") ? global : this || window; //helps ensure compatibility with AMD/RequireJS and CommonJS/Node
13 | (_gsScope._gsQueue || (_gsScope._gsQueue = [])).push( function() {
14 |
15 | "use strict";
16 |
17 | var _numExp = /(\d|\.)+/g,
18 | _ColorFilter, _ColorMatrixFilter,
19 | _colorProps = ["redMultiplier","greenMultiplier","blueMultiplier","alphaMultiplier","redOffset","greenOffset","blueOffset","alphaOffset"],
20 | _colorLookup = {aqua:[0,255,255],
21 | lime:[0,255,0],
22 | silver:[192,192,192],
23 | black:[0,0,0],
24 | maroon:[128,0,0],
25 | teal:[0,128,128],
26 | blue:[0,0,255],
27 | navy:[0,0,128],
28 | white:[255,255,255],
29 | fuchsia:[255,0,255],
30 | olive:[128,128,0],
31 | yellow:[255,255,0],
32 | orange:[255,165,0],
33 | gray:[128,128,128],
34 | purple:[128,0,128],
35 | green:[0,128,0],
36 | red:[255,0,0],
37 | pink:[255,192,203],
38 | cyan:[0,255,255],
39 | transparent:[255,255,255,0]},
40 | _parseColor = function(color) {
41 | if (color === "" || color == null || color === "none") {
42 | return _colorLookup.transparent;
43 | } else if (_colorLookup[color]) {
44 | return _colorLookup[color];
45 | } else if (typeof(color) === "number") {
46 | return [color >> 16, (color >> 8) & 255, color & 255];
47 | } else if (color.charAt(0) === "#") {
48 | if (color.length === 4) { //for shorthand like #9F0
49 | color = "#" + color.charAt(1) + color.charAt(1) + color.charAt(2) + color.charAt(2) + color.charAt(3) + color.charAt(3);
50 | }
51 | color = parseInt(color.substr(1), 16);
52 | return [color >> 16, (color >> 8) & 255, color & 255];
53 | }
54 | return color.match(_numExp) || _colorLookup.transparent;
55 | },
56 | _parseColorFilter = function(t, v, pg) {
57 | if (!_ColorFilter) {
58 | _ColorFilter = (_gsScope.ColorFilter || _gsScope.createjs.ColorFilter);
59 | if (!_ColorFilter) {
60 | throw("EaselPlugin error: The EaselJS ColorFilter JavaScript file wasn't loaded.");
61 | }
62 | }
63 | var filters = t.filters || [],
64 | i = filters.length,
65 | c, s, e, a, p;
66 | while (--i > -1) {
67 | if (filters[i] instanceof _ColorFilter) {
68 | s = filters[i];
69 | break;
70 | }
71 | }
72 | if (!s) {
73 | s = new _ColorFilter();
74 | filters.push(s);
75 | t.filters = filters;
76 | }
77 | e = s.clone();
78 | if (v.tint != null) {
79 | c = _parseColor(v.tint);
80 | a = (v.tintAmount != null) ? Number(v.tintAmount) : 1;
81 | e.redOffset = Number(c[0]) * a;
82 | e.greenOffset = Number(c[1]) * a;
83 | e.blueOffset = Number(c[2]) * a;
84 | e.redMultiplier = e.greenMultiplier = e.blueMultiplier = 1 - a;
85 | } else {
86 | for (p in v) {
87 | if (p !== "exposure") if (p !== "brightness") {
88 | e[p] = Number(v[p]);
89 | }
90 | }
91 | }
92 | if (v.exposure != null) {
93 | e.redOffset = e.greenOffset = e.blueOffset = 255 * (Number(v.exposure) - 1);
94 | e.redMultiplier = e.greenMultiplier = e.blueMultiplier = 1;
95 | } else if (v.brightness != null) {
96 | a = Number(v.brightness) - 1;
97 | e.redOffset = e.greenOffset = e.blueOffset = (a > 0) ? a * 255 : 0;
98 | e.redMultiplier = e.greenMultiplier = e.blueMultiplier = 1 - Math.abs(a);
99 | }
100 | i = 8;
101 | while (--i > -1) {
102 | p = _colorProps[i];
103 | if (s[p] !== e[p]) {
104 | pg._addTween(s, p, s[p], e[p], "easel_colorFilter");
105 | }
106 | }
107 | pg._overwriteProps.push("easel_colorFilter");
108 | if (!t.cacheID) {
109 | throw("EaselPlugin warning: for filters to display in EaselJS, you must call the object's cache() method first. " + t);
110 | }
111 | },
112 |
113 | _idMatrix = [1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],
114 | _lumR = 0.212671,
115 | _lumG = 0.715160,
116 | _lumB = 0.072169,
117 |
118 | _applyMatrix = function(m, m2) {
119 | if (!(m instanceof Array) || !(m2 instanceof Array)) {
120 | return m2;
121 | }
122 | var temp = [],
123 | i = 0,
124 | z = 0,
125 | y, x;
126 | for (y = 0; y < 4; y++) {
127 | for (x = 0; x < 5; x++) {
128 | z = (x === 4) ? m[i + 4] : 0;
129 | temp[i + x] = m[i] * m2[x] + m[i+1] * m2[x + 5] + m[i+2] * m2[x + 10] + m[i+3] * m2[x + 15] + z;
130 | }
131 | i += 5;
132 | }
133 | return temp;
134 | },
135 |
136 | _setSaturation = function(m, n) {
137 | if (isNaN(n)) {
138 | return m;
139 | }
140 | var inv = 1 - n,
141 | r = inv * _lumR,
142 | g = inv * _lumG,
143 | b = inv * _lumB;
144 | return _applyMatrix([r + n, g, b, 0, 0, r, g + n, b, 0, 0, r, g, b + n, 0, 0, 0, 0, 0, 1, 0], m);
145 | },
146 |
147 | _colorize = function(m, color, amount) {
148 | if (isNaN(amount)) {
149 | amount = 1;
150 | }
151 | var c = _parseColor(color),
152 | r = c[0] / 255,
153 | g = c[1] / 255,
154 | b = c[2] / 255,
155 | inv = 1 - amount;
156 | return _applyMatrix([inv + amount * r * _lumR, amount * r * _lumG, amount * r * _lumB, 0, 0, amount * g * _lumR, inv + amount * g * _lumG, amount * g * _lumB, 0, 0, amount * b * _lumR, amount * b * _lumG, inv + amount * b * _lumB, 0, 0, 0, 0, 0, 1, 0], m);
157 | },
158 |
159 | _setHue = function(m, n) {
160 | if (isNaN(n)) {
161 | return m;
162 | }
163 | n *= Math.PI / 180;
164 | var c = Math.cos(n),
165 | s = Math.sin(n);
166 | return _applyMatrix([(_lumR + (c * (1 - _lumR))) + (s * (-_lumR)), (_lumG + (c * (-_lumG))) + (s * (-_lumG)), (_lumB + (c * (-_lumB))) + (s * (1 - _lumB)), 0, 0, (_lumR + (c * (-_lumR))) + (s * 0.143), (_lumG + (c * (1 - _lumG))) + (s * 0.14), (_lumB + (c * (-_lumB))) + (s * -0.283), 0, 0, (_lumR + (c * (-_lumR))) + (s * (-(1 - _lumR))), (_lumG + (c * (-_lumG))) + (s * _lumG), (_lumB + (c * (1 - _lumB))) + (s * _lumB), 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1], m);
167 | },
168 |
169 | _setContrast = function(m, n) {
170 | if (isNaN(n)) {
171 | return m;
172 | }
173 | n += 0.01;
174 | return _applyMatrix([n,0,0,0,128 * (1 - n), 0,n,0,0,128 * (1 - n), 0,0,n,0,128 * (1 - n), 0,0,0,1,0], m);
175 | },
176 |
177 | _parseColorMatrixFilter = function(t, v, pg) {
178 | if (!_ColorMatrixFilter) {
179 | _ColorMatrixFilter = (_gsScope.ColorMatrixFilter || _gsScope.createjs.ColorMatrixFilter);
180 | if (!_ColorMatrixFilter) {
181 | throw("EaselPlugin error: The EaselJS ColorMatrixFilter JavaScript file wasn't loaded.");
182 | }
183 | }
184 | var filters = t.filters || [],
185 | i = filters.length,
186 | matrix, startMatrix, s;
187 | while (--i > -1) {
188 | if (filters[i] instanceof _ColorMatrixFilter) {
189 | s = filters[i];
190 | break;
191 | }
192 | }
193 | if (!s) {
194 | s = new _ColorMatrixFilter(_idMatrix.slice());
195 | filters.push(s);
196 | t.filters = filters;
197 | }
198 | startMatrix = s.matrix;
199 | matrix = _idMatrix.slice();
200 | if (v.colorize != null) {
201 | matrix = _colorize(matrix, v.colorize, Number(v.colorizeAmount));
202 | }
203 | if (v.contrast != null) {
204 | matrix = _setContrast(matrix, Number(v.contrast));
205 | }
206 | if (v.hue != null) {
207 | matrix = _setHue(matrix, Number(v.hue));
208 | }
209 | if (v.saturation != null) {
210 | matrix = _setSaturation(matrix, Number(v.saturation));
211 | }
212 |
213 | i = matrix.length;
214 | while (--i > -1) {
215 | if (matrix[i] !== startMatrix[i]) {
216 | pg._addTween(startMatrix, i, startMatrix[i], matrix[i], "easel_colorMatrixFilter");
217 | }
218 | }
219 |
220 | pg._overwriteProps.push("easel_colorMatrixFilter");
221 | if (!t.cacheID) {
222 | throw("EaselPlugin warning: for filters to display in EaselJS, you must call the object's cache() method first. " + t);
223 | }
224 |
225 | pg._matrix = startMatrix;
226 | };
227 |
228 |
229 | _gsScope._gsDefine.plugin({
230 | propName: "easel",
231 | priority: -1,
232 | version: "0.1.6",
233 | API: 2,
234 |
235 | //called when the tween renders for the first time. This is where initial values should be recorded and any setup routines should run.
236 | init: function(target, value, tween) {
237 | this._target = target;
238 | var p, pt, tint, colorMatrix;
239 | for (p in value) {
240 |
241 | if (p === "colorFilter" || p === "tint" || p === "tintAmount" || p === "exposure" || p === "brightness") {
242 | if (!tint) {
243 | _parseColorFilter(target, value.colorFilter || value, this);
244 | tint = true;
245 | }
246 |
247 | } else if (p === "saturation" || p === "contrast" || p === "hue" || p === "colorize" || p === "colorizeAmount") {
248 | if (!colorMatrix) {
249 | _parseColorMatrixFilter(target, value.colorMatrixFilter || value, this);
250 | colorMatrix = true;
251 | }
252 |
253 | } else if (p === "frame") {
254 | this._firstPT = pt = {_next:this._firstPT, t:target, p:"gotoAndStop", s:target.currentFrame, f:true, n:"frame", pr:0, type:0, r:true};
255 | pt.c = (typeof(value[p]) === "number") ? value[p] - pt.s : (typeof(value[p]) === "string") ? parseFloat(value[p].split("=").join("")) : 0;
256 | if (pt._next) {
257 | pt._next._prev = pt;
258 | }
259 |
260 | } else if (target[p] != null) {
261 | this._firstPT = pt = {_next:this._firstPT, t:target, p:p, f:(typeof(target[p]) === "function"), n:p, pr:0, type:0};
262 | pt.s = (!pt.f) ? parseFloat(target[p]) : target[ ((p.indexOf("set") || typeof(target["get" + p.substr(3)]) !== "function") ? p : "get" + p.substr(3)) ]();
263 | pt.c = (typeof(value[p]) === "number") ? value[p] - pt.s : (typeof(value[p]) === "string") ? parseFloat(value[p].split("=").join("")) : 0;
264 |
265 | if (pt._next) {
266 | pt._next._prev = pt;
267 | }
268 | }
269 |
270 | }
271 | return true;
272 | },
273 |
274 | //called each time the values should be updated, and the ratio gets passed as the only parameter (typically it's a value between 0 and 1, but it can exceed those when using an ease like Elastic.easeOut or Back.easeOut, etc.)
275 | set: function(v) {
276 | var pt = this._firstPT,
277 | min = 0.000001,
278 | val;
279 | while (pt) {
280 | val = pt.c * v + pt.s;
281 | if (pt.r) {
282 | val = Math.round(val);
283 | } else if (val < min && val > -min) {
284 | val = 0;
285 | }
286 | if (pt.f) {
287 | pt.t[pt.p](val);
288 | } else {
289 | pt.t[pt.p] = val;
290 | }
291 | pt = pt._next;
292 | }
293 | if (this._target.cacheID) {
294 | this._target.updateCache();
295 | }
296 | }
297 |
298 | });
299 |
300 | }); if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); }
--------------------------------------------------------------------------------
/www/js/common/gsap/easing/EasePack.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * VERSION: beta 1.9.4
3 | * DATE: 2014-07-17
4 | * UPDATES AND DOCS AT: http://www.greensock.com
5 | *
6 | * @license Copyright (c) 2008-2014, GreenSock. All rights reserved.
7 | * This work is subject to the terms at http://www.greensock.com/terms_of_use.html or for
8 | * Club GreenSock members, the software agreement that was issued with your membership.
9 | *
10 | * @author: Jack Doyle, jack@greensock.com
11 | **/
12 | var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(global) !== "undefined") ? global : this || window; //helps ensure compatibility with AMD/RequireJS and CommonJS/Node
13 | (_gsScope._gsQueue || (_gsScope._gsQueue = [])).push( function() {
14 |
15 | "use strict";
16 |
17 | _gsScope._gsDefine("easing.Back", ["easing.Ease"], function(Ease) {
18 |
19 | var w = (_gsScope.GreenSockGlobals || _gsScope),
20 | gs = w.com.greensock,
21 | _2PI = Math.PI * 2,
22 | _HALF_PI = Math.PI / 2,
23 | _class = gs._class,
24 | _create = function(n, f) {
25 | var C = _class("easing." + n, function(){}, true),
26 | p = C.prototype = new Ease();
27 | p.constructor = C;
28 | p.getRatio = f;
29 | return C;
30 | },
31 | _easeReg = Ease.register || function(){}, //put an empty function in place just as a safety measure in case someone loads an OLD version of TweenLite.js where Ease.register doesn't exist.
32 | _wrap = function(name, EaseOut, EaseIn, EaseInOut, aliases) {
33 | var C = _class("easing."+name, {
34 | easeOut:new EaseOut(),
35 | easeIn:new EaseIn(),
36 | easeInOut:new EaseInOut()
37 | }, true);
38 | _easeReg(C, name);
39 | return C;
40 | },
41 | EasePoint = function(time, value, next) {
42 | this.t = time;
43 | this.v = value;
44 | if (next) {
45 | this.next = next;
46 | next.prev = this;
47 | this.c = next.v - value;
48 | this.gap = next.t - time;
49 | }
50 | },
51 |
52 | //Back
53 | _createBack = function(n, f) {
54 | var C = _class("easing." + n, function(overshoot) {
55 | this._p1 = (overshoot || overshoot === 0) ? overshoot : 1.70158;
56 | this._p2 = this._p1 * 1.525;
57 | }, true),
58 | p = C.prototype = new Ease();
59 | p.constructor = C;
60 | p.getRatio = f;
61 | p.config = function(overshoot) {
62 | return new C(overshoot);
63 | };
64 | return C;
65 | },
66 |
67 | Back = _wrap("Back",
68 | _createBack("BackOut", function(p) {
69 | return ((p = p - 1) * p * ((this._p1 + 1) * p + this._p1) + 1);
70 | }),
71 | _createBack("BackIn", function(p) {
72 | return p * p * ((this._p1 + 1) * p - this._p1);
73 | }),
74 | _createBack("BackInOut", function(p) {
75 | return ((p *= 2) < 1) ? 0.5 * p * p * ((this._p2 + 1) * p - this._p2) : 0.5 * ((p -= 2) * p * ((this._p2 + 1) * p + this._p2) + 2);
76 | })
77 | ),
78 |
79 |
80 | //SlowMo
81 | SlowMo = _class("easing.SlowMo", function(linearRatio, power, yoyoMode) {
82 | power = (power || power === 0) ? power : 0.7;
83 | if (linearRatio == null) {
84 | linearRatio = 0.7;
85 | } else if (linearRatio > 1) {
86 | linearRatio = 1;
87 | }
88 | this._p = (linearRatio !== 1) ? power : 0;
89 | this._p1 = (1 - linearRatio) / 2;
90 | this._p2 = linearRatio;
91 | this._p3 = this._p1 + this._p2;
92 | this._calcEnd = (yoyoMode === true);
93 | }, true),
94 | p = SlowMo.prototype = new Ease(),
95 | SteppedEase, RoughEase, _createElastic;
96 |
97 | p.constructor = SlowMo;
98 | p.getRatio = function(p) {
99 | var r = p + (0.5 - p) * this._p;
100 | if (p < this._p1) {
101 | return this._calcEnd ? 1 - ((p = 1 - (p / this._p1)) * p) : r - ((p = 1 - (p / this._p1)) * p * p * p * r);
102 | } else if (p > this._p3) {
103 | return this._calcEnd ? 1 - (p = (p - this._p3) / this._p1) * p : r + ((p - r) * (p = (p - this._p3) / this._p1) * p * p * p);
104 | }
105 | return this._calcEnd ? 1 : r;
106 | };
107 | SlowMo.ease = new SlowMo(0.7, 0.7);
108 |
109 | p.config = SlowMo.config = function(linearRatio, power, yoyoMode) {
110 | return new SlowMo(linearRatio, power, yoyoMode);
111 | };
112 |
113 |
114 | //SteppedEase
115 | SteppedEase = _class("easing.SteppedEase", function(steps) {
116 | steps = steps || 1;
117 | this._p1 = 1 / steps;
118 | this._p2 = steps + 1;
119 | }, true);
120 | p = SteppedEase.prototype = new Ease();
121 | p.constructor = SteppedEase;
122 | p.getRatio = function(p) {
123 | if (p < 0) {
124 | p = 0;
125 | } else if (p >= 1) {
126 | p = 0.999999999;
127 | }
128 | return ((this._p2 * p) >> 0) * this._p1;
129 | };
130 | p.config = SteppedEase.config = function(steps) {
131 | return new SteppedEase(steps);
132 | };
133 |
134 |
135 | //RoughEase
136 | RoughEase = _class("easing.RoughEase", function(vars) {
137 | vars = vars || {};
138 | var taper = vars.taper || "none",
139 | a = [],
140 | cnt = 0,
141 | points = (vars.points || 20) | 0,
142 | i = points,
143 | randomize = (vars.randomize !== false),
144 | clamp = (vars.clamp === true),
145 | template = (vars.template instanceof Ease) ? vars.template : null,
146 | strength = (typeof(vars.strength) === "number") ? vars.strength * 0.4 : 0.4,
147 | x, y, bump, invX, obj, pnt;
148 | while (--i > -1) {
149 | x = randomize ? Math.random() : (1 / points) * i;
150 | y = template ? template.getRatio(x) : x;
151 | if (taper === "none") {
152 | bump = strength;
153 | } else if (taper === "out") {
154 | invX = 1 - x;
155 | bump = invX * invX * strength;
156 | } else if (taper === "in") {
157 | bump = x * x * strength;
158 | } else if (x < 0.5) { //"both" (start)
159 | invX = x * 2;
160 | bump = invX * invX * 0.5 * strength;
161 | } else { //"both" (end)
162 | invX = (1 - x) * 2;
163 | bump = invX * invX * 0.5 * strength;
164 | }
165 | if (randomize) {
166 | y += (Math.random() * bump) - (bump * 0.5);
167 | } else if (i % 2) {
168 | y += bump * 0.5;
169 | } else {
170 | y -= bump * 0.5;
171 | }
172 | if (clamp) {
173 | if (y > 1) {
174 | y = 1;
175 | } else if (y < 0) {
176 | y = 0;
177 | }
178 | }
179 | a[cnt++] = {x:x, y:y};
180 | }
181 | a.sort(function(a, b) {
182 | return a.x - b.x;
183 | });
184 |
185 | pnt = new EasePoint(1, 1, null);
186 | i = points;
187 | while (--i > -1) {
188 | obj = a[i];
189 | pnt = new EasePoint(obj.x, obj.y, pnt);
190 | }
191 |
192 | this._prev = new EasePoint(0, 0, (pnt.t !== 0) ? pnt : pnt.next);
193 | }, true);
194 | p = RoughEase.prototype = new Ease();
195 | p.constructor = RoughEase;
196 | p.getRatio = function(p) {
197 | var pnt = this._prev;
198 | if (p > pnt.t) {
199 | while (pnt.next && p >= pnt.t) {
200 | pnt = pnt.next;
201 | }
202 | pnt = pnt.prev;
203 | } else {
204 | while (pnt.prev && p <= pnt.t) {
205 | pnt = pnt.prev;
206 | }
207 | }
208 | this._prev = pnt;
209 | return (pnt.v + ((p - pnt.t) / pnt.gap) * pnt.c);
210 | };
211 | p.config = function(vars) {
212 | return new RoughEase(vars);
213 | };
214 | RoughEase.ease = new RoughEase();
215 |
216 |
217 | //Bounce
218 | _wrap("Bounce",
219 | _create("BounceOut", function(p) {
220 | if (p < 1 / 2.75) {
221 | return 7.5625 * p * p;
222 | } else if (p < 2 / 2.75) {
223 | return 7.5625 * (p -= 1.5 / 2.75) * p + 0.75;
224 | } else if (p < 2.5 / 2.75) {
225 | return 7.5625 * (p -= 2.25 / 2.75) * p + 0.9375;
226 | }
227 | return 7.5625 * (p -= 2.625 / 2.75) * p + 0.984375;
228 | }),
229 | _create("BounceIn", function(p) {
230 | if ((p = 1 - p) < 1 / 2.75) {
231 | return 1 - (7.5625 * p * p);
232 | } else if (p < 2 / 2.75) {
233 | return 1 - (7.5625 * (p -= 1.5 / 2.75) * p + 0.75);
234 | } else if (p < 2.5 / 2.75) {
235 | return 1 - (7.5625 * (p -= 2.25 / 2.75) * p + 0.9375);
236 | }
237 | return 1 - (7.5625 * (p -= 2.625 / 2.75) * p + 0.984375);
238 | }),
239 | _create("BounceInOut", function(p) {
240 | var invert = (p < 0.5);
241 | if (invert) {
242 | p = 1 - (p * 2);
243 | } else {
244 | p = (p * 2) - 1;
245 | }
246 | if (p < 1 / 2.75) {
247 | p = 7.5625 * p * p;
248 | } else if (p < 2 / 2.75) {
249 | p = 7.5625 * (p -= 1.5 / 2.75) * p + 0.75;
250 | } else if (p < 2.5 / 2.75) {
251 | p = 7.5625 * (p -= 2.25 / 2.75) * p + 0.9375;
252 | } else {
253 | p = 7.5625 * (p -= 2.625 / 2.75) * p + 0.984375;
254 | }
255 | return invert ? (1 - p) * 0.5 : p * 0.5 + 0.5;
256 | })
257 | );
258 |
259 |
260 | //CIRC
261 | _wrap("Circ",
262 | _create("CircOut", function(p) {
263 | return Math.sqrt(1 - (p = p - 1) * p);
264 | }),
265 | _create("CircIn", function(p) {
266 | return -(Math.sqrt(1 - (p * p)) - 1);
267 | }),
268 | _create("CircInOut", function(p) {
269 | return ((p*=2) < 1) ? -0.5 * (Math.sqrt(1 - p * p) - 1) : 0.5 * (Math.sqrt(1 - (p -= 2) * p) + 1);
270 | })
271 | );
272 |
273 |
274 | //Elastic
275 | _createElastic = function(n, f, def) {
276 | var C = _class("easing." + n, function(amplitude, period) {
277 | this._p1 = amplitude || 1;
278 | this._p2 = period || def;
279 | this._p3 = this._p2 / _2PI * (Math.asin(1 / this._p1) || 0);
280 | }, true),
281 | p = C.prototype = new Ease();
282 | p.constructor = C;
283 | p.getRatio = f;
284 | p.config = function(amplitude, period) {
285 | return new C(amplitude, period);
286 | };
287 | return C;
288 | };
289 | _wrap("Elastic",
290 | _createElastic("ElasticOut", function(p) {
291 | return this._p1 * Math.pow(2, -10 * p) * Math.sin( (p - this._p3) * _2PI / this._p2 ) + 1;
292 | }, 0.3),
293 | _createElastic("ElasticIn", function(p) {
294 | return -(this._p1 * Math.pow(2, 10 * (p -= 1)) * Math.sin( (p - this._p3) * _2PI / this._p2 ));
295 | }, 0.3),
296 | _createElastic("ElasticInOut", function(p) {
297 | return ((p *= 2) < 1) ? -0.5 * (this._p1 * Math.pow(2, 10 * (p -= 1)) * Math.sin( (p - this._p3) * _2PI / this._p2)) : this._p1 * Math.pow(2, -10 *(p -= 1)) * Math.sin( (p - this._p3) * _2PI / this._p2 ) *0.5 + 1;
298 | }, 0.45)
299 | );
300 |
301 |
302 | //Expo
303 | _wrap("Expo",
304 | _create("ExpoOut", function(p) {
305 | return 1 - Math.pow(2, -10 * p);
306 | }),
307 | _create("ExpoIn", function(p) {
308 | return Math.pow(2, 10 * (p - 1)) - 0.001;
309 | }),
310 | _create("ExpoInOut", function(p) {
311 | return ((p *= 2) < 1) ? 0.5 * Math.pow(2, 10 * (p - 1)) : 0.5 * (2 - Math.pow(2, -10 * (p - 1)));
312 | })
313 | );
314 |
315 |
316 | //Sine
317 | _wrap("Sine",
318 | _create("SineOut", function(p) {
319 | return Math.sin(p * _HALF_PI);
320 | }),
321 | _create("SineIn", function(p) {
322 | return -Math.cos(p * _HALF_PI) + 1;
323 | }),
324 | _create("SineInOut", function(p) {
325 | return -0.5 * (Math.cos(Math.PI * p) - 1);
326 | })
327 | );
328 |
329 | _class("easing.EaseLookup", {
330 | find:function(s) {
331 | return Ease.map[s];
332 | }
333 | }, true);
334 |
335 | //register the non-standard eases
336 | _easeReg(w.SlowMo, "SlowMo", "ease,");
337 | _easeReg(RoughEase, "RoughEase", "ease,");
338 | _easeReg(SteppedEase, "SteppedEase", "ease,");
339 |
340 | return Back;
341 |
342 | }, true);
343 |
344 | }); if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); }
--------------------------------------------------------------------------------
/www/js/common/backbone-stickit/docs/annotated/docco.css:
--------------------------------------------------------------------------------
1 | /*--------------------- Typography ----------------------------*/
2 |
3 | @font-face {
4 | font-family: 'aller-light';
5 | src: url('public/fonts/aller-light.eot');
6 | src: url('public/fonts/aller-light.eot?#iefix') format('embedded-opentype'),
7 | url('public/fonts/aller-light.woff') format('woff'),
8 | url('public/fonts/aller-light.ttf') format('truetype');
9 | font-weight: normal;
10 | font-style: normal;
11 | }
12 |
13 | @font-face {
14 | font-family: 'aller-bold';
15 | src: url('public/fonts/aller-bold.eot');
16 | src: url('public/fonts/aller-bold.eot?#iefix') format('embedded-opentype'),
17 | url('public/fonts/aller-bold.woff') format('woff'),
18 | url('public/fonts/aller-bold.ttf') format('truetype');
19 | font-weight: normal;
20 | font-style: normal;
21 | }
22 |
23 | @font-face {
24 | font-family: 'novecento-bold';
25 | src: url('public/fonts/novecento-bold.eot');
26 | src: url('public/fonts/novecento-bold.eot?#iefix') format('embedded-opentype'),
27 | url('public/fonts/novecento-bold.woff') format('woff'),
28 | url('public/fonts/novecento-bold.ttf') format('truetype');
29 | font-weight: normal;
30 | font-style: normal;
31 | }
32 |
33 | /*--------------------- Layout ----------------------------*/
34 | html { height: 100%; }
35 | body {
36 | font-family: "aller-light";
37 | font-size: 14px;
38 | line-height: 18px;
39 | color: #30404f;
40 | margin: 0; padding: 0;
41 | height:100%;
42 | }
43 | #container { min-height: 100%; }
44 |
45 | a {
46 | color: #000;
47 | }
48 |
49 | b, strong {
50 | font-weight: normal;
51 | font-family: "aller-bold";
52 | }
53 |
54 | p, ul, ol {
55 | margin: 15px 0 0px;
56 | }
57 |
58 | h1, h2, h3, h4, h5, h6 {
59 | color: #112233;
60 | line-height: 1em;
61 | font-weight: normal;
62 | font-family: "novecento-bold";
63 | text-transform: uppercase;
64 | margin: 30px 0 15px 0;
65 | }
66 |
67 | h1 {
68 | margin-top: 40px;
69 | }
70 |
71 | hr {
72 | border: 0;
73 | background: 1px solid #ddd;
74 | height: 1px;
75 | margin: 20px 0;
76 | }
77 |
78 | pre, tt, code {
79 | font-size: 12px; line-height: 16px;
80 | font-family: Menlo, Monaco, Consolas, "Lucida Console", monospace;
81 | margin: 0; padding: 0;
82 | }
83 | .annotation pre {
84 | display: block;
85 | margin: 0;
86 | padding: 7px 10px;
87 | background: #fcfcfc;
88 | -moz-box-shadow: inset 0 0 10px rgba(0,0,0,0.1);
89 | -webkit-box-shadow: inset 0 0 10px rgba(0,0,0,0.1);
90 | box-shadow: inset 0 0 10px rgba(0,0,0,0.1);
91 | overflow-x: auto;
92 | }
93 | .annotation pre code {
94 | border: 0;
95 | padding: 0;
96 | background: transparent;
97 | }
98 |
99 |
100 | blockquote {
101 | border-left: 5px solid #ccc;
102 | margin: 0;
103 | padding: 1px 0 1px 1em;
104 | }
105 | .sections blockquote p {
106 | font-family: Menlo, Consolas, Monaco, monospace;
107 | font-size: 12px; line-height: 16px;
108 | color: #999;
109 | margin: 10px 0 0;
110 | white-space: pre-wrap;
111 | }
112 |
113 | ul.sections {
114 | list-style: none;
115 | padding:0 0 5px 0;;
116 | margin:0;
117 | }
118 |
119 | /*
120 | Force border-box so that % widths fit the parent
121 | container without overlap because of margin/padding.
122 |
123 | More Info : http://www.quirksmode.org/css/box.html
124 | */
125 | ul.sections > li > div {
126 | -moz-box-sizing: border-box; /* firefox */
127 | -ms-box-sizing: border-box; /* ie */
128 | -webkit-box-sizing: border-box; /* webkit */
129 | -khtml-box-sizing: border-box; /* konqueror */
130 | box-sizing: border-box; /* css3 */
131 | }
132 |
133 |
134 | /*---------------------- Jump Page -----------------------------*/
135 | #jump_to, #jump_page {
136 | margin: 0;
137 | background: white;
138 | -webkit-box-shadow: 0 0 25px #777; -moz-box-shadow: 0 0 25px #777;
139 | -webkit-border-bottom-left-radius: 5px; -moz-border-radius-bottomleft: 5px;
140 | font: 16px Arial;
141 | cursor: pointer;
142 | text-align: right;
143 | list-style: none;
144 | }
145 |
146 | #jump_to a {
147 | text-decoration: none;
148 | }
149 |
150 | #jump_to a.large {
151 | display: none;
152 | }
153 | #jump_to a.small {
154 | font-size: 22px;
155 | font-weight: bold;
156 | color: #676767;
157 | }
158 |
159 | #jump_to, #jump_wrapper {
160 | position: fixed;
161 | right: 0; top: 0;
162 | padding: 10px 15px;
163 | margin:0;
164 | }
165 |
166 | #jump_wrapper {
167 | display: none;
168 | padding:0;
169 | }
170 |
171 | #jump_to:hover #jump_wrapper {
172 | display: block;
173 | }
174 |
175 | #jump_page {
176 | padding: 5px 0 3px;
177 | margin: 0 0 25px 25px;
178 | }
179 |
180 | #jump_page .source {
181 | display: block;
182 | padding: 15px;
183 | text-decoration: none;
184 | border-top: 1px solid #eee;
185 | }
186 |
187 | #jump_page .source:hover {
188 | background: #f5f5ff;
189 | }
190 |
191 | #jump_page .source:first-child {
192 | }
193 |
194 | /*---------------------- Low resolutions (> 320px) ---------------------*/
195 | @media only screen and (min-width: 320px) {
196 | .pilwrap { display: none; }
197 |
198 | ul.sections > li > div {
199 | display: block;
200 | padding:5px 10px 0 10px;
201 | }
202 |
203 | ul.sections > li > div.annotation ul, ul.sections > li > div.annotation ol {
204 | padding-left: 30px;
205 | }
206 |
207 | ul.sections > li > div.content {
208 | background: #f5f5ff;
209 | overflow-x:auto;
210 | -webkit-box-shadow: inset 0 0 5px #e5e5ee;
211 | box-shadow: inset 0 0 5px #e5e5ee;
212 | border: 1px solid #dedede;
213 | margin:5px 10px 5px 10px;
214 | padding-bottom: 5px;
215 | }
216 |
217 | ul.sections > li > div.annotation pre {
218 | margin: 7px 0 7px;
219 | padding-left: 15px;
220 | }
221 |
222 | ul.sections > li > div.annotation p tt, .annotation code {
223 | background: #f8f8ff;
224 | border: 1px solid #dedede;
225 | font-size: 12px;
226 | padding: 0 0.2em;
227 | }
228 | }
229 |
230 | /*---------------------- (> 481px) ---------------------*/
231 | @media only screen and (min-width: 481px) {
232 | #container {
233 | position: relative;
234 | }
235 | body {
236 | background-color: #F5F5FF;
237 | font-size: 15px;
238 | line-height: 21px;
239 | }
240 | pre, tt, code {
241 | line-height: 18px;
242 | }
243 | p, ul, ol {
244 | margin: 0 0 15px;
245 | }
246 |
247 |
248 | #jump_to {
249 | padding: 5px 10px;
250 | }
251 | #jump_wrapper {
252 | padding: 0;
253 | }
254 | #jump_to, #jump_page {
255 | font: 10px Arial;
256 | text-transform: uppercase;
257 | }
258 | #jump_page .source {
259 | padding: 5px 10px;
260 | }
261 | #jump_to a.large {
262 | display: inline-block;
263 | }
264 | #jump_to a.small {
265 | display: none;
266 | }
267 |
268 |
269 |
270 | #background {
271 | position: absolute;
272 | top: 0; bottom: 0;
273 | width: 350px;
274 | background: #fff;
275 | border-right: 1px solid #e5e5ee;
276 | z-index: -1;
277 | }
278 |
279 | ul.sections > li > div.annotation ul, ul.sections > li > div.annotation ol {
280 | padding-left: 40px;
281 | }
282 |
283 | ul.sections > li {
284 | white-space: nowrap;
285 | }
286 |
287 | ul.sections > li > div {
288 | display: inline-block;
289 | }
290 |
291 | ul.sections > li > div.annotation {
292 | max-width: 350px;
293 | min-width: 350px;
294 | min-height: 5px;
295 | padding: 13px;
296 | overflow-x: hidden;
297 | white-space: normal;
298 | vertical-align: top;
299 | text-align: left;
300 | }
301 | ul.sections > li > div.annotation pre {
302 | margin: 15px 0 15px;
303 | padding-left: 15px;
304 | }
305 |
306 | ul.sections > li > div.content {
307 | padding: 13px;
308 | vertical-align: top;
309 | background: #f5f5ff;
310 | border: none;
311 | -webkit-box-shadow: none;
312 | box-shadow: none;
313 | }
314 |
315 | .pilwrap {
316 | position: relative;
317 | display: inline;
318 | }
319 |
320 | .pilcrow {
321 | font: 12px Arial;
322 | text-decoration: none;
323 | color: #454545;
324 | position: absolute;
325 | top: 3px; left: -20px;
326 | padding: 1px 2px;
327 | opacity: 0;
328 | -webkit-transition: opacity 0.2s linear;
329 | }
330 | .for-h1 .pilcrow {
331 | top: 47px;
332 | }
333 | .for-h2 .pilcrow, .for-h3 .pilcrow, .for-h4 .pilcrow {
334 | top: 35px;
335 | }
336 |
337 | ul.sections > li > div.annotation:hover .pilcrow {
338 | opacity: 1;
339 | }
340 | }
341 |
342 | /*---------------------- (> 1025px) ---------------------*/
343 | @media only screen and (min-width: 1025px) {
344 |
345 | body {
346 | font-size: 16px;
347 | line-height: 24px;
348 | }
349 |
350 | #background {
351 | width: 525px;
352 | }
353 | ul.sections > li > div.annotation {
354 | max-width: 525px;
355 | min-width: 525px;
356 | padding: 10px 25px 1px 50px;
357 | }
358 | ul.sections > li > div.content {
359 | padding: 9px 15px 16px 25px;
360 | }
361 | }
362 |
363 | /*---------------------- Syntax Highlighting -----------------------------*/
364 |
365 | td.linenos { background-color: #f0f0f0; padding-right: 10px; }
366 | span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
367 | /*
368 |
369 | github.com style (c) Vasily Polovnyov
370 |
371 | */
372 |
373 | pre code {
374 | display: block; padding: 0.5em;
375 | color: #000;
376 | background: #f8f8ff
377 | }
378 |
379 | pre .comment,
380 | pre .template_comment,
381 | pre .diff .header,
382 | pre .javadoc {
383 | color: #408080;
384 | font-style: italic
385 | }
386 |
387 | pre .keyword,
388 | pre .assignment,
389 | pre .literal,
390 | pre .css .rule .keyword,
391 | pre .winutils,
392 | pre .javascript .title,
393 | pre .lisp .title,
394 | pre .subst {
395 | color: #954121;
396 | /*font-weight: bold*/
397 | }
398 |
399 | pre .number,
400 | pre .hexcolor {
401 | color: #40a070
402 | }
403 |
404 | pre .string,
405 | pre .tag .value,
406 | pre .phpdoc,
407 | pre .tex .formula {
408 | color: #219161;
409 | }
410 |
411 | pre .title,
412 | pre .id {
413 | color: #19469D;
414 | }
415 | pre .params {
416 | color: #00F;
417 | }
418 |
419 | pre .javascript .title,
420 | pre .lisp .title,
421 | pre .subst {
422 | font-weight: normal
423 | }
424 |
425 | pre .class .title,
426 | pre .haskell .label,
427 | pre .tex .command {
428 | color: #458;
429 | font-weight: bold
430 | }
431 |
432 | pre .tag,
433 | pre .tag .title,
434 | pre .rules .property,
435 | pre .django .tag .keyword {
436 | color: #000080;
437 | font-weight: normal
438 | }
439 |
440 | pre .attribute,
441 | pre .variable,
442 | pre .instancevar,
443 | pre .lisp .body {
444 | color: #008080
445 | }
446 |
447 | pre .regexp {
448 | color: #B68
449 | }
450 |
451 | pre .class {
452 | color: #458;
453 | font-weight: bold
454 | }
455 |
456 | pre .symbol,
457 | pre .ruby .symbol .string,
458 | pre .ruby .symbol .keyword,
459 | pre .ruby .symbol .keymethods,
460 | pre .lisp .keyword,
461 | pre .tex .special,
462 | pre .input_number {
463 | color: #990073
464 | }
465 |
466 | pre .builtin,
467 | pre .constructor,
468 | pre .built_in,
469 | pre .lisp .title {
470 | color: #0086b3
471 | }
472 |
473 | pre .preprocessor,
474 | pre .pi,
475 | pre .doctype,
476 | pre .shebang,
477 | pre .cdata {
478 | color: #999;
479 | font-weight: bold
480 | }
481 |
482 | pre .deletion {
483 | background: #fdd
484 | }
485 |
486 | pre .addition {
487 | background: #dfd
488 | }
489 |
490 | pre .diff .change {
491 | background: #0086b3
492 | }
493 |
494 | pre .chunk {
495 | color: #aaa
496 | }
497 |
498 | pre .tex .formula {
499 | opacity: 0.5;
500 | }
501 |
--------------------------------------------------------------------------------
/www/js/common/gsap/plugins/KineticPlugin.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * VERSION: 0.5.2
3 | * DATE: 2014-07-17
4 | * UPDATES AND DOCS AT: http://www.greensock.com
5 | *
6 | * @license Copyright (c) 2008-2014, GreenSock. All rights reserved.
7 | * This work is subject to the terms at http://www.greensock.com/terms_of_use.html or for
8 | * Club GreenSock members, the software agreement that was issued with your membership.
9 | *
10 | * @author: Jack Doyle, jack@greensock.com
11 | */
12 | var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(global) !== "undefined") ? global : this || window; //helps ensure compatibility with AMD/RequireJS and CommonJS/Node
13 | (_gsScope._gsQueue || (_gsScope._gsQueue = [])).push( function() {
14 |
15 | "use strict";
16 |
17 | var _specialProps = {scale:1, shadowOffset:1, fillPatternOffset:1, offset:1, fill:2, stroke:2, shadowColor:2}, //type 1 is one that has "x" and "y" components that can be split apart but in order to set them, they must be combined into a single object and passed to one setter (like setScale({x:0.5, y:0.6})). Type 2 is for colors.
18 | _getterFuncs = {},
19 | _setterFuncs = {},
20 | _numExp = /(\d|\.)+/g,
21 | _directionalRotationExp = /(?:_cw|_ccw|_short)/,
22 | _plugins = _gsScope._gsDefine.globals.com.greensock.plugins,
23 | _colorLookup = {aqua:[0,255,255],
24 | lime:[0,255,0],
25 | silver:[192,192,192],
26 | black:[0,0,0],
27 | maroon:[128,0,0],
28 | teal:[0,128,128],
29 | blue:[0,0,255],
30 | navy:[0,0,128],
31 | white:[255,255,255],
32 | fuchsia:[255,0,255],
33 | olive:[128,128,0],
34 | yellow:[255,255,0],
35 | orange:[255,165,0],
36 | gray:[128,128,128],
37 | purple:[128,0,128],
38 | green:[0,128,0],
39 | red:[255,0,0],
40 | pink:[255,192,203],
41 | cyan:[0,255,255],
42 | transparent:[255,255,255,0]},
43 | _hue = function(h, m1, m2) {
44 | h = (h < 0) ? h + 1 : (h > 1) ? h - 1 : h;
45 | return ((((h * 6 < 1) ? m1 + (m2 - m1) * h * 6 : (h < 0.5) ? m2 : (h * 3 < 2) ? m1 + (m2 - m1) * (2 / 3 - h) * 6 : m1) * 255) + 0.5) | 0;
46 | },
47 | _parseColor = function(color) {
48 | if (color === "" || color == null || color === "none") {
49 | return _colorLookup.transparent;
50 | }
51 | if (_colorLookup[color]) {
52 | return _colorLookup[color];
53 | }
54 | if (typeof(color) === "number") {
55 | return [color >> 16, (color >> 8) & 255, color & 255];
56 | }
57 | if (color.charAt(0) === "#") {
58 | if (color.length === 4) { //for shorthand like #9F0
59 | color = "#" + color.charAt(1) + color.charAt(1) + color.charAt(2) + color.charAt(2) + color.charAt(3) + color.charAt(3);
60 | }
61 | color = parseInt(color.substr(1), 16);
62 | return [color >> 16, (color >> 8) & 255, color & 255];
63 | }
64 | if (color.substr(0, 3) === "hsl") {
65 | color = color.match(_numExp);
66 | var h = (Number(color[0]) % 360) / 360,
67 | s = Number(color[1]) / 100,
68 | l = Number(color[2]) / 100,
69 | m2 = (l <= 0.5) ? l * (s + 1) : l + s - l * s,
70 | m1 = l * 2 - m2;
71 | if (color.length > 3) {
72 | color[3] = Number(color[3]);
73 | }
74 | color[0] = _hue(h + 1 / 3, m1, m2);
75 | color[1] = _hue(h, m1, m2);
76 | color[2] = _hue(h - 1 / 3, m1, m2);
77 | return color;
78 | }
79 | var a = color.match(_numExp) || _colorLookup.transparent,
80 | i = a.length;
81 | while (--i > -1) {
82 | a[i] = Number(a[i]);
83 | }
84 | return a;
85 | },
86 | ColorProp = function(target, getter, setter, next) {
87 | this.getter = getter;
88 | this.setter = setter;
89 | var val = _parseColor( target[getter]() );
90 | this.proxy = {r:val[0], g:val[1], b:val[2], a:(val.length > 3 ? val[3] : 1)};
91 | if (next) {
92 | this._next = next;
93 | next._prev = this;
94 | }
95 | },
96 | _layersToDraw = [],
97 | _ticker, _listening,
98 | _onTick = function() {
99 | var i = _layersToDraw.length;
100 | if (i !== 0) {
101 | while (--i > -1) {
102 | _layersToDraw[i].draw();
103 | _layersToDraw[i]._gsDraw = false;
104 | }
105 | _layersToDraw.length = 0;
106 | } else {
107 | _ticker.removeEventListener("tick", _onTick);
108 | _listening = false;
109 | }
110 | },
111 | _prepDimensionProp = function(p, dimension) {
112 | var alt = (dimension === "x") ? "y" : "x",
113 | proxyName = "_gs_" + p;
114 | _getterFuncs[p] = function() {
115 | return this["get" + p]()[dimension];
116 | };
117 | _setterFuncs[p] = function(value) {
118 | var cur = this["get" + p](),
119 | proxy = this[proxyName];
120 | if (!proxy) {
121 | proxy = this[proxyName] = {};
122 | }
123 | proxy[dimension] = value;
124 | proxy[alt] = cur[alt];
125 | this[p](proxy);
126 | return this;
127 | };
128 | },
129 | _createGetterSetter = function(getter, setter) {
130 | return function(value) {return (arguments.length) ? setter(value) : getter(); };
131 | },
132 | //looks at every property in the vars and converts them (when appropriate) to the KineticJS equivalent. If it finds a special property for which "x" and "y" must be split apart (like scale, offset, shadowOffset, etc.), it will do that as well. This method returns an array of any names it had to change (like "x", "y", "scale", etc.) so that they can be used in the overwriteProps array.
133 | _convertProps = function(target, vars) {
134 | var converted = [],
135 | p, val, i, proto;
136 | for (p in vars) {
137 | val = vars[p];
138 | if (p !== "bezier" && p !== "autoDraw" && p.substr(0,3) !== "set" && target[p] === undefined) {
139 | converted.push(p);
140 | delete vars[p];
141 | p = "set" + p.charAt(0).toUpperCase() + p.substr(1);
142 | vars[p] = val;
143 | }
144 | if (_specialProps[p]) {
145 | if (_specialProps[p] === 1) {
146 | vars[p + "X"] = vars[p + "Y"] = vars[p];
147 | delete vars[p];
148 | return _convertProps(target, vars);
149 | } else if (!target[p] && _setterFuncs[p]) {
150 | proto = target.prototype || target;
151 | proto[p] = _createGetterSetter(_getterFuncs[p], _setterFuncs[p]);
152 | }
153 | } else if (p === "bezier") {
154 | val = (val instanceof Array) ? val : val.values || [];
155 | i = val.length;
156 | while (--i > -1) {
157 | if (i === 0) {
158 | converted = converted.concat( _convertProps(target, val[i]) );
159 | } else {
160 | _convertProps(target, val[i]);
161 | }
162 | }
163 | }
164 | }
165 | return converted;
166 | },
167 | _copy = function(obj) {
168 | var result = {},
169 | p;
170 | for (p in obj) {
171 | result[p] = obj[p];
172 | }
173 | return result;
174 | },
175 | versionValid, p;
176 |
177 | for (p in _specialProps) {
178 | if (_specialProps[p] === 1) {
179 | _prepDimensionProp(p, "x");
180 | _prepDimensionProp(p, "y");
181 | }
182 | }
183 |
184 | var KineticPlugin = _gsScope._gsDefine.plugin({
185 | propName: "kinetic",
186 | API: 2,
187 | version: "0.5.2",
188 |
189 | //called when the tween renders for the first time. This is where initial values should be recorded and any setup routines should run.
190 | init: function(target, value, tween) {
191 | var p, val, gp, sp, bezierPlugin, directionalRotationPlugin;
192 | if (!versionValid && (versionValid = (parseInt(Kinetic.version.split(".")[0], 10)) < 5)) {
193 | throw ("The GSAP KineticPlugin that's loaded requires KineticJS version 5.0.0 or later. For earlier versions, use KineticPlugin from GSAP 1.11.3 or earlier.");
194 | }
195 | this._overwriteProps = _convertProps(target, value); //allow users to pass in shorter names like "x" instead of "setX" and "rotationDeg" instead of "setRotationDeg"
196 | this._target = target;
197 | this._layer = (value.autoDraw !== false) ? target.getLayer() : null;
198 | if (!_ticker && this._layer) {
199 | _ticker = tween.constructor.ticker;
200 | }
201 | for (p in value) {
202 | val = value[p];
203 | //we must handle colors in a special way, splitting apart the red, green, blue, and alpha.
204 | if (_specialProps[p] === 2) {
205 | sp = this._firstSP = new ColorProp(target, p, p, this._firstSP);
206 | val = _parseColor(val);
207 | if (sp.proxy.r !== val[0]) {
208 | this._addTween(sp.proxy, "r", sp.proxy.r, val[0], p);
209 | }
210 | if (sp.proxy.g !== val[1]) {
211 | this._addTween(sp.proxy, "g", sp.proxy.g, val[1], p);
212 | }
213 | if (sp.proxy.b !== val[2]) {
214 | this._addTween(sp.proxy, "b", sp.proxy.b, val[2], p);
215 | }
216 | if ((val.length > 3 || sp.proxy.a !== 1) && sp.proxy.a !== val[3]) {
217 | this._addTween(sp.proxy, "a", sp.proxy.a, (val.length > 3 ? val[3] : 1), p);
218 | }
219 | } else if (p === "bezier") {
220 | bezierPlugin = _plugins.BezierPlugin;
221 | if (!bezierPlugin) {
222 | throw("BezierPlugin not loaded");
223 | }
224 | bezierPlugin = this._bezier = new bezierPlugin();
225 | if (typeof(val) === "object" && val.autoRotate === true) {
226 | val.autoRotate = ["x","y","rotation",0,false];
227 | }
228 | bezierPlugin._onInitTween(target, val, tween);
229 | this._overwriteProps = this._overwriteProps.concat(bezierPlugin._overwriteProps);
230 | this._addTween(bezierPlugin, "setRatio", 0, 1, p);
231 |
232 | } else if ((p === "rotation" || p === "rotationDeg") && typeof(val) === "string" && _directionalRotationExp.test(val)) {
233 | directionalRotationPlugin = _plugins.DirectionalRotationPlugin;
234 | if (!directionalRotationPlugin) {
235 | throw("DirectionalRotationPlugin not loaded");
236 | }
237 | directionalRotationPlugin = this._directionalRotation = new directionalRotationPlugin();
238 | gp = {useRadians:false};
239 | gp[p] = val;
240 | directionalRotationPlugin._onInitTween(target, gp, tween);
241 | this._addTween(directionalRotationPlugin, "setRatio", 0, 1, p);
242 |
243 | } else if (val instanceof Array) { //for array-based values like "points"
244 | this._initArrayTween(target[p](), val, p);
245 |
246 | } else if (p !== "autoDraw") {
247 | gp = "get" + p.substr(3);
248 | this._addTween(target, p, ((typeof(target[p]) === "function") ? target[( (gp !== "get" && typeof(target[gp]) === "function") ? gp : p)]() : target[p]) || 0, val, p);
249 | }
250 | this._overwriteProps.push(p);
251 | }
252 | return true;
253 | },
254 |
255 | kill: function(lookup) {
256 | lookup = _copy(lookup);
257 | _convertProps(this._target, lookup);
258 | if (this._bezier) {
259 | this._bezier._kill(lookup);
260 | }
261 | if (this._directionalRotation) {
262 | this._directionalRotation._kill(lookup);
263 | }
264 | return this._super._kill.call(this, lookup);
265 | },
266 |
267 | round:function(lookup, value) {
268 | lookup = _copy(lookup);
269 | _convertProps(this._target, lookup);
270 | if (this._bezier) {
271 | this._bezier._roundProps(lookup, value);
272 | }
273 | return this._super._roundProps.call(this, lookup, value);
274 | },
275 |
276 | //called each time the values should be updated, and the ratio gets passed as the only parameter (typically it's a value between 0 and 1, but it can exceed those when using an ease like Elastic.easeOut or Back.easeOut, etc.)
277 | set: function(ratio) {
278 | this._super.setRatio.call(this, ratio);
279 | var sp = this._firstSP,
280 | layer = this._layer,
281 | arrayTweens = this._arrayTweens,
282 | i, e, p, val, t, proxy;
283 | if (sp) {
284 | t = this._target;
285 | while (sp) {
286 | proxy = sp.proxy;
287 | t[sp.setter]( (proxy.a !== 1 ? "rgba(" : "rgb(") + (proxy.r | 0) + ", " + (proxy.g | 0) + ", " + (proxy.b | 0) + (proxy.a !== 1 ? ", " + proxy.a : "") + ")");
288 | sp = sp._next;
289 | }
290 | }
291 | if (arrayTweens) {
292 | i = arrayTweens.length;
293 | while (--i > -1) {
294 | e = arrayTweens[i];
295 | val = e.s + e.c * ratio;
296 | e.a[e.i] = (val < 0.000001 && val > -0.000001) ? 0 : val;
297 | }
298 | for (p in this._arrayProps) {
299 | this._target[p](this._arrayProps[p]);
300 | }
301 | }
302 | if (layer && !layer._gsDraw) {
303 | _layersToDraw.push(layer);
304 | layer._gsDraw = true; //a flag indicating that we need to draw() this layer as soon as all the tweens have finished updating (using a "tick" event listener)
305 | if (!_listening) {
306 | _ticker.addEventListener("tick", _onTick);
307 | _listening = true;
308 | }
309 | }
310 | }
311 |
312 | });
313 |
314 | p = KineticPlugin.prototype;
315 | p._initArrayTween = function(a, b, prop) {
316 | if (!this._arrayTweens) {
317 | this._arrayTweens = []; //stores data about any elements that must tween (ones that match in a and b are ignored (no need to waste resources). For example, {a:array, i:0, s:100, c:50}
318 | this._arrayProps = {}; //stores data about which properties are associted with which arrays so that we can apply them in the setRatio() method, like target[property](array), as in target.points([1,2,500,600]);
319 | }
320 | var i = a.length,
321 | tweens = this._arrayTweens,
322 | start, end;
323 | while (--i > -1) {
324 | start = a[i];
325 | end = b[i];
326 | if (start !== end) {
327 | tweens.push({a:a, i:i, s:start, c:end - start});
328 | }
329 | }
330 | if (tweens.length) {
331 | this._arrayProps[prop] = a;
332 | }
333 | };
334 |
335 | }); if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); }
--------------------------------------------------------------------------------