3 <title>The source code</title>
\r
4 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
\r
5 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
\r
7 <body onload="prettyPrint();">
\r
8 <pre class="prettyprint lang-js">Imgorg.ImagePanel = Ext.extend(Ext.Panel,{
11 tagTpl: new Ext.XTemplate(
12 '<h3 class="image-prop-header">Tags</h3>',
14 '<div class="image-prop">{text}</div>',
17 albumTpl: new Ext.XTemplate(
18 '<h3 class="image-prop-header">Album</h3>',
20 '<div class="image-prop">{text}</div>',
23 infoTpl: new Ext.XTemplate(
24 '<h3 class="image-prop-header">File Info</h3>',
25 '<div class="image-prop">Filename: {FileName}</div>',
26 '<div class="image-prop">Size: {FileSize:fileSize}</div>',
27 '<div class="image-prop">Height: {[values["COMPUTED"].Height]}</div>',
28 '<div class="image-prop">Width: {[values["COMPUTED"].Width]}</div>'
30 initComponent: function() {
36 html: '<div style="text-align:center;"><img src="'+this.url+'"/></div>',
41 itemId: 'image-properties',
45 style: 'border-left: 1px solid #99BBE8'
48 Imgorg.ImagePanel.superclass.initComponent.call(this);
51 afterRender: function() {
52 Imgorg.ImagePanel.superclass.afterRender.call(this);
53 Imgorg.ss.Images.getInfo({image: this.imageData.id}, this.onGetInfo, this);
54 Imgorg.ss.Albums.getAlbums({image: this.imageData.id}, this.onGetAlbums,this);
55 Imgorg.ss.Tags.getTags({image: this.imageData.id}, this.onGetTags, this);
58 onGetInfo: function(data, resp) {
59 var prop = this.getComponent('image-properties');
60 this.infoTpl.append(prop.body, data)
63 onGetTags: function(data, resp) {
64 var prop = this.getComponent('image-properties');
65 this.tagTpl.append(prop.body, data);
68 onGetAlbums: function(data, resp) {
69 var prop = this.getComponent('image-properties');
70 this.albumTpl.append(prop.body, data);
73 Ext.reg('img-panel',Imgorg.ImagePanel);