| author | ymh <ymh.work@gmail.com> |
| Sun, 14 Jul 2024 22:00:08 +0200 | |
| changeset 666 | 9d6550026232 |
| parent 649 | 2b9c120dba55 |
| permissions | -rw-r--r-- |
| 284 | 1 |
|
|
600
e12243191095
correct jquery dependency in renkan renderer + problem with CKEditor + version
ymh <ymh.work@gmail.com>
parents:
530
diff
changeset
|
2 |
define(['jquery', 'underscore', 'requtils', 'renderer/baseeditor', 'renderer/shapebuilder', 'ckeditor-core'], function ($, _, requtils, BaseEditor, ShapeBuilder, CKEditor) { |
|
293
fba23fde14ba
Correct jshint errors and force it on build
ymh <ymh.work@gmail.com>
parents:
284
diff
changeset
|
3 |
'use strict'; |
|
fba23fde14ba
Correct jshint errors and force it on build
ymh <ymh.work@gmail.com>
parents:
284
diff
changeset
|
4 |
|
| 284 | 5 |
var Utils = requtils.getUtils(); |
6 |
||
7 |
/* NodeEditor Begin */ |
|
8 |
//var NodeEditor = Renderer.NodeEditor = Utils.inherit(Renderer._BaseEditor); |
|
9 |
var NodeEditor = Utils.inherit(BaseEditor); |
|
10 |
||
11 |
_(NodeEditor.prototype).extend({ |
|
|
435
e529b633c339
Add shape management, correction on shape manip[ulation on the client, correct 404 error on space creation, increment version
ymh <ymh.work@gmail.com>
parents:
434
diff
changeset
|
12 |
_init: function() { |
|
e529b633c339
Add shape management, correction on shape manip[ulation on the client, correct 404 error on space creation, increment version
ymh <ymh.work@gmail.com>
parents:
434
diff
changeset
|
13 |
BaseEditor.prototype._init.apply(this); |
|
e529b633c339
Add shape management, correction on shape manip[ulation on the client, correct 404 error on space creation, increment version
ymh <ymh.work@gmail.com>
parents:
434
diff
changeset
|
14 |
this.template = this.options.templates['templates/nodeeditor.html']; |
| 450 | 15 |
//fusionner avec this.options.node_editor_templates |
| 482 | 16 |
this.readOnlyTemplate = this.options.node_editor_templates; |
|
435
e529b633c339
Add shape management, correction on shape manip[ulation on the client, correct 404 error on space creation, increment version
ymh <ymh.work@gmail.com>
parents:
434
diff
changeset
|
17 |
}, |
| 284 | 18 |
draw: function() { |
19 |
var _model = this.source_representation.model, |
|
20 |
_created_by = _model.get("created_by") || Utils._USER_PLACEHOLDER(this.renkan), |
|
| 482 | 21 |
_template = (this.renderer.isEditable() ? this.template : this.readOnlyTemplate[_model.get("type")] || this.readOnlyTemplate["default"]), |
| 284 | 22 |
_image_placeholder = this.options.static_url + "img/image-placeholder.png", |
23 |
_size = (_model.get("size") || 0); |
|
24 |
this.editor_$ |
|
25 |
.html(_template({ |
|
26 |
node: { |
|
|
479
be510a7fc5ac
send the id to the template and construct an proper url for each node passing the id to the parameter idNode
rougeronj
parents:
469
diff
changeset
|
27 |
_id: _model.get("_id"), |
| 284 | 28 |
has_creator: !!_model.get("created_by"), |
29 |
title: _model.get("title"), |
|
30 |
uri: _model.get("uri"), |
|
| 482 | 31 |
type: _model.get("type") || "default", |
| 284 | 32 |
short_uri: Utils.shortenText((_model.get("uri") || "").replace(/^(https?:\/\/)?(www\.)?/,'').replace(/\/$/,''),40), |
33 |
description: _model.get("description"), |
|
34 |
image: _model.get("image") || "", |
|
35 |
image_placeholder: _image_placeholder, |
|
|
458
423bdf56d103
migrated to style, added dash style to client + small refactoring for shapes + triangle
ymh <ymh.work@gmail.com>
parents:
435
diff
changeset
|
36 |
color: (_model.has("style") && _model.get("style").color) || _created_by.get("color"), |
|
649
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
37 |
title_size: (_model.has("style") && _model.get("style").title_size) || 1, |
|
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
38 |
title_color: (_model.has("style") && _model.get("style").title_color) || this.options.node_title_color, |
|
459
98cae534083d
add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents:
458
diff
changeset
|
39 |
thickness: (_model.has("style") && _model.get("style").thickness) || 1, |
|
458
423bdf56d103
migrated to style, added dash style to client + small refactoring for shapes + triangle
ymh <ymh.work@gmail.com>
parents:
435
diff
changeset
|
40 |
dash: _model.has("style") && _model.get("style").dash ? "checked" : "", |
| 284 | 41 |
clip_path: _model.get("clip_path") || false, |
42 |
created_by_color: _created_by.get("color"), |
|
43 |
created_by_title: _created_by.get("title"), |
|
| 330 | 44 |
size: (_size > 0 ? "+" : "") + _size, |
45 |
shape: _model.get("shape") || "circle" |
|
| 284 | 46 |
}, |
47 |
renkan: this.renkan, |
|
48 |
options: this.options, |
|
|
458
423bdf56d103
migrated to style, added dash style to client + small refactoring for shapes + triangle
ymh <ymh.work@gmail.com>
parents:
435
diff
changeset
|
49 |
shortenText: Utils.shortenText, |
|
423bdf56d103
migrated to style, added dash style to client + small refactoring for shapes + triangle
ymh <ymh.work@gmail.com>
parents:
435
diff
changeset
|
50 |
shapes : _(ShapeBuilder.builders).omit('svg').keys().value(), |
| 482 | 51 |
types : _(this.options.node_editor_templates).keys().value(), |
| 284 | 52 |
})); |
53 |
this.redraw(); |
|
54 |
var _this = this, |
|
|
600
e12243191095
correct jquery dependency in renkan renderer + problem with CKEditor + version
ymh <ymh.work@gmail.com>
parents:
530
diff
changeset
|
55 |
editorInstance = (this.renderer.isEditable() && _this.options.show_node_editor_description_richtext) ? |
|
e12243191095
correct jquery dependency in renkan renderer + problem with CKEditor + version
ymh <ymh.work@gmail.com>
parents:
530
diff
changeset
|
56 |
CKEditor.inline("Rk-Edit-Description-"+_model.get("_id"), _this.options.richtext_editor_config) : |
|
468
364c367df7fc
add rich text editor for description
ymh <ymh.work@gmail.com>
parents:
461
diff
changeset
|
57 |
false, |
|
600
e12243191095
correct jquery dependency in renkan renderer + problem with CKEditor + version
ymh <ymh.work@gmail.com>
parents:
530
diff
changeset
|
58 |
editorInstanceTitle = (this.renderer.isEditable() && _this.options.show_node_editor_title_richtext) ? |
|
e12243191095
correct jquery dependency in renkan renderer + problem with CKEditor + version
ymh <ymh.work@gmail.com>
parents:
530
diff
changeset
|
59 |
CKEditor.inline("Rk-Edit-Title-"+_model.get("_id"), _this.options.richtext_editor_config) : |
| 530 | 60 |
false, |
|
468
364c367df7fc
add rich text editor for description
ymh <ymh.work@gmail.com>
parents:
461
diff
changeset
|
61 |
closeEditor = function() { |
|
364c367df7fc
add rich text editor for description
ymh <ymh.work@gmail.com>
parents:
461
diff
changeset
|
62 |
_this.renderer.removeRepresentation(_this); |
|
364c367df7fc
add rich text editor for description
ymh <ymh.work@gmail.com>
parents:
461
diff
changeset
|
63 |
paper.view.draw(); |
|
364c367df7fc
add rich text editor for description
ymh <ymh.work@gmail.com>
parents:
461
diff
changeset
|
64 |
}; |
| 284 | 65 |
|
|
470
47308aa6ce94
correction for rich text editor. correct problem of empty description. make sure that the editor toolbr close
ymh <ymh.work@gmail.com>
parents:
469
diff
changeset
|
66 |
_this.cleanEditor = function() { |
|
47308aa6ce94
correction for rich text editor. correct problem of empty description. make sure that the editor toolbr close
ymh <ymh.work@gmail.com>
parents:
469
diff
changeset
|
67 |
_this.editor_$.off("keyup"); |
|
47308aa6ce94
correction for rich text editor. correct problem of empty description. make sure that the editor toolbr close
ymh <ymh.work@gmail.com>
parents:
469
diff
changeset
|
68 |
_this.editor_$.find("input, textarea, select").off("change keyup paste"); |
|
47308aa6ce94
correction for rich text editor. correct problem of empty description. make sure that the editor toolbr close
ymh <ymh.work@gmail.com>
parents:
469
diff
changeset
|
69 |
_this.editor_$.find(".Rk-Edit-Image-File").off('change'); |
|
47308aa6ce94
correction for rich text editor. correct problem of empty description. make sure that the editor toolbr close
ymh <ymh.work@gmail.com>
parents:
469
diff
changeset
|
70 |
_this.editor_$.find(".Rk-Edit-ColorPicker-Wrapper").off('hover'); |
|
47308aa6ce94
correction for rich text editor. correct problem of empty description. make sure that the editor toolbr close
ymh <ymh.work@gmail.com>
parents:
469
diff
changeset
|
71 |
_this.editor_$.find(".Rk-Edit-Size-Btn").off('click'); |
|
47308aa6ce94
correction for rich text editor. correct problem of empty description. make sure that the editor toolbr close
ymh <ymh.work@gmail.com>
parents:
469
diff
changeset
|
72 |
_this.editor_$.find(".Rk-Edit-Image-Del").off('click'); |
|
47308aa6ce94
correction for rich text editor. correct problem of empty description. make sure that the editor toolbr close
ymh <ymh.work@gmail.com>
parents:
469
diff
changeset
|
73 |
_this.editor_$.find(".Rk-Edit-ColorPicker").find("li").off('hover click'); |
|
47308aa6ce94
correction for rich text editor. correct problem of empty description. make sure that the editor toolbr close
ymh <ymh.work@gmail.com>
parents:
469
diff
changeset
|
74 |
_this.editor_$.find(".Rk-CloseX").off('click'); |
|
47308aa6ce94
correction for rich text editor. correct problem of empty description. make sure that the editor toolbr close
ymh <ymh.work@gmail.com>
parents:
469
diff
changeset
|
75 |
_this.editor_$.find(".Rk-Edit-Goto").off('click'); |
|
47308aa6ce94
correction for rich text editor. correct problem of empty description. make sure that the editor toolbr close
ymh <ymh.work@gmail.com>
parents:
469
diff
changeset
|
76 |
|
|
47308aa6ce94
correction for rich text editor. correct problem of empty description. make sure that the editor toolbr close
ymh <ymh.work@gmail.com>
parents:
469
diff
changeset
|
77 |
if(_this.options.show_node_editor_description_richtext) { |
|
600
e12243191095
correct jquery dependency in renkan renderer + problem with CKEditor + version
ymh <ymh.work@gmail.com>
parents:
530
diff
changeset
|
78 |
if(editorInstance) { |
|
e12243191095
correct jquery dependency in renkan renderer + problem with CKEditor + version
ymh <ymh.work@gmail.com>
parents:
530
diff
changeset
|
79 |
editorInstance.focusManager.blur(true); |
|
e12243191095
correct jquery dependency in renkan renderer + problem with CKEditor + version
ymh <ymh.work@gmail.com>
parents:
530
diff
changeset
|
80 |
editorInstance.destroy(); |
|
470
47308aa6ce94
correction for rich text editor. correct problem of empty description. make sure that the editor toolbr close
ymh <ymh.work@gmail.com>
parents:
469
diff
changeset
|
81 |
} |
|
47308aa6ce94
correction for rich text editor. correct problem of empty description. make sure that the editor toolbr close
ymh <ymh.work@gmail.com>
parents:
469
diff
changeset
|
82 |
} |
| 530 | 83 |
if(_this.options.show_node_editor_title_richtext) { |
|
600
e12243191095
correct jquery dependency in renkan renderer + problem with CKEditor + version
ymh <ymh.work@gmail.com>
parents:
530
diff
changeset
|
84 |
if(editorInstanceTitle) { |
|
e12243191095
correct jquery dependency in renkan renderer + problem with CKEditor + version
ymh <ymh.work@gmail.com>
parents:
530
diff
changeset
|
85 |
editorInstanceTitle.focusManager.blur(true); |
|
e12243191095
correct jquery dependency in renkan renderer + problem with CKEditor + version
ymh <ymh.work@gmail.com>
parents:
530
diff
changeset
|
86 |
editorInstanceTitle.destroy(); |
| 530 | 87 |
} |
88 |
} |
|
|
470
47308aa6ce94
correction for rich text editor. correct problem of empty description. make sure that the editor toolbr close
ymh <ymh.work@gmail.com>
parents:
469
diff
changeset
|
89 |
}; |
|
47308aa6ce94
correction for rich text editor. correct problem of empty description. make sure that the editor toolbr close
ymh <ymh.work@gmail.com>
parents:
469
diff
changeset
|
90 |
|
|
47308aa6ce94
correction for rich text editor. correct problem of empty description. make sure that the editor toolbr close
ymh <ymh.work@gmail.com>
parents:
469
diff
changeset
|
91 |
this.editor_$.find(".Rk-CloseX").click(function (e) { |
|
47308aa6ce94
correction for rich text editor. correct problem of empty description. make sure that the editor toolbr close
ymh <ymh.work@gmail.com>
parents:
469
diff
changeset
|
92 |
e.preventDefault(); |
|
47308aa6ce94
correction for rich text editor. correct problem of empty description. make sure that the editor toolbr close
ymh <ymh.work@gmail.com>
parents:
469
diff
changeset
|
93 |
closeEditor(); |
|
47308aa6ce94
correction for rich text editor. correct problem of empty description. make sure that the editor toolbr close
ymh <ymh.work@gmail.com>
parents:
469
diff
changeset
|
94 |
}); |
| 284 | 95 |
|
96 |
this.editor_$.find(".Rk-Edit-Goto").click(function() { |
|
97 |
if (!_model.get("uri")) { |
|
98 |
return false; |
|
99 |
} |
|
100 |
}); |
|
101 |
||
102 |
if (this.renderer.isEditable()) { |
|
103 |
||
|
625
4d67ae41b9b3
debounce node and edge edition instead of throttle
ymh <ymh.work@gmail.com>
parents:
600
diff
changeset
|
104 |
var onFieldChange = _.debounce(function() { |
| 433 | 105 |
_.defer(function() { |
106 |
if (_this.renderer.isEditable()) { |
|
| 530 | 107 |
var _data = {}; |
| 433 | 108 |
if (_this.options.show_node_editor_uri) { |
109 |
_data.uri = _this.editor_$.find(".Rk-Edit-URI").val(); |
|
110 |
_this.editor_$.find(".Rk-Edit-Goto").attr("href",_data.uri || "#"); |
|
111 |
} |
|
112 |
if (_this.options.show_node_editor_image) { |
|
113 |
_data.image = _this.editor_$.find(".Rk-Edit-Image").val(); |
|
114 |
_this.editor_$.find(".Rk-Edit-ImgPreview").attr("src", _data.image || _image_placeholder); |
|
115 |
} |
|
116 |
if (_this.options.show_node_editor_description) { |
|
|
470
47308aa6ce94
correction for rich text editor. correct problem of empty description. make sure that the editor toolbr close
ymh <ymh.work@gmail.com>
parents:
469
diff
changeset
|
117 |
if(_this.options.show_node_editor_description_richtext) { |
|
600
e12243191095
correct jquery dependency in renkan renderer + problem with CKEditor + version
ymh <ymh.work@gmail.com>
parents:
530
diff
changeset
|
118 |
if(editorInstance && |
|
e12243191095
correct jquery dependency in renkan renderer + problem with CKEditor + version
ymh <ymh.work@gmail.com>
parents:
530
diff
changeset
|
119 |
editorInstance.checkDirty()) { |
|
e12243191095
correct jquery dependency in renkan renderer + problem with CKEditor + version
ymh <ymh.work@gmail.com>
parents:
530
diff
changeset
|
120 |
_data.description = editorInstance.getData(); |
|
e12243191095
correct jquery dependency in renkan renderer + problem with CKEditor + version
ymh <ymh.work@gmail.com>
parents:
530
diff
changeset
|
121 |
editorInstance.resetDirty(); |
|
470
47308aa6ce94
correction for rich text editor. correct problem of empty description. make sure that the editor toolbr close
ymh <ymh.work@gmail.com>
parents:
469
diff
changeset
|
122 |
} |
|
468
364c367df7fc
add rich text editor for description
ymh <ymh.work@gmail.com>
parents:
461
diff
changeset
|
123 |
} |
|
364c367df7fc
add rich text editor for description
ymh <ymh.work@gmail.com>
parents:
461
diff
changeset
|
124 |
else { |
|
364c367df7fc
add rich text editor for description
ymh <ymh.work@gmail.com>
parents:
461
diff
changeset
|
125 |
_data.description = _this.editor_$.find(".Rk-Edit-Description").val(); |
|
364c367df7fc
add rich text editor for description
ymh <ymh.work@gmail.com>
parents:
461
diff
changeset
|
126 |
} |
| 433 | 127 |
} |
| 530 | 128 |
if (_this.options.show_node_editor_title) { |
129 |
if(_this.options.show_node_editor_title_richtext) { |
|
|
600
e12243191095
correct jquery dependency in renkan renderer + problem with CKEditor + version
ymh <ymh.work@gmail.com>
parents:
530
diff
changeset
|
130 |
if(editorInstanceTitle && |
|
e12243191095
correct jquery dependency in renkan renderer + problem with CKEditor + version
ymh <ymh.work@gmail.com>
parents:
530
diff
changeset
|
131 |
editorInstanceTitle.checkDirty()) { |
|
e12243191095
correct jquery dependency in renkan renderer + problem with CKEditor + version
ymh <ymh.work@gmail.com>
parents:
530
diff
changeset
|
132 |
_data.title = editorInstanceTitle.getData(); |
|
e12243191095
correct jquery dependency in renkan renderer + problem with CKEditor + version
ymh <ymh.work@gmail.com>
parents:
530
diff
changeset
|
133 |
editorInstanceTitle.resetDirty(); |
| 530 | 134 |
} |
135 |
} |
|
136 |
else { |
|
137 |
_data.title = _this.editor_$.find(".Rk-Edit-Title").val(); |
|
138 |
} |
|
139 |
} |
|
|
458
423bdf56d103
migrated to style, added dash style to client + small refactoring for shapes + triangle
ymh <ymh.work@gmail.com>
parents:
435
diff
changeset
|
140 |
if (_this.options.show_node_editor_style) { |
|
423bdf56d103
migrated to style, added dash style to client + small refactoring for shapes + triangle
ymh <ymh.work@gmail.com>
parents:
435
diff
changeset
|
141 |
var dash = _this.editor_$.find(".Rk-Edit-Dash").is(':checked'); |
|
423bdf56d103
migrated to style, added dash style to client + small refactoring for shapes + triangle
ymh <ymh.work@gmail.com>
parents:
435
diff
changeset
|
142 |
_data.style = _.assign( ((_model.has("style") && _.clone(_model.get("style"))) || {}), {dash: dash}); |
|
423bdf56d103
migrated to style, added dash style to client + small refactoring for shapes + triangle
ymh <ymh.work@gmail.com>
parents:
435
diff
changeset
|
143 |
} |
| 433 | 144 |
if (_this.options.change_shapes) { |
145 |
if(_model.get("shape")!==_this.editor_$.find(".Rk-Edit-Shape").val()){ |
|
146 |
_data.shape = _this.editor_$.find(".Rk-Edit-Shape").val(); |
|
| 284 | 147 |
} |
| 433 | 148 |
} |
| 482 | 149 |
if (_this.options.change_types) { |
150 |
if(_model.get("type")!==_this.editor_$.find(".Rk-Edit-Type").val()){ |
|
151 |
_data.type = _this.editor_$.find(".Rk-Edit-Type").val(); |
|
152 |
} |
|
153 |
} |
|
| 433 | 154 |
_model.set(_data); |
155 |
_this.redraw(); |
|
156 |
} else { |
|
157 |
closeEditor(); |
|
158 |
} |
|
159 |
}); |
|
|
468
364c367df7fc
add rich text editor for description
ymh <ymh.work@gmail.com>
parents:
461
diff
changeset
|
160 |
}, 1000); |
| 433 | 161 |
|
| 284 | 162 |
this.editor_$.on("keyup", function(_e) { |
163 |
if (_e.keyCode === 27) { |
|
164 |
closeEditor(); |
|
165 |
} |
|
166 |
}); |
|
167 |
||
| 330 | 168 |
this.editor_$.find("input, textarea, select").on("change keyup paste", onFieldChange); |
|
468
364c367df7fc
add rich text editor for description
ymh <ymh.work@gmail.com>
parents:
461
diff
changeset
|
169 |
if( _this.options.show_node_editor_description && |
|
364c367df7fc
add rich text editor for description
ymh <ymh.work@gmail.com>
parents:
461
diff
changeset
|
170 |
_this.options.show_node_editor_description_richtext && |
|
600
e12243191095
correct jquery dependency in renkan renderer + problem with CKEditor + version
ymh <ymh.work@gmail.com>
parents:
530
diff
changeset
|
171 |
editorInstance) |
|
468
364c367df7fc
add rich text editor for description
ymh <ymh.work@gmail.com>
parents:
461
diff
changeset
|
172 |
{ |
|
600
e12243191095
correct jquery dependency in renkan renderer + problem with CKEditor + version
ymh <ymh.work@gmail.com>
parents:
530
diff
changeset
|
173 |
editorInstance.on("change", onFieldChange); |
|
e12243191095
correct jquery dependency in renkan renderer + problem with CKEditor + version
ymh <ymh.work@gmail.com>
parents:
530
diff
changeset
|
174 |
editorInstance.on("blur", onFieldChange); |
|
468
364c367df7fc
add rich text editor for description
ymh <ymh.work@gmail.com>
parents:
461
diff
changeset
|
175 |
} |
|
600
e12243191095
correct jquery dependency in renkan renderer + problem with CKEditor + version
ymh <ymh.work@gmail.com>
parents:
530
diff
changeset
|
176 |
|
| 530 | 177 |
if( _this.options.show_node_editor_title && |
178 |
_this.options.show_node_editor_title_richtext && |
|
|
600
e12243191095
correct jquery dependency in renkan renderer + problem with CKEditor + version
ymh <ymh.work@gmail.com>
parents:
530
diff
changeset
|
179 |
editorInstanceTitle) |
| 530 | 180 |
{ |
|
600
e12243191095
correct jquery dependency in renkan renderer + problem with CKEditor + version
ymh <ymh.work@gmail.com>
parents:
530
diff
changeset
|
181 |
editorInstanceTitle.on("change", onFieldChange); |
|
e12243191095
correct jquery dependency in renkan renderer + problem with CKEditor + version
ymh <ymh.work@gmail.com>
parents:
530
diff
changeset
|
182 |
editorInstanceTitle.on("blur", onFieldChange); |
| 530 | 183 |
} |
| 284 | 184 |
|
| 385 | 185 |
if(_this.options.allow_image_upload) { |
186 |
this.editor_$.find(".Rk-Edit-Image-File").change(function() { |
|
187 |
if (this.files.length) { |
|
188 |
var f = this.files[0], |
|
189 |
fr = new FileReader(); |
|
190 |
if (f.type.substr(0,5) !== "image") { |
|
191 |
alert(_this.renkan.translate("This file is not an image")); |
|
192 |
return; |
|
193 |
} |
|
194 |
if (f.size > (_this.options.uploaded_image_max_kb * 1024)) { |
|
195 |
alert(_this.renkan.translate("Image size must be under ") + _this.options.uploaded_image_max_kb + _this.renkan.translate("KB")); |
|
196 |
return; |
|
197 |
} |
|
198 |
fr.onload = function(e) { |
|
199 |
_this.editor_$.find(".Rk-Edit-Image").val(e.target.result); |
|
200 |
onFieldChange(); |
|
201 |
}; |
|
202 |
fr.readAsDataURL(f); |
|
| 284 | 203 |
} |
| 385 | 204 |
}); |
205 |
} |
|
| 284 | 206 |
this.editor_$.find(".Rk-Edit-Title")[0].focus(); |
207 |
||
|
649
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
208 |
var _picker = _this.editor_$.find(".Rk-Editor-ColorPicker-Node"); |
| 284 | 209 |
|
210 |
this.editor_$.find(".Rk-Edit-ColorPicker-Wrapper").hover( |
|
211 |
function(_e) { |
|
212 |
_e.preventDefault(); |
|
213 |
_picker.show(); |
|
214 |
}, |
|
215 |
function(_e) { |
|
216 |
_e.preventDefault(); |
|
217 |
_picker.hide(); |
|
218 |
} |
|
219 |
); |
|
220 |
||
221 |
_picker.find("li").hover( |
|
222 |
function(_e) { |
|
223 |
_e.preventDefault(); |
|
224 |
_this.editor_$.find(".Rk-Edit-Color").css("background", $(this).attr("data-color")); |
|
225 |
}, |
|
226 |
function(_e) { |
|
227 |
_e.preventDefault(); |
|
|
458
423bdf56d103
migrated to style, added dash style to client + small refactoring for shapes + triangle
ymh <ymh.work@gmail.com>
parents:
435
diff
changeset
|
228 |
_this.editor_$.find(".Rk-Edit-Color").css("background", (_model.has("style") && _model.get("style").color) || (_model.get("created_by") || Utils._USER_PLACEHOLDER(_this.renkan)).get("color")); |
| 284 | 229 |
} |
230 |
).click(function(_e) { |
|
231 |
_e.preventDefault(); |
|
232 |
if (_this.renderer.isEditable()) { |
|
|
458
423bdf56d103
migrated to style, added dash style to client + small refactoring for shapes + triangle
ymh <ymh.work@gmail.com>
parents:
435
diff
changeset
|
233 |
_model.set("style", _.assign( ((_model.has("style") && _.clone(_model.get("style"))) || {}), {color: $(this).attr("data-color")})); |
| 284 | 234 |
_picker.hide(); |
235 |
paper.view.draw(); |
|
236 |
} else { |
|
237 |
closeEditor(); |
|
238 |
} |
|
239 |
}); |
|
240 |
||
241 |
var shiftSize = function(n) { |
|
242 |
if (_this.renderer.isEditable()) { |
|
243 |
var _newsize = n+(_model.get("size") || 0); |
|
|
459
98cae534083d
add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents:
458
diff
changeset
|
244 |
_this.editor_$.find("#Rk-Edit-Size-Value").text((_newsize > 0 ? "+" : "") + _newsize); |
| 284 | 245 |
_model.set("size", _newsize); |
246 |
paper.view.draw(); |
|
247 |
} else { |
|
248 |
closeEditor(); |
|
249 |
} |
|
250 |
}; |
|
251 |
||
|
459
98cae534083d
add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents:
458
diff
changeset
|
252 |
this.editor_$.find("#Rk-Edit-Size-Down").click(function() { |
| 284 | 253 |
shiftSize(-1); |
254 |
return false; |
|
255 |
}); |
|
|
459
98cae534083d
add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents:
458
diff
changeset
|
256 |
this.editor_$.find("#Rk-Edit-Size-Up").click(function() { |
| 284 | 257 |
shiftSize(1); |
258 |
return false; |
|
259 |
}); |
|
| 433 | 260 |
|
|
459
98cae534083d
add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents:
458
diff
changeset
|
261 |
var shiftThickness = function(n) { |
|
98cae534083d
add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents:
458
diff
changeset
|
262 |
if (_this.renderer.isEditable()) { |
|
98cae534083d
add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents:
458
diff
changeset
|
263 |
var _oldThickness = ((_model.has('style') && _model.get('style').thickness) || 1), |
|
98cae534083d
add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents:
458
diff
changeset
|
264 |
_newThickness = n + _oldThickness; |
|
98cae534083d
add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents:
458
diff
changeset
|
265 |
if(_newThickness < 1 ) { |
|
98cae534083d
add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents:
458
diff
changeset
|
266 |
_newThickness = 1; |
|
98cae534083d
add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents:
458
diff
changeset
|
267 |
} |
|
98cae534083d
add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents:
458
diff
changeset
|
268 |
else if (_newThickness > _this.options.node_stroke_witdh_scale) { |
|
98cae534083d
add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents:
458
diff
changeset
|
269 |
_newThickness = _this.options.node_stroke_witdh_scale; |
|
98cae534083d
add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents:
458
diff
changeset
|
270 |
} |
|
98cae534083d
add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents:
458
diff
changeset
|
271 |
if (_newThickness !== _oldThickness) { |
|
98cae534083d
add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents:
458
diff
changeset
|
272 |
_this.editor_$.find("#Rk-Edit-Thickness-Value").text(_newThickness); |
|
98cae534083d
add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents:
458
diff
changeset
|
273 |
_model.set("style", _.assign( ((_model.has("style") && _.clone(_model.get("style"))) || {}), {thickness: _newThickness})); |
|
98cae534083d
add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents:
458
diff
changeset
|
274 |
paper.view.draw(); |
|
98cae534083d
add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents:
458
diff
changeset
|
275 |
} |
|
98cae534083d
add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents:
458
diff
changeset
|
276 |
} |
|
98cae534083d
add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents:
458
diff
changeset
|
277 |
else { |
|
98cae534083d
add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents:
458
diff
changeset
|
278 |
closeEditor(); |
|
98cae534083d
add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents:
458
diff
changeset
|
279 |
} |
|
98cae534083d
add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents:
458
diff
changeset
|
280 |
}; |
|
98cae534083d
add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents:
458
diff
changeset
|
281 |
|
|
98cae534083d
add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents:
458
diff
changeset
|
282 |
this.editor_$.find("#Rk-Edit-Thickness-Down").click(function() { |
|
98cae534083d
add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents:
458
diff
changeset
|
283 |
shiftThickness(-1); |
|
98cae534083d
add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents:
458
diff
changeset
|
284 |
return false; |
|
98cae534083d
add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents:
458
diff
changeset
|
285 |
}); |
|
98cae534083d
add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents:
458
diff
changeset
|
286 |
this.editor_$.find("#Rk-Edit-Thickness-Up").click(function() { |
|
98cae534083d
add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents:
458
diff
changeset
|
287 |
shiftThickness(1); |
|
98cae534083d
add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents:
458
diff
changeset
|
288 |
return false; |
|
98cae534083d
add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents:
458
diff
changeset
|
289 |
}); |
|
98cae534083d
add node and edge stroke width + adjust text + arrow placement + conrol arrow visibility
ymh <ymh.work@gmail.com>
parents:
458
diff
changeset
|
290 |
|
|
649
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
291 |
var shiftTitleSize = function(n) { |
|
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
292 |
var min = _this.options.node_title_size_min; |
|
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
293 |
var max = _this.options.node_title_size_max; |
|
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
294 |
if (_this.renderer.isEditable()) { |
|
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
295 |
var _oldTitleSize = ((_model.has('style') && _model.get('style').title_size) || 1), |
|
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
296 |
_newTitleSize = n + _oldTitleSize; |
|
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
297 |
if(_newTitleSize < min ) { |
|
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
298 |
_newTitleSize = min; |
|
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
299 |
} |
|
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
300 |
else if (_newTitleSize > max) { |
|
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
301 |
_newTitleSize = max; |
|
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
302 |
} |
|
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
303 |
if (_newTitleSize !== _oldTitleSize) { |
|
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
304 |
_this.editor_$.find("#Rk-Edit-Title-Size-Value").text(_newTitleSize.toFixed(1)); |
|
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
305 |
_model.set("style", _.assign( ((_model.has("style") && _.clone(_model.get("style"))) || {}), {title_size: _newTitleSize})); |
|
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
306 |
paper.view.draw(); |
|
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
307 |
} |
|
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
308 |
} |
|
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
309 |
else { |
|
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
310 |
closeEditor(); |
|
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
311 |
} |
|
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
312 |
}; |
|
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
313 |
|
|
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
314 |
|
|
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
315 |
var _pickerTitle = _this.editor_$.find(".Rk-Editor-ColorPicker-Title"); |
|
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
316 |
|
|
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
317 |
this.editor_$.find(".Rk-Editor-p-title-color").hover( |
|
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
318 |
function(_e) { |
|
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
319 |
_e.preventDefault(); |
|
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
320 |
_pickerTitle.show(); |
|
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
321 |
}, |
|
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
322 |
function(_e) { |
|
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
323 |
_e.preventDefault(); |
|
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
324 |
_pickerTitle.hide(); |
|
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
325 |
} |
|
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
326 |
); |
|
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
327 |
|
|
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
328 |
_pickerTitle.find("li").hover( |
|
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
329 |
function(_e) { |
|
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
330 |
_e.preventDefault(); |
|
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
331 |
_this.editor_$.find(".Rk-Editor-p-title-color .Rk-Edit-Color").css("background", $(this).attr("data-color")); |
|
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
332 |
}, |
|
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
333 |
function(_e) { |
|
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
334 |
_e.preventDefault(); |
|
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
335 |
var title_color = (_model.has("style") && _model.get("style").title_color) || _this.options.node_fill_color; |
|
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
336 |
_this.editor_$.find(".Rk-Editor-p-title-color .Rk-Edit-Color").css("background", title_color); |
|
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
337 |
} |
|
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
338 |
).click(function(_e) { |
|
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
339 |
_e.preventDefault(); |
|
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
340 |
if (_this.renderer.isEditable()) { |
|
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
341 |
_model.set("style", _.assign( ((_model.has("style") && _.clone(_model.get("style"))) || {}), {title_color: $(this).attr("data-color")})); |
|
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
342 |
_pickerTitle.hide(); |
|
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
343 |
paper.view.draw(); |
|
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
344 |
} else { |
|
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
345 |
closeEditor(); |
|
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
346 |
} |
|
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
347 |
}); |
|
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
348 |
|
|
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
349 |
|
|
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
350 |
this.editor_$.find("#Rk-Edit-Title-Size-Down").click(function() { |
|
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
351 |
var step = _this.options.node_title_size_step; |
|
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
352 |
shiftTitleSize(-step); |
|
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
353 |
return false; |
|
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
354 |
}); |
|
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
355 |
this.editor_$.find("#Rk-Edit-Title-Size-Up").click(function() { |
|
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
356 |
var step = _this.options.node_title_size_step; |
|
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
357 |
shiftTitleSize(step); |
|
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
358 |
return false; |
|
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
359 |
}); |
|
2b9c120dba55
first implementation of node title size and color
ymh <ymh.work@gmail.com>
parents:
648
diff
changeset
|
360 |
|
|
384
6a7930a0d4d1
Close #60 - Add a trash icon to delete the image URL
rougeronj
parents:
331
diff
changeset
|
361 |
this.editor_$.find(".Rk-Edit-Image-Del").click(function() { |
|
435
e529b633c339
Add shape management, correction on shape manip[ulation on the client, correct 404 error on space creation, increment version
ymh <ymh.work@gmail.com>
parents:
434
diff
changeset
|
362 |
_this.editor_$.find(".Rk-Edit-Image").val(''); |
|
e529b633c339
Add shape management, correction on shape manip[ulation on the client, correct 404 error on space creation, increment version
ymh <ymh.work@gmail.com>
parents:
434
diff
changeset
|
363 |
onFieldChange(); |
|
384
6a7930a0d4d1
Close #60 - Add a trash icon to delete the image URL
rougeronj
parents:
331
diff
changeset
|
364 |
return false; |
|
6a7930a0d4d1
Close #60 - Add a trash icon to delete the image URL
rougeronj
parents:
331
diff
changeset
|
365 |
}); |
| 284 | 366 |
} else { |
367 |
if (typeof this.source_representation.highlighted === "object") { |
|
368 |
var titlehtml = this.source_representation.highlighted.replace(_(_model.get("title")).escape(),'<span class="Rk-Highlighted">$1</span>'); |
|
369 |
this.editor_$.find(".Rk-Display-Title" + (_model.get("uri") ? " a" : "")).html(titlehtml); |
|
370 |
if (this.options.show_node_tooltip_description) { |
|
371 |
this.editor_$.find(".Rk-Display-Description").html(this.source_representation.highlighted.replace(_(_model.get("description")).escape(),'<span class="Rk-Highlighted">$1</span>')); |
|
372 |
} |
|
373 |
} |
|
374 |
} |
|
375 |
this.editor_$.find("img").load(function() { |
|
376 |
_this.redraw(); |
|
377 |
}); |
|
378 |
}, |
|
379 |
redraw: function() { |
|
| 447 | 380 |
if (this.options.popup_editor){ |
381 |
var _coords = this.source_representation.paper_coords; |
|
|
648
e388117572d8
Improve display of editor tooltip. Add a vertical scroll if they too tall.
ymh <ymh.work@gmail.com>
parents:
647
diff
changeset
|
382 |
Utils.drawEditBox(this.options, _coords, this.editor_block, this.source_representation.circle_radius * 0.75, this.editor_$, this.renderer.renkan); |
| 447 | 383 |
} |
| 284 | 384 |
this.editor_$.show(); |
385 |
paper.view.draw(); |
|
|
470
47308aa6ce94
correction for rich text editor. correct problem of empty description. make sure that the editor toolbr close
ymh <ymh.work@gmail.com>
parents:
469
diff
changeset
|
386 |
}, |
|
47308aa6ce94
correction for rich text editor. correct problem of empty description. make sure that the editor toolbr close
ymh <ymh.work@gmail.com>
parents:
469
diff
changeset
|
387 |
destroy: function() { |
|
47308aa6ce94
correction for rich text editor. correct problem of empty description. make sure that the editor toolbr close
ymh <ymh.work@gmail.com>
parents:
469
diff
changeset
|
388 |
if(typeof this.cleanEditor !== 'undefined') { |
|
47308aa6ce94
correction for rich text editor. correct problem of empty description. make sure that the editor toolbr close
ymh <ymh.work@gmail.com>
parents:
469
diff
changeset
|
389 |
this.cleanEditor(); |
|
47308aa6ce94
correction for rich text editor. correct problem of empty description. make sure that the editor toolbr close
ymh <ymh.work@gmail.com>
parents:
469
diff
changeset
|
390 |
} |
|
47308aa6ce94
correction for rich text editor. correct problem of empty description. make sure that the editor toolbr close
ymh <ymh.work@gmail.com>
parents:
469
diff
changeset
|
391 |
this.editor_block.remove(); |
|
47308aa6ce94
correction for rich text editor. correct problem of empty description. make sure that the editor toolbr close
ymh <ymh.work@gmail.com>
parents:
469
diff
changeset
|
392 |
this.editor_$.remove(); |
| 284 | 393 |
} |
| 433 | 394 |
}).value(); |
|
434
0d5998b32a7c
clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents:
433
diff
changeset
|
395 |
|
| 284 | 396 |
/* NodeEditor End */ |
|
293
fba23fde14ba
Correct jshint errors and force it on build
ymh <ymh.work@gmail.com>
parents:
284
diff
changeset
|
397 |
|
| 284 | 398 |
return NodeEditor; |
399 |
||
|
293
fba23fde14ba
Correct jshint errors and force it on build
ymh <ymh.work@gmail.com>
parents:
284
diff
changeset
|
400 |
}); |