annotate gis_gui/lib/blocks.js @ 263:3a10287447b1

Integration von Europeana4D UserInterface
author fknauft
date Thu, 01 Dec 2011 13:48:56 +0100
parents d6c7bedf4370
children 52b1247140b7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
63
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
1 /*
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
2 * fallback for console.log calls
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
3 */
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
4 if (typeof(console) == 'undefined') {
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
5 console = {
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
6 log : function(){},
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
7 debug : function(){},
65
2f477270cc0c adding layers to maps works now
casties
parents: 63
diff changeset
8 error : function(){}
2f477270cc0c adding layers to maps works now
casties
parents: 63
diff changeset
9 };
63
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
10 }
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
11
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
12 function defined(x) {
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
13 // returns if x is defined
68
49fb47bbe2e6 saving and loading maps
casties
parents: 65
diff changeset
14 return (typeof arguments[0] !== "undefined");
63
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
15 }
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
16
72
825a92d0ab10 fixed potential closure problem
casties
parents: 68
diff changeset
17 function randomString() {
825a92d0ab10 fixed potential closure problem
casties
parents: 68
diff changeset
18 var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
825a92d0ab10 fixed potential closure problem
casties
parents: 68
diff changeset
19 var string_length = 8;
825a92d0ab10 fixed potential closure problem
casties
parents: 68
diff changeset
20 var randomstring = '';
825a92d0ab10 fixed potential closure problem
casties
parents: 68
diff changeset
21 for (var i=0; i<string_length; i++) {
825a92d0ab10 fixed potential closure problem
casties
parents: 68
diff changeset
22 var rnum = Math.floor(Math.random() * chars.length);
825a92d0ab10 fixed potential closure problem
casties
parents: 68
diff changeset
23 randomstring += chars.substring(rnum,rnum+1);
825a92d0ab10 fixed potential closure problem
casties
parents: 68
diff changeset
24 }
825a92d0ab10 fixed potential closure problem
casties
parents: 68
diff changeset
25 return randomstring;
825a92d0ab10 fixed potential closure problem
casties
parents: 68
diff changeset
26 }
825a92d0ab10 fixed potential closure problem
casties
parents: 68
diff changeset
27
825a92d0ab10 fixed potential closure problem
casties
parents: 68
diff changeset
28
263
3a10287447b1 Integration von Europeana4D UserInterface
fknauft
parents: 253
diff changeset
29
63
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
30 /*
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
31 * guiBlocks base
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
32 */
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
33 function guiBlocks(container) {
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
34 // list of blocks
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
35 this.blocks = [];
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
36 this.containerElement = container;
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
37 return this;
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
38 }
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
39 //var guiBlocks = new Object();
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
40
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
41 /*
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
42 * Block base class
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
43 */
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
44 guiBlocks.Block = function(id, element) {
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
45 this.id = id; // the blocks html id
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
46 this.element = element; // the html dom element
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
47 this.storeId = null; // the id in online storage
65
2f477270cc0c adding layers to maps works now
casties
parents: 63
diff changeset
48 this.params = {}; // parameters to store
63
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
49 return this;
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
50 };
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
51
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
52 // create a new block and add it to the current workspaces stack
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
53 guiBlocks.prototype.addBlock = function(url, baseId, params, whenDone) {
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
54 // add title to url
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
55 var newblock = $("<div>Block loading...</div>");
68
49fb47bbe2e6 saving and loading maps
casties
parents: 65
diff changeset
56 var newid = baseId+"_"+randomString();
63
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
57 var container = this.containerElement;
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
58 console.debug("addblock newid="+newid);
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
59 newblock.hide();
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
60 newblock.load(url, function() {
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
61 // after load function
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
62 console.debug("addblock after load block");
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
63 console.debug(container);
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
64 $(this).find(".block").attr("id",newid);
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
65 $(this).appendTo(container);
253
d6c7bedf4370 New reload button active in upper right corner of block
fknauft
parents: 248
diff changeset
66
63
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
67 // chain done function
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
68 if (typeof(whenDone) == "function") {
72
825a92d0ab10 fixed potential closure problem
casties
parents: 68
diff changeset
69 // chain whenDone (should we add parameters?)
825a92d0ab10 fixed potential closure problem
casties
parents: 68
diff changeset
70 whenDone.apply(this);
63
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
71 } else {
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
72 // default after load function
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
73 $(this).fadeIn();
65
2f477270cc0c adding layers to maps works now
casties
parents: 63
diff changeset
74 }
63
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
75
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
76 });
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
77 // create new Block object
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
78 var block = new guiBlocks.Block(newid, newblock);
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
79 // add parameters
68
49fb47bbe2e6 saving and loading maps
casties
parents: 65
diff changeset
80 if (params == null) {
63
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
81 // create new params
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
82 params = {"id": newid};
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
83 }
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
84 block.params = params;
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
85 // add to list of blocks
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
86 this.blocks.push(block);
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
87 return block;
65
2f477270cc0c adding layers to maps works now
casties
parents: 63
diff changeset
88 };
63
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
89
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
90 guiBlocks.prototype.getBlock = function(id) {
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
91 for (b in this.blocks) {
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
92 if (b.id == id) {
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
93 return b;
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
94 }
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
95 }
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
96 return null;
65
2f477270cc0c adding layers to maps works now
casties
parents: 63
diff changeset
97 };
63
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
98
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
99 /*
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
100 guiBlocks.prototype.getStoreItem = function(tag,type,item) {
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
101 // get item from online storage
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
102 jQuery.get();
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
103 }
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
104 */
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
105
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
106 guiBlocks.prototype.loadListOfItems = function(storeTag,storeType,callback) {
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
107 // loads list of id and type objects and executes callback function
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
108 var url = "../db/RESTjson/db/public/gui_objects/"+escape(storeTag)+"/"+storeType+"?recursive=true";
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
109 jQuery.getJSON(url,callback);
65
2f477270cc0c adding layers to maps works now
casties
parents: 63
diff changeset
110 };
63
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
111
263
3a10287447b1 Integration von Europeana4D UserInterface
fknauft
parents: 253
diff changeset
112 guiBlocks.prototype.e4DOpen = function(titel,table){
3a10287447b1 Integration von Europeana4D UserInterface
fknauft
parents: 253
diff changeset
113 var e4D_URL="http://mappit.mpiwg-berlin.mpg.de:8080/e4D";
3a10287447b1 Integration von Europeana4D UserInterface
fknauft
parents: 253
diff changeset
114 var paramstr = "format=KML";
3a10287447b1 Integration von Europeana4D UserInterface
fknauft
parents: 253
diff changeset
115 // var layer_URL = "http://chinagis-develop.mpiwg-berlin.mpg.de:9080/db/RESTdb/db/public/" + escape(table) + "?" + paramstr;
3a10287447b1 Integration von Europeana4D UserInterface
fknauft
parents: 253
diff changeset
116 var layer_URL = "http://mappit.mpiwg-berlin.mpg.de/db/RESTdb/db/public/" + escape(table) + "?" + paramstr;
3a10287447b1 Integration von Europeana4D UserInterface
fknauft
parents: 253
diff changeset
117 var kml_URL = "";
3a10287447b1 Integration von Europeana4D UserInterface
fknauft
parents: 253
diff changeset
118 /* jQuery.get(layerurl, function (data, textStatus, XMLHttpRequest) {
3a10287447b1 Integration von Europeana4D UserInterface
fknauft
parents: 253
diff changeset
119 // function after load kml url finished
3a10287447b1 Integration von Europeana4D UserInterface
fknauft
parents: 253
diff changeset
120 console.debug("kml url loaded! this=", this );
3a10287447b1 Integration von Europeana4D UserInterface
fknauft
parents: 253
diff changeset
121 console.debug(" data=", data );
3a10287447b1 Integration von Europeana4D UserInterface
fknauft
parents: 253
diff changeset
122 console.debug(" data type=", typeof(data));
3a10287447b1 Integration von Europeana4D UserInterface
fknauft
parents: 253
diff changeset
123 if (typeof(data) == "string") {
3a10287447b1 Integration von Europeana4D UserInterface
fknauft
parents: 253
diff changeset
124 kml_URL = data;
3a10287447b1 Integration von Europeana4D UserInterface
fknauft
parents: 253
diff changeset
125 }*/
3a10287447b1 Integration von Europeana4D UserInterface
fknauft
parents: 253
diff changeset
126 e4D_URL=e4D_URL+"?kml1="+layer_URL+"&source1=1";
3a10287447b1 Integration von Europeana4D UserInterface
fknauft
parents: 253
diff changeset
127 console.debug(" e4D_URL=", e4D_URL );
3a10287447b1 Integration von Europeana4D UserInterface
fknauft
parents: 253
diff changeset
128 var newwindow=window.open(e4D_URL,"Mappit@Europeana4D","height=800,width=900");
3a10287447b1 Integration von Europeana4D UserInterface
fknauft
parents: 253
diff changeset
129 if (window.focus) {newwindow.focus();}
3a10287447b1 Integration von Europeana4D UserInterface
fknauft
parents: 253
diff changeset
130 return false;
3a10287447b1 Integration von Europeana4D UserInterface
fknauft
parents: 253
diff changeset
131 /* });*/
3a10287447b1 Integration von Europeana4D UserInterface
fknauft
parents: 253
diff changeset
132 };
63
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
133
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
134 guiBlocks.Block.prototype.storeBlock = function(storeTag) {
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
135 var storeType = this.params.type;
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
136 var storeItem = this.params.id;
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
137 var url = "../db/RESTjson/db/public/gui_objects/"+escape(storeTag)+"/"+storeType+"/"+storeItem;
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
138 var ds = JSON.stringify(this.params);
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
139 jQuery.ajax({
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
140 type: "PUT",
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
141 url: url,
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
142 data: ds,
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
143 success: function(msg){
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
144 console.debug("PUT success msg=",msg);
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
145 this.storeId = storeItem;
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
146 }
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
147 });
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
148 };
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
149
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
150
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
151
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
152 // collapse the block so that only its titlebar is visible
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
153 function foldBlock(segment){
72
825a92d0ab10 fixed potential closure problem
casties
parents: 68
diff changeset
154 if (segment == null) {
63
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
155 return;
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
156 }
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
157 if(segment.hasClass("folded")){
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
158 //if the segment is collapsed
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
159 segment.removeClass("folded");
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
160 segment.find(".body").slideDown();
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
161 } else{
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
162 //if the segment is expanded
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
163 segment.addClass("folded");
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
164 segment.find(".body").slideUp();
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
165 }
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
166 }
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
167
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
168 function switchSubscreens(container, id1, id2) {
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
169 var oldScreen = container.find("#"+id1);
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
170 var newScreen = container.find("#"+id2);
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
171
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
172 oldScreen.fadeOut();
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
173 newScreen.fadeIn();
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
174 }
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
175
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
176 function guiBlocks_init() {
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
177 // initialize collapsed windows
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
178 $("div.block.folded").each(function(e){
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
179 $(this).find(".body").slideUp();
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
180 });
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
181
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
182 // TitleBar Click
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
183 $("div.block div.titlebar h1").live("click", function(e) {
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
184 var segment = $(this).parents().filter("div.block");
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
185 foldBlock(segment);
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
186 });
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
187
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
188 // TitleBar Close
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
189 $("div.block div.titlebar div.close_button").live("click", function(e){
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
190 segment = $(this).parents().filter("div.block");
65
2f477270cc0c adding layers to maps works now
casties
parents: 63
diff changeset
191 segment.fadeOut(function(){ segment.remove();});
63
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
192 });
7f008e782563 add gui files to product via FileSystemSite
casties
parents:
diff changeset
193
248
fcb7876178d1 Reload-Button
fknauft
parents: 72
diff changeset
194 // TitleBar Reload
fcb7876178d1 Reload-Button
fknauft
parents: 72
diff changeset
195 $("div.block div.titlebar div.reload_button").live("click", function(e){
fcb7876178d1 Reload-Button
fknauft
parents: 72
diff changeset
196 segment = $(this).parents().filter("div.block");
fcb7876178d1 Reload-Button
fknauft
parents: 72
diff changeset
197 console.debug("guiBlocks_init().live(reload) segment[0].id="+ segment[0].id);
fcb7876178d1 Reload-Button
fknauft
parents: 72
diff changeset
198 //FJK: funktioniert leider noch nicht!
fcb7876178d1 Reload-Button
fknauft
parents: 72
diff changeset
199 // var blockid=$(this).parents().firstElementChild.id;
fcb7876178d1 Reload-Button
fknauft
parents: 72
diff changeset
200 // var mapblock=getBlock(blockid);
fcb7876178d1 Reload-Button
fknauft
parents: 72
diff changeset
201 // var params=mapblock.readMapParams();
fcb7876178d1 Reload-Button
fknauft
parents: 72
diff changeset
202 // var be = mapblock.element;
fcb7876178d1 Reload-Button
fknauft
parents: 72
diff changeset
203 //var mapblock = $(be).find(".map_box");
fcb7876178d1 Reload-Button
fknauft
parents: 72
diff changeset
204 // console.debug("guiBlocks_init().live(reload) params="+ new String(params));
fcb7876178d1 Reload-Button
fknauft
parents: 72
diff changeset
205 // mapblock.updateMap(be,params);
fcb7876178d1 Reload-Button
fknauft
parents: 72
diff changeset
206 });
fcb7876178d1 Reload-Button
fknauft
parents: 72
diff changeset
207
65
2f477270cc0c adding layers to maps works now
casties
parents: 63
diff changeset
208 }
248
fcb7876178d1 Reload-Button
fknauft
parents: 72
diff changeset
209
fcb7876178d1 Reload-Button
fknauft
parents: 72
diff changeset
210 function getBlock(id){
fcb7876178d1 Reload-Button
fknauft
parents: 72
diff changeset
211 for (b in this.blocks) {
fcb7876178d1 Reload-Button
fknauft
parents: 72
diff changeset
212 if (b.id == id) {
fcb7876178d1 Reload-Button
fknauft
parents: 72
diff changeset
213 return b;
fcb7876178d1 Reload-Button
fknauft
parents: 72
diff changeset
214 }
fcb7876178d1 Reload-Button
fknauft
parents: 72
diff changeset
215 }
fcb7876178d1 Reload-Button
fknauft
parents: 72
diff changeset
216 return null;
fcb7876178d1 Reload-Button
fknauft
parents: 72
diff changeset
217 }