js.revisions.js Maven / Gradle / Ivy
/*
* Copyright (C) 2011 Red Hat, Inc. ([email protected])
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
indyAddons.factory('StoreChangelogSvc', ['$resource', function($resource){
return {
resource: $resource(appPath('/api/revisions/changelog/store/:type/:name'), {}, {
list: {
method:'GET',
params:{type: '', name:''},
isArray:false
},
}),
viewStorePath: function(type, name){
return '/revisions/changelog/store/' + type + '/' + name;
},
};
}]);
indyAddons.controller('StoreChangelogCtl', ['$scope', '$location', '$q', 'StoreChangelogSvc', 'AllEndpointsSvc', 'StoreUtilSvc',
function($scope, $location, $q, StoreChangelogSvc, AllEndpointsSvc, StoreUtilSvc) {
var tz = -1 * (new Date().getTimezoneOffset() / 60);
var tzLabel = 'GMT';
if ( tz < 0 ){
tzLabel += tz;
}
else if ( tz > 0 ){
tzLabel += '+' + tz;
}
$scope.form = {
key: '',
timezone: tzLabel,
start: 0,
count: 10,
};
$scope.loadEndpoints = function(){
var deferred = $q.defer();
$scope.form.available = [];
console.log( "Loading endpoint listing");
AllEndpointsSvc.resource.query().$promise.then(function(listing){
for(var i=0; i 0 ){
console.log( "Formatting " + listing.items.length + " entries.");
for(var i=0; i