10 add: function(resource) {
11 if (!this.has(resource)) {
12 this.pending.push(resource);
17 del: function(resource) {
18 if (this.has(resource)) {
19 this.pending.splice(index, 1);
23 has: function(resource) {
24 index = jQuery.inArray( resource, this.pending );
32 return this.pending.length;
36 localStorage.setItem('pending', JSON.stringify(this.pending));
40 this.pending = JSON.parse(localStorage.getItem('pending'));
47 $('div#loading').show();
50 setTimeout(function(){
51 $('div#loading').hide();
52 window.location.href = '/resources/' + this.slice + '?message=true';
57 // $.post("/rest/slice/", { 'fields': ['resource','slice_hrn'], 'filters': { 'slice_hrn' : this.slice } }, function(data) {
62 // if ('resource' in data[0]) {
63 // $.each(data[0].resource, function(idx, r) {
64 // resources.push(r.urn);
68 // console.log(myslice.pending);
69 // console.log(resources);
70 // $.each(resources.concat(myslice.pending), function(idx, v) {
71 // update.push({ 'resource': v });
73 // console.log(update);
74 // $.post("/update/slice/", { 'filters': { 'slice_hrn' : myslice.slice }, 'params' : update }, function(data) {
78 //console.log(this.slice);
83 $(document).ready(function() {
84 // Put the object into storage
85 //localStorage.setItem('testObject', JSON.stringify(testObject));
87 // Retrieve the object from storage