summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorValeriy Sizov <vsv2711@gmail.com>2012-10-09 20:11:49 +0300
committerValeriy Sizov <vsv2711@gmail.com>2012-10-12 20:07:24 +0300
commit57e2b5ed1adf330f2b1684d3e8aed311087d4304 (patch)
tree4302868028e570feca4ce41fa8e2e4fe6bdb1c0f /app
parent3b5c7b6e9aead85ffaa5d669639e69989da8a5b8 (diff)
downloadgitlab-ce-57e2b5ed1adf330f2b1684d3e8aed311087d4304.tar.gz
WebEditor: integrated editor
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/application.js1
-rw-r--r--app/assets/stylesheets/main.scss6
-rw-r--r--app/assets/stylesheets/sections/editor.scss14
-rw-r--r--app/views/tree/edit.html.haml15
4 files changed, 33 insertions, 3 deletions
diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js
index d582a1a1727..21554ba396d 100644
--- a/app/assets/javascripts/application.js
+++ b/app/assets/javascripts/application.js
@@ -18,4 +18,5 @@
//= require chosen-jquery
//= require raphael
//= require branch-graph
+//= require ace-src-noconflict/ace.js
//= require_tree .
diff --git a/app/assets/stylesheets/main.scss b/app/assets/stylesheets/main.scss
index bff24493820..f8cf8e449b4 100644
--- a/app/assets/stylesheets/main.scss
+++ b/app/assets/stylesheets/main.scss
@@ -182,3 +182,9 @@ $hover: #D9EDF7;
*
*/
@import "highlight/dark.scss";
+
+/**
+ * File Editor styles
+ *
+ */
+@import "sections/editor.scss";
diff --git a/app/assets/stylesheets/sections/editor.scss b/app/assets/stylesheets/sections/editor.scss
new file mode 100644
index 00000000000..f8e0fcac8c7
--- /dev/null
+++ b/app/assets/stylesheets/sections/editor.scss
@@ -0,0 +1,14 @@
+.file-editor {
+
+ #editor{
+ height: 500px;
+ width: 90%;
+ position: relative;
+ margin-bottom: 20px;
+ }
+ textarea{
+ display: block;
+ width: 40%;
+ margin: 10px 0 10px 0;
+ }
+}
diff --git a/app/views/tree/edit.html.haml b/app/views/tree/edit.html.haml
index d4571f7663c..f9a1e6dcc76 100644
--- a/app/views/tree/edit.html.haml
+++ b/app/views/tree/edit.html.haml
@@ -1,10 +1,19 @@
-.file_holder
- Edit file:
+.file-editor
+ .file_name
+ File:
%span.file_name
= @tree.path.force_encoding('utf-8')
%br
= form_tag(project_tree_path(@project, @id), :method => :put) do
- %textarea
+ #editor
= @tree.data
= hidden_field_tag 'last_commit', @last_commit
+ = hidden_field_tag 'content'
+
+ = text_area_tag 'text_commit'
= submit_tag "Save"
+
+:javascript
+ var editor = ace.edit("editor");
+ editor.setTheme("ace/theme/twilight");
+ editor.getSession().setMode("ace/mode/javascript");