From 67f1fd41c3ff95c85f9e71eb0961ea5c94d69f6e Mon Sep 17 00:00:00 2001 From: Nick Sergeant Date: Thu, 9 May 2013 00:54:00 -0400 Subject: [PATCH] Init the Angular app as soon as possible. --- media/js/src/application.min.js | 2 +- media/js/src/search.min.js | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 media/js/src/search.min.js diff --git a/media/js/src/application.min.js b/media/js/src/application.min.js index a3dfa89..4daa152 100644 --- a/media/js/src/application.min.js +++ b/media/js/src/application.min.js @@ -1,3 +1,3 @@ var snipt={module:function(){var modules={};return function(name){if(modules[name]){return modules[name];} -return modules[name]={};};}()};jQuery(function($){var SiteView=snipt.module('site').SiteView;window.site=new SiteView();});(function(){if(typeof angular!=='undefined'){var root=this;var app=angular.module('Snipt',[],function($locationProvider){$locationProvider.html5Mode(true);});app.config(function($interpolateProvider){$interpolateProvider.startSymbol('((');$interpolateProvider.endSymbol('))');});root.app=app;}}).call(this); \ No newline at end of file +return modules[name]={};};}()};jQuery(function($){var SiteView=snipt.module('site').SiteView;window.site=new SiteView();});(function(){var root=this;var app=angular.module('Snipt',[],function($locationProvider){$locationProvider.html5Mode(true);});app.config(function($interpolateProvider){$interpolateProvider.startSymbol('((');$interpolateProvider.endSymbol('))');});root.app=app;}).call(this); \ No newline at end of file diff --git a/media/js/src/search.min.js b/media/js/src/search.min.js new file mode 100644 index 0000000..1888ded --- /dev/null +++ b/media/js/src/search.min.js @@ -0,0 +1,3 @@ + +(function(){if(typeof angular!=='undefined'){var root=this;var $=root.jQuery;var controllers={};var app=root.app;app.factory('SearchService',function(){return{mineOnly:false,query:''};});controllers.HeaderSearchController=function($scope,SearchService){$scope.search=SearchService;};controllers.SearchController=function($scope,SearchService){$scope.search=SearchService;$scope.$watch('search.query',function(query){if(query.indexOf('--mine')!==-1){$scope.search.mineOnly=true;}else{$scope.search.mineOnly=false;}});$scope.toggleMineOnly=function(){if($scope.search.mineOnly){if($scope.search.query.indexOf('--mine')===-1){$scope.search.query=$scope.search.query.trim()+' --mine';}} +else{$scope.search.query=$scope.search.query.replace('--mine','').trim();}};};app.controller(controllers);}}).call(this); \ No newline at end of file