server/src/main/webapp/WEB-INF/templates/renkanProjectEdit.html
changeset 54 43c35d6ca3f0
parent 51 3247fccfbd3f
child 58 87569ad0ff53
--- a/server/src/main/webapp/WEB-INF/templates/renkanProjectEdit.html	Mon Jan 14 16:00:07 2013 +0100
+++ b/server/src/main/webapp/WEB-INF/templates/renkanProjectEdit.html	Mon Feb 11 10:34:23 2013 +0100
@@ -17,18 +17,15 @@
         <script src="js/i18n.js" th:src="@{/static/js/i18n.js}"></script>
         <script src="js/models.js" th:src="@{/static/js/models.js}"></script>
         <script src="js/corenkan-json.js" th:src="@{/static/js/corenkan-json.js}"></script>
-        <!--script src="js/random-data.js" th:src="@{/static/js/random-data.js}"></script-->
         <script src="js/twitter-bin.js" th:src="@{/static/js/twitter-bin.js}"></script>
         <script src="js/wikipedia-bin.js" th:src="@{/static/js/wikipedia-bin.js}"></script>
         <script src="js/ldtjson-bin.js" th:src="@{/static/js/ldtjson-bin.js}"></script>
         <script src="js/paper-renderer.js" th:src="@{/static/js/paper-renderer.js}"></script>
         <script type="text/javascript" src="js/config.js" th:src="@{/static/js/config.js}"></script>
-        <script type="text/javascript" src="lib/dojo/dojo.js" data-dojo-config="isDebug: true, parseOnLoad: true" th:src="@{/static/lib/dojo/dojo.js}"></script>        
+        <script type="text/javascript" src="lib/dojo/dojo.js" data-dojo-config="isDebug: true, parseOnLoad: true" th:src="@{/static/lib/dojo/dojo.js}"></script>                
         <script type="text/javascript" th:inline="javascript">
-            var _proj;
-            require(["corenkan"], function(corenkan) {            
-              $(function() {
-                _renkan = new Rkns.Renkan({
+            $(function() {
+                var _renkan = new Rkns.Renkan({
                     url: /*[[@{/rest/projects/}+${project.id}]]*/ "data/simple-persist.php",
                     static_url : /*[[@{/static/}]]*/ "",
                     bins: [
@@ -71,17 +68,24 @@
                         }
                     ],
                 });
-                corenkan.app.onStatusChange = function(status) {
-                	if(status == "ready") {
-                        Rkns.jsonIO(_renkan, {
-                            url: /*[[@{/rest/projects/}+${project.id}]]*/ "data/simple-persist.php",
-                            callback: function(_proj, _renkan) {
-                            	corenkan.app.setObjects(_renkan);
-                            }
-                        });
-                	}
-                };
-              });
+                var corenkanConfig = {
+        	        projectId: /*[[${project.id}]]*/"new_project",
+        	        renkan : _renkan
+        	    };
+
+                require({corenkanConfig: corenkanConfig}, ["corenkan"], function(corenkan) {            
+                    corenkan.app.onStatusChange = function(status) {
+                    	if(status == "ready") {
+                    		_renkan.renderer.autoScale();
+                            /*Rkns.jsonIO(_renkan, {*/
+                                /*url: *//*[[@{/rest/projects/}+${project.id}]]*/ /*"data/simple-persist.php",*/
+                                //callback: function(_proj, _renkan) {
+                               // 	corenkan.app.setObjects(_renkan);
+                              // }
+                            //});
+                    	}
+                    };
+                });
             });
         </script>
         <link rel="stylesheet" href="css/renkan.css" th:href="@{/static/css/renkan.css}"/>