Permalink
Browse files

Refactor client init

  • Loading branch information...
1 parent e30007d commit b862290606e9555c98cb27e33a49f984d977dcd6 @ixti ixti committed Aug 24, 2012
Showing with 329 additions and 327 deletions.
  1. +0 −57 assets/javascripts/app.js
  2. +5 −2 assets/javascripts/loader.js.ejs
  3. +35 −268 client/init.js
  4. +289 −0 client/init/app.js
View
@@ -1,5 +1,3 @@
-/*global nodeca, _, $, Modernizr, window, document*/
-
//= require store
//= require jquery/jquery
//= require jquery-ui/jquery-ui
@@ -14,58 +12,3 @@
//= require i18n
//= require views
//= require api
-//= require_self
-
-$(function () {
- "use strict";
- nodeca.client.init();
-});
-
-//
-// Social buttons defered load - after all
-//
-
-$(window).load(function() {
- 'use strict';
-
- setTimeout(function () {
-
- // Twitter buttons
-
- (function(d,s,id) {
- var js, fjs = d.getElementsByTagName(s)[0];
-
- if (!d.getElementById(id)) {
- js = d.createElement(s);
- js.id = id;
- js.src = "//platform.twitter.com/widgets.js";
-
- fjs.parentNode.insertBefore(js,fjs);
- }
- }(document, "script", "twitter-wjs"));
-
- // Google +1
-
- (function() {
- var po = document.createElement('script');
-
- po.type = 'text/javascript';
- po.async = true;
- po.src = 'https://apis.google.com/js/plusone.js';
-
- var s = document.getElementsByTagName('script')[0];
- s.parentNode.insertBefore(po, s);
- }());
-
- // Flattr
-
- (function() {
- var s = document.createElement('script'), t = document.getElementsByTagName('script')[0];
- s.type = 'text/javascript';
- s.async = true;
- s.src = '//api.flattr.com/js/0.6/load.js?mode=auto';
- t.parentNode.insertBefore(s, t);
- }());
-
- }, 1000);
-});
@@ -4,7 +4,7 @@
/*jshint browser:true,node:false*/
-/*global yepnope*/
+/*global yepnope, window*/
yepnope([
@@ -15,7 +15,10 @@ yepnope([
nope: <%- JSON.stringify(asset_path('json2.js')) %>
},
{
- load: <%- JSON.stringify(asset_path('app.js')) %>
+ load: <%- JSON.stringify(asset_path('app.js')) %>,
+ complete: function () {
+ window.nodeca.client.init();
+ }
}
]);
Oops, something went wrong.

0 comments on commit b862290

Please sign in to comment.