Moving sourceEditor module to its own directory with its own styles
authorAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Thu, 6 Jun 2013 14:25:39 +0000 (16:25 +0200)
committerAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Thu, 6 Jun 2013 14:25:39 +0000 (16:25 +0200)
modules.js
modules/sourceEditor.js [deleted file]
modules/sourceEditor/sourceEditor.js [new file with mode: 0644]
modules/sourceEditor/sourceEditor.less [new file with mode: 0644]
styles/main.less

index 1727e00..d8e32f5 100644 (file)
@@ -9,7 +9,7 @@ define(function(require) {
         mainBar: require('modules/mainBar/mainBar'),\r
         indicator: require('modules/indicator/indicator'),\r
         \r
-        sourceEditor: require('modules/sourceEditor'),\r
+        sourceEditor: require('modules/sourceEditor/sourceEditor'),\r
         visualEditor: require('modules/visualEditor'),\r
         \r
         documentCanvas: require('modules/documentCanvas/documentCanvas'),\r
diff --git a/modules/sourceEditor.js b/modules/sourceEditor.js
deleted file mode 100644 (file)
index 248c02d..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-define(function() {\r
-\r
-return function(sandbox) {\r
-\r
-    var view = $(sandbox.getTemplate('main')());\r
-    var isDirty = false;\r
-    \r
-    var editor = ace.edit(view.find('#rng-sourceEditor-editor')[0]);\r
-    editor.setTheme("ace/theme/chrome");\r
-    editor.getSession().setMode("ace/mode/xml");\r
-    $('textarea', view).on('keyup', function() {\r
-        isDirty = true;\r
-    });\r
-    \r
-    editor.getSession().on('change', function() {\r
-        isDirty = true;\r
-    })\r
-    return {\r
-        start: function() {\r
-            sandbox.publish('ready');\r
-        },\r
-        getView: function() {\r
-            return view;\r
-        },\r
-        setDocument: function(document) {\r
-            editor.setValue(document);\r
-            editor.gotoLine(0)\r
-            isDirty = false;\r
-        },\r
-        getDocument: function() {\r
-            return editor.getValue();\r
-        },\r
-        isDirty: function() {\r
-            return isDirty;\r
-        },\r
-        setDirty: function(dirty) {\r
-            isDirty = dirty;\r
-        }\r
-    \r
-    }\r
-};\r
-\r
-});
\ No newline at end of file
diff --git a/modules/sourceEditor/sourceEditor.js b/modules/sourceEditor/sourceEditor.js
new file mode 100644 (file)
index 0000000..248c02d
--- /dev/null
@@ -0,0 +1,43 @@
+define(function() {\r
+\r
+return function(sandbox) {\r
+\r
+    var view = $(sandbox.getTemplate('main')());\r
+    var isDirty = false;\r
+    \r
+    var editor = ace.edit(view.find('#rng-sourceEditor-editor')[0]);\r
+    editor.setTheme("ace/theme/chrome");\r
+    editor.getSession().setMode("ace/mode/xml");\r
+    $('textarea', view).on('keyup', function() {\r
+        isDirty = true;\r
+    });\r
+    \r
+    editor.getSession().on('change', function() {\r
+        isDirty = true;\r
+    })\r
+    return {\r
+        start: function() {\r
+            sandbox.publish('ready');\r
+        },\r
+        getView: function() {\r
+            return view;\r
+        },\r
+        setDocument: function(document) {\r
+            editor.setValue(document);\r
+            editor.gotoLine(0)\r
+            isDirty = false;\r
+        },\r
+        getDocument: function() {\r
+            return editor.getValue();\r
+        },\r
+        isDirty: function() {\r
+            return isDirty;\r
+        },\r
+        setDirty: function(dirty) {\r
+            isDirty = dirty;\r
+        }\r
+    \r
+    }\r
+};\r
+\r
+});
\ No newline at end of file
diff --git a/modules/sourceEditor/sourceEditor.less b/modules/sourceEditor/sourceEditor.less
new file mode 100644 (file)
index 0000000..a62e9dd
--- /dev/null
@@ -0,0 +1,4 @@
+#rng-sourceEditor-editor {\r
+    width: 940px;\r
+    height: 500px;\r
+}
\ No newline at end of file
index 6d44f45..040ff6f 100644 (file)
@@ -3,6 +3,7 @@
 \r
 @import '../modules/rng/rng.less';\r
 @import '../modules/documentCanvas/documentCanvas.less';\r
+@import '../modules/sourceEditor/sourceEditor.less';\r
 @import '../modules/mainBar/mainBar.less';\r
 @import '../modules/documentToolbar/documentToolbar.less';\r
 @import '../modules/indicator/indicator.less';\r