server/src/main/webapp/WEB-INF/templates/renkanProjectEdit.html
author ymh <ymh.work@gmail.com>
Thu, 14 Mar 2013 00:29:09 +0100
changeset 77 4f2511a70880
parent 59 69924ca1b233
child 80 5295e118320b
permissions -rw-r--r--
add bin config from spaces. Add size to nodes.

<!DOCTYPE html>
<html lang="fr" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" >
    <head>
        <meta charset="utf-8" />
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
        <title>RENKAN</title>
        <meta name="description" content="" />
        <meta name="author" content="Institut de Recherche et d'Innovation" />
        <link rel="icon" href="favicon.ico" th:href="@{/static/img/favicon.ico}" type="image/x-icon" />
        <script src="lib/jquery.min.js" th:src="@{/static/lib/jquery.min.js}" ></script>
        <script src="lib/jquery.mousewheel.min.js" th:src="@{/static/lib/jquery.mousewheel.min.js}"></script>
        <script src="lib/underscore-min.js" th:src="@{/static/lib/underscore-min.js}"></script>
        <script src="lib/backbone.js" th:src="@{/static/lib/backbone.js}"></script>
        <script src="lib/backbone-relational.js" th:src="@{/static/lib/backbone-relational.js}"></script>
        <script src="lib/paper.js" th:src="@{/static/lib/paper.js}"></script>
        <script src="js/main.js" th:src="@{/static/js/main.js}"></script>
        <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/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/list-bin.js" th:src="@{/static/js/list-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" th:inline="javascript">
            $(function() {
            	var renkan_config = {
                    url: /*[[@{/rest/projects/}+${project.id}]]*/ "data/simple-persist.php",
                    static_url : /*[[@{/static/}]]*/ "",
                    bins: [
                        {
                            bin: Rkns.Wikipedia.Bin,
                            lang: "en",
                            search: "Digital Humanities"
                        },
                        {
                            bin: Rkns.Wikipedia.Bin,
                            lang: "ja",
                            search: "Digital Humanities"
                        },
                        {
                            bin: Rkns.Twitter.Bin,
                            search: "Digital Humanities"
                        },
                        {
                            title: "LDT Project",
                            bin: Rkns.Ldt.ProjectBin,
                            project_id: "67280b1c-ff30-11e0-a82d-00145ea49a02",
                            ldt_platform: "http://ldt.iri.centrepompidou.fr/"
                        }
                    ],
                    search: [
                        {
                            type: Rkns.Wikipedia.Search,
                            lang: "fr"
                        }, 
                        {
                            type: Rkns.Wikipedia.Search,
                            lang: "en"
                        }, 
                        {
                            type: Rkns.Wikipedia.Search,
                            lang: "ja"
                        },
                        {
                            type: Rkns.Twitter.Search
                        }
                    ],
                };
            	var space_config = /*[[${space.binConfig}?${space.binConfig}:'{}']]*/"{}";
            	space_config = JSON.parse(space_config);
            	for ( var i in (('bins' in space_config)?space_config.bins:[])) {
					var bin_def = space_config.bins[i];
            		bin_def.bin = eval(bin_def.bin);
				}
                for ( var i in (('search' in space_config)?space_config.search:[])) {
                    var search_def = space_config.search[i];
                	search_def.type = eval(bin_def.type);
                }
                var _renkan = new Rkns.Renkan($.extend({}, renkan_config, space_config));
                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();
                    	}
                    };
                });
            });
        </script>
        <link rel="stylesheet" href="css/renkan.css" th:href="@{/static/css/renkan.css}"/>
        <style type="text/css">
        </style>
    </head>

    <body>
        <div id="renkan"></div>
    </body>
</html>