summaryrefslogtreecommitdiffabout
path: root/content
authorMichael Krelin <hacker@klever.net>2006-09-30 18:27:38 (UTC)
committer Michael Krelin <hacker@klever.net>2006-09-30 18:27:38 (UTC)
commit01fbc99cb713a0c4656f33949b2949bf7403656b (patch) (side-by-side diff)
tree2ee9c07db4c6c7c329f97e56615672ca2fc3e462 /content
parent4f5e775ff24baf34b3425e93bfeac4a436b4b525 (diff)
downloadfireflix-01fbc99cb713a0c4656f33949b2949bf7403656b.zip
fireflix-01fbc99cb713a0c4656f33949b2949bf7403656b.tar.gz
fireflix-01fbc99cb713a0c4656f33949b2949bf7403656b.tar.bz2
more code beauty/performance enhancements
git-svn-id: http://svn.klever.net/kin/fireflix/trunk@171 fe716a7a-6dde-0310-88d9-d003556173a8
Diffstat (limited to 'content') (more/less context) (ignore whitespace changes)
-rw-r--r--content/photoset-props.js38
-rw-r--r--content/photoset-props.xul1
2 files changed, 18 insertions, 21 deletions
diff --git a/content/photoset-props.js b/content/photoset-props.js
index 43dc1b9..7c816be 100644
--- a/content/photoset-props.js
+++ b/content/photoset-props.js
@@ -6,4 +6,2 @@ var psetprops = {
- settitle: null, setdesc: null,
- primarypic: null,
photos: new Array(),
@@ -12,11 +10,11 @@ var psetprops = {
this.photoset = window.arguments[1];
- this.settitle = document.getElementById('set_title');
- this.settitle.value = this.photoset.title;
- this.setdesc = document.getElementById('set_desc');
- this.setdesc.value = this.photoset.description;
- this.primarypic = document.getElementById('primary_picture');
- this.primarypic.src =
+ pull_elements(this,document,[
+ 'set_title','set_desc','primary_picture',
+ 'primary_picture_list'
+ ]);
+ this.set_title.value = this.photoset.title;
+ this.set_desc.value = this.photoset.description;
+ this.primary_picture.src =
this.fireflix.flickr.get_image_url( this.photoset, 't' );
- this.primarypic.hidden = false;
- this.picslist = document.getElementById('primary_picture_list');
+ this.primary_picture.hidden = false;
@@ -33,3 +31,3 @@ var psetprops = {
XPathResult.ORDERED_NODE_ITERATOR_TYPE, null );
- _this.picslist.removeAllItems(); _this.photos= new Array();
+ _this.primary_picture_list.removeAllItems(); _this.photos= new Array();
var n; while(n=xp.iterateNext()) {
@@ -42,3 +40,3 @@ var psetprops = {
);
- var ni = _this.picslist.appendItem(
+ var ni = _this.primary_picture_list.appendItem(
n.getAttribute('title'), _this.photos.length-1
@@ -47,3 +45,3 @@ var psetprops = {
if(n.getAttribute('isprimary')==1) {
- _this.picslist.selectedItem = ni;
+ _this.primary_picture_list.selectedItem = ni;
_this.pripic = _this.photos[_this.photos.length-1];
@@ -51,3 +49,3 @@ var psetprops = {
}
- _this.picslist.hidden = false;
+ _this.primary_picture_list.hidden = false;
}, function() { }
@@ -57,6 +55,6 @@ var psetprops = {
var epic = ev.explicitOriginalTarget;
- this.picslist.selectedItem = epic;
- var pic = this.photos[this.picslist.selectedItem.value];
+ this.primary_picture_list.selectedItem = epic;
+ var pic = this.photos[this.primary_picture_list.selectedItem.value];
this.pripic = pic;
- this.primarypic.src =
+ this.primary_picture.src =
this.fireflix.flickr.get_photo_url(
@@ -69,6 +67,4 @@ var psetprops = {
on_accept: function() {
- this.photoset.title =
- document.getElementById('set_title').value;
- this.photoset.description =
- document.getElementById('set_desc').value;
+ this.photoset.title = this.set_title.value;
+ this.photoset.description = this.set_desc.value;
this.photoset.server = this.pripic.server;
diff --git a/content/photoset-props.xul b/content/photoset-props.xul
index e8f6d13..2efa9e6 100644
--- a/content/photoset-props.xul
+++ b/content/photoset-props.xul
@@ -14,2 +14,3 @@
+ <script src="util.js" type="application/x-javascript"/>
<script src="photoset-props.js" type="application/x-javascript"/>