3 * Copyright(c) 2006-2010 Ext JS, LLC
5 * http://www.extjs.com/license
7 Imgorg.ImagePanel = Ext.extend(Ext.Panel,{
10 tagTpl: new Ext.XTemplate(
11 '<h3 class="image-prop-header">Tags</h3>',
13 '<div class="image-prop">{text}</div>',
16 albumTpl: new Ext.XTemplate(
17 '<h3 class="image-prop-header">Album</h3>',
19 '<div class="image-prop">{text}</div>',
22 infoTpl: new Ext.XTemplate(
23 '<h3 class="image-prop-header">File Info</h3>',
24 '<div class="image-prop">Filename: {FileName}</div>',
25 '<div class="image-prop">Size: {FileSize:fileSize}</div>',
26 '<div class="image-prop">Height: {[values["COMPUTED"].Height]}</div>',
27 '<div class="image-prop">Width: {[values["COMPUTED"].Width]}</div>'
29 initComponent: function() {
35 html: '<div style="text-align:center;"><img src="'+this.url+'"/></div>',
40 itemId: 'image-properties',
44 style: 'border-left: 1px solid #99BBE8'
47 Imgorg.ImagePanel.superclass.initComponent.call(this);
50 afterRender: function() {
51 Imgorg.ImagePanel.superclass.afterRender.call(this);
52 Imgorg.ss.Images.getInfo({image: this.imageData.id}, this.onGetInfo, this);
53 Imgorg.ss.Albums.getAlbums({image: this.imageData.id}, this.onGetAlbums,this);
54 Imgorg.ss.Tags.getTags({image: this.imageData.id}, this.onGetTags, this);
57 onGetInfo: function(data, resp) {
58 var prop = this.getComponent('image-properties');
59 this.infoTpl.append(prop.body, data)
62 onGetTags: function(data, resp) {
63 var prop = this.getComponent('image-properties');
64 this.tagTpl.append(prop.body, data);
67 onGetAlbums: function(data, resp) {
68 var prop = this.getComponent('image-properties');
69 this.albumTpl.append(prop.body, data);
72 Ext.reg('img-panel',Imgorg.ImagePanel);