Skip to content

Commit

Permalink
Merge pull request #858 from superdesk/devel
Browse files Browse the repository at this point in the history
Devel
  • Loading branch information
nistormihai committed Sep 9, 2014
2 parents f4cd6f6 + d3afbc9 commit c88aaa8
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,27 @@ define([
'jquery',
'angular',
config.guiJs('livedesk', 'authorization'),
],function($, angular, auth){
'interceptor'
],function($, angular, auth, interceptor){
var angularHeaders = $.extend({}, auth, { 'Content-Type': 'text/json' });
var feeds = angular.module('manageFeeds',[]);
feeds.config(['$interpolateProvider', function($interpolateProvider) {
$interpolateProvider.startSymbol('{{ ');
$interpolateProvider.endSymbol(' }}');
}]);
feeds.run(function($http){
var authObject = {
'Authorization': localStorage.getItem('superdesk.login.session')
}
var angularHeaders = $.extend({}, authObject, { 'Content-Type': 'text/json' });
$http.defaults.headers.get = authObject;
$http.defaults.headers.post = angularHeaders;
$http.defaults.headers.put = angularHeaders;
$http.defaults.headers.delete = authObject;
});
feeds.config(function($httpProvider){
delete $httpProvider.defaults.headers.common['X-Requested-With'];
$httpProvider.defaults.headers.get = auth;
$httpProvider.defaults.headers.post = angularHeaders;
$httpProvider.defaults.headers.delete = auth;
$httpProvider.defaults.headers.put = angularHeaders;
$httpProvider.interceptors.push(interceptor);
});
return feeds;
});
25 changes: 16 additions & 9 deletions plugins/livedesk/gui-resources/scripts/js/seo-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,35 @@ define([
'jquery',
'angular',
'gizmo/superdesk',
config.guiJs('livedesk', 'authorization')
], function($, angular, Gizmo, auth){
config.guiJs('livedesk', 'authorization'),
'interceptor'
], function($, angular, Gizmo, auth, interceptor){
function getGizmoUrl(path) {
var url = new Gizmo.Url(path);
return url.get();
}
function relativeToAbsolute(rel) {
return window.location.protocol + '//' + window.location.host + rel;
}
var angularHeaders = $.extend({}, auth, { 'Content-Type': 'text/json' });
var seoconf = angular.module('seoConf',[]);
seoconf.config(['$interpolateProvider', function($interpolateProvider) {
$interpolateProvider.startSymbol('{{ ');
$interpolateProvider.endSymbol(' }}');
}]);
seoconf.config(function($httpProvider){
seoconf.run(function($http){
var authObject = {
'Authorization': localStorage.getItem('superdesk.login.session')
}
var angularHeaders = $.extend({}, authObject, { 'Content-Type': 'text/json' });
$http.defaults.headers.get = authObject;
$http.defaults.headers.post = angularHeaders;
$http.defaults.headers.put = angularHeaders;
$http.defaults.headers.delete = authObject;
});
seoconf.config(['$httpProvider', function($httpProvider){
delete $httpProvider.defaults.headers.common['X-Requested-With'];
$httpProvider.defaults.headers.get = auth;
$httpProvider.defaults.headers.post = angularHeaders;
$httpProvider.defaults.headers.put = angularHeaders;
$httpProvider.defaults.headers.delete = auth;
});
$httpProvider.interceptors.push(interceptor);
}]);

seoconf.factory('seoInterfaceData', ['$http', '$q', function($http, $q){
return {
Expand Down

0 comments on commit c88aaa8

Please sign in to comment.