Sha256: 48b7f4bfb89b264cbe876991b07cb5d983d99c2f733daa6b95029c1956bdcef8

Contents?: true

Size: 1.17 KB

Versions: 101

Compression:

Stored size: 1.17 KB

Contents

var EntityMap = function(data){
 this.id = data.id
 this.name = data.id
 this.type = data.type
 this.column = data.column

 this.full_type = function(){
  return this.type
 }

 this.url = function(){
  var url = "/entity_map/" + this.full_type() + "/" + clean_element(this.column) + "/" + clean_element(this.id)
  return url
 }

 this.get = function(){ 
  var url = this.url()
  url = add_parameter(url, '_format', 'json')
  return m.request({url: url, method: 'GET'})
 }
}

var FavouriteMaps = function(by_type){
 for (type in by_type){
  this[type] = by_type[type]
 }
}

FavouriteMaps.get = function(){
  return m.request({method: 'GET', url: '/favourite_entity_maps', type: FavouriteMaps, deserialize: FavouriteMaps.deserialize})
}

FavouriteMaps.deserialize = function(data){
  data = JSON.parse(data)
  favourite_maps = {}

  forHash(data, function(type, type_data){
    favourite_maps[type] = {}
    forHash(type_data, function(column, column_data){
      forArray(column_data, function(id){
        var info = {}
        info.id = id
        info.column = column
        info.type = type
        favourite_maps[type][id] = new EntityMap(info)
      })
    })
  })
  return favourite_maps
} 


Version data entries

101 entries across 101 versions & 1 rubygems

Version Path
rbbt-rest-1.8.6 share/views/public/js/rbbt.entity_map.js
rbbt-rest-1.8.5 share/views/public/js/rbbt.entity_map.js
rbbt-rest-1.8.4 share/views/public/js/rbbt.entity_map.js
rbbt-rest-1.8.3 share/views/public/js/rbbt.entity_map.js
rbbt-rest-1.8.2 share/views/public/js/rbbt.entity_map.js
rbbt-rest-1.8.1 share/views/public/js/rbbt.entity_map.js
rbbt-rest-1.8.0 share/views/public/js/rbbt.entity_map.js
rbbt-rest-1.7.20 share/views/public/js/rbbt.entity_map.js
rbbt-rest-1.7.19 share/views/public/js/rbbt.entity_map.js
rbbt-rest-1.7.18 share/views/public/js/rbbt.entity_map.js
rbbt-rest-1.7.17 share/views/public/js/rbbt.entity_map.js
rbbt-rest-1.7.16 share/views/public/js/rbbt.entity_map.js
rbbt-rest-1.7.15 share/views/public/js/rbbt.entity_map.js
rbbt-rest-1.7.14 share/views/public/js/rbbt.entity_map.js
rbbt-rest-1.7.13 share/views/public/js/rbbt.entity_map.js
rbbt-rest-1.7.12 share/views/public/js/rbbt.entity_map.js
rbbt-rest-1.7.11 share/views/public/js/rbbt.entity_map.js
rbbt-rest-1.7.10 share/views/public/js/rbbt.entity_map.js
rbbt-rest-1.7.9 share/views/public/js/rbbt.entity_map.js
rbbt-rest-1.7.8 share/views/public/js/rbbt.entity_map.js