<commit_before>/*   Riassence Framework
 *   Copyright 2009 Riassence Inc.
 *   http://riassence.com/
 *
 *   You should have received a copy of the GNU General Public License along
 *   with this software package. If not, contact <EMAIL>
 */


/*** Constructs nodes from JSON structures as GUI
  ** tree structures. Lowers the learning curve of GUI
  ** development, because Javascript knowledge is not
  ** required to define user interfaces.
  ** The main purpose is to ease the development of
  ** user interfaces by defining them as data on the
  ** server, converting the data to JSON GUI trees and
  ** letting the client handle the rest. The end result
  ** is the same as defining the structures in
  ** JavaScript code.
  **
  ** This class is still in development, so expect more
  ** features and documentation as it matures.
***/
COMM.JSONRenderer = HClass.extend({
  
  version: 0.5,

/** = Description
  * Renders JSON structured data, see some of the demos for usage examples.
  *
  * = Parameters:
  * +_data+:   The data structure used for building.
  * +_parent+: The parent view (or app) (Optional)
  **/
  constructor: function(_data, _parent){
    if((_data['type'] === 'GUITree') && (this.version >= _data['version'])){
      this.data   = _data;
      this.parent = _parent;
      this.render();
    }
    else{
      throw("JSONRenderer: Only GUITree version "+this.version+" or older data can be handled.");
    }
  },
  render: function(){
    this.scopes = [window];
    this.scopeDepth = 0;
    this.view = this.renderNode( this.data, this.parent );
  },
  defineInScope: function( _definition ){
    console.log('definedInScope(',_definition,')');
    var _isArr = (_definition instanceof Array),
        _isObj = (_definition instanceof Object);
    if( _isArr || !_isObj ){
      console.log("JSONRenderer; definition must be an Object, got: '"+(typeof _definition)+"'. Definition: ",_definition);
      return;
    }
    var _extension = {},
        _reserved = ['class','extend','implement'],
        _className = _definition[_reserved[0]],
        _extendName = _definition[_reserved[1]],
        _implementName = _definition[_reserved[2]],
        _extend = _extendName?this.findInScope(_extendName):false,
        _implement = _implementName?this.findInScope(_implementName):false,<commit_msg>Removed debug message.<commit_after>/*   Riassence Framework
 *   Copyright 2009 Riassence Inc.
 *   http://riassence.com/
 *
 *   You should have received a copy of the GNU General Public License along
 *   with this software package. If not, contact <EMAIL>
 */


/*** Constructs nodes from JSON structures as GUI
  ** tree structures. Lowers the learning curve of GUI
  ** development, because Javascript knowledge is not
  ** required to define user interfaces.
  ** The main purpose is to ease the development of
  ** user interfaces by defining them as data on the
  ** server, converting the data to JSON GUI trees and
  ** letting the client handle the rest. The end result
  ** is the same as defining the structures in
  ** JavaScript code.
  **
  ** This class is still in development, so expect more
  ** features and documentation as it matures.
***/
COMM.JSONRenderer = HClass.extend({
  
  version: 0.5,

/** = Description
  * Renders JSON structured data, see some of the demos for usage examples.
  *
  * = Parameters:
  * +_data+:   The data structure used for building.
  * +_parent+: The parent view (or app) (Optional)
  **/
  constructor: function(_data, _parent){
    if((_data['type'] === 'GUITree') && (this.version >= _data['version'])){
      this.data   = _data;
      this.parent = _parent;
      this.render();
    }
    else{
      throw("JSONRenderer: Only GUITree version "+this.version+" or older data can be handled.");
    }
  },
  render: function(){
    this.scopes = [window];
    this.scopeDepth = 0;
    this.view = this.renderNode( this.data, this.parent );
  },
  defineInScope: function( _definition ){
    var _isArr = (_definition instanceof Array),
        _isObj = (_definition instanceof Object);
    if( _isArr || !_isObj ){
      console.log("JSONRenderer; definition must be an Object, got: '"+(typeof _definition)+"'. Definition: ",_definition);
      return;
    }
    var _extension = {},
        _reserved = ['class','extend','implement'],
        _className = _definition[_reserved[0]],
        _extendName = _definition[_reserved[1]],
        _implementName = _definition[_reserved[2]],
        _extend = _extendName?this.findInScope(_extendName):false,
        _implement = _implementName?this.findInScope(_implementName):false,
{'fraction_non_alphanumeric': 0.11760883690708251, 'fraction_numerical': 0.004331817197314273, 'mean_word_length': 3.3402255639097747, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6335464', 'n_tokens_mistral': 1334, 'n_tokens_neox': 1297, 'n_words': 448}