Remoto - VFS: staticHtml.js Source File
Remoto - VFS
staticHtml.js
Go to the documentation of this file.
1 
2 define( [
3  'remoto!stdlib:js/panes/pane.js',
4  ],
5  function(pane)
6  {
7  'use strict';
8 
29  staticHtml.prototype = new pane;
30  function staticHtml(layout)
31  {
32  pane.call(this,layout);
33 
34  this._keepType = true;
35  this._saveFields.keepType = "_keepType";
36 
37  this._rawContent = layout.content || null;
38  this._saveFields.content = "_rawContent";
39 
40  this._type = 'staticHtml';
41  }
42 
53  staticHtml.prototype.createHTML = function()
54  {
55  if (this._html) return this._html;
56 
57  pane.prototype.createHTML.call(this);
58 
59  if (this._rawContent)
60  this._content.html(this._rawContent);
61  else
62  this._content.html(" ");
63 
64  //console.log("RAW: "+this._rawContent);
65 
66  //var THIS = this;
67  //requestAnimationFrame( function() {
68  // THIS._content.trigger("paneLoadStart");
69  // requestAnimationFrame( function() {
70  // THIS._content.trigger("paneLoadComplete");
71  // } );
72  //} );
73 
74  return this._html;
75  }
76 
87  staticHtml.prototype.applyDiff = function(diff,user)
88  {
89  //console.log("staticHtml applyDiff");
90 
91  if (diff.content)
92  {
93  this._content.empty();
94  this._rawContent = diff.content; //may be null!
95 
96  if (diff.content === null)
97  {
98  //already cleared
99  this._content.html(" ");
100  }
101  else
102  {
103  this._content.html(this._rawContent);
104  }
105  }
106  }
107 
117  staticHtml.prototype.applySettings = function(settings)
118  {
119  }
120 
129  staticHtml.prototype.attach = function()
130  {
131  }
132 
139  staticHtml.prototype.destroy = function()
140  {
141  this._rawContent = null;
142  this._content.empty();
143 
144  pane.prototype.destroy.call(this);
145  }
146 
147  return staticHtml;
148  }
149 );
150 
setter user
a setter DOCME
Create a pane which will be mounted into a paneManager layout.
destroy()
DOCME.
createHTML()
pane(layout, object)
Insert raw html into a pane.
applySettings(settings)
attach()
This node has been attached to the DOM.
staticHtml(layout)
applyDiff(diff, user)
Apply a diff to this pane.
destroy()
Destroy the content html and call the base destructor.
createHTML()
Create the html representation of this pane, and store that DOM element as this._html.