From c9f5a753c8ed53264cda67c520c07624827a8d62 Mon Sep 17 00:00:00 2001 From: Jordan Wright Date: Fri, 25 Sep 2015 18:06:38 -0500 Subject: [PATCH] Removing dead code --- static/js/app/app.js | 96 -------------------------------------------- 1 file changed, 96 deletions(-) delete mode 100644 static/js/app/app.js diff --git a/static/js/app/app.js b/static/js/app/app.js deleted file mode 100644 index cd960864..00000000 --- a/static/js/app/app.js +++ /dev/null @@ -1,96 +0,0 @@ -var app = angular.module('gophish', ['ngRoute', 'ngTable', 'ngResource', 'ui.bootstrap', 'highcharts-ng', 'angularFileUpload', 'ngCkeditor']); - -app.config(function($routeProvider) { - $routeProvider - - // route for the home page - .when('/', { - templateUrl: 'js/app/partials/dashboard.html', - controller: 'DashboardCtrl' - }) - - .when('/campaigns', { - templateUrl: 'js/app/partials/campaigns.html', - controller: 'CampaignCtrl' - }) - - .when('/campaigns/:id', { - templateUrl: 'js/app/partials/campaign_results.html', - controller: 'CampaignResultsCtrl' - }) - - .when('/users', { - templateUrl: 'js/app/partials/users.html', - controller: 'GroupCtrl' - }) - - .when('/templates', { - templateUrl: 'js/app/partials/templates.html', - controller: 'TemplateCtrl' - }) - - .when('/landing_pages', { - templateUrl: 'js/app/partials/landing_pages.html', - controller: 'LandingPageCtrl' - }) - - .when('/settings', { - templateUrl: 'js/app/partials/settings.html', - controller: 'SettingsCtrl' - }) -}); - -app.config( [ - '$compileProvider', - function( $compileProvider ) - { - $compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|ftp|mailto|data):/); - // Angular before v1.2 uses $compileProvider.urlSanitizationWhitelist(...) - } -]); - -app.filter('cut', function() { - return function(value, max, tail) { - if (!value) return ''; - max = parseInt(max, 10); - truncd = [] - for(var i=0; i < Math.min(value.length,max); i++) { - if (i == max-1) truncd.push("...") - else truncd.push(value[i].email); - } - return truncd; - }; -}); - -// Example provided by http://docs.angularjs.org/api/ng/type/ngModel.NgModelController -app.directive('contenteditable', function() { - return { - restrict: 'A', // only activate on element attribute - require: '?ngModel', // get a hold of NgModelCtrl - link: function(scope, element, attrs, ngModel) { - if (!ngModel) return; // do nothing if no ng-model - - // Specify how UI should be updated - ngModel.$render = function() { - element.html(ngModel.$viewValue || ''); - }; - - // Listen for change events to enable binding - element.on('blur keyup change', function() { - scope.$apply(read); - }); - - // Write data to the model - - function read() { - var html = element.html(); - // When we clear the content editable the browser leaves a
behind - // If strip-br attribute is provided then we strip this out - //if (attrs.stripBr && html == '
') { - // html = ''; - //} - ngModel.$setViewValue(html); - } - } - }; -});