Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-01-27 09:39:48 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-01-27 09:39:48 +0300
commit65e88f1e1aa247c9a89af82717aae791786ad276 (patch)
tree8fd7172af66c44a1c5170c6c888ea2c5f098d33b
parent8ecf7d3207ca52d694f6d8ebd9bed96041c49a8c (diff)
Fixed few tests and improved css style
-rw-r--r--app/assets/javascripts/blob/edit_blob.js.coffee4
-rw-r--r--app/assets/javascripts/blob/new_blob.js.coffee4
-rw-r--r--app/assets/stylesheets/sections/editor.scss8
-rw-r--r--app/views/projects/blob/edit.html.haml2
-rw-r--r--app/views/projects/blob/new.html.haml2
-rw-r--r--features/steps/project/source/browse_files.rb5
6 files changed, 16 insertions, 9 deletions
diff --git a/app/assets/javascripts/blob/edit_blob.js.coffee b/app/assets/javascripts/blob/edit_blob.js.coffee
index 79433dab505..6914ca759f6 100644
--- a/app/assets/javascripts/blob/edit_blob.js.coffee
+++ b/app/assets/javascripts/blob/edit_blob.js.coffee
@@ -6,6 +6,7 @@ class @EditBlob
ace_mode = mode
editor = ace.edit("editor")
editor.focus()
+ @editor = editor
if ace_mode
editor.getSession().setMode "ace/mode/" + ace_mode
@@ -38,3 +39,6 @@ class @EditBlob
currentPane.fadeIn 200
editor.focus()
return
+
+ editor: ->
+ return @editor
diff --git a/app/assets/javascripts/blob/new_blob.js.coffee b/app/assets/javascripts/blob/new_blob.js.coffee
index ed4b7c47936..a6e27116b40 100644
--- a/app/assets/javascripts/blob/new_blob.js.coffee
+++ b/app/assets/javascripts/blob/new_blob.js.coffee
@@ -6,6 +6,7 @@ class @NewBlob
ace_mode = mode
editor = ace.edit("editor")
editor.focus()
+ @editor = editor
if ace_mode
editor.getSession().setMode "ace/mode/" + ace_mode
@@ -15,3 +16,6 @@ class @NewBlob
$("#file-content").val editor.getValue()
$(".file-editor form").submit()
return
+
+ editor: ->
+ return @editor
diff --git a/app/assets/stylesheets/sections/editor.scss b/app/assets/stylesheets/sections/editor.scss
index becd593331f..88aa256e56e 100644
--- a/app/assets/stylesheets/sections/editor.scss
+++ b/app/assets/stylesheets/sections/editor.scss
@@ -35,15 +35,15 @@
.file-title {
@extend .monospace;
font-size: 14px;
+ padding: 5px;
}
.editor-ref {
- background: #fafafa;
- padding: 18px 15px;
- padding-left: 25px;
+ background: #f5f5f5;
+ padding: 11px 15px;
border-right: 1px solid #CCC;
display: inline-block;
- margin: -10px -15px;
+ margin: -5px -5px;
margin-right: 10px;
}
diff --git a/app/views/projects/blob/edit.html.haml b/app/views/projects/blob/edit.html.haml
index c0734d9f476..b150b639888 100644
--- a/app/views/projects/blob/edit.html.haml
+++ b/app/views/projects/blob/edit.html.haml
@@ -21,4 +21,4 @@
cancel_path: @after_edit_path
:javascript
- new EditBlob(gon.relative_url_root + "#{Gitlab::Application.config.assets.prefix}", "#{@blob.language.try(:ace_mode)}")
+ blob = new EditBlob(gon.relative_url_root + "#{Gitlab::Application.config.assets.prefix}", "#{@blob.language.try(:ace_mode)}")
diff --git a/app/views/projects/blob/new.html.haml b/app/views/projects/blob/new.html.haml
index 70f52332cc7..df6aedbe17d 100644
--- a/app/views/projects/blob/new.html.haml
+++ b/app/views/projects/blob/new.html.haml
@@ -9,4 +9,4 @@
cancel_path: project_tree_path(@project, @id)
:javascript
- new NewBlob(gon.relative_url_root + "#{Gitlab::Application.config.assets.prefix}", null)
+ blob = new NewBlob(gon.relative_url_root + "#{Gitlab::Application.config.assets.prefix}", null)
diff --git a/features/steps/project/source/browse_files.rb b/features/steps/project/source/browse_files.rb
index 1caad73654b..bd1ca55a20a 100644
--- a/features/steps/project/source/browse_files.rb
+++ b/features/steps/project/source/browse_files.rb
@@ -58,7 +58,7 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
step 'I can edit code' do
set_new_content
- evaluate_script('editor.getValue()').should == new_gitignore_content
+ evaluate_script('blob.editor.getValue()').should == new_gitignore_content
end
step 'I edit code' do
@@ -103,7 +103,6 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
step 'I can see new file page' do
page.should have_content "New file"
- page.should have_content "File name"
page.should have_content "Commit message"
end
@@ -170,7 +169,7 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
private
def set_new_content
- execute_script("editor.setValue('#{new_gitignore_content}')")
+ execute_script("blob.editor.setValue('#{new_gitignore_content}')")
end
# Content of the gitignore file on the seed repository.