Sha256: 3757dc5cbd183c45b2a7efcd0e569c4045717efc86c0f4ddc217acbfdda0367d

Contents?: true

Size: 1.3 KB

Versions: 1

Compression:

Stored size: 1.3 KB

Contents

Ext.ns('Rwiki.Data');

/**
 * Transfer object used in Rwiki events handlers
 * @param data
 */
Rwiki.Data.Page = function(data) {
  this._data = data;
};

Rwiki.Data.Page.prototype = {

  /**
   * Returns data binded by ajax event handler
   */
  getData: function() {
    return this._data;
  },

  /**
   * Returns node's html content
   */
  getHtmlContent: function() {
    return this._data.htmlContent;
  },

  /**
  * Returns node's html table of content
  */
  getHtmlToc: function() {
    return this._data.htmlToc;
  },

  /**
   * Returns node's raw content
   */
  getRawContent: function() {
    return this._data.rawContent;
  },

  /**
   * Return node's path
   */
  getPath: function() {
    return this._data.path;
  },

  /**
   * Sets the new page path.
   * @param path
   */
  setPath: function(path) {
    this._data.path = path;
  },

  /**
   * Returns node's parent path
   */
  getParentPath: function() {
    var paths = this.getPath().split('/');
    paths.pop();

    return paths.join('/');
  },

  /**
   * Returns node's file name
   */
  getBaseName: function() {
    var path = this.getPath();
    if (path) {
      return path.split('/').pop();
    }
  },

  /**
   * Returns node's title displayed on tree panel or tab panel
   */
  getTitle: function() {
    return this.getBaseName();
  }

};

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rwiki-0.2.5 public/javascripts/Rwiki/Data/Page.js