angularjs 1.2.0 upgrade

This commit is contained in:
Athou
2013-11-12 09:43:36 +01:00
parent c01c1e93f9
commit 32325bb49c
14 changed files with 259 additions and 213 deletions

View File

@@ -1551,11 +1551,13 @@ module.controller('HelpController', ['$scope', 'CategoryService', 'AnalyticsServ
}]);
module.controller('FooterController', ['$scope', function($scope) {
module.controller('FooterController', ['$scope', '$sce', function($scope, $sce) {
var baseUrl = window.location.href.substring(0, window.location.href.lastIndexOf('#'));
var hostname = window.location.hostname;
$scope.subToMeUrl = baseUrl + 'rest/feed/subscribe?url={feed}';
$scope.subToMeName = hostname.indexOf('www.commafeed.com') !== -1 ? 'CommaFeed' : 'CommaFeed (' + hostname + ')';
var url = baseUrl + 'rest/feed/subscribe?url={feed}';
var name = hostname.indexOf('www.commafeed.com') !== -1 ? 'CommaFeed' : 'CommaFeed (' + hostname + ')';
var subToMeUrl = 'https://www.subtome.com/register-no-ui.html?name=' + name + '&url=' + url;
$scope.subToMeUrl = $sce.trustAsResourceUrl(subToMeUrl);
}]);

View File

@@ -22,6 +22,12 @@ module.filter('escape', function() {
return encodeURIComponent;
});
module.filter('unsafe', ['$sce', function($sce) {
return function(val) {
return $sce.trustAsHtml(val);
};
}]);
module.filter('highlight', function() {
return function(html, keywords) {
if (keywords) {
@@ -39,7 +45,7 @@ module.filter('highlight', function() {
};
var tokens = keywords.split(' ');
for ( var i = 0; i < tokens.length; i++) {
for (var i = 0; i < tokens.length; i++) {
html = handleKeyword(tokens[i], html);
}
}

View File

@@ -1,10 +1,10 @@
var app = angular.module('commafeed', ['ui.utils', 'ui.bootstrap', 'ui.state', 'ui.select2', 'commafeed.directives', 'commafeed.controllers',
var app = angular.module('commafeed', ['ngRoute', 'ui.utils', 'ui.bootstrap', 'ui.router', 'ui.select2', 'commafeed.directives', 'commafeed.controllers',
'commafeed.services', 'commafeed.filters', 'ngSanitize', 'infinite-scroll', 'ngGrid']);
app.config(['$routeProvider', '$stateProvider', '$urlRouterProvider', '$httpProvider', '$compileProvider',
function($routeProvider, $stateProvider, $urlRouterProvider, $httpProvider, $compileProvider) {
$compileProvider.urlSanitizationWhitelist(/^\s*(https?|ftp|mailto|javascript):/);
$compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|ftp|mailto|javascript):/);
var interceptor = ['$rootScope', '$q', function(scope, $q) {
var success = function(response) {