Merging...
authorrougeronj
Mon, 15 Jun 2015 11:02:09 +0200
changeset 480 a5da9a586297
parent 479 be510a7fc5ac (current diff)
parent 470 47308aa6ce94 (diff)
child 481 66c3b474a331
Merging...
client/gruntfile.js
client/js/renderer/nodeeditor.js
client/js/renderer/scene.js
--- a/client/css/renkan.css	Fri Jun 12 15:41:26 2015 +0200
+++ b/client/css/renkan.css	Mon Jun 15 11:02:09 2015 +0200
@@ -428,13 +428,15 @@
 }
 
 div.Rk-Edit-Description {
+    -moz-appearance: textfield-multiline;
+    -webkit-appearance: textarea;
     background-color: #FFF;
     border: 1px solid #F0F0F0;
     width: 250px;
     height: 120px;
     resize: vertical;
     overflow: auto;
-    padding: 1px;
+    padding: 2px;
 }
 
 .Rk-UserColor {
--- a/client/gruntfile.js	Fri Jun 12 15:41:26 2015 +0200
+++ b/client/gruntfile.js	Mon Jun 15 11:02:09 2015 +0200
@@ -205,11 +205,12 @@
   grunt.loadNpmTasks('grunt-contrib-watch');
 
   // Default task(s).
-  grunt.registerTask('default', ['jshint', 'bower:install', 'copy:vendors', 'requirejs', 'jst', 'concat', 'uglify', 'cssmin', 'copy:renkan', 'copy:renkan_css', 'clean:renderer', 'clean:jst']);
+  grunt.registerTask('base', ['jshint', 'bower:install', 'copy:vendors', 'requirejs', 'clean:renkan', 'jst', 'concat', 'uglify', 'cssmin', 'copy:renkan', 'copy:renkan_css', 'clean:renderer']);
+  grunt.registerTask('default', ['base', 'clean:jst']);
   grunt.registerTask('copy-server', 'copy files to server part', function(){
       grunt.task.run(['copy:renkan_server']);
   });
-  grunt.registerTask('dev', [ 'jshint', 'bower:install', 'copy:vendors', 'requirejs', 'jst', 'concat', 'uglify', 'cssmin', 'copy:renkan', 'copy:renkan_css', 'clean:renderer', 'connect:server', 'watch']);
+  grunt.registerTask('dev', [ 'base', 'connect:server', 'watch']);
 
 
 };
--- a/client/js/defaults.js	Fri Jun 12 15:41:26 2015 +0200
+++ b/client/js/defaults.js	Mon Jun 15 11:02:09 2015 +0200
@@ -152,8 +152,7 @@
             '/',
 	        { name: 'styles'},
         ],
-        //extraPlugins: 'onchange',
-        removePlugins : 'colorbutton,find,flash,font,forms,iframe,image,newpage,smiley,specialchar,stylescombo,templates'
+        removePlugins : 'colorbutton,find,flash,font,forms,iframe,image,newpage,smiley,specialchar,stylescombo,templates',
     },
 
     /* NODE EDITOR OPTIONS */
--- a/client/js/renderer/nodeeditor.js	Fri Jun 12 15:41:26 2015 +0200
+++ b/client/js/renderer/nodeeditor.js	Mon Jun 15 11:02:09 2015 +0200
@@ -53,33 +53,35 @@
                     $(".Rk-Edit-Description").ckeditor(_this.options.richtext_editor_config) :
                     false,
                 closeEditor = function() {
-                    _this.editor_$.off("keyup");
-                    _this.editor_$.find("input, textarea, select").off("change keyup paste");
-                    _this.editor_$.find(".Rk-Edit-Image-File").off('change');
-                    _this.editor_$.find(".Rk-Edit-ColorPicker-Wrapper").off('hover');
-                    _this.editor_$.find(".Rk-Edit-Size-Btn").off('click');
-                    _this.editor_$.find(".Rk-Edit-Image-Del").off('click');
-                    _this.editor_$.find(".Rk-Edit-ColorPicker").find("li").off('hover click');
-                    _this.editor_$.find(".Rk-CloseX").off('click');
-                    _this.editor_$.find(".Rk-Edit-Goto").off('click');
-
-                    if(_this.options.show_node_editor_description_richtext) {
-                        if(typeof _this.editorListeners !== 'undefined') {
-                            _this.editorListeners.forEach( function(listener) {
-                                listener.removeListener();
-                            });
-                        }
-                        if(typeof editorInstance.editor !== 'undefined') {
-                            var _editor = editorInstance.editor;
-                            delete editorInstance.editor;
-                            _editor.destroy();
-                        }
-                    }
                     _this.renderer.removeRepresentation(_this);
                     paper.view.draw();
                 };
 
-            this.editor_$.find(".Rk-CloseX").click(closeEditor);
+            _this.cleanEditor = function() {
+                _this.editor_$.off("keyup");
+                _this.editor_$.find("input, textarea, select").off("change keyup paste");
+                _this.editor_$.find(".Rk-Edit-Image-File").off('change');
+                _this.editor_$.find(".Rk-Edit-ColorPicker-Wrapper").off('hover');
+                _this.editor_$.find(".Rk-Edit-Size-Btn").off('click');
+                _this.editor_$.find(".Rk-Edit-Image-Del").off('click');
+                _this.editor_$.find(".Rk-Edit-ColorPicker").find("li").off('hover click');
+                _this.editor_$.find(".Rk-CloseX").off('click');
+                _this.editor_$.find(".Rk-Edit-Goto").off('click');
+
+                if(_this.options.show_node_editor_description_richtext) {
+                    if(typeof editorInstance.editor !== 'undefined') {
+                        var _editor = editorInstance.editor;
+                        delete editorInstance.editor;
+                        _editor.focusManager.blur(true);
+                        _editor.destroy();
+                    }
+                }
+            };
+
+            this.editor_$.find(".Rk-CloseX").click(function (e) {
+                e.preventDefault();
+                closeEditor();
+            });
 
             this.editor_$.find(".Rk-Edit-Goto").click(function() {
                 if (!_model.get("uri")) {
@@ -104,12 +106,12 @@
                             _this.editor_$.find(".Rk-Edit-ImgPreview").attr("src", _data.image || _image_placeholder);
                         }
                         if (_this.options.show_node_editor_description) {
-                            if(_this.options.show_node_editor_description_richtext &&
-                                typeof editorInstance.editor !== 'undefined' &&
-                                editorInstance.editor.checkDirty())
-                            {
-                                _data.description = editorInstance.editor.getData();
-                                editorInstance.editor.resetDirty();
+                            if(_this.options.show_node_editor_description_richtext) {
+                                if(typeof editorInstance.editor !== 'undefined' &&
+                                    editorInstance.editor.checkDirty()) {
+                                    _data.description = editorInstance.editor.getData();
+                                    editorInstance.editor.resetDirty();
+                                }
                             }
                             else {
                                 _data.description = _this.editor_$.find(".Rk-Edit-Description").val();
@@ -143,9 +145,8 @@
                     _this.options.show_node_editor_description_richtext &&
                     typeof editorInstance.editor !== 'undefined')
                 {
-                    _this.editorListeners = [];
-                    _this.editorListeners.push(editorInstance.editor.on("change", onFieldChange));
-                    _this.editorListeners.push(editorInstance.editor.on("blur", onFieldChange));
+                    editorInstance.editor.on("change", onFieldChange);
+                    editorInstance.editor.on("blur", onFieldChange);
                 }
 
                 if(_this.options.allow_image_upload) {
@@ -279,6 +280,13 @@
             }
             this.editor_$.show();
             paper.view.draw();
+        },
+        destroy: function() {
+            if(typeof this.cleanEditor !== 'undefined') {
+                this.cleanEditor();
+            }
+            this.editor_block.remove();
+            this.editor_$.remove();
         }
     }).value();
 
--- a/client/js/renderer/scene.js	Fri Jun 12 15:41:26 2015 +0200
+++ b/client/js/renderer/scene.js	Mon Jun 15 11:02:09 2015 +0200
@@ -169,7 +169,7 @@
             },
             mouseleave: function(_event) {
                 _event.preventDefault();
-                _this.onMouseUp(_event, false);
+                //_this.onMouseUp(_event, false);//
                 _this.click_target = null;
                 _this.is_dragging = false;
             },
@@ -257,7 +257,7 @@
         });
         this.$.find(".Rk-ShowHiddenNodes").click( function() {
             _this.showNodes(false);
-            _this.$.find(".Rk-ShowHiddenNodes").off( "mouseleave" ); 
+            _this.$.find(".Rk-ShowHiddenNodes").off( "mouseleave" );
         });
         if(this.renkan.project.get("views").length > 0 && this.renkan.options.save_view){
             this.$.find(".Rk-ZoomSetSaved").show();
@@ -1038,7 +1038,7 @@
                                       _event.pageY - _off.top
                                       ]);
             var _hitResult = paper.project.hitTest(_point);
-            
+
             if (!this.isEditable()) {
                 if (_hitResult && typeof _hitResult.item.__representation !== "undefined") {
                     if (_hitResult.item.__representation.model.get('uri')){
@@ -1300,7 +1300,7 @@
           _.each(projectJSON.views, function(e,i,l) {
             delete e._id;
             delete e.id;
-            
+
             if(e.hidden_nodes) {
                 hiddenNodes = e.hidden_nodes;
                 e.hidden_nodes = [];