summaryrefslogtreecommitdiffabout
path: root/content
authorMichael Krelin <hacker@klever.net>2011-08-28 16:57:16 (UTC)
committer Michael Krelin <hacker@klever.net>2011-08-28 16:57:16 (UTC)
commit0d7604dd5ba76c31d7192ff37e0f6ae6f95945ac (patch) (unidiff)
tree8e496ae35eae9e4e09a8daef17d1bee9589dda61 /content
parent63b7d8b9cd7b4c4fd010a46bb2737a47d5afa65e (diff)
downloadfireflix-0d7604dd5ba76c31d7192ff37e0f6ae6f95945ac.zip
fireflix-0d7604dd5ba76c31d7192ff37e0f6ae6f95945ac.tar.gz
fireflix-0d7604dd5ba76c31d7192ff37e0f6ae6f95945ac.tar.bz2
more jsonifications
Signed-off-by: Michael Krelin <hacker@klever.net>
Diffstat (limited to 'content') (more/less context) (ignore whitespace changes)
-rw-r--r--content/fireflix.js32
1 files changed, 14 insertions, 18 deletions
diff --git a/content/fireflix.js b/content/fireflix.js
index 34cfd3e..f30daee 100644
--- a/content/fireflix.js
+++ b/content/fireflix.js
@@ -631,6 +631,6 @@ var fireflix = {
631 pset ); 631 pset );
632 if(pset.dirty) { 632 if(pset.dirty) {
633 var _this = this; 633 var that = this;
634 this.flickr.api_call( 634 this.flickr.api_call_json(
635 { 635 {
636 method: 'flickr.photosets.editMeta', 636 method: 'flickr.photosets.editMeta',
@@ -639,26 +639,22 @@ var fireflix = {
639 title: pset.title, 639 title: pset.title,
640 description: pset.description 640 description: pset.description
641 }, function(xr) { 641 }, function(x,j) {
642 pset.dirty = false; 642 pset.dirty = false;
643 _this.flickr.api_call( 643 that.flickr.api_call_json(
644 { 644 {
645 method: 'flickr.photosets.getPhotos', 645 method: 'flickr.photosets.getPhotos',
646 auth_token: 'default', 646 auth_token: 'default',
647 photoset_id: pset.id 647 photoset_id: pset.id
648 }, function(xr) { 648 }, function(x,j) {
649 var x = xr.responseXML; 649 var pp = j.photoset.photo;
650 var xp = x.evaluate(
651 '/rsp/photoset/photo', x, null,
652 XPathResult.ORDERED_NODE_ITERATOR_TYPE, null );
653 var phids = new Array(); 650 var phids = new Array();
654 var priph = null; 651 var priph = null;
655 var n; while(n=xp.iterateNext()) { 652 for(var i in pp) {
656 var pid = n.getAttribute('id'); 653 var pid = pp[i].id;
657 phids.push( pid ); 654 phids.push(pid);
658 if(pid==pset.primary && n.getAttribute('isprimary')!='1') 655 if(pid==pset.primary && pp[i].isprimary) priph = pid;
659 priph = pid;
660 } 656 }
661 if(priph) { 657 if(priph) {
662 _this.flickr.api_call( 658 that.flickr.api_call_json(
663 { 659 {
664 method: 'flickr.photosets.editPhotos', 660 method: 'flickr.photosets.editPhotos',
@@ -668,14 +664,14 @@ var fireflix = {
668 photo_ids: phids.join(',') 664 photo_ids: phids.join(',')
669 }, function() { }, function(x,s,c,m) { /* flickr.photosets.editPhotos */ 665 }, function() { }, function(x,s,c,m) { /* flickr.photosets.editPhotos */
670 _this.flickr_failure(x,s,c,m); 666 that.flickr_failure(x,s,c,m);
671 } 667 }
672 ); 668 );
673 } 669 }
674 }, function(x,s,c,m) { /* flickr.photosets.getPhotos */ 670 }, function(x,s,c,m) { /* flickr.photosets.getPhotos */
675 _this.flickr_failure(x,s,c,m); 671 that.flickr_failure(x,s,c,m);
676 } 672 }
677 ); 673 );
678 }, function(x,s,c,m) { /* flickr.photosets.editMeta */ 674 }, function(x,s,c,m) { /* flickr.photosets.editMeta */
679 _this.flickr_failure(x,s,c,m); 675 that.flickr_failure(x,s,c,m);
680 } 676 }
681 ); 677 );