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.70 share/views/public/js/rbbt.entity_map.js
rbbt-rest-1.8.69 share/views/public/js/rbbt.entity_map.js
rbbt-rest-1.8.68 share/views/public/js/rbbt.entity_map.js
rbbt-rest-1.8.67 share/views/public/js/rbbt.entity_map.js
rbbt-rest-1.8.66 share/views/public/js/rbbt.entity_map.js
rbbt-rest-1.8.65 share/views/public/js/rbbt.entity_map.js
rbbt-rest-1.8.64 share/views/public/js/rbbt.entity_map.js
rbbt-rest-1.8.63 share/views/public/js/rbbt.entity_map.js
rbbt-rest-1.8.62 share/views/public/js/rbbt.entity_map.js
rbbt-rest-1.8.61 share/views/public/js/rbbt.entity_map.js
rbbt-rest-1.8.60 share/views/public/js/rbbt.entity_map.js
rbbt-rest-1.8.59 share/views/public/js/rbbt.entity_map.js
rbbt-rest-1.8.58 share/views/public/js/rbbt.entity_map.js
rbbt-rest-1.8.57 share/views/public/js/rbbt.entity_map.js
rbbt-rest-1.8.56 share/views/public/js/rbbt.entity_map.js
rbbt-rest-1.8.55 share/views/public/js/rbbt.entity_map.js
rbbt-rest-1.8.53 share/views/public/js/rbbt.entity_map.js
rbbt-rest-1.8.52 share/views/public/js/rbbt.entity_map.js
rbbt-rest-1.8.51 share/views/public/js/rbbt.entity_map.js
rbbt-rest-1.8.50 share/views/public/js/rbbt.entity_map.js