# HG changeset patch # User rougeronj # Date 1429370067 -7200 # Node ID 22393cbf44679f156cabfb0e9a2bb0699ac045e3 # Parent 4f458e6d32bd909023ecda6dd0c920a8bd21d8c2 export the templates of nodeeditor to html files diff -r 4f458e6d32bd -r 22393cbf4467 client/js/renderer/nodeeditor.js --- a/client/js/renderer/nodeeditor.js Sat Apr 18 16:56:37 2015 +0200 +++ b/client/js/renderer/nodeeditor.js Sat Apr 18 17:14:27 2015 +0200 @@ -9,36 +9,11 @@ var NodeEditor = Utils.inherit(BaseEditor); _(NodeEditor.prototype).extend({ - template: _.template( - '

×<%-renkan.translate("Edit Node")%>

' + - '

' + - '<% if (options.show_node_editor_uri) { %>

<% } %>' + - '<% if (options.show_node_editor_description) { %>

<% } %>' + - '<% if (options.show_node_editor_size) { %>

<%-renkan.translate("Size:")%>-<%-node.size%>+

<% } %>' + - '<% if (options.show_node_editor_color) { %>
<%-renkan.translate("Node color:")%>
' + - '<%= renkan.colorPicker %><%- renkan.translate("Choose color") %>
<% } %>' + - '<% if (options.show_node_editor_image) { %>
' + - '<% if (node.clip_path) { %><% }%>' + - '

' + - '<% if (options.allow_image_upload) { %>

<% }%><% } %>' + - '<% if (options.show_node_editor_creator && node.has_creator) { %>

<%-renkan.translate("Created by:")%> <%- shortenText(node.created_by_title, 25) %>

<% } %>' + - '<% if (options.change_shapes) { %>

<% } %>' - ), - readOnlyTemplate: _.template( - '

×<% if (options.show_node_tooltip_color) { %><% } %>' + - '<% if (node.uri) { %><% } %><%-node.title%><% if (node.uri) { %><% } %>

' + - '<% if (node.uri && options.show_node_tooltip_uri) { %>

<%-node.short_uri%>

<% } %>' + - '<% if (options.show_node_tooltip_description) { %>

<%-node.description%>

<% } %>' + - '<% if (node.image && options.show_node_tooltip_image) { %><% } %>' + - '<% if (node.has_creator && options.show_node_tooltip_creator) { %>

<%-renkan.translate("Created by:")%><%- shortenText(node.created_by_title, 25) %>

<% } %>' - ), + _init: function() { + BaseEditor.prototype._init.apply(this); + this.template = this.options.templates['templates/nodeeditor.html']; + this.readOnlyTemplate = this.options.templates['templates/nodeeditor_readonly.html']; + }, draw: function() { var _model = this.source_representation.model, _created_by = _model.get("created_by") || Utils._USER_PLACEHOLDER(this.renkan), diff -r 4f458e6d32bd -r 22393cbf4467 client/templates/nodeeditor.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/templates/nodeeditor.html Sat Apr 18 17:14:27 2015 +0200 @@ -0,0 +1,91 @@ +

+ ×<%-renkan.translate("Edit Node")%> +

+

+ + +

+<% if (options.show_node_editor_uri) { %> +

+ + + +

+<% } %> <% if (options.show_node_editor_description) { %> +

+ + +

+<% } %> <% if (options.show_node_editor_size) { %> +

+ <%-renkan.translate("Size:")%> + - + <%-node.size%> + + +

+<% } %> <% if (options.show_node_editor_color) { %> +
+ + <%-renkan.translate("Node color:")%> +
+ + + + <%= renkan.colorPicker %> + <%- renkan.translate("Choose color") %> +
+
+<% } %> <% if (options.show_node_editor_image) { %> +
+
+ + <% if (node.clip_path) { %> + + + + <% }%> +
+
+

+ +

+ + +
+

+<% if (options.allow_image_upload) { %> +

+ + +

+<% }%><% } %> <% if (options.show_node_editor_creator && node.has_creator) { %> +

+ <%-renkan.translate("Created by:")%> + + <%- shortenText(node.created_by_title, 25) %> +

+<% } %> <% if (options.change_shapes) { %> +

+ + +

+<% } %> diff -r 4f458e6d32bd -r 22393cbf4467 client/templates/nodeeditor_readonly.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/templates/nodeeditor_readonly.html Sat Apr 18 17:14:27 2015 +0200 @@ -0,0 +1,28 @@ +

+ × + <% if (options.show_node_tooltip_color) { %> + + <% } %> + + <% if (node.uri) { %> + + <% } %> + <%-node.title%> + <% if (node.uri) { %><% } %> + +

+<% if (node.uri && options.show_node_tooltip_uri) { %> +

+ <%-node.short_uri%> +

+<% } %> <% if (options.show_node_tooltip_description) { %> +

<%-node.description%>

+<% } %> <% if (node.image && options.show_node_tooltip_image) { %> + +<% } %> <% if (node.has_creator && options.show_node_tooltip_creator) { %> +

+ <%-renkan.translate("Created by:")%> + + <%- shortenText(node.created_by_title, 25) %> +

+<% } %>