6 $.wiki.Perspective = function(options) {
9 this.doc = options.doc;
11 this.perspective_id = options.id;
14 this.perspective_id = '';
18 options.callback.call(this);
21 $.wiki.Perspective.prototype.config = function() {
22 return $.wiki.state.perspectives[this.perspective_id];
25 $.wiki.Perspective.prototype.toString = function() {
26 return this.perspective_id;
29 $.wiki.Perspective.prototype.dirty = function() {
33 $.wiki.Perspective.prototype.onEnter = function () {
34 // called when perspective in initialized
35 if (!this.noupdate_hash_onenter) {
36 document.location.hash = '#' + this.perspective_id;
40 $.wiki.Perspective.prototype.onExit = function () {
41 // called when user switches to another perspective
42 if (!this.noupdate_hash_onenter) {
43 document.location.hash = '';
47 $.wiki.Perspective.prototype.destroy = function() {
51 $.wiki.Perspective.prototype.freezeState = function () {
52 // free UI state (don't store data here)
55 $.wiki.Perspective.prototype.unfreezeState = function (frozenState) {