Skip to content
Permalink
Browse files

Initial Commit.

v1.0
  • Loading branch information...
Ryan J Daw
Ryan J Daw committed Jun 1, 2012
0 parents commit 2ddc9fd11a48aae43b9b21fb8dee5872bb34572c
Showing with 52,856 additions and 0 deletions.
  1. +2 −0 .gitattributes
  2. +2 −0 .gitignore
  3. +21 −0 LICENSE
  4. +4 −0 README.md
  5. +22 −0 api-browser.konf
  6. +7 −0 api-client.konf
  7. +22 −0 api-legacy.konf
  8. +18 −0 api-node.konf
  9. +136 −0 api/analytics.js
  10. 0 api/blank.js
  11. +264 −0 api/cont.js
  12. +367 −0 api/data.js
  13. +120 −0 api/data2.js
  14. +131 −0 api/deferrable.js
  15. +177 −0 api/enhance.js
  16. +138 −0 api/externals.js
  17. +311 −0 api/main.js
  18. +12 −0 api/noconflict.js
  19. +78 −0 api/stack.js
  20. +174 −0 api/tmpl.js
  21. +181 −0 api/util.js
  22. +1 −0 init.js
  23. +1,011 −0 lib/backbone.js
  24. +94 −0 lib/base_konf.konf
  25. +14 −0 lib/base_legacy_konf.konf
  26. +267 −0 lib/debug.js
  27. +37 −0 lib/defaultConf.konf
  28. +207 −0 lib/detect.konf
  29. +525 −0 lib/dust-core.js
  30. +132 −0 lib/fy/bubble.html
  31. +108 −0 lib/fy/bubble.js
  32. +126 −0 lib/fy/bubble2.js
  33. +61 −0 lib/fy/menu.html
  34. +64 −0 lib/fy/menu.js
  35. +42 −0 lib/fy/slide.html
  36. +245 −0 lib/fy/slide.js
  37. +8,376 −0 lib/jquery-1.5.2.js
  38. +8,981 −0 lib/jquery-1.6.2.js
  39. +9,046 −0 lib/jquery-1.6.4.js
  40. +8,865 −0 lib/jquery-1.6.js
  41. +5,144 −0 lib/jquery-base-1.5.2.js
  42. +1 −0 lib/jquery-latest.js
  43. +99 −0 lib/jquery/jquery.cookie.js
  44. +29 −0 lib/jquery/jquery.mapattributes.js
  45. +32 −0 lib/jquery/jquery.outerhtml.js
  46. +76 −0 lib/jquery/jquery.tap.js
  47. +480 −0 lib/json2.js
  48. +811 −0 lib/livereload.js
  49. +855 −0 lib/underscore.js
  50. +862 −0 lib/zepto.js
  51. +456 −0 scss/_normalize.scss
  52. +22 −0 scss/_reset.scss
  53. +24 −0 scss/modules/_bubble.scss
  54. +63 −0 scss/modules/_grid.scss
  55. +75 −0 scss/modules/_slide.scss
  56. +46 −0 test/detect-test.html
  57. +71 −0 test/enhance-test.html
  58. +167 −0 test/externals-test.html
  59. +13 −0 test/fixtures-externals/plaintext.html
  60. +11 −0 test/fixtures-unmobify/basic.html
  61. +28 −0 test/fixtures-unmobify/escaped.html
  62. +33 −0 test/fixtures-unmobify/legacy.html
  63. +22 −0 test/fixtures-unmobify/plaintext-leading-content.html
  64. +26 −0 test/fixtures-unmobify/plaintext-missing-body.html
  65. +32 −0 test/fixtures-unmobify/plaintext-missing-closing-head.html
  66. +33 −0 test/fixtures-unmobify/plaintext.html
  67. +226 −0 test/qunit/qunit.css
  68. +1,597 −0 test/qunit/qunit.js
  69. +17 −0 test/test-server.js
  70. +226 −0 test/unmobify-test.html
  71. +258 −0 test/util-test.html
  72. +89 −0 timing.js
  73. +108 −0 tmpl/analytics.tmpl
  74. +19 −0 tmpl/base_mobileHead.tmpl
  75. +58 −0 tmpl/base_root.tmpl
  76. +358 −0 unmobify.js
@@ -0,0 +1,2 @@
.* export-ignore
test export-ignore
@@ -0,0 +1,2 @@
*.swp
.DS_STORE
21 LICENSE
@@ -0,0 +1,21 @@
Copyright (c) Mobify R&D Inc.
http://www.mobify.com/

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,4 @@
Mobify.js
=========

For information on using Mobify.js see [http://portal.mobify.com/docs/](http://portal.mobify.com/docs/).
@@ -0,0 +1,22 @@
{%rebase}

{>"lib/jquery/jquery.cookie.js"/}
{>"lib/jquery/jquery.outerhtml.js"/}
{>"lib/jquery/jquery.mapattributes.js"/}
{>"lib/dust-core.js"/}

{>"api/analytics.js"/}
{>"api/util.js"/}
{>"api/externals.js"/}
{>"unmobify.js"/}

{>"api/data2.js"/}
{>"api/stack.js"/}
{>"api/cont.js"/}

{>"api/tmpl.js"/}

{>"api/enhance.js"/}
{>"api/main.js"/}

{/rebase}
@@ -0,0 +1,7 @@
{%rebase}

{>"api/analytics.js"/}
{>"api/externals.js"/}
{>"api/enhance.js"/}

{/rebase}
@@ -0,0 +1,22 @@
{%rebase}

{>"lib/jquery/jquery.cookie.js"/}
{>"lib/jquery/jquery.outerhtml.js"/}
{>"lib/jquery/jquery.mapattributes.js"/}
{>"lib/dust-core.js"/}

{>"api/analytics.js"/}
{>"api/util.js"/}
{>"api/externals.js"/}
{>"unmobify.js"/}

{>"api/deferrable.js"/}
{>"api/data.js"/}

{>"api/tmpl.js"/}

{>"api/enhance.js"/}

{>"api/main.js"/}

{/rebase}
@@ -0,0 +1,18 @@
{%rebase}

{>"lib/jquery/jquery.cookie.js"/}
{>"lib/jquery/jquery.outerhtml.js"/}
{>"lib/jquery/jquery.mapattributes.js"/}
{>"lib/dust-core.js"/}

{>"api/util.js"/}

{>"api/data2.js"/}
{>"api/stack.js"/}
{>"api/cont.js"/}

{>"api/tmpl.js"/}

{>"api/main.js"/}

{/rebase}
@@ -0,0 +1,136 @@
/* DEPRECATED DEPRECATED DEPRECATED DEPRECATED DEPRECATED DEPRECATED DEPRECATED */
/* DEPRECATED DEPRECATED DEPRECATED DEPRECATED DEPRECATED DEPRECATED DEPRECATED */

/* This is now only used by api-legacy js konfs. Look at analytics.tmpl in the
template directory for up to date info. */

/* DEPRECATED DEPRECATED DEPRECATED DEPRECATED DEPRECATED DEPRECATED DEPRECATED */
/* DEPRECATED DEPRECATED DEPRECATED DEPRECATED DEPRECATED DEPRECATED DEPRECATED */


// TODO: It would be nice if these scripts were more natural in the mobify.js flow.
// TODO: Rename these functions, they're not just about GA anymore.
(function($, _) {
window._gaq = window._gaq || [];

var ga = Mobify.ga = {

init: function() {
// Load time rounded to nearest 100ms.
var ed = Mobify.evaluatedData;
var start;
try {
start = Mobify.timing.points[0][0];
} catch (err) {
start = undefined;
}

var loadTime = Math.round((Mobify.timing.addPoint('Done') - start) / 100) * 100;
var template = ed.bodyType || ed.rootPageType || 'miss';
//var buildDate = (ed.siteConfig.buildDate || (ed && ed.buildDate)) + '';
var buildDate = (
(ed.siteConfig && ed.siteConfig.buildDate) ||
(ed.buildDate)
) + '';

// http://code.google.com/apis/analytics/docs/tracking/gaTrackingCustomVariables.html
// _setCustomVar scope levels:
// 1 => Visitor
// 2 => Session
// 3 => Page (default)

// TODO: If they have multiple domains we need to configure a single tracking.

// this looks weird but it's populated down in the push: definition
var ga_args = [['_setAccount', null]];
// If we have site or konf specified args, populate them here, otherwise assume domain 'none'
// Corollory: this means site specified arguments should ALWAYS include _setDomainName

var ga_domain = (function(hostname, domain_dict){
var domain = 'none';
if (! domain_dict) return domain;
var hostname_parts = hostname.split('.');

while (hostname_parts.length > 0) {
domain = domain_dict[hostname_parts.join('_')];
if (!! domain) return domain;
hostname_parts = hostname_parts.slice(1); // cut off the head and continue
}
// fallback, domain is set to 'none'
return domain;
})(window.location.hostname, (!! ed.siteConfig) ? ed.siteConfig.ga_domains : false );
ga_args.push(['_setDomainName', ((ga_domain === 'none') ? '' : '.') + ga_domain]);

var site_args = ed.gaOptions || ((!! (ed.siteConfig && ed.siteConfig.ga_options)) ? ed.siteConfig.ga_options : []);

// Our custom variables, some of which aren't currently being populated properly (timing, build_dt)
var ga_final = [
['_setCustomVar', 1, 'loadTime', '' + loadTime],
['_setCustomVar', 2, 't', template],
['_setCustomVar', 3, 'build_dt', buildDate],
['_setCustomVar', 4, 'mobi', 'y', 1],
['_trackPageview'],
['_trackPageLoadTime']
];

var ga_args_array = ga_args.concat(site_args, ga_final);
ga.push.apply(this, ga_args_array);

var insertAt = document.getElementsByTagName('script')[0] || document.getElementsByTagName('head')[0];
var isSSL = location.protocol[4] == 's';

// JB: Would this ever really happen?
// PM: If clients aren't using GA in their site, yes. (Many ecommerce sites don't use GA.)
// QA Tracking. Load the QA script if its not already loaded.
if (!window._gat) {
var gaScript = document.createElement('script');
gaScript.onload = gaScript.onreadystatechange = ga.load;
gaScript.src = '//' + (isSSL ? 'ssl' : 'www') + '.google-analytics.com/ga.js';
insertAt.parentNode.insertBefore(gaScript, insertAt);
} else {
ga.load();
}

// Quantcast Tracking
var _qevents = window._qevents = window._qevents || [];
var qcScript = document.createElement('script');
qcScript.src = '//' + (isSSL ? 'secure' : 'edge') + '.quantserve.com/quant.js';
insertAt.parentNode.insertBefore(qcScript, insertAt);

_qevents.push({qacct:"p-eb0xvejp1OUw6"});
},

load: function() {
if (ga.loaded) return;
ga.loaded = true;
ga.push.apply(null, ga.q);
// Don't queue anymore.
ga.queue = ga.push;
},

loaded: false,

// Queue arguments to be pushed to _gaq on ga.load.
queue: function() {
[].push.apply(ga.q, [].slice.call(arguments));
},

q: [],

// Iterates through arguments and pushes them to _gaq.
// Replaces null values with gaId.
push: function() {
var ed = Mobify.evaluatedData;
var args = [].slice.call(arguments);
_.each(ed.gaId || ((!! (ed.siteConfig && ed.siteConfig.ga_account)) ? [ed.siteConfig.ga_account] : false) || [], function(gaId, i) {
var prefix = 'MOBIFY' + i;
_.each(args, function(arg, j) {
var data = arg.slice(0);
data[0] = prefix + '.' + data[0];
if (data[1] === null) data[1] = gaId;
_gaq.push(data);
});
});
}
};
})(Mobify.$, Mobify._);
No changes.
Oops, something went wrong.

0 comments on commit 2ddc9fd

Please sign in to comment.
You can’t perform that action at this time.