diff --git a/Gemfile b/Gemfile index fa8a851db..6f513c2c5 100644 --- a/Gemfile +++ b/Gemfile @@ -7,11 +7,6 @@ gem 'pg' gem 'schema_plus' ######## gem 'devise' -gem 'omniauth' -gem 'omniauth-facebook' -gem 'omniauth-google-oauth2' -gem 'omniauth-github' -# gem 'omniauth-openid', '~> 1.0.1' gem 'pundit' gem 'ancestry' @@ -26,23 +21,9 @@ gem 'highline', '~> 1.6.20' gem 'state_machines-activerecord' gem 'redis-rails' -gem 'grack', git: 'git://github.com/rosa-abf/grack.git', require: 'git_http' -gem 'grit', git: 'git://github.com/rosa-abf/grit.git', tag: '2.6.17' gem 'charlock_holmes' -gem 'github-linguist', '3.1.5', require: 'linguist' -gem 'diff-display' - -# Wiki -gem 'gollum-lib', '~> 3.0' -gem 'redcarpet', '~> 3.3' -gem 'creole' -gem 'rdiscount' -# gem 'org-ruby' -gem 'RedCloth' -gem 'wikicloth' gem 'newrelic_rpm' -gem 'whenever', require: false gem 'jbuilder' gem 'rails3-jquery-autocomplete' @@ -65,7 +46,6 @@ gem 'ohm-expire', '~> 0.1.3' gem 'ffi' gem 'attr_encrypted' -gem 'gemoji' # AngularJS related stuff gem 'underscore-rails' @@ -85,7 +65,6 @@ gem 'sass-rails' gem 'coffee-rails' gem 'bootstrap-sass' gem 'font-awesome-rails' -gem 'zeroclipboard-rails' gem 'compass-rails' gem 'uglifier' @@ -93,8 +72,6 @@ gem 'therubyracer', platforms: [:mri, :rbx] gem 'therubyrhino', platforms: :jruby gem 'sitemap_generator' -gem 'codemirror-rails', '~> 4.5' - source 'http://rails-assets.org' do gem 'rails-assets-notifyjs' end @@ -108,7 +85,6 @@ gem 'faraday-http-cache' group :production do gem 'airbrake' - #gem 'bluepill', '~> 0.0.60', require: false gem 'puma' end @@ -127,7 +103,6 @@ group :development do gem 'binding_of_caller' gem 'meta_request' gem 'localeapp' - gem 'skype' #gem 'ruby-dbus' if RUBY_PLATFORM =~ /linux/i # Error at deploy gem 'rack-mini-profiler', require: false end diff --git a/Gemfile.lock b/Gemfile.lock index a297dbb6d..fe6936ab2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -26,27 +26,10 @@ GIT ransack (~> 1.3) sass-rails -GIT - remote: git://github.com/rosa-abf/grack.git - revision: 020be3fef3fb308b9d214252522aa5945bf6584a - specs: - grack (0.2.0) - -GIT - remote: git://github.com/rosa-abf/grit.git - revision: b733f0ceefb44b18a9dec8f509ba5493dab59e4e - tag: 2.6.17 - specs: - grit (2.5.0) - diff-lcs (~> 1.1) - mime-types (~> 1.15) - posix-spawn (~> 0.3.6) - GEM remote: http://rubygems.org/ remote: http://rails-assets.org/ specs: - RedCloth (4.2.9) actionmailer (4.2.2) actionpack (= 4.2.2) actionview (= 4.2.2) @@ -127,7 +110,6 @@ GEM net-ssh-gateway (>= 1.1.0) capistrano_colors (0.5.5) charlock_holmes (0.7.3) - chronic (0.10.2) chunky_png (1.3.4) climate_control (0.0.3) activesupport (>= 3.0) @@ -161,7 +143,6 @@ GEM sprockets (< 2.13) crack (0.4.2) safe_yaml (~> 1.0.0) - creole (0.5.0) daemons (1.2.2) debug_inspector (0.0.2) descendants_tracker (0.0.4) @@ -173,16 +154,13 @@ GEM responders thread_safe (~> 0.1) warden (~> 1.2.3) - diff-display (0.0.1) diff-lcs (1.2.5) domain_name (0.5.24) unf (>= 0.0.5, < 1.0.0) encryptor (1.3.0) erubis (2.7.0) - escape_utils (1.0.1) eventmachine (1.0.5) execjs (2.5.2) - expression_parser (0.9.0) factory_girl (4.5.0) activesupport (>= 3.0.0) factory_girl_rails (4.5.0) @@ -200,15 +178,6 @@ GEM formtastic_i18n (0.4.1) friendly_id (5.1.0) activerecord (>= 4.0.0) - gemoji (2.1.0) - github-linguist (3.1.5) - charlock_holmes (~> 0.7.3) - escape_utils (~> 1.0.1) - mime-types (~> 1.19) - pygments.rb (~> 0.6.0) - rugged (~> 0.21.0) - github-markup (1.1.2) - posix-spawn (~> 0.3.8) github_api (0.13.0) addressable (~> 2.3) descendants_tracker (~> 0.0.4) @@ -217,21 +186,9 @@ GEM multi_json (>= 1.7.5, < 2.0) nokogiri (~> 1.6.6) oauth2 - gitlab-grit (2.6.12) - charlock_holmes (~> 0.6) - diff-lcs (~> 1.1) - mime-types (~> 1.15) - posix-spawn (~> 0.3) gli (2.13.1) globalid (0.3.5) activesupport (>= 4.1.0) - gollum-lib (3.0.0) - github-markup (~> 1.1.0) - gitlab-grit (~> 2.6.5) - nokogiri (~> 1.6.1) - rouge (~> 1.3.3) - sanitize (~> 2.1.0) - stringex (~> 2.5.1) haml (4.0.6) tilt haml-rails (0.9.0) @@ -252,7 +209,6 @@ GEM haml (~> 4.0.0) nokogiri (~> 1.6.0) ruby_parser (~> 3.5) - htmlentities (4.3.3) http-cookie (1.0.2) domain_name (~> 0.5) i18n (0.7.0) @@ -349,20 +305,6 @@ GEM scrivener (~> 0.0.3) ohm-expire (0.1.3.2) ohm (>= 0.1.5) - omniauth (1.2.2) - hashie (>= 1.2, < 4) - rack (~> 1.0) - omniauth-facebook (2.0.1) - omniauth-oauth2 (~> 1.2) - omniauth-github (1.1.2) - omniauth (~> 1.0) - omniauth-oauth2 (~> 1.1) - omniauth-google-oauth2 (0.2.6) - omniauth (> 1.0) - omniauth-oauth2 (~> 1.1) - omniauth-oauth2 (1.3.0) - oauth2 (~> 1.0) - omniauth (~> 1.2) orm_adapter (0.5.0) paperclip (4.3.0) activemodel (>= 3.2.0) @@ -373,14 +315,10 @@ GEM pg (0.18.2) polyamorous (1.2.0) activerecord (>= 3.0) - posix-spawn (0.3.11) puma (2.11.3) rack (>= 1.1, < 2.0) pundit (1.0.1) activesupport (>= 3.0.0) - pygments.rb (0.6.3) - posix-spawn (~> 0.3.6) - yajl-ruby (~> 1.2.0) rack (1.6.2) rack-contrib (1.2.0) rack (>= 0.9.1) @@ -433,8 +371,6 @@ GEM rb-fsevent (0.9.5) rb-inotify (0.9.5) ffi (>= 0.5.0) - rdiscount (2.1.8) - redcarpet (3.3.2) redis (3.0.7) redis-actionpack (4.0.0) actionpack (~> 4) @@ -478,7 +414,6 @@ GEM http-cookie (>= 1.0.2, < 2.0) mime-types (>= 1.16, < 3.0) netrc (~> 0.7) - rouge (1.3.4) rr (1.1.2) rspec-core (3.2.3) rspec-support (~> 3.2.0) @@ -504,14 +439,11 @@ GEM sexp_processor (~> 4.1) rufus-scheduler (2.0.24) tzinfo (>= 0.3.22) - rugged (0.21.0) russian (0.6.0) i18n (>= 0.5.0) rvm-capistrano (1.5.6) capistrano (~> 2.15.4) safe_yaml (1.0.4) - sanitize (2.1.0) - nokogiri (>= 1.4.4) sass (3.4.14) sass-rails (5.0.1) railties (>= 4.0.0, < 5.0) @@ -593,8 +525,6 @@ GEM skinny (0.2.3) eventmachine (~> 1.0.0) thin (~> 1.5.0) - skype (0.2.8) - tmp_cache slim (3.0.6) temple (~> 0.7.3) tilt (>= 1.3.3, < 2.1) @@ -616,7 +546,6 @@ GEM state_machines-activerecord (0.2.0) activerecord (~> 4.1) state_machines-activemodel (~> 0.1.0) - stringex (2.5.2) temple (0.7.5) test_after_commit (0.4.1) activerecord (>= 3.2) @@ -634,9 +563,6 @@ GEM activesupport i18n timecop (0.7.4) - tmp_cache (0.1.1) - twitter-text (1.12.0) - unf (~> 0.1.0) tzinfo (1.2.2) thread_safe (~> 0.1) uglifier (2.7.1) @@ -654,25 +580,13 @@ GEM webmock (1.21.0) addressable (>= 2.3.6) crack (>= 0.3.2) - whenever (0.9.4) - chronic (>= 0.6.3) - wikicloth (0.8.3) - builder - expression_parser - htmlentities - nokogiri - twitter-text will_paginate (3.0.7) ya2yaml (0.31) - yajl-ruby (1.2.1) - zeroclipboard-rails (0.1.0) - railties (>= 3.1) PLATFORMS ruby DEPENDENCIES - RedCloth activeadmin! airbrake ancestry @@ -691,20 +605,13 @@ DEPENDENCIES codemirror-rails (~> 4.5) coffee-rails compass-rails - creole devise - diff-display factory_girl_rails faraday-http-cache ffi font-awesome-rails friendly_id - gemoji - github-linguist (= 3.1.5) github_api - gollum-lib (~> 3.0) - grack! - grit! haml-rails highline (~> 1.6.20) hirb @@ -723,10 +630,6 @@ DEPENDENCIES ngmin-rails ohm (~> 1.3.2) ohm-expire (~> 0.1.3) - omniauth - omniauth-facebook - omniauth-github - omniauth-google-oauth2 paperclip perform_later! pg @@ -740,8 +643,6 @@ DEPENDENCIES rails3-generators rails3-jquery-autocomplete rake - rdiscount - redcarpet (~> 3.3) redis-rails redis-semaphore resque @@ -761,7 +662,6 @@ DEPENDENCIES shoulda-matchers simple_form (= 3.1.0.rc2) sitemap_generator - skype slim soundmanager-rails sprockets @@ -774,10 +674,7 @@ DEPENDENCIES uglifier underscore-rails webmock - whenever - wikicloth will_paginate - zeroclipboard-rails BUNDLED WITH 1.11.2 diff --git a/Rakefile b/Rakefile index d36b66ef1..562c9b3d7 100644 --- a/Rakefile +++ b/Rakefile @@ -5,6 +5,5 @@ require File.expand_path('../config/application', __FILE__) require 'rake' require 'resque/tasks' require 'resque_scheduler/tasks' -load 'tasks/emoji.rake' Rosa::Application.load_tasks diff --git a/app/admin/build_scripts.rb b/app/admin/build_scripts.rb deleted file mode 100644 index de86d2f02..000000000 --- a/app/admin/build_scripts.rb +++ /dev/null @@ -1,72 +0,0 @@ -ActiveAdmin.register BuildScript do - permit_params :project_name, :treeish, :commit, :sha1, :status - - menu priority: 4 - - filter :project_name, as: :string - - controller do - def scoped_collection - BuildScript.includes(:project) - end - end - - index do - column(:project) do |bs| - link_to(bs.project.name_with_owner, project_path(bs.project)) - end - column :treeish - column :commit - column :sha1 - - column(:status, sortable: :status) do |bs| - status_tag(bs.status, build_script_status_color(bs)) - end - column :updated_at - - actions - end - - show do - attributes_table do - row :id - row(:project) do |bs| - link_to(bs.project.name_with_owner, project_path(bs.project)) - end - row :treeish - row :commit - row :sha1 - row(:status, sortable: :status) do |bs| - status_tag(bs.status, build_script_status_color(bs)) - end - row :created_at - row :updated_at - end - end - - form do |f| - f.inputs do - f.input :project_name - f.input :treeish - f.input :commit - f.input :sha1 - f.input :status, as: :select, include_blank: false, collection: BuildScript::STATUSES - end - f.actions - end - - sidebar 'Actions', only: :show do - %w(enable disable update_archive).each do |state| - div do - link_to state.humanize, force_admin_build_script_path(resource, state: state), method: :patch - end if resource.send("can_#{state}?") - end - end - - member_action :force, method: :patch do - resource.send(params[:state]) - flash[:notice] = 'Updated successfully' - redirect_to admin_build_script_path(resource) - end - -end diff --git a/app/admin/node_instructions.rb b/app/admin/node_instructions.rb deleted file mode 100644 index 4ffb23e07..000000000 --- a/app/admin/node_instructions.rb +++ /dev/null @@ -1,92 +0,0 @@ -ActiveAdmin.register NodeInstruction do - permit_params :instruction, :user_id, :output, :status - - menu priority: 3 - - controller do - def scoped_collection - NodeInstruction.includes(:user) - end - end - - filter :user_uname, as: :string - filter :status, as: :select, collection: NodeInstruction::STATUSES - filter :updated_at - - index do - column :id - column :user - - column(:status, sortable: :status) do |ni| - status_tag(ni.status, status_color(ni)) - end - column :updated_at - - actions - end - - form do |f| - f.inputs do - f.input :user, as: :select, include_blank: false, collection: User.system.map { |u| [u.uname, u.id] } - f.input :status, as: :select, include_blank: false, collection: NodeInstruction::STATUSES - f.input :instruction, as: :text - end - f.actions - end - - show do - attributes_table do - row :id - row :user - row(:status, sortable: :status) do |ni| - status_tag(ni.status, status_color(ni)) - end - row :created_at - row :updated_at - row :instruction - row(:output) do |ni| - ni.output.to_s.lines.join('
').html_safe - end - end - end - - sidebar 'Actions', only: :show do - - %w(disable ready restart restart_failed).each do |state| - div do - link_to state.humanize, force_admin_node_instruction_path(resource, state: state), method: :patch - end if resource.send("can_#{state}?") - end - - end - - sidebar 'Actions', only: :index do - locked = NodeInstruction.all_locked? - span(class: "status_tag #{locked ? 'red' : 'green'}") do - if locked - link_to 'Unlock instructions', unlock_all_admin_node_instructions_path, method: :post - else - link_to 'Lock instructions', lock_all_admin_node_instructions_path, method: :post - end - end - end - - collection_action :lock_all, method: :post do - NodeInstruction.lock_all - flash[:notice] = 'Locked successfully' - redirect_to admin_node_instructions_path - end - - collection_action :unlock_all, method: :post do - NodeInstruction.unlock_all - flash[:notice] = 'Unlocked successfully' - redirect_to admin_node_instructions_path - end - - member_action :force, method: :patch do - resource.send(params[:state]) - flash[:notice] = 'Updated successfully' - redirect_to admin_node_instruction_path(resource) - end - -end diff --git a/app/admin/register_requests.rb b/app/admin/register_requests.rb deleted file mode 100644 index 6fd19f1c3..000000000 --- a/app/admin/register_requests.rb +++ /dev/null @@ -1,20 +0,0 @@ -ActiveAdmin.register RegisterRequest do - - menu parent: 'Misc' - - index do - column :id - column :name - - column('User') do |request| - user = User.find_by(email: request.email) if request.approved - link_to(user.uname, admin_user_path(user)) if user - end - column :interest - column :more - column :created_at - - actions - end - -end diff --git a/app/admin/shared/build_script.rb b/app/admin/shared/build_script.rb deleted file mode 100644 index 28f4ca64d..000000000 --- a/app/admin/shared/build_script.rb +++ /dev/null @@ -1,3 +0,0 @@ -def build_script_status_color(bs) - bs.active? ? :green : :red -end \ No newline at end of file diff --git a/app/admin/shared/node_instruction.rb b/app/admin/shared/node_instruction.rb deleted file mode 100644 index c911b8415..000000000 --- a/app/admin/shared/node_instruction.rb +++ /dev/null @@ -1,12 +0,0 @@ -def status_color(ni) - case - when ni.ready? - :green - when ni.disabled? - nil - when ni.failed? - :red - else - :orange - end -end \ No newline at end of file diff --git a/app/assets/javascripts/angularjs/build_lists/build_list_controller.js.coffee b/app/assets/javascripts/angularjs/build_lists/build_list_controller.js.coffee index 6d03e42b2..f17b63efe 100644 --- a/app/assets/javascripts/angularjs/build_lists/build_list_controller.js.coffee +++ b/app/assets/javascripts/angularjs/build_lists/build_list_controller.js.coffee @@ -1,16 +1,10 @@ RosaABF.controller 'BuildListController', ['$scope', '$http', '$timeout', 'SoundNotificationsHelper', ($scope, $http, $timeout, SoundNotificationsHelper) -> - $scope.advisoriable_types = null - $scope.id = $('#build_list_id').val() $scope.build_list = null $scope.subject = {} # See: shared/build_results - $scope.attach_advisory = 'no' # Statuses: advisory_not_found, server_error, continue_input - $scope.search_status = 'continue_input' $scope.term = '' - $scope.advisory = null - $scope.update_type_errors = null $scope.getBuildList = -> $http.get Routes.build_list_path($scope.id, {format: 'json'}) @@ -21,7 +15,6 @@ RosaABF.controller 'BuildListController', ['$scope', '$http', '$timeout', 'Sound $scope.build_list = $scope.subject = build_list $scope.canRefresh = -> - return false if $scope.attach_advisory != 'no' return true unless $scope.build_list show_dependent_projects = _.find $scope.build_list.packages, (p) -> @@ -42,14 +35,6 @@ RosaABF.controller 'BuildListController', ['$scope', '$http', '$timeout', 'Sound else false - # if (!( - # $scope.build_list.status == <%=BuildList::BUILD_PUBLISHED%> || - # $scope.build_list.status == <%=BuildList::REJECTED_PUBLISH%> || - # $scope.build_list.status == <%=BuildList::FAILED_PUBLISH%> || - # $scope.build_list.status == <%=BuildList::BUILD_CANCELED%> || - # $scope.build_list.status == <%=BuildList::BUILD_ERROR%> - # )) { return true; } - $scope.cancelRefresh = null $scope.refresh = -> if $scope.canRefresh() @@ -57,51 +42,4 @@ RosaABF.controller 'BuildListController', ['$scope', '$http', '$timeout', 'Sound $scope.cancelRefresh = $timeout($scope.refresh, 10000) $scope.refresh() - - $scope.search = -> - params = - query: $scope.term - bl_type: $scope.build_list.update_type - format: 'json' - - $http.get Routes.search_advisories_path(params) - .success (results) -> - $scope.search_status = 'continue_input' - $scope.advisory = results - $('#attach_advisory').find('.advisory_id').val($scope.advisory.advisory_id) - .error (data, status, headers, config) -> - $scope.search_status = status == 404 ? 'advisory_not_found' : 'server_error' - $scope.advisory = null - $('#attach_advisory').find('.advisory_id').val('') - - $scope.updateTypeChanged = -> - if _.contains($scope.advisoriable_types, $scope.build_list.update_type) - if $scope.advisory || $scope.term.length > 0 - $scope.search() - else - $scope.attach_advisory = 'no' - - $scope.updateUpdateType() - - $scope.attachAdvisoryChanged = -> - unless _.contains($scope.advisoriable_types, $scope.build_list.update_type) - $scope.build_list.update_type = $scope.advisoriable_types[0] - $scope.updateUpdateType() - - $('#build_list_update_type .nonadvisoriable').attr('disabled', ($scope.attach_advisory != 'no')) - true - - $scope.updateUpdateType = -> - params = - update_type: $scope.build_list.update_type - format: 'json' - $http.put Routes.update_type_build_list_path($scope.id), params - .success (results) -> - $scope.update_type_errors = null - $timeout -> - $('#build_list_update_type').effect('highlight', {}, 1000) - , 100 - .error (data, status, headers, config) -> - $scope.update_type_errors = data.message - ] \ No newline at end of file diff --git a/app/assets/javascripts/angularjs/comments/comment.js.coffee b/app/assets/javascripts/angularjs/comments/comment.js.coffee deleted file mode 100644 index cfa273999..000000000 --- a/app/assets/javascripts/angularjs/comments/comment.js.coffee +++ /dev/null @@ -1,45 +0,0 @@ -commentService = ($http) -> - getPath = (kind, project, commentable, id) -> - if commentable.kind is 'issue' or commentable.kind is 'pull' - if kind is 'remove' or kind is 'update' - return Routes.project_issue_comment_path(project, commentable.id, id) - else if kind is 'add' - return Routes.project_issue_comments_path(project, commentable.id) - - else if commentable.kind is 'commit' - if kind is 'remove' or kind is 'update' - return Routes.project_commit_comment_path(project, commentable.id, id) - else if kind is 'add' - return Routes.project_commit_comments_path(project, commentable.id) - - { - add: (project, commentable, body) -> - path = getPath('add', project, commentable) - params = { comment: { body: body }} - $http.post(path, params) - - addInline: (project, commentable, body, params) -> - path = getPath('add', project, commentable) - params = { - comment: { body: body }, - in_reply: params.in_reply, - line: params.line, - path: params.path - } - $http.post(path, params) - - update: (project, commentable, id) -> - path = getPath('update', project, commentable, id) - params = { comment: { body: $('#comment-'+id+'-body').val() }} - $http.patch(path, params) - - remove: (project, commentable, id) -> - path = getPath('remove', project, commentable, id) - $http.delete(path) - } - -angular - .module("RosaABF") - .factory "Comment", commentService - -commentService.$inject = ['$http'] diff --git a/app/assets/javascripts/angularjs/comments/comments_controller.js.coffee b/app/assets/javascripts/angularjs/comments/comments_controller.js.coffee deleted file mode 100644 index b2e1e4d19..000000000 --- a/app/assets/javascripts/angularjs/comments/comments_controller.js.coffee +++ /dev/null @@ -1,218 +0,0 @@ -CommentsController = (Comment, Preview, confirmMessage, $scope, compileHTML, $rootScope) -> - - inlineCommentParams = {} - list = null - new_inline_form = $('.new_inline_comment_form.hidden') - - setInlineCommentParams = (params) -> - inlineCommentParams = params - - findInlineComments = ($event, params) -> - if params.in_reply - $('#comment'+params.in_reply).parents('tr').find('td .line-comment:last') - else - $($event.target).parents('tr') - - insertCommentForm = (line_comments, form) -> - if inlineCommentParams.in_reply - new_form = compileHTML.run($scope, form) - line_comments.append(new_form) - else - if line_comments.hasClass('line-comments') - new_form = form - new_form = compileHTML.run($scope, new_form) - line_comments.find('td.line-comments:last').append(new_form) - else - new_form = "" + - "" + form + "" - new_form = compileHTML.run($scope, new_form) - line_comments.after(new_form) - true - - vm = this - - vm.isDisabledNewInlineCommentButton = -> - vm.processing || vm.new_inline_body is '' || !vm.new_inline_body - - vm.isDisabledNewCommentButton = -> - vm.processing || vm.new_body is '' || !vm.new_body - - vm.previewBody = (id) -> - if id is 'new-comment' - body = vm.new_body - else if id is 'new-inline-comment' - body = vm.new_inline_body - else - body = $('#'+id+'-body').val() - - if body is '' or !body - vm.preview_body = '' - return false - if body is Preview.old_text - return false - - return false if vm.processing - vm.processing = true - Preview.old_text = '' - - promise = Preview.get_preview(vm.project, body) - promise.success( (response) -> - vm.preview_body = response.html - Preview.old_text = body - ).error( (response) -> - vm.preview_body = 'Error :(' - ) - - vm.processing = false - false - - vm.toggleEditForm = (id)-> - $('.open-comment').addClass('hidden') - form = $('.open-comment.comment-'+id) - if form.length is 1 - form.removeClass('hidden') - ########## Maybe Chrome 43 bug? don't show text in the textarea :( - textarea = form.find('.form-group textarea') - tmp = textarea.val() - textarea.val('') - textarea.val(tmp) - ########## - true - else - false - - vm.closeEditForm = (id)-> - $('.open-comment.comment-'+id).addClass('hidden') - false - - vm.add = ($event)-> - $event.preventDefault() - $event.stopPropagation() - - vm.processing = true - Comment.add(vm.project, vm.commentable, vm.new_body) - .success (data) -> - element = compileHTML.run($scope, data.html) - list.append(element) - - vm.new_body = '' - location.hash = "#comment" + data.id; - vm.processing = false - $.notify(data.message, 'success') - .error (data) -> - $.notify(data.message, 'error') - vm.processing = false - - false - - vm.remove = (id) -> - return false unless confirmMessage.show() - vm.processing = true - Comment.remove(vm.project, vm.commentable, id) - .success (data)-> - parent = $('#comment'+id+',#diff-comment'+id).parents('tr.line-comments') - if parent.find('.line-comment').length is 1 - # there is only one line comment, remove all line - parent.remove() - else - $('#comment'+id+',#diff-comment'+id+',#update-comment'+id).remove() - - $.notify(data.message, 'success') - vm.processing = false - .error (data)-> - $.notify(data.message, 'error') - vm.processing = false - - false - - vm.update = (id) -> - vm.processing = true - Comment.update(vm.project, vm.commentable, id) - .success (data) -> - form = $('#comment'+id+ ' .md_and_cm.cm-s-default').html(data.body) - - $.notify(data.message, 'success') - vm.processing = false - form = $('.open-comment.comment-'+id) - if form.length is 1 - form.addClass('hidden') - return true - else - return false - .error (data) -> - $.notify(data.message, 'error') - vm.processing = false - - vm.showInlineForm = ($event, params = {}) -> - line_comments = findInlineComments($event, params) - return false if line_comments.count is 0 - - vm.new_inline_body = null - vm.hideInlineForm() - setInlineCommentParams(params) - insertCommentForm(line_comments, new_inline_form.html()) - tmp = line_comments.find('#new_inline_comment') - $('table.table #new_inline_comment').addClass('cloned') - true - - vm.hideInlineForm = (is_new_comment = false)-> - parent = $('#new_inline_comment.cloned').parents('tr.line-comments') - if !is_new_comment and parent.find('.line-comment').length is 1 - # there is only one line comment, remove all line - parent.remove() - else - $('#new_inline_comment.cloned').remove() - - inlineCommentParams = {} - false - - vm.hideInlineCommentButton = (params = {}) -> - _.isEqual(inlineCommentParams, params) - - vm.addInline = ($event) -> - line_comments = findInlineComments($event, inlineCommentParams) - return false if line_comments.count is 0 - - vm.processing = true - promise = Comment.addInline(vm.project, vm.commentable, vm.new_inline_body, inlineCommentParams) - promise.then (response) -> - vm.hideInlineForm(true) - insertCommentForm(line_comments, response.data.html) - - vm.new_inline_body = '' - location.hash = "#comment" + response.data.id; - vm.processing = false - - false - - $rootScope.$on "compile_html", (event, args) -> - html = compileHTML.run($scope, args.html) - args.element.html(html) - true - - vm.init = (project, commentable = {}) -> - vm.project = project - vm.commentable = commentable - vm.processing = false - vm.k = 10 - if commentable.kind is 'issue' or commentable.kind is 'commit' - list = $('#comments_list') - else if commentable.kind is 'pull' - list = $('#pull-activity') - else - list = $() - true - true - -angular - .module("RosaABF") - .controller "CommentsController", CommentsController - -CommentsController.$inject = [ - 'Comment' - 'Preview' - 'confirmMessage' - '$scope' - 'compileHTML' - '$rootScope' - ] diff --git a/app/assets/javascripts/angularjs/controllers/activity_controller.js.coffee b/app/assets/javascripts/angularjs/controllers/activity_controller.js.coffee index 9a100ff07..d35a4a102 100644 --- a/app/assets/javascripts/angularjs/controllers/activity_controller.js.coffee +++ b/app/assets/javascripts/angularjs/controllers/activity_controller.js.coffee @@ -1,9 +1,5 @@ ActivityController = ($scope, $http, $timeout, $q, $filter, $location, ActivityFilter) -> - getIssuesTab = (kind)-> - return vm.tracker_tab if kind is 'tracker' - return vm.pull_requests_tab if kind is 'pull_requests' - calculateChangeDate = (feed)-> prev_date = null _.each(feed, (event)-> @@ -27,12 +23,8 @@ ActivityController = ($scope, $http, $timeout, $q, $filter, $location, ActivityF vm.processing = false vm.activity_tab = - filter: 'all' - all: {} - code: {} - tracker: {} + filter: 'build' build: {} - wiki: {} owner_filter: null project_name_filter: null owner_uname_filter_tmp: null @@ -41,29 +33,6 @@ ActivityController = ($scope, $http, $timeout, $q, $filter, $location, ActivityF vm.own_activity_tab = $.extend({}, vm.activity_tab) vm.current_activity_tab = vm.activity_tab - vm.tracker_tab = - content: [] - filter: - all: true - assigned: false - created: false - name: 'all' - all_count: 0 - assigned_count: 0 - created_count: 0 - closed_count: 0 - sort: - sort: 'updated' - direction: 'desc' - updated_class: 'fa-chevron-up' - status: 'open' - pagination: - page: 1 - total_count: 0 - - vm.pull_requests_tab = $.extend({}, vm.tracker_tab) - - vm.init = (active_tab)-> switch active_tab when 'activity' @@ -72,10 +41,6 @@ ActivityController = ($scope, $http, $timeout, $q, $filter, $location, ActivityF when 'own_activity' vm.own_activity_tab.active = true vm.current_activity_tab = vm.own_activity_tab - when 'issues' - vm.tracker_tab.active = true - when active_tab is 'pull_requests' - vm.pull_requests_tab.active = true true vm.getContent = (tab)-> @@ -83,8 +48,6 @@ ActivityController = ($scope, $http, $timeout, $q, $filter, $location, ActivityF when 'activity' vm.activity_tab.active = true vm.own_activity_tab.active = false - vm.tracker_tab.active = false - vm.pull_requests_tab.active = false vm.current_activity_tab = vm.activity_tab vm.getActivityContent() if $location.path() isnt '/' @@ -93,37 +56,14 @@ ActivityController = ($scope, $http, $timeout, $q, $filter, $location, ActivityF when 'own_activity' vm.activity_tab.active = false vm.own_activity_tab.active = true - vm.tracker_tab.active = false - vm.pull_requests_tab.active = false vm.current_activity_tab = vm.own_activity_tab vm.getActivityContent() if $location.path() isnt '/own_activity' $location.path('/own_activity').replace() - when 'tracker' - vm.activity_tab.active = false - vm.own_activity_tab.active = false - vm.tracker_tab.active = true - vm.pull_requests_tab.active = false - vm.getIssuesContent() - if $location.path() isnt '/issues' - $location.path('/issues').replace() - - when 'pull_requests' - vm.activity_tab.active = false - vm.own_activity_tab.active = false - vm.tracker_tab.active = false - vm.pull_requests_tab.active = true - vm.getIssuesContent() - if $location.path() isnt '/pull_requests' - $location.path('/pull_requests').replace() - vm.getTimeLinefaClass = (content)-> template = switch content.kind when 'build_list_notification' then 'btn-success fa-gear' - when 'new_comment_notification', 'new_comment_commit_notification' then 'btn-warning fa-comment' - when 'git_new_push_notification' then 'bg-primary fa-sign-in' - when 'new_issue_notification' then 'btn-warning fa-check-square-o' else 'btn-warning fa-question' template @@ -142,15 +82,9 @@ ActivityController = ($scope, $http, $timeout, $q, $filter, $location, ActivityF cur_tab.feed.push.apply(cur_tab.feed, res.data.feed) cur_tab.next_page_link = res.data.next_page_link - vm.changeActivityFilter = (filter)-> - return if vm.current_activity_tab.filter is filter - vm.current_activity_tab.filter = filter - vm.getActivityContent() - vm.getActivityContent = ()-> vm.processing = true options = - filter: vm.current_activity_tab.filter owner_filter: vm.current_activity_tab.owner_filter project_name_filter: vm.current_activity_tab.project_name_filter format: 'json' @@ -168,67 +102,6 @@ ActivityController = ($scope, $http, $timeout, $q, $filter, $location, ActivityF vm.processing = false true - vm.setIssuesFilter = (kind, issues_filter)-> - filter = getIssuesTab(kind).filter - - filter.all = false - filter.assigned = false - filter.created = false - filter[issues_filter] = true - filter.name = issues_filter - vm.getIssuesContent() - - vm.getIssuesContent = ()-> - if vm.tracker_tab.active - tab = vm.tracker_tab - path = Routes.issues_path( - filter: tab.filter.name - sort: tab.sort.sort - direction: tab.sort.direction - status: tab.status - page: tab.pagination.page - format: 'json') - else if vm.pull_requests_tab.active - tab = vm.pull_requests_tab - path = Routes.pull_requests_path( - filter: tab.filter.name - sort: tab.sort.sort - direction: tab.sort.direction - status: tab.status - page: tab.pagination.page - format: 'json') - - $http.get(path).then (res)-> - tab.content = res.data.content - tab.filter.all_count = res.data.all_count - tab.filter.assigned_count = res.data.assigned_count - tab.filter.created_count = res.data.created_count - tab.filter.closed_count = res.data.closed_count - tab.filter.open_count = res.data.open_count - tab.pagination.page = res.data.page - tab.pagination.total_items = parseInt(res.data.issues_count, 10) - - vm.setIssuesSort = (kind, issues_sort)-> - tab = getIssuesTab(kind) - if tab.sort.direction is 'desc' - tab.sort = { sort: issues_sort, direction: 'asc' } - sort_class = 'fa-chevron-down' - else - tab.sort = { sort: issues_sort, direction: 'desc' } - sort_class = 'fa-chevron-up' - - tab.sort[issues_sort+'_class'] = sort_class - vm.getIssuesContent() - - vm.setIssuesStatus = (kind, issues_status)-> - tab = getIssuesTab(kind) - tab.status = issues_status - tab.pagination.page = 1 - vm.getIssuesContent() - - vm.selectPage = (kind, page)-> - vm.getIssuesContent() - vm.getOwnersList = (value)-> return [] if value.length < 1 ActivityFilter.get_owners(value) diff --git a/app/assets/javascripts/angularjs/controllers/advisories_controller.js b/app/assets/javascripts/angularjs/controllers/advisories_controller.js deleted file mode 100644 index 64fd2e4e1..000000000 --- a/app/assets/javascripts/angularjs/controllers/advisories_controller.js +++ /dev/null @@ -1,25 +0,0 @@ -RosaABF.controller('AdvisoryCtrl', ['$scope', '$http', function($scope, $http) { - $scope.total_items = null; - $scope.page = null; - $scope.advisories = null; - $scope.q = null; - - $scope.init = function(q) { - $scope.q = q; - }; - - $scope.getAdvisories = function() { - $http.get(Routes.advisories_path({format: 'json', page: $scope.page, q: $scope.q})).then(function(res) { - $scope.page = res.data.page; - $scope.total_items = res.data.advisories_count; - $scope.advisories = res.data.advisories; - }); - }; - - $scope.goToPage = function(page) { - $scope.page = page; - $scope.getAdvisories(); - }; - - $scope.getAdvisories(); -}]); diff --git a/app/assets/javascripts/angularjs/controllers/git_tree_controller.js b/app/assets/javascripts/angularjs/controllers/git_tree_controller.js deleted file mode 100644 index 46cae3787..000000000 --- a/app/assets/javascripts/angularjs/controllers/git_tree_controller.js +++ /dev/null @@ -1,70 +0,0 @@ -RosaABF.controller('GitTreeCtrl', ['$scope', '$http', '$location', function($scope, $http, $location) { - $scope.project = null; - $scope.treeish = null; - $scope.root_path = null; - $scope.tree = null; - $scope.breadcrumb = null; - $scope.processing = false; - - $scope.init = function(project, treeish, path) { - $scope.project = project; - $scope.treeish = treeish; - $scope.path = path; - }; - - $scope.refresh = function(more) { - var params = { format: 'json', path: $scope.path }; - - if(more) { - params.page = $scope.next_page; - $scope.load_more = true; - } - else { - $scope.processing = true; - } - - $http.get(Routes.tree_path($scope.project, $scope.treeish, params)).then(function(res) { - $scope.path = res.data.path; - $scope.root_path = res.data.root_path; - $scope.breadcrumb = res.data.breadcrumb; - $scope.next_page = res.data.next_page; - if(more) { - $scope.tree.push.apply($scope.tree, res.data.tree); - $scope.load_more = false; - } - else { - $scope.tree = res.data.tree; - $scope.processing = false; - } - }); - }; - - $scope.$on('$locationChangeSuccess', function(event) { - path = typeof $location.search()['path'] !== 'undefined' ? $location.search()['path'] : false; - if(path) { - $scope.path = path; - } - $scope.refresh(); - }); - - $scope.getTree = function($event, path, more) { - if($scope.processing && $event) { - return $event.preventDefault(); - } - - more = typeof more !== 'undefined' ? more : false; - if(path && path !== '') { $scope.path = path; } - else { $scope.path = null; } - - if(more) { - $scope.refresh(more); - } - else { - $location.search('path', $scope.path); - } - - if($event) { - $event.preventDefault(); - } - }; -}]); diff --git a/app/assets/javascripts/angularjs/controllers/project_branches_controller.js b/app/assets/javascripts/angularjs/controllers/project_branches_controller.js deleted file mode 100644 index 9fc754c6d..000000000 --- a/app/assets/javascripts/angularjs/controllers/project_branches_controller.js +++ /dev/null @@ -1,80 +0,0 @@ -RosaABF.controller('ProjectBranchesController', ['$scope', '$http', 'ApiProject', function($scope, $http, ApiProject) { - - $scope.singleton = ApiProject.singleton; - $scope.branches = []; - - $scope.current_ref = null; - $scope.project_resource = null; - - $scope.init = function(owner_uname, project_name, ref) { - $scope.current_ref = ref; - - $scope.project_resource = ApiProject.resource.get( - {owner: owner_uname, project: project_name}, - function(results) { - $scope.project = new Project(results.project); - $scope.getBranches(); - } - ); - - } - - $scope.getBranches = function() { - - $scope.project_resource.$branches( - {owner: $scope.project.owner.uname, project: $scope.project.name}, - function(results) { - $scope.branches = []; - _.each(results.refs_list, function(ref){ - var result = new ProjectRef(ref); - if (result.ref == $scope.current_ref) { - $scope.branches.unshift(result); - } else { - $scope.branches.push(result); - } - }); - $scope.updateBranchesCount(); - } - ); - - } - - $scope.updateBranchesCount = function() { - $scope.singleton.project.branches_count = $scope.branches.length; - } - - $scope.create = function(branch) { - branch.ui_container = false; - $scope.project_resource.$create_branch( - { - owner: $scope.project.owner.uname, - project: $scope.project.name, - from_ref: branch.ref, - new_ref: branch.new_ref - }, function() { // on success - $scope.getBranches(); - }, function () { // on error - $scope.getBranches(); - } - ); - } - - $scope.destroy = function(branch) { - $scope.project_resource.$delete_branch( - {owner: $scope.project.owner.uname, project: $scope.project.name, ref: branch.ref}, - function() { // on success - var i = $scope.branches.indexOf(branch); - if(i != -1) { $scope.branches.splice(i, 1); } - - $scope.updateBranchesCount(); - // Removes branch from "Current branch/tag:" select box - $('#branch_selector option').filter(function() { - return this.value.match('.*\/branches\/' + branch.ref + '$'); - }).remove(); - }, function () { // on error - $scope.getBranches(); - } - ); - } - -}]); \ No newline at end of file diff --git a/app/assets/javascripts/angularjs/controllers/project_repo_block_controller.js b/app/assets/javascripts/angularjs/controllers/project_repo_block_controller.js deleted file mode 100644 index 6a6910d67..000000000 --- a/app/assets/javascripts/angularjs/controllers/project_repo_block_controller.js +++ /dev/null @@ -1,12 +0,0 @@ -RosaABF.controller('ProjectRepoBlockController', ['$scope', 'ApiProject', function($scope, ApiProject) { - - $scope.clone_url = null; - $scope.singleton = ApiProject.singleton; - $scope.clone_url_protocol = 'ssh'; - $scope.is_collapsed_git_help = true; - - $scope.init = function(clone_url, branches) { - $scope.clone_url = clone_url; - $scope.singleton.project.branches_count = branches; - } -}]); diff --git a/app/assets/javascripts/angularjs/controllers/project_tags_controller.js b/app/assets/javascripts/angularjs/controllers/project_tags_controller.js deleted file mode 100644 index 9042eb4c6..000000000 --- a/app/assets/javascripts/angularjs/controllers/project_tags_controller.js +++ /dev/null @@ -1,31 +0,0 @@ -RosaABF.controller('ProjectTagsController', ['$scope', '$http', 'ApiProject', function($scope, $http, ApiProject) { - - $scope.tags = []; - $scope.project_resource = null; - - $scope.init = function(owner_uname, project_name) { - $scope.project_resource = ApiProject.resource.get( - {owner: owner_uname, project: project_name}, - function(results) { - $scope.project = new Project(results.project); - $scope.getTags(); - } - ); - - } - - $scope.getTags = function() { - - $scope.project_resource.$tags( - {owner: $scope.project.owner.uname, project: $scope.project.name}, - function(results) { - $scope.tags = []; - _.each(results.refs_list, function(ref){ - $scope.tags.push(new ProjectRef(ref)); - }); - } - ); - - } - -}]); \ No newline at end of file diff --git a/app/assets/javascripts/angularjs/issues/issue.js.coffee b/app/assets/javascripts/angularjs/issues/issue.js.coffee deleted file mode 100644 index 386666e97..000000000 --- a/app/assets/javascripts/angularjs/issues/issue.js.coffee +++ /dev/null @@ -1,72 +0,0 @@ -issueService = ($http) -> - getFormParams = (kind, extra = {}) -> - if kind is 'title_body' - { - issue: { - title: $('#issue_title').val() - body: $('#issue-body').val() - } - } - else if kind is 'labels' - if extra.label.selected is false - is_destroy = '1' - else - is_destroy = '0' - { - issue: { - labelings_attributes: - [{ - id: extra.label.labeling_id, - label_id: extra.label.id, - _destroy: is_destroy - }] - } - } - else if kind is 'assignee' - { - issue: { - assignee_id: extra.assignee.id - } - } - else if kind is 'status' - if extra.status.name isnt 'closed' - status = 'closed' - else - status = 'open' - - { - issue: { - status: status - } - } - - { - getIssues: (project, filter) -> - params = { - kind: filter.kind - filter: filter.name - sort: filter.sort - direction: filter.sort_direction - status: filter.status - labels: filter.labels - page: filter.page - } - - path = Routes.project_issues_path(project, params) - $http.get(path) - - getAssignees: (project, val) -> - path = Routes.search_collaborators_project_issues_path(project, {search_user: val}) - $http.get(path) - - update: (project, id, kind, extra = {}) -> - params = getFormParams(kind, extra) - path = Routes.project_issue_path(project, id) - $http.put(path, params) - } - -angular - .module("RosaABF") - .factory "Issue", issueService - -issueService.$inject = ['$http'] diff --git a/app/assets/javascripts/angularjs/issues/issue_controller.js.coffee b/app/assets/javascripts/angularjs/issues/issue_controller.js.coffee deleted file mode 100644 index c782ed561..000000000 --- a/app/assets/javascripts/angularjs/issues/issue_controller.js.coffee +++ /dev/null @@ -1,162 +0,0 @@ -IssueController = (dataservice, $http, Issue, $rootScope, Preview, Label, confirmMessage) -> - - updateIssueFromResponse = (response) -> - $('#issue_title_text').html(response.data.title) - $('#issue_body_text').html(response.data.body) - vm.assignee = response.data.assignee - vm.labels = response.data.labels - vm.status = response.data.status - - updateStatusCLass() - - getLabels = -> - promise = Label.get_labels(vm.project) - promise.then (response) -> - old_labels = vm.labels - vm.labels = response.data - _.each(vm.labels, (l) -> - _.each(old_labels, (ol) -> - if l.id is ol.id - l.selected = ol.selected - l.style = ol.style - l.selected_id = ol.selected_id - ) - ) - true - - updateStatusCLass = -> - if vm.status.name is 'open' or vm.status.name is 'reopen' - vm.issue_status_class = 'btn-primary' - else - vm.issue_status_class = 'btn-danger' - - - vm = this - - vm.previewBody = -> - body = $('#issue-body').val() - if body is '' or !body - vm.preview_body = '' - return false - if body is Preview.old_text - return false - - return false if vm.processing - vm.processing = true - - promise = Preview.get_preview(vm.project, body) - promise.success( (response) -> - vm.preview_body = response.html - Preview.old_text = body - ).error( (response) -> - vm.preview_body = 'Error :(' - ) - - vm.processing = false - false - - vm.toggleLabel = (label) -> - if vm.action is 'show' - return false if vm.processing_issue_labels - vm.processing_issue_labels = true - - label.selected = !label.selected - if label.selected - label.style = label.default_style - label.selected_id = label.id - else - label.selected_id = null - label.style = {} - - if vm.action is 'show' - vm.updateIssue('labels', label: label) - true - - vm.getAssignees = (val) -> - vm.processing_issue_assignee = true - promise = Issue.getAssignees(vm.project, val) - promise.then (response) -> - vm.processing_issue_assignee = false - response.data - - vm.selectAssignee = (item, model, label) -> - if vm.action is 'show' - return false if vm.processing_issue_assignee - vm.processing_issue_assignee = true - - vm.assignee = item - - if vm.action is 'show' - vm.updateIssue('assignee', assignee: vm.assignee) - vm.toggle_manage_assignee = false - false - - vm.removeAssignee = () -> - return false unless confirmMessage.show() - if vm.action is 'show' - return false if vm.processing_issue_assignee - vm.processing_issue_assignee = true - - vm.assignee = {} - - if vm.action is 'show' - vm.updateIssue('assignee', assignee: vm.assignee) - vm.toggle_manage_assignee = false - false - - vm.updateStatus = -> - return false if vm.action isnt 'show' - return false if vm.processing_issue_status - vm.processing_issue_status = true - vm.updateIssue('status', status: vm.status) - false - - vm.updateIssue = (kind, extra = {}) -> - promise = Issue.update(vm.project, vm.serial_id, kind, extra) - promise.then (response) -> - updateIssueFromResponse(response) - vm.edit = false if kind is 'title_body' - if vm.action is 'show' and vm.processing_issue_assignee - vm.processing_issue_assignee = false - if vm.action is 'show' and vm.processing_issue_labels - vm.processing_issue_labels = false - if vm.action is 'show' and vm.processing_issue_status - vm.processing_issue_status = false - false - - - $rootScope.$on "updateLabels", (event, args) -> - getLabels() - - init = (dataservice) -> - vm.project = dataservice.project - vm.serial_id = dataservice.serial_id - vm.labels = dataservice.labels - vm.action = dataservice.action - vm.assignee = dataservice.assignee - vm.status = dataservice.status - - vm.toggle_manage_assignee = false - vm.processing = false - - vm.processing_issue_labels = false - vm.processing_issue_assignee = false - - updateStatusCLass() - - init(dataservice) - true - -angular - .module("RosaABF") - .controller "IssueController", IssueController - -IssueController.$inject = [ - 'IssueInitializer' - '$http' - 'Issue' - '$rootScope' - 'Preview' - 'Label' - 'confirmMessage' - ] diff --git a/app/assets/javascripts/angularjs/issues/issues_controller.js.coffee b/app/assets/javascripts/angularjs/issues/issues_controller.js.coffee deleted file mode 100644 index b599f77f8..000000000 --- a/app/assets/javascripts/angularjs/issues/issues_controller.js.coffee +++ /dev/null @@ -1,109 +0,0 @@ -IssuesController = (dataservice, $http, $location, Issue, $rootScope) -> - - getIssues = () -> - prepareLabelsFilter() - promise = Issue.getIssues(vm.project, vm.filter) - promise.then (response) -> - vm.issues = response.data.issues - - vm.filter.page = response.data.page - vm.filter.all_count = response.data.all_count - vm.filter.created_count = response.data.created_count - vm.filter.assigned_count = response.data.assigned_count - vm.filter.opened_count = response.data.opened_count - vm.filter.closed_count = response.data.closed_count - vm.filter.filtered_count = response.data.filtered_count - - vm.labels = response.data.labels - true - - setSortClass = -> - if vm.filter.sort_direction is 'asc' - sort_class = 'fa-chevron-down' - else - sort_class = 'fa-chevron-up' - - if vm.filter.sort is 'updated' - vm.updated_class = sort_class - vm.submitted_class = null - else - vm.updated_class = null - vm.submitted_class = sort_class - - prepareLabelsFilter = () -> - vm.filter.labels = [] - _.each(vm.labels, (l) -> - vm.filter.labels.push(l.name) if l.selected - ) - - vm = this - - vm.setIssuesFilter = (filter) -> - vm.filter.all = false - vm.filter.assigned = false - vm.filter.created = false - vm.filter[filter] = true - vm.filter.name = filter - - getIssues() - - vm.setIssuesSort = (issues_sort) -> - if vm.filter.sort_direction is 'desc' - vm.filter.sort_direction = 'asc' - else - vm.filter.sort_direction = 'desc' - - vm.filter.sort = issues_sort - setSortClass() - getIssues() - - vm.setIssuesStatus = (issues_status) -> - vm.filter.status = issues_status - vm.filter.page = 1 - getIssues() - - vm.goToPage = (page) -> - getIssues() - - vm.toggleLabelFilter = (label) -> - label.selected = !label.selected - if label.selected - label.style = label.default_style - else - label.style = {} - getIssues() - - vm.selectLabelFilter = (name) -> - label = null - _.each(vm.labels, (l) -> - l.selected = false - label = l if l.name is name - ) - vm.toggleLabelFilter(label) if label - - $rootScope.$on "updateLabels", (event, args) -> - getIssues() - - init = (dataservice) -> - vm.project = dataservice.project - vm.filter = dataservice.filter - vm.labels = dataservice.labels - - vm.filter[dataservice.filter.filter] = true - - if vm.filter.status == "closed" - vm.filter.status_closed = true - else - vm.filter.status_open = true - - setSortClass() - getIssues() - - init(dataservice) - true - -angular - .module("RosaABF") - .controller "IssuesController", IssuesController - -IssuesController.$inject = ['IssuesInitializer', '$http', '$location', 'Issue', '$rootScope'] diff --git a/app/assets/javascripts/angularjs/labels/label.js.coffee b/app/assets/javascripts/angularjs/labels/label.js.coffee deleted file mode 100644 index 2352182cb..000000000 --- a/app/assets/javascripts/angularjs/labels/label.js.coffee +++ /dev/null @@ -1,44 +0,0 @@ -labelService = ($http) -> - { - default_colors: [ - '0054a6' - '00a651' - 'ed1c24' - 'e65c00' - '9e005d' - '464646' - '8c6239' - ] - - add: (project, label) -> - params = { - name: label.name - color: label.color - } - - path = Routes.create_label_project_issues_path(project, params) - $http.post(path) - - update: (project, label) -> - params = { - name: label.name - color: label.color - } - - path = Routes.project_issues_update_label_path(project, label.id, params) - $http.post(path) - - remove: (project, label) -> - path = Routes.project_issues_delete_label_path(project, label.id) - $http.post(path) - - get_labels: (project) -> - path = Routes.project_labels_path(project) - $http.get(path) - } - -angular - .module("RosaABF") - .factory "Label", labelService - -labelService.$inject = ['$http'] diff --git a/app/assets/javascripts/angularjs/labels/labels_controller.js.coffee b/app/assets/javascripts/angularjs/labels/labels_controller.js.coffee deleted file mode 100644 index bc7b17623..000000000 --- a/app/assets/javascripts/angularjs/labels/labels_controller.js.coffee +++ /dev/null @@ -1,85 +0,0 @@ -LabelsController = (dataservice, $http, Label, $rootScope, $scope, confirmMessage) -> - - $scope.$watch (-> - vm.label.color - ), () -> - vm.label.color = vm.label.color.replace(/[^a-f0-9]/gmi,'') if vm.label.color - - vm = this - - - vm.colorClass = (color) -> - if vm.label.color == color - 'fa-check-circle' - else - 'fa-circle' - - vm.colorStyle = (color) -> - color: '#'+color - - vm.colorPreviewStyle = () -> - color: '#FFF' - background: '#'+vm.label.color - - vm.selectCurrentLabel = (l) -> - vm.label.id = l.id - vm.label.name = l.name - vm.label.color = l.color - vm.is_new_label = false - false - - vm.saveLabel = () -> - return false unless vm.label.name && vm.label.color - - if vm.is_new_label - promise = Label.add(vm.project, vm.label) - else - promise = Label.update(vm.project, vm.label) - promise.success( (data) -> - vm.labels = data - vm.errors = [] - $rootScope.$broadcast('updateLabels') - ).error( (data) -> - vm.errors = data - ) - - false - - vm.removeLabel = (l) -> - return false unless confirmMessage.show() - promise = Label.remove(vm.project, l) - promise.success (data) -> - $rootScope.$broadcast('updateLabels') - - false - - - init = (dataservice) -> - vm.project = dataservice.project - vm.labels = dataservice.labels - vm.is_collapsed_manage_block = true - - vm.default_colors = Label.default_colors - vm.label = { - id: null - name: null - color: vm.default_colors[0] - } - vm.is_new_label = true - vm.processing = false - - init(dataservice) - true - -angular - .module("RosaABF") - .controller "LabelsController", LabelsController - -LabelsController.$inject = [ - 'LabelsInitializer' - '$http' - 'Label' - '$rootScope' - '$scope' - 'confirmMessage' - ] diff --git a/app/assets/javascripts/angularjs/models/project_ref.js b/app/assets/javascripts/angularjs/models/project_ref.js deleted file mode 100644 index 71f7b1aea..000000000 --- a/app/assets/javascripts/angularjs/models/project_ref.js +++ /dev/null @@ -1,30 +0,0 @@ -var ProjectRef = function(atts) { - var self = this; - var initialSettings = atts || {}; - //initial settings if passed in - for(var setting in initialSettings){ - if(initialSettings.hasOwnProperty(setting)) - self[setting] = initialSettings[setting]; - }; - - - - //with some logic... - self.isTag = self.object.type == 'tag'; - self.ui_container = false; - - self.path = function(project) { - return Routes.tree_path(project.fullname, self.ref); - } - - self.diff_path = function(project, current_ref) { - return Routes.diff_path(project.fullname, current_ref + '...' + self.ref); - } - - self.archive_path = function(project, type) { - return Routes.archive_path(project.fullname, project.name + '-' + self.ref, {format: type}); - } - - //return the scope-safe instance - return self; -}; \ No newline at end of file diff --git a/app/assets/javascripts/angularjs/projects/collaborators_controller.js.coffee b/app/assets/javascripts/angularjs/projects/collaborators_controller.js.coffee deleted file mode 100644 index 1050803ec..000000000 --- a/app/assets/javascripts/angularjs/projects/collaborators_controller.js.coffee +++ /dev/null @@ -1,87 +0,0 @@ -CollaboratorsController = (dataservice, Collaborator, $http, confirmMessage) -> - vm = this - - vm.new_role = 'reader' - - vm.isDisabledDeleteAllButton = -> - is_selected = true - result = _.select(vm.collaborators, (c) -> - is_selected = false if c.check_delete - ) - is_selected - - vm.getCollaborators = (val) -> - return [] if val.length <= 2 - Collaborator.find(vm.name_with_owner, val) - - vm.selectCollaborator = (item, model, label) -> - vm.selected_new_collaborator = item - false - - vm.addCollaborator = ($event) -> - $event.preventDefault() - $event.stopPropagation() - - Collaborator.add(vm.name_with_owner, - vm.selected_new_collaborator, - vm.new_role, - vm.project_id) - .success (data) -> - vm.collaborators.push data - $.notify(data.message, 'success') - .error (data) -> - $.notify(data.message, 'error') - - vm.new_collaborator_uname = null - vm.selected_new_collaborator = null - false - - vm.removeCollaborator = (member, need_confirm = true) -> - return false if need_confirm and !confirmMessage.show() - Collaborator.remove(vm.name_with_owner, member.id) - .success (data) -> - vm.collaborators = _.reject(vm.collaborators, (c) -> - c.id is member.id - ) - $.notify(data.message, 'success') - .error (data) -> - $.notify(data.message, 'error') - - false - - vm.removeCollaborators = -> - return false unless confirmMessage.show() - _.each(vm.collaborators, (c) -> - vm.removeCollaborator(c, false) if c.check_delete - ) - false - - vm.updateCollaborator = (member) -> - return false unless confirmMessage.show() - Collaborator.update(vm.name_with_owner, member) - .success (data) -> - $.notify(data.message, 'success') - .error (data) -> - $.notify(data.message, 'error') - false - - init = (dataservice) -> - vm.name_with_owner = dataservice.name_with_owner - vm.project_id = dataservice.project_id - - vm.collaborators = dataservice.collaborators - - init(dataservice) - return true - - -angular - .module("RosaABF") - .controller "CollaboratorsController", CollaboratorsController - -CollaboratorsController.$inject = [ - 'CollaboratorsInitializer' - 'Collaborator' - '$http' - 'confirmMessage' - ] diff --git a/app/assets/javascripts/angularjs/pull_requests/pull_request.js.coffee b/app/assets/javascripts/angularjs/pull_requests/pull_request.js.coffee deleted file mode 100644 index 437c148e0..000000000 --- a/app/assets/javascripts/angularjs/pull_requests/pull_request.js.coffee +++ /dev/null @@ -1,48 +0,0 @@ -ApiPullRequestService = ($resource, $http) -> - - getPath = (pull, kind) -> - name_with_owner = pull.owner+'/'+pull.project - switch kind - when 'activity' then params = { get_activity: true } - when 'diff' then params = { get_diff: true } - when 'commits' then params = { get_commits: true } - Routes.project_pull_request_path(name_with_owner, pull.serial_id, params) - - PullRequestResource = $resource("/:owner/:project/pull_requests/:serial_id?format=json", - owner: "@pull_request.to_ref.project.owner_uname" - project: "@pull_request.to_ref.project.name" - serial_id: "@pull_request.number" - , - update: - method: "PUT" - isArray: false - - merge: - url: "/:owner/:project/pull_requests/:serial_id/merge" - format: "json" - method: "PUT" - isArray: false - ) - - get_activity = (params) -> - path = getPath(params, 'activity') - $http.get(path) - - get_diff = (params) -> - path = getPath(params, 'diff') - $http.get(path) - - get_commits = (params) -> - path = getPath(params, 'commits') - $http.get(path) - - resource: PullRequestResource - get_activity: get_activity - get_diff: get_diff - get_commits: get_commits - -angular - .module("RosaABF") - .factory "ApiPullRequest", ApiPullRequestService - -ApiPullRequestService.$inject = ['$resource', '$http'] diff --git a/app/assets/javascripts/angularjs/pull_requests/pull_request_controller.js.coffee b/app/assets/javascripts/angularjs/pull_requests/pull_request_controller.js.coffee deleted file mode 100644 index b2c49e1d1..000000000 --- a/app/assets/javascripts/angularjs/pull_requests/pull_request_controller.js.coffee +++ /dev/null @@ -1,179 +0,0 @@ -PullRequestController = (dataservice, $http, ApiPullRequest, ApiProject, DateTimeFormatter, - compileHTML, $scope, $rootScope) -> - vm = this - - vm.project_resource = null - - vm.pull_params = null - vm.pull = null - vm.pull_resource = null - - vm.merged_at = null - vm.closed_at = null - vm.branch = null - - vm.can_delete_branch = false - - activity = $('#pull-activity') - diff = $('#diff.tab-pane .content') - commits = $('#commits.tab-pane .content') - - vm.active_tab = null - - vm.processing = false - vm.is_pull_updated = false - vm.is_activity_updated = false - vm.is_diff_updated = false - vm.is_commits_updated = false - - - vm.getPullRequest = -> - vm.pull_resource = ApiPullRequest.resource.get(vm.pull_params, (results) -> - if vm.pull - vm.is_pull_updated = vm.pull.updated_at is results.pull_request.updated_at - else - vm.is_pull_updated = true - vm.pull = results.pull_request - vm.merged_at = DateTimeFormatter.utc(vm.pull.merged_at) if vm.pull.merged_at - vm.closed_at = DateTimeFormatter.utc(vm.pull.closed_at) if vm.pull.closed_at - ) - - # @param [from_ref] - sets only at first time - vm.getBranch = (from_ref) -> - vm.project_resource = ApiProject.resource.get(vm.pull_params) unless vm.project_resource - - # Fix: at first load - # Cannot read property 'from_ref' of null - from_ref = vm.pull.from_ref.ref unless from_ref - vm.project_resource.$branches vm.pull_params, (results) -> - branch = null - _.each results.refs_list, (b) -> - if b.ref is from_ref - branch = new ProjectRef(b) - true - vm.branch = branch - - vm.reopen = -> - return false if vm.processing - vm.processing = true - vm.pull_resource.$update - pull_request_action: "reopen" - , -> - vm.getPullRequest() - vm.processing = false - - vm.close = -> - return false if vm.processing - vm.processing = true - vm.pull_resource.$update - pull_request_action: "close" - , -> - vm.getPullRequest() - vm.processing = false - - vm.merge = -> - return false if vm.processing - vm.processing = true - vm.pull_resource.$merge -> - vm.getPullRequest() - vm.processing = false - - vm.deleteBranch = -> - return false if vm.processing - vm.processing = true - vm.project_resource.$delete_branch vm.branch_params(), (-> # success - vm.branch = null - vm.processing = false - ), -> # error - vm.getBranch() - vm.processing = false - - vm.restoreBranch = -> - return false if vm.processing - vm.processing = true - vm.project_resource.$restore_branch vm.branch_params(), (-> # success - vm.getBranch() - vm.processing = false - ), -> # error - vm.getBranch() - vm.processing = false - - vm.branch_params = -> - owner: vm.pull_params.owner - project: vm.pull_params.project - ref: vm.pull.from_ref.ref - sha: vm.pull.from_ref.sha - - vm.getActivity = -> - return if vm.is_pull_updated and vm.is_activity_updated - vm.processing = true - - promise = ApiPullRequest.get_activity(vm.pull_params) - promise.then (response) -> - activity.html(null) - #html = compileHTML.run($scope, response.data) - #activity.html(html) - $rootScope.$broadcast('compile_html', { element: activity, html: response.data }) - vm.processing = false - vm.is_activity_updated = true - false - - vm.getDiff = -> - return if vm.is_pull_updated and vm.is_diff_updated - vm.processing = true - - promise = ApiPullRequest.get_diff(vm.pull_params) - promise.then (response) -> - diff.html(null) - $rootScope.$broadcast('compile_html', { element: diff, html: response.data }) - $('[data-toggle="tooltip"]').tooltip() - vm.processing = false - vm.is_diff_updated = true - false - - vm.getCommits = -> - return if vm.is_pull_updated and vm.is_commits_updated - vm.processing = true - - promise = ApiPullRequest.get_commits(vm.pull_params) - promise.then (response) -> - commits.html(null) - html = compileHTML.run($scope, response.data) - commits.html(html) - vm.processing = false - vm.is_commits_updated = true - false - - init = (dataservice) -> - vm.pull_params = dataservice - vm.getPullRequest() - - if location.href.match(/(.*)#diff(.*)/) - vm.active_tab = "diff" - vm.getDiff() - else if document.location.href.match(/(.*)#commits(.*)/) - vm.active_tab = "commits" - vm.getCommits() - else - vm.active_tab = 'discussion' - vm.getActivity() - $("#pull_tabs a[href=\"#" + vm.active_tab + "\"]").tab "show" - true - - init(dataservice) - true - -angular - .module("RosaABF") - .controller "PullRequestController", PullRequestController - -PullRequestController.$inject = [ - 'PullInitializer' - '$http' - 'ApiPullRequest' - 'ApiProject' - 'DateTimeFormatter' - 'compileHTML' - '$scope' - '$rootScope' - ] diff --git a/app/assets/javascripts/angularjs/services/collaborator.js.coffee b/app/assets/javascripts/angularjs/services/collaborator.js.coffee deleted file mode 100644 index 5e3eb1caf..000000000 --- a/app/assets/javascripts/angularjs/services/collaborator.js.coffee +++ /dev/null @@ -1,49 +0,0 @@ -collaboratorService = ($http) -> - { - find: (name_with_owner, val) -> - path = Routes.find_project_collaborators_path( - { - name_with_owner: name_with_owner, - term: val - } - ) - - $http.get(path).then (response) -> - response.data - - add: (name_with_owner, selected, role, project_id) -> - path = Routes.project_collaborators_path( - { - name_with_owner: name_with_owner, - collaborator: { - actor_id: selected.actor_id - actor_type: selected.actor_type - role: role - project_id: project_id - } - } - ) - - $http.post(path) - - remove: (name_with_owner, member_id) -> - path = Routes.project_collaborator_path(name_with_owner, member_id) - - $http.delete(path) - - update: (name_with_owner, member) -> - path = Routes.project_collaborator_path( - name_with_owner, - member.id, - { - collaborator: { role: member.role } - } - ) - $http.put(path) - } - -angular - .module("RosaABF") - .factory "Collaborator", collaboratorService - -collaboratorService.$inject = ['$http'] diff --git a/app/assets/javascripts/angularjs/services/preview.js.coffee b/app/assets/javascripts/angularjs/services/preview.js.coffee deleted file mode 100644 index 69289199d..000000000 --- a/app/assets/javascripts/angularjs/services/preview.js.coffee +++ /dev/null @@ -1,15 +0,0 @@ -previewService = ($http) -> - old_text = '' - { - old_text: old_text - get_preview: (name_with_owner, text, old_text) -> - return null if text is old_text - path = Routes.project_md_preview_path(name_with_owner) - $http.post(path, {text: text}) - } - -angular - .module("RosaABF") - .factory "Preview", previewService - -previewService.$inject = ['$http'] diff --git a/app/assets/javascripts/angularjs/services/project.js b/app/assets/javascripts/angularjs/services/project.js deleted file mode 100644 index 9417f74d8..000000000 --- a/app/assets/javascripts/angularjs/services/project.js +++ /dev/null @@ -1,48 +0,0 @@ -RosaABF.factory("ApiProject", ['$resource', function($resource) { - - var ProjectResource = $resource( - '/:owner/:project?format=json&info=true', - {owner: '@project.owner.uname', project: '@project.name'}, - { - tags: { - url: '/:owner/:project/tags', - format: 'json', - method: 'GET', - isArray : false - }, - branches: { - url: '/:owner/:project/branches', - format: 'json', - method: 'GET', - isArray : false - }, - delete_branch: { - url: '/:owner/:project/branches/:ref', - format: 'json', - method: 'DELETE', - isArray : false - }, - restore_branch: { - url: '/:owner/:project/branches/:ref', // ?sha= - format: 'json', - method: 'PUT', - isArray : false - }, - create_branch: { - url: '/:owner/:project/branches', // ?new_ref=&from_ref= - format: 'json', - method: 'POST', - isArray : false - } - } - ); - - return { - resource : ProjectResource, - singleton : { - project : { - branches_count : 0 - } - } - } -}]); \ No newline at end of file diff --git a/app/assets/javascripts/angularjs/templates/git_delete_branch_notification.html.haml b/app/assets/javascripts/angularjs/templates/git_delete_branch_notification.html.haml deleted file mode 100644 index 7ce440a23..000000000 --- a/app/assets/javascripts/angularjs/templates/git_delete_branch_notification.html.haml +++ /dev/null @@ -1,16 +0,0 @@ -%i.img-circle.btn-danger.fa.fa-times -.timeline-item{ 'ng-cloak' => true } - %h3.timeline-header - %a{ 'ng-href' => "{{item.user.link}}" } - %img{ 'ng-src' => "{{item.user.image}}" } - {{item.user.uname}} - %span.time{ popover: "{{item.date | amDateFormat:'ddd, LLL'}}", - "popover-trigger" => "mouseenter", 'popover-append-to-body' => 'true' } - %span.glyphicon.glyphicon-time - %span {{item.date | amDateFormat:'HH:mm'}} - .clearfix - .timeline-body - %p - {{'notification.push.delete_branch' | i18n}} - {{ item.branch_name + ('notification.in_project' | i18n)}} - %a{ 'ng-href' => "{{item.project_link}}" } {{item.project_name_with_owner}} diff --git a/app/assets/javascripts/angularjs/templates/git_new_push_notification.html.haml b/app/assets/javascripts/angularjs/templates/git_new_push_notification.html.haml deleted file mode 100644 index 93f31590e..000000000 --- a/app/assets/javascripts/angularjs/templates/git_new_push_notification.html.haml +++ /dev/null @@ -1,28 +0,0 @@ -%i.img-circle.bg-primary.fa.fa-sign-in -.timeline-item{ 'ng-cloak' => true } - %h3.timeline-header - %a{ 'ng-href' => "{{item.user.link}}" } - %img{ 'ng-src' => "{{item.user.image}}" } - {{item.user.uname}} - %span.time{ popover: "{{item.date | amDateFormat:'ddd, LLL'}}", - "popover-trigger" => "mouseenter", 'popover-append-to-body' => 'true' } - %span.glyphicon.glyphicon-time - %span {{item.date | amDateFormat:'HH:mm'}} - .clearfix - .timeline-body - %p - {{'notification.push.' + item.change_type + '_branch' | i18n}} - %a{ 'ng-href' => "{{item.branch_link}}" } {{item.branch_name}} - {{'notification.in_project' | i18n}} - %a{ 'ng-href' => "{{item.project_link}}" } {{item.project_name_with_owner}} - - .timeline-footer - .row - .container-fluid{ 'ng-repeat' => 'commit in item.last_commits' } - .col-sm-3.col-md-2 - %a{ 'ng-href' => "{{commit.link}}" } {{commit.hash}} - .col-sm-8.col-md-9{ 'ng-bind-html' => "commit.message" } - .clearfix - - %br{ 'ng-if' => "item.other_commits" } - %a{ 'ng-if' => "item.other_commits", 'ng-href' => "{{item.other_commits_path}}" } {{item.other_commits}} diff --git a/app/assets/javascripts/angularjs/templates/issue_assign_notification.html.haml b/app/assets/javascripts/angularjs/templates/issue_assign_notification.html.haml deleted file mode 100644 index b982b4b1f..000000000 --- a/app/assets/javascripts/angularjs/templates/issue_assign_notification.html.haml +++ /dev/null @@ -1,14 +0,0 @@ -%i.img-circle.btn-danger.fa.fa-asterisk -.timeline-item{ 'ng-cloak' => true } - %h3.timeline-header - %span.time{ popover: "{{item.date | amDateFormat:'ddd, LLL'}}", - "popover-trigger" => "mouseenter", 'popover-append-to-body' => 'true' } - %span.glyphicon.glyphicon-time - %span {{item.date | amDateFormat:'HH:mm'}} - .clearfix - .timeline-body - %p - {{'notification.issue_assign' | i18n}} - %a{ 'ng-href' => "{{item.issue.link}}" } {{item.issue.title}} - {{ item.branch_name + ('notification.in_project' | i18n)}} - %a{ 'ng-href' => "{{item.project_link}}" } {{item.project_name_with_owner}} diff --git a/app/assets/javascripts/angularjs/templates/new_comment_commit_notification.html.haml b/app/assets/javascripts/angularjs/templates/new_comment_commit_notification.html.haml deleted file mode 100644 index a00cf2c65..000000000 --- a/app/assets/javascripts/angularjs/templates/new_comment_commit_notification.html.haml +++ /dev/null @@ -1,26 +0,0 @@ -%i.img-circle.btn-warning.fa.fa-comment -.timeline-item{ 'ng-cloak' => true } - %h3.timeline-header - %a{ 'ng-href' => "{{item.user.link}}" } - %img{ 'ng-src' => "{{item.user.image}}" } - {{item.user.uname}} - %span.time{ popover: "{{item.date | amDateFormat:'ddd, LLL'}}", - "popover-trigger" => "mouseenter", 'popover-append-to-body' => 'true' } - %span.glyphicon.glyphicon-time - %span {{item.date | amDateFormat:'HH:mm'}} - .clearfix - .timeline-body - %p - {{'notification.new_commit_comment.title' | i18n}} - - .row - .col-sm-3.col-md-2 - %a{ 'ng-href' => "{{item.commit.link}}" } {{item.commit.hash}} - .col-sm-8.col-md-9{ 'ng-bind-html' => "item.commit.message" } - .clearfix - - %blockquote{ 'ng-bind-html' => "item.body" } - - .timeline-footer - %a.btn.btn-primary.btn-xs{ 'ng-href' => "{{item.commit.link + '#comment' + item.commit.read_more}}" } - {{'read_more' | i18n}} diff --git a/app/assets/javascripts/angularjs/templates/new_comment_notification.html.haml b/app/assets/javascripts/angularjs/templates/new_comment_notification.html.haml deleted file mode 100644 index fab1088c9..000000000 --- a/app/assets/javascripts/angularjs/templates/new_comment_notification.html.haml +++ /dev/null @@ -1,22 +0,0 @@ -%i.img-circle.btn-warning.fa.fa-comment -.timeline-item{ 'ng-cloak' => true } - %h3.timeline-header - %a{ 'ng-href' => "{{item.user.link}}" } - %img{ 'ng-src' => "{{item.user.image}}" } - {{item.user.uname}} - %span.time{ popover: "{{item.date | amDateFormat:'ddd, LLL'}}", - "popover-trigger" => "mouseenter", 'popover-append-to-body' => 'true' } - %span.glyphicon.glyphicon-time - %span {{item.date | amDateFormat:'HH:mm'}} - .clearfix - .timeline-body - %p - %span{'ng-show' => 'item.issue.is_pull'} {{'notification.new_pull_comment.title' | i18n}} - %span{'ng-show' => '!item.issue.is_pull'} {{'notification.new_comment.title' | i18n}} - %a{ 'ng-href' => "{{item.issue.link}}" } {{item.issue.title}} - - %blockquote{ 'ng-bind-html' => "item.body" } - - .timeline-footer - %a.btn.btn-primary.btn-xs{ 'ng-href' => "{{item.issue.link + '#comment' + item.issue.read_more}}" } - {{'read_more' | i18n}} diff --git a/app/assets/javascripts/angularjs/templates/new_issue_notification.html.haml b/app/assets/javascripts/angularjs/templates/new_issue_notification.html.haml deleted file mode 100644 index 2ef27d5af..000000000 --- a/app/assets/javascripts/angularjs/templates/new_issue_notification.html.haml +++ /dev/null @@ -1,18 +0,0 @@ -%i.img-circle.btn-success.fa.fa-check -.timeline-item{ 'ng-cloak' => true } - %h3.timeline-header - %a{ 'ng-href' => "{{item.user.link}}" } - %img{ 'ng-src' => "{{item.user.image}}" } - {{item.user.uname}} - %span.time{ popover: "{{item.date | amDateFormat:'ddd, LLL'}}", - "popover-trigger" => "mouseenter", 'popover-append-to-body' => 'true' } - %span.glyphicon.glyphicon-time - %span {{item.date | amDateFormat:'HH:mm'}} - .clearfix - .timeline-body - %p - %span{'ng-show' => 'item.issue.is_pull'} {{'notification.new_pull' | i18n}} - %span{'ng-show' => '!item.issue.is_pull'} {{'notification.new_issue' | i18n}} - {{'notification.in_project' | i18n}} - %a{ 'ng-href' => "{{item.project_link}}" } {{item.project_name_with_owner}} - %a{ 'ng-href' => "{{item.issue.link}}" } {{item.issue.title}} diff --git a/app/assets/javascripts/angularjs/templates/new_user_notification.html.haml b/app/assets/javascripts/angularjs/templates/new_user_notification.html.haml deleted file mode 100644 index 121a8cd28..000000000 --- a/app/assets/javascripts/angularjs/templates/new_user_notification.html.haml +++ /dev/null @@ -1,13 +0,0 @@ -%i.img-circle.btn-success.fa.fa-user -.timeline-item{ 'ng-cloak' => true } - %h3.timeline-header - %span.time{ popover: "{{item.date | amDateFormat:'ddd, LLL'}}", - "popover-trigger" => "mouseenter", 'popover-append-to-body' => 'true' } - %span.glyphicon.glyphicon-time - %span {{item.date | amDateFormat:'HH:mm'}} - .clearfix - .timeline-body - %p - {{('notification.new_user.title' | i18n) + item.user_name}} - %p - {{'notification.new_user.content' | i18n}} diff --git a/app/assets/javascripts/angularjs/templates/wiki_new_commit_notification.html.haml b/app/assets/javascripts/angularjs/templates/wiki_new_commit_notification.html.haml deleted file mode 100644 index b61f5508d..000000000 --- a/app/assets/javascripts/angularjs/templates/wiki_new_commit_notification.html.haml +++ /dev/null @@ -1,17 +0,0 @@ -%i.img-circle.btn-warning.fa.fa-edit -.timeline-item{ 'ng-cloak' => true } - %h3.timeline-header - %a{ 'ng-href' => "{{item.user.link}}" } - %img{ 'ng-src' => "{{item.user.image}}" } - {{item.user.uname}} - %span.time{ popover: "{{item.date | amDateFormat:'ddd, LLL'}}", - "popover-trigger" => "mouseenter", 'popover-append-to-body' => 'true' } - %span.glyphicon.glyphicon-time - %span {{item.date | amDateFormat:'HH:mm'}} - .clearfix - .timeline-body - %p - {{'notification.wiki.new_commit' | i18n}} - %a{ 'ng-href' => "{{item.wiki_link}}" } wiki - {{'notification.in_project' | i18n}} - %a{ 'ng-href' => "{{item.project_link}}" } {{item.project_name_with_owner}} diff --git a/app/assets/javascripts/design/all.js b/app/assets/javascripts/design/all.js deleted file mode 100644 index 8ba672900..000000000 --- a/app/assets/javascripts/design/all.js +++ /dev/null @@ -1,44 +0,0 @@ -$(document).ready(function() { - var dropbox = $("#droplist"); - - function loadMessages() { - $("#messages-new").fadeOut("slow"); - $("#new-messages").delay(700).fadeIn("slow"); - } - - function loadOldMessages() { - $("#old-messages").fadeIn("slow"); - } - - $(document).click(function() { - var dl = dropbox.css("height"); - var dl2 = dropbox.css("display"); - if ((dl2 == "block")&&(dl == "91px")) { - dropbox.slideUp("slow"); - } - - }); - - $('.data-expander').on('click', function(e) { - var $button = $(e.target); - var id = "#content-" + $button.attr('id'); - var $slider = $(id); - $slider.slideToggle("slow", function(){ - $button.toggleClass('expanded collapsed'); - }); - }); - - function showActivity(elem) { - $("#activity-bottom"+elem).slideToggle("slow"); - var img = document.getElementById("expand" + elem).className; - if (img == "expand-gray-down") { - document.getElementById("expand" + elem).className = "expand-gray-up"; - } else { - document.getElementById("expand" + elem).className = "expand-gray-down"; - } - } - - $('div.information > div.user').on('click', function() { - dropbox.slideToggle("slow"); - }); -}); diff --git a/app/assets/javascripts/extra/admin-members.js b/app/assets/javascripts/extra/admin-members.js deleted file mode 100644 index c51de1ce5..000000000 --- a/app/assets/javascripts/extra/admin-members.js +++ /dev/null @@ -1,38 +0,0 @@ -/*function deleteAdminMember() { - if (document.getElementById("niceCheckbox1-1").checked == true) { - $("#admin-table-members-row1").fadeOut("slow"); - } - if (document.getElementById("niceCheckbox2-1").checked == true) { - $("#admin-table-members-row2").fadeOut("slow"); - } - if (document.getElementById("niceCheckbox3-1").checked == true) { - $("#admin-table-members-row3").fadeOut("slow"); - } - if (document.getElementById("niceCheckbox4-1").checked == true) { - $("#admin-table-members-row4").fadeOut("slow"); - } -}*/ - -function saveAdminMember() { - $('#_method').attr('value', 'post'); - $('form#members_form').submit(); -} - -function deleteAdminMember() { - $('#_method').attr('value', 'delete'); - var delete_url = $('form#members_form').attr('delete_url'); - $('form#members_form').attr('action', delete_url); - $('form#members_form').submit(); -} - -function saveAdminGroup() { - $('#groups_method').attr('value', 'post'); - $('form#groups_form').submit(); -} - -function deleteAdminGroup() { - $('#groups_method').attr('value', 'delete'); - var delete_url = $('form#groups_form').attr('delete_url'); - $('form#groups_form').attr('action', delete_url); - $('form#groups_form').submit(); -} diff --git a/app/assets/javascripts/extra/blob.editor.js b/app/assets/javascripts/extra/blob.editor.js deleted file mode 100644 index edcf8bf1c..000000000 --- a/app/assets/javascripts/extra/blob.editor.js +++ /dev/null @@ -1,14 +0,0 @@ -(function($) { - $.BlobEditor = function() { - $.BlobEditor.Placeholder.add($('#gollum-editor-edit-summary input')); - $('#gollum-editor form[name="blob-editor"]').submit(function( e ) { - e.preventDefault(); - $.BlobEditor.Placeholder.clearAll(); - //debug('submitting'); - $(this).unbind('submit'); - $(this).submit(); - }); - }; - - $.BlobEditor.Placeholder = $.GollumPlaceholder; -})(jQuery); diff --git a/app/assets/javascripts/extra/diff.js.coffee b/app/assets/javascripts/extra/diff.js.coffee deleted file mode 100644 index dc811ae69..000000000 --- a/app/assets/javascripts/extra/diff.js.coffee +++ /dev/null @@ -1,6 +0,0 @@ -$(document).ready -> - $(document).on 'click', '#diff_header .panel-body li.list-group-item a', -> - href = $(this).attr('href') - $(".diff_data.collapse#"+href.slice(1)+"_content").collapse('show') - - return diff --git a/app/assets/javascripts/extra/diff_chevrons.js.coffee b/app/assets/javascripts/extra/diff_chevrons.js.coffee deleted file mode 100644 index 82da70eba..000000000 --- a/app/assets/javascripts/extra/diff_chevrons.js.coffee +++ /dev/null @@ -1,14 +0,0 @@ -$(document).ready -> - $(document).on 'hide.bs.collapse', '.file .diff_data.collapse', -> - $(this).parent().find('.top button span.fa').removeClass('fa-chevron-down').addClass('fa-chevron-up') - - $(document).on 'show.bs.collapse', '.file .diff_data.collapse', -> - $(this).parent().find('.top button span.fa').removeClass('fa-chevron-up').addClass('fa-chevron-down') - - $(document).on 'hide.bs.collapse', '#diff_header #collapseList', -> - $(this).parent().find('.panel-title a span.fa').removeClass('fa-chevron-down').addClass('fa-chevron-up') - - $(document).on 'show.bs.collapse', '#diff_header #collapseList', -> - $(this).parent().find('.panel-title a span.fa').removeClass('fa-chevron-up').addClass('fa-chevron-down') - - return diff --git a/app/assets/javascripts/extra/flash_notifies.js b/app/assets/javascripts/extra/flash_notifies.js deleted file mode 100644 index e9e2522a5..000000000 --- a/app/assets/javascripts/extra/flash_notifies.js +++ /dev/null @@ -1,21 +0,0 @@ -function setCookie (name, value, expires, path, domain, secure) { - document.cookie = name + "=" + escape(value) + - ((expires) ? "; expires=" + expires : "") + - ((path) ? "; path=" + path : "") + - ((domain) ? "; domain=" + domain : "") + - ((secure) ? "; secure" : ""); -} - -$(document).ready(function() { - if ($(".alert").size()) { - $(".alert").alert() - } - - $('#close-alert').click(function () { - var exdate=new Date(); - exdate.setDate(exdate.getDate() + 365); - var expires="expires="+exdate.toUTCString(); - setCookie("flash_notify_hash", FLASH_HASH_ID, expires); - }); -}); - diff --git a/app/assets/javascripts/extra/fork.js b/app/assets/javascripts/extra/fork.js deleted file mode 100644 index 2b5d18f92..000000000 --- a/app/assets/javascripts/extra/fork.js +++ /dev/null @@ -1,19 +0,0 @@ -$(document).ready(function() { - var fork_name = $('#fork_name'); - var forks_path = $('#possible_forks_path'); - - fork_name.keyup(function(){ - $.ajax({ - type: 'GET', - url: forks_path.val(), - data: 'name=' + fork_name.val(), - success: function(data){ - $('#forkModal .modal-body').html(data); - }, - error: function(data){ - alert('error'); // TODO remove - } - }); - }); - -}); \ No newline at end of file diff --git a/app/assets/javascripts/extra/highlight.js b/app/assets/javascripts/extra/highlight.js deleted file mode 100644 index 88d815430..000000000 --- a/app/assets/javascripts/extra/highlight.js +++ /dev/null @@ -1,47 +0,0 @@ -$(document).ready(function() { - - jQuery(window).bind('hashchange', function(e) { - var hash = location.hash; - if (/^#(diff|discussion)-F[0-9]+(L|R)[0-9]+/.test(hash)) { - highlightDiff(hash); - } else if (/^#lc-[0-9]+/.test(hash)) { - highlightShow(hash); - } - }); - - // Since the event is only triggered when the hash changes, we need to trigger - // the event now, to handle the hash the page may have loaded with. - jQuery(window).trigger('hashchange'); - -}); - - -function highlightShow(id) { - $('td.code span.highlight-line').removeClass('highlight-line'); - var from = to = id.substring(4); - if (/[0-9]+\-lc-[0-9]+$/.test(from)) { - var index = to.indexOf('-'); - to = to.substring(index + 2); - from = from.substring(0, index); - } - from = parseInt(from); - to = parseInt(to); - if (from && to) { - if (from > to) { - var x = to; to = from; from = x; - } - var el = $('#ln-' + from); - $(document).scrollTop( el.offset().top ); - while (el.length > 0) { - $('td.code span#ln-'+from).addClass('highlight-line'); - if (from == to) { return true; } - from += 1; - el = $('#ln-' + from); - } - } -} - -function highlightDiff(id) { - $('.highlight-line').removeClass('highlight-line'); - $(id).parent().find('td.code').addClass('highlight-line'); -} \ No newline at end of file diff --git a/app/assets/javascripts/extra/pull.js.coffee b/app/assets/javascripts/extra/pull.js.coffee deleted file mode 100644 index eaf4c3f36..000000000 --- a/app/assets/javascripts/extra/pull.js.coffee +++ /dev/null @@ -1,31 +0,0 @@ -upd_action = $('#update_action').val() -form = $('#new_pull_request') - -updatePull = -> - form.attr('action', upd_action) - .attr('method', 'get') - $('#update_pull').fadeIn('fast') - $('#create_pull').fadeOut('fast') - return - -window.pullUpdateToProject = (data)-> - ref = $('#to_ref'); - ref.parent().load('/'+data.text+'/refs_list', {"selected": ref.val()}) - updatePull() - return - -$('select#to_ref, select#from_ref').on('change', updatePull) - -$('#pull_tabs a').on 'click', (e) -> - href = $(this).attr('href') - if window.history and history.pushState - history.pushState '', '', href - history.replaceState '', '', href - else - location.hash = href - return - -diff_tab = $('#pull_tabs a[href="#diff"]') -$('.link_to_full_changes').on 'click', -> - diff_tab.tab 'show' - return diff --git a/app/assets/javascripts/login.js b/app/assets/javascripts/login.js deleted file mode 100644 index 3307fd90a..000000000 --- a/app/assets/javascripts/login.js +++ /dev/null @@ -1,37 +0,0 @@ -//= require jquery - -$(document).ready(function() { - var login_default = $('#login_default').val(); - var pass_default = $('#password_default').val(); - - $('.registartion-input').on('keydown', function() { - var id = $(this).attr('id'); - if(id == 'user_login' || id == 'user_password') { id = 'login_error'} - $('.error.'+id).fadeOut('slow'); - }).on('focus', function() { - var id = $(this).attr('id'); - if(id == 'user_login' && $(this).val() == login_default) { $(this).val('')} - else if(id == 'user_password' && $(this).val() == pass_default) { $(this).val('')} - $(this).addClass('registartion-input-focus').removeClass('registartion-input-error'); - }).on('blur', function() { - var id = $(this).attr('id'); - if(id == 'user_login' && $(this).val() == '') { $(this).val(login_default)} - else if(id == 'user_password' && $(this).val() == '') { $(this).val(pass_default)} - $(this).addClass('registartion-input-no-focus').removeClass('registartion-input-focus'); - }); - - $('#niceCheckbox1').click(function() { - var el = $(this), - input = el.find('input[type="checkbox"]'); - if(input.attr("checked")) { - el.css('backgroundPosition', '0 0'); - input.removeAttr('checked'); - } else { - el.css('backgroundPosition', '0 -18px'); - input.attr('checked', true); - } - return true; - }); - - $('#recaptcha_response_field').val(''); -}); diff --git a/app/assets/javascripts/new_application.js b/app/assets/javascripts/new_application.js index fe206c76b..d54dffa86 100644 --- a/app/assets/javascripts/new_application.js +++ b/app/assets/javascripts/new_application.js @@ -8,7 +8,6 @@ //= require angular //= require angular-sanitize //= require angular-ui-bootstrap-tpls -//= require ui-codemirror //= require angular-i18n //= require angular-resource @@ -25,8 +24,6 @@ //= require underscore -//= require zeroclipboard - //= require notifyjs //= require notifyjs/styles/bootstrap/notify-bootstrap @@ -34,33 +31,11 @@ //= require lib/bootstrap-typeahead //= require lib/custom-bootstrap-typeahead -//= require extra/highlight -//= require extra/pull //= require extra/scroller -//= require extra/fork -//= require extra/diff_chevrons -//= require extra/diff //= require_self -function setCookie (name, value, expires, path, domain, secure) { - document.cookie = name + "=" + escape(value) + - ((expires) ? "; expires=" + expires : "") + - ((path) ? "; path=" + path : "") + - ((domain) ? "; domain=" + domain : "") + - ((secure) ? "; secure" : ""); -} - $(document).ready(function() { - $('.notify.alert button.close').click(function () { - var exdate=new Date(); - exdate.setDate(exdate.getDate() + 365); - var expires="expires="+exdate.toUTCString(); - setCookie("flash_notify_hash", FLASH_HASH_ID, expires); - }); - - var clip = new ZeroClipboard($("#copy_to_clipboard")); - $('.datetime_moment').each(function() { var mtime = moment($(this).attr('origin_datetime'), 'YYYY-MM-DD HH:mm Z'); $(this).attr('title', mtime.utc().format('YYYY-MM-DD HH:mm:ss UTC')); @@ -76,16 +51,4 @@ $(document).ready(function() { updateTime(); setInterval( updateTime, 15000 ); - // TODO refactoring - $('#branch_selector').change(function() { - var form = $('form#branch_changer'); - form.attr('action', $(this).val()); - form.submit(); - }); - - $('#create_fork').click(function () { - $(this).button('loading'); - }); - - $('[data-toggle="tooltip"]').tooltip(); }); diff --git a/app/assets/javascripts/tour.js b/app/assets/javascripts/tour.js deleted file mode 100644 index 57279c1cb..000000000 --- a/app/assets/javascripts/tour.js +++ /dev/null @@ -1,12 +0,0 @@ -//= require jquery -//= require jquery_ujs -//= require jquery-ui -//= require jquery-migrate-min -//= require pirobox_extended_min -//= require ./design/all - -$(document).ready(function() { - $('div.information > div.profile > a').on('click', function(e) { - e.preventDefault(); - }); -}); \ No newline at end of file diff --git a/app/assets/stylesheets/custom_bootstrap.sass b/app/assets/stylesheets/custom_bootstrap.sass index 52e0b202c..2619b58c7 100644 --- a/app/assets/stylesheets/custom_bootstrap.sass +++ b/app/assets/stylesheets/custom_bootstrap.sass @@ -158,20 +158,6 @@ table.table-borderless > thead > tr > th padding-top: 5px padding-bottom: 5px - .advisory_preview - td - padding-top: 0 - padding-bottom: 0 - margin-top: 0 - margin-bottom: 0 - - h4 - margin-top: 0 - margin-bottom: 0 - - .advisory-description - margin-top: 0 - .submenu margin-bottom: 0 diff --git a/app/controllers/advisories_controller.rb b/app/controllers/advisories_controller.rb deleted file mode 100644 index 154eedf32..000000000 --- a/app/controllers/advisories_controller.rb +++ /dev/null @@ -1,34 +0,0 @@ -class AdvisoriesController < ApplicationController - before_action :authenticate_user! - skip_before_action :authenticate_user! if APP_CONFIG['anonymous_access'] - - def index - authorize :advisory - @advisories = Advisory.includes(:platforms, :projects).search(params[:q]).uniq - @advisories_count = @advisories.count - @advisories = @advisories.paginate(page: current_page, per_page: Advisory.per_page) - respond_to do |format| - format.html - format.json - format.atom - end - end - - def show - authorize @advisory = Advisory.find_by(advisory_id: params[:id]) - @packages_info = @advisory.fetch_packages_info - end - - def search - authorize :advisory - @advisory = Advisory.by_update_type(params[:bl_type]).search_by_id(params[:query]).first - if @advisory.nil? - render nothing: true, status: 404 - else - # respond_to do |format| - # format.json { render @advisory } - # end - render @advisory - end - end -end diff --git a/app/controllers/api/v1/advisories_controller.rb b/app/controllers/api/v1/advisories_controller.rb deleted file mode 100644 index 6356a77d4..000000000 --- a/app/controllers/api/v1/advisories_controller.rb +++ /dev/null @@ -1,52 +0,0 @@ -class Api::V1::AdvisoriesController < Api::V1::BaseController - before_action :authenticate_user! - skip_before_action :authenticate_user!, only: %i(index show) if APP_CONFIG['anonymous_access'] - before_action :load_advisory, only: %i(show update) - before_action :load_build_list, only: %i(create update) - - def index - authorize :advisory - @advisories = Advisory.includes(:platforms, :projects).paginate(paginate_params) - end - - def show - @packages_info = @advisory.fetch_packages_info - end - - def create - authorize :advisory - if @build_list.can_attach_to_advisory? && - @build_list.associate_and_create_advisory(advisory_params) && - @build_list.save - render_json_response @build_list.advisory, 'Advisory has been created successfully' - else - render_validation_error @build_list.advisory, error_message(@build_list, 'Advisory has not been created') - end - end - - def update - if @advisory && @build_list.can_attach_to_advisory? && - @advisory.attach_build_list(@build_list) && @build_list.save - render_json_response @advisory, "Build list '#{@build_list.id}' has been attached to advisory successfully" - else - render_validation_error @advisory, error_message(@build_list, 'Build list has not been attached to advisory') - end - end - - protected - - def advisory_params - subject_params(Advisory) - end - - def load_build_list - @build_list = BuildList.find params[:build_list_id] - authorize @build_list.save_to_platform, :local_admin_manage? - end - - def load_advisory - @advisory = Advisory.find_by(advisory_id: params[:id]) if params[:id] - authorize @advisory if @advisory - end - -end diff --git a/app/controllers/api/v1/issues_controller.rb b/app/controllers/api/v1/issues_controller.rb deleted file mode 100644 index 4822f2800..000000000 --- a/app/controllers/api/v1/issues_controller.rb +++ /dev/null @@ -1,112 +0,0 @@ -class Api::V1::IssuesController < Api::V1::BaseController - include Api::V1::Issueable - - before_action :authenticate_user! - skip_before_action :authenticate_user!, only: %i(index group_index show) if APP_CONFIG['anonymous_access'] - - before_action :load_group, only: :group_index - before_action :load_project - skip_before_action :load_project, only: %i(all_index user_index group_index) - before_action :load_issue, only: %i(show update index) - - def index - @issues = @project.issues - render_issues_list - end - - def all_index - authorize :issue, :index? - project_ids = get_all_project_ids membered_projects.pluck(:id) - @issues = Issue.where(project_id: project_ids) - render_issues_list - end - - def user_index - authorize :issue, :index? - project_ids = get_all_project_ids current_user.projects.pluck(:id) - @issues = Issue.where(project_id: project_ids) - render_issues_list - end - - def group_index - project_ids = @group.projects.pluck(:id) - project_ids = membered_projects.where(id: project_ids).pluck(:id) - @issues = Issue.where(project_id: project_ids) - render_issues_list - end - - def show - if @issue.pull_request - redirect_to api_v1_project_pull_request_path(@project.id, @issue.serial_id) - else - respond_to :json - end - end - - def create - @issue = @project.issues.new - @issue.assign_attributes subject_params(Issue, @issue) - @issue.user = current_user - create_subject @issue - end - - def update - @issue.labelings.destroy_all if params[:update_labels] && policy(@project).write? - if params[:issue] && status = params[:issue].delete(:status) - @issue.set_close(current_user) if status == 'closed' - @issue.set_open if status == 'open' - end - update_subject @issue - end - - private - - def render_issues_list - @issues = @issues.preload(:user, :assignee, :labels, :project).without_pull_requests - if params[:status] == 'closed' - @issues = @issues.closed - else - @issues = @issues.opened - end - - if action_name == 'index' && params[:assignee].present? - case params[:assignee] - when 'none' - @issues = @issues.where(assigned_id: nil) - when '*' - @issues = @issues.where('issues.assigned_id IS NOT NULL') - else - @issues = @issues.where('issues.assignees_issues.uname = ?', params[:assignee]) - end - end - - if %w[all_index user_index group_index].include?(action_name) - case params[:filter] - when 'created' - @issues = @issues.where(user_id: current_user) - when 'all' - else - @issues = @issues.where(assignee_id: current_user) - end - else - @issues.where('users.uname = ?', params[:creator]) if params[:creator].present? - end - - if params[:labels].present? - labels = params[:labels].split(',').map(&:strip).select(&:present?) - @issues = @issues.where('labels.name IN (?)', labels) - end - - sort = params[:sort] == 'updated' ? 'issues.updated_at' : 'issues.created_at' - direction = params[:direction] == 'asc' ? 'ASC' : 'DESC' - @issues = @issues.order("#{sort} #{direction}") - - @issues = @issues.where('issues.created_at >= to_timestamp(?)', params[:since]) if params[:since] =~ /\A\d+\z/ - @issues = @issues.paginate(paginate_params) - - respond_to do |format| - format.json { render :index } - end - end - -end diff --git a/app/controllers/api/v1/projects_controller.rb b/app/controllers/api/v1/projects_controller.rb index 452d3e8e1..22e254e85 100644 --- a/app/controllers/api/v1/projects_controller.rb +++ b/app/controllers/api/v1/projects_controller.rb @@ -18,10 +18,6 @@ class Api::V1::ProjectsController < Api::V1::BaseController def show end - def refs_list - @refs = @project.repo.branches + @project.repo.tags.select{ |t| t.commit } - end - def update update_subject @project end diff --git a/app/controllers/api/v1/pull_requests_controller.rb b/app/controllers/api/v1/pull_requests_controller.rb deleted file mode 100644 index ed6ef5628..000000000 --- a/app/controllers/api/v1/pull_requests_controller.rb +++ /dev/null @@ -1,172 +0,0 @@ -class Api::V1::PullRequestsController < Api::V1::BaseController - include Api::V1::Issueable - - before_action :authenticate_user! - skip_before_action :authenticate_user!, only: %i(show index group_index commits files) if APP_CONFIG['anonymous_access'] - - before_action :load_group, only: %i(group_index) - before_action :load_project, except: %i(all_index user_index) - before_action :load_issue, only: %i(show index commits files merge update) - before_action :load_pull, only: %i(show index commits files merge update) - - def index - @pulls = @project.pull_requests - @pulls_url = api_v1_project_pull_requests_path(@project, format: :json) - render_pulls_list - end - - def all_index - authorize :pull_request, :index? - project_ids = get_all_project_ids membered_projects.pluck(:id) - @pulls = PullRequest.where('pull_requests.to_project_id IN (?)', project_ids) - @pulls_url = api_v1_pull_requests_path format: :json - render_pulls_list - end - - def user_index - authorize :pull_request, :index? - project_ids = get_all_project_ids current_user.projects.pluck(:id) - @pulls = PullRequest.where('pull_requests.to_project_id IN (?)', project_ids) - @pulls_url = pull_requests_api_v1_user_path format: :json - render_pulls_list - end - - def group_index - project_ids = @group.projects.pluck(:id) - project_ids = membered_projects.where(id: project_ids).pluck(:id) - @pulls = PullRequest.where(to_project_id: project_ids) - @pulls_url = pull_requests_api_v1_group_path - render_pulls_list - end - - def show - redirect_to api_v1_project_issue_path(@project.id, @issue.serial_id) and return if @pull.nil? - end - - def create - from_project = Project.find_by(id: pull_params[:from_project_id]) - from_project ||= @project - authorize from_project, :show? - - @pull = @project.pull_requests.build - @pull.build_issue title: pull_params[:title], body: pull_params[:body] - @pull.from_project = from_project - @pull.to_ref, @pull.from_ref = pull_params[:to_ref], pull_params[:from_ref] - @pull.issue.assignee_id = pull_params[:assignee_id] if policy(@project).write? - @pull.issue.user, @pull.issue.project = current_user, @project - @pull.issue.new_pull_request = true - render_validation_error(@pull, "#{@pull.class.name} has not been created") && return unless @pull.valid? - - authorize @pull - @pull.save # set pull id - @pull.reload - @pull.check(false) # don't make event transaction - if @pull.already? - @pull.destroy - error_message = I18n.t('projects.pull_requests.up_to_date', to_ref: @pull.to_ref, from_ref: @pull.from_ref) - render_json_response(@pull, error_message, 422) - else - @pull.send(@pull.status == 'blocked' ? 'block' : @pull.status) - render_json_response @pull, "#{@pull.class.name} has been created successfully" - end - end - - def update - @pull = @project.pull_requests.includes(:issue).where(issues: {serial_id: params[:id]}).first - authorize @pull - - if pull_params.present? - attrs = subject_params(PullRequest) - attrs.merge!(assignee_id: pull_params[:assignee_id]) if policy(@project).write? - - if action = %w(close reopen).find{ |s| s == pull_params[:status] } - if @pull.send("can_#{action}?") - @pull.set_user_and_time current_user - need_check = true if action == 'reopen' && @pull.valid? - end - end - end - - class_name = @pull.class.name - if @pull.issue.update_attributes(attrs) - @pull.send(action) if action.present? - @pull.check if need_check - render_json_response @pull, "#{class_name} has been updated successfully" - else - render_validation_error @pull, "#{class_name} has not been updated" - end - end - - def commits - authorize @pull - @commits = @pull.repo.commits_between(@pull.to_commit, @pull.from_commit).paginate(paginate_params) - end - - def files - authorize @pull - @stats = @pull.diff_stats.zip(@pull.diff).paginate(paginate_params) - end - - def merge - authorize @pull - class_name = @pull.class.name - if @pull.merge!(current_user) - render_json_response @pull, "#{class_name} has been merged successfully" - else - render_validation_error @pull, "#{class_name} has not been merged" - end - end - - private - - # Private: before_action hook which loads PullRequest. - def load_pull - @pull = @issue.pull_request - authorize @pull, :show? if @pull - end - - def render_pulls_list - @pulls = @pulls.includes(issue: [:user, :assignee]) - if params[:status] == 'closed' - @pulls = @pulls.closed_or_merged - else - @pulls = @pulls.not_closed_or_merged - end - - if action_name == 'index' && params[:assignee].present? - case params[:assignee] - when 'none' - @pulls = @pulls.where('issues.assigned_id IS NULL') - when '*' - @pulls = @pulls.where('issues.assigned_id IS NOT NULL') - else - @pulls = @pulls.where('assignees_issues.uname = ?', params[:assignee]) - end - end - - if %w[all_index user_index group_index].include?(action_name) - case params[:filter] - when 'created' - @pulls = @pulls.where('issues.user_id = ?', current_user.id) - when 'all' - else - @pulls = @pulls.where('issues.assignee_id = ?', current_user.id) - end - else - @pulls.where('users.uname = ?', params[:creator]) if params[:creator].present? - end - - sort = params[:sort] == 'updated' ? 'issues.updated_at' : 'issues.created_at' - direction = params[:direction] == 'asc' ? 'ASC' : 'DESC' - @pulls = @pulls.order("#{sort} #{direction}") - - @pulls = @pulls.where('issues.created_at >= to_timestamp(?)', params[:since]) if params[:since] =~ /\A\d+\z/ - @pulls = @pulls.paginate(paginate_params) - - render :index - end - - def pull_params - @pull_params ||= params[:pull_request] || {} - end -end diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 3043b47b7..0daa9e78e 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -37,8 +37,6 @@ class ApplicationController < ActionController::Base redirect_to forbidden_url, alert: t("flash.exception_message") end - rescue_from Grit::NoSuchPathError, with: :not_found - def render_404 render_error 404 diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index 9a51c3e76..0eb918ff1 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -2,20 +2,12 @@ class HomeController < ApplicationController before_action :authenticate_user!, except: [:root] skip_after_action :verify_authorized - def root - respond_to do |format| - format.html { render 'pages/tour/abf-tour-project-description-1' } - end - end - def activity(is_my_activity = false) - @filter = t('feed_menu').has_key?(params[:filter].try(:to_sym)) ? params[:filter].to_sym : :all + #@filter = :build @activity_feeds = current_user.activity_feeds .by_project_name(params[:project_name_filter]) .by_owner_uname(params[:owner_filter]) - @activity_feeds = @activity_feeds.where(kind: "ActivityFeed::#{@filter.upcase}".constantize) unless @filter == :all - @activity_feeds = @activity_feeds.where(user_id: current_user) if @own_filter == :created - @activity_feeds = @activity_feeds.where.not(user_id: current_user) if @own_filter == :not_created + #@activity_feeds = @activity_feeds.where(kind: "ActivityFeed::#{@filter.upcase}".constantize) unless @filter == :all @activity_feeds = if is_my_activity @activity_feeds.where(creator_id: current_user) diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rb index 40d3ed2f8..b997d6659 100644 --- a/app/controllers/pages_controller.rb +++ b/app/controllers/pages_controller.rb @@ -1,18 +1,6 @@ class PagesController < ApplicationController skip_after_action :verify_authorized - def tour_inside - @entries = case params[:id] - when 'builds' - %w(repo builds monitoring) - when 'sources' - %w(source history annotation edit) - when 'projects' - %w(control git tracker) - end - render "pages/tour/tour-inside" - end - def forbidden end diff --git a/app/controllers/platforms/platforms_controller.rb b/app/controllers/platforms/platforms_controller.rb index 4b7d20f2a..bdda87fb4 100644 --- a/app/controllers/platforms/platforms_controller.rb +++ b/app/controllers/platforms/platforms_controller.rb @@ -2,7 +2,7 @@ class Platforms::PlatformsController < Platforms::BaseController include FileStoreHelper before_action :authenticate_user! - skip_before_action :authenticate_user!, only: [:advisories, :members, :show] if APP_CONFIG['anonymous_access'] + skip_before_action :authenticate_user!, only: [:members, :show] if APP_CONFIG['anonymous_access'] def index authorize :platform @@ -150,11 +150,6 @@ class Platforms::PlatformsController < Platforms::BaseController redirect_to members_platform_url(@platform) end - def advisories - authorize @platform - @advisories = @platform.advisories.paginate(page: params[:page]) - end - def clear authorize @platform @platform.clear diff --git a/app/controllers/projects/base_controller.rb b/app/controllers/projects/base_controller.rb index a0bbb460b..6f7453521 100644 --- a/app/controllers/projects/base_controller.rb +++ b/app/controllers/projects/base_controller.rb @@ -1,6 +1,5 @@ class Projects::BaseController < ApplicationController prepend_before_action :authenticate_user_and_find_project - before_action :init_statistics protected @@ -16,11 +15,4 @@ class Projects::BaseController < ApplicationController return if params[:name_with_owner].blank? authorize @project = Project.find_by_owner_and_name!(params[:name_with_owner]), :show? end - - def init_statistics - if @project - #@opened_issues_count = @project.issues.without_pull_requests.not_closed_or_merged.count - #@opened_pull_requests_count = @project.issues.joins(:pull_request).not_closed_or_merged.count - end - end end diff --git a/app/controllers/projects/build_lists_controller.rb b/app/controllers/projects/build_lists_controller.rb index e8dff652c..ea2367b96 100644 --- a/app/controllers/projects/build_lists_controller.rb +++ b/app/controllers/projects/build_lists_controller.rb @@ -93,28 +93,6 @@ class Projects::BuildListsController < Projects::BaseController end def publish - @build_list.update_type = params[:build_list][:update_type] if params[:build_list][:update_type].present? - - if params[:attach_advisory].present? and params[:attach_advisory] != 'no' and !@build_list.advisory - - unless @build_list.update_type.in? BuildList::RELEASE_UPDATE_TYPES - redirect_to :back, notice: t('layout.build_lists.publish_fail') and return - end - - if params[:attach_advisory] == 'new' - # create new advisory - unless @build_list.associate_and_create_advisory(advisory_params) - redirect_to :back, notice: t('layout.build_lists.publish_fail') and return - end - else - # attach existing advisory - a = Advisory.find_by(advisory_id: params[:attach_advisory]) - unless (a && a.attach_build_list(@build_list)) - redirect_to :back, notice: t('layout.build_lists.publish_fail') and return - end - end - end - @build_list.publisher = current_user do_and_back(:publish, 'publish_') end @@ -187,31 +165,12 @@ class Projects::BuildListsController < Projects::BaseController render partial: 'build_lists_ajax', layout: false end - def update_type - respond_to do |format| - format.html { render nothing: true } - format.json do - @build_list.update_type = params[:update_type] - if @build_list.save - render json: 'success', status: :ok - else - render json: { message: @build_list.errors.full_messages.join('. ') }, - status: :unprocessable_entity - end - end - end - end - protected def build_list_params subject_params(BuildList) end - def advisory_params - permit_params(%i(build_list advisory), *policy(Advisory).permitted_attributes) - end - # Private: before_action hook which loads BuidList. def load_build_list authorize @build_list = diff --git a/app/controllers/projects/collaborators_controller.rb b/app/controllers/projects/collaborators_controller.rb deleted file mode 100644 index cc8501864..000000000 --- a/app/controllers/projects/collaborators_controller.rb +++ /dev/null @@ -1,78 +0,0 @@ -class Projects::CollaboratorsController < Projects::BaseController - before_action :authenticate_user! - before_action :authorize_collaborators - - before_action :find_users - before_action :find_groups - - def index - @collaborators = Collaborator.find_by_project(@project) - end - - def find - users = User.not_member_of(@project) - groups = Group.not_member_of(@project) - if params[:term].present? - users = users.search(params[:term]).first(5) - groups = groups.search(params[:term]).first(5) - end - @collaborators = (users | groups).map{|act| Collaborator.new(actor: act, project: @project)} - end - - def create - @collaborator = Collaborator.new(collaborator_params) - @collaborator.project = @project - respond_to do |format| - if @collaborator.save - format.json { render partial: 'collaborator', locals: {collaborator: @collaborator, success: true} } - else - format.json { render json: {message:t('flash.collaborators.error_in_adding')}, status: 422 } - end - end - end - - def update - cb = Collaborator.find(params[:id]) - respond_to do |format| - if cb.update_attributes(params[:collaborator]) - format.json { render json: {message:t('flash.collaborators.successfully_updated', uname: cb.actor.uname)} } - else - format.json { render json: {message:t('flash.collaborators.error_in_updating')}, status: 422 } - end - end - end - - def destroy - cb = Collaborator.find(params[:id]) - respond_to do |format| - if cb.present? && cb.destroy - format.json { render json: {message:t('flash.collaborators.successfully_removed', uname: cb.actor.uname)} } - else - format.json { - render json: {message:t('flash.collaborators.error_in_removing', uname: cb.try(:actor).try(:uname))}, - status: 422 - } - end - end - end - - protected - - def collaborator_params - subject_params(Collaborator) - end - - def find_users - @users = @project.collaborators.order('uname')#User.all - @users = @users.without(@project.owner_id) if @project.owner_type == 'User' - end - - def find_groups - @groups = @project.groups.order('uname')#Group.all - @groups = @groups.without(@project.owner_id) if @project.owner_type == 'Group' - end - - def authorize_collaborators - authorize @project, :update? - end -end diff --git a/app/controllers/projects/comments_controller.rb b/app/controllers/projects/comments_controller.rb deleted file mode 100644 index b4cbc3acb..000000000 --- a/app/controllers/projects/comments_controller.rb +++ /dev/null @@ -1,65 +0,0 @@ -class Projects::CommentsController < Projects::BaseController - before_action :authenticate_user! - before_action :find_commentable - before_action :find_or_build_comment - - include CommentsHelper - - def create - respond_to do |format| - if !@comment.set_additional_data params - format.json { - render json: { - message: I18n.t("flash.comment.save_error"), - error: @comment.errors.full_messages - } - } - elsif @comment.save - format.json {} - else - format.json { render json: { message: I18n.t("flash.comment.save_error") }, status: 422 } - end - end - end - - def edit - end - - def update - respond_to do |format| - if @comment.update_attributes(comment_params) - format.json { render json: {message:t('flash.comment.updated'), body: view_context.markdown(@comment.body)} } - else - format.json { render json: {message:t('flash.comment.error_in_updating')}, status: 422 } - end - end - end - - def destroy - respond_to do |format| - if @comment.present? && @comment.destroy - format.json { render json: {message: I18n.t('flash.comment.destroyed')} } - else - format.json { - render json: {message: t('flash.comment.error_in_deleting')}, status: 422 } - end - end - end - - protected - - def comment_params - subject_params(Comment) - end - - def find_commentable - @commentable = params[:issue_id].present? && @project.issues.find_by(serial_id: params[:issue_id]) || - params[:commit_id].present? && @project.repo.commit(params[:commit_id]) - end - - def find_or_build_comment - @comment = params[:id].present? && Comment.where(automatic: false).find(params[:id]) || - current_user.comments.build(comment_params) {|c| c.commentable = @commentable; c.project = @project} - authorize @comment - end -end diff --git a/app/controllers/projects/commit_subscribes_controller.rb b/app/controllers/projects/commit_subscribes_controller.rb deleted file mode 100644 index 440e52a47..000000000 --- a/app/controllers/projects/commit_subscribes_controller.rb +++ /dev/null @@ -1,28 +0,0 @@ -class Projects::CommitSubscribesController < Projects::BaseController - before_action :authenticate_user! - before_action :find_commit - - def create - if Subscribe.subscribe_to_commit(@options) - flash[:notice] = I18n.t("flash.subscribe.commit.saved") - # TODO js - redirect_to commit_path(@project, @commit) - else - flash[:error] = I18n.t("flash.subscribe.saved_error") - redirect_to commit_path(@project, @commit) - end - end - - def destroy - Subscribe.unsubscribe_from_commit(@options) - flash[:notice] = t("flash.subscribe.commit.destroyed") - redirect_to commit_path(@project, @commit) - end - - protected - - def find_commit - @commit = @project.repo.commit(params[:commit_id]) - @options = {project_id: @project.id, subscribeable_id: @commit.id.hex, subscribeable_type: @commit.class.name, user_id: current_user.id} - end -end diff --git a/app/controllers/projects/git/base_controller.rb b/app/controllers/projects/git/base_controller.rb deleted file mode 100644 index d95c4eb32..000000000 --- a/app/controllers/projects/git/base_controller.rb +++ /dev/null @@ -1,22 +0,0 @@ -class Projects::Git::BaseController < Projects::BaseController - before_action :authenticate_user! - if APP_CONFIG['anonymous_access'] - skip_before_action :authenticate_user!, only: %i(show index blame raw archive diff tags branches) - before_action :authenticate_user, only: %i(show index blame raw archive diff tags branches) - end - - before_action :set_treeish_and_path - before_action :set_branch_and_tree - - protected - - def set_treeish_and_path - @treeish, @path = params[:treeish].presence || @project.default_head, params[:path] - end - - def set_branch_and_tree - @branch = @project.repo.branches.detect{|b| b.name == @treeish} - @tree = @project.repo.tree(@treeish) - # raise Grit::NoSuchPathError if @tree.blobs.blank? - end -end diff --git a/app/controllers/projects/git/blobs_controller.rb b/app/controllers/projects/git/blobs_controller.rb deleted file mode 100644 index 20979b566..000000000 --- a/app/controllers/projects/git/blobs_controller.rb +++ /dev/null @@ -1,38 +0,0 @@ -class Projects::Git::BlobsController < Projects::Git::BaseController - before_action :set_blob - before_action -> {authorize @project, :write? }, only: [:edit, :update] - - def show - end - - def edit - end - - def update - if @project.update_file(params[:path], params[:content].gsub("\r", ''), - message: params[:message].gsub("\r", ''), actor: current_user, head: @treeish) - flash[:notice] = t("flash.blob.successfully_updated", name: params[:path]) - else - flash[:notice] = t("flash.blob.updating_error", name: params[:path]) - end - redirect_to action: :show - end - - def blame - @blame = Grit::Blob.blame(@project.repo, @commit.id, @path) - end - - def raw - repo = Grit::GitRuby::Repository.new(@project.repo.path) - raw = repo.get_raw_object_by_sha1(@blob.id) - send_data raw.content, type: @blob.content_type, disposition: @blob.disposition - end - - protected - - def set_blob - @blob = @tree / @path or raise Grit::NoSuchPathError - redirect_to tree_path(@project, treeish: @treeish, path: @path) if @blob.is_a? Grit::Tree - @commit = @project.repo.log(@treeish, @path, max_count: 1).first - end -end diff --git a/app/controllers/projects/git/commits_controller.rb b/app/controllers/projects/git/commits_controller.rb deleted file mode 100644 index 5072521dd..000000000 --- a/app/controllers/projects/git/commits_controller.rb +++ /dev/null @@ -1,50 +0,0 @@ -class Projects::Git::CommitsController < Projects::Git::BaseController - - def index - if @path.present? - @commits = @project.repo.log(@treeish, @path) - else - @commits, @page, @last_page = @project.paginate_commits(@treeish, page: params[:page]) - end - end - - def show - @commit = @commentable = @project.repo.commit(params[:id]) || raise(ActiveRecord::RecordNotFound) - @comments = Comment.for_commit(@commit) - - respond_to do |format| - format.html - format.diff { render text: (@commit.show.map(&:diff).join("\n") rescue ''), content_type: "text/plain" } - format.patch { render text: (@commit.to_patch rescue ''), content_type: "text/plain" } - end - end - - def diff - res = params[:diff].split(/\A(.*)\.\.\.(.*)\z/).select {|e| e.present?} - if res[1].present? - params1 = res[0] - params2 = res[1] == 'HEAD' ? @project.resolve_default_branch : res.last - else # get only one parameter - params1 = @project.resolve_default_branch - params2 = res.first - end - params1.sub! 'HEAD', @project.resolve_default_branch - params2.sub! 'HEAD', @project.resolve_default_branch - - ref1 = if @project.repo.branches_and_tags.include? params1 - @project.repo.commits(params1).first - else - params1 # possible commit hash - end - @commit1 = @project.repo.commit(ref1) || raise(ActiveRecord::RecordNotFound) - - ref = if @project.repo.branches_and_tags.include? params2 - @project.repo.commits(params2).first - else - params2 # possible commit hash - end - @commit = @project.repo.commit(ref) || raise(ActiveRecord::RecordNotFound) - @common_ancestor = @project.repo.commit(@project.repo.git.merge_base({}, @commit1, @commit)) || @commit1 - @stats = @project.repo.diff_stats @commit1.id, @commit.id - end -end diff --git a/app/controllers/projects/git/trees_controller.rb b/app/controllers/projects/git/trees_controller.rb deleted file mode 100644 index e2a13ff96..000000000 --- a/app/controllers/projects/git/trees_controller.rb +++ /dev/null @@ -1,98 +0,0 @@ -class Projects::Git::TreesController < Projects::Git::BaseController - - skip_before_action :set_branch_and_tree, only: :archive - skip_before_action :set_treeish_and_path, only: :archive - before_action :redirect_to_project, only: :show - before_action :resolve_treeish, only: [:branch, :destroy] - - # skip_authorize_resource :project, only: [:destroy, :restore_branch, :create] - before_action -> { authorize(@project, :show?) }, only: [:show, :archive, :tags, :branches] - - def show - unless request.xhr? - render('empty') and return if @project.is_empty? - @tree = @tree / @path if @path.present? - @commit = @branch.present? ? @branch.commit() : @project.repo.log(@treeish, @path, max_count: 1).first - raise Grit::NoSuchPathError unless @commit - else - @tree = @tree / @path if @path.present? - end - end - - def archive - format, @treeish = params[:format], params[:treeish] - raise Grit::NoSuchPathError unless @treeish =~ /^#{@project.name}-/ && - @treeish !~ /[\s]+/ && - format =~ /\A(zip|tar\.gz)\z/ - @treeish.gsub!(/^#{@project.name}-/, '') - sha1 = @project.build_scripts.by_active.by_treeish(@treeish).first.try(:sha1) - unless sha1 - @commit = @project.repo.commits(@treeish, 1).first - raise Grit::NoSuchPathError unless @commit - tag = @project.repo.tags.find{ |t| t.name == @treeish } - sha1 = @project.get_project_tag_sha1(tag, format) if tag - end - - if sha1.present? - redirect_to "#{APP_CONFIG['file_store_url']}/api/v1/file_stores/#{sha1}" - else - archive = @project.archive_by_treeish_and_format @treeish, format - send_file archive[:path], disposition: 'attachment', type: "application/#{format == 'zip' ? 'zip' : 'x-tar-gz'}", filename: archive[:fullname] - end - end - - def tags - if request.xhr? - @refs = @project.repo.tags.select{ |t| t.commit }.sort_by(&:name).reverse - render :refs_list - else - respond_to do |format| - format.json { render nothing: true, status: 422 } - format.html - end - end - end - - def restore_branch - authorize @project, :write? - status = @project.create_branch(@treeish, params[:sha], current_user) ? 200 : 422 - render nothing: true, status: status - end - - def create - authorize @project, :write? - status = @project.create_branch(params[:new_ref], params[:from_ref], current_user) ? 200 : 422 - render nothing: true, status: status - end - - def destroy - authorize @project, :write? - status = @branch && @project.delete_branch(@branch, current_user) ? 200 : 422 - render nothing: true, status: status - end - - def branches - if request.xhr? - @refs = @project.repo.branches.sort_by(&:name) - render :refs_list - else - respond_to do |format| - format.json { render nothing: true, status: 422 } - format.html - end - end - end - - protected - - def resolve_treeish - raise Grit::NoSuchPathError if params[:treeish] != @branch.try(:name) - end - - def redirect_to_project - if params[:treeish] == @project.resolve_default_branch && params[:path].blank? && !request.xhr? - redirect_to @project - end - end - -end diff --git a/app/controllers/projects/hooks_controller.rb b/app/controllers/projects/hooks_controller.rb deleted file mode 100644 index 4668beb54..000000000 --- a/app/controllers/projects/hooks_controller.rb +++ /dev/null @@ -1,56 +0,0 @@ -class Projects::HooksController < Projects::BaseController - before_action :authenticate_user! - before_action -> { authorize @project, :update? } - before_action :load_hook, except: %i(index new create) - - def index - @name = params[:name] - @hooks = @project.hooks.for_name(@name).order('name asc, created_at desc') - render(:show) if @name.present? - end - - def new - @hook = @project.hooks.build - end - - def edit - end - - def create - authorize @hook = @project.hooks.build(hook_params) - if @hook.save - redirect_to project_hooks_path(@project, name: @hook.name), notice: t('flash.hook.created') - else - flash[:error] = t('flash.hook.save_error') - flash[:warning] = @hook.errors.full_messages.join('. ') - render :new - end - end - - def update - if @hook.update_attributes(hook_params) - redirect_to project_hooks_path(@project, name: @hook.name), notice: t('flash.hook.updated') - else - flash[:error] = t('flash.hook.save_error') - flash[:warning] = @hook.errors.full_messages.join('. ') - render :edit - end - end - - def destroy - @hook.destroy - redirect_to project_hooks_path(@project, name: @hook.name) - end - - private - - def hook_params - subject_params(Hook) - end - - # Private: before_action hook which loads Hook. - def load_hook - authorize @hook = @project.hooks.find(params[:id]) - end - -end diff --git a/app/controllers/projects/issues_controller.rb b/app/controllers/projects/issues_controller.rb deleted file mode 100644 index a05160298..000000000 --- a/app/controllers/projects/issues_controller.rb +++ /dev/null @@ -1,176 +0,0 @@ -class Projects::IssuesController < Projects::BaseController - before_action :authenticate_user! - skip_before_action :authenticate_user!, only: [:index, :show] if APP_CONFIG['anonymous_access'] - before_action :load_issue, only: %i(show edit update destroy) - before_action :load_and_authorize_label, only: %i(create_label update_label destroy_label) - before_action :find_collaborators, only: :search_collaborators - - layout false, only: [:update, :search_collaborators] - - def index - params[:kind] = params[:kind] == 'pull_requests' ? 'pull_requests' : 'issues' - raise Pundit::NotAuthorizedError if !@project.has_issues? && params[:kind] == 'issues' - - params[:filter] = params[:filter].in?(['created', 'assigned']) ? params[:filter] : 'all' - params[:sort] = params[:sort] == 'submitted' ? 'submitted' : 'updated' - params[:direction] = params[:direction] == 'asc' ? :asc : :desc - params[:status] = params[:status] == 'closed' ? :closed : :open - if !params[:labels].is_a?(Array) || params[:labels].blank? - params[:labels] = [] - end - - respond_to do |format| - format.html { render 'index' } - format.json do - all_issues = - if params[:kind] == 'pull_requests' - @project.issues.joins(:pull_request) - else - @project.issues.without_pull_requests - end - - @all_issues = all_issues - if current_user - @created_issues = all_issues.where(user_id: current_user) - @assigned_issues = all_issues.where(assignee_id: current_user) - end - - case params[:filter] - when 'created' - @issues = @created_issues - when 'assigned' - @issues = @assigned_issues - else - @issues = all_issues - end - - if params[:labels].is_a?(Array) && params[:labels].present? - @issues = @issues.joins(:labels).where(labels: {name: params[:labels]}) - end - - @opened_issues, @closed_issues = @issues.not_closed_or_merged, @issues.closed_or_merged - @issues = @issues.send( params[:status] == :closed ? :closed_or_merged : :not_closed_or_merged ) - - if params[:sort] == 'submitted' - @issues = @issues.order(created_at: params[:direction]) - else - @issues = @issues.order(updated_at: params[:direction]) - end - - @issues = @issues.includes(:assignee, :user, :pull_request).uniq - .paginate(page: current_page) - - render 'index' - end - end - end - - def pull_requests - params[:kind] = 'pull_requests' - index - end - - def labels - render partial: 'projects/issues/labels.json', locals: {project: @project}, layout: false - end - - def new - authorize @issue = @project.issues.build - end - - def create - @issue = @project.issues.new - @issue.assign_attributes(issue_params) - @issue.user = current_user - - authorize @issue - if @issue.save - @issue.subscribe_creator(current_user.id) - flash[:notice] = I18n.t("flash.issue.saved") - redirect_to project_issues_path(@project) - else - flash[:error] = I18n.t("flash.issue.save_error") - render action: :new - end - end - - def show - redirect_to project_pull_request_path(@project, @issue.pull_request) if @issue.pull_request - @commentable = @issue - end - - def update - respond_to do |format| - format.html { render nothing: true, status: 200 } - - format.json { - status = 200 - if params[:issue] && status = params[:issue][:status] - @issue.set_close(current_user) if status == 'closed' - @issue.set_open if status == 'open' - status = @issue.save ? 200 : 500 - else - status = 422 unless @issue.update_attributes(issue_params) - end - render status: status - } - end - end - - # def destroy - # @issue.destroy - # flash[:notice] = t("flash.issue.destroyed") - # redirect_to root_path - # end - - def create_label - @label = @project.labels.new(name: params[:name], color: params[:color]) - respond_to do |format| - if @label.save - format.json { render partial: 'labels', locals: {project: @project} } - else - format.json { render text: @label.errors.full_messages, status: 422 } - end - end - end - - def update_label - respond_to do |format| - if @label.update_attributes(name: params[:name], color: params[:color]) - format.json { render partial: 'labels', locals: {project: @project} } - else - format.json { render text: @label.errors.full_messages, status: 422 } - end - end - end - - def destroy_label - respond_to do |format| - if @label.destroy - format.json { render partial: 'labels', locals: {project: @project} } - else - format.json { render json: @label.errors.full_messages, status: 422 } - end - end - end - - def search_collaborators - end - - private - - def issue_params - subject_params(Issue, @issue) - end - - # Private: before_action hook which loads Issue. - def load_issue - authorize @issue = @project.issues.find_by!(serial_id: params[:id]) - end - - # Private: before_action hook which loads Label. - def load_and_authorize_label - authorize @project, :write? - @label = @project.labels.find(params[:label_id]) if params[:label_id] - end -end diff --git a/app/controllers/projects/project/base_controller.rb b/app/controllers/projects/project/base_controller.rb deleted file mode 100644 index 82baaa905..000000000 --- a/app/controllers/projects/project/base_controller.rb +++ /dev/null @@ -1,3 +0,0 @@ -class Projects::Project::BaseController < Projects::BaseController - -end \ No newline at end of file diff --git a/app/controllers/projects/project/project_controller.rb b/app/controllers/projects/project/project_controller.rb deleted file mode 100644 index ba680bc1d..000000000 --- a/app/controllers/projects/project/project_controller.rb +++ /dev/null @@ -1,13 +0,0 @@ -class Projects::Project::ProjectController < Projects::Project::BaseController - def index - (render :error_github) if not @project.github_data - end - - def commit - redirect_to 'https://github.com/' + @project.github_get_organization + '/' + @project.name + '/commit/' + params[:sha] - end - - def diff - redirect_to 'https://github.com/' + @project.github_get_organization + '/' + @project.name + '/compare/' + params[:diff] - end -end \ No newline at end of file diff --git a/app/controllers/projects/projects_controller.rb b/app/controllers/projects/projects_controller.rb index 5007667c9..8c5fb037b 100644 --- a/app/controllers/projects/projects_controller.rb +++ b/app/controllers/projects/projects_controller.rb @@ -136,29 +136,6 @@ class Projects::ProjectsController < Projects::BaseController redirect_to @project.owner end - def fork(is_alias = false) - owner = (Group.find params[:group] if params[:group].present?) || current_user - authorize owner, :write? - if forked = @project.fork(owner, new_name: params[:fork_name], is_alias: is_alias) and forked.valid? - redirect_to forked, notice: t("flash.project.forked") - else - flash[:warning] = t("flash.project.fork_error") - flash[:error] = forked.errors.full_messages.join("\n") - redirect_to @project - end - end - - def alias - authorize @project - fork(true) - end - - def possible_forks - authorize @project - render partial: 'projects/git/base/forks', layout: false, - locals: { owner: current_user, name: (params[:name].presence || @project.name) } - end - def sections authorize @project, :update? if request.patch? @@ -193,20 +170,16 @@ class Projects::ProjectsController < Projects::BaseController render json: items end - def preview - authorize @project - respond_to do |format| - format.json {} - format.html {render inline: view_context.markdown(params[:text]), layout: false} - end + def commit + redirect_to 'https://github.com/' + @project.github_get_organization + '/' + @project.name + '/commit/' + params[:sha] end - def refs_list - authorize @project - refs = @project.repo.branches_and_tags.map(&:name) - @selected = params[:selected] if refs.include?(params[:selected]) - @selected ||= @project.resolve_default_branch - render layout: false + def diff + redirect_to 'https://github.com/' + @project.github_get_organization + '/' + @project.name + '/compare/' + params[:diff] + end + + def bl_redirect + redirect_to controller: "build_lists", action: "index" end protected diff --git a/app/controllers/projects/pull_requests_controller.rb b/app/controllers/projects/pull_requests_controller.rb deleted file mode 100644 index 6390e81f9..000000000 --- a/app/controllers/projects/pull_requests_controller.rb +++ /dev/null @@ -1,169 +0,0 @@ -class Projects::PullRequestsController < Projects::BaseController - before_action :authenticate_user! - skip_before_action :authenticate_user!, only: [:index, :show] if APP_CONFIG['anonymous_access'] - - before_action :load_issue, except: %i(index autocomplete_to_project new create) - before_action :load_pull, except: %i(index autocomplete_to_project new create) - - def new - to_project = find_destination_project(false) - authorize to_project, :show? - - @pull = to_project.pull_requests.new - @issue = @pull.issue = to_project.issues.new - set_attrs - - authorize @pull - if PullRequest.check_ref(@pull, 'to', @pull.to_ref) && PullRequest.check_ref(@pull, 'from', @pull.from_ref) || @pull.uniq_merge - flash.now[:warning] = @pull.errors.full_messages.join('. ') - else - @pull.check(false) # don't make event transaction - if @pull.already? - @pull.destroy - flash.now[:warning] = I18n.t('projects.pull_requests.up_to_date', to_ref: @pull.to_ref, from_ref: @pull.from_ref) - else - load_diff_commits_data - end - end - end - - def create - unless pull_params - redirect :back - end - to_project = find_destination_project - authorize to_project, :show? - - @pull = to_project.pull_requests.build pull_params - @issue = @pull.issue - @pull.issue.assignee_id = (params[:issue] || {})[:assignee_id] if policy(to_project).write? - @pull.issue.user, @pull.issue.project, @pull.from_project = current_user, to_project, @project - @pull.from_project_owner_uname = @pull.from_project.owner.uname - @pull.from_project_name = @pull.from_project.name - @pull.issue.new_pull_request = true - - authorize @pull - if @pull.valid? # FIXME more clean/clever logics - @pull.save # set pull id - @pull.reload - @pull.check(false) # don't make event transaction - if @pull.already? - @pull.destroy - flash.now[:error] = I18n.t('projects.pull_requests.up_to_date', to_ref: @pull.to_ref, from_ref: @pull.from_ref) - render :new - else - @pull.send(@pull.status == 'blocked' ? 'block' : @pull.status) - redirect_to project_pull_request_path(@pull.to_project, @pull) - end - else - flash.now[:error] = t('flash.pull_request.save_error') - flash.now[:warning] = @pull.errors.full_messages.join('. ') - - if @pull.errors.try(:messages) && @pull.errors.messages[:to_ref].nil? && @pull.errors.messages[:from_ref].nil? - @pull.check(false) # don't make event transaction - load_diff_commits_data - end - render :new - end - end - - def merge - authorize @pull - status = @pull.merge!(current_user) ? 200 : 422 - render nothing: true, status: status - end - - def update - authorize @pull - status = 422 - if (action = params[:pull_request_action]) && %w(close reopen).include?(params[:pull_request_action]) - if @pull.send("can_#{action}?") - @pull.set_user_and_time current_user - @pull.send(action) - @pull.check if @pull.open? - status = 200 - end - end - render nothing: true, status: status - end - - def show - if @pull.nil? - redirect_to project_issue_path(@project, @issue) - return - end - - load_diff_commits_data - - if params[:get_activity] == 'true' - render partial: 'activity', layout: false - elsif params[:get_diff] == 'true' - render partial: 'diff_tab', layout: false - elsif params[:get_commits] == 'true' - render partial: 'commits_tab', layout: false - end - end - - def autocomplete_to_project - items = [] - term = params[:query].to_s.strip.downcase - [ Project.where(id: @project.pull_requests.last.try(:to_project_id)), - @project.ancestors, - ProjectPolicy::Scope.new(current_user, Project).membered - ].each do |p| - items.concat p.by_owner_and_name(term) - end - items = items.uniq{|i| i.id}.select{|e| e.repo.branches.count > 0} - render json: json_for_autocomplete_base(items) - end - - protected - - # Private: before_action hook which loads Issue. - def load_issue - @issue = @project.issues.find_by!(serial_id: params[:id]) - end - - # Private: before_action hook which loads PullRequest. - def load_pull - @pull = @issue.pull_request - authorize @pull, :show? if @pull - end - - def pull_params - @pull_params ||= subject_params(PullRequest).presence - end - - def json_for_autocomplete_base items - items.collect do |project| - {id: project.id.to_s, name: project.name_with_owner} - end - end - - def load_diff_commits_data - @commits = @pull.repo.commits_between(@pull.to_commit, @pull.from_commit) - @total_commits = @commits.count - @commits = @commits.last(100) - - @stats = @pull.diff_stats - @comments, @commentable = @issue.comments, @issue - end - - def find_destination_project bang=true - project = Project.find_by_owner_and_name params[:to_project] - raise ActiveRecord::RecordNotFound if bang && !project - project || @project.pull_requests.last.try(:to_project) || @project.root - end - - def set_attrs - if pull_params && pull_params[:issue_attributes] - @pull.issue.title = pull_params[:issue_attributes][:title].presence - @pull.issue.body = pull_params[:issue_attributes][:body].presence - end - @pull.from_project = @project - @pull.to_ref = (pull_params[:to_ref].presence if pull_params) || @pull.to_project.default_head - @pull.from_ref = params[:treeish].presence || (pull_params[:from_ref].presence if pull_params) || @pull.from_project.default_head(params[:treeish]) - @pull.from_project_owner_uname = @pull.from_project.owner.uname - @pull.from_project_name = @pull.from_project.name - end -end diff --git a/app/controllers/projects/subscribes_controller.rb b/app/controllers/projects/subscribes_controller.rb deleted file mode 100644 index a5b8aef31..000000000 --- a/app/controllers/projects/subscribes_controller.rb +++ /dev/null @@ -1,31 +0,0 @@ -class Projects::SubscribesController < Projects::BaseController - before_action :authenticate_user! - - before_action :load_issue - - def create - authorize @subscribe = @issue.subscribes.build(user_id: current_user.id) - if @subscribe.save - flash[:notice] = I18n.t("flash.subscribe.saved") - redirect_to :back - else - flash[:error] = I18n.t("flash.subscribe.saved_error") - redirect_to :back - end - end - - def destroy - authorize @subscribe = @issue.subscribes.find_by(user_id: current_user.id) - @subscribe.destroy - - flash[:notice] = t("flash.subscribe.destroyed") - redirect_to :back - end - - private - - # Private: before_action hook which loads Issue. - def load_issue - authorize @issue = @project.issues.find_by!(serial_id: params[:issue_id]), :show? - end -end diff --git a/app/controllers/projects/wiki_controller.rb b/app/controllers/projects/wiki_controller.rb deleted file mode 100644 index ccdfd5d6d..000000000 --- a/app/controllers/projects/wiki_controller.rb +++ /dev/null @@ -1,287 +0,0 @@ -#require 'lib/gollum' -require 'cgi' - -class Projects::WikiController < Projects::BaseController - WIKI_OPTIONS = {} - - before_action :authenticate_user! - skip_before_action :authenticate_user!, only: [:show, :index, :git, :compare, :compare_wiki, :history, :wiki_history, :search, :pages] if APP_CONFIG['anonymous_access'] - - before_action :authorize_read_actions, only: [:index, :show, :git, :compare, :compare_wiki, :history, :wiki_history, :search, :pages] - before_action :authorize_write_actions, only: [:edit, :update, :new, :create, :destroy, :revert, :revert_wiki, :preview] - before_action :get_wiki - - def index - @name = 'Home' - @page = @wiki.page(@name) - - show_or_create_page - end - - def show - @name = CGI.unescape(params[:id]) - redirect_to project_wiki_index_path(@project) and return if @name == 'Home' - - ref = params[:ref].presence || @wiki.ref - @page = @wiki.page(@name, ref) - if !@page && @wiki.page(@name) - flash[:error] = t('flash.wiki.ref_not_exist') - redirect_to project_wiki_path(@project, CGI.escape(@name)) and return - end - - show_or_create_page - end - - def edit - @name = CGI.unescape(params[:id]) - if page = @wiki.page(@name) - @page = page - @content = page.text_data - render :edit - else - render :new - end - end - - def update - @name = CGI.unescape(params[:id]) - @page = @wiki.page(@name) - name = wiki_page_params[:rename] || @name - - update_wiki_page(@wiki, @page, wiki_page_params[:content], {committer: committer}, name, wiki_page_params[:format]) - update_wiki_page(@wiki, @page.footer, wiki_page_params[:footer], {committer: committer}) if wiki_page_params[:footer] - update_wiki_page(@wiki, @page.sidebar, wiki_page_params[:sidebar], {committer: committer}) if wiki_page_params[:sidebar] - - committer.commit - - flash[:notice] = t('flash.wiki.successfully_updated', name: @name) - redirect_to project_wiki_path(@project, CGI.escape(@name)) - end - - def new - @name = '' - @new = true - end - - def create - @name = CGI.unescape(wiki_page_params[:page]) - format = wiki_page_params[:format].intern - begin - @wiki.write_page(@name, format, wiki_page_params[:content] || '', {committer: committer}).commit - redirect_to project_wiki_path(@project, CGI.escape(@name)) - rescue Gollum::DuplicatePageError => e - flash[:error] = t("flash.wiki.duplicate_page", name: @name) - render :new - end - end - - def destroy - @name = CGI.unescape(params[:id]) - page = @wiki.page(@name) - if page - @wiki.delete_page(page, {committer: committer}).commit - flash[:notice] = t("flash.wiki.page_successfully_removed") - else - flash[:notice] = t("flash.wiki.page_not_found", name: params[:id]) - end - redirect_to project_wiki_index_path(@project) - end - - def git - end - - def compare - @name = CGI.unescape(params[:id]) - if request.post? - @versions = params[:versions] || [] - if @versions.size < 2 - redirect_to history_project_wiki_path(@project, CGI.escape(@name)) - else - redirect_to compare_versions_project_wiki_path(@project, CGI.escape(@name), - sprintf('%s...%s', @versions.last, @versions.first)) - end - elsif request.get? - @versions = params[:versions].split(/\.{2,3}/) - if @versions.size < 2 - redirect_to history_project_wiki_path(@project, CGI.escape(@name)) - return - end - @page = @wiki.page(@name) - @diffs = [@wiki.repo.diff(@versions.first, @versions.last, @page.path).first] - render :compare - else - redirect_to project_wiki_path(@project, CGI.escape(@name)) - end - end - - def compare_wiki - if request.post? - @versions = params[:versions] || [] - versions_string = case @versions.size - when 1 then @versions.first - when 2 then sprintf('%s...%s', @versions.last, @versions.first) - else begin - redirect_to history_project_wiki_index_path(@project) - return - end - end - redirect_to compare_versions_project_wiki_index_path(@project, versions_string) - elsif request.get? - @versions = params[:versions].split(/\.{2,3}/) || [] - @diffs = case @versions.size - when 1 then @wiki.repo.commit_diff(@versions.first) - when 2 then @wiki.repo.diff(@versions.first, @versions.last) - else begin - redirect_to history_project_wiki_index_path(@project) - return - end - end - render :compare - else - redirect_to project_wiki_path(@project, CGI.escape(@name)) - end - end - - def revert - @name = CGI.unescape(params[:id]) - @page = @wiki.page(@name) - sha1 = params[:sha1] - sha2 = params[:sha2] - sha2 = nil if params[:sha2] == 'prev' - - if c = @wiki.revert_page(@page, sha1, sha2, {committer: committer}) and c.commit - flash[:notice] = t("flash.wiki.revert_success") - redirect_to project_wiki_path(@project, CGI.escape(@name)) - else - # if revert wasn't successful then redirect back to comparsion. - # if second commit version is missed, then second version is - # params[:sha1] and first version is parent of params[:sha1] - # (see Gollum::Wiki#revert_page) - sha2, sha1 = sha1, "#{sha1}^" if !sha2 - @versions = [sha1, sha2] - diffs = @wiki.repo.diff(@versions.first, @versions.last, @page.path) - @diffs = [diffs.first] - flash[:error] = t("flash.wiki.patch_does_not_apply") - render :compare - end - end - - def revert_wiki - sha1 = params[:sha1] - sha2 = params[:sha2] - sha2 = nil if sha2 == 'prev' - if c = @wiki.revert_commit(sha1, sha2, {committer: committer}) and c.commit - flash[:notice] = t("flash.wiki.revert_success") - redirect_to project_wiki_index_path(@project) - else - sha2, sha1 = sha1, "#{sha1}^" if !sha2 - @versions = [sha1, sha2] - @diffs = @wiki.repo.diff(@versions.first, @versions.last) - flash[:error] = t("flash.wiki.patch_does_not_apply") - render :compare - end - end - - def preview - @name = wiki_page_params[:page] - @page = @wiki.preview_page(@name, wiki_page_params[:content], wiki_page_params[:format]) - @content = @page.formatted_data - @editable = false - render :show - end - - def history - @name = CGI.unescape(params[:id]) - if @page = @wiki.page(@name) - @versions = @page.versions - else - redirect_to :back - end - end - - def wiki_history - @versions = @wiki.log - render :history - end - - def search - @query = params[:q] - @results = @wiki.search @query - end - - def pages - @results = @wiki.pages - @ref = @wiki.ref - end - - protected - - def get_wiki - @wiki = Gollum::Wiki.new(@project.wiki_path, - WIKI_OPTIONS.merge(base_path: project_wiki_index_path(@project))) - end - - # This method was grabbed from sinatra application, shipped with Gollum gem. - # See Gollum gem and Gollum License if you have any questions about license notes. - # https://github.com/github/gollum https://github.com/github/gollum/blob/master/LICENSE - def update_wiki_page(wiki, page, content, commit_msg, name = nil, format = nil) - return if !page || - ((!content || page.raw_data == content) && page.format == format) - name ||= page.name - format = (format || page.format).to_sym - content ||= page.raw_data - wiki.update_page(page, name, format, content.to_s, commit_msg) - end - - def commit_message - msg = wiki_page_params[:message].presence - unless msg - msg = case action_name.to_s - when 'create' then "Created page #{@name.to_s}" - when 'update' then "Updated page #{@name.to_s}" - when 'destroy' then "Removed page #{@name.to_s}" - when 'revert' then "Reverted page #{@name.to_s}" - when 'revert_wiki' then "Reverted wiki" - end - msg << " (#{wiki_page_params[:format]})" if wiki_page_params[:format] - end - msg = 'Unhandled action' if !msg || msg.empty? - { message: msg } - end - - def committer - unless @committer - p = commit_message.merge({name: current_user.uname, email: current_user.email}) - @committer = Gollum::Committer.new(@wiki, p) - GitHook.perform_later!(:notification, :process, {project_id: @project.id, actor_name: @committer.actor.name, commit_sha: @committer.commit}) - end - @committer - end - - def show_or_create_page - if @page - @content = @page.formatted_data - @editable = policy(@project).write? - render :show - elsif file = @wiki.file(@name) - render text: file.raw_data, content_type: file.mime_type - elsif policy(@project).write? - @new = true - render :new - else - redirect_to action: :index #forbidden_path - end - end - - def wiki_page_params - @wiki_page_params ||= params[:wiki_page] || {} - end - - def authorize_read_actions - authorize @project, :show? - end - - def authorize_write_actions - authorize @project, :write? - end -end diff --git a/app/controllers/users/omniauth_callbacks_controller.rb b/app/controllers/users/omniauth_callbacks_controller.rb deleted file mode 100644 index ec02acebf..000000000 --- a/app/controllers/users/omniauth_callbacks_controller.rb +++ /dev/null @@ -1,63 +0,0 @@ -class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController - - def facebook - oauthorize 'Facebook' - end - - def google_oauth2 - oauthorize 'google_oauth2' - end - - def github - oauthorize 'GitHub' - end - - def passthru - render file: "#{Rails.root}/public/404.html", status: 404, layout: false - end - - private - - def oauthorize(kind) - provider = kind.downcase - @user = find_for_ouath(env["omniauth.auth"], current_user) - if @user && @user.persisted? - flash[:notice] = I18n.t "devise.omniauth_callbacks.success", kind: action_name.classify - sign_in_and_redirect @user, event: :authentication - else - session["devise.#{provider}_data"] = env["omniauth.auth"] - redirect_to new_user_registration_url - end - end - - def find_for_ouath(auth, resource=nil) - provider, uid = auth['provider'], auth['uid'] - authentication = Authentication.find_or_initialize_by(provider: provider, uid: uid) - if authentication.new_record? - if user_signed_in? # New authentication method for current_user - authentication.user = current_user - else # Register new user from session - case provider - when 'facebook' - name = auth['extra']['raw_info']['name'] - when 'google_oauth2', 'github' - name = auth['info']['nickname'] || auth['info']['name'] - else - raise 'Provider #{provider} not handled' - end - user = User.find_or_initialize_by email: auth['info']['email'] - if user.new_record? - user.name = name - user.uname = name.gsub(/\s/, '').underscore - user.password = Devise.friendly_token[0,20] - user.confirmed_at = Time.zone.now - user.save - end - authentication.user = user - end - authentication.save - end - return authentication.user - end - -end diff --git a/app/controllers/users/register_requests_controller.rb b/app/controllers/users/register_requests_controller.rb deleted file mode 100644 index bbe23a47b..000000000 --- a/app/controllers/users/register_requests_controller.rb +++ /dev/null @@ -1,24 +0,0 @@ -class Users::RegisterRequestsController < ApplicationController - before_action :user_choose_locale - layout 'invite' - - def new - if APP_CONFIG['preregistration'] - render :invite - else - redirect_to new_user_registration_path - end - end - - def create - params[:register_request][:language] = I18n.locale if params[:register_request] - RegisterRequest.create(params[:register_request]) - render :thanks - end - - protected - - def user_choose_locale - I18n.locale = params[:format] if User::LANGUAGES.include?(params[:format]) - end -end diff --git a/app/helpers/activity_feeds_helper.rb b/app/helpers/activity_feeds_helper.rb index bf92330c3..53d9180cf 100644 --- a/app/helpers/activity_feeds_helper.rb +++ b/app/helpers/activity_feeds_helper.rb @@ -1,8 +1,4 @@ module ActivityFeedsHelper - def render_activity_feed(activity_feed) - render activity_feed.partial, activity_feed.data.merge(activity_feed: activity_feed) - end - def get_feed_title_from_content(content) # removes html tags and haml generator indentation whitespaces and new line chars: feed_title = strip_tags(content).gsub(/(^\s+|\n| )/, ' ') diff --git a/app/helpers/advisories_helper.rb b/app/helpers/advisories_helper.rb deleted file mode 100644 index 1f8dc4e6b..000000000 --- a/app/helpers/advisories_helper.rb +++ /dev/null @@ -1,21 +0,0 @@ -module AdvisoriesHelper - def advisories_select_options(advisories, opts = {class: 'popoverable'}) - def_values = [[t("layout.advisories.no_"), 'no'], [t("layout.advisories.new"), 'new'], [t("layout.advisories.existing"), 'existing', {class: 'advisory_id'}]] - options_for_select(def_values, def_values.first) - end - - def advisory_id_for_hint - sprintf(Advisory::ID_STRING_TEMPLATE, type: "{#{Advisory::TYPES.values.join(',')}}", - year: 'YYYY', id: 'XXXX') - end - - def construct_ref_link(ref) - ref = sanitize(ref) - url = if ref =~ %r[^http(s?)://*] - ref - else - 'http://' << ref - end - link_to url, url - end -end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index a48fa5e0b..f387efd5b 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -47,15 +47,12 @@ module ApplicationHelper 'fa-cogs' when :groups 'fa-users' - when :advisories - 'fa-newspaper-o' when :statistics 'fa-area-chart' end end def title_object(object) - return object.advisory_id if object.class == Advisory name = object.class == Group ? object.uname : object.name object_name = t "activerecord.models.#{object.class.name.downcase}" case object.class.name diff --git a/app/helpers/build_lists_helper.rb b/app/helpers/build_lists_helper.rb index 1d8b2714d..46c17de52 100644 --- a/app/helpers/build_lists_helper.rb +++ b/app/helpers/build_lists_helper.rb @@ -82,18 +82,7 @@ module BuildListsHelper end end - def build_list_classified_update_types - advisoriable = BuildList::RELEASE_UPDATE_TYPES.map do |el| - [el, {class: 'advisoriable'}] - end - nonadvisoriable = (BuildList::UPDATE_TYPES - BuildList::RELEASE_UPDATE_TYPES).map do |el| - [el, {class: 'nonadvisoriable'}] - end - - return advisoriable + nonadvisoriable - end - - def build_list_item_version_link(item, str_version = false) + def build_list_item_version_link(item, str_version = false) hash_size=5 if item.version =~ /^[\da-z]+$/ && item.name == item.build_list.project.name bl = item.build_list @@ -331,4 +320,12 @@ module BuildListsHelper checked = build_list.auto_create_container if checked.nil? checked end + + def short_hash_id(id) + id[0..19] + end + + def shortest_hash_id(id, size=10) + id[0..size-1] + end end diff --git a/app/helpers/comments_helper.rb b/app/helpers/comments_helper.rb deleted file mode 100644 index d57301a6e..000000000 --- a/app/helpers/comments_helper.rb +++ /dev/null @@ -1,29 +0,0 @@ -module CommentsHelper - def project_commentable_comment_path(project, commentable, comment) - if Comment.issue_comment?(commentable.class) - project_issue_comment_path(project, commentable, comment) - elsif Comment.commit_comment?(commentable.class) - project_commit_comment_path(project, commentable, comment) - end - end - - def project_commentable_path(project, commentable) - if Comment.issue_comment?(commentable.class) - polymorphic_path [project, commentable.pull_request ? commentable.pull_request : commentable] - elsif Comment.commit_comment?(commentable.class) - commit_path project, commentable.id - end - end - - def project_commentable_comments_path(project, commentable) - if commentable.is_a? Issue - project_issue_comments_path(@project, @commentable) - elsif commentable.is_a? Grit::Commit - project_commit_comments_path(@project, @commentable) - end - end - - def comment_anchor c - "#{(c.data.present? && c.actual_inline_comment?) ? 'diff-' : ''}comment#{c.id}" - end -end diff --git a/app/helpers/commit_helper.rb b/app/helpers/commit_helper.rb deleted file mode 100644 index a031fc950..000000000 --- a/app/helpers/commit_helper.rb +++ /dev/null @@ -1,196 +0,0 @@ -module CommitHelper - MAX_FILES_WITHOUT_COLLAPSE = 25 - - def render_commit_stats(options = {}) - stats = options[:stats] - diff = options[:diff] - repo = options[:repo] - commit = options[:commit] - parent_commit = commit.parents.try(:first) - - res = ["
    "] - ind=0 - stats.files.each do |filename, adds, deletes, total| - file_name = get_filename_in_diff(diff[ind], filename) - file_status = t "layout.projects.diff.#{get_file_status_in_diff(diff[ind])}" - res << "
  • " - res << "
    " - res << "" - res << render_file_changes(diff: diff[ind], adds: adds, deletes: deletes, total: total, - repo: repo, commit: commit, parent_commit: parent_commit, file_status: file_status) - res << "" - ind +=1 - end - res << "
" - - wrap_commit_header_list(stats, res) - end - - def wrap_commit_header_list(stats, list) - is_stats_open = stats.files.count <= MAX_FILES_WITHOUT_COLLAPSE ? 'in' : '' - res = ["
"] - res << "
" - res << "" - res << "
" - res << "
" - res += list - res << "
" - res << "
" - res << "
" - res << "
" - res.join("\n").html_safe - end - - def diff_commit_header_message(stats) - t("layout.projects.diff_show_header", - files: t("layout.projects.commit_files_count", count: stats.files.size), - additions: t("layout.projects.commit_additions_count", count: stats.additions), - deletions: t("layout.projects.commit_deletions_count", count: stats.deletions)) - end - - def commit_date(date) - I18n.localize(date, { format: "%d %B %Y" }) - end - - def short_hash_id(id) - id[0..19] - end - - def shortest_hash_id(id, size=10) - id[0..size-1] - end - - def commit_author_link(author) - name = author.name - email = author.email - u = User.where(email: email).first - u.present? ? link_to(name, user_path(u)) : mail_to(email, name) - end - - def commits_pluralize(commits_count) - Russian.p(commits_count, *commits_pluralization_arr) - end - - def is_file_open_in_diff(blob, diff) - return true if blob.binary? && blob.render_as == :image - return true if diff.diff.blank? && diff.a_mode != diff.b_mode - diff.diff.present? && diff.diff.split("\n").count <= DiffHelper::MAX_LINES_WITHOUT_COLLAPSE - end - - def file_blob_in_diff(repo, commit_id, diff) - return if repo.nil? || commit_id.nil? || diff.nil? - tree = repo.tree(commit_id) - blob = diff.renamed_file ? (tree / diff.b_path) : (tree / (diff.a_path || diff.b_path)) - blob || diff.a_blob || diff.b_blob - end - - def get_commit_id_for_file(diff, commit, parent_commit) - diff.deleted_file ? parent_commit.id : commit.id - end - - def get_file_status_in_diff(diff) - if diff.renamed_file - :renamed_file - elsif diff.new_file - :new_file - elsif diff.deleted_file - :deleted_file - else - :changed_file - end - end - - def get_filename_in_diff(diff, filename) - if diff.renamed_file - "#{diff.a_path.rtruncate 50} => #{diff.b_path.rtruncate 50}" - else - filename.rtruncate(100) - end - end - - protected - - def commits_pluralization_arr - pluralize ||= t('layout.commits.pluralize').map {|base, title| title.to_s} - end - - def render_file_changes(options = {}) - diff = options[:diff] - adds = options[:adds] - deletes = options[:deletes] - total = options[:total] - repo = options[:repo] - file_status = options[:file_status] - commit_id = get_commit_id_for_file(diff, options[:commit], options[:parent_commit]) - blob = file_blob_in_diff(repo, commit_id, diff) - - res = '' - res << "
" - res << "
" - if blob.binary? - res << "#{t 'layout.projects.diff.binary'} #{file_status}" - elsif total > 0 - res << "+#{adds} -#{deletes}" - else # total == 0 - res << "#{t 'layout.projects.diff.without_changes'}" - end - res << "
" - res << "
" - - res << "
" - res << render_progress_bar(adds, deletes, total, blob) - res << "
" - - end - - def render_progress_bar(adds, deletes, total, blob) - res = '' - pluses = 0 - minuses = 0 - - if total > 0 - pluses = ((adds/(adds+deletes).to_f)*100).round - minuses = 100 - pluses - end - - title = if total >0 - t 'layout.projects.inline_changes_count', count: total - elsif !blob.binary? - t 'layout.projects.diff.without_changes' - else - 'BIN' - end - - res << "
" - res << "
" - res << "
" - res << "
" - res - end - - def diff_file_icon(diff) - icon = case get_file_status_in_diff(diff) - when :renamed_file - 'fa-caret-square-o-right text-info' - when :new_file - 'fa-plus-square text-success' - when :deleted_file - 'fa-minus-square text-danger' - when :changed_file - 'fa-pencil-square text-primary' - else - 'fa-exclamation-circle text-danger' - end - "" - end -end diff --git a/app/helpers/diff_helper.rb b/app/helpers/diff_helper.rb deleted file mode 100644 index f698214ce..000000000 --- a/app/helpers/diff_helper.rb +++ /dev/null @@ -1,332 +0,0 @@ -module DiffHelper - include CommitHelper - - MAX_LINES_WITHOUT_COLLAPSE = 50 - - def render_diff_stats(options = {}) - stats = options[:stats] - diff = options[:diff] - repo = options[:repo] - commit = options[:commit] - parent_commit = options[:common_ancestor] - - res = ["
    "] - stats.each_with_index do |stat, ind| - adds = stat.additions - deletes = stat.deletions - total = adds + deletes - file_name = get_filename_in_diff(diff[ind], stat.filename) - file_status = t "layout.projects.diff.#{get_file_status_in_diff(diff[ind])}" - - res << "
  • " - res << "
    " - res << "" - res << render_file_changes(diff: diff[ind], adds: adds, deletes: deletes, total: total, - repo: repo, commit: commit, parent_commit: parent_commit, file_status: file_status) - res << "" - ind +=1 - end - res << "
" - - wrap_diff_header_list(stats, res) - end - - def wrap_diff_header_list(stats, list) - is_stats_open = stats.count <= MAX_FILES_WITHOUT_COLLAPSE ? 'in' : '' - res = ["
"] - res << "
" - res << "" - res << "
" - res << "
" - res += list - res << "
" - res << "
" - res << "
" - res << "
" - res.join("\n").html_safe - end - - def diff_header_message(stats) - total_additions = stats.inject(0) {|sum, n| sum + n.additions} - total_deletions = stats.inject(0) {|sum, n| sum + n.deletions} - I18n.t('layout.projects.diff_show_header', - files: t('layout.projects.commit_files_count', count: stats.count), - additions: t('layout.projects.commit_additions_count', count: total_additions), - deletions: t('layout.projects.commit_deletions_count', count: total_deletions)) - end - - #include Git::Diff::InlineCallback - def render_diff(diff, args = {})#diff_counter, comments, opts = nil diffpath = nil) - if diff.respond_to?(:diff) - diff, filepath, in_discussion = diff.diff, diff.a_path, false - comments = (args[:comments] || []).select{|c| c.data.try('[]', :path) == filepath} - else - filepath, in_discussion, comments = args[:diffpath], true, args[:comments] - end - - diff_display ||= Diff::Display::Unified.new(diff) - url = if @pull - @pull.id ? polymorphic_path([@project, @pull]) : '' - elsif @commit - commit_path @project, @commit - end - prepare(args.merge({filepath: filepath, comments: comments, in_discussion: in_discussion})) - - res = '
' - res << '' - res << '' - res << renderer(diff_display.data) #diff_display.render(Git::Diff::InlineCallback.new comments, path) - res << tr_line_comments(comments) if in_discussion - res << '' - res << '
' - res << '
' - res.html_safe - end - - ######################################################## - # FIXME: Just to dev, remove to lib. Really need it? - ######################################################## - def prepare(args) - @url, @diff_counter, @in_discussion = args[:url], args[:diff_counter], args[:in_discussion] - @filepath, @line_comments = args[:filepath], args[:comments] - @diff_prefix = args[:diff_prefix] || 'diff' - @add_reply_id, @num_line = if @in_discussion - [@line_comments[0].id, @line_comments[0].data[:line].to_i - @line_comments[0].data[:strings].lines.count.to_i-1] - else - [nil, -1] - end - - @no_commit_comment = true if params[:controller] == 'projects/wiki' || (params[:action] == 'diff') - end - - def headerline(line) - set_line_number - " - ... - ... - #{line} - " - end - - def addline(line) - set_line_number - " - - #{td_line_link "#{@diff_prefix}-F#{@diff_counter}R#{line.new_number}", line.new_number} - - #{line_comment_icon} -
#{render_line(line)}
- - - #{render_line_comments}" - end - - def remline(line) - set_line_number - " - #{td_line_link "#{@diff_prefix}-F#{@diff_counter}L#{line.old_number}", line.old_number} - - - #{line_comment_icon} -
#{render_line(line)}
- - - #{render_line_comments}" - end - - def modline(line) - set_line_number - " - #{td_line_link "#{@diff_prefix}-F#{@diff_counter}L#{line.old_number}", line.old_number} - #{td_line_link "#{@diff_prefix}-F#{@diff_counter}R#{line.new_number}", line.new_number} - - #{line_comment_icon} -
#{render_line(line)}
- - - #{render_line_comments}" - end - - def unmodline(line) - set_line_number - " - #{td_line_link "#{@diff_prefix}-F#{@diff_counter}L#{line.old_number}", line.old_number} - #{td_line_link "#{@diff_prefix}-F#{@diff_counter}R#{line.new_number}", line.new_number} - - #{line_comment_icon} -
#{render_line(line)}
- - - #{render_line_comments}" - end - - def sepline(line) - " - … - … - - " - end - - def nonewlineline(line) - set_line_number - " - #{td_line_link "#{@diff_prefix}-F#{@diff_counter}L#{line.old_number}", line.old_number} - #{td_line_link "#{@diff_prefix}-F#{@diff_counter}R#{line.new_number}", line.new_number} - - #{line_comment_icon} -
#{render_line(line)}
- - - #{render_line_comments}" - end - - def before_headerblock(block) - end - - def after_headerblock(block) - end - - def before_unmodblock(block) - end - - def before_modblock(block) - end - - def before_remblock(block) - end - - def before_addblock(block) - end - - def before_sepblock(block) - end - - def before_nonewlineblock(block) - end - - def after_unmodblock(block) - end - - def after_modblock(block) - end - - def after_remblock(block) - end - - def after_addblock(block) - end - - def after_sepblock(block) - end - - def after_nonewlineblock(block) - end - - def new_line - "" - end - - def renderer(data) - result = [] - data.each do |block| - result << send("before_" + classify(block), block) - result << block.map { |line| send(classify(line), line) } - result << send("after_" + classify(block), block) - end - result.compact.join(new_line) - end - - protected - - def classify(object) - object.class.name[/\w+$/].downcase - end - - def escape(str) - str.to_s.gsub('&', '&').gsub('<', '<').gsub('>', '>').gsub('"', '"') - end - - def render_line(line) - res = '' - if line.inline_changes? - prefix, changed, postfix = line.segments.map{|segment| escape(segment) } - res << "#{prefix}#{changed}#{postfix}" - else - res << escape(line) - end - res << '' - - res - end - - def set_line_number - @num_line = @num_line.succ - end - - def line_comment_icon - return if @no_commit_comment || (@in_discussion && @add_reply_id && @line_comments[0].data[:line].to_i != @num_line) - if current_user - link_to image_tag('line_comment.png', alt: t('layout.comments.new_header')), - '#new_inline_comment', - class: 'add_line-comment', - 'ng-click' => "commentsCtrl.showInlineForm($event, #{new_inline_comment_params.to_json})" - end - end - - def render_line_comments - unless @no_commit_comment || @in_discussion - comments = @line_comments.select do |c| - c.data.try('[]', :line).to_s == @num_line.to_s && c.actual_inline_comment? - end - tr_line_comments(comments) if comments.count > 0 - end - end - - def td_line_link id, num - "#{num}" - end - - def tr_line_comments comments - return if @no_commit_comment - res=" - #{comments.count} - " - comments.each do |comment| - res << "
- #{render 'projects/comments/comment', comment: comment, data: {project: @project, commentable: @commentable, add_anchor: 'inline', in_discussion: @in_discussion}} -
" - end - if current_user - res << link_to( t('layout.comments.new_inline'), - '#new_inline_comment', - class: 'btn btn-primary', - 'ng-click' => "commentsCtrl.showInlineForm($event, #{new_inline_comment_params.to_json})", - 'ng-hide' => "commentsCtrl.hideInlineCommentButton(#{new_inline_comment_params.to_json})" ) - end - res << "" - end - # def new_comment_path - # hash = {path: @filepath, line: @num_line} - # if @commentable.is_a? Issue - # project_new_line_pull_comment_path(@project, @commentable, hash.merge({in_reply: @add_reply_id})) - # elsif @commentable.is_a? Grit::Commit - # new_line_commit_comment_path(@project, @commentable, hash) - # end - # end - - def new_inline_comment_params - { path: @filepath, line: @num_line, in_reply: @add_reply_id } - end - -end diff --git a/app/helpers/facebook_helper.rb b/app/helpers/facebook_helper.rb index 25eeb607e..06c4d1a7c 100644 --- a/app/helpers/facebook_helper.rb +++ b/app/helpers/facebook_helper.rb @@ -52,8 +52,6 @@ module FacebookHelper @group when Users::BaseController @user - when Projects::Git::BaseController - @project else instance_variable_get "@#{controller_name.singularize}" end diff --git a/app/helpers/git_helper.rb b/app/helpers/git_helper.rb index c735e4625..239afda0c 100644 --- a/app/helpers/git_helper.rb +++ b/app/helpers/git_helper.rb @@ -1,92 +1,4 @@ module GitHelper - - def submodule_url(node, treeish) - # node.url(treeish) looks like: - # - http://0.0.0.0:3000/abf/git@abf.rosalinux.ru:abf/rhel-scripts.git - # - git://github.com/avokhmin/mdv-scripts.git - # - empty string if ".gitmodules" does not exist - url = node.url(treeish) - return nil if url.blank? - url.gsub!(/.git$/, '') - if url =~ /^git:/ - url.gsub!(/^git/, 'http') - elsif str = /git@.*:.*/.match(url) - str = str[0].gsub(/^git@/, '') - domen = str.gsub(/:.*/, '') - owner = str.gsub(/^#{domen}:/, '').gsub(/\/.*/, '') - project = str.gsub(/.*\//, '') - url = "http://#{domen}/#{owner}/#{project}" - end - url - end - - def render_path - # TODO: Looks ugly, rewrite with clear mind. - if @path.present? - if @treeish == @project.resolve_default_branch - res = "#{link_to @project.name, tree_path(@project)} / " - else - res = "#{link_to @project.name, tree_path(@project, @treeish)} / " - end - - parts = @path.split("/") - - current_path = parts.first - res << (parts.length == 1 ? parts.first : link_to(parts.first, tree_path(@project, @treeish, current_path)) + " / ") - - parts[1..-2].each do |part| - current_path = File.join([current_path, part].compact) - res << link_to(part, tree_path(@project, @treeish, current_path)) - res << " / " - end - - res << parts.last if parts.length > 1 - else - res = "#{link_to @project.name, tree_path(@project)} /" - end - - res.html_safe - end - - def render_line_numbers(n) - res = "" - 1.upto(n){ |i| res << "#{i}
" } - - res.html_safe - end - - def iterate_path(path) - tree = [] - path.split("\/").each do |name| - if tree.last - tree << [File.join(tree.try(:last).try(:first), name), name] - else - tree << [name, name] - end - end - tree - end - - def branch_selector_options(project) - p, tag_enabled = params.dup, !(controller_name == 'trees' && action_name == 'branches') - p.delete(:path) if p[:path].present? # to root path - p.merge!(project_id: project.id, treeish: project.resolve_default_branch).delete(:id) unless p[:treeish].present? - current = url_for(p).split('?', 2).first - - res = [] - if params[:treeish].present? && !project.repo.branches_and_tags.map(&:name).include?(params[:treeish]) - res << [I18n.t('layout.git.repositories.commits'), [params[:treeish].truncate(20)]] - end - linking = Proc.new {|name| [name.truncate(20), url_for(p.merge treeish: name).split('?', 2).first]} - res << [I18n.t('layout.git.repositories.branches'), project.repo.branches.map(&:name).sort.map(&linking)] - if tag_enabled - res << [I18n.t('layout.git.repositories.tags'), project.repo.tags.map(&:name).sort.map(&linking)] - else - res << [I18n.t('layout.git.repositories.tags'), project.repo.tags.map(&:name).sort.map {|name| [name.truncate(20), {disabled: true}]}] - end - grouped_options_for_select(res, current) - end - def versions_for_group_select(project) return [] unless project [ @@ -94,46 +6,4 @@ module GitHelper [I18n.t('layout.git.repositories.tags'), project.github_tags.map(&:name).sort] ] end - - def split_commits_by_date(commits) - # See: https://github.com/gitlabhq/gitlabhq/blob/master/app/views/projects/commits/_commits.html.haml#L1 - commits.sort{|x, y| y.committed_date <=> x.committed_date}.inject({}) do |h, commit| - dt = commit.committed_date - h[dt.year] ||= {} - h[dt.year][dt.month] ||= {} - h[dt.year][dt.month][dt.day] ||= [] - h[dt.year][dt.month][dt.day] << commit - h - end - end - - def blob_highlight(blob) - return if blob.nil? || blob.data.blank? - result = if blob.mime_type == 'text/rpm-spec' - Pygments.highlight blob.data, highlight_options.merge(lexer: 'spec') - else - blob.colorize(highlight_options) - end - result.present? ? result.html_safe : blob.data - rescue MentosError, Yajl::ParseError => e - blob.data.html_safe - end - - def blame_highlight(blob, text) - return if blob.nil? || text.blank? - result = if blob.mime_type == 'text/rpm-spec' - Pygments.highlight(text, lexer: 'spec') - else - blob.lexer.highlight text - end - result.present? ? result.html_safe : text - rescue MentosError, Yajl::ParseError => e - text.html_safe - end - - protected - - def highlight_options - @highlight ||= { options: { linenos: true, lineanchors: 'lc', linespans: 'ln', anchorlinenos: true }} - end end diff --git a/app/helpers/gitlab_markdown_helper.rb b/app/helpers/gitlab_markdown_helper.rb deleted file mode 100644 index 7ca1e6da9..000000000 --- a/app/helpers/gitlab_markdown_helper.rb +++ /dev/null @@ -1,63 +0,0 @@ -# This module is based on -# https://github.com/gitlabhq/gitlabhq/blob/7665b1de7eed4addd7b94786c84e6674710e6377/app/helpers/gitlab_markdown_helper.rb -module GitlabMarkdownHelper - include MarkdownHelper - - # Use this in places where you would normally use link_to(gfm(...), ...). - # - # It solves a problem occurring with nested links (i.e. - # "outer text gfm ref more outer text"). This will not be - # interpreted as intended. Browsers will parse something like - # "outer text gfm ref more outer text" (notice the last part is - # not linked any more). link_to_gfm corrects that. It wraps all parts to - # explicitly produce the correct linking behavior (i.e. - # "outer text gfm ref more outer text"). - def link_to_gfm(body, url, html_options = {}) - return "" if body.blank? - - escaped_body = if body =~ /^\.*?}m) do |match| - "#{match}#{link_to("", url, html_options)[0..-5]}" # "".length +1 - end - - link_to(gfm_body.html_safe, url, html_options) - end - - def markdown(text) - return '' if text.blank? - unless @markdown - gitlab_renderer = Redcarpet::Render::GitlabHTML.new(self, - # see https://github.com/vmg/redcarpet#darling-i-packed-you-a-couple-renderers-for-lunch- - filter_html: true, - with_toc_data: true, - hard_wrap: true) - @markdown = Redcarpet::Markdown.new(gitlab_renderer, - # see https://github.com/vmg/redcarpet#and-its-like-really-simple-to-use - no_intra_emphasis: true, - tables: true, - fenced_code_blocks: true, - autolink: true, - strikethrough: true, - lax_html_blocks: true, - space_after_headers: true, - superscript: true) - end - - @markdown.render(text).html_safe - end - - def render_wiki_content(wiki_page) - if wiki_page.format == :markdown - markdown(wiki_page.content) - else - wiki_page.formatted_content.html_safe - end - end -end diff --git a/app/helpers/hooks_helper.rb b/app/helpers/hooks_helper.rb deleted file mode 100644 index 14354af9c..000000000 --- a/app/helpers/hooks_helper.rb +++ /dev/null @@ -1,2 +0,0 @@ -module HooksHelper -end diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb deleted file mode 100644 index e87b7b5aa..000000000 --- a/app/helpers/issues_helper.rb +++ /dev/null @@ -1,8 +0,0 @@ -module IssuesHelper - def tracker_search_field(name, txt, classes = nil) - str = "" - str.html_safe - end -end diff --git a/app/helpers/markdown_helper.rb b/app/helpers/markdown_helper.rb deleted file mode 100644 index 8e99d698b..000000000 --- a/app/helpers/markdown_helper.rb +++ /dev/null @@ -1,176 +0,0 @@ -# This module is based on -# https://github.com/gitlabhq/gitlabhq/blob/397c3da9758c03a215a308c011f94261d9c61cfa/lib/gitlab/markdown.rb - -# Custom parser for GitLab-flavored Markdown -# -# It replaces references in the text with links to the appropriate items in -# GitLab. -# -# Supported reference formats are: -# * @foo for team members -# * for issues & pull requests: -# * #123 -# * abf#123 -# * abf/rosa-build#123 -# * 123456 for commits -# -# It also parses Emoji codes to insert images. See -# http://www.emoji-cheat-sheet.com/ for a list of the supported icons. -# -# Examples -# -# >> gfm("Hey @david, can you fix this?") -# => "Hey @david, can you fix this?" -# -# >> gfm("Commit 35d5f7c closes #1234") -# => "Commit 35d5f7c closes #1234" -# -# >> gfm(":trollface:") -# => "\":trollface:\" -module MarkdownHelper - include IssuesHelper - - attr_reader :html_options - - # Public: Parse the provided text with GitLab-Flavored Markdown - # - # text - the source text - # html_options - extra options for the reference links as given to link_to - # - # Note: reference links will only be generated if @project is set - def gfm(text, html_options = {}) - return text if text.nil? - - # Duplicate the string so we don't alter the original, then call to_str - # to cast it back to a String instead of a SafeBuffer. This is required - # for gsub calls to work as we need them to. - text = text.dup.to_str - - @html_options = html_options - - # Extract pre blocks so they are not altered - # from http://github.github.com/github-flavored-markdown/ - text.gsub!(%r{
.*?
|.*?}m) { |match| extract_piece(match) } - # Extract links with probably parsable hrefs - text.gsub!(%r{.*?}m) { |match| extract_piece(match) } - # Extract images with probably parsable src - text.gsub!(%r{}m) { |match| extract_piece(match) } - - # TODO: add popups with additional information - - text = parse(text) - - # Insert pre block extractions - text.gsub!(/\{gfm-extraction-(\h{32})\}/) do - insert_piece($1) - end - - sanitize text.html_safe, attributes: %w(href src alt id class) - end - - private - - def extract_piece(text) - @extractions ||= {} - - md5 = Digest::MD5.hexdigest(text) - @extractions[md5] = text - "{gfm-extraction-#{md5}}" - end - - def insert_piece(id) - @extractions[id] - end - - # Private: Parses text for references and emoji - # - # text - Text to parse - # - # Note: reference links will only be generated if @project is set - # - # Returns parsed text - def parse(text) - parse_references(text) if @project - parse_emoji(text) - end - - REFERENCE_PATTERN = %r{ - (?[\W\/])? # Prefix - ( # Reference - @(?[a-zA-Z][a-zA-Z0-9_\-\.]*) # User/Group uname - |(?(?:[a-zA-Z0-9\-_]*\/)?(?:[a-zA-Z0-9\-_]*)?\#[0-9]+) # Issue ID - |(?[\h]{6,40}) # Commit ID - ) - (?\W)? # Suffix - }x.freeze - - TYPES = [:user, :issue, :commit].freeze - - def parse_references(text) - # parse reference links - text.gsub!(REFERENCE_PATTERN) do |match| - prefix = $~[:prefix] - suffix = $~[:suffix] - type = TYPES.select{|t| !$~[t].nil?}.first - identifier = $~[type] - - # Avoid HTML entities - if prefix && suffix && prefix[0] == '&' && suffix[-1] == ';' - match - elsif ref_link = reference_link(type, identifier) - "#{prefix}#{ref_link}#{suffix}" - else - match - end - end - end - - def parse_emoji(text) - text.gsub(/:([\w+-]+):/) do |match| - if emoji = Emoji.find_by_alias($1) - image_tag("/images/emoji/#{emoji.image_filename}", class: 'emoji', title: $1, alt: $1, size: "20x20") - else - match - end - end if text.present? - end - - # Private: Dispatches to a dedicated processing method based on reference - # - # reference - Object reference ("@1234", "!567", etc.) - # identifier - Object identifier (Issue ID, SHA hash, etc.) - # - # Returns string rendered by the processing method - def reference_link(type, identifier) - send("reference_#{type}", identifier) - end - - def reference_user(identifier) - member = User.where(uname: identifier).first || Group.where(uname: identifier).first - if member - link_to("@#{identifier}", "/#{identifier}", html_options.merge(title: member.fullname, class: "gfm gfm-member #{html_options[:class]}")) - end - end - - def reference_issue(identifier) - if issue = Issue.find_by_hash_tag(identifier, current_user, @project) - if issue.pull_request - title = "#{PullRequest.model_name.human}: #{issue.title}" - url = project_pull_request_path(issue.project, issue.pull_request) - else - title = "#{Issue.model_name.human}: #{issue.title}" - url = project_issue_path(issue.project, issue.serial_id) - end - link_to(identifier, url, html_options.merge(title: title, class: "gfm gfm-issue #{html_options[:class]}")) - end - end - - def reference_commit(identifier) - if commit = @project.repo.commit(identifier) - link_to shortest_hash_id(commit.id), commit_path(@project, commit.id) - title = GitPresenters::CommitAsMessagePresenter.present(commit, project: @project) do |presenter| - link_to(identifier, commit_path(@project, commit), html_options.merge(title: presenter.caption, class: "gfm gfm-commit #{html_options[:class]}")) - end - end - end -end diff --git a/app/helpers/pull_request_helper.rb b/app/helpers/pull_request_helper.rb deleted file mode 100644 index 6272a1fad..000000000 --- a/app/helpers/pull_request_helper.rb +++ /dev/null @@ -1,61 +0,0 @@ -module PullRequestHelper - def merge_activity comments, commits - common_comments, pull_comments = comments.partition {|c| c.automatic || c.data.blank?} - common_comments = common_comments.map{ |c| [c.created_at, c] } - pull_comments = pull_comments.group_by(&:data).map{|data, c| [c.first.created_at, [data || {}, [c].flatten]]} - commits = commits.map{ |c| [(c.committed_date || c.authored_date), c] } - (common_comments + pull_comments + commits).sort_by{ |c| c[0] }.map{ |c| c[1] } - end - - def pull_status_label pull_status, options = {} - statuses = {'ready' => 'success', 'closed' => 'default', 'merged' => 'info', 'blocked' => 'warning'} - options[:class] = "#{options[:class]} label label-#{statuses[pull_status]}" - content_tag :span, t("projects.pull_requests.statuses.#{pull_status}"), options - end - - def pull_status pull - if %w(blocked merged closed ready open).include? pull.status - t("projects.pull_requests.#{pull.status}", user: pull.issue.closer.try(:uname), to_ref: show_ref(pull, 'to'), - from_ref: show_ref(pull, 'from'), time: pull.issue.closed_at).html_safe - else - raise "pull id (#{pull.id}) wrong status #{pull.status} " - end - end - - def pull_header pull - str = "#{t '.header'} #{t 'from'} \ - #{show_ref pull, 'from'} \ - #{t 'into'} \ - #{show_ref pull, 'to'}" - str << " #{t 'by'} #{link_to pull.user.uname, user_path(pull.user)}" if pull.user# pull.persisted? - str.html_safe - end - - #helper for helpers - def show_ref pull, which, limit = 30 - project, ref = pull.send("#{which}_project"), pull.send("#{which}_ref") - fullname = if which == 'to' - "#{project.owner.uname.truncate limit}/#{project.name.truncate limit}" - elsif which == 'from' - "#{pull.from_project_owner_uname.truncate limit}/#{pull.from_project_name.truncate limit}" - end - link_to "#{fullname}: #{ref.truncate limit}", ref_path(project, ref), class: 'btn btn-primary' - end - - def ref_path project, ref - if project && project.repo.branches_and_tags.map(&:name).include?(ref) - tree_path(project, ref) - else - '#' - end - end - - def ref_selector_options(project, current) - res = [] - value = Proc.new {|t| [t.name.truncate(50), t.name]} - res << [I18n.t('layout.git.repositories.branches'), project.repo.branches.map(&value).sort] - res << [I18n.t('layout.git.repositories.tags'), project.repo.tags.map(&value).sort] - - grouped_options_for_select(res, current) - end -end diff --git a/app/helpers/wiki_helper.rb b/app/helpers/wiki_helper.rb deleted file mode 100644 index 37a65654e..000000000 --- a/app/helpers/wiki_helper.rb +++ /dev/null @@ -1,106 +0,0 @@ -module WikiHelper - - def revert_path(project, first, second, name) - if name - revert_page_project_wiki_path(project, CGI.escape(name), first, second) - else - revert_project_wiki_index_path(project, first, second) - end - end - - def compare_path(project, name) - if name - compare_project_wiki_path(@project, CGI.escape(name)) - else - compare_project_wiki_index_path(@project) - end - end - - def escaped_name - CGI.escape(@name) - end - - def editor_path(project, name) - if @new - url_for(controller: :wiki, action: :create, project_id: project.id) - else - url_for(controller: :wiki, action: :update, project_id: project.id, id: name) - end - end - - def view_path(project, name) - name == 'Home' ? project_wiki_index_path(project) : project_wiki_path(project, name) - end - - def wiki_formats - APP_CONFIG['wiki_formats'].map do |key, val| - [ val, key.to_s ] - end.sort do |a, b| - a.first.downcase <=> b.first.downcase - end - end - - def footer - if @footer.nil? && @page - @footer = !!@page.footer ? @page.footer : false - end - @footer - end - - def sidebar - if @sidebar.nil? && @page - @sidebar = !!@page.sidebar ? @page.sidebar : false - end - @sidebar - end - - def has_footer? - @footer = (@page.footer || false) if @footer.nil? && @page - !!@footer - end - - def has_sidebar? - @sidebar = (@page.sidebar || false) if @sidebar.nil? && @page - !!@sidebar - end - - def footer_content - has_footer? && @footer.formatted_data - end - - def footer_format - has_footer? && @footer.format.to_s - end - - def sidebar_content - has_sidebar? && @sidebar.formatted_data - end - - def sidebar_format - has_sidebar? && @sidebar.format.to_s - end - - def author - @page.version.author.name - end - - def author_email - @page.version.author.email - end - - def user_path_by_user(user) - (user.present?) ? user_path(user) : 'javascript:void(0)' - end - - def user_link_by_user(user) - link_to (user.present?) ? user.uname : author, user_path_by_user(user) - end - - def date - @page.version.authored_date - end - - def format - @page.try(:format) || 'markdown' - end -end diff --git a/app/jobs/build_lists/dependent_packages_job.rb b/app/jobs/build_lists/dependent_packages_job.rb index 7aea17361..d26241d55 100644 --- a/app/jobs/build_lists/dependent_packages_job.rb +++ b/app/jobs/build_lists/dependent_packages_job.rb @@ -31,7 +31,6 @@ module BuildLists bl.include_repos |= [save_to_repository.id] %i( build_for_platform_id - update_type save_to_platform_id extra_build_lists extra_params diff --git a/app/mailers/user_mailer.rb b/app/mailers/user_mailer.rb index 381151de5..c70d7ff19 100644 --- a/app/mailers/user_mailer.rb +++ b/app/mailers/user_mailer.rb @@ -1,57 +1,11 @@ class UserMailer < ActionMailer::Base add_template_helper ActivityFeedsHelper - add_template_helper CommitHelper default from: "\"#{APP_CONFIG['project_name']}\" <#{APP_CONFIG['do-not-reply-email']}>" default_url_options.merge!(protocol: 'https') if APP_CONFIG['mailer_https_url'] include Resque::Mailer # send email async - def new_user_notification(user) - @user = user - mail( - to: email_with_name(user, user.email), - subject: I18n.t("notifications.subjects.new_user_notification", - project_name: APP_CONFIG['project_name']) - ) do |format| - format.html - end - end - - def new_comment_notification(comment, user_id) - @user, @comment = User.find(user_id), comment - subject = @comment.issue_comment? ? subject_for_issue(@comment.commentable) : - I18n.t('notifications.subjects.new_commit_comment_notification') - mail( - to: email_with_name(@user, @user.email), - subject: subject, - from: email_with_name(comment.user) - ) do |format| - format.html - end - end - - def new_issue_notification(issue_id, user_id) - @user, @issue = User.find(user_id), Issue.find(issue_id) - mail( - to: email_with_name(@user, @user.email), - subject: subject_for_issue(@issue, true), - from: email_with_name(@issue.user) - ) do |format| - format.html - end - end - - def issue_assign_notification(issue, user) - @issue = issue - mail( - to: email_with_name(user, user.email), - subject: subject_for_issue(@issue) - ) do |format| - format.html - end - end - def build_list_notification(build_list, user) set_locale user @user, @build_list = user, build_list @@ -84,37 +38,6 @@ class UserMailer < ActionMailer::Base end end - def invite_approve_notification(register_request) - set_locale register_request - @register_request = register_request - mail( - to: register_request.email, - subject: I18n.t("notifications.subjects.invite_approve_notification") - ) do |format| - format.html - end - end - - def git_delete_branch_notification(user, options) - set_locale user - mail( - to: user.email, - subject: I18n.t('notifications.subjects.update_code', project_name: "#{options[:project_owner]}/#{options[:project_name]}") - ) do |format| - format.html { render 'git_delete_branch_notification', locals: options } - end - end - - def git_new_push_notification(user, options) - set_locale user - mail( - to: user.email, - subject: I18n.t('notifications.subjects.update_code', project_name: "#{options[:project_owner]}/#{options[:project_name]}") - ) do |format| - format.html { render 'git_new_push_notification', locals: options } - end - end - protected def set_locale(user) diff --git a/app/models/activity_feed.rb b/app/models/activity_feed.rb index 8e9c123ee..348ff513d 100644 --- a/app/models/activity_feed.rb +++ b/app/models/activity_feed.rb @@ -1,9 +1,6 @@ class ActivityFeed < ActiveRecord::Base - CODE = %w(git_delete_branch_notification git_new_push_notification new_comment_commit_notification) - TRACKER = %w(issue_assign_notification new_comment_notification new_issue_notification) BUILD = %w(build_list_notification) - WIKI = %w(wiki_new_commit_notification) belongs_to :user belongs_to :creator, class_name: 'User' diff --git a/app/models/advisory.rb b/app/models/advisory.rb deleted file mode 100644 index 84fc1aa73..000000000 --- a/app/models/advisory.rb +++ /dev/null @@ -1,74 +0,0 @@ -class Advisory < ActiveRecord::Base - self.include_root_in_json = false - self.per_page = 30 - - has_and_belongs_to_many :platforms - has_and_belongs_to_many :projects - has_many :build_lists - - validates :description, :update_type, presence: true - validates :update_type, inclusion: BuildList::RELEASE_UPDATE_TYPES - - after_create :generate_advisory_id - before_save :normalize_references, if: :references_changed? - - ID_TEMPLATE = 'ROSA-%s-%d:%04d' - ID_STRING_TEMPLATE = 'ROSA-%s-%04s:%04s' - TYPES = {'security' => 'SA', 'bugfix' => 'A'} - - scope :search, ->(q) { - q = q.to_s.strip - where("#{table_name}.advisory_id ILIKE :q OR #{table_name}.description ILIKE :q OR build_list_packages.fullname ILIKE :q", q: "%#{q}%"). - joins(build_lists: :packages) if q.present? - } - scope :search_by_id, ->(aid) { where("#{table_name}.advisory_id ILIKE ?", "%#{aid.to_s.strip}%") } - scope :by_update_type, ->(ut) { where(update_type: ut) } - default_scope { order(created_at: :desc) } - - def to_param - advisory_id - end - - def attach_build_list(build_list) - return false if update_type != build_list.update_type - self.platforms << build_list.save_to_platform unless platforms.include? build_list.save_to_platform - self.projects << build_list.project unless projects.include? build_list.project - build_list.advisory = self - save && build_list.save - end - - # this method fetches and structurize packages attached to current advisory. - def fetch_packages_info - packages_info = Hash.new { |h, k| h[k] = {} } # maaagic, it's maaagic ;) - build_lists.includes(:save_to_platform, :packages, :project).find_in_batches do |batch| - batch.each do |build_list| - tmp = build_list.packages.inject({srpm: nil, rpm: []}) do |h, p| - p.package_type == 'binary' ? h[:rpm] << p.fullname : h[:srpm] = p.fullname - h - end - h = { build_list.project => tmp } - packages_info[build_list.save_to_platform].merge!(h) do |pr, old, new| - {srpm: new[:srpm], rpm: old[:rpm].concat(new[:rpm]).uniq} - end - end - end - packages_info - end - - protected - - def generate_advisory_id - self.advisory_id = sprintf(ID_TEMPLATE, type: TYPES[self.update_type], year: Time.now.utc.year, id: self.id) - self.save - end - - def normalize_references - self.references.gsub!(/\r| /, '') - self.references = self.references.split('\n').map do |ref| - ref = CGI::escapeHTML(ref) - ref = "http://#{ref}" unless ref =~ %r[^http(s?)://*] - ref - end.join("\n") - end - -end diff --git a/app/models/build_list.rb b/app/models/build_list.rb index 860de1074..9b55ffa23 100644 --- a/app/models/build_list.rb +++ b/app/models/build_list.rb @@ -17,21 +17,11 @@ class BuildList < ActiveRecord::Base belongs_to :user belongs_to :builder, class_name: 'User' belongs_to :publisher, class_name: 'User' - belongs_to :advisory belongs_to :mass_build, counter_cache: true has_many :items, class_name: '::BuildList::Item', dependent: :destroy has_many :packages, class_name: '::BuildList::Package', dependent: :destroy has_many :source_packages, -> { where(package_type: 'source') }, class_name: '::BuildList::Package' - UPDATE_TYPES = [ - UPDATE_TYPE_BUGFIX = 'bugfix', - UPDATE_TYPE_SECURITY = 'security', - UPDATE_TYPE_ENHANCEMENT = 'enhancement', - UPDATE_TYPE_RECOMMENDED = 'recommended', - UPDATE_TYPE_NEWPACKAGE = 'newpackage' - ] - - RELEASE_UPDATE_TYPES = [UPDATE_TYPE_BUGFIX, UPDATE_TYPE_SECURITY] EXTRA_PARAMS = %w[cfg_options cfg_urpm_options build_src_rpm build_rpm] AUTO_PUBLISH_STATUSES = [ @@ -51,10 +41,6 @@ class BuildList < ActiveRecord::Base validates_numericality_of :priority, greater_than_or_equal_to: 0 validates :auto_publish_status, inclusion: { in: AUTO_PUBLISH_STATUSES } - validates :update_type, inclusion: UPDATE_TYPES, - unless: Proc.new { |b| b.advisory.present? } - validates :update_type, inclusion: { in: RELEASE_UPDATE_TYPES, message: I18n.t('flash.build_list.frozen_platform') }, - if: Proc.new { |b| b.advisory.present? } validate -> { if save_to_platform.try(:main?) && save_to_platform_id != build_for_platform_id errors.add(:build_for_platform, I18n.t('flash.build_list.wrong_platform')) @@ -507,25 +493,9 @@ class BuildList < ActiveRecord::Base #[WAITING_FOR_RESPONSE, BUILD_PENDING, BUILD_STARTED].include?(status) end - def associate_and_create_advisory(params) - build_advisory(params){ |a| a.update_type = update_type } - advisory.attach_build_list(self) - end - - def can_attach_to_advisory? - !save_to_repository.publish_without_qa && - save_to_platform.main? && - save_to_platform.released && - build_published? - end - def log(load_lines=nil) - if new_core? - worker_log = abf_worker_log - Pygments.highlight(worker_log, lexer: 'sh') rescue worker_log - else - I18n.t('layout.build_lists.log.not_available') - end + worker_log = abf_worker_log + Pygments.highlight(worker_log, lexer: 'sh') rescue worker_log end def last_published(testing = false) @@ -694,7 +664,6 @@ class BuildList < ActiveRecord::Base unless mass_build_id users = [user, publisher].compact.uniq.select{ |u| u.notifier.can_notify? && u.notifier.new_build? } - # find associated users users |= project.all_members(:notifier).select do |u| u.notifier.can_notify? && u.notifier.new_associated_build? end if project diff --git a/app/models/build_list/filter.rb b/app/models/build_list/filter.rb index a17c52773..568af838f 100644 --- a/app/models/build_list/filter.rb +++ b/app/models/build_list/filter.rb @@ -23,7 +23,6 @@ class BuildList::Filter else BuildListPolicy::Scope.new(@user, build_lists).everything end - build_lists = build_lists.scoped_to_new_core(@options[:new_core] == '0' ? nil : true) if @options[:new_core].present? if @options[:mass_build_id] build_lists = build_lists.by_mass_build(@options[:mass_build_id] == '-1' ? nil : @options[:mass_build_id]) end @@ -65,8 +64,7 @@ class BuildList::Filter project_version: nil, id: nil, project_name: nil, - mass_build_id: nil, - new_core: nil + mass_build_id: nil })) @options[:ownership] = @options[:ownership].presence || (@project || !@user ? 'everything' : 'owned') @@ -84,7 +82,6 @@ class BuildList::Filter @options[:id] = @options[:id].presence @options[:project_name] = @options[:project_name].presence @options[:mass_build_id] = @options[:mass_build_id].presence - @options[:new_core] = @options[:new_core].presence end def build_date_from_params(field_name, params) diff --git a/app/models/build_list/package.rb b/app/models/build_list/package.rb index cc4cb8f92..b025f0834 100644 --- a/app/models/build_list/package.rb +++ b/app/models/build_list/package.rb @@ -12,7 +12,7 @@ class BuildList::Package < ActiveRecord::Base :package_type, :name, :release, :version, presence: true validates :package_type, inclusion: PACKAGE_TYPES - validates :sha1, presence: true, if: Proc.new { |p| p.build_list.new_core? } + validates :sha1, presence: true default_scope { order("lower(#{table_name}.name) ASC, length(#{table_name}.name) ASC") } diff --git a/app/models/build_script.rb b/app/models/build_script.rb deleted file mode 100644 index 9681263df..000000000 --- a/app/models/build_script.rb +++ /dev/null @@ -1,63 +0,0 @@ -class BuildScript < ActiveRecord::Base - include FileStoreClean - - STATUSES = [ - ACTIVE = 'active', - BLOCKED = 'blocked' - ] - FORMAT = 'tar.gz' - - belongs_to :project - - validates :treeish, presence: true - validates :project, presence: true - validates :project_id, uniqueness: { scope: :treeish } - - scope :by_active, -> { where(status: ACTIVE) } - scope :by_treeish, -> treeish { where(treeish: treeish) } - - before_validation :attach_project - attr_writer :project_name - - state_machine :status, initial: :active do - event(:disable) { transition active: :blocked } - event(:enable) { transition blocked: :active } - end - - def sha1_of_file_store_files - [sha1].select(&:present?) - end - - def project_name - @project_name.presence || project.try(:name_with_owner) - end - - def can_update_archive? - last_commit != commit - end - - def update_archive - old_sha1, new_commit = sha1, last_commit - - archive = project.archive_by_treeish_and_format(treeish, FORMAT) - new_sha1 = FileStoreService::File.new(data: archive).save - if new_sha1.present? - update_attributes(sha1: new_sha1, commit: new_commit) - destroy_files_from_file_store(old_sha1) if old_sha1.present? - end - end - later :update_archive, queue: :middle - - protected - - def last_commit - project.repo.commits(treeish, 1).first.try(:id) - end - - def attach_project - if @project_name.present? - self.project = Project.find_by_owner_and_name(@project_name) - end - end - -end diff --git a/app/models/collaborator.rb b/app/models/collaborator.rb deleted file mode 100644 index 1841f98ce..000000000 --- a/app/models/collaborator.rb +++ /dev/null @@ -1,154 +0,0 @@ -class Collaborator - include ActiveModel::Conversion - include ActiveModel::Validations - include ActiveModel::Serializers::JSON - extend ActiveModel::Naming - - attr_accessor :role, :actor, :project, :relation - attr_reader :id, :actor_id, :actor_type, :actor_name, :project_id - - delegate :new_record?, to: :relation - - class << self - def find_by_project(project) - res = [] - project.relations.each do |r| - res << from_relation(r) unless project.owner_id == r.actor_id and project.owner_type == r.actor_type - end - return res - end - - def find(id) - return self.from_relation(Relation.find(id)) || nil - end - - def create(args) - c = self.new(args) - return c.save ? c : false - end - - def create!(args) - c = self.new(args) - c.save! - return c - end - end - - def initialize(args = {}) - return false if args.blank? - args.to_options! - acc_options = args.select{ |(k, v)| k.in? [:actor, :project, :relation] } - acc_options.each_pair do |name, value| - send("#{name}=", value) - end - - if args[:project_id].present? - @project = Project.find(args[:project_id]) - end - if args[:actor_id].present? and args[:actor_type].present? - @actor = args[:actor_type].classify.constantize.find(args[:actor_id]) - end - - relation.role = args[:role] if args[:role].present? #if @relation.present? and args[:role].present? - end - - def update_attributes(attributes, options = {}) - attributes.each_pair do |k, v| - send("#{k}=", v) - end - save - end - - def relation=(model) - @relation = model - @actor = @relation.actor - @project = @relation.target - end - - def id - relation.try(:id) - end - - def actor_id - @actor.try(:id) - end - - def actor_type - @actor.class.to_s.underscore - end - - def actor_name - if @actor.present? - @actor.instance_of?(User) ? "#{@actor.uname}#{ @actor.try(:name) and !@actor.name.empty? ? " (#{@actor.name})" : ''}" : @actor.uname - else - nil - end - end - - def actor_uname - @actor.uname - end - - def project_id - @project.try(:id) - end - - def role - relation.try(:role) - end - - def role=(arg) - relation.role = arg - end - - def save - relation.try(:save) - end - - def save! - relation.try(:save!) - end - - def destroy - relation.try(:destroy) - @actor.check_assigned_issues @project - end - - def attributes - %w{ id actor_id actor_type actor_name project_id role}.inject({}) do |h, e| - h.merge(e => send(e)) - end - end - - def persisted? - false - end - - protected - - class << self - - def from_relation(relation) - return nil unless relation.present? - return self.new(relation: relation) - end - - end - - def relation - return @relation if @relation.present? and @relation.actor == @actor and @relation.target == @project - - if @actor.present? and @project.present? - @relation = Relation.by_actor(@actor).by_target(@project).limit(1).first - @relation ||= Relation.new(:actor_id => @actor.id, :actor_type => @actor.class.to_s, - target_id: @project.id, target_type: 'Project') - else - @relation = Relation.new - @relation.actor = @actor - @relation.target = @project - end - @relation - end - -end -Collaborator.include_root_in_json = false diff --git a/app/models/comment.rb b/app/models/comment.rb deleted file mode 100644 index 12a7fd11f..000000000 --- a/app/models/comment.rb +++ /dev/null @@ -1,214 +0,0 @@ -class Comment < ActiveRecord::Base - include Feed::Comment - - # regexp take from http://code.google.com/p/concerto-platform/source/browse/v3/cms/lib/CodeMirror/mode/gfm/gfm.js?spec=svn861&r=861#71 - # User/Project#Num - # User#Num - # #Num - ISSUES_REGEX = /(?:[a-zA-Z0-9\-_]*\/)?(?:[a-zA-Z0-9\-_]*)?#[0-9]+/ - - belongs_to :commentable, polymorphic: true - belongs_to :user - belongs_to :project - serialize :data - - validates :body, :user, :commentable_id, :commentable_type, :project_id, presence: true - validates :body, length: { maximum: 10000 } - - scope :for_commit, ->(c) { where(commentable_id: c.id.hex, commentable_type: c.class) } - default_scope { order(:created_at) } - - before_save :touch_commentable - after_create :subscribe_on_reply, unless: ->(c) { c.commit_comment? } - after_create :subscribe_users - - def commentable - commit_comment? ? project.repo.commit(Comment.hex_to_commit_hash commentable_id) : super - end - - def commentable=(c) - if self.class.commit_comment?(c.class) - self.commentable_id = c.id.hex - self.commentable_type = c.class.name - else - super - end - end - - def self.commit_comment?(class_name) - class_name.to_s == 'Grit::Commit' - end - - def commit_comment? - self.class.commit_comment?(commentable_type) - end - - def self.issue_comment?(class_name) - class_name.to_s == 'Issue' - end - - def issue_comment? - self.class.issue_comment?(commentable_type) - end - - def own_comment?(user) - user_id == user.id - end - - def actual_inline_comment?(diff = nil, force = false) - unless force - raise "This is not inline comment!" if data.blank? # for debug - return data[:actual] unless data[:actual].nil? - return false if diff.nil? - end - return data[:actual] = true if commentable_type == 'Grit::Commit' - filepath, line_number = data[:path], data[:line] - diff_path = (diff || commentable.show ).select {|d| d.a_path == data[:path]} - comment_line = data[:line].to_i - # NB! also dont create a comment to the diff header - return data[:actual] = false if diff_path.blank? || comment_line == 0 - res, ind = true, 0 - diff_path[0].diff.each_line do |line| - if self.persisted? && (comment_line-2..comment_line+2).include?(ind) && data.try('[]', "line#{ind-comment_line}") != line.chomp - break res = false - end - ind = ind + 1 - end - if ind < comment_line - return data[:actual] = false - else - return data[:actual] = res - end - end - - def inline_diff - data[:strings] + data['line0'] - end - - def pull_comment? - commentable.is_a?(Issue) && commentable.pull_request.present? - end - - def set_additional_data params - return true if params[:path].blank? && params[:line].blank? # not inline comment - if params[:in_reply].present? && reply = Comment.where(id: params[:in_reply]).first - self.data = reply.data - return true - end - self.data = {path: params[:path], line: params[:line]} - return actual_inline_comment?(nil, true) if commentable.is_a?(Grit::Commit) - if commentable.is_a?(Issue) && pull = commentable.pull_request - diff_path = pull.diff.select {|d| d.a_path == params[:path]} - return false unless actual_inline_comment?(pull.diff, true) - - comment_line, line_number, strings = params[:line].to_i, -1, [] - diff_path[0].diff.each_line do |line| - line_number = line_number.succ - # Save 2 lines above and bottom of the diff comment line - break if line_number > comment_line + 2 - if (comment_line-2..comment_line+2).include? line_number - data["line#{line_number-comment_line}"] = line.chomp - end - - # Save lines from the closest header for rendering in the discussion - if line_number < comment_line - # Header is the line like "@@ -47,9 +50,8 @@ def initialize(user)" - if line =~ Diff::Display::Unified::Generator::LINE_NUM_RE - strings = [line] - else - strings << line - end - end - end - ## Bug with numbers of diff lines, now store all diff - data[:strings] = strings.join - # Limit stored diff to 10 lines (see inline_diff) - #data[:strings] = ((strings.count) <= 9 ? strings : [strings[0]] + strings.last(8)).join - ## - data[:view_path] = h(diff_path[0].renamed_file ? "#{diff_path[0].a_path.rtruncate 60} -> #{diff_path[0].b_path.rtruncate 60}" : diff_path[0].a_path.rtruncate(120)) - end - return true - end - - def self.create_link_on_issues_from_item item, commits = nil - linker = item.user - - case - when item.is_a?(GitHook) - elements = commits - opts = {} - when item.is_a?(Issue) - elements = [[item, item.title], [item, item.body]] - opts = {created_from_issue_id: item.id} - when item.commentable_type == 'Issue' - elements = [[item, item.body]] - opts = {created_from_issue_id: item.commentable_id} - when item.commentable_type == 'Grit::Commit' - elements = [[item, item.body]] - opts = {created_from_commit_hash: item.commentable_id} - else - raise "Unsupported item type #{item.class.name}!" - end - - elements.each do |element| - element[1].scan(ISSUES_REGEX).each do |hash| - issue = Issue.find_by_hash_tag hash, linker, item.project - next unless issue - # dont create link to the same issue - next if opts[:created_from_issue_id] == issue.id - opts = {created_from_commit_hash: element[0].hex} if item.is_a?(GitHook) - # dont create duplicate link to issue - next if Comment.find_existing_automatic_comment issue, opts - # dont create link to outdated commit - next if item.is_a?(GitHook) && !item.project.repo.commit(element[0]) - comment = linker.comments.new body: 'automatic comment' - comment.commentable, comment.project, comment.automatic = issue, issue.project, true - comment.data = {from_project_id: item.project.id} - if opts[:created_from_commit_hash] - comment.created_from_commit_hash = opts[:created_from_commit_hash] - elsif opts[:created_from_issue_id] - comment.data.merge!(comment_id: item.id) if item.is_a? Comment - comment.created_from_issue_id = opts[:created_from_issue_id] - else - raise 'Unsupported opts for automatic comment!' - end - comment.save - end - end - end - - def self.hex_to_commit_hash hex - # '079d'.hex.to_s(16) => "79d" - t = hex.to_s(16) - '0'*(40-t.length) << t # commit hash has 40-character - end - - protected - - def touch_commentable - commentable.touch unless commit_comment? - end - - def subscribe_on_reply - commentable.subscribes.where(user_id: user_id).first_or_create - end - - def subscribe_users - if issue_comment? - commentable.subscribes.create(user: user) if !commentable.subscribes.exists?(user_id: user.id) - elsif commit_comment? - recipients = project.all_members - recipients << user << User.find_by(email: commentable.try(:committer).try(:email)) # commentor and committer - recipients.compact.uniq.each do |user| - options = {project_id: project.id, subscribeable_id: commentable_id, subscribeable_type: commentable.class.name, user_id: user.id} - Subscribe.subscribe_to_commit(options) if Subscribe.subscribed_to_commit?(project, user, commentable) - end - end - end - - def self.find_existing_automatic_comment issue, opts - find_dup = opts.merge(automatic: true, commentable_type: issue.class.name, - commentable_id: issue.id) - Comment.exists? find_dup - end -end diff --git a/app/models/concerns/feed/comment.rb b/app/models/concerns/feed/comment.rb deleted file mode 100644 index bc6652f1f..000000000 --- a/app/models/concerns/feed/comment.rb +++ /dev/null @@ -1,72 +0,0 @@ -module Feed::Comment - extend ActiveSupport::Concern - - included do - after_commit :new_comment_notifications, on: :create - # dont remove outdated issues link - after_update -> { Comment.create_link_on_issues_from_item(self) } - end - - private - - def new_comment_notifications - return if automatic? - - if issue_comment? - commentable.subscribes.each do |subscribe| - if can_notify_on_new_comment?(subscribe) - UserMailer.new_comment_notification(self, subscribe.user_id).deliver unless own_comment?(subscribe.user) - ActivityFeed.create( - user_id: subscribe.user_id, - kind: 'new_comment_notification', - project_owner: project.owner_uname, - project_name: project.name, - creator_id: user_id, - data: { - creator_name: user.name, - creator_email: user.email, - comment_body: body.truncate(100, omission: '…'), - issue_title: commentable.title, - issue_serial_id: commentable.serial_id, - project_id: commentable.project.id, - comment_id: id - } - ) - end - end - elsif commit_comment? - Subscribe.comment_subscribes(self).where(status: true).each do |subscribe| - next if !subscribe.user_id - if subscribe.user.notifier.can_notify && !own_comment?(subscribe.user) - ( (subscribe.project.owner?(subscribe.user) && subscribe.user.notifier.new_comment_commit_repo_owner) || - (subscribe.user.commentor?(self.commentable) && subscribe.user.notifier.new_comment_commit_commentor) || - (subscribe.user.committer?(self.commentable) && subscribe.user.notifier.new_comment_commit_owner) ) - UserMailer.new_comment_notification(self, subscribe.user_id).deliver - end - ActivityFeed.create( - user_id: subscribe.user_id, - kind: 'new_comment_commit_notification', - project_owner: project.owner_uname, - project_name: project.name, - creator_id: user_id, - data: { - creator_name: user.name, - creator_email: user.email, - - comment_body: body.truncate(100, omission: '…'), - commit_message: commentable.message.truncate(70, omission: '…'), - commit_id: commentable.id, - project_id: project.id, - comment_id: id - } - ) - end - end - Comment.create_link_on_issues_from_item(self) - end - - def can_notify_on_new_comment?(subscribe) - notifier = SettingsNotifier.find_by user_id: subscribe.user_id - notifier && notifier.new_comment && notifier.can_notify - end -end diff --git a/app/models/concerns/feed/git.rb b/app/models/concerns/feed/git.rb deleted file mode 100644 index b2f6ba93b..000000000 --- a/app/models/concerns/feed/git.rb +++ /dev/null @@ -1,82 +0,0 @@ -module Feed::Git - - def self.create_notifications(record) - - case record.class.to_s - when 'GitHook' - return unless record.project - PullRequest.where("from_project_id = ? OR to_project_id = ?", record.project, record.project).needed_checking.each {|pull| pull.check} - record.project.hooks.each{ |h| h.receive_push(record) } - - change_type = record.change_type - branch_name = record.refname.split('/').last - - if change_type == 'delete' - kind = 'git_delete_branch_notification' - options = {project_id: record.project.id, branch_name: branch_name, change_type: change_type} - else - if record.message # online update - last_commits, commits = [[record.newrev, record.message.truncate(70, omission: '…')]], [] - all_commits = last_commits - else - commits = record.project.repo.commits_between(record.oldrev, record.newrev) - all_commits = commits.collect { |commit| [commit.sha, commit.message.truncate(70, omission: '…')] } - last_commits = all_commits.last(3).reverse - end - - kind = 'git_new_push_notification' - options = {project_id: record.project.id, last_commits: last_commits, - branch_name: branch_name, change_type: change_type} - if commits.count > 3 - commits = commits[0...-3] - options.merge!({other_commits_count: commits.count, other_commits: "#{commits[0].sha[0..9]}...#{commits[-1].sha[0..9]}"}) - end - - if all_commits.count > 0 - Statistic.statsd_increment( - activity_at: Time.now, - key: Statistic::KEY_COMMIT, - project_id: record.project.id, - user_id: record.user.id, - counter: all_commits.count - ) - Comment.create_link_on_issues_from_item(record, all_commits) - end - end - options.merge!({creator_name: record.user.name, creator_email: record.user.email}) if record.user - - options_for_mail = options.merge(project_owner: record.project.owner_uname, - project_name: record.project.name) - record.project.all_members.each do |recipient| - ActivityFeed.create!( - user: recipient, - kind: kind, - project_owner: record.project.owner_uname, - project_name: record.project.name, - creator_id: record.user.id, - data: options - ) - next if record.user && record.user.id == recipient.id - if recipient.notifier.can_notify && recipient.notifier.update_code - UserMailer.send(kind, recipient, options_for_mail).deliver - end - end - - when 'Hash' # 'Gollum::Committer' - actor = User.find_by! uname: record[:actor_name] - project = Project.find record[:project_id] - - project.all_members.each do |recipient| - ActivityFeed.create!( - user: recipient, - kind: 'wiki_new_commit_notification', - project_owner: project.owner_uname, - project_name: project.name, - creator_id: actor.id, - data: {creator_name: actor.name, creator_email: actor.email, - project_id: project.id, commit_sha: record[:commit_sha]} - ) - end - end - end -end diff --git a/app/models/concerns/feed/issue.rb b/app/models/concerns/feed/issue.rb deleted file mode 100644 index d5d61e8db..000000000 --- a/app/models/concerns/feed/issue.rb +++ /dev/null @@ -1,69 +0,0 @@ -module Feed::Issue - extend ActiveSupport::Concern - - included do - after_commit :new_issue_notifications, on: :create - - after_commit :send_assign_notifications, on: :create, if: ->(i) { i.assignee } - after_update :send_assign_notifications - - after_commit :send_hooks, on: :create - after_update -> { send_hooks(:update) }, if: ->(i) { i.previous_changes['status'].present? } - end - - private - - def new_issue_notifications - return unless user - collect_recipients.each do |recipient| - if user_id != recipient.id && recipient.notifier.can_notify && - recipient.notifier.new_issue && assignee_id != recipient.id - UserMailer.new_issue_notification(id, recipient.id).deliver - end - ActivityFeed.create( - user: recipient, - kind: 'new_issue_notification', - project_owner: project.owner_uname, - project_name: project.name, - creator_id: user_id, - data: { - creator_name: user.name, - creator_email: user.email, - issue_serial_id: serial_id, - issue_title: title, - project_id: project.id - } - ) - end - ::Comment.create_link_on_issues_from_item(self) - end - - def send_assign_notifications - return if @skip_assign_notifications - @skip_assign_notifications = true - if assignee_id && assignee_id_changed? - if assignee.notifier.issue_assign && assignee.notifier.can_notify - UserMailer.issue_assign_notification(self, assignee).deliver - end - ActivityFeed.create( - user: assignee, - kind: 'issue_assign_notification', - project_owner: project.owner_uname, - project_name: project.name, - data: { - user_name: assignee.name, - user_email: assignee.email, - issue_serial_id: serial_id, - issue_title: title, - project_id: project.id - } - ) - end - # dont remove outdated issues link - ::Comment.create_link_on_issues_from_item(self) if title_changed? || body_changed? - end - - def send_hooks(action = :create) - project.hooks.each{ |h| h.receive_issues(self, action) } - end -end diff --git a/app/models/concerns/feed/user.rb b/app/models/concerns/feed/user.rb deleted file mode 100644 index 66b7ff111..000000000 --- a/app/models/concerns/feed/user.rb +++ /dev/null @@ -1,17 +0,0 @@ -module Feed::User - extend ActiveSupport::Concern - - included do - after_commit :new_user_notification, on: :create - end - - private - - def new_user_notification - activity_feeds.create( - kind: 'new_user_notification', - data: { user_name: user_appeal, user_email: email } - ) - end - -end \ No newline at end of file diff --git a/app/models/concerns/git.rb b/app/models/concerns/git.rb deleted file mode 100644 index d426d56e4..000000000 --- a/app/models/concerns/git.rb +++ /dev/null @@ -1,284 +0,0 @@ -require 'nokogiri' -require 'open-uri' - -module Git - extend ActiveSupport::Concern - - included do - CONTENT_LIMIT = 100 - - has_attached_file :srpm - - validates_attachment_size :srpm, less_than_or_equal_to: 500.megabytes - validates_attachment_content_type :srpm, content_type: ['application/octet-stream', "application/x-rpm", "application/x-redhat-package-manager"], message: I18n.t('layout.invalid_content_type') - - #after_create :create_git_repo - #after_commit(on: :create) {|p| p.fork_git_repo unless p.is_root?} # later with resque - #after_commit(on: :create) {|p| p.import_attached_srpm if p.srpm?} # later with resque # should be after create_git_repo - #after_destroy :destroy_git_repo - # after_rollback -> { destroy_git_repo rescue true if new_record? } - - #later :import_attached_srpm, queue: :fork_import - #later :fork_git_repo, queue: :fork_import - end - - def repo - @repo ||= Grit::Repo.new(path) rescue Grit::Repo.new(GAP_REPO_PATH) - end - - def path - build_path(name_with_owner) - end - - def versions - repo.tags.map(&:name) + repo.branches.map(&:name) - end - - #def find_blob_and_raw_of_spec_file(project_version) - # blob = repo.tree(project_version).contents.find{ |n| n.is_a?(Grit::Blob) && n.name =~ /.spec$/ } - # return unless blob - - # raw = Grit::GitRuby::Repository.new(repo.path).get_raw_object_by_sha1(blob.id) - # [blob, raw] - #end - - def create_branch(new_ref, from_ref, user) - return false if new_ref.blank? || from_ref.blank? || !(from_commit = repo.commit(from_ref)) - status, out, err = repo.git.native(:branch, {process_info: true}, new_ref, from_commit.id) - if status == 0 - Resque.enqueue(GitHook, owner.uname, name, from_commit.id, GitHook::ZERO, "refs/heads/#{new_ref}", 'commit', "user-#{user.id}", nil) - return true - end - return false - - end - - def delete_branch(branch, user) - return false if default_branch == branch.name - message = repo.git.native(:branch, {}, '-D', branch.name) - if message.present? - Resque.enqueue(GitHook, owner.uname, name, GitHook::ZERO, branch.commit.id, "refs/heads/#{branch.name}", 'commit', "user-#{user.id}", message) - end - return message.present? - end - - def update_file(path, data, options = {}) - head = options[:head].to_s || default_branch - actor = get_actor(options[:actor]) - filename = File.split(path).last - message = options[:message] - message = "Updated file #{filename}" if message.nil? or message.empty? - - # can not write to unexisted branch - return false if repo.branches.select{|b| b.name == head}.size != 1 - - parent = repo.commits(head).first - - index = repo.index - index.read_tree(parent.tree.id) - - # can not create new file - return false if (index.current_tree / path).nil? - - system "sudo chown -R rosa:rosa #{repo.path}" #FIXME Permission denied - /mnt/gitstore/git_projects/... - index.add(path, data) - if sha1 = index.commit(message, parents: [parent], actor: actor, last_tree: parent.tree.id, head: head) - Resque.enqueue(GitHook, owner.uname, name, sha1, sha1, "refs/heads/#{head}", 'commit', "user-#{options[:actor].id}", message) - end - sha1 - end - - def paginate_commits(treeish, options = {}) - options[:page] = options[:page].try(:to_i) || 1 - options[:per_page] = options[:per_page].try(:to_i) || 20 - - skip = options[:per_page] * (options[:page] - 1) - last_page = (skip + options[:per_page]) >= repo.commit_count(treeish) - - [repo.commits(treeish, options[:per_page], skip), options[:page], last_page] - end - - def tree_info(tree, treeish = nil, path = nil, page = 0) - return [] unless tree - grouped = tree.contents.sort_by{|c| c.name.downcase}.group_by(&:class) - contents = [ - grouped[Grit::Tree], - grouped[Grit::Blob], - grouped[Grit::Submodule] - ].compact.flatten - range = page*CONTENT_LIMIT..CONTENT_LIMIT+page*(CONTENT_LIMIT)-1 - contents[range].map do |node| - node_path = File.join([path.present? ? path : nil, node.name].compact) - [ - node, - node_path, - repo.log(treeish, node_path, max_count: 1).first - ] - end - end - - def import_srpm(srpm_path = srpm.path, branch_name = 'import') - token = User.find_by(uname: 'rosa_system').authentication_token - opts = [srpm_path, path, branch_name, Rails.root.join('bin', 'file-store.rb'), token, APP_CONFIG['file_store_url']].join(' ') - system("#{Rails.root.join('bin', 'import_srpm.sh')} #{opts} >> /dev/null 2>&1") - end - - def is_empty? - repo.branches.count == 0 - end - - def total_commits_count - return 0 if is_empty? - %x(cd #{path} && git rev-list --all | wc -l).to_i - end - - protected - - def aliases_path - File.join(APP_CONFIG['git_path'], 'git_projects', '.aliases') - end - - def alias_path - File.join(aliases_path, "#{alias_from_id}.git") - end - - def build_path(dir) - File.join(APP_CONFIG['git_path'], 'git_projects', "#{dir}.git") - end - - def import_attached_srpm - if srpm? - import_srpm # srpm.path - self.srpm = nil; save # clear srpm - end - end - - def create_git_repo - if is_root? - Grit::Repo.init_bare(path) - write_hook - end - end - - # Creates fork/alias for GIT repo - def fork_git_repo - dummy = Grit::Repo.new(path) rescue nil - # Do nothing if GIT repo already exist - unless dummy - if alias_from_id - FileUtils.mkdir_p(aliases_path) - if !Dir.exists?(alias_path) && alias_from - # Move GIT repo into aliases - FileUtils.mv(alias_from.path, alias_path, force: true) - # Create link for GIT - FileUtils.ln_sf alias_path, alias_from.path - end - # Create folder - FileUtils.mkdir_p File.join(APP_CONFIG['git_path'], 'git_projects', owner_uname || owner.uname) - # Create link for GIT - FileUtils.ln_sf alias_path, path - else - parent.repo.fork_bare(path, shared: false) - end - end - write_hook - end - - def destroy_git_repo - FileUtils.rm_rf path - return unless alias_from_id - unless alias_from || Project.where.not(id: id).where(alias_from_id: alias_from_id).exists? - FileUtils.rm_rf alias_path - end - end - - def write_hook - hook = "/home/#{APP_CONFIG['shell_user']}/gitlab-shell/hooks/post-receive" - hook_file = File.join(path, 'hooks', 'post-receive') - FileUtils.ln_sf hook, hook_file - end - - def get_actor(actor = nil) - @last_actor = case actor.class.to_s - when 'Grit::Actor' then options[:actor] - when 'Hash' then Grit::Actor.new(actor[:name], actor[:email]) - when 'String' then Grit::Actor.from_stirng(actor) - else begin - if actor.respond_to?(:name) and actor.respond_to?(:email) - Grit::Actor.new(actor.name, actor.email) - else - config = Grit::Config.new(repo) - Grit::Actor.new(config['user.name'], config['user.email']) - end - end - end - @last_actor - end - - module ClassMethods - MAX_SRC_SIZE = 1024*1024*256 - - def process_hook(owner_uname, repo, newrev, oldrev, ref, newrev_type, user = nil, message = nil) - rec = GitHook.new(owner_uname, repo, newrev, oldrev, ref, newrev_type, user, message) - Modules::Observers::ActivityFeed::Git.create_notifications rec - end - - def run_mass_import(url, srpms_list, visibility, owner, add_to_repository_id) - doc = Nokogiri::HTML(open(url)) - links = doc.css("a[href$='.src.rpm']") - return if links.count == 0 - filter = srpms_list.lines.map(&:chomp).map(&:strip).select(&:present?) - - repository = Repository.find add_to_repository_id - platform = repository.platform - dir = Dir.mktmpdir 'mass-import-', APP_CONFIG['tmpfs_path'] - links.each do |link| - begin - package = link.attributes['href'].value - package.chomp!; package.strip! - - next if package.size == 0 || package !~ Project::NAME_REGEXP - next if filter.present? && !filter.include?(package) - - uri = URI "#{url}/#{package}" - srpm_file = "#{dir}/#{package}" - Net::HTTP.start(uri.host) do |http| - if http.request_head(uri.path)['content-length'].to_i < MAX_SRC_SIZE - f = open(srpm_file, 'wb') - http.request_get(uri.path) do |resp| - resp.read_body{ |segment| f.write(segment) } - end - f.close - end - end - if name = `rpm -q --qf '[%{Name}]' -p #{srpm_file}` and $?.success? and name.present? - next if owner.projects.exists?(name: name) - description = `rpm -q --qf '[%{Description}]' -p #{srpm_file}`.scrub('') - - project = owner.projects.build( - name: name, - description: description, - visibility: visibility, - is_package: false # See: Hook for #attach_to_personal_repository - ) - project.owner = owner - if project.save - repository.projects << project rescue nil - project.update_attributes(is_package: true) - project.import_srpm srpm_file, platform.name - end - end - rescue => e - f.close if defined?(f) - Airbrake.notify_or_ignore(e, link: link.to_s, url: url, owner: owner) - ensure - File.delete srpm_file if srpm_file - end - end - rescue => e - Airbrake.notify_or_ignore(e, url: url, owner: owner) - ensure - FileUtils.remove_entry_secure dir if dir - end - end -end diff --git a/app/models/concerns/web_hooks.rb b/app/models/concerns/web_hooks.rb deleted file mode 100644 index 0a75a5c0b..000000000 --- a/app/models/concerns/web_hooks.rb +++ /dev/null @@ -1,55 +0,0 @@ -module WebHooks - - class << self - protected - - def add_hook(name) - NAMES << name.to_s - @schema = [] - yield if block_given? - SCHEMA[name] = @schema - @schema = [] - end - - def add_to_schema(type, attrs) - attrs.each do |attr| - @schema << [type, attr.to_sym] - end - end - - def boolean(*attrs) - add_to_schema :boolean, attrs - end - - def string(*attrs) - add_to_schema :string, attrs - end - - def password(*attrs) - add_to_schema :password, attrs - end - end - - NAMES = [] - SCHEMA = {} - add_hook :web do - string :url - end - # temporarily disabled - # add_hook :hipchat do - # string :auth_token, :room, :restrict_to_branch - # boolean :notify - # end - add_hook :irc do - string :server, :port, :room, :nick, :branch_regexes - password :password - boolean :ssl, :message_without_join, :no_colors, :long_url, :notice - end - - add_hook :jabber do - string :user - end - - SCHEMA.freeze - NAMES.freeze -end diff --git a/app/models/concerns/wiki.rb b/app/models/concerns/wiki.rb deleted file mode 100644 index 851fac272..000000000 --- a/app/models/concerns/wiki.rb +++ /dev/null @@ -1,31 +0,0 @@ -module Wiki - extend ActiveSupport::Concern - - included do - after_save :create_wiki - after_destroy :destroy_wiki - end - - def wiki_path - build_path(wiki_repo_name) - end - - def wiki_repo_name - File.join owner.uname, "#{name}.wiki" - end - - protected - - def create_wiki - if has_wiki && !FileTest.exist?(wiki_path) - Grit::Repo.init_bare(wiki_path) - wiki = Gollum::Wiki.new(wiki_path, { base_path: Rails.application.routes.url_helpers.project_wiki_index_path(self) }) - wiki.write_page('Home', :markdown, I18n.t("wiki.seed.welcome_content"), - { name: owner.name, email: owner.email, message: 'Initial commit' }) - end - end - - def destroy_wiki - FileUtils.rm_rf wiki_path - end -end diff --git a/app/models/git_hook.rb b/app/models/git_hook.rb deleted file mode 100644 index 5e6fb3b20..000000000 --- a/app/models/git_hook.rb +++ /dev/null @@ -1,83 +0,0 @@ -class GitHook - include Feed::Git - include Resque::Plugins::Status - - ZERO = '0000000000000000000000000000000000000000' - @queue = :hook - - attr_reader :repo, :newrev, :oldrev, :newrev_type, :oldrev_type, :refname, - :change_type, :rev, :rev_type, :refname_type, :owner, :project, :user, :message - - def self.perform(*options) - self.process(*options) - end - - def initialize(owner_uname, repo, newrev, oldrev, ref, newrev_type, user = nil, message = nil) - @repo, @newrev, @oldrev, @refname, @newrev_type, @user, @message = repo, newrev, oldrev, ref, newrev_type, user, message - if @owner = User.where(uname: owner_uname).first || Group.where(uname: owner_uname).first! - @project = @owner.own_projects.where(name: repo).first! - end - @change_type, @user = git_change_type, find_user(user) - git_revision_types - commit_type - end - - def git_change_type - if oldrev == ZERO - return 'create' - elsif newrev == ZERO - return 'delete' - else - return 'update' - end - end - - def git_revision_types - case change_type - when 'create', 'update' - @rev = newrev - when 'delete' - @rev = oldrev - end - @rev_type = newrev_type - end - - def commit_type - if refname =~ /refs\/tags\/*/ && rev_type == 'commit' - # un-annotated tag - @refname_type= 'tag' - #~ short_refname=refname + '##refs/tags/' - elsif refname =~ /refs\/tags\/*/ && rev_type == 'tag' - # annotated tag - @refname_type="annotated tag" - #~ short_refname= refname + '##refs/tags/' - elsif refname =~ /refs\/heads\/*/ && rev_type == 'commit' - # branch - @refname_type= 'branch' - elsif refname =~ /refs\/remotes\/*'/ && rev_type == 'commit' - # tracking branch - @refname_type="tracking branch" - @short_refname= refname + '##refs/remotes/' - else - # Anything else (is there anything else?) - @refname_type= "*** Unknown type of update to $refname (#{rev_type})" - end - end - - def self.process(*args) - Feed::Git.create_notifications(args.size > 1 ? GitHook.new(*args) : args.first) - end - - def find_user(user) - if user.blank? - # Local push - User.find_by(email: project.repo.commit(newrev).author.email) rescue nil - elsif user =~ /\Auser-\d+\Z/ - # git push over http - User.find(user.gsub('user-', '')) - elsif user =~ /\Akey-\d+\Z/ - # git push over ssh - SshKey.find(user.gsub('key-', '')).try(:user) - end - end -end diff --git a/app/models/hook.rb b/app/models/hook.rb deleted file mode 100644 index 3d0b357ad..000000000 --- a/app/models/hook.rb +++ /dev/null @@ -1,145 +0,0 @@ -class Hook < ActiveRecord::Base - include WebHooks - include UrlHelper - include Rails.application.routes.url_helpers - - belongs_to :project - - before_validation :cleanup_data - validates :project, :data, presence: true - validates :name, presence: true, inclusion: {in: NAMES} - - serialize :data, Hash - - scope :for_name, ->(name) { where(name: name) if name.present? } - - def receive_issues(issue, action) - pull = issue.pull_request - return if action.to_sym == :create && pull - default_url_options - - payload = meta(issue.project, issue.user) - base_params = { - number: issue.serial_id, - state: issue.status, - title: issue.title, - body: issue.body, - user: {login: issue.user.uname}, - } - if pull - total_commits = pull.repo.commits_between(pull.to_commit, pull.from_commit).count - repo_owner = pull.to_project.owner.uname - post 'pull_request', { - payload: payload.merge( - action: (pull.ready? ? 'opened' : pull.status), - pull_request: base_params.merge( - commits: total_commits, - head: {label: "#{pull.from_project.owner.uname}:#{pull.from_ref}"}, - base: {label: "#{repo_owner}:#{pull.to_ref}"}, - html_url: project_pull_request_url(pull.to_project, pull) - ) - ).to_json - } - else - post 'issues', { - payload: payload.merge( - action: (issue.closed? ? 'closed' : 'opened'), - issue: base_params.merge( - html_url: project_issue_url(issue.project, issue) - ) - ).to_json - } - end - end - later :receive_issues, queue: :notification - - def receive_push(git_hook) - default_url_options - project = Project.find(git_hook['project']['id']) - user = User.find(git_hook['user']['id']) - payload = meta(project, user) - oldrev, newrev, change_type = git_hook.values_at *%w(oldrev newrev change_type) - - commits = [] - payload.merge!(before: oldrev, after: newrev) - if %w(delete create).exclude? change_type - payload.merge!( - :compare => diff_url(project, "#{oldrev[0..6]}...#{newrev[0..6]}") - ) - if oldrev == newrev - commits = [project.repo.commit(newrev)] - modified = commits.first.stats.files.map{|f| f[0]} - else - commits = project.repo.commits_between(oldrev, newrev) - end - end - - post 'push', { - payload: payload.merge( - ref: git_hook['refname'], - commits: commits.map{ |commit| - files = changed_files commit - { - id: commit.id, - message: commit.message, - distinct: true, - url: commit_url(project, commit), - removed: files[:removed], - added: files[:added], - modified: files[:modified], - timestamp: commit.committed_date, - author: {name: commit.committer.name, email: commit.committer.email} - } - } - ).to_json - } - end - later :receive_push, queue: :notification - - protected - - def post(action, params) - github_services = APP_CONFIG['github_services'] - uri = URI "http://#{github_services['ip']}:#{github_services['port']}/#{name}/#{action}" - Net::HTTP.post_form uri, params.merge(data: data.to_json) - rescue # Dont care about it - end - - def meta(project, user) - { - repository: { - name: project.name, - url: project_url(project), - owner: { login: project.owner.uname } - }, - sender: {login: user.uname}, - pusher: {name: user.uname} - } - end - - def cleanup_data - if self.name.present? && fields = SCHEMA[self.name.to_sym] - new_data = {} - fields.each { |type, field| new_data[field] = self.data[field] } - self.data = new_data - end - end - - def changed_files(commit) - removed, added, modified = [], [], [] - commit.show.each do |diff| - if diff.renamed_file - added << diff.b_path - removed << diff.a_path - elsif diff.new_file - added << diff.b_path - elsif diff.deleted_file - removed << diff.a_path - else - modified << diff.a_path - end - end - { removed: removed, added: added, modified: modified } - end - -end diff --git a/app/models/issue.rb b/app/models/issue.rb deleted file mode 100644 index d71d5621b..000000000 --- a/app/models/issue.rb +++ /dev/null @@ -1,150 +0,0 @@ -class Issue < ActiveRecord::Base - include Feed::Issue - - STATUSES = [ - STATUS_OPEN = 'open', - STATUS_REOPEN = 'reopen', - STATUS_CLOSED = 'closed' - ] - HASH_TAG_REGEXP = /([a-zA-Z0-9\-_]*\/)?([a-zA-Z0-9\-_]*)?#([0-9]+)/ - self.per_page = 20 - - belongs_to :project - belongs_to :user - belongs_to :assignee, - class_name: 'User', - foreign_key: 'assignee_id' - - belongs_to :closer, - class_name: 'User', - foreign_key: 'closed_by' - - has_many :comments, - as: :commentable, - dependent: :destroy - - has_many :subscribes, - as: :subscribeable, - dependent: :destroy - - has_many :labelings, - dependent: :destroy - - has_many :labels, - -> { uniq }, - through: :labelings - - has_one :pull_request#, dependent: :destroy - - validates :title, :body, :project, presence: true - validates :title, length: { maximum: 100 } - validates :body, length: { maximum: 10000 } - - after_create :set_serial_id - after_create :subscribe_users - after_update :subscribe_issue_assigned_user - - before_create :update_statistic - before_update :update_statistic - - accepts_nested_attributes_for :labelings, - reject_if: -> (attributes) { attributes['label_id'].blank? }, - allow_destroy: true - - scope :opened, -> { where(status: [STATUS_OPEN, STATUS_REOPEN]) } - scope :closed, -> { where(status: STATUS_CLOSED) } - - scope :needed_checking, -> { where(issues: { status: %w(open reopen blocked ready already) }) } - scope :not_closed_or_merged, -> { needed_checking } - scope :closed_or_merged, -> { where(issues: { status: %w(closed merged) }) } - # Using mb_chars for correct transform to lowercase ('Русский Текст'.downcase => "Русский Текст") - scope :search, ->(q) { - where("#{table_name}.title ILIKE ?", "%#{q.mb_chars.downcase}%") if q.present? - } - scope :without_pull_requests, -> { - where('NOT EXISTS (select null from pull_requests as pr where pr.issue_id = issues.id)'). - references(:pull_requests) - } - - attr_accessor :new_pull_request - - def assign_uname - assignee.uname if assignee - end - - def to_param - serial_id.to_s - end - - def subscribe_creator(creator_id) - unless self.subscribes.exists?(user_id: creator_id) - self.subscribes.create(user_id: creator_id) - end - end - - def closed? - closed_by && closed_at && status == STATUS_CLOSED - end - - def set_close(closed_by) - self.closed_at = Time.now.utc - self.closer = closed_by - self.status = STATUS_CLOSED - end - - def set_open - self.closed_at = self.closed_by = nil - self.status = STATUS_REOPEN - end - - def collect_recipients - recipients = self.project.all_members - recipients = recipients | [self.assignee] if self.assignee - recipients - end - - def self.find_by_hash_tag(hash_tag, current_user, project) - hash_tag =~ HASH_TAG_REGEXP - owner_uname = Regexp.last_match[1].presence || Regexp.last_match[2].presence || project.owner.uname - project_name = Regexp.last_match[1] ? Regexp.last_match[2] : project.name - serial_id = Regexp.last_match[3] - project = Project.find_by_owner_and_name(owner_uname.chomp('/'), project_name) - return nil unless project - return nil unless ProjectPolicy.new(current_user, project).show? - project.issues.where(serial_id: serial_id).first - end - - protected - - def update_statistic - key = (pull_request || new_pull_request) ? Statistic::KEY_PULL_REQUEST : Statistic::KEY_ISSUE - Statistic.statsd_increment( - activity_at: Time.now, - key: "#{key}.#{status}", - project_id: project_id, - user_id: closed_by || user_id, - ) if new_record? || status_changed? - end - - def set_serial_id - self.serial_id = self.project.issues.maximum(:serial_id).to_i+1 - self.save! - end - - def subscribe_users - collect_recipients.each do |recipient| - if recipient.notifier.new_comment && !self.subscribes.exists?(user_id: recipient.id) - ss = self.subscribes.create(user_id: recipient.id) - end - end - end - - def subscribe_issue_assigned_user - if self.assignee_id && self.assignee_id_changed? - self.subscribes.where(user_id: self.assignee_id_was).first.try(:destroy) unless self.assignee_id_was.blank? - if self.assignee.notifier.issue_assign && !self.subscribes.exists?(user_id: self.assignee_id) - self.subscribes.create(user_id: self.assignee_id) - end - end - end -end diff --git a/app/models/label.rb b/app/models/label.rb deleted file mode 100644 index 85e5f3497..000000000 --- a/app/models/label.rb +++ /dev/null @@ -1,11 +0,0 @@ -class Label < ActiveRecord::Base - has_many :labelings, dependent: :destroy - has_many :issues, through: :labelings - belongs_to :project - - validates :name, uniqueness: { scope: :project_id } - validates :name, length: { in: 1..20 } - - validates :color, presence: true - validates :color, format: { with: /\A([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})\z/, message: I18n.t('layout.issues.invalid_labels') } -end diff --git a/app/models/labeling.rb b/app/models/labeling.rb deleted file mode 100644 index 972f44342..000000000 --- a/app/models/labeling.rb +++ /dev/null @@ -1,4 +0,0 @@ -class Labeling < ActiveRecord::Base - belongs_to :issue - belongs_to :label -end diff --git a/app/models/node_instruction.rb b/app/models/node_instruction.rb deleted file mode 100644 index e7b5c22c7..000000000 --- a/app/models/node_instruction.rb +++ /dev/null @@ -1,86 +0,0 @@ -class NodeInstruction < ActiveRecord::Base - STATUSES = [ - DISABLED = 'disabled', - READY = 'ready', - RESTARTING = 'restarting', - FAILED = 'failed' - ] - - LOCK_KEY = 'NodeInstruction::lock-key' - - belongs_to :user - - scope :duplicate, -> id, user_id { - where.not(id: id.to_i).where(user_id: user_id, status: STATUSES - [DISABLED]) - } - - attr_encrypted :instruction, key: APP_CONFIG['keys']['node_instruction_secret_key'] - - validates :user, presence: true - validates :instruction, presence: true, length: { maximum: 10000 } - validates :status, presence: true - validate -> { - errors.add(:status, 'Can be only single active instruction for each node') if !disabled? && NodeInstruction.duplicate(id.to_i, user_id).exists? - } - - state_machine :status, initial: :ready do - - after_transition(on: :restart) do |instruction, transition| - instruction.perform_restart - end - - event :ready do - transition %i(ready restarting disabled failed) => :ready - end - - event :disable do - transition ready: :disabled - end - - event :restart do - transition ready: :restarting - end - - event :restart_failed do - transition restarting: :failed - end - end - - def perform_restart - restart_failed if NodeInstruction.all_locked? - - success = false - stdout = '' - instruction.lines.each do |command| - next if command.blank? - command.chomp!; command.strip! - stdout << %x[ #{command} 2>&1 ] - success = $?.success? - end - - build_lists = BuildList.where(builder_id: user_id, external_nodes: [nil, '']). - for_status(BuildList::BUILD_STARTED) - - build_lists.find_each do |bl| - bl.update_column(:status, BuildList::BUILD_PENDING) - bl.restart_job - end - - update_column(:output, stdout) - success ? ready : restart_failed - end - later :perform_restart, queue: :low - - def self.all_locked? - Redis.current.get(LOCK_KEY).present? - end - - def self.lock_all - Redis.current.set(LOCK_KEY, 1) - end - - def self.unlock_all - Redis.current.del(LOCK_KEY) - end - -end diff --git a/app/models/platform.rb b/app/models/platform.rb index 5f9109556..dba42a5f6 100644 --- a/app/models/platform.rb +++ b/app/models/platform.rb @@ -41,9 +41,6 @@ class Platform < ActiveRecord::Base has_many :actors, as: :target, class_name: 'Relation', dependent: :destroy has_many :members, through: :actors, source: :actor, source_type: 'User' - - has_and_belongs_to_many :advisories - has_many :packages, class_name: "BuildList::Package", dependent: :destroy has_many :mass_builds, foreign_key: :save_to_platform_id diff --git a/app/models/project.rb b/app/models/project.rb index 6b02055ac..a2fb4090d 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -5,8 +5,6 @@ class Project < ActiveRecord::Base include Autostart include Owner - include Git - include Wiki include UrlHelper include EventLoggable include Project::DefaultBranch @@ -23,8 +21,6 @@ class Project < ActiveRecord::Base belongs_to :owner, polymorphic: true, counter_cache: :own_projects_count belongs_to :maintainer, class_name: 'User' - has_many :build_scripts, dependent: :destroy - has_many :project_to_repositories, dependent: :destroy has_many :repositories, through: :project_to_repositories has_many :project_statistics, dependent: :destroy @@ -32,11 +28,9 @@ class Project < ActiveRecord::Base has_many :build_lists, dependent: :destroy has_many :relations, as: :target, dependent: :destroy - has_many :collaborators, through: :relations, source: :actor, source_type: 'User' has_many :groups, through: :relations, source: :actor, source_type: 'Group' has_many :packages, class_name: 'BuildList::Package', dependent: :destroy - has_and_belongs_to_many :advisories # should be without dependent: :destroy validates :name, uniqueness: { scope: [:owner_id, :owner_type], case_sensitive: false }, presence: true, @@ -87,15 +81,7 @@ class Project < ActiveRecord::Base end def members(*includes) - collaborators.includes(includes) | groups.map{ |g| g.members.includes(includes) }.flatten - end - - def add_member(member, role = 'admin') - Relation.add_member(member, self, role) - end - - def remove_member(member) - Relation.remove_member(member, self) + groups.map{ |g| g.members.includes(includes) }.flatten end def platforms @@ -137,7 +123,6 @@ class Project < ActiveRecord::Base build_list = build_lists.build do |bl| bl.save_to_platform = save_to_platform bl.build_for_platform = build_for_platform - bl.update_type = 'newpackage' bl.arch = arch bl.project_version = project_version bl.user = user @@ -211,7 +196,6 @@ class Project < ActiveRecord::Base build_list = p.build_lists.build do |bl| bl.save_to_platform = repository.platform bl.build_for_platform = platform - bl.update_type = BuildList::UPDATE_TYPE_NEWPACKAGE bl.arch_id = arch_id bl.project_version = p.project_version_for(repository.platform, platform) bl.user = user diff --git a/app/models/project_tag.rb b/app/models/project_tag.rb deleted file mode 100644 index 06e99fd33..000000000 --- a/app/models/project_tag.rb +++ /dev/null @@ -1,17 +0,0 @@ -class ProjectTag < ActiveRecord::Base - include FileStoreClean - - FORMATS = { - 'zip' => 0, - 'tar.gz' => 1 - } - - belongs_to :project - - validates :project, :commit_id, :sha1, :tag_name, :format_id, presence: true - validates :project_id, uniqueness: { scope: [:tag_name, :format_id] } - - def sha1_of_file_store_files - [sha1] - end -end diff --git a/app/models/pull_request.rb b/app/models/pull_request.rb deleted file mode 100644 index 8a9f61568..000000000 --- a/app/models/pull_request.rb +++ /dev/null @@ -1,277 +0,0 @@ -class PullRequest < ActiveRecord::Base - STATUSES = [ - STATUS_OPEN = 'open', - STATUS_READY = 'ready', - STATUS_ALREADY = 'already', - STATUS_BLOCKED = 'blocked', - STATUS_MERGED = 'merged', - STATUS_CLOSED = 'closed' - ] - - belongs_to :issue, - autosave: true, - dependent: :destroy, - touch: true, - validate: true - - belongs_to :to_project, - class_name: 'Project', - foreign_key: 'to_project_id' - - belongs_to :from_project, - class_name: 'Project', - foreign_key: 'from_project_id' - - delegate :user, - :user_id, - :title, - :body, - :serial_id, - :assignee, - :status, - :to_param, - :created_at, - :updated_at, - :comments, - :status=, - to: :issue, allow_nil: true - - validates :from_project, presence: true, on: :create - validates :to_project, presence: true - - validate :uniq_merge, if: ->(pull) { pull.to_project.present? } - validates_each :from_ref, :to_ref do |record, attr, value| - check_ref record, attr, value - end - - before_create :clean_dir - before_create :set_add_data - after_destroy :clean_dir - - accepts_nested_attributes_for :issue - - scope :needed_checking, -> { includes(:issue).where(issues: { status: [STATUS_OPEN, STATUS_BLOCKED, STATUS_READY] }) } - scope :not_closed_or_merged, -> { needed_checking } - scope :closed_or_merged, -> { where(issues: { status: [STATUS_CLOSED, STATUS_MERGED] }) } - - state_machine :status, initial: :open do - event :ready do - transition [:ready, :open, :blocked] => :ready - end - - event :already do - transition [:ready, :open, :blocked] => :already - end - - event :block do - transition [:ready, :open, :blocked] => :blocked - end - - event :merging do - transition ready: :merged - end - - event :close do - transition [:ready, :open, :blocked] => :closed - end - - event :reopen do - transition closed: :open - end - end - - def update_relations(old_from_project_name = nil) - FileUtils.mv path(old_from_project_name), path, force: true if old_from_project_name - return unless Dir.exists?(path) - Dir.chdir(path) do - system 'git', 'remote', 'set-url', 'origin', to_project.path - system 'git', 'remote', 'set-url', 'head', from_project.path if cross_pull? - end - end - later :update_relations, queue: :middle - - def cross_pull? - from_project_id != to_project_id - end - - def check(do_transaction = true) - if do_transaction && !valid? - issue.set_close nil - issue.save(validate: false) # FIXME remove this hack - return false - end - res = merge - new_status = case res - when /Already up-to-date/ - 'already' - when /Merge made by/ - system("cd #{path} && git reset --hard HEAD^") # remove merge commit - 'ready' - when /Automatic merge failed/ - system("cd #{path} && git reset --hard HEAD") # clean git index - 'block' - else - raise res - end - - if do_transaction - new_status == 'already' ? (ready; merging) : send(new_status) - self.update_inline_comments - else - self.status = new_status == 'block' ? STATUS_BLOCKED : new_status - end - end - - def merge!(who) - return false unless can_merging? - Dir.chdir(path) do - old_commit = to_project.repo.commits(to_ref).first - commit = repo.commits(to_ref).first - system "git config user.name \"#{who.uname}\" && git config user.email \"#{who.email}\"" - res = merge - if commit.id != repo.commits(to_ref).first.id - res2 = %x(export GL_ID=user-#{who.id} GL_REPO_NAME=#{to_project.path} && git push origin HEAD) - system("git reset --hard HEAD^") # for diff maybe FIXME - - if old_commit.id == to_project.repo.commits(to_ref).first.id - raise "merge result pull_request #{id}: #{$?.exitstatus}; #{res2}; #{res}" - end - set_user_and_time who - merging - else # Try to catch no merge errors - raise "merge result pull_request #{id}: #{res}" - end - end - end - - def path(suffix = from_project_name) - last_part = [id, from_project_owner_uname, suffix].compact.join('-') - File.join(APP_CONFIG['git_path'], "#{new_record? ? 'temp_' : ''}pull_requests", to_project.owner.uname, to_project.name, last_part) - end - - def from_branch - cross_pull? ? "head_#{from_ref}" : from_ref - end - - def common_ancestor - return @common_ancestor if @common_ancestor - base_commit = repo.commits(to_ref).first - @common_ancestor = repo.commit(repo.git.merge_base({}, base_commit, from_commit)) || base_commit - end - alias_method :to_commit, :common_ancestor - - def diff_stats - @diff_stats ||= repo.diff_stats(to_commit.id, from_commit.id) - end - - def diff - @diff ||= repo.diff(to_commit.id, from_commit.id) - end - - def set_user_and_time user - issue.closed_at = Time.now.utc - issue.closer = user - end - - def self.check_ref(record, attr, value) - project = attr == :from_ref ? record.from_project : record.to_project - return if project.blank? - if record.to_project.repo.branches.count > 0 - record.errors.add attr, I18n.t('projects.pull_requests.wrong_ref') unless project.repo.branches_and_tags.map(&:name).include?(value) - else - record.errors.add attr, I18n.t('projects.pull_requests.empty_repo') - end - end - - def uniq_merge - if to_project && to_project.pull_requests.needed_checking - .where(from_project_id: from_project_id, - to_ref: to_ref, from_ref: from_ref) - .where('pull_requests.id <> :id or :id is null', id: id).count > 0 - errors.add(:base_branch, I18n.t('projects.pull_requests.duplicate', from_ref: from_ref)) - end - end - - def repo - @repo ||= Grit::Repo.new(path) - end - - def from_commit - repo.commits(from_branch).first - end - - protected - - def merge - clone - message = "Merge pull request ##{serial_id} from #{from_project_owner_uname}/#{from_project_name}:#{from_ref}\r\n #{title}" - %x(cd #{path} && git checkout #{to_ref.shellescape} && git merge --no-ff #{from_branch.shellescape} -m #{message.shellescape}) - end - - def clone - return if from_project.nil? - git = Grit::Git.new(path) - if new_record? || !git.exist? - #~ FileUtils.mkdir_p(path) - #~ system("git clone --local --no-hardlinks #{to_project.path} #{path}") - options = {bare: false, shared: false, branch: to_ref} # shared? - `rm -rf #{path}` - git.fs_mkdir('..') - git.clone(options, to_project.path, path) - if cross_pull? - Dir.chdir(path) do - system 'git', 'remote', 'add', 'head', from_project.path - end - end - #clean # Need testing - end - - Dir.chdir(path) do - system 'git', 'tag', '-d', from_ref, to_ref - system 'git fetch --tags && git fetch --all' - - tags, head = repo.tags.map(&:name), to_project == from_project ? 'origin' : 'head' - system 'git', 'checkout', to_ref - unless tags.include? to_ref - system 'git', 'reset', '--hard', "origin/#{to_ref}" - end - unless tags.include? from_ref - system 'git', 'branch', '-D', from_branch - system 'git', 'fetch', head, "+#{from_ref}:#{from_branch}" - system 'git', 'checkout', to_ref - end - end - end - - def clean - Dir.chdir(path) do - to_project.repo.branches.each {|branch| system 'git', 'checkout', branch.name} - system 'git', 'checkout', to_ref - - to_project.repo.branches.each do |branch| - system 'git', 'branch', '-D', branch.name unless [to_ref, from_branch].include? branch.name - end - to_project.repo.tags.each do |tag| - system 'git', 'tag', '-d', tag.name unless [to_ref, from_branch].include? tag.name - end - end - end - - def clean_dir - FileUtils.rm_rf path - end - - def update_inline_comments - self.comments.each do |c| - if c.data.present? # maybe need add new column 'actual'? - c.actual_inline_comment? diff, true - c.save - end - end - end - - def set_add_data - self.from_project_owner_uname = from_project.owner.uname - self.from_project_name = from_project.name - end -end diff --git a/app/models/register_request.rb b/app/models/register_request.rb deleted file mode 100644 index 20e2d04b1..000000000 --- a/app/models/register_request.rb +++ /dev/null @@ -1,35 +0,0 @@ -class RegisterRequest < ActiveRecord::Base - - default_scope { order(:created_at) } - - scope :rejected, -> { where(rejected: true) } - scope :approved, -> { where(approved: true) } - scope :unprocessed, -> { where(approved: false, rejected: false) } - - validates :email, presence: true, uniqueness: {case_sensitive: false}, - format: { with: /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i } - - # before_create :generate_token - before_update :invite_approve_notification - - def approve - update_attributes(approved: true, rejected: false) - end - - def reject - update_attributes(approved: false, rejected: true) - end - - protected - - def generate_token - self.token = Digest::SHA1.hexdigest(name + email + Time.now.to_s + rand.to_s) - end - - def invite_approve_notification - if approved_changed? && approved? - generate_token - UserMailer.invite_approve_notification(self).deliver - end - end -end diff --git a/app/models/ssh_key.rb b/app/models/ssh_key.rb deleted file mode 100644 index be7940ad1..000000000 --- a/app/models/ssh_key.rb +++ /dev/null @@ -1,63 +0,0 @@ -# This class is based on -# https://github.com/gitlabhq/gitlabhq/blob/15c0e58a49d623a0f8747e1d7e74364324eeb79f/app/models/key.rb - -class SshKey < ActiveRecord::Base - SHELL_KEY_COMMAND = "sudo -i -u #{APP_CONFIG['shell_user']} ~#{APP_CONFIG['shell_user']}/gitlab-shell/bin/gitlab-keys" - - belongs_to :user - - before_validation -> { self.key = key.strip if key.present? } - before_validation :set_fingerprint - - validates :name, length: { maximum: 255 } - validates :key, length: { maximum: 5000 }, format: { with: /ssh-.{3} / } # Public key? - validates :fingerprint, uniqueness: true, presence: { message: I18n.t('activerecord.errors.ssh_key.wrong_key') } - - after_create :add_key - before_destroy :remove_key - - protected - - def set_fingerprint - return false unless key - - file = Tempfile.new('key_file', '/tmp') - filename = file.path - begin - file.puts key - file.rewind - fingerprint_output = `ssh-keygen -lf #{file.path} 2>&1` # Catch stderr. - exitstatus = $?.exitstatus - ensure - file.close - file.unlink # deletes the temp file - end - if exitstatus != 0 - self.fingerprint = nil - else - self.fingerprint = fingerprint_output.split.try :[], 1 - if name.blank? - s = fingerprint_output.split.try :[], 2 - if filename == s # no identificator - start = key =~ /ssh-.{3} / - self.name = key[start..start+26] # taken first 26 characters - else - self.name = s - end - end - end - end - - def key_id - "key-#{id}" - end - - def add_key - system "#{SHELL_KEY_COMMAND} add-key #{key_id} \"#{key}\"" # Safety? - end - - def remove_key - system "#{SHELL_KEY_COMMAND} rm-key #{key_id}"# \"#{key}\"" - end - -end diff --git a/app/models/statistic.rb b/app/models/statistic.rb index 8790efdba..7288faea0 100644 --- a/app/models/statistic.rb +++ b/app/models/statistic.rb @@ -1,19 +1,10 @@ class Statistic < ActiveRecord::Base KEYS = [ - KEY_COMMIT = 'commit', KEY_BUILD_LIST = 'build_list', KEY_BUILD_LIST_BUILD_STARTED = "#{KEY_BUILD_LIST}.#{BuildList::BUILD_STARTED}", KEY_BUILD_LIST_SUCCESS = "#{KEY_BUILD_LIST}.#{BuildList::SUCCESS}", KEY_BUILD_LIST_BUILD_ERROR = "#{KEY_BUILD_LIST}.#{BuildList::BUILD_ERROR}", KEY_BUILD_LIST_BUILD_PUBLISHED = "#{KEY_BUILD_LIST}.#{BuildList::BUILD_PUBLISHED}", - KEY_ISSUE = 'issue', - KEY_ISSUES_OPEN = "#{KEY_ISSUE}.#{Issue::STATUS_OPEN}", - KEY_ISSUES_REOPEN = "#{KEY_ISSUE}.#{Issue::STATUS_REOPEN}", - KEY_ISSUES_CLOSED = "#{KEY_ISSUE}.#{Issue::STATUS_CLOSED}", - KEY_PULL_REQUEST = 'pull_request', - KEY_PULL_REQUESTS_OPEN = "#{KEY_PULL_REQUEST}.#{PullRequest::STATUS_OPEN}", - KEY_PULL_REQUESTS_MERGED = "#{KEY_PULL_REQUEST}.#{PullRequest::STATUS_MERGED}", - KEY_PULL_REQUESTS_CLOSED = "#{KEY_PULL_REQUEST}.#{PullRequest::STATUS_CLOSED}", ] belongs_to :user @@ -66,14 +57,6 @@ class Statistic < ActiveRecord::Base scope :build_lists_success, -> { where(key: KEY_BUILD_LIST_SUCCESS) } scope :build_lists_error, -> { where(key: KEY_BUILD_LIST_BUILD_ERROR) } scope :build_lists_published, -> { where(key: KEY_BUILD_LIST_BUILD_PUBLISHED) } - scope :commits, -> { where(key: KEY_COMMIT) } - scope :issues_open, -> { where(key: KEY_ISSUES_OPEN) } - scope :issues_reopen, -> { where(key: KEY_ISSUES_REOPEN) } - scope :issues_closed, -> { where(key: KEY_ISSUES_CLOSED) } - scope :pull_requests_open, -> { where(key: KEY_PULL_REQUESTS_OPEN) } - scope :pull_requests_merged, -> { where(key: KEY_PULL_REQUESTS_MERGED) } - scope :pull_requests_closed, -> { where(key: KEY_PULL_REQUESTS_CLOSED) } - def self.now_statsd_increment(activity_at: nil, user_id: nil, project_id: nil, key: nil, counter: 1) # Truncates a DateTime to the minute diff --git a/app/models/subscribe.rb b/app/models/subscribe.rb deleted file mode 100644 index d2522d5a6..000000000 --- a/app/models/subscribe.rb +++ /dev/null @@ -1,44 +0,0 @@ -class Subscribe < ActiveRecord::Base - belongs_to :subscribeable, polymorphic: true - belongs_to :user - belongs_to :project - - validates :user, presence: true - - def commit_subscribe? - subscribeable_type == 'Grit::Commit' - end - - def subscribed? - status - end - - def self.comment_subscribes(comment) - Subscribe.where(subscribeable_id: comment.commentable_id, subscribeable_type: comment.commentable.class.name, project_id: comment.project) - end - - def self.subscribed_to_commit?(project, user, commit) - subscribe = user.subscribes.where(subscribeable_id: commit.id.hex, subscribeable_type: commit.class.name, project_id: project.id).first - return subscribe.subscribed? if subscribe # return status if already subscribe present - true - end - - def self.subscribe_to_commit(options) - Subscribe.set_subscribe_to_commit(options, true) - end - - def self.unsubscribe_from_commit(options) - Subscribe.set_subscribe_to_commit(options, false) - end - - private - - def self.set_subscribe_to_commit(options, status) - if subscribe = Subscribe.where(options).first - subscribe.update_attributes(status: status) - else - Subscribe.create options.merge(status: status) - end - end - -end diff --git a/app/models/user.rb b/app/models/user.rb index 7166ac551..9994e3e52 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -4,7 +4,6 @@ class User < Avatar include PersonalRepository include ActsLikeMember - include Feed::User include EventLoggable include TokenAuthenticatable @@ -14,9 +13,8 @@ class User < Avatar LANGUAGES = LANGUAGES_FOR_SELECT.map(&:last) NAME_REGEXP = /[a-z0-9_]+/ - devise :database_authenticatable, :registerable, :omniauthable, - :recoverable, :rememberable, :validatable, :lockable, :confirmable - devise :omniauthable, omniauth_providers: [:facebook, :google_oauth2, :github] + devise :database_authenticatable, :registerable, :recoverable, + :rememberable, :validatable, :lockable, :confirmable has_one :notifier, class_name: 'SettingsNotifier', dependent: :destroy #:notifier has_one :builds_setting, class_name: 'UserBuildsSetting', dependent: :destroy @@ -25,8 +23,6 @@ class User < Avatar has_many :authentications, dependent: :destroy has_many :build_lists, dependent: :destroy - has_many :subscribes, foreign_key: :user_id, dependent: :destroy - has_many :comments, dependent: :destroy has_many :relations, as: :actor, dependent: :destroy has_many :targets, as: :actor, class_name: 'Relation', dependent: :destroy @@ -39,11 +35,8 @@ class User < Avatar has_many :own_projects, as: :owner, class_name: 'Project', dependent: :destroy has_many :own_groups, foreign_key: :owner_id, class_name: 'Group', dependent: :destroy has_many :own_platforms, as: :owner, class_name: 'Platform', dependent: :destroy - has_many :issues - has_many :assigned_issues, foreign_key: :assignee_id, class_name: 'Issue', dependent: :nullify has_many :key_pairs - has_many :ssh_keys, dependent: :destroy validates :uname, presence: true, uniqueness: { case_sensitive: false }, @@ -131,14 +124,6 @@ class User < Avatar # result # end - def commentor?(commentable) - comments.exists?(commentable_type: commentable.class.name, commentable_id: commentable.id.hex) - end - - def committer?(commit) - email.downcase == commit.committer.email.downcase - end - def owner_of? object if object.respond_to? :owner object.owner_id == self.id or self.group_ids.include? object.owner_id @@ -155,18 +140,6 @@ class User < Avatar raise "unknown user #{self.uname} roles #{roles}" end - def check_assigned_issues target - if target.is_a? Project - assigned_issues.where(project_id: target.id).update_all(assignee_id: nil) - else - project_ids = ProjectPolicy::Scope.new(self, Project).membered.uniq.pluck(:id) - - issues = assigned_issues - issues = issues.where('project_id not in (?)', project_ids) if project_ids.present? - issues.update_all(assignee_id: nil) - end - end - protected def target_roles target diff --git a/app/models/wiki_page.rb b/app/models/wiki_page.rb deleted file mode 100644 index 65aa62e66..000000000 --- a/app/models/wiki_page.rb +++ /dev/null @@ -1,11 +0,0 @@ -class WikiPage < Struct.new(:page, :format, :content, :footer, :sidebar) - include ActiveModel::Conversion - extend ActiveModel::Naming - - attr_accessor :message, :rename - - def rename - @rename ||= page - end - -end \ No newline at end of file diff --git a/app/policies/advisory_policy.rb b/app/policies/advisory_policy.rb deleted file mode 100644 index eded0db6d..000000000 --- a/app/policies/advisory_policy.rb +++ /dev/null @@ -1,24 +0,0 @@ -class AdvisoryPolicy < ApplicationPolicy - - def index? - true - end - alias_method :search?, :index? - alias_method :show?, :index? - - def create? - !user.guest? - end - alias_method :update?, :create? - - # Public: Get list of parameters that the user is allowed to alter. - # - # Returns Array - def permitted_attributes - %i( - description - references - ) - end - -end diff --git a/app/policies/build_list_policy.rb b/app/policies/build_list_policy.rb index 9a86b4a1f..25bdcff7d 100644 --- a/app/policies/build_list_policy.rb +++ b/app/policies/build_list_policy.rb @@ -26,13 +26,11 @@ class BuildListPolicy < ApplicationPolicy end def publish_into_testing? - return false unless record.new_core? return false unless record.can_publish_into_testing? create? || ( record.save_to_platform.main? && publish? ) end def publish? - return false unless record.new_core? return false unless record.can_publish? if record.build_published? local_admin?(record.save_to_platform) || record.save_to_repository.members.exists?(id: user.id) @@ -41,10 +39,8 @@ class BuildListPolicy < ApplicationPolicy ProjectPolicy.new(user, record.project).write? : local_admin?(record.save_to_platform) end end - alias_method :update_type?, :publish? def create_container? - return false unless record.new_core? ProjectPolicy.new(user, record.project).write? || local_admin?(record.save_to_platform) end @@ -75,7 +71,6 @@ class BuildListPolicy < ApplicationPolicy save_buildroot save_to_platform_id save_to_repository_id - update_type use_cached_chroot use_extra_tests ) diff --git a/app/policies/comment_policy.rb b/app/policies/comment_policy.rb deleted file mode 100644 index 0ce3cefcc..000000000 --- a/app/policies/comment_policy.rb +++ /dev/null @@ -1,21 +0,0 @@ -class CommentPolicy < ApplicationPolicy - - def create? - !user.guest? && ProjectPolicy.new(user, record.project).show? - end - alias_method :new_line?, :create? - - def update? - return false if user.guest? - is_admin? || record.user_id == user.id || local_admin?(record.project) - end - alias_method :destroy?, :update? - - # Public: Get list of parameters that the user is allowed to alter. - # - # Returns Array - def permitted_attributes - %i(body data) - end - -end diff --git a/app/policies/hook_policy.rb b/app/policies/hook_policy.rb deleted file mode 100644 index e10887645..000000000 --- a/app/policies/hook_policy.rb +++ /dev/null @@ -1,18 +0,0 @@ -class HookPolicy < ApplicationPolicy - - def show? - ProjectPolicy.new(user, record.project).update? - end - alias_method :read?, :show? - alias_method :create?, :show? - alias_method :destroy?, :show? - alias_method :update?, :show? - - # Public: Get list of parameters that the user is allowed to alter. - # - # Returns Array - def permitted_attributes - %i(data name) - end - -end diff --git a/app/policies/issue_policy.rb b/app/policies/issue_policy.rb deleted file mode 100644 index 7d7020efd..000000000 --- a/app/policies/issue_policy.rb +++ /dev/null @@ -1,34 +0,0 @@ -class IssuePolicy < ApplicationPolicy - - def index? - # record.project.has_issues? - true - end - - def show? - return true if record.pull_request.present? # for redirect from a issue to a pull request - return false unless record.project.has_issues? - ProjectPolicy.new(user, record.project).show? - end - alias_method :create?, :show? - alias_method :read?, :show? - - def update? - return false if user.guest? - is_admin? || record.user_id == user.id || local_admin?(record.project) - end - - # Public: Get list of parameters that the user is allowed to alter. - # - # Returns Array - def permitted_attributes - pa = %i(title body) - if ProjectPolicy.new(user, record.project).write? - pa << :assignee_id - pa << { labelings_attributes: %i(id name color label_id _destroy) } - pa << { labelings: [] } - end - pa - end - -end diff --git a/app/policies/platform_policy.rb b/app/policies/platform_policy.rb index 251ed412b..efef3ee2e 100644 --- a/app/policies/platform_policy.rb +++ b/app/policies/platform_policy.rb @@ -15,7 +15,6 @@ class PlatformPolicy < ApplicationPolicy return true if record.owner == user owner? || local_reader? || user_platform_ids.include?(record.id) end - alias_method :advisories?, :show? alias_method :owned?, :show? alias_method :read?, :show? alias_method :related?, :show? diff --git a/app/policies/project_policy.rb b/app/policies/project_policy.rb index 489665665..f8810c9a8 100644 --- a/app/policies/project_policy.rb +++ b/app/policies/project_policy.rb @@ -87,9 +87,6 @@ class ProjectPolicy < ApplicationPolicy architecture_dependent autostart_status default_branch - description - has_issues - has_wiki is_package maintainer_id mass_import diff --git a/app/policies/pull_request_policy.rb b/app/policies/pull_request_policy.rb deleted file mode 100644 index 0d7e3e9c8..000000000 --- a/app/policies/pull_request_policy.rb +++ /dev/null @@ -1,37 +0,0 @@ -class PullRequestPolicy < ApplicationPolicy - - def index? - true - end - - def show? - is_admin? || ProjectPolicy.new(user, record.to_project).show? - end - alias_method :read?, :show? - alias_method :commits?, :show? - alias_method :files?, :show? - alias_method :create?, :show? - - def update? - return false if user.guest? - is_admin? || record.user_id == user.id || local_writer?(record.to_project) - end - - def merge? - return false if user.guest? - is_admin? || local_writer?(record.to_project) - end - - # Public: Get list of parameters that the user is allowed to alter. - # - # Returns Array - def permitted_attributes - %i( - body - from_ref - title - to_ref - ) + [ issue_attributes: %i(title body) ] - end - -end diff --git a/app/policies/settings_notifier_policy.rb b/app/policies/settings_notifier_policy.rb index 665a567ab..f5f00ead5 100644 --- a/app/policies/settings_notifier_policy.rb +++ b/app/policies/settings_notifier_policy.rb @@ -6,14 +6,6 @@ class SettingsNotifierPolicy < ApplicationPolicy def permitted_attributes %i( can_notify - update_code - new_comment_commit_owner - new_comment_commit_repo_owner - new_comment_commit_commentor - new_comment - new_comment_reply - new_issue - issue_assign new_build new_associated_build ) diff --git a/app/policies/ssh_key_policy.rb b/app/policies/ssh_key_policy.rb deleted file mode 100644 index aa0a4d8ba..000000000 --- a/app/policies/ssh_key_policy.rb +++ /dev/null @@ -1,10 +0,0 @@ -class SshKeyPolicy < ApplicationPolicy - - # Public: Get list of parameters that the user is allowed to alter. - # - # Returns Array - def permitted_attributes - %i(key name) - end - -end diff --git a/app/policies/subscribe_policy.rb b/app/policies/subscribe_policy.rb deleted file mode 100644 index 7f136dfe5..000000000 --- a/app/policies/subscribe_policy.rb +++ /dev/null @@ -1,22 +0,0 @@ -class SubscribePolicy < ApplicationPolicy - - def create? - return false if user.guest? - return true if record.subscribeable.is_a?(Grit::Commit) - !record.subscribeable.subscribes.exists?(user_id: user.id) - end - - def destroy? - return false if user.guest? - return true if record.subscribeable.is_a?(Grit::Commit) - record.subscribeable.subscribes.exists?(user_id: user.id) - end - - # Public: Get list of parameters that the user is allowed to alter. - # - # Returns Array - def permitted_attributes - %i(status user_id) - end - -end diff --git a/app/presenters/abf_worker_status_presenter.rb b/app/presenters/abf_worker_status_presenter.rb index da0ae4512..16d1560b3 100644 --- a/app/presenters/abf_worker_status_presenter.rb +++ b/app/presenters/abf_worker_status_presenter.rb @@ -1,4 +1,4 @@ -class AbfWorkerStatusPresenter < ApplicationPresenter +class AbfWorkerStatusPresenter def initialize end diff --git a/app/presenters/api/v1/repository_package_presenter.rb b/app/presenters/api/v1/repository_package_presenter.rb index 65226b389..35e03cef5 100644 --- a/app/presenters/api/v1/repository_package_presenter.rb +++ b/app/presenters/api/v1/repository_package_presenter.rb @@ -1,5 +1,5 @@ require 'csv' -class Api::V1::RepositoryPackagePresenter < ApplicationPresenter +class Api::V1::RepositoryPackagePresenter CSV_HEADERS = { project_owner: 'Project owner', project_name: 'Project name', @@ -8,9 +8,7 @@ class Api::V1::RepositoryPackagePresenter < ApplicationPresenter version: 'Version', release: 'Release', maintainer_uname: 'Maintainer uname', - maintainer_email: 'Maintainer email', - committer_uname: 'Committer uname', - committer_email: 'Committer email' + maintainer_email: 'Maintainer email' } attr_reader :package @@ -21,13 +19,6 @@ class Api::V1::RepositoryPackagePresenter < ApplicationPresenter end def to_csv_row - commit = project.repo.commit(build_list.commit_hash) - committer = User.where(email: commit.committer.email).first || commit.committer if commit - if committer.is_a? User - committer_uname, committer_email = committer.uname, committer.email - elsif committer.is_a? Grit::Actor - committer_uname, committer_email = committer.name, committer.email - end CSV::Row.new( CSV_HEADERS.keys, [ @@ -38,9 +29,7 @@ class Api::V1::RepositoryPackagePresenter < ApplicationPresenter version, release, assignee.uname, - assignee.email, - committer_uname, - committer_email + assignee.email ] ) end diff --git a/app/presenters/application_presenter.rb b/app/presenters/application_presenter.rb deleted file mode 100644 index 35ce9e33b..000000000 --- a/app/presenters/application_presenter.rb +++ /dev/null @@ -1,55 +0,0 @@ -class ApplicationPresenter < RosaPresenter::Base -end - -#class ApplicationPresenter -# include ActionDispatch::Routing::UrlFor -# include ActionView::Helpers::UrlHelper -# include Rails.application.routes.url_helpers -# -# attr_accessor :controller -# -# def initialize(item, opts) -# end -# -# # TODO it needs to be refactored! -# class << self -# def present(item, opts, &block) -# block.call(self.new(item, opts)) -# end -# -# def present_collection(collection, &block) -# res = collection.map {|e| self.new(*e)} -# if block.present? -# res = res.inject('') do |akk, presenter| -# akk << block.call(presenter) -# akk -# end -# end -# return res -# end -# end -# -# protected -# -# def t(*args) -# I18n.translate(*args) -# end -# -# def l(*args) -# I18n.localize(*args) -# end -#end -# -#module Presenters -# module Activation -# def self.included(klass) # :nodoc: -# klass.prepend_before_filter :activate_presenter -# end -# -# private -# def activate_presenter -# ApplicationPresenter.controller = self -# end -# end -#end -#ActionController::Base.send(:include, Presenters::Activation) diff --git a/app/presenters/comment_presenter.rb b/app/presenters/comment_presenter.rb deleted file mode 100644 index ce0df3b23..000000000 --- a/app/presenters/comment_presenter.rb +++ /dev/null @@ -1,120 +0,0 @@ -class CommentPresenter < ApplicationPresenter - include PullRequestHelper - - attr_accessor :comment, :options - attr_reader :header, :image, :date, :caption, :content, :buttons, :is_reference_to_issue, - :reference_project - - def initialize(comment, opts = {}) - @is_reference_to_issue = !!(comment.automatic && comment.created_from_issue_id) # is it reference issue from another issue - @comment, @user, @options = comment, comment.user, opts - - unless @is_reference_to_issue - @content = @comment.body - else - issue = Issue.where(id: comment.created_from_issue_id).first - if issue && (comment.data[:comment_id].nil? || Comment.exists?(comment.data[:comment_id])) - @referenced_issue = issue.pull_request || issue - @reference_project = issue.project - title = if issue == opts[:commentable] - "#{issue.serial_id}" - elsif issue.project.owner == opts[:commentable].project.owner - "#{issue.project.name}##{issue.serial_id}" - else - "#{issue.project.name_with_owner}##{issue.serial_id}" - end - title = "#{title}:" - issue_link = project_issue_path(issue.project, issue) - @content = "#{title} #{issue.title}".html_safe - else - @content = t 'layout.comments.removed' - end - end - end - - def expandable? - false - end - - def buttons? - !@is_reference_to_issue # dont show for automatic comment - end - - def content? - true - end - - def caption? - false - end - - def issue_referenced_state? - @referenced_issue # show state of the existing referenced issue - end - - def buttons - project, commentable = options[:project], options[:commentable] - - link_to_comment = "#{helpers.project_commentable_path(project, commentable)}##{comment_anchor}" - klass = "#{@options[:in_discussion].present? ? 'in_discussion_' : ''}link_to_comment" - res = [ link_to(content_tag(:i, nil, class: 'fa fa-link'), - link_to_comment, - class: klass).html_safe ] - if controller.policy(@comment).update? - res << link_to(content_tag(:i, nil, class: 'fa fa-edit'), - "#update-comment#{comment.id}", - 'ng-click' => "commentsCtrl.toggleEditForm(#{comment_id})" ).html_safe - end - if controller.policy(@comment).destroy? - res << link_to(content_tag(:i, nil, class: 'fa fa-close'), - '', - 'ng-click' => "commentsCtrl.remove(#{comment_id})").html_safe - end - res - end - - def header - user_link = link_to @user.fullname, user_path(@user.uname) - res = unless @is_reference_to_issue - "#{user_link} #{t 'layout.comments.has_commented'}" - else - t 'layout.comments.reference', user: user_link - end - res.html_safe - end - - def image - @image ||= helpers.avatar_url(@user, :medium) - end - - def date - @date ||= @comment.created_at - end - - def comment_id? - true - end - - def comment_id - @comment.id - end - - def comment_anchor - # check for pull diff inline comment - before = if @options[:add_anchor].present? && !@options[:in_discussion] - 'diff-' - else - '' - end - "#{before}comment#{@comment.id}" - end - - def issue_referenced_state - if @referenced_issue.is_a? Issue - statuses = {'open' => 'success', 'closed' => 'danger'} - content_tag :span, t("layout.issues.status.#{@referenced_issue.status}"), class: "pull-right label label-#{statuses[@referenced_issue.status]}" - else - pull_status_label @referenced_issue.status, class: 'pull-right' - end.html_safe - end -end diff --git a/app/presenters/git_presenters/commit_as_message_presenter.rb b/app/presenters/git_presenters/commit_as_message_presenter.rb deleted file mode 100644 index 21385b4a5..000000000 --- a/app/presenters/git_presenters/commit_as_message_presenter.rb +++ /dev/null @@ -1,112 +0,0 @@ -class GitPresenters::CommitAsMessagePresenter < ApplicationPresenter - include CommitHelper - - attr_accessor :commit - attr_reader :header, :image, :date, :caption, :content, :expandable, - :is_reference_to_issue, :committer - - def initialize(commit, opts = {}) - comment = opts[:comment] - @is_reference_to_issue = !!comment # is it reference issue from commit - @project = if comment - Project.where(id: comment.data[:from_project_id]).first - else - opts[:project] - end - commit = commit || @project.repo.commit(Comment.hex_to_commit_hash comment.created_from_commit_hash) if @project - - if @project && commit - @committer = User.where(email: commit.committer.email).first || commit.committer - @commit_hash = commit.id - @committed_date, @authored_date = commit.committed_date, commit.authored_date - @commit_message = commit.message - else - @committer = t('layout.commits.unknown_committer') - @commit_hash = Comment.hex_to_commit_hash comment.created_from_commit_hash - @committed_date = @authored_date = comment.created_at - @commit_message = t('layout.commits.deleted') - end - prepare_message - end - - def header - @header ||= if @is_reference_to_issue - I18n.t('layout.commits.reference', committer: committer_link, commit: commit_link) - elsif @project.present? - I18n.t('layout.messages.commits.header', - committer: committer_link, commit: commit_link, project: @project.name) - end.html_safe - end - - def image - @image ||= if committer.is_a? User - helpers.avatar_url(committer, :medium) - elsif committer.is_a? Grit::Actor - helpers.avatar_url_by_email(committer.email, :medium) - else - helpers.gravatar_url('Unknown', User::AVATAR_SIZES[:medium]) - end - end - - def date - @date ||= @committed_date || @authored_date - end - - def expandable? - true - end - - def buttons? - false - end - - def content? - content.present? - end - - def caption? - true - end - - def comment_id? - false - end - - def issue_referenced_state? - false - end - - def reference_project - @project if @is_reference_to_issue - end - - protected - - def committer_link - @committer_link ||= if committer.is_a? User - link_to committer.uname, user_path(committer) - elsif committer.is_a?(Grit::Actor) && committer.email.present? - mail_to committer.email, committer.name - else # unknown committer - committer - end - end - - def commit_link - if @project - link_to shortest_hash_id(@commit_hash), commit_path(@project, @commit_hash) - else - shortest_hash_id(@commit_hash) - end - end - - def prepare_message - (@caption, @content) = @commit_message.split("\n\n", 2) - @caption = 'empty message' unless @caption.present? - if @caption.length > 72 - tmp = '...' + @caption[69..-1] - @content = (@content.present?) ? tmp + @content : tmp - @caption = @caption[0..68] + '...' - end - end -end diff --git a/app/presenters/statistic_presenter.rb b/app/presenters/statistic_presenter.rb index 580a19d5c..dac024bc1 100644 --- a/app/presenters/statistic_presenter.rb +++ b/app/presenters/statistic_presenter.rb @@ -1,4 +1,4 @@ -class StatisticPresenter < ApplicationPresenter +class StatisticPresenter attr_accessor :range_start, :range_end, :unit, :users_or_groups @@ -21,28 +21,6 @@ class StatisticPresenter < ApplicationPresenter success_count: build_lists_success.sum(&:count), build_error_count: build_lists_error.sum(&:count), build_published_count: build_lists_published.sum(&:count), - }, - commits: { - chart: prepare_collection(commits_chart), - commits_count: commits_chart.sum(&:count) - }, - issues: { - open: prepare_collection(issues_open), - reopen: prepare_collection(issues_reopen), - closed: prepare_collection(issues_closed), - - open_count: issues_open.sum(&:count), - reopen_count: issues_reopen.sum(&:count), - closed_count: issues_closed.sum(&:count) - }, - pull_requests: { - open: prepare_collection(pull_requests_open), - merged: prepare_collection(pull_requests_merged), - closed: prepare_collection(pull_requests_closed), - - open_count: pull_requests_open.sum(&:count), - merged_count: pull_requests_merged.sum(&:count), - closed_count: pull_requests_closed.sum(&:count) } } end @@ -64,34 +42,6 @@ class StatisticPresenter < ApplicationPresenter group("date_trunc('#{ unit }', activity_at)").order('activity_at') end - def issues_open - @issues_open ||= scope.issues_open.to_a - end - - def issues_reopen - @issues_reopen ||= scope.issues_reopen.to_a - end - - def issues_closed - @issues_closed ||= scope.issues_closed.to_a - end - - def pull_requests_open - @pull_requests_open ||= scope.pull_requests_open.to_a - end - - def pull_requests_merged - @pull_requests_merged ||= scope.pull_requests_merged.to_a - end - - def pull_requests_closed - @pull_requests_closed ||= scope.pull_requests_closed.to_a - end - - def commits_chart - @commits_chart ||= scope.commits.to_a - end - def build_lists_started @build_lists_started ||= scope.build_lists_started.to_a end diff --git a/app/services/abf_worker_service/repository.rb b/app/services/abf_worker_service/repository.rb index 3e05616a4..ec5ee0803 100644 --- a/app/services/abf_worker_service/repository.rb +++ b/app/services/abf_worker_service/repository.rb @@ -70,7 +70,7 @@ module AbfWorkerService status = testing ? BuildList::BUILD_PUBLISHED_INTO_TESTING : BuildList::BUILD_PUBLISHED Arch.pluck(:id).each do |arch_id| bl = BuildList.where(project_id: project_id). - where(new_core: true, status: status). + where(status: status). where(save_to_repository_id: repository_id). where(build_for_platform_id: platform_id). where(arch_id: arch_id). diff --git a/app/services/abf_worker_service/rpm.rb b/app/services/abf_worker_service/rpm.rb index 64dca5dc7..85cf3a90a 100644 --- a/app/services/abf_worker_service/rpm.rb +++ b/app/services/abf_worker_service/rpm.rb @@ -19,7 +19,7 @@ module AbfWorkerService def self.build_rpms(testing = false) available_repos = BuildList. select('MIN(updated_at) as min_updated_at, save_to_repository_id, build_for_platform_id'). - where(new_core: true, status: (testing ? BuildList::BUILD_PUBLISH_INTO_TESTING : BuildList::BUILD_PUBLISH)). + where(status: (testing ? BuildList::BUILD_PUBLISH_INTO_TESTING : BuildList::BUILD_PUBLISH)). group(:save_to_repository_id, :build_for_platform_id). order('min_updated_at ASC'). limit(WORKERS_COUNT * 2) # because some repos may be locked @@ -226,7 +226,7 @@ module AbfWorkerService def build_lists @build_lists ||= begin build_lists = BuildList. - where(new_core: true, status: (testing ? BuildList::BUILD_PUBLISH_INTO_TESTING : BuildList::BUILD_PUBLISH)). + where(status: (testing ? BuildList::BUILD_PUBLISH_INTO_TESTING : BuildList::BUILD_PUBLISH)). where(save_to_repository_id: save_to_repository_id). where(build_for_platform_id: build_for_platform_id). order(:updated_at) diff --git a/app/views/admin/_register_requests/index.html.haml b/app/views/admin/_register_requests/index.html.haml deleted file mode 100644 index ef9ab59d6..000000000 --- a/app/views/admin/_register_requests/index.html.haml +++ /dev/null @@ -1,60 +0,0 @@ -%div{style: 'float: right; margin: 20px'} - = link_to t("layout.register_request.approved"), admin_register_requests_path(scope: :approved) - \| - = link_to t("layout.register_request.rejected"), admin_register_requests_path(scope: :rejected) -%h2.title= title t("layout.register_request.list_header") -= form_tag admin_register_requests_path, method: :put, class: 'update_form' do - = hidden_field_tag 'update_type' - %table.tablesorter - %tr - %th   - %th= t("activerecord.attributes.register_request.name") - %th= t("activerecord.attributes.register_request.email") - %th= t("activerecord.attributes.register_request.interest") - %th= t("activerecord.attributes.register_request.more") - %th= t("activerecord.attributes.register_request.created_at") - %th - - @register_requests.each do |request| - %tr{class: cycle("odd", "even")} - %td= check_box_tag 'request_ids[]', request.id - %td= request.name - - @user = User.find_by(email: request.email) if request.approved - %td= link_to_if @user, request.email, @user - %td= request.interest - %td= request.more - %td= request.created_at - %td - - links = [] - - if policy(request).approve? - - links << link_to(t("layout.approve"), approve_admin_register_request_path(request)) - - if policy(request).reject? - - links << link_to(t("layout.reject"), reject_admin_register_request_path(request)) - - if request.token - - links << link_to('Link', new_user_registration_url(invitation_token: request.token)) - = raw links.join('|') - - .actions - %input#approve_registration{type: 'button', value: "Approve Selected"} - %input#reject_registration{type: 'button', value: "Reject Selected"} - -= will_paginate @register_requests - -:javascript - $(function() { - var $form = $('form.update_form') - var change_update_type = function (type) { - $('input#update_type').val(type); - }; - $('#approve_registration').on('click', function(e) { - //set update_type to 'approve' - change_update_type('approve'); - $form.submit(); - }); - $('#reject_registration').on('click', function(e) { - //set update_type to 'reject' - change_update_type('reject'); - $form.submit(); - }); - }); - -= render 'submenu' diff --git a/app/views/advisories/_advisories.json.jbuilder b/app/views/advisories/_advisories.json.jbuilder deleted file mode 100644 index 9be943673..000000000 --- a/app/views/advisories/_advisories.json.jbuilder +++ /dev/null @@ -1,8 +0,0 @@ -json.array!(advisories) do |json, a| - json.id a.advisory_id - json.advisory_id a.advisory_id - json.description simple_format(a.description) - json.popover_desc truncate(a.description, length: 500); - json.references a.references.split("\n").map{|ref| construct_ref_link(ref)}.join('
') - json.update_type a.update_type -end diff --git a/app/views/advisories/_advisory.json.jbuilder b/app/views/advisories/_advisory.json.jbuilder deleted file mode 100644 index 504f382f2..000000000 --- a/app/views/advisories/_advisory.json.jbuilder +++ /dev/null @@ -1,6 +0,0 @@ -json.id advisory.id -json.advisory_id advisory.advisory_id -json.description simple_format(advisory.description) -json.references advisory.references.split("\n").map { |ref| construct_ref_link(ref) }.join('
') -json.update_type advisory.update_type - diff --git a/app/views/advisories/_feed_partial.haml b/app/views/advisories/_feed_partial.haml deleted file mode 100644 index 421dbd53d..000000000 --- a/app/views/advisories/_feed_partial.haml +++ /dev/null @@ -1,8 +0,0 @@ -%h3= t("activerecord.attributes.advisory.description") -%p= simple_format advisory.description - -%h3= t("activerecord.attributes.advisory.references") -%p - - advisory.references.gsub(/\r| /, '').split("\n").each do |ref| - = construct_ref_link(ref) - %br diff --git a/app/views/advisories/_form.html.haml b/app/views/advisories/_form.html.haml deleted file mode 100644 index 0232b2f7f..000000000 --- a/app/views/advisories/_form.html.haml +++ /dev/null @@ -1,11 +0,0 @@ -%h3= t("layout.advisories.form_header") - -.form-group - = f.label :description, t("activerecord.attributes.advisory.description") - = f.text_area :description, class: 'form-control', cols: 80 - -.form-group - = f.label :references, t("activerecord.attributes.advisory.references") - %p.help-block - = t("layout.advisories.ref_comment") - = f.text_area :references, class: 'form-control', cols: 80 diff --git a/app/views/advisories/_list.html.haml b/app/views/advisories/_list.html.haml deleted file mode 100644 index dc8582c0e..000000000 --- a/app/views/advisories/_list.html.haml +++ /dev/null @@ -1,27 +0,0 @@ -.row.offset10.boffset10 - .col-xs-8 - = text_field_tag 'q', params[:q], placeholder: t('layout.advisories.search'), - class: 'form-control text-muted', 'ng-model' => 'q', 'ng-change' => 'goToPage(1)' - -%table.table.table-hover{ 'ng-cloak' => true } - %thead - %tr - %th= t 'activerecord.attributes.advisory.advisory_id' - %th= t 'layout.advisories.affected_versions' - %th= t 'activerecord.attributes.advisory.description' - %th= t 'layout.advisories.project_names' - %tbody - %tr{ 'ng-repeat' => 'item in advisories' } - %td - %a{ 'ng-href' => '{{item.link}}' } {{item.id}} - %td - %p{ 'ng-repeat' => 'pl in item.platforms' } - %a{ 'ng-href' => '{{pl.link}}' } {{pl.name}} - %td {{item.description}} - %td - %ul.list-unstyled - %li{ 'ng-repeat' => 'project in item.projects' } - %a{ 'ng-href' => '{{project.link}}' } {{ project.name }} - - %tr{ 'ng-show' => 'advisories.length === 0' } - %td{ colspan: 3 } {{'no_results_for_search' | i18n:q}} diff --git a/app/views/advisories/_list_item.html.haml b/app/views/advisories/_list_item.html.haml deleted file mode 100644 index 08288a12a..000000000 --- a/app/views/advisories/_list_item.html.haml +++ /dev/null @@ -1,7 +0,0 @@ -%tr{class: cycle("odd", "even")} - %td= link_to advisory.advisory_id, advisory_path(advisory) - %td - - advisory.platforms.each do |platform| - = link_to platform_printed_name(platform), platform_path(platform) - %br - %td= truncate(advisory.description, length: 50) diff --git a/app/views/advisories/_packages_info.html.slim b/app/views/advisories/_packages_info.html.slim deleted file mode 100644 index 0d135f032..000000000 --- a/app/views/advisories/_packages_info.html.slim +++ /dev/null @@ -1,23 +0,0 @@ -.packages_info_container - h3 - = t('layout.advisories.affected_in') - ul - - @packages_info.each_pair do |platform, projects| - li - p - => t('activerecord.models.platform') - = link_to platform.name, platform_path(platform) - ul - - projects.each_pair do |project, packages| - li - p= raw "#{ t('activerecord.models.project') } #{ link_to project.name, project_path(project) }" - ul - li - p SRPM: - ul - li= packages[:srpm] - li - p RPM: - ul - - packages[:rpm].each do |package| - li= package diff --git a/app/views/advisories/_submenu.html.haml b/app/views/advisories/_submenu.html.haml deleted file mode 100644 index 9b818ff69..000000000 --- a/app/views/advisories/_submenu.html.haml +++ /dev/null @@ -1,11 +0,0 @@ -- content_for :submenu do - - act = action_name.to_sym; contr = controller_name.to_sym - %nav.navbar.navbar-default.submenu{role: "navigation"} - .container-fluid - .navbar-header - %ul.nav.navbar-nav - - if @advisory.present? - %li= @advisory.advisory_id - - else - %li{ class: ('active' if act.in? [:index]) } - = link_to t('layout.list'), advisories_path, class: act.in?([:index]) ? 'active' : nil diff --git a/app/views/advisories/index.atom.builder b/app/views/advisories/index.atom.builder deleted file mode 100644 index 8a746b6ea..000000000 --- a/app/views/advisories/index.atom.builder +++ /dev/null @@ -1,14 +0,0 @@ -atom_feed do |feed| - feed.title t('layout.advisories.atom_title') - feed.updated(@advisories.first.created_at) if @advisories.length > 0 - - @advisories.each do |advisory| - feed.entry(advisory, url: advisory_url(advisory)) do |entry| - content = raw(render(inline: true, partial: 'feed_partial', locals: { advisory: advisory })) - - entry.title("#{t("activerecord.models.advisory")} #{advisory.advisory_id}") - entry.content(content, type: 'html') - - end - end -end diff --git a/app/views/advisories/index.html.slim b/app/views/advisories/index.html.slim deleted file mode 100644 index ecdebc17c..000000000 --- a/app/views/advisories/index.html.slim +++ /dev/null @@ -1,17 +0,0 @@ -- set_meta_tags title: t('layout.advisories.list_header') -- set_meta_tags og: { title: t('layout.advisories.list_header'), - description: t('layout.advisories.search') } -- set_meta_tags twitter: { title: t('layout.advisories.list_header'), - description: t('layout.advisories.search') } - -- render partial: 'submenu' -.col-xs-12.col-md-10.col-md-offset-1 - .row - - q = params[:q].presence || 'null' - div ng-controller='AdvisoryCtrl' ng-init="init(#{ q })" - h3 - = t('layout.advisories.list_header') - = link_to image_tag("rss.ico", width: '15px', height: '15px', class: 'atom_icon'), - APP_CONFIG['anonymous_access'] ? advisories_path(format: 'atom') : advisories_path(format: 'atom', token: current_user.authentication_token) - == render partial: 'list', object: @advisories - = angularjs_paginate( per_page: Advisory.per_page ) diff --git a/app/views/advisories/index.json.jbuilder b/app/views/advisories/index.json.jbuilder deleted file mode 100644 index fc2dc052c..000000000 --- a/app/views/advisories/index.json.jbuilder +++ /dev/null @@ -1,24 +0,0 @@ -json.advisories do - json.array!(@advisories) do |item| - json.cache! item, expires_in: 10.minutes do - json.id item.advisory_id - json.link advisory_path(item) - json.description truncate(item.description, length: 100) - json.platforms do - json.array!(item.platforms) do |pl| - json.name platform_printed_name(pl) - json.link platform_path(pl) - end - end - json.projects do - json.array!(item.projects) do |pr| - json.name pr.name - json.link project_path(pr) - end - end - end - end -end - -json.page params[:page] -json.advisories_count @advisories_count diff --git a/app/views/advisories/show.html.slim b/app/views/advisories/show.html.slim deleted file mode 100644 index 8e9ffecc1..000000000 --- a/app/views/advisories/show.html.slim +++ /dev/null @@ -1,79 +0,0 @@ -- title = [title_object(@advisory), t('activerecord.models.advisory')] -- set_meta_tags title: title -- title = title.reverse * ' - ' -- set_meta_tags og: { title: title, - description: truncate(@advisory.description, length: 255) } -- set_meta_tags twitter: { title: title, - description: truncate(@advisory.description, length: 200) } - -- render partial: 'submenu' - -.container.col-md-offset-2.col-md-8 - .row - h3 - => t('activerecord.models.advisory') - = @advisory.advisory_id - - .row - .col-md-6 - b - = t('layout.advisories.project_names') - .col-md-6 - = raw @advisory.projects.map{ |p| link_to p.name_with_owner, project_path(p) }.join(', ') - - .row - .col-md-6 - b - = t('activerecord.attributes.advisory.created_at') - .col-md-6 - = @advisory.created_at - - .row - .col-md-6 - b - = t('activerecord.attributes.advisory.advisory_id') - .col-md-6 - = @advisory.advisory_id - - .row - .col-md-6 - b - = t('layout.advisories.affected_versions') - .col-md-6 - ul.list-unstyled - - @advisory.platforms.each do |platform| - li - = link_to platform_printed_name(platform), platform_path(platform) - - .row - .col-md-6 - b - = t('activerecord.attributes.advisory.description') - .col-md-6 - = simple_format @advisory.description - - .row - .col-md-6 - b - = t('activerecord.attributes.advisory.references') - .col-md-6 - ul.list-unstyled - - @advisory.references.gsub(/\r| /, '').split("\n").each do |ref| - li - = construct_ref_link(ref) - - .row - .col-md-6 - b - = t('layout.advisories.build_lists') - .col-md-6 - = raw @advisory.build_lists.map{ |bl| link_to bl.id, build_list_path(bl) }.join(', ') - - .row - .col-md-6 - b - = t('layout.advisories.build_lists') - .col-md-6 - - .row - = render 'packages_info' diff --git a/app/views/api/v1/advisories/_advisory.json.jbuilder b/app/views/api/v1/advisories/_advisory.json.jbuilder deleted file mode 100644 index 056c2b304..000000000 --- a/app/views/api/v1/advisories/_advisory.json.jbuilder +++ /dev/null @@ -1,12 +0,0 @@ -json.id advisory.advisory_id -json.(advisory, :description) -json.platforms advisory.platforms do |platform| - json.(platform, :id, :released) - json.url api_v1_platform_path(platform.id, format: :json) -end -json.projects advisory.projects do |project| - json.(project, :id, :name) - json.fullname project.name_with_owner - json.url api_v1_project_path(project.id, format: :json) -end -json.url api_v1_advisory_path(advisory.advisory_id, format: :json) \ No newline at end of file diff --git a/app/views/api/v1/advisories/index.json.jbuilder b/app/views/api/v1/advisories/index.json.jbuilder deleted file mode 100644 index 178715ad1..000000000 --- a/app/views/api/v1/advisories/index.json.jbuilder +++ /dev/null @@ -1,4 +0,0 @@ -json.advisories @advisories do |advisory| - json.partial! 'advisory', advisory: advisory -end -json.url api_v1_advisories_path(format: :json) \ No newline at end of file diff --git a/app/views/api/v1/advisories/show.json.jbuilder b/app/views/api/v1/advisories/show.json.jbuilder deleted file mode 100644 index 85c727901..000000000 --- a/app/views/api/v1/advisories/show.json.jbuilder +++ /dev/null @@ -1,25 +0,0 @@ -json.advisory do - json.partial! 'advisory', advisory: @advisory - json.created_at @advisory.created_at.to_i - json.updated_at @advisory.updated_at.to_i - json.(@advisory, :update_type) - json.references @advisory.references.split('\n') - - json.build_lists @advisory.build_lists do |build_list| - json.(build_list, :id) - json.url api_v1_build_list_path(build_list.id, format: :json) - end - - json.affected_in @packages_info do |package_info| - json.partial! 'api/v1/platforms/platform', platform: package_info[0] - - json.projects package_info[1] do |info| - json.partial! 'api/v1/projects/project', project: info[0] - - packages = info[1] - json.srpm packages[:srpm] - json.rpm packages[:rpm] - end - end - -end diff --git a/app/views/api/v1/build_lists/show.json.jbuilder b/app/views/api/v1/build_lists/show.json.jbuilder index b4cb8a726..c28e2b935 100644 --- a/app/views/api/v1/build_lists/show.json.jbuilder +++ b/app/views/api/v1/build_lists/show.json.jbuilder @@ -1,6 +1,6 @@ json.build_list do json.(@build_list, :id, :container_status, :status, :duration) - json.(@build_list, :update_type, :priority, :new_core) + json.(@build_list, :priority) json.(@build_list, :auto_publish_status, :package_version, :commit_hash, :last_published_commit_hash, :auto_create_container, :use_cached_chroot, :use_extra_tests) json.build_log_url log_build_list_path(@build_list) @@ -62,15 +62,6 @@ json.build_list do json.extra_params @build_list.extra_params - if @build_list.advisory - json.advisory do - json.name @build_list.advisory.advisory_id - json.(@build_list.advisory, :description) - end - else - json.advisory nil - end - if @build_list.mass_build json.mass_build do json.(@build_list.mass_build, :id, :name) @@ -83,7 +74,7 @@ json.build_list do json.file_name result['file_name'] json.size result['size'] json.url "#{APP_CONFIG['file_store_url']}/api/v1/file_stores/#{result['sha1']}" - end if @build_list.new_core? + end json.packages @build_list.packages do |package| json.partial! 'api/v1/maintainers/package', package: package diff --git a/app/views/api/v1/issues/_issue.json.jbuilder b/app/views/api/v1/issues/_issue.json.jbuilder deleted file mode 100644 index cccbd1f8f..000000000 --- a/app/views/api/v1/issues/_issue.json.jbuilder +++ /dev/null @@ -1,11 +0,0 @@ -json.number issue.serial_id -json.(issue, :title, :status) -json.labels issue.labels do |label| - json.partial! 'label', label: label -end -json.assignee do - json.partial! 'api/v1/shared/member', member: issue.assignee -end if issue.assignee - -json.url api_v1_project_issue_path(issue.project.id, issue.serial_id, format: :json) - diff --git a/app/views/api/v1/issues/_label.json.jbuilder b/app/views/api/v1/issues/_label.json.jbuilder deleted file mode 100644 index fdee26e0d..000000000 --- a/app/views/api/v1/issues/_label.json.jbuilder +++ /dev/null @@ -1 +0,0 @@ -json.(label, :name, :color) diff --git a/app/views/api/v1/issues/index.json.jbuilder b/app/views/api/v1/issues/index.json.jbuilder deleted file mode 100644 index e9145135e..000000000 --- a/app/views/api/v1/issues/index.json.jbuilder +++ /dev/null @@ -1,11 +0,0 @@ -json.issues @issues do |issue| - json.partial! 'issue', issue: issue - json.issue issue.body - json.partial! 'api/v1/shared/owner', owner: issue.user - json.closed_at issue.closed_at.to_i - json.closed_by do - json.partial! 'api/v1/shared/member', member: issue.closer - end if issue.closer - json.created_at issue.created_at.to_i - json.updated_at issue.updated_at.to_i -end diff --git a/app/views/api/v1/issues/show.json.jbuilder b/app/views/api/v1/issues/show.json.jbuilder deleted file mode 100644 index 4649b8226..000000000 --- a/app/views/api/v1/issues/show.json.jbuilder +++ /dev/null @@ -1,11 +0,0 @@ -json.issue do - json.partial! 'issue', issue: @issue - json.issue @issue.body - json.partial! 'api/v1/shared/owner', owner: @issue.user - json.closed_at @issue.closed_at.to_i - json.closed_by do - json.partial! 'api/v1/shared/member', member: @issue.closer - end if @issue.closer - json.created_at @issue.created_at.to_i - json.updated_at @issue.updated_at.to_i -end diff --git a/app/views/api/v1/projects/_project.json.jbuilder b/app/views/api/v1/projects/_project.json.jbuilder index 682cec9ab..aab9cef3b 100644 --- a/app/views/api/v1/projects/_project.json.jbuilder +++ b/app/views/api/v1/projects/_project.json.jbuilder @@ -1,7 +1,7 @@ json.(project, :id, :name, :visibility) json.fullname project.name_with_owner json.url api_v1_project_path(project.id, format: :json) -json.git_url git_repo_url(project.name_with_owner) +json.git_url project.git_project_address json.maintainer do if project.maintainer json.partial! 'api/v1/maintainers/maintainer', maintainer: project.maintainer diff --git a/app/views/api/v1/projects/index.json.jbuilder b/app/views/api/v1/projects/index.json.jbuilder index b141abd52..627c87312 100644 --- a/app/views/api/v1/projects/index.json.jbuilder +++ b/app/views/api/v1/projects/index.json.jbuilder @@ -1,6 +1,6 @@ json.projects @projects do |project| json.partial! 'project', project: project - json.(project, :description, :ancestry, :has_issues, :has_wiki, :default_branch, :is_package, :publish_i686_into_x86_64) + json.(project, :ancestry, :default_branch, :is_package, :publish_i686_into_x86_64) json.created_at project.created_at.to_i json.updated_at project.updated_at.to_i json.partial! 'api/v1/shared/owner', owner: project.owner diff --git a/app/views/api/v1/projects/refs_list.json.jbuilder b/app/views/api/v1/projects/refs_list.json.jbuilder deleted file mode 100644 index 557a449b6..000000000 --- a/app/views/api/v1/projects/refs_list.json.jbuilder +++ /dev/null @@ -1,8 +0,0 @@ -json.refs_list @refs do |grit| - json.ref grit.name - json.object do - json.type (grit.class.name =~ /Tag/ ? 'tag' : 'commit') - json.sha grit.commit.id - end -end -json.url refs_list_api_v1_project_path(@project.id, format: :json) \ No newline at end of file diff --git a/app/views/api/v1/projects/show.json.jbuilder b/app/views/api/v1/projects/show.json.jbuilder index 0254b1aaf..e9cfcdc64 100644 --- a/app/views/api/v1/projects/show.json.jbuilder +++ b/app/views/api/v1/projects/show.json.jbuilder @@ -1,6 +1,6 @@ json.project do json.partial! 'project', project: @project - json.(@project, :description, :ancestry, :has_issues, :has_wiki, :default_branch, :is_package, :publish_i686_into_x86_64) + json.(@project, :ancestry, :default_branch, :is_package, :publish_i686_into_x86_64) json.created_at @project.created_at.to_i json.updated_at @project.updated_at.to_i json.partial! 'api/v1/shared/owner', owner: @project.owner diff --git a/app/views/api/v1/pull_requests/_pull.json.jbuilder b/app/views/api/v1/pull_requests/_pull.json.jbuilder deleted file mode 100644 index 8337a2068..000000000 --- a/app/views/api/v1/pull_requests/_pull.json.jbuilder +++ /dev/null @@ -1,24 +0,0 @@ -json.number pull.serial_id -json.(pull, :title, :status) -json.to_ref do - json.ref pull.to_ref - json.sha pull.to_commit.try(:id) - json.project do - json.partial! 'api/v1/projects/project', project: pull.to_project - end -end -json.from_ref do - json.ref pull.from_ref - json.sha pull.from_commit.try(:id) - json.project do - json.partial! 'api/v1/projects/project', project: pull.from_project - end -end -json.partial! 'api/v1/shared/owner', owner: pull.user -json.assignee do - json.partial! 'api/v1/shared/member', member: pull.issue.assignee -end if pull.issue.assignee -json.mergeable pull.can_merging? -json.merged_at pull.issue.closed_at.to_i if pull.merged? - -json.url api_v1_project_pull_request_path(pull.to_project.id, pull.id, format: :json) diff --git a/app/views/api/v1/pull_requests/commits.json.jbuilder b/app/views/api/v1/pull_requests/commits.json.jbuilder deleted file mode 100644 index 2de2932b1..000000000 --- a/app/views/api/v1/pull_requests/commits.json.jbuilder +++ /dev/null @@ -1,25 +0,0 @@ -json.commits @commits do |commit| - json.sha commit.id - json.https_url commit_path(@project, commit.id) - json.author do - json.name commit.author.name - json.email commit.author.email - json.date commit.authored_date.to_i - end - json.committer do - json.name commit.committer.name - json.email commit.committer.email - json.date commit.committed_date.to_i - end - json.message commit.message - json.tree do - json.sha commit.id - json.https_url commit_path(@project, commit.id) - end - json.parents commit.parents do |parent| - json.sha parent.id - json.https_url commit_path(@project, parent.id) - end -end - -json.url commits_api_v1_project_pull_request_path(format: :json) diff --git a/app/views/api/v1/pull_requests/files.json.jbuilder b/app/views/api/v1/pull_requests/files.json.jbuilder deleted file mode 100644 index c2e94fff5..000000000 --- a/app/views/api/v1/pull_requests/files.json.jbuilder +++ /dev/null @@ -1,24 +0,0 @@ -json.files @stats do |stat| - fstat, diff = stat - commit_id = diff.deleted_file ? @pull.to_commit.id : @pull.from_commit.id - json.sha commit_id - json.filename diff.b_path - status = case - when diff.new_file - 'added' - when diff.deleted_file - 'deleted' - when diff.renamed_file - 'renamed' - else - 'modified' - end - json.status status - json.additions fstat.additions - json.deletions fstat.deletions - json.changes fstat.additions + fstat.deletions - json.blob_https_url blob_path(@project, commit_id, diff.b_path) - json.raw_https_url raw_path(@project, commit_id, diff.b_path) -end - -json.url files_api_v1_project_pull_request_path(format: :json) diff --git a/app/views/api/v1/pull_requests/index.json.jbuilder b/app/views/api/v1/pull_requests/index.json.jbuilder deleted file mode 100644 index b37e26879..000000000 --- a/app/views/api/v1/pull_requests/index.json.jbuilder +++ /dev/null @@ -1,5 +0,0 @@ -json.pull_requests @pulls do |pull| - json.partial! 'pull', pull: pull -end - -json.url @pulls_url diff --git a/app/views/api/v1/pull_requests/show.json.jbuilder b/app/views/api/v1/pull_requests/show.json.jbuilder deleted file mode 100644 index d4882284f..000000000 --- a/app/views/api/v1/pull_requests/show.json.jbuilder +++ /dev/null @@ -1,17 +0,0 @@ -json.pull_request do - json.partial! 'pull', pull: @pull - json.body @pull.body - json.closed_at @pull.issue.closed_at.to_i if @pull.merged? || @pull.closed? - - if @pull.issue.closer - json.closed_by do - json.(@pull.issue.closer, :id, :name, :uname) - end - json.merged_by do - json.(@pull.issue.closer, :id, :name, :uname) - end if @pull.merged? - end - - json.created_at @pull.issue.created_at.to_i - json.updated_at @pull.issue.updated_at.to_i -end diff --git a/app/views/api/v1/users/notifiers.json.jbuilder b/app/views/api/v1/users/notifiers.json.jbuilder index a1968e864..5ec7588ca 100644 --- a/app/views/api/v1/users/notifiers.json.jbuilder +++ b/app/views/api/v1/users/notifiers.json.jbuilder @@ -1,8 +1,7 @@ json.user do json.(@user, :id) json.notifiers do - json.(@user.notifier, :can_notify, :new_comment, :new_comment_reply, :new_issue, :issue_assign, :new_comment_commit_owner, :new_comment_commit_repo_owner, :new_comment_commit_commentor, :new_build, :new_associated_build, - :update_code) + json.(@user.notifier, :can_notify, :new_build, :new_associated_build) end end diff --git a/app/views/devise/registrations/new.html.slim b/app/views/devise/registrations/new.html.slim index eed1c34cd..1673f366d 100644 --- a/app/views/devise/registrations/new.html.slim +++ b/app/views/devise/registrations/new.html.slim @@ -15,6 +15,4 @@ hr .pull-right - = f.button :submit, t('layout.devise.shared_links.sign_up') - .panel-footer - == render 'devise/shared/providers' + = f.button :submit, t('layout.devise.shared_links.sign_up') \ No newline at end of file diff --git a/app/views/devise/sessions/new.html.slim b/app/views/devise/sessions/new.html.slim index 8403be4a8..d3b7e060f 100644 --- a/app/views/devise/sessions/new.html.slim +++ b/app/views/devise/sessions/new.html.slim @@ -18,7 +18,5 @@ = f.input :remember_me, as: :boolean, checked: true .pull-right = f.button :submit, t('layout.devise.shared_links.sign_in') - .panel-footer - == render 'devise/shared/providers' = link_to t('layout.devise.shared_links.forgot_password'), new_password_path(resource_name) diff --git a/app/views/devise/shared/_links.haml b/app/views/devise/shared/_links.haml index f9ee42292..945473188 100644 --- a/app/views/devise/shared/_links.haml +++ b/app/views/devise/shared/_links.haml @@ -9,6 +9,3 @@ = link_to t("layout.devise.shared_links.confirm_again"), new_confirmation_path(resource_name), class: "text_button_padding link_button" - if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' = link_to t("layout.devise.shared_links.unlock"), new_unlock_path(resource_name), class: "text_button_padding link_button" --# if devise_mapping.omniauthable? - - resource_class.omniauth_providers.each do |provider| - = link_to t("layout.devise.shared_links.sign_in_through", provider: provider.to_s.classify), omniauth_authorize_path(resource_name, provider), class: "text_button_padding link_button" diff --git a/app/views/devise/shared/_providers.html.slim b/app/views/devise/shared/_providers.html.slim deleted file mode 100644 index e001b24ca..000000000 --- a/app/views/devise/shared/_providers.html.slim +++ /dev/null @@ -1,10 +0,0 @@ -- if devise_mapping.omniauthable? - .row - .col-md-12 - .pull-left - = t('layout.sessions.sign_up_with') - .pull-right - - resource_class.omniauth_providers.each do |provider| - a.text-muted> href=omniauth_authorize_path(resource_name, provider) - - provider = provider.to_s.gsub(/_oauth2/,'-plus') - i.fa.fa-2x class="fa-#{provider}-square" \ No newline at end of file diff --git a/app/views/home/_activity_tabsets.html.slim b/app/views/home/_activity_tabsets.html.slim index 1b8084129..8532bc437 100644 --- a/app/views/home/_activity_tabsets.html.slim +++ b/app/views/home/_activity_tabsets.html.slim @@ -1,7 +1,4 @@ div ng-hide= 'actCtrl.processing' - tabset - - (collection = t 'feed_menu').each do |base, title| - tab heading= title active= (@filter == base) select= "actCtrl.changeActivityFilter('#{base}')" / The time line .row.offset10 .col-md-12.col-sm-12 diff --git a/app/views/home/_top_menu.html.haml b/app/views/home/_top_menu.html.haml deleted file mode 100644 index 240854e25..000000000 --- a/app/views/home/_top_menu.html.haml +++ /dev/null @@ -1,7 +0,0 @@ -- content_for :feed_tabs do - .sub-menu - %nav - %ul - %li= link_to t('activity_menu.activity_feed'), root_path, class: action_name == 'activity' ? 'active' : '' - %li= link_to t('activity_menu.tracker'), issues_path, class: action_name == 'issues' ? 'active' : '' - %li= link_to t('activity_menu.pull_requests'), pull_requests_path, class: action_name == 'pull_requests' ? 'active' : '' \ No newline at end of file diff --git a/app/views/home/_tracker_and_pulls_tabs.html.slim b/app/views/home/_tracker_and_pulls_tabs.html.slim deleted file mode 100644 index 304651f9d..000000000 --- a/app/views/home/_tracker_and_pulls_tabs.html.slim +++ /dev/null @@ -1,70 +0,0 @@ -- %w(tracker pull_requests).each do |kind| - tab[ heading= t("activity_menu.#{kind}") - active= "actCtrl.#{kind}_tab.active" - select= "actCtrl.getContent('#{kind}')" ] - .row - .col-md-3.offset10 - ul.nav.nav-pills.nav-stacked - - %w(all assigned created).each do |kind_filter| - li ng-class= "{ active: actCtrl.#{kind}_tab.filter.#{kind_filter} }" - a ng-click= "actCtrl.setIssuesFilter('#{kind}', '#{kind_filter}')" - span.badge.pull-right= "{{ actCtrl.#{kind}_tab.filter.#{kind_filter}_count }}" - = "{{'#{kind}.filter.#{kind_filter}' | i18n}}" - .col-md-9.offset10 - tabset.boffset10 - - %w(open closed).each do |status| - - count_issues = "({{actCtrl.#{kind}_tab.filter.#{status}_count}})" - tab[ heading= "#{t "layout.issues.statuses.#{status}"} #{count_issues}" - active= "actCtrl.#{kind}_tab.status_#{status}" - ng-click= "actCtrl.setIssuesStatus('#{kind}', '#{status}')" ] - - .pull-right.boffset10 - button.btn.btn-default.roffset5[ type= 'button' - ng-click= "actCtrl.setIssuesSort('#{kind}', 'updated')" ] - span.fa ng-class= "actCtrl.#{kind}_tab.sort.updated_class" - => t('layout.issues.sort.updated') - button.btn.btn-default[ type= 'button' - ng-click= "actCtrl.setIssuesSort('#{kind}', 'submitted')" ] - span.fa ng-class= "actCtrl.#{kind}_tab.sort.submitted_class" - => t('layout.issues.sort.submitted') - - table.table - tr ng-repeat= "issue in actCtrl.#{kind}_tab.content" - td - a ng-href= "{{issue.issue_url}}" - span.text-info - = '{{issue.project_name}} ' - | {{issue.title}} - span.label.small.loffset5[ ng-repeat= "label in issue.labels" - ng-style= "{background: label.color}" ] - | {{label.name}} - .small - = t 'layout.issues.created_by' - a>[ ng-href= "{{issue.user.path}}" ] {{issue.user.uname}} - span.text-muted[ ng-show= 'actCtrl.#{kind}_tab.sort.sort == "submitted"' - title= "{{issue.created_at_utc}}" ] - | {{issue.created_at | amDateFormat:'YYYY-MM-DD HH:mm'}} ( - span am-time-ago= 'issue.created_at' - | ) - span> class= 'text-muted' ng-show= 'actCtrl.#{kind}_tab.sort.sort == "updated"' - = t 'layout.issues.updated_at' - span.text-muted[ ng-show= 'actCtrl.#{kind}_tab.sort.sort == "updated"' - title= "{{issue.updated_at_utc}}" ] - | {{issue.updated_at | amDateFormat:'YYYY-MM-DD HH:mm'}} ( - span am-time-ago= 'issue.updated_at' - | ) - td - a ng-href= "{{issue.issue_url + '#comments'}}" - span.fa.fa-comments.text-primary - = " {{issue.comments_count}}" - td - a>[ ng-href= '{{issue.assignee.link}}' - title= "#{t('layout.issues.assigned_to')} {{issue.assignee.fullname}}" ] - img ng-src= '{{issue.assignee.image}}' - span.text-muted.roffset5 - | {{'#' + issue.serial_id}} - - = angularjs_paginate( total_items: "actCtrl.#{kind}_tab.pagination.total_items", - page: "actCtrl.#{kind}_tab.pagination.page", - per_page: Issue.per_page, - select_page: "actCtrl.selectPage('#{kind}', page)" ) diff --git a/app/views/home/activity.html.slim b/app/views/home/activity.html.slim index a9c98e752..6f0e73f56 100644 --- a/app/views/home/activity.html.slim +++ b/app/views/home/activity.html.slim @@ -4,5 +4,4 @@ ng-init= "actCtrl.init('#{action_name}')" ] tabset.offset10 ng-cloak= true == render 'activity_tab' - == render 'tracker_and_pulls_tabs' == render 'own_activity_tab' diff --git a/app/views/home/issues.json.jbuilder b/app/views/home/issues.json.jbuilder deleted file mode 100644 index afe1e89b0..000000000 --- a/app/views/home/issues.json.jbuilder +++ /dev/null @@ -1,38 +0,0 @@ -json.all_count @all_issues.not_closed_or_merged.count -json.open_count @opened_issues.count -json.closed_count @closed_issues.count -json.assigned_count @assigned_issues.not_closed_or_merged.count -json.created_count @created_issues.not_closed_or_merged.count -json.page params[:page] -json.issues_count @issues.count - -json.content do - json.array!(@issues) do |issue| - json.serial_id issue.serial_id - json.project_name issue.project.name - json.title issue.title - json.issue_url polymorphic_path [@project || issue.project, issue.pull_request ? issue.pull_request : issue] - - json.updated_at issue.updated_at - json.updated_at_utc issue.updated_at.strftime('%Y-%m-%d %H:%M:%S UTC') - json.created_at issue.created_at - json.created_at_utc issue.created_at.strftime('%Y-%m-%d %H:%M:%S UTC') - - json.user do - json.link user_path(issue.user) if issue.user - json.uname issue.user.uname if issue.user - end - json.assignee do - json.link user_path(issue.assignee) if issue.assignee - json.image avatar_url(issue.assignee, :micro) if issue.assignee - json.fullname issue.assignee.fullname if issue.assignee - end - json.labels do - json.array!(issue.labels) do |label| - json.name label.name - json.color "##{label.color}" - end - end - json.comments_count issue.comments.where(automatic: false).count - end -end \ No newline at end of file diff --git a/app/views/home/partials/_git_delete_branch_notification.haml b/app/views/home/partials/_git_delete_branch_notification.haml deleted file mode 100644 index bf856518f..000000000 --- a/app/views/home/partials/_git_delete_branch_notification.haml +++ /dev/null @@ -1,12 +0,0 @@ --user= User.where(email: creator_email).first || User.new(email: creator_email) if defined?(creator_email) -.top - .image= link_to(image_tag(avatar_url(user, :small), alt: 'avatar'), user_path(user)) if user.try(:persisted?) - .text - %span - -_user_link = defined?(creator_email) ? user_link(user, defined?(creator_name) ? creator_name : creator_email) : nil - = t('notifications.bodies.delete_branch', branch_name: branch_name, user_link: _user_link).html_safe - - name_with_owner = "#{project_owner}/#{project_name}" - = raw t("notifications.bodies.project", project_link: link_to(name_with_owner, project_path(name_with_owner)) ) - .both - = datetime_moment activity_feed.created_at, tag: :span, class: 'date' - .both diff --git a/app/views/home/partials/_git_delete_branch_notification.json.jbuilder b/app/views/home/partials/_git_delete_branch_notification.json.jbuilder deleted file mode 100644 index a452e00e7..000000000 --- a/app/views/home/partials/_git_delete_branch_notification.json.jbuilder +++ /dev/null @@ -1,2 +0,0 @@ -json.branch_name item.data[:branch_name] -json.project_link project_path(project_name_with_owner) diff --git a/app/views/home/partials/_git_new_push_notification.haml b/app/views/home/partials/_git_new_push_notification.haml deleted file mode 100644 index a791ff342..000000000 --- a/app/views/home/partials/_git_new_push_notification.haml +++ /dev/null @@ -1,21 +0,0 @@ --user= User.where(email: creator_email).first || User.new(email: creator_email) if defined?(creator_email) -- name_with_owner = "#{project_owner}/#{project_name}" -.top - .image= link_to(image_tag(avatar_url(user, :small), alt: 'avatar'), user_path(user)) if user.try(:persisted?) - .text - %span - -_user_link = defined?(creator_email) ? user_link(user, defined?(creator_name) ? creator_name : creator_email) : nil - = raw t("notifications.bodies.#{change_type}_branch", {branch_name: branch_name, user_link: _user_link}) - = raw t("notifications.bodies.project", project_link: link_to(name_with_owner, project_path(name_with_owner)) ) - .both - = datetime_moment activity_feed.created_at, tag: :span, class: 'date' - .both - %span.subject - - last_commits.each do |commit| - = link_to shortest_hash_id(commit[0]), commit_path(name_with_owner, commit[0]) - = commit[1] - %br - - if defined? other_commits - %br - =link_to t('notifications.bodies.more_commits', count: other_commits_count, commits: commits_pluralize(other_commits_count)), - diff_path(name_with_owner, diff: other_commits) diff --git a/app/views/home/partials/_git_new_push_notification.json.jbuilder b/app/views/home/partials/_git_new_push_notification.json.jbuilder deleted file mode 100644 index 06e936b83..000000000 --- a/app/views/home/partials/_git_new_push_notification.json.jbuilder +++ /dev/null @@ -1,16 +0,0 @@ -json.change_type item.data[:change_type] -json.project_link project_path(project_name_with_owner) -json.branch_name item.data[:branch_name] -json.branch_link ref_path(@project, item.data[:branch_name]) - -json.last_commits do - json.array! item.data[:last_commits] do |commit| - json.hash shortest_hash_id(commit[0]) - json.message markdown(short_message(commit[1], 70)) - json.link commit_path(project_name_with_owner, commit[0]) - end -end -if item.data[:other_commits].present? - json.other_commits t('notifications.bodies.more_commits', count: item.data[:other_commits_count], commits: commits_pluralize(item.data[:other_commits_count])) - json.other_commits_path diff_path(project_name_with_owner, diff: item.data[:other_commits]) -end diff --git a/app/views/home/partials/_issue_assign_notification.haml b/app/views/home/partials/_issue_assign_notification.haml deleted file mode 100644 index 2dce880d9..000000000 --- a/app/views/home/partials/_issue_assign_notification.haml +++ /dev/null @@ -1,9 +0,0 @@ -.top - .text - %span - - name_with_owner = "#{project_owner}/#{project_name}" - = raw t("notifications.bodies.issue_assign_notification", { issue_link: link_to(issue_title, project_issue_path(name_with_owner, issue_serial_id))}) - = raw t("notifications.bodies.project", project_link: link_to(name_with_owner, project_path(name_with_owner)) ) - .both - = datetime_moment activity_feed.created_at, tag: :span, class: 'date' - .both diff --git a/app/views/home/partials/_issue_assign_notification.json.jbuilder b/app/views/home/partials/_issue_assign_notification.json.jbuilder deleted file mode 100644 index 4558d2b8f..000000000 --- a/app/views/home/partials/_issue_assign_notification.json.jbuilder +++ /dev/null @@ -1,5 +0,0 @@ -json.project_link project_path(project_name_with_owner) -json.issue do - json.title item.data[:issue_title] - json.link project_issue_path(project_name_with_owner, item.data[:issue_serial_id]) if item.data[:issue_serial_id].present? -end diff --git a/app/views/home/partials/_new_comment_commit_notification.haml b/app/views/home/partials/_new_comment_commit_notification.haml deleted file mode 100644 index 5d2cd01b4..000000000 --- a/app/views/home/partials/_new_comment_commit_notification.haml +++ /dev/null @@ -1,13 +0,0 @@ --user= User.where(email: creator_email).first || User.new(email: creator_email) if defined?(creator_email) -- name_with_owner = "#{project_owner}/#{project_name}" -.top - .image= link_to(image_tag(avatar_url(user, :small), alt: 'avatar'), user_path(user)) if user.persisted? - .text - %span - = raw t("notifications.bodies.new_comment_notification.title", user_link: user_link(user, creator_name)) - = raw t("notifications.bodies.new_comment_notification.commit_content", {commit_link: link_to(commit_message, commit_path(name_with_owner, commit_id) + "#comment#{comment_id}")}) - = raw t("notifications.bodies.project", project_link: link_to(name_with_owner, project_path(name_with_owner)) ) - .both - = datetime_moment activity_feed.created_at, tag: :span, class: 'date' - .both - %span.subject= comment_body diff --git a/app/views/home/partials/_new_comment_commit_notification.json.jbuilder b/app/views/home/partials/_new_comment_commit_notification.json.jbuilder deleted file mode 100644 index a915ae810..000000000 --- a/app/views/home/partials/_new_comment_commit_notification.json.jbuilder +++ /dev/null @@ -1,8 +0,0 @@ -json.project_link project_path(project_name_with_owner) -json.commit do - json.link commit_path(project_name_with_owner, item.data[:commit_id]) if item.data[:commit_id].present? - json.hash shortest_hash_id(item.data[:commit_id]) - json.message markdown(short_message(item.data[:commit_message], 70)) - json.read_more item.data[:comment_id] -end -json.body markdown(short_message(item.data[:comment_body], 100)) diff --git a/app/views/home/partials/_new_comment_notification.haml b/app/views/home/partials/_new_comment_notification.haml deleted file mode 100644 index 3a961e0ac..000000000 --- a/app/views/home/partials/_new_comment_notification.haml +++ /dev/null @@ -1,13 +0,0 @@ --user= User.where(email: creator_email).first || User.new(email: creator_email) if defined?(creator_email) -- name_with_owner = "#{project_owner}/#{project_name}" -.top - .image= link_to(image_tag(avatar_url(user, :small), alt: 'avatar'), user_path(user)) if user.persisted? - .text - %span - = raw t("notifications.bodies.new_comment_notification.title", {user_link: user_link(user, creator_name)}) - = raw t("notifications.bodies.new_comment_notification.content", {issue_link: link_to(issue_title, project_issue_path(name_with_owner, issue_serial_id) + "#comment#{comment_id}")}) - = raw t("notifications.bodies.project", project_link: link_to(name_with_owner, project_path(name_with_owner)) ) - .both - = datetime_moment activity_feed.created_at, tag: :span, class: 'date' - .both - %span.subject= comment_body diff --git a/app/views/home/partials/_new_comment_notification.json.jbuilder b/app/views/home/partials/_new_comment_notification.json.jbuilder deleted file mode 100644 index 33b71a07e..000000000 --- a/app/views/home/partials/_new_comment_notification.json.jbuilder +++ /dev/null @@ -1,14 +0,0 @@ -json.issue do - if item.data[:issue_serial_id].present? - is_pull = @project.issues.where(serial_id: item.data[:issue_serial_id]).joins(:pull_request).exists? - json.is_pull is_pull - if is_pull - json.link project_pull_request_path(project_name_with_owner, item.data[:issue_serial_id]) - else - json.link project_issue_path(project_name_with_owner, item.data[:issue_serial_id]) - end - end - json.title short_message(item.data[:issue_title], 50) - json.read_more item.data[:comment_id] -end -json.body markdown(short_message(item.data[:comment_body], 100)) diff --git a/app/views/home/partials/_new_issue_notification.haml b/app/views/home/partials/_new_issue_notification.haml deleted file mode 100644 index cb7055854..000000000 --- a/app/views/home/partials/_new_issue_notification.haml +++ /dev/null @@ -1,13 +0,0 @@ --user= User.where(email: creator_email).first || User.new(email: creator_email) if defined?(creator_email) -- name_with_owner = "#{project_owner}/#{project_name}" -- issue_path = issue_serial_id.present? ? project_issue_path(name_with_owner, issue_serial_id) : '#' -.top - .image= link_to(image_tag(avatar_url(user, :small), alt: 'avatar'), user_path(user)) if user.persisted? - .text - %span - = raw t("notifications.bodies.new_issue_notification", { user_link: user_link(user, creator_name), issue_link: issue_path }) - = raw t("notifications.bodies.project", project_link: link_to(name_with_owner, project_path(name_with_owner)) ) - .both - = datetime_moment activity_feed.created_at, tag: :span, class: 'date' - .both - %span.subject= issue_title diff --git a/app/views/home/partials/_new_issue_notification.json.jbuilder b/app/views/home/partials/_new_issue_notification.json.jbuilder deleted file mode 100644 index 7e80813f7..000000000 --- a/app/views/home/partials/_new_issue_notification.json.jbuilder +++ /dev/null @@ -1,14 +0,0 @@ -json.project_link project_path(project_name_with_owner) -json.issue do - json.title item.data[:issue_title] - - if item.data[:issue_serial_id].present? - is_pull = @project.issues.where(serial_id: item.data[:issue_serial_id]).joins(:pull_request).exists? - json.is_pull is_pull - if is_pull - json.link project_pull_request_path(project_name_with_owner, item.data[:issue_serial_id]) - else - json.link project_issue_path(project_name_with_owner, item.data[:issue_serial_id]) - end - end -end diff --git a/app/views/home/partials/_new_user_notification.haml b/app/views/home/partials/_new_user_notification.haml deleted file mode 100644 index 4be8329ed..000000000 --- a/app/views/home/partials/_new_user_notification.haml +++ /dev/null @@ -1,16 +0,0 @@ -.top - .image - = image_tag(avatar_url_by_email(activity_feed.user.email, :small), alt: 'avatar') - .text - %span.name - = link_to activity_feed.user.uname, user_path(activity_feed.user.uname) - .both - = datetime_moment activity_feed.created_at, tag: :span, class: 'date' - .both - .both - %span.subject #{ t("notifications.bodies.new_user_notification.title", user_name: user_name) } - .both -.fulltext - #{ t("notifications.bodies.new_user_notification.content") } - %br - #{ t("notifications.bodies.new_user_notification.email", user_email: user_email) } diff --git a/app/views/home/partials/_new_user_notification.json.jbuilder b/app/views/home/partials/_new_user_notification.json.jbuilder deleted file mode 100644 index 7425d5ea8..000000000 --- a/app/views/home/partials/_new_user_notification.json.jbuilder +++ /dev/null @@ -1 +0,0 @@ -json.user_name item.data[:user_name] diff --git a/app/views/home/partials/_wiki_new_commit_notification.haml b/app/views/home/partials/_wiki_new_commit_notification.haml deleted file mode 100644 index 53b7f5d0d..000000000 --- a/app/views/home/partials/_wiki_new_commit_notification.haml +++ /dev/null @@ -1,11 +0,0 @@ --user= User.where(email: creator_email).first || User.new(email: creator_email) if defined?(creator_email) -- name_with_owner = "#{project_owner}/#{project_name}" -.top - .image= link_to(image_tag(avatar_url(user, :small), alt: 'avatar'), user_path(user)) if user.persisted? - .text - %span - = raw t("notifications.bodies.wiki_new_commit_notification", {user_link: user_link(user, creator_name), history_link: link_to("wiki", history_project_wiki_index_path(name_with_owner))}) - = raw t("notifications.bodies.project", project_link: link_to(name_with_owner, project_path(name_with_owner)) ) - .both - = datetime_moment activity_feed.created_at, tag: :span, class: 'date' - .both diff --git a/app/views/home/partials/_wiki_new_commit_notification.json.jbuilder b/app/views/home/partials/_wiki_new_commit_notification.json.jbuilder deleted file mode 100644 index 8eef90cc2..000000000 --- a/app/views/home/partials/_wiki_new_commit_notification.json.jbuilder +++ /dev/null @@ -1,2 +0,0 @@ -json.wiki_link history_project_wiki_index_path(project_name_with_owner) -json.project_link project_path(project_name_with_owner) diff --git a/app/views/layouts/_counters.html.erb b/app/views/layouts/_counters.html.erb deleted file mode 100644 index ba1806fdf..000000000 --- a/app/views/layouts/_counters.html.erb +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - diff --git a/app/views/layouts/menu/_bottom.html.haml b/app/views/layouts/menu/_bottom.html.haml deleted file mode 100644 index 983f73535..000000000 --- a/app/views/layouts/menu/_bottom.html.haml +++ /dev/null @@ -1,25 +0,0 @@ -%ul - %li - = image_tag 'square.png' - = t('bottom_menu.copyright', year: Date.today.year) - %li - = image_tag 'square.png' - = image_tag 'flag.png', alt: 'flag' - %li - = image_tag 'square.png' - = link_to t('bottom_menu.about'), t('bottom_menu.about_url') - %li - = image_tag 'square.png' - = link_to t('bottom_menu.contacts'), t('bottom_menu.contacts_url') - %li - = image_tag 'square.png' - = link_to t('bottom_menu.tos'), tos_url #t('bottom_menu.tos_url') - %li - = image_tag 'square.png' - = link_to t('bottom_menu.support'), contact_url - %li - = image_tag 'square.png' - = link_to t('bottom_menu.developer_api'), t('bottom_menu.developer_api_url') - %li - = image_tag 'square.png' - = link_to t('bottom_menu.abf_blog'), t('bottom_menu.abf_blog_url') \ No newline at end of file diff --git a/app/views/layouts/menu/_new_bottom.html.haml b/app/views/layouts/menu/_new_bottom.html.haml index 76fbead0a..c60795278 100644 --- a/app/views/layouts/menu/_new_bottom.html.haml +++ b/app/views/layouts/menu/_new_bottom.html.haml @@ -2,8 +2,6 @@ %ul %li= t('bottom_menu.copyright', year: Date.today.year) %li · - %li= image_tag 'flag.png', alt: 'flag' - %li · %li= link_to t('bottom_menu.about'), t('bottom_menu.about_url') %li · %li= link_to t('bottom_menu.contacts'), t('bottom_menu.contacts_url') diff --git a/app/views/layouts/menu/_top.html.haml b/app/views/layouts/menu/_top.html.haml deleted file mode 100644 index d3cbaddf0..000000000 --- a/app/views/layouts/menu/_top.html.haml +++ /dev/null @@ -1,7 +0,0 @@ -- namespace = which_menu == 'admins_menu' ? 'admin_' : '' -%ul - - (collection = t which_menu).each do |base, title| - - if policy(base).index? - %li= link_to title, send(:"#{namespace}#{base}_path"), class: top_menu_class(base) - - if current_user.try(:admin?) and which_menu == 'top_menu' - %li= link_to t('admins_menu_header'), admin_root_path, class: top_menu_class('admin') \ No newline at end of file diff --git a/app/views/pages/tour/_entry.html.slim b/app/views/pages/tour/_entry.html.slim deleted file mode 100644 index f0fd65b18..000000000 --- a/app/views/pages/tour/_entry.html.slim +++ /dev/null @@ -1,28 +0,0 @@ -.row - - - if is_left - .col-md-6 - h3.text-primary - = t("tour.#{entry}") - p.text-muted - = t("tour.#{entry}_description_html") - - .col-md-6 - a.btn-link data-toggle="modal" data-target="##{entry}Modal" - = image_tag "tour/#{entry}.png", class: 'img-responsive center-block img-rounded' - - else - .col-md-6 - a.btn-link data-toggle="modal" data-target="##{entry}Modal" - = image_tag "tour/#{entry}.png", class: 'img-responsive center-block img-rounded' - - .col-md-6 - h3.text-primary - = t("tour.#{entry}") - p.text-muted - = t("tour.#{entry}_description_html") - - .modal.fade id="#{entry}Modal" tabindex="-1" role="dialog" aria-hidden="true" - .modal-dialog - .modal-content - .modal-body - = image_tag "tour/big/#{entry}.png", class: 'img-responsive center-block img-rounded' diff --git a/app/views/pages/tour/_submenu.html.slim b/app/views/pages/tour/_submenu.html.slim deleted file mode 100644 index 78108729d..000000000 --- a/app/views/pages/tour/_submenu.html.slim +++ /dev/null @@ -1,4 +0,0 @@ -ul.nav.nav-tabs - - %w(projects sources builds).each do |entry| - li role='presentation' class=('active' if params[:id] == entry) - = link_to t("tour.#{entry}"), tour_inside_path(entry) diff --git a/app/views/pages/tour/abf-tour-project-description-1.html.slim b/app/views/pages/tour/abf-tour-project-description-1.html.slim deleted file mode 100644 index 86c927dd5..000000000 --- a/app/views/pages/tour/abf-tour-project-description-1.html.slim +++ /dev/null @@ -1,66 +0,0 @@ -- set_meta_tags og: { title: facebook_site_name, description: t('tour.meta_description') } -- set_meta_tags twitter: { title: facebook_site_name, description: t('tour.meta_description') } - -.row - .col-md-8.col-md-offset-2 - .row - = image_tag "tour-top#{I18n.locale == :en ? '-eng' : ''}.png", alt: 'ABF', class: 'img-responsive center-block img-rounded' - - .row.offset10 - .col-md-6 - a.btn-link data-toggle="modal" data-target="#controlModal" - = image_tag 'tour/control.png', class: 'img-responsive center-block img-rounded' - - .modal.fade#controlModal tabindex="-1" role="dialog" aria-hidden="true" - .modal-dialog - .modal-content - .modal-body - = image_tag 'tour/big/control.png', class: 'img-responsive center-block img-rounded' - - .col-md-6 - h3 - a href=tour_inside_path('projects') - = t('tour.projects') - p.text-muted - = t('tour.projects_header') - = link_to t('tour.read_more'), tour_inside_path('projects') - - hr - .row - .col-md-6 - h3 - a href=tour_inside_path('sources') - = t('tour.sources') - p.text-muted - = t('tour.sources_header') - = link_to t('tour.read_more'), tour_inside_path('sources') - - .col-md-6 - a.btn-link data-toggle="modal" data-target="#sourceModal" - = image_tag 'tour/source.png', class: 'img-responsive center-block img-rounded' - - .modal.fade#sourceModal tabindex="-1" role="dialog" aria-hidden="true" - .modal-dialog - .modal-content - .modal-body - = image_tag 'tour/big/source.png', class: 'img-responsive center-block img-rounded' - - hr - .row - .col-md-6 - a.btn-link data-toggle="modal" data-target="#monitoringModal" - = image_tag 'tour/monitoring.png', class: 'img-responsive center-block img-rounded' - - .modal.fade#monitoringModal tabindex="-1" role="dialog" aria-hidden="true" - .modal-dialog - .modal-content - .modal-body - = image_tag 'tour/big/monitoring.png', class: 'img-responsive center-block img-rounded' - - .col-md-6 - h3 - a href=tour_inside_path('builds') - = t('tour.builds') - p.text-muted - = t('tour.builds_header') - = link_to t('tour.read_more'), tour_inside_path('builds') diff --git a/app/views/pages/tour/tour-inside.html.slim b/app/views/pages/tour/tour-inside.html.slim deleted file mode 100644 index 00487d71f..000000000 --- a/app/views/pages/tour/tour-inside.html.slim +++ /dev/null @@ -1,15 +0,0 @@ -- set_meta_tags og: { title: facebook_site_name, description: t('tour.meta_description') } -- set_meta_tags twitter: { title: facebook_site_name, description: t('tour.meta_description') } - -.row - .col-md-8.col-md-offset-2 - .row - = image_tag "tour-top#{I18n.locale == :en ? '-eng' : ''}.png", alt: 'ABF', class: 'img-responsive center-block img-rounded' - - .row.offset10 - = render 'pages/tour/submenu' - .offset10 - - - @entries.each_with_index do |el, ind| - = render partial: 'pages/tour/entry', locals: {entry: el, is_left: ind.odd?} - hr diff --git a/app/views/platforms/base/_submenu.html.slim b/app/views/platforms/base/_submenu.html.slim index 3e6567457..1d44f7b4a 100644 --- a/app/views/platforms/base/_submenu.html.slim +++ b/app/views/platforms/base/_submenu.html.slim @@ -30,9 +30,6 @@ - if policy(@platform.products.build).show? li class=('active' if contr == :products) = link_to t("layout.products.list_header"), platform_products_path(@platform) - - if policy(@platform.advisories.build).show? - li class=('active' if contr == :platforms && act == :advisories) - = link_to t("layout.advisories.list_header"), advisories_platform_path(@platform) - if policy(@platform).update? li class=('active' if act == :edit && contr == :platforms) = link_to t("platform_menu.settings"), edit_platform_path(@platform) diff --git a/app/views/platforms/platforms/_advisories.html.slim b/app/views/platforms/platforms/_advisories.html.slim deleted file mode 100644 index 324aa005b..000000000 --- a/app/views/platforms/platforms/_advisories.html.slim +++ /dev/null @@ -1,7 +0,0 @@ -table.table.table-striped - thead - tr - th= t("activerecord.attributes.advisory.advisory_id") - th= t("activerecord.attributes.advisory.description") - tbody - = render partial: 'advisory', collection: @advisories, as: :advisory diff --git a/app/views/platforms/platforms/_advisory.html.slim b/app/views/platforms/platforms/_advisory.html.slim deleted file mode 100644 index 96ea085c8..000000000 --- a/app/views/platforms/platforms/_advisory.html.slim +++ /dev/null @@ -1,3 +0,0 @@ -tr - td= link_to advisory.advisory_id, advisory_path(advisory) - td= truncate(advisory.description, length: 120) diff --git a/app/views/platforms/platforms/advisories.html.slim b/app/views/platforms/platforms/advisories.html.slim deleted file mode 100644 index 30dd83d9f..000000000 --- a/app/views/platforms/platforms/advisories.html.slim +++ /dev/null @@ -1,10 +0,0 @@ -- set_meta_tags title: [title_object(@platform), t('layout.advisories.list_header')] -- title = t('layout.advisories.list_header') + ' - ' + title_object(@platform) -- set_meta_tags og: { title: title, description: t('layout.advisories.search') } -- set_meta_tags twitter: { title: title, description: t('layout.advisories.search') } -== render 'submenu' - -.col-xs-12.col-md-10.col-md-offset-1 - .row - == render partial: 'advisories', object: @advisories - = will_paginate @advisories diff --git a/app/views/projects/base/_about_block.html.haml b/app/views/projects/base/_about_block.html.haml deleted file mode 100644 index ecd7ec742..000000000 --- a/app/views/projects/base/_about_block.html.haml +++ /dev/null @@ -1,3 +0,0 @@ -- if project.description.present? - %h3= t 'layout.projects.about_subheader' - %p= simple_format project.description diff --git a/app/views/projects/base/_branch_select.html.slim b/app/views/projects/base/_branch_select.html.slim deleted file mode 100644 index 78e0857d9..000000000 --- a/app/views/projects/base/_branch_select.html.slim +++ /dev/null @@ -1,7 +0,0 @@ -p.navbar-text.navbar-left.current_branch - = t('layout.projects.current_branch') - | : -form.navbar-form.navbar-left - .form-group - = select_tag :branch, branch_selector_options(project), id: 'branch_selector', class: 'form-control' -form action='' method='get' id='branch_changer' data-action=controller_name diff --git a/app/views/projects/base/_layout.html.slim b/app/views/projects/base/_layout.html.slim deleted file mode 100644 index 07494f0e2..000000000 --- a/app/views/projects/base/_layout.html.slim +++ /dev/null @@ -1,14 +0,0 @@ -== render 'submenu' -.col-xs-12.col-md-10.col-md-offset-1 - .row - == render 'repo_block', project: @project - == render 'about_block', project: @project - - - if @commit.present? - h3= t('layout.projects.last_commit') - - GitPresenters::CommitAsMessagePresenter.present(@commit, project: @project) do |presenter| - .panel.panel-default - .panel-body - == render 'shared/feed_commit', presenter: presenter, item_no: 1 - .clearfix - == yield diff --git a/app/views/projects/base/_repo_block.html.slim b/app/views/projects/base/_repo_block.html.slim deleted file mode 100644 index 060f2777c..000000000 --- a/app/views/projects/base/_repo_block.html.slim +++ /dev/null @@ -1,86 +0,0 @@ -- act = action_name.to_sym; contr = controller_name.to_sym; treeish = project.default_head(params[:treeish]); branch = @branch.try(:name) || project.default_head --http_url = git_repo_url(project.name_with_owner) --ssh_url = git_ssh_repo_url(project.name_with_owner) - -div[ role = 'navigation' ng-controller = 'ProjectRepoBlockController' ng-cloak = true - ng-init = "init('#{ssh_url}', #{project.repo.branches.count})" ] - nav.navbar.navbar-default - .container-fluid - / Brand and toggle get grouped for better mobile display - .navbar-header - button.navbar-toggle[ data-target = '#repo-block-navbar-collapse' data-toggle = 'collapse' type = 'button' ] - span.sr-only Toggle navigation - span.icon-bar - span.icon-bar - span.icon-bar - / Collect the nav links, forms, and other content for toggling - #repo-block-navbar-collapse.collapse.navbar-collapse - ul.nav.navbar-nav - li.dropdown - a.dropdown href = '#' data-toggle = 'dropdown' - = fa_icon 'file-archive-o', class: 'fa-lg' - span.caret - ul.dropdown-menu role = 'menu' - - file_name = "#{@project.name}-#{treeish}" - li= link_to 'tar.gz', archive_path(project, file_name, 'tar.gz') - li= link_to 'zip', archive_path(project, file_name, 'zip') - .navbar-left - button.btn.navbar-btn.btn-default[ type = 'button' ng-click = "clone_url = '#{http_url}'" - ng-model = "clone_url_protocol" btn-radio = "'http'" - ng-class = '{"btn-info": clone_url_protocol == "http"}' ] HTTP - button.btn.navbar-btn.btn-default[ type = 'button' ng-click = "clone_url = '#{ssh_url}'" - ng-model = "clone_url_protocol" btn-radio = "'ssh'" - ng-class = '{"btn-info": clone_url_protocol == "ssh"}'] SSH - #git-help.navbar-text.navbar-left - a.navbar-link ng-click = 'is_collapsed_git_help = !is_collapsed_git_help' - = fa_icon 'question', class: 'fa-lg' - - form#clone_url.navbar-form.navbar-left - .form-group - input#clone-url.form-control[ readonly = 'readonly' spellcheck = false - type = 'text' ng-model = 'clone_url' ] - .navbar-text.navbar-left title = t('layout.projects.git_help.question_title') - a#copy_to_clipboard.navbar-link data-clipboard-target = 'clone-url' - i.fa.fa-clipboard.fa-lg - - .navbar-text.navbar-left - = policy(project).write? ? t("layout.read_write_access") : t("layout.read_access") - - .navbar-right== render 'branch_select', project: project if act != :tags - - div collapse = "is_collapsed_git_help" - .container - p= t("layout.projects.git_help.cloning") + ":" - p - - if current_user - p[ ng-hide = 'clone_url_protocol == "ssh"']~ "git clone #{http_url} #{project.name}" - p[ ng-hide = 'clone_url_protocol == "http"']~ "git clone #{ssh_url} #{project.name}" - p~ "cd #{project.name}" - p - p= t("layout.projects.git_help.remote") + ":" - p - - if current_user - p[ ng-hide = 'clone_url_protocol == "ssh"' ]~ "git remote add #{project.name} #{http_url}" - p[ ng-hide = 'clone_url_protocol == "http"' ]~ "git remote add #{project.name} #{ssh_url}" - p~ "git fetch #{project.name}" - p~ "git checkout -b my-local-tracking-branch #{project.name}/master_or_other_branch" - - .container - .row - ul.nav.nav-tabs role = 'tablist' - li class = ('active' if act == :show && contr == :trees ) - a href=tree_path(project, treeish) - i.fa.fa-files-o> - = t('project_menu.files') - li class = ('active' if act == :index && contr == :commits ) - a href=commits_path(project, treeish) - i.fa.fa-history> - = t('project_menu.commits') - li class = ('active' if act == :branches && contr == :trees ) - a href=branch_path(project, branch) - i.fa.fa-code-fork> - = t('project_menu.branches', count: '{{singleton.project.branches_count}}') - li.tags class = ('active' if act == :tags && contr == :trees ) - a href=tags_path(project) - i.fa.fa-tag> - = t('project_menu.tags', count: project.repo.tags.count) diff --git a/app/views/projects/base/_settings_menu.html.slim b/app/views/projects/base/_settings_menu.html.slim deleted file mode 100644 index 930bc6977..000000000 --- a/app/views/projects/base/_settings_menu.html.slim +++ /dev/null @@ -1,10 +0,0 @@ -- act = action_name.to_sym -- contr = controller_name.to_sym - -ul.nav.nav-tabs.nav-justified.boffset10[ role = 'tablist' ] - - if policy(@project).edit? - li[ class = "#{(act == :edit && contr == :projects) ? 'active' : ''}" ] - = link_to t("layout.projects.edit"), edit_project_path(@project) - - if policy(@project).manage_collaborators? - li[ class = "#{(act == :index && contr == :collaborators) ? 'active' : ''}" ] - = link_to t("layout.projects.edit_collaborators"), project_collaborators_path(@project) diff --git a/app/views/projects/base/_submenu.html.slim b/app/views/projects/base/_submenu.html.slim index ff7e6cf7f..9ce642d7c 100644 --- a/app/views/projects/base/_submenu.html.slim +++ b/app/views/projects/base/_submenu.html.slim @@ -19,10 +19,6 @@ / Collect the nav links, forms, and other content for toggling #submenu-navbar-collapse.collapse.navbar-collapse ul.nav.navbar-nav.left-border - li class=('active' if act == :index && contr == :project) - a href=("/"+@project.name_with_owner) - i.fa.fa-files-o> - = t("project_menu.project") - if @project.is_package li class=('active' if contr == :build_lists) a href=project_build_lists_path(@project) @@ -44,8 +40,6 @@ a href=(github_base_url + "/wiki") target="_blank" i.fa.fa-book> = t('project_menu.wiki') - / li - / = link_to t('project_menu.readme'), '#' #pending - if policy(@project).update? li class=('active' if act.in?(%i[edit update sections]) && contr == :projects) a href=edit_project_path(@project) diff --git a/app/views/projects/build_lists/_advisory.html.slim b/app/views/projects/build_lists/_advisory.html.slim deleted file mode 100644 index fa568cc2e..000000000 --- a/app/views/projects/build_lists/_advisory.html.slim +++ /dev/null @@ -1,48 +0,0 @@ -- if build_list.save_to_platform.released - tr ng-show='build_list.can_publish && !build_list.advisory' - td= t('layout.build_lists.attached_advisory') - td - = select_tag :attach_advisory, - advisories_select_options(advisories), - 'ng-model' => 'attach_advisory', - 'ng-change' => 'attachAdvisoryChanged()' - p.help-block - = t('layout.advisories.publication_info', - update_types: BuildList::RELEASE_UPDATE_TYPES.join(', ')) - - tr ng-show='attach_advisory != "no" && attach_advisory != "new"' - td - i - = t('layout.advisories.search_hint') - td - input.form-control type='text' ng-model='term' ng-keyup='search()' - p.help-block - = t('layout.advisories.advisory_id_info', - advisory_format: advisory_id_for_hint) - - I18n.t('layout.advisories.banners').keys.each do |key| - .info class=key ng-show="search_status == '#{key}'" - p.help-block - = t("layout.advisories.banners.#{key}") - - tr ng-show='attach_advisory == "new"' - td colspan=2 - = f.fields_for build_list.build_advisory do |f| - = render partial: 'advisories/form', locals: {f: f} - - tr.alert.alert-info ng-show='attach_advisory != "no" && attach_advisory != "new"' - td colspan=2 - .row - .col-md-4 - i=t('activerecord.models.advisory') - .col-md-8 - b - | {{advisory.advisory_id}} - .row - .col-md-4 - i= t('activerecord.attributes.advisory.description') - .col-md-8 ng-bind-html='advisory.description' - .row - .col-md-4 - i= t('activerecord.attributes.advisory.references') - .col-md-8 - | {{advisory.references}} \ No newline at end of file diff --git a/app/views/projects/build_lists/new_build/_new_form.html.haml b/app/views/projects/build_lists/new_build/_new_form.html.haml index ae0b3510d..ee762feb9 100644 --- a/app/views/projects/build_lists/new_build/_new_form.html.haml +++ b/app/views/projects/build_lists/new_build/_new_form.html.haml @@ -30,10 +30,6 @@ name: 'arches[]' } {{ arch.name }} - %h4.offset10= t 'activerecord.attributes.build_list.update_type' - - selected = params[:build_list].try(:[], :update_type) ? {selected: params[:build_list][:update_type]} : {} - = f.select :update_type, BuildList::UPDATE_TYPES, selected, class: 'form-control boffset10' - %div{ 'ng-hide' => 'newBuildCtrl.is_build_for_main_platform' } = render 'shared/autocomplete_form', field: :ExtraRepositories, diff --git a/app/views/projects/build_lists/show.html.slim b/app/views/projects/build_lists/show.html.slim index 4c70cbde5..76257d248 100644 --- a/app/views/projects/build_lists/show.html.slim +++ b/app/views/projects/build_lists/show.html.slim @@ -9,7 +9,6 @@ = render 'submenu' row[ ng-controller='BuildListController' - ng-init ="advisoriable_types = #{ BuildList::RELEASE_UPDATE_TYPES }" ng-cloak =true ] = hidden_field_tag :build_list_id, @build_list.id .col-md-8.col-md-offset-2.alert.alert-info @@ -77,25 +76,6 @@ row[ ng-controller='BuildListController' td= t('activerecord.attributes.build_list.include_repos') td= Repository.where(id: @build_list.include_repos).pluck(:name).join(', ') - tr - td= t('activerecord.attributes.build_list.update_type') - td - = f.select :update_type, - options_for_select(build_list_classified_update_types, - @build_list.update_type), - {}, - 'ng-model' => 'build_list.update_type', - 'ng-change' => 'updateTypeChanged()', - 'ng-show' => 'build_list.can_publish' - div ng-hide='build_list.can_publish' - = @build_list.update_type - - tr - td.offset10.ng-hide ng-show='update_type_errors' colspan=2 - .flash_notify - .alert ng-class="{ 'alert-danger': update_type_errors }" - | {{ update_type_errors }} - tr td= t('activerecord.attributes.build_list.auto_publish_status') td= t("layout.build_lists.auto_publish_status.#{@build_list.auto_publish_status}") @@ -152,10 +132,6 @@ row[ ng-controller='BuildListController' td= t('activerecord.attributes.build_list.is_circle') td= t("layout.#{@build_list.is_circle?}_") - tr - td= t('activerecord.attributes.build_list.new_core') - td= t("layout.#{@build_list.new_core?}_") - - if @build_list.extra_build_lists.present? || @build_list.extra_repositories.present? tr td= t('activerecord.attributes.build_list.extra_repositories') @@ -186,19 +162,11 @@ row[ ng-controller='BuildListController' = link_to @build_list.mass_build.name, platform_mass_build_path(@build_list.save_to_platform, @build_list.mass_build_id) - tr ng-show='build_list.advisory' - td= t('layout.build_lists.attached_advisory') - td - a ng-href='{{build_list.advisory.path}}' - | {{build_list.advisory.advisory_id}} - tr ng-show='build_list.human_duration' td td | {{build_list.human_duration }} - = render 'advisory', build_list: @build_list, advisories: @advisories, f: f - tr.alert.alert-danger ng-hide='build_list.extra_build_lists_published' td colspan=2 = t('layout.build_lists.publish_with_extra_fail') @@ -224,7 +192,6 @@ row[ ng-controller='BuildListController' = render 'item_groups' = render 'packages' - - if @build_list.new_core? - .row - hr - = render 'shared/build_results', subject: @build_list + .row + hr + = render 'shared/build_results', subject: @build_list diff --git a/app/views/projects/build_lists/show.json.jbuilder b/app/views/projects/build_lists/show.json.jbuilder index 62ebb5387..5d3235929 100644 --- a/app/views/projects/build_lists/show.json.jbuilder +++ b/app/views/projects/build_lists/show.json.jbuilder @@ -7,7 +7,6 @@ json.build_list do json.cache! [@build_list, current_user], expires_in: 1.minute do json.(@build_list, :id, :container_status, :status) - json.(@build_list, :update_type) json.updated_at @build_list.updated_at json.updated_at_utc @build_list.updated_at.strftime('%Y-%m-%d %H:%M:%S UTC') @@ -34,11 +33,6 @@ json.build_list do json.path user_path(@build_list.builder) end if @build_list.builder && (!@build_list.builder.system? || current_user.try(:admin?)) - json.advisory do - json.(@build_list.advisory, :description, :advisory_id) - json.path advisory_path(@build_list.advisory) - end if @build_list.advisory - json.results @build_list.results do |result| json.file_name result['file_name'] json.sha1 result['sha1'] @@ -47,7 +41,7 @@ json.build_list do json.created_at Time.zone.at(result['timestamp']).to_s if result['timestamp'] json.url file_store_results_url(result['sha1'], result['file_name']) - end if @build_list.new_core? && @build_list.results.present? + end if @build_list.results.present? dependent_projects_exists = false json.packages @build_list.packages do |package| diff --git a/app/views/projects/collaborators/_collaborator.json.jbuilder b/app/views/projects/collaborators/_collaborator.json.jbuilder deleted file mode 100644 index b922ee911..000000000 --- a/app/views/projects/collaborators/_collaborator.json.jbuilder +++ /dev/null @@ -1,8 +0,0 @@ -json.(collaborator, :id, :actor_name, :actor_type, :actor_id, :role) - -json.avatar avatar_url(collaborator.actor) -json.path participant_path(collaborator.actor) - -if defined? success - json.message t('flash.collaborators.successfully_added', uname: collaborator.actor.uname) -end diff --git a/app/views/projects/collaborators/_collaborators.json.jbuilder b/app/views/projects/collaborators/_collaborators.json.jbuilder deleted file mode 100644 index e7310dba0..000000000 --- a/app/views/projects/collaborators/_collaborators.json.jbuilder +++ /dev/null @@ -1,3 +0,0 @@ -json.array!(collaborators) do |collaborator| - json.partial! 'collaborator.json', collaborator: collaborator -end diff --git a/app/views/projects/collaborators/_init_service.js.erb b/app/views/projects/collaborators/_init_service.js.erb deleted file mode 100644 index 0c06bb827..000000000 --- a/app/views/projects/collaborators/_init_service.js.erb +++ /dev/null @@ -1,9 +0,0 @@ - diff --git a/app/views/projects/collaborators/_members_table.html.slim b/app/views/projects/collaborators/_members_table.html.slim deleted file mode 100644 index c9d393d1c..000000000 --- a/app/views/projects/collaborators/_members_table.html.slim +++ /dev/null @@ -1,67 +0,0 @@ -table.table.table-striped - thead - tr - th - th - = t('layout.collaborators.members') - th.buttons.text-center colspan=3 - = t('layout.collaborators.roles') - th.buttons - = t('layout.remove') - tbody - tr ng-repeat = 'member in membersCtrl.collaborators' - td - = check_box_tag 'members[]', 'true', false, - 'ng-model' => 'member.check_delete', - 'ng-value' => 'member.check_delete' - td - span - img ng-src = '{{ member.avatar_path }}' size = '30x30' - |   - a[ ng-href = 'member.path' ] {{ member.actor_name }} - - Relation::ROLES.each do |role| - td - input[ - type = 'radio' - ng-model = 'member.role' - value = role ] - |   - = t("layout.collaborators.role_names.#{ role }") - td - a[ ng-click = 'membersCtrl.updateCollaborator(member)' - href = '#' ] - - span.glyphicon.glyphicon-ok - |   - - a[ ng-click = 'membersCtrl.removeCollaborator(member)' - href = '#' ] - span.glyphicon.glyphicon-remove - |   - - -= submit_tag t('layout.delete'), class: 'btn btn-danger', - 'ng-click' => 'membersCtrl.removeCollaborators()', - 'ng-disabled' => 'membersCtrl.isDisabledDeleteAllButton()' - -hr - -= simple_form_for :user, url: '', - html: { class: 'form-inline' }, - wrapper: :inline_form do |f| - - => f.input :uname, - input_html: {'ng-model' => 'membersCtrl.new_collaborator_uname', - 'typeahead' => 'member.actor_uname for member in membersCtrl.getCollaborators($viewValue)', - 'typeahead-on-select' => 'membersCtrl.selectCollaborator($item, $model, $label)' } - - => f.input :role, - collection: options_for_collaborators_roles_select, - input_html: { name: :role, 'ng-model' => 'membersCtrl.new_role' }, - include_blank: false - - = f.button :submit, t('layout.add'), 'ng-click' => 'membersCtrl.addCollaborator($event)', - 'ng-disabled' => '!membersCtrl.selected_new_collaborator' - -- content_for :additional_scripts do - = render 'init_service.js.erb' diff --git a/app/views/projects/collaborators/find.json.jbuilder b/app/views/projects/collaborators/find.json.jbuilder deleted file mode 100644 index 0bda0eeda..000000000 --- a/app/views/projects/collaborators/find.json.jbuilder +++ /dev/null @@ -1,3 +0,0 @@ -json.array!(@collaborators) do |collaborator| - json.(collaborator, :actor_uname, :actor_id, :actor_type) -end \ No newline at end of file diff --git a/app/views/projects/collaborators/index.html.slim b/app/views/projects/collaborators/index.html.slim deleted file mode 100644 index 8168e2811..000000000 --- a/app/views/projects/collaborators/index.html.slim +++ /dev/null @@ -1,10 +0,0 @@ --set_meta_tags title: [title_object(@project), t('layout.projects.members')] -= render 'submenu' - -.container - .row - .col-md-offset-2.col-md-8= render 'settings_menu' - .col-md-9.col-md-offset-2[ ng-controller = 'CollaboratorsController as membersCtrl' - ng-cloak = 'true' ] - - = render 'members_table' diff --git a/app/views/projects/collaborators/index.json.jbuilder b/app/views/projects/collaborators/index.json.jbuilder deleted file mode 100644 index 42edfd368..000000000 --- a/app/views/projects/collaborators/index.json.jbuilder +++ /dev/null @@ -1 +0,0 @@ -json.partial! 'collaborators.json', collaborators: @collaborators diff --git a/app/views/projects/comments/_add.html.slim b/app/views/projects/comments/_add.html.slim deleted file mode 100644 index 54dd8d5a8..000000000 --- a/app/views/projects/comments/_add.html.slim +++ /dev/null @@ -1,21 +0,0 @@ -h3 - = t('layout.comments.new_header') - -= simple_form_for Comment.new, url: '', html: { method: :post } do |f| - .panel.panel-info - .panel-heading - h3.panel-title - = f.label :body - .pull-right= render 'projects/comments/button_md_help' - .clearfix - .panel-body - = render 'projects/comments/body', f: f, id: 'new-comment', ctrl: 'commentsCtrl', - ang_model: 'new_body' - hr - button.btn.btn-primary[ ng-disabled = 'commentsCtrl.isDisabledNewCommentButton()' - ng-click = 'commentsCtrl.add($event)' ] - = t('layout.create') - .panel-footer - => t('layout.comments.notifications_are') - - == render 'projects/subscribes/subscribe_status', project: @project, commentable: @commentable diff --git a/app/views/projects/comments/_body.html.slim b/app/views/projects/comments/_body.html.slim deleted file mode 100644 index da53e6762..000000000 --- a/app/views/projects/comments/_body.html.slim +++ /dev/null @@ -1,18 +0,0 @@ -tabset - tab.active heading = t('layout.edit') - .offset10 - - if defined?(ang_model) - = f.input :body, label: false, as: :text, - input_html: { rows: 10, id: "#{id}-body", style: 'resize: vertical', - 'ng-model' => "#{ctrl}.#{ang_model}", 'ng-value' => "#{ctrl}.#{ang_model}" } - - else - = f.input :body, label: false, as: :text, - input_html: { rows: 10, id: "#{id}-body" } - - tab[ heading = t('layout.preview') - select = "#{ctrl}.previewBody('#{id}')" ] - .offset10 - i.fa.fa-spinner.fa-spin.fa-lg ng-show = "#{ctrl}.processing" - - div[ ng-bind-html = "#{ctrl}.preview_body" - ng-show = "!#{ctrl}.processing" ] diff --git a/app/views/projects/comments/_button_md_help.html.slim b/app/views/projects/comments/_button_md_help.html.slim deleted file mode 100644 index 328698a31..000000000 --- a/app/views/projects/comments/_button_md_help.html.slim +++ /dev/null @@ -1,2 +0,0 @@ -a[ href = '#' data-toggle = 'modal' data-target = '#md_help' ] - = t('layout.comments.md_cheatsheet_header') diff --git a/app/views/projects/comments/_comment.html.slim b/app/views/projects/comments/_comment.html.slim deleted file mode 100644 index 1e73f508c..000000000 --- a/app/views/projects/comments/_comment.html.slim +++ /dev/null @@ -1,22 +0,0 @@ -- CommentPresenter.present(comment, data) do |presenter| - == render 'shared/feed_message.html.slim', presenter: presenter --unless comment.automatic - .open-comment.hidden class = "comment-#{comment.id}" id = "update-comment#{comment.id}" - h3.tmargin0= t("layout.comments.edit_header") - = simple_form_for comment, url: project_commentable_comment_path(data[:project], data[:commentable], comment) do |f| - .panel.panel-info - .panel-heading - h3.panel-title - = f.label :body - .pull-right== render 'projects/comments/button_md_help.html.slim' - .clearfix - .panel-body - == render 'projects/comments/body.html.slim', f: f, id: "comment-#{comment.id}", - ctrl: 'commentsCtrl' - - anchor = "#comment#{comment.id}" - a.btn.btn-primary[ ng-disabled = 'commentsCtrl.processing' - href = anchor - ng-click = "commentsCtrl.update(#{comment.id})" ] - = t('layout.update') - =< link_to t('layout.cancel'), anchor, - 'ng-click' => "commentsCtrl.closeEditForm(#{comment.id})" diff --git a/app/views/projects/comments/_form.html.haml b/app/views/projects/comments/_form.html.haml deleted file mode 100644 index dcac243bb..000000000 --- a/app/views/projects/comments/_form.html.haml +++ /dev/null @@ -1 +0,0 @@ -= render 'projects/comments/body', f: f, id: id diff --git a/app/views/projects/comments/_line_comment.html.slim b/app/views/projects/comments/_line_comment.html.slim deleted file mode 100644 index 3ec3278a2..000000000 --- a/app/views/projects/comments/_line_comment.html.slim +++ /dev/null @@ -1,3 +0,0 @@ -.line-comment - == render 'projects/comments/comment.html.slim', - comment: @comment, data: { project: @project, commentable: @commentable } diff --git a/app/views/projects/comments/_list.html.slim b/app/views/projects/comments/_list.html.slim deleted file mode 100644 index fe644d1e0..000000000 --- a/app/views/projects/comments/_list.html.slim +++ /dev/null @@ -1,12 +0,0 @@ -a name = 'comments' - -h3#block-list= t("layout.comments.comments_header") -#comments_list - - list.each do |comment| - -unless comment.created_from_commit_hash - == render 'projects/comments/comment', comment: comment, - data: { project: project, commentable: commentable } - -else - - GitPresenters::CommitAsMessagePresenter.present(nil, comment: comment) do |presenter| - == render 'shared/feed_message', presenter: presenter, item_no: "-#{comment.id}" -== render "projects/comments/markdown_help" diff --git a/app/views/projects/comments/_markdown_help.html.haml b/app/views/projects/comments/_markdown_help.html.haml deleted file mode 100644 index 9e527bda9..000000000 --- a/app/views/projects/comments/_markdown_help.html.haml +++ /dev/null @@ -1,12 +0,0 @@ -.modal.fade{ id: 'md_help', tabindex: '-1', role: 'dialog', - 'aria-labelledby' => 'md_helpLabel', 'aria-hidden' => 'true' } - .modal-dialog - .modal-content - .modal-header - %button{ class: 'close', type: 'button', 'data-dismiss' => 'modal' } - %span{ 'aria-hidden' => 'true' } × - %span.sr-only Close - %h4.modal-title#md_help= t('layout.comments.md_cheatsheet_header') - .modal-body - = render 'projects/comments/markdown_help_body' - diff --git a/app/views/projects/comments/_markdown_help_body.html.slim b/app/views/projects/comments/_markdown_help_body.html.slim deleted file mode 100644 index 946cff090..000000000 --- a/app/views/projects/comments/_markdown_help_body.html.slim +++ /dev/null @@ -1,112 +0,0 @@ -.row - .col-md-6 - h3=t 'layout.comments.md_cheatsheet.format_text' - p=t 'layout.comments.md_cheatsheet.headers' - pre - = '# This is an

tag' - br - = '## This is an

tag' - br - = '### This is an

tag' - p=t 'layout.comments.md_cheatsheet.text_styles' - - pre - | *This text will be italic* - br - | _This will also be italic_ - br - | **This text will be bold** - br - | __This will also be bold__ - p=link_to t('layout.comments.md_cheatsheet.emoji_header'), - 'http://www.emoji-cheat-sheet.com/', target: '_blank' - pre - =":smile:" - =image_tag("/images/emoji/#{Emoji.find_by_alias('smile').image_filename}", - class: 'emoji', title: 'smile', alt: 'smile', size: "20x20") - =" :+1:" - =image_tag("/images/emoji/#{Emoji.find_by_alias('+1').image_filename}", - class: 'emoji', title: '+1', alt: '+1', size: "20x20") - .col-md-6 - h3=t 'layout.comments.md_cheatsheet.lists' - p= "#{t 'layout.comments.md_cheatsheet.unordered'} / #{t 'layout.comments.md_cheatsheet.ordered'}" - pre - | * Item 1 1. Item 1 - br - | * Item 2 2. Item 2 - br - | * Item 2a 3. Item 3 - br - | * Item 2b * Item 3a - br - | * Item 3b - p=t 'layout.comments.md_cheatsheet.reference_format' - pre - =preserve t('layout.comments.md_cheatsheet.reference_format_example').html_safe - - .clearfix - - .col-md-12 - h3=t 'layout.comments.md_cheatsheet.code_examples' - .col-md-6 - p= t 'layout.comments.md_cheatsheet.syntax_highlighting' - pre - | ```javascript - br - | function fancyAlert(arg) { - br - | if(arg) { - br - | $.facebox({div:'#foo'}) - br - | } - br - | } - br - | ``` - - .col-md-6 - p=t 'layout.comments.md_cheatsheet.indent_code' - pre - | Here is a Python code example - br - | without syntax highlighting: - br - br - | def foo: - br - | if not bar: - br - | return true - - .col-md-6 - p= t 'layout.comments.md_cheatsheet.inline_code' - pre - | I think you should use an - br - | `[addr]` element here instead. - - .clearfix - - .col-md-12 - h3=t 'layout.comments.md_cheatsheet.miscellaneous' - .row - .col-md-6 - p=t 'layout.comments.md_cheatsheet.images' - pre - | ![avatar](/assets/ava.png) - br - | Format: ![Alt Text](url) - p=t 'layout.comments.md_cheatsheet.links' - pre - | https://abf.rosalinux.ru - br - | [ABF](https://abf.rosalinux.ru/) - .col-md-6 - p=t 'layout.comments.md_cheatsheet.blockquotes' - pre - | As Kanye West said: - br - | > We're living the future so - br - | > the present is our past. diff --git a/app/views/projects/comments/_new_line.html.slim b/app/views/projects/comments/_new_line.html.slim deleted file mode 100644 index 30247133c..000000000 --- a/app/views/projects/comments/_new_line.html.slim +++ /dev/null @@ -1,20 +0,0 @@ -.new_inline_comment_form.hidden - #new_inline_comment - h3 - = t('layout.comments.new_header') - - = simple_form_for Comment.new, url: '', html: { method: :post } do |f| - .panel.panel-info - .panel-heading - h3.panel-title - = f.label :body - .pull-right= render 'projects/comments/button_md_help' - .clearfix - .panel-body - = render 'projects/comments/body', f: f, id: 'new-inline-comment', ctrl: 'commentsCtrl', - ang_model: 'new_inline_body' - hr - button.btn.btn-primary[ ng-disabled = 'commentsCtrl.isDisabledNewInlineCommentButton()' - ng-click = 'commentsCtrl.addInline($event)' ] - = t('layout.create') - =< link_to t('layout.cancel'), '', 'ng-click' => 'commentsCtrl.hideInlineForm()' diff --git a/app/views/projects/comments/create.json.jbuilder b/app/views/projects/comments/create.json.jbuilder deleted file mode 100644 index 92866965b..000000000 --- a/app/views/projects/comments/create.json.jbuilder +++ /dev/null @@ -1,3 +0,0 @@ -json.id @comment.id -json.html render partial: 'projects/comments/line_comment.html.slim' -json.message t('flash.comment.saved') diff --git a/app/views/projects/comments/edit.html.haml b/app/views/projects/comments/edit.html.haml deleted file mode 100644 index 3ff974111..000000000 --- a/app/views/projects/comments/edit.html.haml +++ /dev/null @@ -1,13 +0,0 @@ --set_meta_tags title: [title_object(@comment.project), t('layout.comments.edit_header')] -.block - .secondary-navigation - %ul.wat-cf - %li.first= link_to t("layout.comments.back"), project_commentable_path(@project, @commentable) - .content - %h2.title - = t("layout.comments.edit_header") - .inner - = form_for @comment, url: project_commentable_comment_path(@project, @commentable, @comment), html: {class: :form} do |f| - = render "form", f: f, id: "edit_#{@comment.id}" -=hidden_field_tag :preview_url, project_md_preview_path(@project) - diff --git a/app/views/projects/git/base/_choose_fork.html.slim b/app/views/projects/git/base/_choose_fork.html.slim deleted file mode 100644 index 146525514..000000000 --- a/app/views/projects/git/base/_choose_fork.html.slim +++ /dev/null @@ -1,26 +0,0 @@ -- is_group = owner.class == Group ? "(#{t 'activerecord.models.group'})" : '' -- full_name = "#{owner.uname}/#{name} #{is_group}" - -- if owner.own_projects.exists? name: name - p.text-center - => t('layout.projects.already_exists') - = link_to full_name, project_path("#{owner.uname}/#{name}") -- else - = form_for @project, url: fork_project_path(@project), html: { class: :form, multipart: true, method: :post } do |f| - = hidden_field_tag :group, owner.id if owner.class == Group - = hidden_field_tag :fork_name, name, name: 'fork_name' - .btn-group.btn-group-justified - .btn-group - = f.submit t('layout.projects.fork_to', to: full_name), - class: 'btn btn-primary center-block', - 'data-loading-text' => t('layout.processing'), id: 'create_fork' - - - if policy(@project).alias? - = form_for @project, url: alias_project_path(@project), html: { class: :form, multipart: true, method: :post } do |f| - = hidden_field_tag :group, owner.id if owner.class == Group - = hidden_field_tag :fork_name, name, name: 'fork_name' - .btn-group.btn-group-justified.offset5 - .btn-group - = f.submit t('layout.projects.create_alias_for', for: full_name), - class: 'btn btn-primary center-block', - 'data-loading-text' => t('layout.processing'), id: 'create_fork' diff --git a/app/views/projects/git/base/_fork.html.slim b/app/views/projects/git/base/_fork.html.slim deleted file mode 100644 index 230abf5e8..000000000 --- a/app/views/projects/git/base/_fork.html.slim +++ /dev/null @@ -1,34 +0,0 @@ -= hidden_field_tag :possible_forks_path, possible_forks_project_path(@project) - -- if policy(@project).write? - .pull-right.roffset5 - a.btn.btn-primary href=new_project_pull_request_path(@project, treeish: @treeish) - i.fa.fa-upload> - = t('projects.pull_requests.show.pull') - -- if policy(@project).fork? - .pull-right#fork-and-edit.roffset5 - a.btn.btn-primary href='#' data-toggle='modal' data-target='#forkModal' - i.fa.fa-code-fork> - = t('layout.projects.fork_and_edit') - #forkModal.modal.fade tabindex='-1' role='dialog' aria-labelledby='forkModalLabel' aria-hidden=true - .modal-dialog - .modal-content - .modal-header - button.close type="button" data-dismiss="modal" - span aria-hidden=true × - span.sr-only Close - h4.modal-title#myModalLabel - = t('layout.projects.fork_modal_header') - = hidden_field_tag :possible_forks, possible_forks_project_path(@project) - p.offset10 - = text_field_tag 'fork_name', @project.name, id: 'fork_name', class: 'form-control' - .modal-body - = render 'forks', owner: current_user, name: @project.name - -- if @project.is_package && policy(@project.build_lists.new).create? - .pull-right.roffset5 - - params = { build_list: { project_version: @treeish}} - a.btn.btn-primary href=new_project_build_list_path(@project, params) - i.fa.fa-plus> - = t('layout.projects.new_build_list') diff --git a/app/views/projects/git/base/_forks.html.slim b/app/views/projects/git/base/_forks.html.slim deleted file mode 100644 index c75ee407f..000000000 --- a/app/views/projects/git/base/_forks.html.slim +++ /dev/null @@ -1,5 +0,0 @@ -== render 'projects/git/base/choose_fork', owner: current_user, name: name -hr -- Group.can_own_project(current_user).each do |group| - == render 'projects/git/base/choose_fork', owner: group, name: name - hr \ No newline at end of file diff --git a/app/views/projects/git/blobs/_blame.html.slim b/app/views/projects/git/blobs/_blame.html.slim deleted file mode 100644 index 907d3b07e..000000000 --- a/app/views/projects/git/blobs/_blame.html.slim +++ /dev/null @@ -1,9 +0,0 @@ -h3= t("layout.projects.files_in_project") -.files - .pull-left== render 'whereami' - .pull-right== render 'fork' -.clearfix -.panel.panel-default - .panel-heading== render 'top' - -#output.formatted== render 'blame_table' if @blame.first.first.present? diff --git a/app/views/projects/git/blobs/_blame_table.html.haml b/app/views/projects/git/blobs/_blame_table.html.haml deleted file mode 100644 index 3faff65b9..000000000 --- a/app/views/projects/git/blobs/_blame_table.html.haml +++ /dev/null @@ -1,32 +0,0 @@ -%table.table.blame - - index = 1 - - @blame.each do |elem| - %tr.firstrow - %td.commit_info{ rowspan: elem[1].length, nowrap: 'nowrap' } - %code - #{link_to shortest_hash_id(elem[0].id), commit_path(@project, elem[0].id)} #{t('layout.by')} - - author = elem[0].author - - committer = elem[0].committer - = commit_author_link(author) - - if author.email != committer.email - (#{commit_author_link(committer)}) - %br - %span.date= commit_date(elem[0].committed_date) - %span.message{title: elem[0].message}= short_message(elem[0].message) - - %td.lines - %pre= index - - index += 1 - - %td.code.formatted - = preserve do - = blame_highlight @blob, elem[1].first - - - elem[1][1..-1].each do |line| - %tr - %td.lines - %pre= index - - index += 1 - %td.code.formatted - = preserve do - = blame_highlight @blob, line diff --git a/app/views/projects/git/blobs/_editor.html.slim b/app/views/projects/git/blobs/_editor.html.slim deleted file mode 100644 index 1e20e5514..000000000 --- a/app/views/projects/git/blobs/_editor.html.slim +++ /dev/null @@ -1,37 +0,0 @@ -= javascript_include_tag 'codemirror_editor' -= stylesheet_link_tag 'codemirror_editor' - -h3= t("layout.projects.files_in_project") -.files - .pull-left= render 'whereami' - .pull-right= render 'fork' -.clearfix - -= form_tag edit_blob_path(@project, @treeish, @path), name: 'blob-editor', method: :put do - .form-group - .file-editor= text_area_tag :content, @blob.data, id: 'code' - - .form-group - label[ for = :message ]= t("layout.enter_commit_message") - = text_area_tag :message, "Updated #{@blob.name}", class: 'form-control' - - => submit_button_tag - => t("layout.or") - = link_to t("layout.cancel"), blob_path(@project, @treeish, @path), class: 'btn btn-default' - -- content_for :additional_scripts do - javascript: - $(function() { - var editor = CodeMirror.fromTextArea(document.getElementById('code'), { - lineNumbers: true, - mode: '#{@blob.raw_mime_type}' - }); - $(".CodeMirror").resizable({ - stop: function() { editor.refresh(); }, - resize: function() { - $(".CodeMirror-scroll").height($(this).height()); - $(".CodeMirror-scroll").width($(this).width()); - editor.refresh(); - } - }); - }); \ No newline at end of file diff --git a/app/views/projects/git/blobs/_render_as_binary.html.haml b/app/views/projects/git/blobs/_render_as_binary.html.haml deleted file mode 100644 index a8fd16a3d..000000000 --- a/app/views/projects/git/blobs/_render_as_binary.html.haml +++ /dev/null @@ -1,8 +0,0 @@ -%table.table.blob - %tr - %td.lines - %td.blob - :plain -
-
#{link_to_unless @blob.huge?, @blob.basename, raw_path(@project, @treeish, @path)}
-
\ No newline at end of file diff --git a/app/views/projects/git/blobs/_render_as_image.html.haml b/app/views/projects/git/blobs/_render_as_image.html.haml deleted file mode 100644 index c09645e18..000000000 --- a/app/views/projects/git/blobs/_render_as_image.html.haml +++ /dev/null @@ -1,2 +0,0 @@ -.text-center - %img{ src: raw_path(@project, @treeish, @path), style: 'max-width: 600px;' } diff --git a/app/views/projects/git/blobs/_render_as_text.html.haml b/app/views/projects/git/blobs/_render_as_text.html.haml deleted file mode 100644 index 66a935971..000000000 --- a/app/views/projects/git/blobs/_render_as_text.html.haml +++ /dev/null @@ -1,3 +0,0 @@ -#output.formatted - = preserve do - = blob_highlight(@blob) diff --git a/app/views/projects/git/blobs/_show.html.slim b/app/views/projects/git/blobs/_show.html.slim deleted file mode 100644 index fd762fa91..000000000 --- a/app/views/projects/git/blobs/_show.html.slim +++ /dev/null @@ -1,9 +0,0 @@ -h3= t("layout.projects.files_in_project") -.files - .pull-left== render 'whereami' - .pull-right== render 'fork' -.clearfix -.panel.panel-default - .panel-heading== render 'top' - -== render "render_as_#{@blob.render_as}" diff --git a/app/views/projects/git/blobs/_top.html.haml b/app/views/projects/git/blobs/_top.html.haml deleted file mode 100644 index 3dbb4ee5b..000000000 --- a/app/views/projects/git/blobs/_top.html.haml +++ /dev/null @@ -1,22 +0,0 @@ -.pull-left - = @blob.mode - \| - - if @blob.render_as == :text - #{@blob.loc} lines (#{@blob.sloc} sloc) - \| - = number_to_human_size @blob.size -.pull-right - - if @blob.render_as == :text && policy(@project).write? && @branch.present? - = link_to "Edit", edit_blob_path(@project, @treeish, @path) - \| - - if @blob.render_as == :text && params[:action] != 'show' - = link_to "Normal", blob_path(@project, @treeish, @path) - \| - - unless @blob.huge? - = link_to "Raw", raw_path(@project, @treeish, @path) - \| - - if @blob.render_as == :text && params[:action] != 'blame' - = link_to "Blame", blame_path(@project, @treeish, @path) - \| - = link_to "History", commits_path(@project, @treeish, @path) -.clearfix \ No newline at end of file diff --git a/app/views/projects/git/blobs/_whereami.html.slim b/app/views/projects/git/blobs/_whereami.html.slim deleted file mode 100644 index c37a2e98d..000000000 --- a/app/views/projects/git/blobs/_whereami.html.slim +++ /dev/null @@ -1,8 +0,0 @@ -ol.breadcrumb - li= link_to @project.name, tree_path(@project, treeish: @treeish) - - if @path.present? - - paths = File.split(@path) - - if paths.size > 1 and paths.first != '.' - - iterate_path(paths.first).each do |el| - li= link_to(el.last, tree_path(@project, "#{@treeish}/#{el.first}")) - li.active= paths.last \ No newline at end of file diff --git a/app/views/projects/git/blobs/blame.html.slim b/app/views/projects/git/blobs/blame.html.slim deleted file mode 100644 index 21d9f09fe..000000000 --- a/app/views/projects/git/blobs/blame.html.slim +++ /dev/null @@ -1,8 +0,0 @@ -- title = "#{title_object @project} #{t('at') if @branch} #{@branch.try :name}" -- set_meta_tags title: title -- set_meta_tags og: { title: title, - description: truncate(@project.description, length: 255) } -- set_meta_tags twitter: { title: title, - description: truncate(@project.description, length: 200) } - -== render partial: "blame", layout: 'layout' diff --git a/app/views/projects/git/blobs/edit.html.slim b/app/views/projects/git/blobs/edit.html.slim deleted file mode 100644 index 3c23f57f3..000000000 --- a/app/views/projects/git/blobs/edit.html.slim +++ /dev/null @@ -1,2 +0,0 @@ --set_meta_tags title: [title_object(@project), "#{t :title_editing} #{@project.name}/#{@path} #{t('at') if @branch} #{@branch.try :name}"] -== render partial: "editor", layout: 'layout' diff --git a/app/views/projects/git/blobs/show.html.slim b/app/views/projects/git/blobs/show.html.slim deleted file mode 100644 index b588dedca..000000000 --- a/app/views/projects/git/blobs/show.html.slim +++ /dev/null @@ -1,9 +0,0 @@ -- title = [title_object(@project), "#{@project.name}/#{@path} #{t('at') if @branch} #{@branch.try :name}"] -- set_meta_tags title: title -- title = title * ' - ' -- set_meta_tags og: { title: title, - description: truncate(@project.description, length: 255) } -- set_meta_tags twitter: { title: title, - description: truncate(@project.description, length: 200) } - -== render partial: "show", layout: 'layout' diff --git a/app/views/projects/git/commits/_commits.html.slim b/app/views/projects/git/commits/_commits.html.slim deleted file mode 100644 index 660ef3f6e..000000000 --- a/app/views/projects/git/commits/_commits.html.slim +++ /dev/null @@ -1,17 +0,0 @@ -- project ||= @project -- commits = split_commits_by_date(commits) -- cur_year = Date.today.year -- counter = 1 - -- commits.each_pair do |year, by_month| - - by_month.each_pair do |month, by_day| - - by_day.each_pair do |day, commits| - .panel.panel-info - .panel-heading - h3.panel-title= raw l(commits.first.committed_date, format: :date_block_format) - ul.list-group - - commits.each_with_index do |commit| - li.list-group-item - - GitPresenters::CommitAsMessagePresenter.present(commit, project: project) do |presenter| - == render 'shared/feed_commit', presenter: presenter, item_no: counter - - counter += 1 diff --git a/app/views/projects/git/commits/_commits_small.html.slim b/app/views/projects/git/commits/_commits_small.html.slim deleted file mode 100644 index fd86d6c14..000000000 --- a/app/views/projects/git/commits/_commits_small.html.slim +++ /dev/null @@ -1,22 +0,0 @@ -div.commits_activity - table.table.table-striped - tbody - - commits.each do |commit| - - item_no = commit.id - - GitPresenters::CommitAsMessagePresenter.present(commit, project: @project) do |presenter| - tr - = datetime_moment presenter.date, tag: :td, class: :date - td - img height = 16 alt = 'avatar' src = presenter.image - td.name - = presenter.header - td.subject - - if presenter.caption? - = presenter.caption - - if presenter.expandable? && presenter.content? - span>[ class = 'glyphicon glyphicon-chevron-down pointer' - data-toggle = 'collapse' - data-target = "#content-expand#{item_no}" ] - - if presenter.content? - .collapse id = (presenter.expandable? ? "content-expand#{item_no}" : '') - .cm-s-default.md_and_cm= markdown presenter.content diff --git a/app/views/projects/git/commits/_diff.html.slim b/app/views/projects/git/commits/_diff.html.slim deleted file mode 100644 index 24ffd5581..000000000 --- a/app/views/projects/git/commits/_diff.html.slim +++ /dev/null @@ -1,35 +0,0 @@ -- parent_commit = defined?(common_ancestor) ? common_ancestor : commit.parents.try(:first) -- commit_id = get_commit_id_for_file diff, commit, parent_commit -- diff_counter_content = "diff-#{diff_counter}_content" -- blob = file_blob_in_diff(@project.repo, commit_id, diff) -- is_file_open = 'in' if is_file_open_in_diff(blob, diff) - -.file.offset10 - a name = "diff-#{diff_counter}" - .top - button.btn.btn-link.pull-left[ type = 'button' - data-toggle = 'collapse' - data-target = "##{diff_counter_content}" - aria-expanded = 'true' - aria-controls = diff_counter_content ] - span.fa class= (is_file_open ? 'fa-chevron-down' : 'fa-chevron-up') - =< diff_file_icon(diff).html_safe - =< get_filename_in_diff(diff, diff.a_path) - - if diff.b_path.present? - = link_to "view file @ #{shortest_hash_id(commit_id)}", blob_path(@project, commit_id, diff.b_path), - class: 'btn btn-link pull-right' - .clearfix - - .diff_data.collapse id= diff_counter_content class= is_file_open - - if blob.respond_to?(:render_as) && blob.render_as == :image && diff.diff.present? - - old_blob = file_blob_in_diff(@project.repo, parent_commit.try(:id), diff) - == render 'show_image', diff: diff, blob: blob, old_blob: old_blob - - - if diff.a_mode != diff.b_mode && diff.diff.blank? - == render 'file_change_mode', blob: blob, diff: diff - - - elsif diff.diff.blank? && diff.renamed_file - == render 'file_removed_not_changed', blob: blob - - - elsif !blob.binary? - == render_diff(diff, diff_counter: diff_counter, comments: @comments) diff --git a/app/views/projects/git/commits/_file_change_mode.html.slim b/app/views/projects/git/commits/_file_change_mode.html.slim deleted file mode 100644 index d63782724..000000000 --- a/app/views/projects/git/commits/_file_change_mode.html.slim +++ /dev/null @@ -1,10 +0,0 @@ -.table-responsive.overflow-auto - table.table.diff.inline.table-borderless cellspacing= 0 cellpadding= 0 - tr.header - td.line_numbers[] ... - td.line_numbers[] ... - td.header.text-danger= "oldmode #{diff.a_mode}" - tr.header - td.line_numbers[] ... - td.line_numbers[] ... - td.header.text-success= "newmode #{diff.b_mode}" \ No newline at end of file diff --git a/app/views/projects/git/commits/_file_removed_not_changed.html.slim b/app/views/projects/git/commits/_file_removed_not_changed.html.slim deleted file mode 100644 index 2d1136c6f..000000000 --- a/app/views/projects/git/commits/_file_removed_not_changed.html.slim +++ /dev/null @@ -1,9 +0,0 @@ -.table-responsive.overflow-auto - table.table.diff.inline.table-borderless cellspacing= 0 cellpadding= 0 - tr.header - td.line_numbers[] ... - td.line_numbers[] ... - td.header - strong.text-primary - - binary = t('layout.projects.diff.binary') if blob.binary? - = "#{binary} #{ t 'layout.projects.diff.renamed_file'} #{t 'layout.projects.diff.without_changes'}" diff --git a/app/views/projects/git/commits/_paginate.html.slim b/app/views/projects/git/commits/_paginate.html.slim deleted file mode 100644 index e4b2b91e5..000000000 --- a/app/views/projects/git/commits/_paginate.html.slim +++ /dev/null @@ -1,17 +0,0 @@ -- unless @page == 1 && @last_page - - prev_text, next_text = t('will_paginate.previous_label'), t('will_paginate.next_label') - ul.pager - - if @page == 1 - li.disabled - a= prev_text - - else - li - a href=commits_path(@project, treeish: @treeish, page: (@page - 1)) - = prev_text - - if @last_page - li.disabled - a= next_text - - else - li - a href=commits_path(@project, treeish: @treeish, page: (@page + 1)) - = next_text diff --git a/app/views/projects/git/commits/_show.html.slim b/app/views/projects/git/commits/_show.html.slim deleted file mode 100644 index fa38dfc13..000000000 --- a/app/views/projects/git/commits/_show.html.slim +++ /dev/null @@ -1,14 +0,0 @@ -- begin - - diffs = @commit.show - - stats = Grit::CommitStats.find_all(@project.repo, @commit.sha, max_count: 1, skip: 0)[0][-1] - = render_commit_stats(stats: stats, diff: @commit.show, repo: @project.repo, commit: @commit) - - .pull-right - => link_to 'raw diff', commit_path(@project, @commit.id, :diff) - | | - =< link_to 'patch', commit_path(@project, @commit.id, :patch) - .clearfix - - == render partial: 'diff', collection: diffs, locals: { commit: @commit } -- rescue Grit::Git::GitTimeout - h3.text-danger= t('layout.git.repositories.commit_diff_too_big') diff --git a/app/views/projects/git/commits/_show_image.html.slim b/app/views/projects/git/commits/_show_image.html.slim deleted file mode 100644 index b5ff26323..000000000 --- a/app/views/projects/git/commits/_show_image.html.slim +++ /dev/null @@ -1,18 +0,0 @@ -.row - - if get_file_status_in_diff(diff) == :changed_file - .col-md-6.col-xs-12 - p.text-center.text-danger= t 'layout.projects.diff.deleted_file' - img[ class= 'img-responsive center-block' - src= "data:#{old_blob.mime_type};base64,#{Base64.encode64(old_blob.data)}" - style= 'border: 1px solid red;' ] - - .col-md-6.col-xs-12 - p.text-center.text-success= t 'layout.projects.diff.new_file' - img[ class= 'img-responsive center-block' - src= "data:#{blob.mime_type};base64,#{Base64.encode64(blob.data)}" - style= 'border: 1px solid green;' ] - - else - .col-xs-12 - img[ class= 'img-responsive center-block offset10' - src= "data:#{blob.mime_type};base64,#{Base64.encode64(blob.data)}" - style= 'border: 1px solid #87CEFA;' ] diff --git a/app/views/projects/git/commits/diff.html.slim b/app/views/projects/git/commits/diff.html.slim deleted file mode 100644 index 0016380b3..000000000 --- a/app/views/projects/git/commits/diff.html.slim +++ /dev/null @@ -1,24 +0,0 @@ -- title = "#{t('diff')} #{shortest_hash_id @commit1.id}...#{shortest_hash_id @commit.id}" -- title = [title_object(@project), title] -- set_meta_tags title: title -- title = title * ' - ' -- set_meta_tags og: { title: title, - description: truncate(@project.description, length: 255) } -- set_meta_tags twitter: { title: title, - description: truncate(@project.description, length: 200) } -== render 'submenu' - -.col-xs-12.col-md-10.col-md-offset-1 - h3= title - - #repo-wrapper - -begin - - diffs = @project.repo.diff @common_ancestor.id, @commit.id - == render_diff_stats(stats: @stats, diff: diffs, repo: @project.repo, - commit: @commit, common_ancestor: @common_ancestor) - - == render partial: 'projects/git/commits/diff', collection: diffs, - locals: { commit: @commit, common_ancestor: @common_ancestor} - - - rescue Grit::Git::GitTimeout - p= t 'layout.git.repositories.commit_diff_too_big' diff --git a/app/views/projects/git/commits/index.html.slim b/app/views/projects/git/commits/index.html.slim deleted file mode 100644 index 0868840e7..000000000 --- a/app/views/projects/git/commits/index.html.slim +++ /dev/null @@ -1,15 +0,0 @@ -- title = [title_object(@project), "#{t '.title'} #{t('at') if @branch} #{@branch.try :name}"] -- set_meta_tags title: title -- title = title * ' - ' -- set_meta_tags og: { title: title, - description: truncate(@project.description, length: 255) } -- set_meta_tags twitter: { title: title, - description: truncate(@project.description, length: 200) } - -== render 'submenu' -.col-xs-12.col-md-10.col-md-offset-1 - .row - == render 'repo_block', project: @project - .offset10 - == render partial: 'commits', object: @commits - == render 'paginate' if @path.blank? diff --git a/app/views/projects/git/commits/show.html.slim b/app/views/projects/git/commits/show.html.slim deleted file mode 100644 index 02c21c13a..000000000 --- a/app/views/projects/git/commits/show.html.slim +++ /dev/null @@ -1,32 +0,0 @@ -- title = [title_object(@project), shortest_hash_id(@commit.id)] -- set_meta_tags title: [title, @commit.message].flatten -- title = title * ' - ' -- set_meta_tags og: { title: title, - description: truncate(@commit.message, length: 255) } -- set_meta_tags twitter: { title: title, - description: truncate(@commit.message, length: 200) } - -== render 'submenu' - -- ctrl_params = "{ kind: 'commit', id: '#{@commit.id}' }" -.col-xs-12.col-md-10.col-md-offset-1[ ng-controller= 'CommentsController as commentsCtrl' - ng-init= "commentsCtrl.init('#{@project.name_with_owner}', #{ctrl_params})" ] - - - GitPresenters::CommitAsMessagePresenter.present(@commit, project: @project) do |presenter| - .panel.panel-default - .panel-body - == render 'shared/feed_commit', presenter: presenter, item_no: 1 - - .both - #repo-wrapper - == render 'show' - - - comments = @comments.select {|c| c.data.blank? } # dont work @comments.where(data: nil) - div - == render "projects/comments/list", list: comments, project: @project, commentable: @commit - == render "projects/comments/add", project: @project, commentable: @commit if current_user - - = hidden_field_tag :preview_url, project_md_preview_path(@project) - -div ng-non-bindable = true - == render 'projects/comments/new_line' diff --git a/app/views/projects/git/trees/_branches.html.slim b/app/views/projects/git/trees/_branches.html.slim deleted file mode 100644 index e6468f6bb..000000000 --- a/app/views/projects/git/trees/_branches.html.slim +++ /dev/null @@ -1,39 +0,0 @@ -.row[ ng-controller = 'ProjectBranchesController' ng-cloak = true - ng-init = "init('#{@project.owner.uname}', '#{@project.name}','#{@branch.try(:name)}')"] - - h3= t('layout.projects.branches') - .col-md-4 - h4[ ng-show = '!branches.length']= t('layout.projects.no_branches') - h5[ ng-show = 'branches.length > 0'] {{'project.total_branches' | i18n:'plural':branches.length}} - - .col-md-4.pull-right - input.form-control ng-model = 'query.ref' placeholder = t('layout.search.header') - .clearfix - - table.table.table-hover.offset10 - tbody - tr ng-repeat = 'branch in branches | filter:query' ng-class = '{info: branch.ref == current_ref}' - td - a ng-href = '{{branch.path(project)}}' - strong[] {{branch.ref}} - td - ul.list-inline.pull-right.boffset_auto - - if policy(@project).write? - li ng-hide = 'branch.ref == current_ref || branch.ui_container' - a href = '' ng-confirm-click = t('layout.confirm') confirmed-click = 'destroy(branch)' - = t('layout.projects.delete_branch') - li ng-hide = 'branch.ui_container' - a href = '' ng-click = 'branch.ui_container = true' - = t('layout.projects.new_branch') - li ng-show = 'branch.ui_container' - form.form-inline role = 'form' ng-submit = 'create(branch)' - .form-group - input.form-control ng-model = 'branch.new_ref' - input.btn.btn-primary type = 'submit' value = t('layout.create') - a.btn.btn-primary href = '' ng-click = 'branch.ui_container = false' - = t('layout.cancel') - li ng-hide = 'branch.ref == current_ref || branch.ui_container' - a ng-href = '{{branch.diff_path(project, current_ref)}}' - = t('layout.projects.compare') - li ng-show = 'branch.ref == current_ref && !branch.ui_container' - = t('layout.projects.base_branch') diff --git a/app/views/projects/git/trees/_show.html.haml b/app/views/projects/git/trees/_show.html.haml deleted file mode 100644 index 380a67938..000000000 --- a/app/views/projects/git/trees/_show.html.haml +++ /dev/null @@ -1,65 +0,0 @@ -%h3= t 'layout.projects.files_in_project' -%div{ 'ng-controller' => 'GitTreeCtrl', 'ng-cloak' => true, - 'ng-init' => "init('#{@project.name_with_owner}', '#{@treeish}', '#{@path}')" } - .files - .pull-left= render 'whereami' - - if policy(@project).fork? - .pull-right= render 'fork' - .clearfix - %table.table.table-hover - %thead - %tr - %th.icon - %th.col-xs-3= t 'layout.projects.filename' - %th= t 'layout.projects.message' - %th.col-xs-3= t 'layout.projects.age' - - %tbody{ 'ng-hide' => 'processing' } - %tr{ 'ng-show' => 'path' } - %td - %span= fa_icon 'folder', class: 'text-primary' - %td - %a{ 'ng-href' => '{{root_path}}', 'ng-click' => 'getTree($event, root_path)' } .. - %td   - %td   - - %tr{ 'ng-repeat' => 'el in tree' } - %td{ 'ng-show' => 'el.submodule && el.submodule.url' } - %span= fa_icon 'folder-open', class: 'text-info' - %td{ 'ng-show' => 'el.submodule && el.submodule.url' } - %a{ 'ng-href' => '{{el.submodule.url}}' } {{el.submodule.name}} - @ - %a{ 'ng-href' => '{{el.submodule.tree_url}}' } {{el.submodule.id}} - - %td{ 'ng-show' => 'el.submodule && !el.submodule.url' } - %td{ 'ng-show' => 'el.submodule && !el.submodule.url' } - {{el.submodule.name+' @ '+el.submodule.id}} - - %td{ 'ng-show' => '!el.submodule' } - %span - %i.fa.text-primary{ 'ng-class' => 'el.node.class_name' } - %td{ 'ng-show' => '!el.submodule' } - %a{ 'ng-href' => '{{el.node.url}}', - 'ng-click' => 'getTree($event, el.node.path)', - 'ng-show' => '!el.node.is_blob' } - {{el.node.name}} - %a{ 'ng-href' => '{{el.node.url}}', - 'ng-show' => 'el.node.is_blob' } - {{el.node.name}} - - %td{ 'ng-show' => 'el.commit' } - %a{ 'ng-href' => '{{el.commit.url}}' } {{el.commit.short_message}} - - %td{ 'ng-show' => 'el.commit', - title: '{{el.commit.committed_date_utc}}' } - {{ el.commit.committed_date | amDateFormat:'YYYY-MM-DD HH:mm' }} ( - %span{ 'am-time-ago' => 'el.commit.committed_date' } - ) - - %td{ 'ng-hide' => 'el.commit' } - %td{ 'ng-hide' => 'el.commit' } - - %hr - %btn.center-block.btn.btn-primary{ 'ng-show' => 'next_page', 'ng-disabled' => 'load_more || processing', - 'ng-click' => 'getTree($event, null, true)' } - = t 'layout.activity_feed.load_more' diff --git a/app/views/projects/git/trees/_tags.html.slim b/app/views/projects/git/trees/_tags.html.slim deleted file mode 100644 index 9d97210ce..000000000 --- a/app/views/projects/git/trees/_tags.html.slim +++ /dev/null @@ -1,27 +0,0 @@ - .row[ ng-controller = 'ProjectTagsController' ng-cloak = true - ng-init = "init('#{@project.owner.uname}', '#{@project.name}')"] - - h3= t('layout.projects.tags') - .col-md-4 - h4 ng-show = '!tags.length'= t('layout.projects.no_tags') - h5[ ng-show = 'tags.length > 0'] {{'project.total_tags' | i18n:'plural':tags.length}} - - .col-md-4.pull-right - input.form-control ng-model = 'query.ref' placeholder = t('layout.search.header') - .clearfix - - table.table.table-hover.offset10 - tbody - tr ng-repeat = 'tag in tags | filter:query' - td - strong[] {{tag.ref}} - span.small[] {{tag.object.authored_date * 1000 | date:'yyyy.MM.dd'}} - td - ul.list-inline.pull-right.boffset_auto - li - a ng-href = '{{tag.path(project)}}' - = t('layout.projects.browse_code') - - %w(zip tar.gz).each do |type| - li - a ng-href = "{{tag.archive_path(project, '#{type}')}}" - = t('layout.projects.source_code', type: type) diff --git a/app/views/projects/git/trees/branches.html.slim b/app/views/projects/git/trees/branches.html.slim deleted file mode 100644 index acdb42556..000000000 --- a/app/views/projects/git/trees/branches.html.slim +++ /dev/null @@ -1,8 +0,0 @@ -- title = title_object(@project) -- set_meta_tags title: title -- set_meta_tags og: { title: title, - description: truncate(@project.description, length: 255) } -- set_meta_tags twitter: { title: title, - description: truncate(@project.description, length: 200) } - -== render partial: "branches", layout: 'layout' diff --git a/app/views/projects/git/trees/empty.html.haml b/app/views/projects/git/trees/empty.html.haml deleted file mode 100644 index f3cbae030..000000000 --- a/app/views/projects/git/trees/empty.html.haml +++ /dev/null @@ -1,70 +0,0 @@ -- title = title_object(@project) -- set_meta_tags title: title -- set_meta_tags og: { title: title, - description: truncate(@project.description, length: 255) } -- set_meta_tags twitter: { title: title, - description: truncate(@project.description, length: 200) } - -= render 'submenu' -= render 'repo_block', project: @project -= render 'about_block', project: @project - - -- if @project.parent_id.present? || @project.srpm.exists? - - .both - #repo-wrapper - - %h3= t("layout.projects.files_in_project") - .files - .l= render 'whereami' - .both - %table#myTable.tablesorter.project{cellpadding: "0", cellspacing: "0"} - %thead - %tr - %th.th1= t("layout.projects.filename") - %th.th2= t("layout.projects.age") - %th.th3= t("layout.projects.message") - %th.th4= t("layout.projects.author") - %tbody - %tr - %td.centered{colspan: 4} - %h3= I18n.t("layout.git.repositories.empty") - -- else - - if current_user - %h3= t("layout.projects.git_global_setup") - %p - %code - = "git config --global user.name '#{current_user.fullname}'" - %br/ - = "git config --global user.email #{current_user.email}" - %br/ - git config --global http.postBuffer 524288000 - - %h3= t("layout.projects.create_repository") - %p - %code - = "git clone #{git_repo_url(@project.name_with_owner)}" - %br/ - = "cd #{@project.name}" - %br/ - %br/ - %p= t("layout.projects.move_files_to_folder") - %br/ - %code - git add . - %br/ - git commit -m 'description message' - %br/ - git push -u origin master - - %h3= t("layout.projects.existing_git_repo") - %p - %code - cd existing_git_repo - %br/ - = "git remote add origin #{git_repo_url(@project.name_with_owner)}" - %br/ - git push -u origin master - diff --git a/app/views/projects/git/trees/refs_list.json.jbuilder b/app/views/projects/git/trees/refs_list.json.jbuilder deleted file mode 100644 index c53ee0a8a..000000000 --- a/app/views/projects/git/trees/refs_list.json.jbuilder +++ /dev/null @@ -1,8 +0,0 @@ -json.refs_list @refs do |grit| - json.ref grit.name - json.object do - json.type (grit.class.name =~ /Tag/ ? 'tag' : 'commit') - json.sha grit.commit.id - json.authored_date grit.commit.authored_date.to_i - end -end \ No newline at end of file diff --git a/app/views/projects/git/trees/show.html.slim b/app/views/projects/git/trees/show.html.slim deleted file mode 100644 index fe9601fe6..000000000 --- a/app/views/projects/git/trees/show.html.slim +++ /dev/null @@ -1,6 +0,0 @@ -- title = title_object(@project) -- set_meta_tags title: "#{title} #{t('at') if @branch} #{@branch.try :name}" -- set_meta_tags og: { title: title, - description: truncate(@project.description, length: 255) } -- set_meta_tags twitter: { title: title, - description: truncate(@project.description, length: 200) } diff --git a/app/views/projects/git/trees/show.json.jbuilder b/app/views/projects/git/trees/show.json.jbuilder deleted file mode 100644 index 3df7c30d3..000000000 --- a/app/views/projects/git/trees/show.json.jbuilder +++ /dev/null @@ -1,69 +0,0 @@ -if params[:info] == 'true' - json.project do - json.(@project, :id, :name) - json.fullname @project.name_with_owner - - json.owner do - json.(@project.owner, :id, :name, :uname) - end - end -else - - page = params[:page].to_i - page = page < 1 ? 0 : page - - json.tree do - json.array! @project.tree_info(@tree, @treeish, @path, page).each do |node, node_path, commit| - if node.is_a? Grit::Submodule - url = submodule_url(node, @treeish) - json.submodule do - json.url url - json.name node.name - json.tree_url "#{url}/tree/#{node.id}" - json.id node.id[0..6] - end - else - - json.node do - if node.is_a?(Grit::Tree) - json.class_name 'fa-folder' - json.url tree_path(@project, "#{@treeish}/#{node_path}") - else - json.class_name 'fa-file-text-o' - json.url blob_path(@project, @treeish, node_path) - json.is_blob true - end - json.name node.name - json.path node_path - end - end - if commit - json.commit do - json.committed_date commit.committed_date - json.committed_date_utc commit.committed_date.utc.strftime('%Y-%m-%d %H:%M:%S UTC') - json.short_message commit.short_message - json.url commit_path(@project, commit) - end - end - end - end - - json.breadcrumb do - if @path.present? - paths = File.split(@path) - if paths.size > 1 and paths.first != '.' - json.paths do - json.array! iterate_path(paths.first).each do |el| - json.path el.first - json.name el.last - end - end - end - json.last paths.last - end - end - - json.path @path - json.root_path @path.present? ? @path.split('/')[0...-1].join('/') : nil - json.next_page page.next if @tree && @tree.contents.count >= Project::CONTENT_LIMIT*(page+1) -end diff --git a/app/views/projects/git/trees/tags.html.slim b/app/views/projects/git/trees/tags.html.slim deleted file mode 100644 index 4df845dd6..000000000 --- a/app/views/projects/git/trees/tags.html.slim +++ /dev/null @@ -1,8 +0,0 @@ -- title = title_object(@project) -- set_meta_tags title: title -- set_meta_tags og: { title: title, - description: truncate(@project.description, length: 255) } -- set_meta_tags twitter: { title: title, - description: truncate(@project.description, length: 200) } - -== render partial: "tags", layout: 'layout' diff --git a/app/views/projects/hooks/_form.html.slim b/app/views/projects/hooks/_form.html.slim deleted file mode 100644 index 75f98f36c..000000000 --- a/app/views/projects/hooks/_form.html.slim +++ /dev/null @@ -1,18 +0,0 @@ -= hidden_field_tag 'hook[name]', @hook.name -- Hook::SCHEMA[@hook.name.to_sym].each do |type, field| - - name, value = "hook[data][#{field}]", @hook.data[field] - .form-group - - if type != :boolean - label.control-label.col-sm-3 - = t("activerecord.attributes.hook.data.#{field}") - .col-sm-9 - - if type == :password - = password_field name, value, class: 'form-control' - - else - = text_field_tag name, value, class: 'form-control' - - else - .col-sm-offset-3.col-sm-9 - .checkbox - label - = check_box_tag name, value, 1 - = t("activerecord.attributes.hook.data.#{field}") diff --git a/app/views/projects/hooks/docs/_irc.en.html.haml b/app/views/projects/hooks/docs/_irc.en.html.haml deleted file mode 100644 index 8a4af7cd2..000000000 --- a/app/views/projects/hooks/docs/_irc.en.html.haml +++ /dev/null @@ -1,23 +0,0 @@ -:markdown - - 1. `server` - IRC server, IE. irc.freenode.net - 2. `port` - Normally 6667 (No SSL) or 9999 (SSL) (optional). These are the defaults based on whether the value of `ssl` checkbox. - 3. `room` - Supports single or multiple rooms (comma separated). Also supports room passwords (room_name::password). Prefixing '#' to the room is optional. - 4. `password` - Server password (optional) - 5. `nick` - Nickname (optional) - 6. `long_url` - If enabled, displays full compare/commit url's. If disabled uses git.io. - 7. `message_without_join` - If enabled prevents joining and immediately leaving the channel. - 8. `no_colors` - Disables color support for messages - 9. `notice` - Enables notice support. Make sure you configure channel to support notices ("/mode #yourchannelname -n" or "/msg chanserv set mlock -n") - 10. `branch_regexes` - Regular expressions for branch name matching (optional, comma separated). For example, only master => `^master$`, master & starts with bug => `master,^bug`. - 11. Configure your IRC channel to allow external messages (/mode #yourchannelname -n). - - For freenode, try the following: - - # server: irc.freenode.net - # port: 6667 - # room: #yourroom - # message_without_join: checked - # long_url: checked - # notice: checked - # NOTE: Ensure you enable notice support (see above) diff --git a/app/views/projects/hooks/docs/_irc.ru.html.haml b/app/views/projects/hooks/docs/_irc.ru.html.haml deleted file mode 100644 index 189a0bcdc..000000000 --- a/app/views/projects/hooks/docs/_irc.ru.html.haml +++ /dev/null @@ -1,23 +0,0 @@ -:markdown - - 1. `server` - IRC сервер, например irc.freenode.net - 2. `port` - Стандартный 6667 (без SSL) или 9999 (SSL) (опционально). Это значения по умолчанию в зависимости от значения `ssl` чекбокса. - 3. `room` - Поддержка одной или нескольких комнат (через запятую). Также поддерживается пароль к комнате (room_name::password). Префикс '#' у комнаты опционально. - 4. `password` - пароль к серверу (опционально) - 5. `nick` - никнейм (опционально) - 6. `long_url` - Если включено, показывает полные compare/commit url's. Если отключено, использует git.io. - 7. `message_without_join` - Если включено, предварительно заходит на канал и немедленно покидает его. - 8. `no_colors` - Отключает поддержку цветов для сообщений - 9. `notice` - Включает поддержку уведомлений. Убедитесь, что ваш канал поддерживает уведомления ("/mode #yourchannelname -n" или "/msg chanserv set mlock -n") - 10. `branch_regexes` - Регулярное выражение для фильтрации по имении ветки (опционально, через запятую). Например, только master => `^master$`, master & начинающиеся на bug => `master,^bug`. - 11. Сконфигурируйте ваш IRC канал на поддержку внешних сообщений (/mode #yourchannelname -n). - - Для freenode, подходит следующее: - - # server: irc.freenode.net - # port: 6667 - # room: #yourroom - # message_without_join: checked - # long_url: checked - # notice: checked - # ЗАМЕЧАНИЕ: Убедитесь, что поддержка уведомлений включена (см. выше) diff --git a/app/views/projects/hooks/docs/_jabber.en.html.haml b/app/views/projects/hooks/docs/_jabber.en.html.haml deleted file mode 100644 index 443e90455..000000000 --- a/app/views/projects/hooks/docs/_jabber.en.html.haml +++ /dev/null @@ -1,4 +0,0 @@ -:markdown - - 1. **User** is the Jabber ID (e.g.: myusername@jabber.org). Multiple users can be added by separating them with commas. Currently, there is a maximum of 25 users. - 2. You should add `abf-notification@rosalab.ru` user into your contact list. \ No newline at end of file diff --git a/app/views/projects/hooks/docs/_jabber.ru.html.haml b/app/views/projects/hooks/docs/_jabber.ru.html.haml deleted file mode 100644 index 2fb5101ad..000000000 --- a/app/views/projects/hooks/docs/_jabber.ru.html.haml +++ /dev/null @@ -1,4 +0,0 @@ -:markdown - - 1. **User** это Jabber ID (например: myusername@jabber.org). Несколько пользователей могут быть добавленны через запятую (максимум 25 пользователей). - 2. Вы должны добавить `abf-notification@rosalab.ru` пользователя в ваш список контактов. \ No newline at end of file diff --git a/app/views/projects/hooks/docs/_web.en.html.haml b/app/views/projects/hooks/docs/_web.en.html.haml deleted file mode 100644 index f2bef3247..000000000 --- a/app/views/projects/hooks/docs/_web.en.html.haml +++ /dev/null @@ -1,3 +0,0 @@ -:markdown - - We’ll hit these URLs with POST requests when you push to us, passing along information about the push. \ No newline at end of file diff --git a/app/views/projects/hooks/docs/_web.ru.html.haml b/app/views/projects/hooks/docs/_web.ru.html.haml deleted file mode 100644 index a3e46286a..000000000 --- a/app/views/projects/hooks/docs/_web.ru.html.haml +++ /dev/null @@ -1,3 +0,0 @@ -:markdown - - Мы будем отправлять POST запрос на эти URLs, когда вы обновите проект, передавая информацию об обновлении. \ No newline at end of file diff --git a/app/views/projects/hooks/edit.html.slim b/app/views/projects/hooks/edit.html.slim deleted file mode 100644 index ae2a55906..000000000 --- a/app/views/projects/hooks/edit.html.slim +++ /dev/null @@ -1,19 +0,0 @@ --set_meta_tags title: [title_object(@project), t('layout.projects.hooks')] -= render 'submenu' - -.container.col-md-offset-2.col-md-8 - .row - = render 'settings_menu' - - = simple_form_for @hook, url: project_hooks_path(@project, @hook), - html: { class: 'form-horizontal offset10' }, - wrapper: :horizontal_form do |f| - - h2= t("layout.hooks.services.#{@hook.name}") - = render "form", f: f - - .col-sm-offset-3.col-sm-9 - = f.button :submit, t('layout.update'), data: {'disable-with' => t('layout.processing')}, - class: 'btn btn-primary boffset10' - - .col-sm-offset-3.col-sm-9= render "projects/hooks/docs/#{@hook.name}" diff --git a/app/views/projects/hooks/index.html.slim b/app/views/projects/hooks/index.html.slim deleted file mode 100644 index 80cf13f4d..000000000 --- a/app/views/projects/hooks/index.html.slim +++ /dev/null @@ -1,25 +0,0 @@ --set_meta_tags title: [title_object(@project), t('layout.projects.hooks')] -= render 'submenu' - -.container - .row - .col-md-offset-2.col-md-8= render 'settings_menu' - .col-md-6.col-md-offset-3 - h1= t('layout.projects.hooks') - - table.table - thead - tr - th= t('attributes.name') - th - tbody - - Hook::NAMES.each do |name| - tr - td - = link_to project_hooks_path(@project, name: name) do - = t("layout.hooks.services.#{name}") - = "(#{@hooks.where(name: name).count})" - td - = link_to t('layout.create'), - new_project_hook_path(@project, hook: {name: name}), - class: 'btn btn-primary pull-right' diff --git a/app/views/projects/hooks/new.html.slim b/app/views/projects/hooks/new.html.slim deleted file mode 100644 index 62b03d999..000000000 --- a/app/views/projects/hooks/new.html.slim +++ /dev/null @@ -1,18 +0,0 @@ --set_meta_tags title: [title_object(@project), t('layout.projects.hooks')] -= render 'submenu' - -.container.col-md-offset-2.col-md-8 - .row - = render 'settings_menu' - - = simple_form_for @hook, url: project_hooks_path(@project), - html: { class: 'form-horizontal offset10' }, - wrapper: :horizontal_form do |f| - h2= t("layout.hooks.services.#{@hook.name}") - = render "form", f: f - - .col-sm-offset-3.col-sm-9 - = f.button :submit, t('layout.create'), data: {'disable-with' => t('layout.saving')}, - class: 'btn btn-primary boffset10' - - .col-sm-offset-3.col-sm-9= render "projects/hooks/docs/#{@hook.name}" diff --git a/app/views/projects/hooks/show.html.slim b/app/views/projects/hooks/show.html.slim deleted file mode 100644 index 854216f76..000000000 --- a/app/views/projects/hooks/show.html.slim +++ /dev/null @@ -1,36 +0,0 @@ --set_meta_tags title: [title_object(@project), t('layout.projects.hooks')] -= render 'submenu' - -.container - .row - .col-md-offset-2.col-md-8= render 'settings_menu' - .col-md-6.col-md-offset-3 - - h1 - = t("layout.hooks.services.#{@name}") - - = link_to t('layout.create'), - new_project_hook_path(@project, hook: {name: @name}), - class: 'btn btn-primary boffset10' - .clearfix - - - - @hooks.all.each do |hook| - - schema = Hook::SCHEMA[hook.name.to_sym] - - hook.data.each do |field, value| - .col-sm-3= t("activerecord.attributes.hook.data.#{field}") - .col-sm-9 - - if schema.find{ |type, attr| type == :password && field.to_sym == attr } - = '******' - - else - = value - .clearfix.boffset10 - - .col-sm-9.col-sm-offset-3.offset10 - = link_to t('layout.edit'), edit_project_hook_path(@project, hook), - class: 'btn btn-primary roffset5' - = link_to t('layout.delete'), project_hook_path(@project, hook), method: :delete, - data: { confirm: t('layout.confirm') }, class: 'btn btn-primary' - hr.col-sm-12 - .clearfix - diff --git a/app/views/projects/issues/_choose_assignee.html.slim b/app/views/projects/issues/_choose_assignee.html.slim deleted file mode 100644 index a30e786fb..000000000 --- a/app/views/projects/issues/_choose_assignee.html.slim +++ /dev/null @@ -1,22 +0,0 @@ -== render 'projects/issues/user_container' - -- if policy(@project).write? - .col-md-8 - .panel.panel-info ng-show = 'issueCtrl.toggle_manage_assignee' - .panel-heading - = t('layout.issues.assign_someone') - i.fa.fa-spinner.fa-spin.pull-right ng-show = 'issueCtrl.processing_issue_assignee' - .panel-body - span.fa.fa-times[ ng-click = 'issueCtrl.removeAssignee()' - ng-show = 'issueCtrl.assignee.id' ] - =< t('layout.issues.clear_assignee') - - input[ class = 'form-control offset10' - type = 'text' - ng-model = "issueCtrl.selected_assignee" - placeholder = t('layout.issues.search_user') - typeahead = "extra.label for extra in issueCtrl.getAssignees($viewValue)" - typeahead-on-select = "issueCtrl.selectAssignee($item, $model, $label)" - typeahead-template-url = "search_collaborators.html" ] - .clearfix -.offset10 diff --git a/app/views/projects/issues/_closed_by.html.slim b/app/views/projects/issues/_closed_by.html.slim deleted file mode 100644 index 468049301..000000000 --- a/app/views/projects/issues/_closed_by.html.slim +++ /dev/null @@ -1,15 +0,0 @@ -.panel.panel-default ng-show = 'issueCtrl.status.name === "closed"' - .panel-body - .pull-right - .strong.text-center.padding-5 ng-class = 'issueCtrl.issue_status_class' - | {{ 'issues.status.' + issueCtrl.status.name | i18n }} - .pull-left.roffset5 - img ng-src = '{{ issueCtrl.status.closer.image }}' - .pull-left - strong - a> ng-href = 'issueCtrl.status.closer.path' - | {{ issueCtrl.status.closer.fullname }} - | {{ issueCtrl.status.closed_at | amDateFormat:'D MMM YYYY, HH:mm' }} ( - span am-time-ago = 'issueCtrl.status.closed_at' - | ) - .clearfix diff --git a/app/views/projects/issues/_colors_chooser.html.slim b/app/views/projects/issues/_colors_chooser.html.slim deleted file mode 100644 index 00d9ab3c5..000000000 --- a/app/views/projects/issues/_colors_chooser.html.slim +++ /dev/null @@ -1,7 +0,0 @@ -.colors - a.fa.fa-2x.roffset5[ ng-repeat = 'color in labelsCtrl.default_colors' - ng-class = 'labelsCtrl.colorClass(color)' - ng-style = 'labelsCtrl.colorStyle(color)' - href = '' - ng-click = 'labelsCtrl.label.color = color' ] -.clearfix.boffset5 diff --git a/app/views/projects/issues/_filter.json.jbuilder b/app/views/projects/issues/_filter.json.jbuilder deleted file mode 100644 index 8cbe10b72..000000000 --- a/app/views/projects/issues/_filter.json.jbuilder +++ /dev/null @@ -1,17 +0,0 @@ -json.kind params[:kind] -json.filter params[:filter] -json.sort params[:sort] -json.sort_direction params[:direction] -json.status params[:status] - -if @all_issues - json.all_count @all_issues.not_closed_or_merged.count - if current_user - json.assigned_count @assigned_issues.not_closed_or_merged.count - json.created_count @created_issues.not_closed_or_merged.count - end - json.opened_count @opened_issues.count - json.closed_count @closed_issues.count - json.filtered_count @issues.count -end -json.page params[:page] diff --git a/app/views/projects/issues/_filter_labels.html.slim b/app/views/projects/issues/_filter_labels.html.slim deleted file mode 100644 index e0626de04..000000000 --- a/app/views/projects/issues/_filter_labels.html.slim +++ /dev/null @@ -1,10 +0,0 @@ -h4=t('layout.issues.labels') -ul.nav.nav-pills.nav-stacked - li[ role = 'presentation' ng-repeat = 'label in issuesCtrl.labels' ] - a[ ng-click = 'issuesCtrl.toggleLabelFilter(label)' - ng-style = 'label.style' ] - .label-flag[ ng-style = 'label.default_style' - ng-show = '!label.selected' ]   - | {{label.name}} - span.pull-right - | {{label.count}} diff --git a/app/views/projects/issues/_form.html.slim b/app/views/projects/issues/_form.html.slim deleted file mode 100644 index eabca8a21..000000000 --- a/app/views/projects/issues/_form.html.slim +++ /dev/null @@ -1,2 +0,0 @@ -== render 'projects/issues/title_body', f: f -== render 'projects/issues/choose_assignee' diff --git a/app/views/projects/issues/_header.html.slim b/app/views/projects/issues/_header.html.slim deleted file mode 100644 index 2c04de9d2..000000000 --- a/app/views/projects/issues/_header.html.slim +++ /dev/null @@ -1,46 +0,0 @@ -.offset10 ng-hide='issueCtrl.edit' - h3#issue_title_text - = @issue.title - .panel.panel-default - .panel-body - .pull-left.roffset5 - = image_tag(avatar_url(@issue.user, :medium), alt: 'avatar') if @issue.user - - if policy(@issue).update? - .pull-right - a href='#' - i.fa.fa-edit ng-click='issueCtrl.edit = true' - .pull-left - - if @issue.user - strong - => link_to(@issue.user.fullname, user_path(@issue.user)) - = datetime_moment @issue.created_at, tag: :span - .clearfix - #issue_body_text.offset10= markdown @issue.body - - == render 'projects/issues/closed_by' - == render 'projects/issues/choose_assignee' - - - if controller_name == 'issues' - - ctrl_params = "{ kind: 'issue', id: #{@issue.serial_id} }" - div[ ng-controller = 'CommentsController as commentsCtrl' - ng-init = "commentsCtrl.init('#{@project.name_with_owner}', #{ctrl_params})" ] - == render "projects/comments/list", list: @issue.comments, - project: @project, commentable: @issue - - if current_user - hr - == render "projects/comments/add", project: @project, commentable: @issue - -- if policy(@issue).update? - .offset10 ng-show = 'issueCtrl.edit' - h3= t('layout.issues.edit_header') - - = simple_form_for @issue, url: project_issue_path(@project, @issue) do |f| - == render 'projects/issues/title_body', f: f - - button.btn.btn-primary[ ng-disabled = 'issueCtrl.processing' - type = 'button' - ng-click = 'issueCtrl.updateIssue("title_body")' ] - = t('layout.update') - - a< href='#' ng-click='issueCtrl.edit = false' - = t('layout.issues.cancel_button') diff --git a/app/views/projects/issues/_index_sidebar.html.slim b/app/views/projects/issues/_index_sidebar.html.slim deleted file mode 100644 index 522d162b5..000000000 --- a/app/views/projects/issues/_index_sidebar.html.slim +++ /dev/null @@ -1,25 +0,0 @@ -ul.nav.nav-pills.nav-stacked - li ng-class = "{ active: issuesCtrl.filter.all }" - a ng-click = "issuesCtrl.setIssuesFilter('all')" - span.badge.pull-right= "{{ issuesCtrl.filter.all_count }}" - - kind = params[:kind] == 'issues' ? 'tracker' : 'pull_requests' - = "{{'#{kind}.filter.all' | i18n}}" - - - if current_user - - %w(assigned created).each do |kind_filter| - li ng-class = "{ active: issuesCtrl.filter.#{kind_filter} }" - a ng-click = "issuesCtrl.setIssuesFilter('#{kind_filter}')" - span.badge.pull-right= "{{ issuesCtrl.filter.#{kind_filter}_count }}" - - kind = params[:kind] == 'issues' ? 'tracker' : 'pull_requests' - = "{{'#{kind}.filter.#{kind_filter}' | i18n}}" - -- if params[:kind] == 'issues' - - if policy(@project.issues.new).new? - hr - = link_to t('layout.issues.new'), new_project_issue_path(@project), class: 'btn btn-primary' - hr - - = render 'filter_labels', project: @project - - - if policy(@project).write? - = render 'manage_labels', project: @project diff --git a/app/views/projects/issues/_init_service.js.erb b/app/views/projects/issues/_init_service.js.erb deleted file mode 100644 index af430f2ad..000000000 --- a/app/views/projects/issues/_init_service.js.erb +++ /dev/null @@ -1,38 +0,0 @@ - diff --git a/app/views/projects/issues/_issue.json.jbuilder b/app/views/projects/issues/_issue.json.jbuilder deleted file mode 100644 index 711dba083..000000000 --- a/app/views/projects/issues/_issue.json.jbuilder +++ /dev/null @@ -1,33 +0,0 @@ -json.(issue, :serial_id, :title) -json.path project_issue_path(issue.project, issue) - -json.labels do - json.array!(issue.labels) do |label| - json.name label.name - json.color "##{label.color}" - end -end - -json.user do - json.uname issue.user.uname - json.path user_path(issue.user) -end - -json.updated_at issue.updated_at -json.updated_at_utc issue.updated_at.strftime('%Y-%m-%d %H:%M:%S UTC') - -json.created_at issue.created_at -json.created_at_utc issue.created_at.strftime('%Y-%m-%d %H:%M:%S UTC') - -if issue.assignee - json.assignee do - json.path user_path(issue.assignee) - json.image avatar_url(issue.assignee, :micro) - json.fullname issue.assignee.fullname - end -else - json.assignee do - end -end - -json.comments_count issue.comments.where(automatic: false).count diff --git a/app/views/projects/issues/_issues.json.jbuilder b/app/views/projects/issues/_issues.json.jbuilder deleted file mode 100644 index 122a44b39..000000000 --- a/app/views/projects/issues/_issues.json.jbuilder +++ /dev/null @@ -1,3 +0,0 @@ -json.array!(issues) do |issue| - json.partial! 'projects/issues/issue.json', issue: issue -end diff --git a/app/views/projects/issues/_issues_table.html.slim b/app/views/projects/issues/_issues_table.html.slim deleted file mode 100644 index 0c83e9f0d..000000000 --- a/app/views/projects/issues/_issues_table.html.slim +++ /dev/null @@ -1,38 +0,0 @@ -table.table - tr ng-repeat = "issue in issuesCtrl.issues" - td - a ng-href = "{{issue.path}}" - | {{issue.title}} - span.label.small.loffset5[ ng-repeat = "label in issue.labels" - ng-style = "{background: label.color}" ] - span.update-label[ ng-click = 'issuesCtrl.selectLabelFilter(label.name)' ] {{label.name}} - .small - = t 'layout.issues.created_by' - a>[ ng-href = "{{issue.user.path}}" ] {{issue.user.uname}} - span.text-muted[ ng-show = 'issuesCtrl.filter.sort == "submitted"' - title = "{{issue.created_at_utc}}" ] - | {{issue.created_at | amDateFormat:'YYYY-MM-DD HH:mm'}} ( - span am-time-ago = 'issue.created_at' - | ) - span> class = 'text-muted' ng-show = 'issuesCtrl.filter.sort == "updated"' - = t 'layout.issues.updated_at' - span.text-muted[ ng-show = 'issuesCtrl.filter.sort == "updated"' - title = "{{issue.updated_at_utc}}" ] - | {{issue.updated_at | amDateFormat:'YYYY-MM-DD HH:mm'}} ( - span am-time-ago = 'issue.updated_at' - | ) - td - a ng-href = "{{issue.path + '#comments'}}" - span.fa.fa-comments.text-primary - = " {{issue.comments_count}}" - td - a>[ ng-href = '{{issue.assignee.path}}' - title = "#{t('layout.issues.assigned_to')} {{issue.assignee.fullname}}" ] - img ng-src = '{{issue.assignee.image}}' - span.text-muted.roffset5 - | {{'#' + issue.serial_id}} - -= angularjs_paginate( per_page: Issue.per_page, - page: 'issuesCtrl.filter.page', - select_page: 'issuesCtrl.goToPage(issuesCtrl.filter.page)', - total_items: 'issuesCtrl.filter.filtered_count' ) diff --git a/app/views/projects/issues/_labels.json.jbuilder b/app/views/projects/issues/_labels.json.jbuilder deleted file mode 100644 index 836c25baa..000000000 --- a/app/views/projects/issues/_labels.json.jbuilder +++ /dev/null @@ -1,37 +0,0 @@ -json.array!(project.labels) do |label| - json.id label.id - json.name label.name - json.color label.color - - json.default_style do - json.set! 'background-color', "##{label.color}" - json.color '#FFF' - end - - if defined?(all_issue_ids) - selected = params[:labels].include?(label.name) - json.selected selected - json.style do - json.set! 'background-color', "##{label.color}" - json.color '#FFF' - end if selected - - json.count Labeling.joins(:label).where( - issue_id: all_issue_ids, - labels: { - name: label.name, - project_id: project.id - } - ).count - end - if defined?(issue) && issue.persisted? - labeling = issue.labelings.where(label_id: label.id) - selected = labeling.exists? - json.labeling_id labeling.first.try(:id) - json.selected selected - json.style do - json.set! 'background-color', "##{label.color}" - json.color '#FFF' - end if selected - end -end diff --git a/app/views/projects/issues/_manage_labels.html.slim b/app/views/projects/issues/_manage_labels.html.slim deleted file mode 100644 index 38fec6489..000000000 --- a/app/views/projects/issues/_manage_labels.html.slim +++ /dev/null @@ -1,55 +0,0 @@ -div ng-controller = 'LabelsController as labelsCtrl' ng-cloak = true - hr - button.btn.btn-primary[ ng-click = 'labelsCtrl.is_collapsed_manage_block = !labelsCtrl.is_collapsed_manage_block' - type = 'button' ]= t('layout.issues.label_manage') - - .offset5 collapse = 'labelsCtrl.is_collapsed_manage_block' - .row ng-repeat = "label in labelsCtrl.labels" - .col-md-10 - .update-label.lpadding-5[ ng-style = 'label.default_style' - ng-click = 'labelsCtrl.selectCurrentLabel(label)' ] - span[ ng-style = 'label.default_style' ] {{ label.name }} - .col-md-1.boffset10 - a[ class='fa fa-times-circle text-danger' href='' - ng-click="labelsCtrl.removeLabel(label)" ] - - form role = 'form' - .form-group - label[ for = 'label_name' ng-show = 'labelsCtrl.is_new_label' ] - = t('layout.issues.new_label') - label[ for = 'label_name' ng-show = '!labelsCtrl.is_new_label' ] - => t('layout.issues.update_label') - a.small[ href = '' ng-click = 'labelsCtrl.is_new_label = true' ] - = t('layout.issues.switch_to_new_label') - input[ id = 'label_name' - type = 'text' - class = 'form-control' - ng-model = 'labelsCtrl.label.name' - required = true - maxlength = 20 ] - - = render 'colors_chooser' - .form-group - input[ id = 'label_color' - type = 'text' - class = 'form-control' - ng-model = 'labelsCtrl.label.color' - ng-trim = 'false' - maxlength = 6 - required = true ] - .form-group - .row - .col-md-6 - td= "#{t 'layout.preview'}:" - .col-md-6 - .lpadding-5[ ng-style = 'labelsCtrl.colorPreviewStyle()' ] - span[ ng-style = 'labelsCtrl.colorPreviewStyle()' ] {{ labelsCtrl.label.name }} - - p.text-warning[ ng-repeat = 'error in labelsCtrl.errors' ] {{ error }} - - button.btn.btn-primary[ type = 'button' - ng-click = 'labelsCtrl.saveLabel()' - ng-disabled = 'labelsCtrl.processing' ] - div[ ng-show = 'labelsCtrl.processing' ]= t('layout.processing') - div[ ng-show = '!labelsCtrl.processing && labelsCtrl.is_new_label' ]= t('layout.add') - div[ ng-show = '!labelsCtrl.processing && !labelsCtrl.is_new_label' ]= t('layout.update') diff --git a/app/views/projects/issues/_select_labels.html.slim b/app/views/projects/issues/_select_labels.html.slim deleted file mode 100644 index cbfccc220..000000000 --- a/app/views/projects/issues/_select_labels.html.slim +++ /dev/null @@ -1,19 +0,0 @@ -h4 - = t('layout.issues.labels') - i.fa.fa-spinner.fa-spin.pull-right ng-show = 'issueCtrl.processing_issue_labels' -ul.nav.nav-pills.nav-stacked - li[ role = 'presentation' ng-repeat = 'label in issueCtrl.labels' ] - - if policy(@project).write? - a[ ng-click = 'issueCtrl.toggleLabel(label)' - ng-style = 'label.style' ] - .label-flag[ ng-style = 'label.default_style' - ng-show = '!label.selected' ]   - | {{label.name}} - input.hidden[ name = 'issue[labelings_attributes][][label_id]' - ng-model = 'label.selected_id' - ng-value = 'label.selected_id' ] - - else - a[ ng-style = 'label.style' ] - .label-flag[ ng-style = 'label.default_style' - ng-show = '!label.selected' ]   - | {{label.name}} diff --git a/app/views/projects/issues/_status.json.jbuilder b/app/views/projects/issues/_status.json.jbuilder deleted file mode 100644 index e8b8ce51d..000000000 --- a/app/views/projects/issues/_status.json.jbuilder +++ /dev/null @@ -1,17 +0,0 @@ -json.name issue.status - -if issue.closer - json.closer do - json.path user_path(@issue.closer) - json.image avatar_url(@issue.closer) - json.fullname @issue.closer.fullname - end -else - json.closer do - end -end - -if issue.closed_at - json.closed_at issue.closed_at - json.closed_at_utc issue.closed_at.strftime('%Y-%m-%d %H:%M:%S UTC') -end diff --git a/app/views/projects/issues/_status_sidebar.html.slim b/app/views/projects/issues/_status_sidebar.html.slim deleted file mode 100644 index dba13003d..000000000 --- a/app/views/projects/issues/_status_sidebar.html.slim +++ /dev/null @@ -1,19 +0,0 @@ -h3 - => "#{t('activerecord.attributes.issue.status')}:" - - - if @issue.persisted? - - can_manage = policy(@issue).update? - - if can_manage - button.btn[ ng-class = 'issueCtrl.issue_status_class' - ng-click = 'issueCtrl.updateStatus()' - ng-disabled = 'issueCtrl.processing_issue_status' ] - | {{ 'issues.status.' + issueCtrl.status.name | i18n }} - - else - .strong.text-center.ubpadding-5 ng-class = 'issueCtrl.issue_status_class' - | {{ 'issues.status.' + issueCtrl.status.name | i18n }} -hr - -/ - #switcher.issue_status{class: "#{@issue.closed? ? 'switcher-off' : 'switcher'} #{can_manage ? "switch_issue_status" : ''}"} - .swleft=t('layout.issues.status.open') - .swright=t('layout.issues.status.closed') \ No newline at end of file diff --git a/app/views/projects/issues/_title_body.html.slim b/app/views/projects/issues/_title_body.html.slim deleted file mode 100644 index a296ba4a0..000000000 --- a/app/views/projects/issues/_title_body.html.slim +++ /dev/null @@ -1,11 +0,0 @@ -= f.input :title, as: :string, input_html: { maxlength: 80 } - -.panel.panel-info - .panel-heading - h3.panel-title - - t('activerecord.attributes.issue.body') - = f.label :body - .pull-right= render 'projects/comments/button_md_help' - .clearfix - .panel-body - = render 'projects/comments/body', f: f, id: 'issue', ctrl: 'issueCtrl' diff --git a/app/views/projects/issues/_user.json.jbuilder b/app/views/projects/issues/_user.json.jbuilder deleted file mode 100644 index f86fb18c4..000000000 --- a/app/views/projects/issues/_user.json.jbuilder +++ /dev/null @@ -1,5 +0,0 @@ -if user - json.(user, :id, :fullname) - json.avatar_path avatar_url(user) - json.path user_path(user) -end diff --git a/app/views/projects/issues/_user_container.html.slim b/app/views/projects/issues/_user_container.html.slim deleted file mode 100644 index f316ecab0..000000000 --- a/app/views/projects/issues/_user_container.html.slim +++ /dev/null @@ -1,15 +0,0 @@ -.user-container - span ng-show = 'issueCtrl.assignee.id' - a[ ng-href = 'issueCtrl.assignee.path' ] - img> ng-src = '{{issueCtrl.assignee.avatar_path}}' - span[] {{ issueCtrl.assignee.fullname }} - span<= t('layout.issues.is_assigned') - - span[ ng-hide = 'issueCtrl.assignee.id' ]= t('layout.issues.no_one_is_assigned') - - - if policy(@project).write? - input.hidden name = 'issue[assignee_id]' ng-value = 'issueCtrl.assignee.id' - a< href = '' - i [ class = 'fa fa-share-square-o boffset10' - ng-click = 'issueCtrl.toggle_manage_assignee = !issueCtrl.toggle_manage_assignee' ] - diff --git a/app/views/projects/issues/index.html.slim b/app/views/projects/issues/index.html.slim deleted file mode 100644 index 810ffa950..000000000 --- a/app/views/projects/issues/index.html.slim +++ /dev/null @@ -1,29 +0,0 @@ -- set_meta_tags title: [title_object(@project), t("projects.#{params[:kind]}.index.title")] -- render 'submenu' - -.col-xs-12.col-md-10.col-md-offset-1 ng-controller = 'IssuesController as issuesCtrl' ng-cloak = true - .row - .col-md-3.col-sm-4.offset10 - == render 'index_sidebar', project: @project - .col-md-9.col-sm-8.offset10 - tabset.boffset10 - tab[ heading = "#{t "layout.issues.statuses.open"} ({{issuesCtrl.filter.opened_count}})" - active = 'issuesCtrl.filter.status_open' - ng-click = "issuesCtrl.setIssuesStatus('open')" ] - tab[ heading = "#{t "layout.issues.statuses.closed"} ({{issuesCtrl.filter.closed_count}})" - active = 'issuesCtrl.filter.status_closed' - ng-click = "issuesCtrl.setIssuesStatus('closed')" ] - - .pull-right.boffset10 - button.btn.btn-default.roffset5[ type = 'button' - ng-click = "issuesCtrl.setIssuesSort('updated')" ] - span.fa ng-class = "issuesCtrl.updated_class" - => t('layout.issues.sort.updated') - button.btn.btn-default[ type = 'button' - ng-click = "issuesCtrl.setIssuesSort('submitted')" ] - span.fa ng-class = "issuesCtrl.submitted_class" - => t('layout.issues.sort.submitted') - == render 'issues_table' - -- content_for :additional_scripts do - == render 'init_service.js.erb' diff --git a/app/views/projects/issues/index.json.jbuilder b/app/views/projects/issues/index.json.jbuilder deleted file mode 100644 index 47b995251..000000000 --- a/app/views/projects/issues/index.json.jbuilder +++ /dev/null @@ -1,10 +0,0 @@ -json.partial! 'filter', issues: @issues - -json.issues do - json.partial! 'issues', issues: @issues -end - -json.labels do - all_issue_ids = @all_issues.not_closed_or_merged.pluck(:id) - json.partial! 'labels', project: @project, all_issue_ids: all_issue_ids -end diff --git a/app/views/projects/issues/new.html.slim b/app/views/projects/issues/new.html.slim deleted file mode 100644 index bb62c07ff..000000000 --- a/app/views/projects/issues/new.html.slim +++ /dev/null @@ -1,23 +0,0 @@ --set_meta_tags title: [title_object(@project), t('layout.issues.create_header')] --render 'submenu' - -.col-xs-12.col-md-10.col-md-offset-1 ng-controller = 'IssueController as issueCtrl' ng-cloak = true - = simple_form_for @issue, url: project_issues_path(@project) do |f| - .row - - can_write = policy(@project).write? - - if can_write - .col-md-3.col-sm-4.offset10 - == render 'select_labels' - == render 'manage_labels' - - .col-md-9.col-sm-8.offset10[ class = "#{'col-md-offset-2' unless can_write}" ] - h3= title t('layout.issues.create_header') - == render 'form', f: f - = submit_tag t('layout.create'), - class: 'btn btn-primary', - data: {'disable-with' => t('layout.processing')} - - == render 'projects/comments/markdown_help' - -- content_for :additional_scripts do - == render 'init_service.js.erb' diff --git a/app/views/projects/issues/search_collaborators.json.jbuilder b/app/views/projects/issues/search_collaborators.json.jbuilder deleted file mode 100644 index dbb1e420f..000000000 --- a/app/views/projects/issues/search_collaborators.json.jbuilder +++ /dev/null @@ -1,3 +0,0 @@ -json.array!(@users) do |user| - json.partial! 'user', user: user -end diff --git a/app/views/projects/issues/show.html.slim b/app/views/projects/issues/show.html.slim deleted file mode 100644 index 9e427c183..000000000 --- a/app/views/projects/issues/show.html.slim +++ /dev/null @@ -1,24 +0,0 @@ -- set_meta_tags title: [title_object(@project), @issue.title] -- set_meta_tags og: { title: @issue.title, - description: truncate(@issue.body, length: 255) } -- set_meta_tags twitter: { title: @issue.title, - description: truncate(@issue.body, length: 200) } - -== render 'submenu' -== render 'projects/comments/markdown_help' if current_user - -.col-xs-12.col-md-10.col-md-offset-1 ng-controller = 'IssueController as issueCtrl' ng-cloak = true - .row - .col-md-3.col-sm-4.offset10 - == render 'status_sidebar' - - if policy(@project).write? - = simple_form_for @issue, url: project_issue_path(@project, @issue) do |f| - == render 'select_labels' - == render 'manage_labels' - - else - == render 'select_labels' - - .col-md-9.col-sm-8= render 'header' - -- content_for :additional_scripts do - == render 'init_service.js.erb' diff --git a/app/views/projects/issues/update.json.jbuilder b/app/views/projects/issues/update.json.jbuilder deleted file mode 100644 index 34580b656..000000000 --- a/app/views/projects/issues/update.json.jbuilder +++ /dev/null @@ -1,25 +0,0 @@ -json.(@issue, :title) -json.body markdown(@issue.body) - -json.labels do - json.partial! 'labels', project: @project, issue: @issue -end - -json.status do - json.partial! 'status', issue: @issue -end - - -#json.updated_at @issue.updated_at -#json.updated_at_utc @issue.updated_at.strftime('%Y-%m-%d %H:%M:%S UTC') - -if @issue.assignee - json.assignee do - json.path user_path(@issue.assignee) - json.image avatar_url(@issue.assignee) - json.fullname @issue.assignee.fullname - end -else - json.assignee do - end -end diff --git a/app/views/projects/project/project/error_github.html.slim b/app/views/projects/project/project/error_github.html.slim deleted file mode 100644 index 1e31b6bd4..000000000 --- a/app/views/projects/project/project/error_github.html.slim +++ /dev/null @@ -1,4 +0,0 @@ -=render 'submenu' -.col-xs-12.col-md-10.col-md-offset-1 - .row - .alert.alert-danger.text-center=t('layout.projects.no_github_repo_error', organization:@project.github_get_organization) \ No newline at end of file diff --git a/app/views/projects/project/project/index.html.haml b/app/views/projects/project/project/index.html.haml deleted file mode 100644 index 4c4415041..000000000 --- a/app/views/projects/project/project/index.html.haml +++ /dev/null @@ -1,14 +0,0 @@ --title = title_object(@project) --set_meta_tags title: "#{title}" --set_meta_tags og: { title: title, - description: truncate(@project.github_data.description, length: 255) } --set_meta_tags twitter: { title: title, - description: truncate(@project.github_data.description, length: 200) } - -=render 'submenu' -.col-xs-12.col-md-10.col-md-offset-1 - .row - %h3=@project.name - %a{:href => @project.github_data.html_url, :target => "_blank"}=t("layout.projects.github_link") - %hr - =@project.github_data.description \ No newline at end of file diff --git a/app/views/projects/projects/_form.html.slim b/app/views/projects/projects/_form.html.slim index c1b47c981..3ce2236a7 100644 --- a/app/views/projects/projects/_form.html.slim +++ b/app/views/projects/projects/_form.html.slim @@ -1,7 +1,6 @@ - act = controller.action_name.to_sym div ng-controller = 'ProjectFromController' ng-cloak = 'true' = f.input :name - = f.input :description, as: :text = f.input :github_organization - if [:new, :create].include? act diff --git a/app/views/projects/projects/edit.html.slim b/app/views/projects/projects/edit.html.slim index 304eb2988..8bad4555a 100644 --- a/app/views/projects/projects/edit.html.slim +++ b/app/views/projects/projects/edit.html.slim @@ -3,7 +3,6 @@ .container.col-md-offset-2.col-md-8 .row - == render 'settings_menu' = simple_form_for @project, html: { class: 'form-horizontal' }, wrapper: :horizontal_form, diff --git a/app/views/projects/projects/index.html.slim b/app/views/projects/projects/index.html.slim index 8eecd91ca..0ee3fb2ce 100644 --- a/app/views/projects/projects/index.html.slim +++ b/app/views/projects/projects/index.html.slim @@ -19,7 +19,6 @@ tr th th= t 'activerecord.attributes.project.name' - th= t 'activerecord.attributes.project.description' th th= t 'layout.projects.role' th= t 'layout.projects.remove_user' @@ -29,7 +28,6 @@ i.fa ng-class = 'item.visibility_class' td a[ ng-href = '{{item.link}}' ] {{item.name_with_owner}} - td[] {{item.description}} td i.fa.roffset5 ng-class = 'item.participant_class' td[] {{item.user_role_name}} diff --git a/app/views/projects/projects/index.json.jbuilder b/app/views/projects/projects/index.json.jbuilder index 6305340f3..dacd2cd57 100644 --- a/app/views/projects/projects/index.json.jbuilder +++ b/app/views/projects/projects/index.json.jbuilder @@ -5,7 +5,6 @@ json.projects do json.visibility_class fa_visibility_icon(item) json.name_with_owner item.name_with_owner json.link project_path(item) - json.description item.description json.participant_class participant_class(alone_member, item) json.user_role_name t("layout.collaborators.role_names.#{current_user.best_role item}") json.can_leave_project item.owner != current_user && alone_member diff --git a/app/views/projects/projects/refs_list.html.haml b/app/views/projects/projects/refs_list.html.haml deleted file mode 100644 index 5d9670a0d..000000000 --- a/app/views/projects/projects/refs_list.html.haml +++ /dev/null @@ -1 +0,0 @@ -=render 'projects/pull_requests/ref_select', kind: 'to', project: @project, current: @selected diff --git a/app/views/projects/projects/sections.html.haml b/app/views/projects/projects/sections.html.haml deleted file mode 100644 index 595e66c62..000000000 --- a/app/views/projects/projects/sections.html.haml +++ /dev/null @@ -1,20 +0,0 @@ --set_meta_tags title: [title_object(@project), t('layout.projects.sections')] -= render 'submenu' - -.container.col-md-offset-2.col-md-8 - .row - = render 'settings_menu' - - = simple_form_for @project, url: sections_project_path(@project), - html: { class: 'form-horizontal' }, - wrapper: :horizontal_form, - wrapper_mappings: { boolean: :horizontal_boolean } do |f| - - = f.input :has_issues, as: :boolean, - hint: t('layout.projects.has_issue_description') - - = f.input :has_wiki, as: :boolean, - hint: t('layout.projects.has_wiki_description') - - .col-sm-offset-3.col-sm-9 - = submit_button_tag diff --git a/app/views/projects/pull_requests/_activity.html.slim b/app/views/projects/pull_requests/_activity.html.slim deleted file mode 100644 index 6f9b1a337..000000000 --- a/app/views/projects/pull_requests/_activity.html.slim +++ /dev/null @@ -1,32 +0,0 @@ -hr -- commits_queue = [] -- diff_counter = 0 - --merge_activity(@comments, @commits).each do |item| - -if item.is_a? Comment - == render 'projects/git/commits/commits_small', commits: commits_queue if commits_queue.present? - -commits_queue.clear - -unless item.created_from_commit_hash - == render 'projects/comments/comment', comment: item, data: {project: @project, commentable: @commentable} - -else - - GitPresenters::CommitAsMessagePresenter.present(nil, comment: item) do |presenter| - == render 'shared/feed_message', presenter: presenter, item_no: "-#{item.id}" - -elsif item.is_a? Grit::Commit - -commits_queue << item - -elsif item.is_a? Array - == render 'projects/git/commits/commits_small', commits: commits_queue if commits_queue.present? - -commits_queue.clear - -unless item[1].first.data[:actual] - -exp_id = "expand-comment#{item[1].first.id}" - .activity.panel.panel-default - .panel-heading - => t '.show_outdated_diff' - span>[ class = 'glyphicon glyphicon-chevron-down pointer' - data-toggle = 'collapse' - data-target = "#content-#{exp_id}" ] - .panel-body.collapse id = "content-#{exp_id}" - == render 'projects/pull_requests/discussion_comments', item: item, diff_counter: diff_counter - -else - == render 'projects/pull_requests/discussion_comments', item: item, diff_counter: diff_counter - - diff_counter += 1 -== render 'projects/git/commits/commits_small', commits: commits_queue if commits_queue.present? diff --git a/app/views/projects/pull_requests/_commits_tab.html.slim b/app/views/projects/pull_requests/_commits_tab.html.slim deleted file mode 100644 index 01df12113..000000000 --- a/app/views/projects/pull_requests/_commits_tab.html.slim +++ /dev/null @@ -1,3 +0,0 @@ -- if @total_commits > @commits.count - h4= t("projects.pull_requests.is_big", count: @commits.count) -== render partial: 'projects/git/commits/commits', object: @commits, locals: { project: @pull.from_project } diff --git a/app/views/projects/pull_requests/_diff_tab.html.slim b/app/views/projects/pull_requests/_diff_tab.html.slim deleted file mode 100644 index cf42ee54d..000000000 --- a/app/views/projects/pull_requests/_diff_tab.html.slim +++ /dev/null @@ -1,10 +0,0 @@ --begin - - diff = @pull.diff - == render_diff_stats(stats: @stats, diff: diff, repo: @pull.repo, - commit: @pull.from_commit, common_ancestor: @pull.to_commit) - == render partial: 'pull_diff', collection: diff -- rescue => ex - -if ex.try(:message) == 'Grit::Git::GitTimeout' - p= t 'layout.git.repositories.commit_diff_too_big' - -else - -raise ex diff --git a/app/views/projects/pull_requests/_discussion_comments.html.slim b/app/views/projects/pull_requests/_discussion_comments.html.slim deleted file mode 100644 index c6569c6d6..000000000 --- a/app/views/projects/pull_requests/_discussion_comments.html.slim +++ /dev/null @@ -1,18 +0,0 @@ --comment = item[1].first -.panel.panel-default.offset10 - .panel-heading - =comment.data[:view_path] - .pull-right - -if comment.actual_inline_comment? @pull.diff - = link_to t("layout.pull_requests.view_full_changes"), - "#{project_commentable_path(@project, @commentable)}##{comment_anchor(comment)}", - class: 'link_to_full_changes' - -else - => t'projects.pull_requests.outdated_diff' - .fa.fa-close.fa-lg.text-danger - .panel-body - == render_diff(comment.inline_diff, - diff_counter: diff_counter, - comments: item[1], - filepath: comment.data[:path], - diff_prefix: 'discussion') diff --git a/app/views/projects/pull_requests/_nav_tabs.html.slim b/app/views/projects/pull_requests/_nav_tabs.html.slim deleted file mode 100644 index cc1f3fef5..000000000 --- a/app/views/projects/pull_requests/_nav_tabs.html.slim +++ /dev/null @@ -1,21 +0,0 @@ -ul.nav.nav-tabs#pull_tabs role = 'tablist' - li role = 'presentation' ng-class = '{active: pullCtrl.active_tab == "discussion"}' - a[ data-toggle = 'tab' - role = 'tab' - aria-controls = 'discussion' - ng-click = 'pullCtrl.getActivity()' - href = '#discussion' ]= t 'pull_requests.tabs.discussion' - -if @stats - li role = 'presentation' ng-class = '{active: pullCtrl.active_tab == "diff"}' - a[ data-toggle = 'tab' - role = 'tab' - aria-controls = 'diff' - ng-click = 'pullCtrl.getDiff()' - href = "#diff" ]= "#{t'pull_requests.tabs.diff'} ({{ pullCtrl.pull.stats_count }})" - -if @commits - li role = 'presentation' ng-class = '{active: pullCtrl.active_tab == "commits"}' - a[ data-toggle = 'tab' - role = 'tab' - aria-controls = 'commits' - ng-click = 'pullCtrl.getCommits()' - href = '#commits' ]= "#{t'pull_requests.tabs.commits'} ({{ pullCtrl.pull.commits_count }})" diff --git a/app/views/projects/pull_requests/_nav_tabs_new.html.slim b/app/views/projects/pull_requests/_nav_tabs_new.html.slim deleted file mode 100644 index f963a116d..000000000 --- a/app/views/projects/pull_requests/_nav_tabs_new.html.slim +++ /dev/null @@ -1,20 +0,0 @@ -ul.nav.nav-tabs#pull_tabs role = 'tablist' - li role = 'presentation' class = 'active' - a[ data-toggle = 'tab' - role = 'tab' - aria-controls = 'discussion' - href = '#discussion' ]= t 'pull_requests.tabs.discussion' - -if @stats - li role = 'presentation' - a[ data-toggle = 'tab' - role = 'tab' - aria-controls = 'diff' - href = "#diff" ]= "#{t'pull_requests.tabs.diff'} (#{@stats.count})" - -if @commits - - commits_message = @commits.count.to_s - - commits_message << '+' if @total_commits > @commits.count - li role = 'presentation' - a[ data-toggle = 'tab' - role = 'tab' - aria-controls = 'commits' - href = '#commits' ]= "#{t'pull_requests.tabs.commits'} (#{commits_message})" diff --git a/app/views/projects/pull_requests/_pull_diff.html.slim b/app/views/projects/pull_requests/_pull_diff.html.slim deleted file mode 100644 index 66ff9e01f..000000000 --- a/app/views/projects/pull_requests/_pull_diff.html.slim +++ /dev/null @@ -1,38 +0,0 @@ -- diff = pull_diff -- diff_counter = "diff-#{pull_diff_counter}" - -- parent_commit = @pull.to_commit -- commit_id = get_commit_id_for_file diff, @pull.from_commit, parent_commit -- diff_counter_content = "#{diff_counter}_content" -- blob = file_blob_in_diff(@pull.repo, commit_id, diff) -- is_file_open = 'in' if is_file_open_in_diff(blob, diff) - -.file.offset10 - a name = diff_counter - .top - button.btn.btn-link.pull-left[ type = 'button' - data-toggle = 'collapse' - data-target = "##{diff_counter_content}" - aria-expanded = 'true' - aria-controls = diff_counter_content ] - span.fa class= (is_file_open ? 'fa-chevron-down' : 'fa-chevron-up') - =< diff_file_icon(diff).html_safe - =< get_filename_in_diff(diff, diff.a_path) - - if @pull.from_project.present? - button.btn.btn-link.pull-right - = link_to "view file @ #{short_hash_id(commit_id)}", blob_path(@pull.from_project, commit_id, pull_diff.b_path) - .clearfix - - .diff_data.collapse id= diff_counter_content class= is_file_open - - if blob.render_as == :image && diff.diff.present? - - old_blob = file_blob_in_diff(@project.repo, parent_commit.id, diff) - == render 'projects/git/commits/show_image', diff: diff, blob: blob, old_blob: old_blob - - - if diff.a_mode != diff.b_mode && diff.diff.blank? - == render 'file_change_mode', blob: blob, diff: diff - - - elsif diff.diff.blank? && diff.renamed_file - == render 'projects/git/commits/file_removed_not_changed', blob: blob - - - elsif !blob.binary? - == render_diff(pull_diff, diff_counter: pull_diff_counter, comments: @comments) unless blob.binary? diff --git a/app/views/projects/pull_requests/_ref_select.html.slim b/app/views/projects/pull_requests/_ref_select.html.slim deleted file mode 100644 index 797d5fcef..000000000 --- a/app/views/projects/pull_requests/_ref_select.html.slim +++ /dev/null @@ -1,4 +0,0 @@ --ref="#{kind}_ref" -= select_tag ref, ref_selector_options(project, current), id: ref, - class: 'form-control col-sm-5', name: "pull_request[#{ref}]" - diff --git a/app/views/projects/pull_requests/_status.html.slim b/app/views/projects/pull_requests/_status.html.slim deleted file mode 100644 index b94c27c3f..000000000 --- a/app/views/projects/pull_requests/_status.html.slim +++ /dev/null @@ -1,60 +0,0 @@ -i> class= 'fa fa-spinner fa-spin fa-lg offset10 boffset10' ng-show= 'pullCtrl.processing' -- if policy(@pull).merge? - button.btn.btn-success[ href= '' - ng-click= 'pullCtrl.merge()' - ng-show= "pullCtrl.pull.status == 'ready'" - ng-disabled= 'pullCtrl.processing' ] - = t 'projects.pull_requests.ready' - -h5 ng-show = '!pullCtrl.pull.mergeable' - .label.label-warning ng-show="pullCtrl.pull.status == 'blocked'" - = t 'projects.pull_requests.blocked' - div ng-show="pullCtrl.pull.status == 'merged'" - a>[ ng-href='{{pullCtrl.pull.merged_by.path}}' title='{{pullCtrl.pull.merged_by.fullname}}' ] - img>[ ng-src='{{pullCtrl.pull.merged_by.image}}' ] - | {{pullCtrl.pull.merged_by.uname}} - - => t 'projects.pull_requests.merged' - - span title='{{pullCtrl.pull.merged_at_utc}}' - | {{ pullCtrl.pull.merged_at | amDateFormat:'ddd, D MMM YYYY, HH:mm' }} ( - span am-time-ago='pullCtrl.pull.merged_at' - | ) - - div ng-show="pullCtrl.pull.status == 'closed'" - a>[ ng-href='{{pullCtrl.pull.closed_by.path}}' title='{{pullCtrl.pull.closed_by.fullname}}' ] - img>[ ng-src='{{pullCtrl.pull.closed_by.image}}' ] - | {{pullCtrl.pull.closed_by.uname}} - => t 'projects.pull_requests.closed' - - span title='{{pullCtrl.pull.closed_at_utc}}' - | {{ pullCtrl.pull.closed_at | amDateFormat:'ddd, D MMM YYYY, HH:mm' }} ( - span am-time-ago='pullCtrl.pull.closed_at' - | ) - -- if !@pull.cross_pull? && policy(@project).write? - div[ ng-init= "pullCtrl.getBranch('#{@pull.from_ref}')" - ng-show= "pullCtrl.pull.status == 'closed' || pullCtrl.pull.status == 'merged'" ] - button.btn.btn-primary[ href= '' - ng-click= 'pullCtrl.deleteBranch()' - ng-show= "pullCtrl.branch && pullCtrl.branch.object.sha == pullCtrl.pull.from_ref.sha" - ng-disabled= 'pullCtrl.processing' ] - = t 'layout.projects.delete_branch' - button.btn.btn-primary[ href= '' - ng-click= 'pullCtrl.restoreBranch()' - ng-hide= 'pullCtrl.branch' - ng-disabled= 'pullCtrl.processing' ] - = t 'layout.projects.restore_branch' - .clearfix - -- if policy(@pull).update? - button.btn.btn-primary.pull-right[ href= '' - ng-click= 'pullCtrl.reopen()' - ng-show= "pullCtrl.pull.status == 'closed'" - ng-disabled= 'pullCtrl.processing' ] - = t '.reopen' - button.btn.btn-danger.pull-right[ href= '' - ng-click= 'pullCtrl.close()' - ng-show= "pullCtrl.pull.status == 'ready' || pullCtrl.pull.status == 'open' || pullCtrl.pull.status == 'blocked'" - ng-disabled= 'pullCtrl.processing' ] - = t '.close' diff --git a/app/views/projects/pull_requests/new.html.slim b/app/views/projects/pull_requests/new.html.slim deleted file mode 100644 index 93699594d..000000000 --- a/app/views/projects/pull_requests/new.html.slim +++ /dev/null @@ -1,66 +0,0 @@ --ar = 'activerecord.attributes.pull_request' --set_meta_tags title: [title_object(@project), t('.title')] -== render 'submenu' -== render "projects/comments/markdown_help" if current_user - -.col-xs-12.col-md-10.col-md-offset-1 ng-cloak = true - h3= pull_header @pull - .row - .col-lg-12 - div role = 'tabpanel' - == render 'nav_tabs_new' - - .tab-content - #discussion.tab-pane.active - =hidden_field_tag :update_action, new_project_pull_request_path - = simple_form_for @pull, url: (@pull.already? ? new_project_pull_request_path : project_pull_requests_path), - html: {method: (@pull.already? ? :get : :post)} do |f| - - .form-group.offset10 - = f.label :from_project, t("#{ar}.from_project"), class: 'col-sm-2 control-label' - .col-sm-10 - .row - .col-sm-5 - = text_field_tag :from_project, @pull.from_project.name_with_owner, readonly: :readonly, style: 'background-color: #DDD;', class: 'form-control col-sm-5' - .col-sm-5== render 'ref_select', kind: 'from', project: @pull.from_project, current: @pull.from_ref - .clearfix.boffset5 - .form-group - = f.label :to_project, t("#{ar}.to_project"), class: 'col-sm-2 control-label' - .col-sm-10 - .row - .col-sm-5 - input[ id = 'to_project' - data-ajax = autocomplete_to_project_project_pull_requests_path - value = @pull.to_project.name_with_owner - id_element = 'pull_request_to_project_id' - name = 'to_project' - class = 'form-control typeahead' ] - .col-sm-5== render 'ref_select', kind: 'to', project: @pull.to_project, current: @pull.to_ref - .clearfix - - .form-group - .col-sm-offset-2.col-sm-10 - = f.submit t('.update'), class: 'btn btn-primary offset10', - style: @pull.already? ? '' : 'display: none;', - id: 'update_pull', data: {'disable-with' => t('layout.processing')} - - -unless @pull.already? - .clearfix - .offset10 ng-controller = 'IssueController as issueCtrl' ng-cloak = true - = f.fields_for :issue do |issue| - == render 'projects/issues/form', f: issue - .form-group - .col-sm-offset-2.col-sm-10 - = f.submit t('.submit'), class: 'btn btn-primary', id: 'create_pull', - data: {'disable-with' => t('layout.processing')} unless @pull.already? - - if !@pull.already? && @stats != nil - #diff.tab-pane - .offset10.content - == render 'diff_tab' - - #commits.tab-pane - .offset10.content - == render 'commits_tab' - -- content_for :additional_scripts do - == render 'projects/issues/init_service.js.erb' diff --git a/app/views/projects/pull_requests/show.html.slim b/app/views/projects/pull_requests/show.html.slim deleted file mode 100644 index e34b0368a..000000000 --- a/app/views/projects/pull_requests/show.html.slim +++ /dev/null @@ -1,41 +0,0 @@ --set_meta_tags title: [title_object(@project), t('.title', name: @pull.title.truncate(40), user: @pull.user.try(:uname))] -== render 'submenu' -== render "projects/comments/markdown_help" if current_user - -.col-xs-12.col-md-10.col-md-offset-1 ng-controller = 'PullRequestController as pullCtrl' ng-cloak = true - h3.bpadding10 - - PullRequest::STATUSES.each do |status| - = pull_status_label status, 'ng-show' => "pullCtrl.pull.status == '#{status}'" - =< pull_header @pull - - div role = 'tabpanel' - == render 'nav_tabs' - - .tab-content - #discussion.tab-pane role = 'tabpanel' - div[ ng-controller = 'IssueController as issueCtrl' ng-cloak = true ] - == render 'projects/issues/header' - - ctrl_params = "{ kind: 'pull', id: #{@issue.serial_id} }" - div[ ng-controller = 'CommentsController as commentsCtrl' - ng-init = "commentsCtrl.init('#{@project.name_with_owner}', #{ctrl_params})" ] - - #pull-activity ng-hide = 'pullCtrl.processing' - i.fa.fa-spinner.fa-spin.fa-lg ng-show = 'pullCtrl.processing' - - if current_user - hr - == render 'projects/comments/add', project: @project, commentable: @issue - .pull_status.offset10== render 'status' - - #diff.tab-pane - .offset10.content ng-hide = 'pullCtrl.processing' - i.fa.fa-spinner.fa-spin.fa-lg.offset10 ng-show = 'pullCtrl.processing' - - #commits.tab-pane - .offset10.content ng-hide = 'pullCtrl.processing' - i.fa.fa-spinner.fa-spin.fa-lg.offset10 ng-show = 'pullCtrl.processing' - -div ng-non-bindable = true - == render 'projects/comments/new_line' - -- content_for :additional_scripts do - == render 'projects/issues/init_service.js.erb' diff --git a/app/views/projects/pull_requests/show.json.jbuilder b/app/views/projects/pull_requests/show.json.jbuilder deleted file mode 100644 index 17dc944a3..000000000 --- a/app/views/projects/pull_requests/show.json.jbuilder +++ /dev/null @@ -1,59 +0,0 @@ -json.pull_request do - - json.number @pull.serial_id - json.(@pull, :status, :updated_at) - json.to_ref do - json.ref @pull.to_ref - json.sha @pull.to_commit.try(:id) - json.project do - json.(@pull.to_project, :id, :name) - json.owner_uname @pull.to_project.owner.uname - end - end - json.from_ref do - json.ref @pull.from_ref - json.sha @pull.from_commit.try(:id) - json.project do - json.(@pull.from_project, :id, :name) if @pull.from_project.present? - json.owner_uname @pull.to_project.owner.uname - end - end - - json.owner do - json.(@pull.user, :id, :name, :uname) - end - - json.assignee do - json.(@pull.issue.assignee, :id, :name, :uname) - end if @pull.issue.assignee - json.mergeable @pull.can_merging? - - if @pull.merged? - json.merged_at @pull.issue.closed_at - json.merged_at_utc @pull.issue.closed_at.strftime('%Y-%m-%d %H:%M:%S UTC') - end - - if @pull.closed? - json.closed_at @pull.issue.closed_at - json.closed_at_utc @pull.issue.closed_at.strftime('%Y-%m-%d %H:%M:%S UTC') - end - - if @pull.issue.closer - json.closed_by do - json.(@pull.issue.closer, :uname, :fullname) - json.path user_path(@pull.issue.closer) - json.image avatar_url(@pull.issue.closer) - end - json.merged_by do - json.(@pull.issue.closer, :uname, :fullname) - json.path user_path(@pull.issue.closer) - json.image avatar_url(@pull.issue.closer) - end if @pull.merged? - end - - commits_count = @commits.count.to_s - commits_count << '+' if @total_commits > @commits.count - - json.stats_count @stats.count - json.commits_count commits_count -end diff --git a/app/views/projects/subscribes/_subscribe_status.html.slim b/app/views/projects/subscribes/_subscribe_status.html.slim deleted file mode 100644 index 169bbad6f..000000000 --- a/app/views/projects/subscribes/_subscribe_status.html.slim +++ /dev/null @@ -1,15 +0,0 @@ -- if Comment.issue_comment?(commentable.class) - - is_subscribed = commentable.subscribes.exists?(user_id: current_user.id) - - subscribe_path = is_subscribed ? project_issue_unsubscribe_path(project, commentable) : project_issue_subscribe_path(project, commentable) -- else Comment.commit_comment?(commentable.class) - - is_subscribed = Subscribe.subscribed_to_commit?(project, current_user, commentable) - - subscribe_path = is_subscribed ? unsubscribe_commit_path(project, commentable) : subscribe_commit_path(project, commentable) - -- if is_subscribed - span.label.label-success> - = t('layout.turned_on') - = link_to t('layout.commits.unsubscribe_btn'), subscribe_path, method: :delete -- else - span.label.label-danger> - = t('layout.turned_off') - = link_to t('layout.commits.subscribe_btn'), subscribe_path, method: :post diff --git a/app/views/projects/subscribes/status.html.slim b/app/views/projects/subscribes/status.html.slim deleted file mode 100644 index b9484bcde..000000000 --- a/app/views/projects/subscribes/status.html.slim +++ /dev/null @@ -1 +0,0 @@ -== render 'subscribe_status', project: @project, commentable: @issue diff --git a/app/views/projects/wiki/_diff_data.html.haml b/app/views/projects/wiki/_diff_data.html.haml deleted file mode 100644 index 468b47a3c..000000000 --- a/app/views/projects/wiki/_diff_data.html.haml +++ /dev/null @@ -1,7 +0,0 @@ -.file - %a{name: "diff-#{diff_counter}"} - .top - .l= h((diff.deleted_file ? diff.a_path : diff.b_path).rtruncate 100) - .clear - .diff_data.highlight= render_diff(diff, diff_counter: diff_counter, in_wiki: true) - diff --git a/app/views/projects/wiki/_editor.html.slim b/app/views/projects/wiki/_editor.html.slim deleted file mode 100644 index eca15e732..000000000 --- a/app/views/projects/wiki/_editor.html.slim +++ /dev/null @@ -1,19 +0,0 @@ -- wiki_page = WikiPage.new(@name, format, @content, footer.try(:text_data), sidebar.try(:text_data)) -= simple_form_for wiki_page, url: editor_path(@project, @name), html: { method: @new ? :post : :put } do |f| - - - if @new - = f.input :page - - else - = f.hidden_field :page - = f.input :rename - = f.input :format, collection: wiki_formats, include_blank: false - - = f.input :content, as: :text, input_html: { rows: 15 } - - if has_footer? - = f.input :footer, as: :text - - if has_sidebar? - = f.input :sidebar, as: :text - - = f.input :message, as: :text - hr - = f.button :submit, t('wiki.save_button') diff --git a/app/views/projects/wiki/_git_access_message.en.html.haml b/app/views/projects/wiki/_git_access_message.en.html.haml deleted file mode 100644 index 707d4dd0e..000000000 --- a/app/views/projects/wiki/_git_access_message.en.html.haml +++ /dev/null @@ -1,11 +0,0 @@ -%p - Your wiki data can be cloned from a git repository for offline access. You have several options for editing it at this point: - %br - %ol - %li With your favorite text editor or IDE. - %li - With the built-in web interface, included with the - = link_to 'Gollum', "https://github.com/github/gollum" - Ruby API. - %li With the Gollum Ruby API. - When you're done, you can simply push your changes back to our system to see them reflected on the site. The wiki repositories obey the same access rules as the source repository that they belong to. \ No newline at end of file diff --git a/app/views/projects/wiki/_git_access_message.ru.html.haml b/app/views/projects/wiki/_git_access_message.ru.html.haml deleted file mode 100644 index 16d5746c2..000000000 --- a/app/views/projects/wiki/_git_access_message.ru.html.haml +++ /dev/null @@ -1,11 +0,0 @@ -%p - Все данные вашей Wiki могут быть клонированы из Git-репозитория для доступа без интернета. В этом случае вы можете редактировать страницы следующими способами: - %br - %ol - %li Вашим любимым текстовым редактором или IDE. - %li - С помощью встроенного Web-интерфейса, включенного в - = link_to 'Gollum', "https://github.com/github/gollum" - Ruby API. - %li С помощью Gollum Ruby API. - Когда изменения будут завершены, просто запуште их обратно в нашу систему чтобы увидеть их на сайте. Доступ к репозиторию Wiki осуществляется с теми же правами, что и к проекту, с которым она связана. \ No newline at end of file diff --git a/app/views/projects/wiki/_gollum_includes.html.haml b/app/views/projects/wiki/_gollum_includes.html.haml deleted file mode 100644 index c3b2db1b7..000000000 --- a/app/views/projects/wiki/_gollum_includes.html.haml +++ /dev/null @@ -1,5 +0,0 @@ -/ - content_for :javascripts do -/ = javascript_include_tag 'gollum/gollum.js', 'gollum/gollum.dialog.js', 'gollum/gollum.placeholder.js' -/ -/ - content_for :stylesheets do -/ = stylesheet_link_tag 'gollum/gollum.css', 'gollum/dialog.css', 'gollum/ie7.css', 'gollum/template.css' diff --git a/app/views/projects/wiki/_history.html.slim b/app/views/projects/wiki/_history.html.slim deleted file mode 100644 index dd020c446..000000000 --- a/app/views/projects/wiki/_history.html.slim +++ /dev/null @@ -1,25 +0,0 @@ -= form_tag compare_path(@project, @name), name: "compare-versions", id: "version-form" do - - input.btn.btn-primary name='commit' type='submit' value=t('wiki.compare_revisions') ng-disabled='selected != 2' - hr - table.table ng-init='selected = 0' - - @versions.each do |v| - tr - td - input type='checkbox' id='versions_' name='versions[]' value=v.id class='history_cbx' ng-model="versions.#{v.id}" ng-change='versions.#{v.id} ? (selected = selected + 1) : (selected = selected - 1)' - td - - user = User.where(email: v.author.email).first - => link_to user_path_by_user(user) do - = image_tag avatar_url_by_email(v.author.email), alt: "avatar: #{v.author.name}", class: 'mini-gravatar' - span - = link_to user_path_by_user(user) do - span.username - = user.present? ? user.fullname : v.author.name - td - => v.message - - if @name - = raw "[#{link_to v.id[0..6], versioned_project_wiki_path(@project, escaped_name, v.id), title: t("wiki.view_commit")}]" - - else - = "[#{v.id[0..6]}]" - .help-block - = datetime_moment v.committed_date, tag: :span, class: 'wiki-gray' diff --git a/app/views/projects/wiki/_page.html.slim b/app/views/projects/wiki/_page.html.slim deleted file mode 100644 index 5488dcbe1..000000000 --- a/app/views/projects/wiki/_page.html.slim +++ /dev/null @@ -1,19 +0,0 @@ -.col-md-12 - = raw @content -- if has_sidebar? - .col-md-12 - = raw sidebar_content -- if has_footer? - .col-md-12 - = raw footer_content - -.col-md-12 - hr - .help-block - => t("wiki.last_edited_by") - b> - = user_link_by_user User.where(email: author_email).first - = datetime_moment date, tag: :span - - unless action_name == 'preview' || !policy(@project).update? - a.btn.btn-danger href=project_wiki_path(@project, escaped_name) data-method='delete' data-confirm=t('layout.confirm') - = t("wiki.delete_page") diff --git a/app/views/projects/wiki/_results.html.slim b/app/views/projects/wiki/_results.html.slim deleted file mode 100644 index 657d125b5..000000000 --- a/app/views/projects/wiki/_results.html.slim +++ /dev/null @@ -1,20 +0,0 @@ -- if @results.present? - ul.list-unstyled - - @results.each do |result| - li - - if action_name == 'search' - a> href=project_wiki_path(@project, CGI.escape(result[:name])) - = result[:name] - span - = "(#{result.count} #{t("wiki.matches")})" - - else - a href=project_wiki_path(@project, CGI.escape(result.name)) - = result.name -- else - p - - @st_ref = capture do - strong= @ref || @query - - if action_name == 'search' - = raw t("wiki.no_results_for_search", query: @st_ref) - - else - = raw t("wiki.no_pages_in", ref: @st_ref) diff --git a/app/views/projects/wiki/_searchbar.html.slim b/app/views/projects/wiki/_searchbar.html.slim deleted file mode 100644 index b4659b03b..000000000 --- a/app/views/projects/wiki/_searchbar.html.slim +++ /dev/null @@ -1,3 +0,0 @@ -hr -= form_tag search_project_wiki_index_path(@project), method: :get, class: 'form' do - input.form-control type='text' name='q' placeholder=t('wiki.search_and_hellip') value=params[:q] diff --git a/app/views/projects/wiki/_sidebar.html.slim b/app/views/projects/wiki/_sidebar.html.slim deleted file mode 100644 index cc6bac9fd..000000000 --- a/app/views/projects/wiki/_sidebar.html.slim +++ /dev/null @@ -1,22 +0,0 @@ -- act = action_name.intern -.panel.panel-default - .panel-body - ul.nav.nav-pills.nav-stacked - - li class=('active' if (act == :show && @name == 'Home') || act == :index) - a href=project_wiki_index_path(@project) - = t('wiki.home') - - li class=('active' if act == :pages) - a href=pages_project_wiki_index_path(@project) - = t('wiki.pages') - - li class=('active' if act == :wiki_history || act == :compare_wiki) - a href=history_project_wiki_index_path(@project) - = t('wiki.wiki_history') - - li class=('active' if act == :git) - a href=git_project_wiki_index_path(@project) - = t('wiki.git_access') - li - = render 'searchbar' diff --git a/app/views/projects/wiki/compare.html.slim b/app/views/projects/wiki/compare.html.slim deleted file mode 100644 index a94c5ca65..000000000 --- a/app/views/projects/wiki/compare.html.slim +++ /dev/null @@ -1,32 +0,0 @@ -- set_meta_tags title: [title_object(@project), t('.title')] - -== render 'submenu' - -.row - .col-md-2.col-md-offset-1 - == render 'sidebar' - .col-md-8 - - .row - .col-md-6 - h3 - - if @name - => t('wiki.history_for') - strong= @page.name - - else - = t('wiki.wiki_history') - .col-md-6.offset10 - = simple_form_for :project, url: revert_path(@project, @versions.first[0..6], (@versions.size == 1) ? 'prev' : @versions.last[0..6], @name) do |f| - - if policy(@project).read? - a.btn.btn-primary> href=(@name ? history_project_wiki_path(@project, escaped_name) : history_project_wiki_index_path(@project)) - = t('wiki.back_to_history') - - - if policy(@project).write? - = f.button :submit, t("wiki.revert_page#{action_name == 'revert' ? '' : 's'}") - - hr - .row - .col-md-12 - == render partial: 'diff_data', collection: @diffs, as: :diff - hr - = link_to t("wiki.back_to_top"), '#wiki' diff --git a/app/views/projects/wiki/edit.html.slim b/app/views/projects/wiki/edit.html.slim deleted file mode 100644 index b004ca9c4..000000000 --- a/app/views/projects/wiki/edit.html.slim +++ /dev/null @@ -1,25 +0,0 @@ -- set_meta_tags title: [title_object(@project), "#{t('wiki.editing_page')} #{@page.name}"] - -== render 'submenu' - - -.row - .col-md-2.col-md-offset-1 - == render 'sidebar' - .col-md-8 - - .row - .col-md-8 - h3 - => t('wiki.editing_page') - strong= @page.name - - if policy(@project).read? - .col-md-4.offset10 - a.btn.btn-primary> href=view_path(@project, escaped_name) - = t('wiki.view_page') - a.btn.btn-primary> href=history_project_wiki_path(@project, escaped_name) - = t('wiki.page_history') - hr - .row - .col-md-12 - == render 'editor' diff --git a/app/views/projects/wiki/git.html.slim b/app/views/projects/wiki/git.html.slim deleted file mode 100644 index 8b1913164..000000000 --- a/app/views/projects/wiki/git.html.slim +++ /dev/null @@ -1,24 +0,0 @@ --set_meta_tags title: [title_object(@project), t('wiki.git_access')] - -== render 'submenu' - -.row - .col-md-2.col-md-offset-1 - == render 'sidebar' - .col-md-8 - nav.navbar.navbar-default - .collapse.navbar-collapse - .navbar-text.navbar-left - a.navbar-link - i.fa.fa-code-fork.fa-lg - form.navbar-form.navbar-left - .form-group - input.form-control type='text' value=git_repo_url(@project.wiki_repo_name) readonly=true - .navbar-text.navbar-left - a.navbar-link - i.fa.fa-clipboard.fa-lg - .navbar-text.navbar-left - = policy(@project).write? ? t("layout.read_write_access") : t("layout.read_access") - - - == render 'git_access_message' diff --git a/app/views/projects/wiki/history.html.slim b/app/views/projects/wiki/history.html.slim deleted file mode 100644 index 64a7d1423..000000000 --- a/app/views/projects/wiki/history.html.slim +++ /dev/null @@ -1,10 +0,0 @@ --set_meta_tags title: [title_object(@project), t('wiki.wiki_history')] - -== render 'submenu' - -.row - .col-md-2.col-md-offset-1 - == render 'sidebar' - .col-md-8 - == render 'history' - diff --git a/app/views/projects/wiki/new.html.slim b/app/views/projects/wiki/new.html.slim deleted file mode 100644 index cfe2f28c2..000000000 --- a/app/views/projects/wiki/new.html.slim +++ /dev/null @@ -1,17 +0,0 @@ -== render 'submenu' - - -.row - .col-md-2.col-md-offset-1 - == render 'sidebar' - .col-md-8 - - .row - .col-md-8 - h3 - => t('wiki.create_page') - strong= @name - hr - .row - .col-md-12 - == render 'editor' diff --git a/app/views/projects/wiki/pages.html.slim b/app/views/projects/wiki/pages.html.slim deleted file mode 100644 index 6c784af6b..000000000 --- a/app/views/projects/wiki/pages.html.slim +++ /dev/null @@ -1,14 +0,0 @@ -- set_meta_tags title: [title_object(@project), t('wiki.pages')] - -== render 'submenu' - -.row - .col-md-2.col-md-offset-1 - == render 'sidebar' - .col-md-8 - - if policy(@project).write? - a.btn.btn-primary href=new_project_wiki_path(@project) - = t("wiki.new_page") - hr - - == render "results" diff --git a/app/views/projects/wiki/search.html.slim b/app/views/projects/wiki/search.html.slim deleted file mode 100644 index 093f363c8..000000000 --- a/app/views/projects/wiki/search.html.slim +++ /dev/null @@ -1,23 +0,0 @@ -- set_meta_tags title: [title_object(@project), @query, t('wiki.searching.title')] - -== render 'submenu' - -.row - .col-md-2.col-md-offset-1 - == render 'sidebar' - .col-md-8 - - .row - .col-md-8 - h3 - - @st_query = capture do - strong= @query - = raw t("wiki.search_results_for", query: @st_query) - - if policy(@project).read? - .col-md-2.offset10 - a.btn.btn-primary href=project_wiki_index_path(@project) - = t('wiki.home') - hr - .row - .col-md-12 - == render 'results' diff --git a/app/views/projects/wiki/show.html.slim b/app/views/projects/wiki/show.html.slim deleted file mode 100644 index 7f9c397c3..000000000 --- a/app/views/projects/wiki/show.html.slim +++ /dev/null @@ -1,28 +0,0 @@ -- set_meta_tags title: [title_object(@project), @page.name] - -== render 'submenu' - -.row - .col-md-2.col-md-offset-1 - == render 'sidebar' - .col-md-8 - - .row - .col-md-4 - h3 - = @page.name - = "(#{ t("wiki.preview") })" if action_name == 'preview' - - unless action_name == 'preview' - .col-md-8.offset10 - a.btn.btn-primary> href=history_project_wiki_path(@project, escaped_name) - = t('wiki.page_history') - - if @editable - a.btn.btn-primary> href=edit_project_wiki_path(@project, escaped_name) - = t('wiki.edit_page') - - if policy(@project).write? - a.btn.btn-primary href=new_project_wiki_path(@project) - = t('wiki.new_page') - hr - .row - .col-md-8 - == render 'page' diff --git a/app/views/statistics/_commits.html.slim b/app/views/statistics/_commits.html.slim deleted file mode 100644 index 3b6f77fd6..000000000 --- a/app/views/statistics/_commits.html.slim +++ /dev/null @@ -1,26 +0,0 @@ -.row - .col-md-12 - h3.text-info - = t('.header') - -.row - .col-md-8 - .graph-wrapper - b - span.graph-key-color1> - = t('.commits_title') - .text-center.graph-loading ng-show='loading' - = image_tag 'loading-large.gif' - .text-center.no-data ng-hide='loading || statistics.commits' - = t('.no_data') - canvas#commits_chart ng-show='statistics.commits' - - .col-md-3 - .panel-wrapper - b - = t('.total_commits') - .panel-data - = image_tag 'loading-small.gif', ng_show: 'loading' - .no-data ng-hide='loading || statistics.commits.commits_count >= 0' - = t('.no_data') - | {{ statistics.commits.commits_count | number }} diff --git a/app/views/statistics/_issues.html.slim b/app/views/statistics/_issues.html.slim deleted file mode 100644 index 167a4c343..000000000 --- a/app/views/statistics/_issues.html.slim +++ /dev/null @@ -1,48 +0,0 @@ -.row - .col-md-12 - h3.text-info - = t('.header') - -.row - .col-md-8 - .graph-wrapper - b - span.graph-key-color1> - = t('.open_title') - span.graph-key-color2> - = t('.reopen_title') - span.graph-key-color3> - = t('.closed_title') - .text-center.graph-loading ng-show='loading' - = image_tag 'loading-large.gif' - .text-center.no-data ng-hide='loading || statistics.issues' - = t('.no_data') - canvas#issues_chart ng-show='statistics.issues' - - .col-md-3 - .panel-wrapper - b - = t('.total_open') - .panel-data - = image_tag 'loading-small.gif', ng_show: 'loading' - .no-data ng-hide='loading || statistics.issues.open_count >= 0' - = t('.no_data') - | {{ statistics.issues.open_count | number }} - - .panel-wrapper - b - = t('.total_reopen') - .panel-data - = image_tag 'loading-small.gif', ng_show: 'loading' - .no-data ng-hide='loading || statistics.issues.reopen_count >= 0' - = t('.no_data') - | {{ statistics.issues.reopen_count | number }} - - .panel-wrapper - b - = t('.total_closed') - .panel-data - = image_tag 'loading-small.gif', ng_show: 'loading' - .no-data ng-hide='loading || statistics.issues.closed_count >= 0' - = t('.no_data') - | {{ statistics.issues.closed_count | number }} diff --git a/app/views/statistics/_pull_requests.html.slim b/app/views/statistics/_pull_requests.html.slim deleted file mode 100644 index 9189a68d1..000000000 --- a/app/views/statistics/_pull_requests.html.slim +++ /dev/null @@ -1,48 +0,0 @@ -.row - .col-md-12 - h3.text-info - = t('.header') - -.row - .col-md-8 - .graph-wrapper - b - span.graph-key-color1> - = t('.open_title') - span.graph-key-color2> - = t('.merged_title') - span.graph-key-color3> - = t('.closed_title') - .text-center.graph-loading ng-show='loading' - = image_tag 'loading-large.gif' - .text-center.no-data ng-hide='loading || statistics.pull_requests' - = t('.no_data') - canvas#pull_requests_chart ng-show='statistics.pull_requests' - - .col-md-3 - .panel-wrapper - b - = t('.total_open') - .panel-data - = image_tag 'loading-small.gif', ng_show: 'loading' - .no-data ng-hide='loading || statistics.pull_requests.open_count >= 0' - = t('.no_data') - | {{ statistics.pull_requests.open_count | number }} - - .panel-wrapper - b - = t('.total_merged') - .panel-data - = image_tag 'loading-small.gif', ng_show: 'loading' - .no-data ng-hide='loading || statistics.pull_requests.merged_count >= 0' - = t('.no_data') - | {{ statistics.pull_requests.merged_count | number }} - - .panel-wrapper - b - = t('.total_closed') - .panel-data - = image_tag 'loading-small.gif', ng_show: 'loading' - .no-data ng-hide='loading || statistics.pull_requests.closed_count >= 0' - = t('.no_data') - | {{ statistics.pull_requests.closed_count | number }} diff --git a/app/views/statistics/index.html.slim b/app/views/statistics/index.html.slim index 279b43d52..f98ef650b 100644 --- a/app/views/statistics/index.html.slim +++ b/app/views/statistics/index.html.slim @@ -3,8 +3,4 @@ .container#manage-statistics ng-controller='StatisticsController' ng-init='init()' = render 'filter' - = render 'build_lists' - = render 'commits' - = render 'issues' - = render 'pull_requests' - + = render 'build_lists' \ No newline at end of file diff --git a/app/views/user_mailer/git_delete_branch_notification.html.haml b/app/views/user_mailer/git_delete_branch_notification.html.haml deleted file mode 100644 index 325dda3de..000000000 --- a/app/views/user_mailer/git_delete_branch_notification.html.haml +++ /dev/null @@ -1,9 +0,0 @@ -- user = User.where(email: creator_email).first || User.new(email: creator_email) if defined?(creator_email) - -%p - - _user_link = defined?(creator_email) ? user_link(user, defined?(creator_name) ? creator_name : creator_email, true) : nil - = t('notifications.bodies.delete_branch', branch_name: branch_name, user_link: _user_link).html_safe - - name_with_owner = "#{project_owner}/#{project_name}" - = raw t("notifications.bodies.project", project_link: link_to(name_with_owner, project_url(name_with_owner)) ) - -= render 'footer' \ No newline at end of file diff --git a/app/views/user_mailer/git_new_push_notification.html.haml b/app/views/user_mailer/git_new_push_notification.html.haml deleted file mode 100644 index a8a6e8c97..000000000 --- a/app/views/user_mailer/git_new_push_notification.html.haml +++ /dev/null @@ -1,19 +0,0 @@ -- user = User.where(email: creator_email).first || User.new(email: creator_email) if defined?(creator_email) -- name_with_owner = "#{project_owner}/#{project_name}" - -%p - - _user_link = defined?(creator_email) ? user_link(user, defined?(creator_name) ? creator_name : creator_email, true) : nil - = raw t("notifications.bodies.#{change_type}_branch", {branch_name: branch_name, user_link: _user_link}) - = raw t("notifications.bodies.project", project_link: link_to(name_with_owner, project_url(name_with_owner)) ) - -%p - - last_commits.each do |commit| - = link_to shortest_hash_id(commit[0]), commit_url(name_with_owner, commit[0]) - = commit[1] - %br - - if defined? other_commits - %br - =link_to t('notifications.bodies.more_commits', count: other_commits_count, commits: commits_pluralize(other_commits_count)), - diff_url(name_with_owner, diff: other_commits) - -= render 'footer' \ No newline at end of file diff --git a/app/views/user_mailer/invite_approve_notification.en.haml b/app/views/user_mailer/invite_approve_notification.en.haml deleted file mode 100644 index 7753b1228..000000000 --- a/app/views/user_mailer/invite_approve_notification.en.haml +++ /dev/null @@ -1,7 +0,0 @@ -%p== Hello, #{@register_request.name || @register_request.email}. - -%p - You have been invited to project ABF. Please click on the following - = link_to 'link for registration', new_user_registration_url(invitation_token: @register_request.token) - -%p== Support team «ROSA ABF» diff --git a/app/views/user_mailer/invite_approve_notification.ru.haml b/app/views/user_mailer/invite_approve_notification.ru.haml deleted file mode 100644 index 5e1f3dd57..000000000 --- a/app/views/user_mailer/invite_approve_notification.ru.haml +++ /dev/null @@ -1,7 +0,0 @@ -%p== Здравствуйте, #{@register_request.name || @register_request.email}. - -%p - Вы приглашены в проект ABF. Пожалуйста, перейдите по - = link_to 'ссылке для регистрации', new_user_registration_url(invitation_token: @register_request.token) - -%p== Команда поддержки «ROSA ABF» diff --git a/app/views/user_mailer/issue_assign_notification.en.haml b/app/views/user_mailer/issue_assign_notification.en.haml deleted file mode 100644 index 91522375b..000000000 --- a/app/views/user_mailer/issue_assign_notification.en.haml +++ /dev/null @@ -1,3 +0,0 @@ -%p You have been assigned to issue #{ link_to @issue.title, project_issue_url(@issue.project, @issue) } - -= render 'footer' \ No newline at end of file diff --git a/app/views/user_mailer/issue_assign_notification.ru.haml b/app/views/user_mailer/issue_assign_notification.ru.haml deleted file mode 100644 index 616f120de..000000000 --- a/app/views/user_mailer/issue_assign_notification.ru.haml +++ /dev/null @@ -1,3 +0,0 @@ -%p Вам была назначена задача #{ link_to @issue.title, project_issue_url(@issue.project, @issue) } - -= render 'footer' \ No newline at end of file diff --git a/app/views/user_mailer/new_comment_notification.html.haml b/app/views/user_mailer/new_comment_notification.html.haml deleted file mode 100644 index b98793e0a..000000000 --- a/app/views/user_mailer/new_comment_notification.html.haml +++ /dev/null @@ -1,10 +0,0 @@ -- if @comment.issue_comment? - - link = project_issue_url(@comment.commentable.project, @comment.commentable) << '#comment' -- elsif @comment.commit_comment? - - link = commit_url(@comment.project, @comment.commentable.id) << '#diff-comment' -- link << @comment.id.to_s -%p= @comment.body -%p - = t('notifications.bodies.view_it_on') - = link_to APP_CONFIG['project_name'], link -= render 'footer' diff --git a/app/views/user_mailer/new_issue_notification.html.haml b/app/views/user_mailer/new_issue_notification.html.haml deleted file mode 100644 index 14ffdedfe..000000000 --- a/app/views/user_mailer/new_issue_notification.html.haml +++ /dev/null @@ -1,5 +0,0 @@ -%p= @issue.body -%p - = t('notifications.bodies.view_it_on') - = link_to APP_CONFIG['project_name'], project_issue_url(@issue.project, @issue) -= render 'footer' diff --git a/app/views/users/base/_submenu.html.slim b/app/views/users/base/_submenu.html.slim index d69c473f8..f174765e3 100644 --- a/app/views/users/base/_submenu.html.slim +++ b/app/views/users/base/_submenu.html.slim @@ -33,7 +33,3 @@ a href=notifiers_settings_path i.fa.fa-inbox> = t('layout.users.settings_notifier') - li class=('active' if contr == :ssh_keys) - a href=ssh_keys_path - i.fa.fa-key> - = t('ssh_keys') diff --git a/app/views/users/profile/_statistics.html.slim b/app/views/users/profile/_statistics.html.slim index 7a32f1c94..bf93ef83e 100644 --- a/app/views/users/profile/_statistics.html.slim +++ b/app/views/users/profile/_statistics.html.slim @@ -1,5 +1,2 @@ = render 'statistics/filter', user: @user -= render 'statistics/build_lists' -= render 'statistics/commits' -= render 'statistics/issues' -= render 'statistics/pull_requests' \ No newline at end of file += render 'statistics/build_lists' \ No newline at end of file diff --git a/app/views/users/profile/show.json.jbuilder b/app/views/users/profile/show.json.jbuilder index a8a6240e0..909e93ca4 100644 --- a/app/views/users/profile/show.json.jbuilder +++ b/app/views/users/profile/show.json.jbuilder @@ -1,5 +1,5 @@ json.projects @projects do |project| - json.(project, :name, :description) + json.(project, :name) json.path project_path(project) json.public project.public? json.updated_at project.updated_at diff --git a/app/views/users/register_requests/invite.html.haml b/app/views/users/register_requests/invite.html.haml deleted file mode 100644 index ef0ef7ac1..000000000 --- a/app/views/users/register_requests/invite.html.haml +++ /dev/null @@ -1,44 +0,0 @@ --content_for :nav do - %nav - -if I18n.locale == :ru - %a{href: "#{new_register_request_path}.en"} - %p - English - %br>/ - version - -elsif I18n.locale == :en - %a{href: "#{new_register_request_path}.ru"} - %p - Русская - %br>/ - версия - -.left - %p - =raw t 'invites.description' - %div{style: "clear: both;"} -.right - %h3=t 'invites.want' - %form#new_register_request{"accept-charset" => "UTF-8", action: "/register_requests", method: "post", name: "invite_form"} - .signup-left=t 'invites.name' - .signup-right - %input#email.registartion-input-signup{name: "register_request[name]", onClick: "this.className='registartion-input-focus';disError(this);", onblur: "if(this.value==''){this.value='';this.className='registartion-input-signup';}else{this.className='registartion-input-no-focus';};buttonCheck();", onfocus: "if(this.value=='#{t 'invites.login_email'}'){this.value='';this.className='registartion-input-focus';};", onkeydown: "buttonCheck();", type: "text"}/ - %div{style: "clear: both;"} - .signup-left=t 'invites.email' - .signup-right - %input#email.registartion-input-signup{name: "register_request[email]", onClick: "this.className='registartion-input-focus';disError(this);", onblur: "if(this.value==''){this.value='';this.className='registartion-input-signup';}else{this.className='registartion-input-no-focus';};buttonCheck();", onfocus: "if(this.value=='#{t 'invites.login_email'}'){this.value='';this.className='registartion-input-focus';};", onkeydown: "buttonCheck();", type: "text"}/ - %div{style: "clear: both;"} - .signup-left=raw t 'invites.interest' - .signup-right - %select.registartion-input-signup{name: "register_request[interest]"} - -t('invites.interests').each do |base, title| - %option=title - %div{style: "clear: both;"} - .signup-left=t 'invites.comments' - .signup-right - %textarea.registartion-input-signup{name: "register_request[more]", rows: "3"} - %div{style: "clear: both;"} - =hidden_field_tag :format, I18n.locale - .button - %input.button{type: "submit", value: t('invites.send')} -%div{style: "clear: both;"} diff --git a/app/views/users/register_requests/new.html.haml b/app/views/users/register_requests/new.html.haml deleted file mode 100644 index fc808c9f6..000000000 --- a/app/views/users/register_requests/new.html.haml +++ /dev/null @@ -1,19 +0,0 @@ -#block-login.block - %h2= title t("layout.register_request.get_token_header") - .content.login - - if flash.present? - .flash - - flash.each do |key, value| - .message{ title: key.to_s.humanize, class: (key == 'alert' ? "error" : key) } - %p= value - - form_for(@register_request, html: { class: "form login" }) do |f| - .group.wat-cf - .left= f.label :name, class: "label right" - .right= f.text_field :name, class: "text_field" - .group.wat-cf - .left= f.label :email, class: "label right" - .right= f.text_field :email, class: "text_field" - .group.navform.wat-cf - .right - %button.button{type: "submit"}= t("layout.register_request.get_token_button") - %span.text_button_padding \ No newline at end of file diff --git a/app/views/users/register_requests/thanks.html.haml b/app/views/users/register_requests/thanks.html.haml deleted file mode 100644 index 83ef60466..000000000 --- a/app/views/users/register_requests/thanks.html.haml +++ /dev/null @@ -1,3 +0,0 @@ -.all - %p - %span{style: "font-size: 28px;"}=raw t 'invites.thanks' diff --git a/app/views/users/settings/notifiers.html.slim b/app/views/users/settings/notifiers.html.slim index 96d86c283..e5b96a6e2 100644 --- a/app/views/users/settings/notifiers.html.slim +++ b/app/views/users/settings/notifiers.html.slim @@ -18,19 +18,6 @@ .col-md-6 = f.input :can_notify, as: :boolean - .col-sm-offset-3.col-sm-9 - h4 - = t('layout.settings.notifiers.code_header') - - [:update_code, :new_comment_commit_owner, :new_comment_commit_repo_owner, :new_comment_commit_commentor].each do |field| - = f.input field, as: :boolean - - .col-md-6 - .col-sm-offset-3.col-sm-9 - h4 - = t('layout.settings.notifiers.tracker_header') - - [:new_comment, :new_comment_reply, :new_issue, :issue_assign].each do |field| - = f.input field, as: :boolean - .col-sm-offset-3.col-sm-9 h4 = t('layout.settings.notifiers.build_list_header') diff --git a/app/views/users/ssh_keys/_list.html.slim b/app/views/users/ssh_keys/_list.html.slim deleted file mode 100644 index 4c3e55365..000000000 --- a/app/views/users/ssh_keys/_list.html.slim +++ /dev/null @@ -1,15 +0,0 @@ -table.table.table-striped - thead - tr - th= t('ssh_keys') - th= t('layout.delete') - tbody - - current_user.ssh_keys.each do |key| - tr - td= "#{key.name} (#{key.fingerprint})" - td.buttons - = link_to ssh_key_path(key), - method: :delete, - data: { confirm: t('layout.confirm') } do - - span.glyphicon.glyphicon-remove diff --git a/app/views/users/ssh_keys/_new.html.slim b/app/views/users/ssh_keys/_new.html.slim deleted file mode 100644 index 05a3f5624..000000000 --- a/app/views/users/ssh_keys/_new.html.slim +++ /dev/null @@ -1,7 +0,0 @@ -h3 - = t("layout.key_pairs.header") - -= simple_form_for @ssh_key, url: ssh_keys_path do |f| - = f.input :name - = f.input :key, as: :text - = submit_button_tag \ No newline at end of file diff --git a/app/views/users/ssh_keys/index.html.slim b/app/views/users/ssh_keys/index.html.slim deleted file mode 100644 index 58daaa8ac..000000000 --- a/app/views/users/ssh_keys/index.html.slim +++ /dev/null @@ -1,7 +0,0 @@ -= render 'users/base/submenu' - -.container.col-md-offset-2.col-md-8 - .row - = render 'new' - hr - = render 'list' diff --git a/config/environments/production.rb b/config/environments/production.rb index d50e35c05..c928ce271 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -2,7 +2,7 @@ Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. # Code is not reloaded between requests. - config.cache_classes = true + config.cache_classes = false # Eager load code on boot. This eager loads most of Rails and # your application in memory, allowing both threaded web servers @@ -42,7 +42,7 @@ Rails.application.configure do # config.force_ssl = true # Set to :debug to see everything in the log. - config.log_level = :warn + config.log_level = :debug # Prepend all log lines with the following tags. # config.log_tags = [ :subdomain, :uuid ] diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index c959ab48d..517071c58 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -191,10 +191,6 @@ Devise.setup do |config| # require 'openid/store/filesystem' # config.omniauth :openid, :name => 'open_id' #, :store => OpenID::Store::Filesystem.new('./tmp') - config.omniauth :facebook, APP_CONFIG['keys']['facebook']['id'], APP_CONFIG['keys']['facebook']['secret'] - config.omniauth :google_oauth2, APP_CONFIG['keys']['google']['id'], APP_CONFIG['keys']['google']['secret'], {:access_type => 'offline', :approval_prompt => ''} - config.omniauth :github, APP_CONFIG['keys']['github']['id'], APP_CONFIG['keys']['github']['secret'], {:scope => 'user:email'} - # ==> Warden configuration # If you want to use other strategies, that are not supported by Devise, or # change the failure app, you can configure them inside the config.warden block. diff --git a/config/initializers/github.rb b/config/initializers/github.rb index 7dc39a25f..7f9d09ccc 100644 --- a/config/initializers/github.rb +++ b/config/initializers/github.rb @@ -3,8 +3,8 @@ Github.configure do |c| c.basic_auth = ENV["GITHUB_LOGIN"] + ":" + ENV["GITHUB_PASSWORD"] c.auto_pagination = true - c.stack do |builder| - builder.use Faraday::HttpCache, store: Rails.cache + c.stack = Proc.new do |builder| + builder.use Faraday::HttpCache, store: Rails.cache, logger: Rails.logger end end diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb deleted file mode 100644 index ac033bf9d..000000000 --- a/config/initializers/inflections.rb +++ /dev/null @@ -1,16 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Add new inflection rules using the following format. Inflections -# are locale specific, and you may define rules for as many different -# locales as you wish. All of these examples are active by default: -# ActiveSupport::Inflector.inflections(:en) do |inflect| -# inflect.plural /^(ox)$/i, '\1en' -# inflect.singular /^(ox)en/i, '\1' -# inflect.irregular 'person', 'people' -# inflect.uncountable %w( fish sheep ) -# end - -# These inflection rules are supported but not enabled by default: -# ActiveSupport::Inflector.inflections(:en) do |inflect| -# inflect.acronym 'RESTful' -# end diff --git a/config/initializers/omniauth.rb b/config/initializers/omniauth.rb deleted file mode 100644 index d5f26a3d8..000000000 --- a/config/initializers/omniauth.rb +++ /dev/null @@ -1 +0,0 @@ -OmniAuth.config.logger = Rails.logger \ No newline at end of file diff --git a/config/initializers/setup.rb b/config/initializers/setup.rb index 83c4d32d4..89df843ea 100644 --- a/config/initializers/setup.rb +++ b/config/initializers/setup.rb @@ -1,10 +1,2 @@ Dir[Rails.root.join("lib/ext/**/*.rb")].each {|f| require f} -require 'plugins' - -# Setup Smart HTTP GRack -config = {project_root: File.join(APP_CONFIG['git_path'], 'git_projects'), git_path: 'git', upload_pack: true, receive_pack: true} -# Rosa::Application.config.middleware.insert_before 0, ::Grack::Handler, config -Rosa::Application.config.middleware.insert_after ::Rails::Rack::Logger, ::Grack::Handler, config -Rosa::Application.config.middleware.insert_before ::Grack::Handler, ::Grack::Auth - -Rosa::Application.config.action_mailer.default_url_options = { host: APP_CONFIG['action_mailer_host'] } if APP_CONFIG['action_mailer_host'] +require 'plugins' \ No newline at end of file diff --git a/config/locales/menu.en.yml b/config/locales/menu.en.yml index 1094dd79f..f0c21a2e0 100644 --- a/config/locales/menu.en.yml +++ b/config/locales/menu.en.yml @@ -8,7 +8,6 @@ en: projects: Projects build_lists: Task monitoring groups: Groups - advisories: Advisories statistics: Statistics bottom_menu: copyright: OMV © %{year} diff --git a/config/locales/menu.ru.yml b/config/locales/menu.ru.yml index 226c692b3..4df40d7a1 100644 --- a/config/locales/menu.ru.yml +++ b/config/locales/menu.ru.yml @@ -8,7 +8,6 @@ ru: projects: Проекты build_lists: Мониторинг задач groups: Группы - advisories: Бюллетени statistics: Статистика bottom_menu: copyright: OMV © %{year} diff --git a/config/locales/models/advisory.en.yml b/config/locales/models/advisory.en.yml deleted file mode 100644 index d675b7118..000000000 --- a/config/locales/models/advisory.en.yml +++ /dev/null @@ -1,39 +0,0 @@ -en: - layout: - advisories: - atom_title: Advisories - list_header: Advisories - form_header: New advisory - project_name: Project - project_names: Projects - build_lists: Build Lists - affected_versions: Affected versions - affected_in: Affected in - ref_comment: Add links one by row - no_: No - new: New - existing: Existing - search_by_id: Search advisory by it's ID - search: Search advisory by it's ID, description or package name - search_hint: Paste full AdvisoryID into text field or enter there its uniq part. - advisory_id_info: AdvisoryID is a string %{advisory_format}, where 'XXXX' (at least 4 symbols) is a uniq part. - publication_info: Advisory might be applied only to Build Lists with [%{update_types}] update types. - - banners: - advisory_not_found: Couldn't find advisory with given ID for this type of Build List. - server_error: Server problem. Please try again later. - continue_input: Continue input while needed Advisory appears in preview. - - flash: - advisories: - - activerecord: - models: - advisory: Advisory - - attributes: - advisory: - created_at: Creation date - advisory_id: Identifier - description: Description - references: References diff --git a/config/locales/models/advisory.ru.yml b/config/locales/models/advisory.ru.yml deleted file mode 100644 index 3f8ec54bf..000000000 --- a/config/locales/models/advisory.ru.yml +++ /dev/null @@ -1,39 +0,0 @@ -ru: - layout: - advisories: - atom_title: Бюллетени - list_header: Бюллетени - form_header: Новый бюллетень - project_name: Проект - project_names: Проекты - build_lists: Сборочные листы - affected_versions: Применен в версиях - affected_in: Применен в - ref_comment: Вставляйте ссылки по одной на строку - no_: Нет - new: Новый - existing: Существующий - search_by_id: Искать бюллетень по его ID - search: Искать бюллетень по его ID, описанию или имени пакета - search_hint: Скопируйте в поле ввода полный AdvisoryID или введите его уникальную часть - advisory_id_info: AdvisoryID имеет формат %{advisory_format}, где 'XXXX' (минимум 4 символа) - это уникальная часть. - publication_info: Бюллетень может быть присоединен только к сборочному листу с типами обновления %{update_types}. - - banners: - advisory_not_found: Не удалось найти запрашиваемый бюллетень для сборочного листа этого типа. - server_error: Произошла ошибка сервера. Попробуйте позже. - continue_input: Продолжайте вводить ID до тех пор, пока не найдется нужный бюллетень. - - flash: - advisories: - - activerecord: - models: - advisory: Бюллетень - - attributes: - advisory: - created_at: Дата создания - advisory_id: Идентификатор - description: Описание проблемы - references: Ссылки diff --git a/config/locales/models/build_list.en.yml b/config/locales/models/build_list.en.yml index c1d20f245..89908bba3 100644 --- a/config/locales/models/build_list.en.yml +++ b/config/locales/models/build_list.en.yml @@ -121,9 +121,6 @@ en: human_current_duration: Build currently takes %{hours} h. %{minutes} min. human_duration: Built in %{hours} h. %{minutes} min. - attached_advisory: Attached advisory - create_advisory: Create new advisory - ownership: header: Build list ownership owned: My diff --git a/config/locales/models/build_list.ru.yml b/config/locales/models/build_list.ru.yml index 69e2e6885..6f2910350 100644 --- a/config/locales/models/build_list.ru.yml +++ b/config/locales/models/build_list.ru.yml @@ -119,9 +119,6 @@ ru: human_current_duration: Сборка длится уже %{hours} ч. %{minutes} мин. human_duration: Собрано за %{hours} ч. %{minutes} мин. - attached_advisory: Связанный бюллетень - create_advisory: Создать новый бюллетень - ownership: header: Принадлежность заданий owned: Мои diff --git a/config/production.pill b/config/production.pill deleted file mode 100644 index 4be8c85d4..000000000 --- a/config/production.pill +++ /dev/null @@ -1,53 +0,0 @@ -#! /usr/bin/env ruby - -app_name = ENV['APP_NAME'] || 'rosa_build' -Bluepill.application(app_name, :log_file => "/srv/rosa_build/shared/log/bluepill.log") do |app| - app.uid = app.gid = 'rosa' - app.working_dir = "/srv/#{app_name}/current" - - app.process("resque") do |process| - process.group = "resque" - pid_path = File.join(app.working_dir, 'tmp', 'pids', 'resque.pid') - process.start_command = "bundle exec rake resque:work QUEUE=fork_import,hook,clone_build,notification PIDFILE=#{ pid_path } BACKGROUND=yes" - process.pid_file = pid_path - process.stop_command = "kill -QUIT {{PID}}" - process.daemonize = true - process.start_grace_time = 5.seconds - process.stop_grace_time = 5.seconds - process.restart_grace_time = 5.seconds - - #process.monitor_children do |c| - # c.stop_command = "kill -USR1 {{PID}}" # TODO: Are we really need this? - # c.checks :mem_usage, :every => 30.seconds, :below => 80.megabytes, :fires => :stop - # c.checks :running_time, :every => 30.seconds, :below => 10.minutes, :fires => :stop - #end - end - - #app.process("newrelic") do |process| - # process.start_grace_time = 10.seconds - # process.stop_grace_time = 10.seconds - # process.restart_grace_time = 10.seconds - - # path = File.join(app.working_dir, 'tmp', 'pids', 'newrelic.pid') - # process.start_command = "/usr/bin/env /usr/local/bin/nrsysmond -c /etc/newrelic/nrsysmond.cfg -p #{path}" - # process.pid_file = path - #end - - #app.process("unicorn") do |process| - # process.start_grace_time = 8.seconds - # process.stop_grace_time = 5.seconds - # process.restart_grace_time = 13.seconds - - # process.start_command = "bundle exec unicorn -l /tmp/#{app_name}_unicorn.sock -E production -c config/unicorn.rb -D" - # process.stop_command = "kill -QUIT {{PID}}" - # process.restart_command = "kill -USR2 {{PID}}" - # process.pid_file = File.join(app.working_dir, 'tmp', 'pids', 'unicorn.pid') - - # process.monitor_children do |child_process| - # child_process.stop_command = "kill -QUIT {{PID}}" - - # child_process.checks :mem_usage, :every => 10.seconds, :below => 150.megabytes, :times => [3,4], :fires => :stop - # child_process.checks :cpu_usage, :every => 10.seconds, :below => 20, :times => [3,4], :fires => :stop - # end - #end -end diff --git a/config/routes.rb b/config/routes.rb index 265120df1..a69355282 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -20,19 +20,16 @@ Rails.application.routes.draw do end devise_scope :user do - get '/users/auth/:provider' => 'users/omniauth_callbacks#passthru' get 'users/sign_up' => 'users/registrations#new', as: :new_user_registration post 'users' => 'users/registrations#create', as: :user_registration end devise_for :users, controllers: { - omniauth_callbacks: 'users/omniauth_callbacks', confirmations: 'users/confirmations' }, skip: [:registrations] namespace :api do namespace :v1, constraints: { format: 'json' }, defaults: { format: 'json' } do - resources :advisories, only: [:index, :show, :create, :update] resources :search, only: [:index] resources :build_lists, only: [:index, :create, :show] do member { @@ -85,14 +82,6 @@ Rails.application.routes.draw do put :update_member } resources :build_lists, only: :index - resources :issues, only: [:index, :create, :show, :update] - resources :pull_requests, only: [:index, :create, :show, :update] do - member { - get :commits - get :files - put :merge - } - end end resources :users, only: [:show] get 'user' => 'users#show_current_user' @@ -100,8 +89,6 @@ Rails.application.routes.draw do member { get :notifiers put :notifiers - get '/issues' => 'issues#user_index' - get '/pull_requests' => 'pull_requests#user_index' } end resources :groups, only: [:index, :show, :update, :create, :destroy] do @@ -110,8 +97,6 @@ Rails.application.routes.draw do put :add_member delete :remove_member put :update_member - get '/issues' => 'issues#group_index' - get '/pull_requests' => 'pull_requests#group_index' } end resources :products, only: [:show, :update, :create, :destroy] do @@ -131,9 +116,6 @@ Rails.application.routes.draw do end end - #resources :ssh_keys, only: [:index, :create, :destroy] - get 'issues' => 'issues#all_index' - get 'pull_requests' => 'pull_requests#all_index' end end @@ -141,13 +123,9 @@ Rails.application.routes.draw do get '/forbidden' => 'pages#forbidden', as: 'forbidden' get '/terms-of-service' => 'pages#tos', as: 'tos' - get '/tour/:id' => 'pages#tour_inside', as: 'tour_inside', id: /projects|sources|builds/ - #match '/invite.html' => redirect('/register_requests/new') get '/activity_feeds.:format' => 'home#activity', as: 'atom_activity_feeds', format: /atom/ get '/own_activity' => 'home#own_activity', as: 'own_activity' - get '/issues' => 'home#issues' - get '/pull_requests' => 'home#pull_requests' get '/get_owners_list' => 'home#get_owners_list' get '/get_project_names_list' => 'home#get_project_names_list' @@ -156,16 +134,15 @@ Rails.application.routes.draw do root to: 'home#activity' end unauthenticated do - root to: 'home#root', as: :authenticated_root + root to: 'statistics#index', as: :unauthenticated_root + #devise_scope :user do + # root to: 'devise/sessions#new', as: :unauthenticated_root + #end end else root to: 'home#activity' end - resources :advisories, only: [:index, :show, :search] do - get :search, on: :collection - end - scope module: 'platforms' do resources :platforms, constraints: {id: Platform::NAME_PATTERN} do member do @@ -177,7 +154,6 @@ Rails.application.routes.draw do post :change_visibility post :add_member post :make_clone - get :advisories end resources :contents, only: %i(index) do @@ -239,9 +215,6 @@ Rails.application.routes.draw do end scope module: 'users' do - get '/settings/ssh_keys' => 'ssh_keys#index', as: :ssh_keys - post '/settings/ssh_keys' => 'ssh_keys#create' - delete '/settings/ssh_keys/:id' => 'ssh_keys#destroy', as: :ssh_key resources :settings, only: [] do collection do @@ -256,7 +229,6 @@ Rails.application.routes.draw do put :reset_auth_token end end - #resources :register_requests, only: [:new, :create], format: /ru|en/ #view support only two languages get '/allowed' => 'users#allowed' get '/check' => 'users#check' @@ -288,7 +260,6 @@ Rails.application.routes.draw do patch :publish put :reject_publish put :publish_into_testing - put :update_type get :dependent_projects post :dependent_projects end @@ -307,11 +278,6 @@ Rails.application.routes.draw do resources :build_lists, only: [:index, :new, :create] do get :list, on: :collection end - resources :collaborators do - get :find, on: :collection - end - post '/preview' => 'projects#preview', as: 'md_preview' - post 'refs_list' => 'projects#refs_list', as: 'refs_list' put 'schedule' => 'projects#schedule' end @@ -323,9 +289,9 @@ Rails.application.routes.draw do # Member delete '/remove_user' => 'projects#remove_user', as: :remove_user_project - get '/' => 'project/project#index', as: :project - get '/commit/:sha' => 'project/project#commit', as: :commit - get '/diff/:diff' => 'project/project#diff', as: :diff, format: false, diff: /.*/ + get '/' => "projects#bl_redirect", as: :project + get '/commit/:sha' => 'projects#commit', as: :commit + get '/diff/:diff' => 'projects#diff', as: :diff, format: false, diff: /.*/ end end diff --git a/config/sitemap.rb b/config/sitemap.rb index d014fbe85..91299c7d3 100644 --- a/config/sitemap.rb +++ b/config/sitemap.rb @@ -1,4 +1,4 @@ -%w(abf.rosalinux.ru abf.io).each do |domain| +%w(abf.openmandriva.org).each do |domain| SitemapGenerator::Sitemap.create( default_host: "https://#{domain}", diff --git a/config/unicorn.rb b/config/unicorn.rb deleted file mode 100644 index 123d51510..000000000 --- a/config/unicorn.rb +++ /dev/null @@ -1,75 +0,0 @@ -#base_path = File.expand_path(File.join File.dirname(__FILE__), '..') -base_path = "/srv/rosa_build" - -rails_env = ENV['RAILS_ENV'] || 'production' - -worker_processes 8 -working_directory File.join(base_path, 'current') # available in 0.94.0+ - -# listen File.join(base_path, 'tmp', 'pids', 'unicorn.sock') -# listen "/tmp/.sock", backlog: 64 -# listen 8080, tcp_nopush: true - -# nuke workers after 30 seconds instead of 60 seconds (the default) -timeout 600 - -# feel free to point this anywhere accessible on the filesystem -pid_file = File.join(base_path, 'shared', 'pids', 'unicorn.pid') -old_pid = pid_file + '.oldbin' - -pid pid_file - -# REE or Ruby 2.0 -# http://www.rubyenterpriseedition.com/faq.html#adapt_apps_for_cow -GC.copy_on_write_friendly = true if GC.respond_to?(:copy_on_write_friendly=) - -before_exec do |server| - ENV["BUNDLE_GEMFILE"] = "#{base_path}/current/Gemfile" -end - -# By default, the Unicorn logger will write to stderr. -# Additionally, ome applications/frameworks log to stderr or stdout, -# so prevent them from going to /dev/null when daemonized here: -stderr_path File.join(base_path, 'current', 'log', 'unicorn.stderr.log') -stdout_path File.join(base_path, 'current', 'log', 'unicorn.stdout.log') - -# combine REE with "preload_app true" for memory savings -# http://rubyenterpriseedition.com/faq.html#adapt_apps_for_cow -preload_app true - -before_fork do |server, worker| - # This option works in together with preload_app true setting - # What is does is prevent the master process from holding - # the database connection - defined?(ActiveRecord::Base) and ActiveRecord::Base.connection.disconnect! - - # When sent a USR2, Unicorn will suffix its pidfile with .oldbin and - # immediately start loading up a new version of itself (loaded with a new - # version of our app). When this new Unicorn is completely loaded - # it will begin spawning workers. The first worker spawned will check to - # see if an .oldbin pidfile exists. If so, this means we've just booted up - # a new Unicorn and need to tell the old one that it can now die. To do so - # we send it a QUIT. - # - # Using this method we get 0 downtime deploys. - - if File.exists?(old_pid) && server.pid != old_pid - begin - Process.kill("QUIT", File.read(old_pid).to_i) - rescue Errno::ENOENT, Errno::ESRCH - # someone else did our job for us - end - end -end - -after_fork do |server, worker| - # Here we are establishing the connection after forking worker processes - defined?(ActiveRecord::Base) and ActiveRecord::Base.establish_connection - - # if preload_app is true, then you may also want to check and - # restart any other shared sockets/descriptors such as Memcached, - # and Redis. TokyoCabinet file handles are safe to reuse - # between any number of forked children (assuming your kernel - # correctly implements pread()/pwrite() system calls) - # srand -end diff --git a/db/migrate/20160311073729_remove_unused_columns.rb b/db/migrate/20160311073729_remove_unused_columns.rb new file mode 100644 index 000000000..844d00623 --- /dev/null +++ b/db/migrate/20160311073729_remove_unused_columns.rb @@ -0,0 +1,36 @@ +class RemoveUnusedColumns < ActiveRecord::Migration + def change + change_table :build_lists do |t| + t.remove :advisory_id + end + + change_table :projects do |t| + t.remove :has_issues, :has_wiki, :description + end + + change_table :settings_notifiers do |t| + t.remove :new_comment, :new_comment_reply, :new_issue, :issue_assign, :new_comment_commit_owner,\ + :new_comment_commit_repo_owner, :new_comment_commit_commentor, :update_code + end + + change_table :users do |t| + t.remove :ssh_key + end + + drop_table :advisories + drop_join_table :advisories, :platforms + drop_join_table :advisories, :projects + drop_table :build_scripts + drop_table :comments + drop_table :hooks + drop_table :issues + drop_table :labelings + drop_table :labels + drop_table :node_instructions + drop_table :project_tags + drop_table :pull_requests + drop_table :register_requests + drop_table :ssh_keys + drop_table :subscribes + end +end diff --git a/doc/README_FOR_APP b/doc/README_FOR_APP deleted file mode 100644 index cd837c6bc..000000000 --- a/doc/README_FOR_APP +++ /dev/null @@ -1,30 +0,0 @@ -=== Basic bootstrap - -* rake db:drop db:setup - -== - -=== Setup autostart - -Add to /etc/rc.d/rc.local - - /srv/rosa_build/current/bin/autostart.sh - -Add to /etc/rc.d/rc.sysinit - - # force run rc.local - if [ -f /etc/rc.local ]; then - . /etc/rc.local - fi - -=== Tips -sudo urpmi lib64icu-devel # mandriva -gem install charlock_holmes -- --with-icu-dir=/opt/local # macports - -sudo urpmi lib64magic-devel # mandriva -brew install libmagic; brew link libmagic # brew -gem install ruby-filemagic - -sudo urpmi python-devel - -git config --global core.quotepath false diff --git a/doc/design/abf-404.html b/doc/design/abf-404.html deleted file mode 100644 index 9bfac5f12..000000000 --- a/doc/design/abf-404.html +++ /dev/null @@ -1,135 +0,0 @@ - - - - - Сборочная среда - - - - - - -
- -
-
-
-
- - - - - -
- - - -
-
- avatar -
- -
- -
-
- - - -
- -
-
-
-
-
-
- -
-
- - -
- -
- -

Ошибка 404

-

Страница не найдена

-

- Попробуйте открыть другие страницы. -

- -
- -
- -
-
-
- -
- - - - \ No newline at end of file diff --git a/doc/design/abf-500.html b/doc/design/abf-500.html deleted file mode 100644 index fc5d9ea3d..000000000 --- a/doc/design/abf-500.html +++ /dev/null @@ -1,138 +0,0 @@ - - - - - Сборочная среда - - - - - - -
- -
-
-
-
- - - - - - -
- - - -
-
- avatar -
- -
- -
-
- - - -
- -
-
-
-
-
-
- -
-
- - -
- -
- -

Ошибка 500

-

Что-то пошло не так.
-Мы были уведомлены об этом
-и скоро посмотрим что случилось.

-

- Попробуйте открыть другие страницы. -

- -
- -
- -
-
-
- -
- - - - \ No newline at end of file diff --git a/doc/design/abf-503.html b/doc/design/abf-503.html deleted file mode 100644 index 2fd2a65e9..000000000 --- a/doc/design/abf-503.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - Сборочная среда - - - - - - -
- - -
- -
- -

Ведутся работы

-

Мы обновляем сайт, это займет еще некоторое время.
-Нажмите F5, если это не помогло, значит,
-нужно еще чуточку подождать.
-
-Мы правда пытаемся сделать это быстро и
-приносим свои извинения за возможные неудобства.

-
- -
- -
-
-
- -
- - - - \ No newline at end of file diff --git a/doc/design/abf-admin-build-project.html b/doc/design/abf-admin-build-project.html deleted file mode 100644 index e74d6b449..000000000 --- a/doc/design/abf-admin-build-project.html +++ /dev/null @@ -1,264 +0,0 @@ - - - - - Сборочная среда - - - - - - - - - - - - -
- -
-
-
-
- - - - - - -
- - - -
-
- avatar -
- -
- -
-
- - - -
- -
-
-
-
-
-
- - -
-
- - -
-
-

Version

-
- -
-

Platform

-
- -
-
- mandriva2011 -
-
-
- -
-
- naulinux -
-
-
- -
-
- NauLinux_Nau57 -
-
-
- -
-
- mandriva_official_repos1 -
-
-

Update type

-
- -
-

Preferences

-
- -
-
- Automated publishing -
-
-
- -
-
- Dependable build requires -
-
-
- Начать сборку -
-
-

Architecture

-
- -
-
- i386 -
-
-
- -
-
- i586 -
-
-
- -
-
- x86-64 -
-
-

Packet list repository

-
- -
-

Includes repository

-
- -
-
- main -
-
-
- -
- - - - - - - \ No newline at end of file diff --git a/doc/design/abf-admin-main.html b/doc/design/abf-admin-main.html deleted file mode 100644 index 52913f772..000000000 --- a/doc/design/abf-admin-main.html +++ /dev/null @@ -1,248 +0,0 @@ - - - - - Сборочная среда - - - - - - - - - - - -
- -
-
-
-
- - - - - -
- - - -
-
- avatar -
- -
- -
-
- - - -
- -
-
-
-
-
-
- - -
-
- - -
- - - -
-
- Описание проекта: -
- -
- -
- -
- -
- Видимость проекта: -
- -
- public Публичный private Приватный -
- -
- -
- Ветка по умолчанию: -
- -
-
- -
-
- -
- -
-   -
- -
-
- -
-
- Проект является пакетом -
-
-
- -
- -
-   -
- - - -
- -
- -
- Внимание! Удаленный проект восстановлению не подлежит. -
- - - -
-
- -
-
-
- -
- - - - \ No newline at end of file diff --git a/doc/design/abf-admin-members.html b/doc/design/abf-admin-members.html deleted file mode 100644 index f79b049a5..000000000 --- a/doc/design/abf-admin-members.html +++ /dev/null @@ -1,299 +0,0 @@ - - - - - Сборочная среда - - - - - - - - - - - - - -
- -
-
-
-
- - - - - - -
- - - -
-
- avatar -
- -
- -
-
- - - -
- -
-
-
-
-
-
- - -
-
- - -
- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-   - - Участники - - Роли -
- - -
miki (Mike Shane)
-
-
читатель
-
-
писатель
-
-
администратор
-
- - -
vitko (Виталий Усупов)
-
-
читатель
-
-
писатель
-
-
администратор
-
- - -
miha (Михаил Буданов)
-
-
читатель
-
-
писатель
-
-
администратор
-
- - -
jeni (Jane Conzi)
-
-
читатель
-
-
писатель
-
-
администратор
-
- - Удалить - -
- -
-
- -
-
- -
-
- -
- - Сохранить - - -
-
- -
-
-
- -
- - - - \ No newline at end of file diff --git a/doc/design/abf-admin-sections.html b/doc/design/abf-admin-sections.html deleted file mode 100644 index 81c01ad3a..000000000 --- a/doc/design/abf-admin-sections.html +++ /dev/null @@ -1,206 +0,0 @@ - - - - - Сборочная среда - - - - - - - -
- -
-
-
-
- - - - - - -
- - - -
-
- avatar -
- -
- -
-
- - - -
- -
-
-
-
-
-
- - -
-
- - -
- - - -
- -
- -
- -
- Трекер
- - GitHub Issues adds lightweight issue tracking tightly integrated with your repository. - Add issues to milestones, label issues, and close & reference issues from commit messages. - -
- -
- -
- -
- -
- Wiki
- - GitHub Wikis are the simplest way to let others contribute content. Any GitHub user -can create and edit pages to use for documentation, examples, support or anything -you wish. - -
- -
- - - -
-
- -
-
- -
- - - - \ No newline at end of file diff --git a/doc/design/abf-commits-history.html b/doc/design/abf-commits-history.html deleted file mode 100644 index d0cd157b1..000000000 --- a/doc/design/abf-commits-history.html +++ /dev/null @@ -1,446 +0,0 @@ - - - - - Сборочная среда - - - - - - - - - -
- -
-
-
-
- - - - - -
- - - -
-
- avatar -
- -
- -
-
- - - -
- -
-
-
-
-
-
- - -
-
- - -
-
-
- -
-
-

Текущая ветка:

-
-
- - - - - - - -
-
- 05
января -
-
-
-
-
- avatar -
-
- Mike Shane
- сегодня в 11:45
- Merge pull request #112 from snigipigi/issues
-
-
-
-
- Наша команда благодарит вас за то, что решили уделить нашему продукту немного внимания. Наша сборочная среда предоставляет широкий спектр возможностей как для личного использования, так и для бизнеса. Нам бы хотелось немного подробнее узнать о вас, поэтому, в удобное для вас время, заполните ваш профиль. -

- Также вы можете познакомиться с подробной документацией, включающей в себя не только описание с картинками, но и видеоуроки. -

- Если вы разработчик, то советуем заглянуть в раздел для разработчиков.
- Если вы мейнтейнер, то советуем заглянуть в раздел для мейнтейнеров.
-
-
-
-
-
- code -
-
- 1245ef48 -
-
- -
-
-
-
- - -
-
-
- avatar -
-
- Mike Shane
- сегодня в 11:45
- Merge pull request #112 from snigipigi/issues
-
-
-
-
- Наша команда благодарит вас за то, что решили уделить нашему продукту немного внимания. Наша сборочная среда предоставляет широкий спектр возможностей как для личного использования, так и для бизнеса. Нам бы хотелось немного подробнее узнать о вас, поэтому, в удобное для вас время, заполните ваш профиль. -

- Также вы можете познакомиться с подробной документацией, включающей в себя не только описание с картинками, но и видеоуроки. -

- Если вы разработчик, то советуем заглянуть в раздел для разработчиков.
- Если вы мейнтейнер, то советуем заглянуть в раздел для мейнтейнеров.
-
-
-
-
-
- code -
-
- 1245ef48 -
-
- -
-
-
-
- - - - -
-
-
- avatar -
-
- Mike Shane
- сегодня в 11:45
- Merge pull request #112 from snigipigi/issues
-
-
-
-
- Наша команда благодарит вас за то, что решили уделить нашему продукту немного внимания. Наша сборочная среда предоставляет широкий спектр возможностей как для личного использования, так и для бизнеса. Нам бы хотелось немного подробнее узнать о вас, поэтому, в удобное для вас время, заполните ваш профиль. -

- Также вы можете познакомиться с подробной документацией, включающей в себя не только описание с картинками, но и видеоуроки. -

- Если вы разработчик, то советуем заглянуть в раздел для разработчиков.
- Если вы мейнтейнер, то советуем заглянуть в раздел для мейнтейнеров.
-
-
-
-
-
- code -
-
- 1245ef48 -
-
- -
-
-
-
- - - -
-
-
-
- - - -
-

2011 год

-
- - - -
-
- 26
декабря -
-
-
-
-
- avatar -
-
- Mike Shane
- сегодня в 11:45
- Merge pull request #112 from snigipigi/issues
-
-
-
-
- Наша команда благодарит вас за то, что решили уделить нашему продукту немного внимания. Наша сборочная среда предоставляет широкий спектр возможностей как для личного использования, так и для бизнеса. Нам бы хотелось немного подробнее узнать о вас, поэтому, в удобное для вас время, заполните ваш профиль. -

- Также вы можете познакомиться с подробной документацией, включающей в себя не только описание с картинками, но и видеоуроки. -

- Если вы разработчик, то советуем заглянуть в раздел для разработчиков.
- Если вы мейнтейнер, то советуем заглянуть в раздел для мейнтейнеров.
-
-
-
-
-
- code -
-
- 1245ef48 -
-
- -
-
-
-
- - -
-
-
- avatar -
-
- Mike Shane
- сегодня в 11:45
- Merge pull request #112 from snigipigi/issues
-
-
-
-
- Наша команда благодарит вас за то, что решили уделить нашему продукту немного внимания. Наша сборочная среда предоставляет широкий спектр возможностей как для личного использования, так и для бизнеса. Нам бы хотелось немного подробнее узнать о вас, поэтому, в удобное для вас время, заполните ваш профиль. -

- Также вы можете познакомиться с подробной документацией, включающей в себя не только описание с картинками, но и видеоуроки. -

- Если вы разработчик, то советуем заглянуть в раздел для разработчиков.
- Если вы мейнтейнер, то советуем заглянуть в раздел для мейнтейнеров.
-
-
-
-
-
- code -
-
- 1245ef48 -
-
- -
-
-
-
- - - - -
-
-
- avatar -
-
- Mike Shane
- сегодня в 11:45
- Merge pull request #112 from snigipigi/issues
-
-
-
-
- Наша команда благодарит вас за то, что решили уделить нашему продукту немного внимания. Наша сборочная среда предоставляет широкий спектр возможностей как для личного использования, так и для бизнеса. Нам бы хотелось немного подробнее узнать о вас, поэтому, в удобное для вас время, заполните ваш профиль. -

- Также вы можете познакомиться с подробной документацией, включающей в себя не только описание с картинками, но и видеоуроки. -

- Если вы разработчик, то советуем заглянуть в раздел для разработчиков.
- Если вы мейнтейнер, то советуем заглянуть в раздел для мейнтейнеров.
-
-
-
-
-
- code -
-
- 1245ef48 -
-
- -
-
-
-
- - - -
-
-
-
- - - - - -
-
- -
- - - - \ No newline at end of file diff --git a/doc/design/abf-create group.html b/doc/design/abf-create group.html deleted file mode 100644 index 3dc747301..000000000 --- a/doc/design/abf-create group.html +++ /dev/null @@ -1,174 +0,0 @@ - - - - - Сборочная среда - - - - - - - - - - - - -
- -
-
-
-
- - - - - - -
- - - -
-
- avatar -
- -
- -
-
- - - -
- -
-
-
-
-
-
- -
-
- - -
- -
-

Создать группу

-
- Название: -
- -
- -
-
-
- -
- - -
- -
- Описание: -
- -
- -
- -
- - - - -
-   -
- - - -
- -
- -
-
-
- -
- - - - \ No newline at end of file diff --git a/doc/design/abf-create issue.html b/doc/design/abf-create issue.html deleted file mode 100644 index d276f03af..000000000 --- a/doc/design/abf-create issue.html +++ /dev/null @@ -1,439 +0,0 @@ - - - - - Сборочная среда - - - - - - - -
- -
-
-
-
- - - - - -
- - - -
-
- avatar -
- -
- -
-
- - - -
- -
-
-
-
-
-
- - -
-
- - -
- - - -
-

Создать задачу

-
- Название: -
- -
- -
- -
- Описание: -
- -
- -
- -
- -
- Назначено: -
- -
- выберите исполнителя слева - - - - -
- -
- -
- Метки: -
- -
- выберите метки слева - - - - -
- -
- - -
-   -
- -
- -
- -
-
- -
-
-
- -
- - - - \ No newline at end of file diff --git a/doc/design/abf-create product.html b/doc/design/abf-create product.html deleted file mode 100644 index 2f3299623..000000000 --- a/doc/design/abf-create product.html +++ /dev/null @@ -1,192 +0,0 @@ - - - - - Сборочная среда - - - - - - -
- -
-
-
-
- - - - - -
- - - -
-
- avatar -
- -
- -
-
- - - -
- -
-
-
-
-
-
- -
-
- - -
- -
-

Создать продукт

-
- Название: -
- -
- -
-
- -
- Content build: -
- -
- -
- -
- -
- Content.counter: -
- -
- -
- -
- -
- Content.ks.template: -
- -
- -
- -
- -
- Content.menu.xml: -
- -
- -
- -
- -
- Tar.bz2 file: -
- - - -
-   -
- - - -
- -
- -
-
-
- -
- - - - \ No newline at end of file diff --git a/doc/design/abf-create project.html b/doc/design/abf-create project.html deleted file mode 100644 index 5302b3cd6..000000000 --- a/doc/design/abf-create project.html +++ /dev/null @@ -1,202 +0,0 @@ - - - - - Сборочная среда - - - - - - - - - - - -
- -
-
-
-
- - - - - -
- - - -
-
- avatar -
- -
- -
-
- - - -
- -
-
-
-
-
-
- -
-
- - -
- -
-

Создать проект

-
- Название проекта: -
- -
- -
- -
- Описание проекта: -
- -
- -
- -
- -
- Видимость проекта: -
- -
- public Публичный private Приватный -
- -
- -
- Проект принадлежит: -
- -
-
-
Мне
-
-
Группе
-
-
- -
-
-
-
- -
- -
- Импортировать srpm: -
- -
- - -
- -
- -
-   -
- - - -
- -
- -
-
-
- -
- - - - \ No newline at end of file diff --git a/doc/design/abf-create repository.html b/doc/design/abf-create repository.html deleted file mode 100644 index 9b3aeef98..000000000 --- a/doc/design/abf-create repository.html +++ /dev/null @@ -1,168 +0,0 @@ - - - - - Сборочная среда - - - - - - -
- -
-
-
-
- - - - - -
- - - -
- avatar -
- - -
-
- - - -
- -
-
-
-
-
-
- - - - -
-
- - -
- -
-

Создать репозиторий

-
- Название: -
- -
- -
-
- -
- Ключ: -
- -
- -
- -
- -
- Пароль для ключа: -
- -
- -
-
- -
-   -
- - - -
- -
- -
-
-
- -
- - - - \ No newline at end of file diff --git a/doc/design/abf-group public profile.html b/doc/design/abf-group public profile.html deleted file mode 100644 index 249e112d2..000000000 --- a/doc/design/abf-group public profile.html +++ /dev/null @@ -1,139 +0,0 @@ - - - - - Сборочная среда - - - - - - -
- -
-
-
-
- - - - - -
- - - -
-
- avatar -
- -
- -
-
- - - -
- -
-
-
-
-
-
- -
-
- - -
- -
-

rosa_group

-

Описание:

-

- Тут описание группы. Тут описание группы. Тут описание группы. - Тут описание группы. Тут описание группы. Тут описание группы. - Тут описание группы. Тут описание группы. Тут описание группы. - Тут описание группы. Тут описание группы. Тут описание группы.

- Тут описание группы. Тут описание группы. Тут описание группы. - Тут описание группы. Тут описание группы. Тут описание группы. -

-

Список проектов:

-

- ROSA-Jabber
- Gimp-Extensions -

-
- -
-
-
- -
- - - - \ No newline at end of file diff --git a/doc/design/abf-groups inside page preferences.html b/doc/design/abf-groups inside page preferences.html deleted file mode 100644 index 5bb17497f..000000000 --- a/doc/design/abf-groups inside page preferences.html +++ /dev/null @@ -1,189 +0,0 @@ - - - - - Сборочная среда - - - - - - - - - - - -
- -
-
-
-
- - - - - -
- - - -
-
- avatar -
- -
- -
-
- - - -
- -
-
-
-
-
-
- - -
-
- - - - -
- - - - \ No newline at end of file diff --git a/doc/design/abf-groups inside page.html b/doc/design/abf-groups inside page.html deleted file mode 100644 index fc34ff20e..000000000 --- a/doc/design/abf-groups inside page.html +++ /dev/null @@ -1,272 +0,0 @@ - - - - - Сборочная среда - - - - - - - - - - - - - -
- -
-
-
-
- - - - - - -
- - - -
-
- avatar -
- -
- -
-
- - - -
- -
-
-
-
-
-
- - -
-
- - -
- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-   - - Участники - - Роли -
- - -
miki (Mike Shane)
-
-
читатель
-
-
писатель
-
-
администратор
-
- - -
vitko (Виталий Усупов)
-
-
читатель
-
-
писатель
-
-
администратор
-
- - -
miha (Михаил Буданов)
-
-
читатель
-
-
писатель
-
-
администратор
-
- - -
jeni (Jane Conzi)
-
-
читатель
-
-
писатель
-
-
администратор
-
- - Исключить - -
- -
-
- -
-
- -
-
- -
- - Сохранить - - -
- -
- -
-
-
- -
- - - - \ No newline at end of file diff --git a/doc/design/abf-groups list.html b/doc/design/abf-groups list.html deleted file mode 100644 index 60e326193..000000000 --- a/doc/design/abf-groups list.html +++ /dev/null @@ -1,170 +0,0 @@ - - - - - Сборочная среда - - - - - - - - - - -
- -
-
-
-
- - - - - -
- - - -
-
- avatar -
- -
- -
-
- - - -
- -
-
-
-
-
-
- -
-
- - -
- -
- Создать группу - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ГруппаОписаниеПокинуть группу
rosa_grouprosa_groupЗдесь должно быть описание группы. Здесь должно быть описание группы. Здесь должно быть описание группы.delete
abs_groupabs_groupЗдесь должно быть описание группы. Здесь должно быть описание группы. Здесь должно быть описание группы.delete
mips_employeesmips_employeesЗдесь должно быть описание группы. Здесь должно быть описание группы. Здесь должно быть описание группы.delete
monkey_fistmonkey_fistЗдесь должно быть описание группы. Здесь должно быть описание группы. Здесь должно быть описание группы.delete
dt2012dt2012Здесь должно быть описание группы. Здесь должно быть описание группы. Здесь должно быть описание группы.delete
-
- -
-
-
- -
- - - - \ No newline at end of file diff --git a/doc/design/abf-index.html b/doc/design/abf-index.html deleted file mode 100644 index 86403588d..000000000 --- a/doc/design/abf-index.html +++ /dev/null @@ -1,405 +0,0 @@ - - - - - Сборочная среда - - - - - - -
- -
-
-
-
- - - - - -
- - - -
-
- avatar -
- -
- -
-
- - - -
- -
-
-
-
-
-
- - -
-
- - -
- - - -
-

Лента активности

-
-

expand 2 новых сообщения

-
- - - -
-
-
- avatar -
-
- Mike Shane внес изменения в проект gsapronov/ROSA-Jabber
- сегодня в 11:45
- Merge pull request #112 from snigipigi/issues
-
- -
-
- -
- -
- Наша команда благодарит вас за то, что решили уделить нашему продукту немного внимания. Наша сборочная среда предоставляет широкий спектр возможностей как для личного использования, так и для бизнеса. Нам бы хотелось немного подробнее узнать о вас, поэтому, в удобное для вас время, заполните ваш профиль. -

- Также вы можете познакомиться с подробной документацией, включающей в себя не только описание с картинками, но и видеоуроки. -

- Если вы разработчик, то советуем заглянуть в раздел для разработчиков.
- Если вы мейнтейнер, то советуем заглянуть в раздел для мейнтейнеров.
-
- -
- -
-
-
- avatar -
-
- ROSA ABF Team
- сегодня в 10:45
- Добро пожаловать! -
- -
-
- -
- -
- Наша команда благодарит вас за то, что решили уделить нашему продукту немного внимания. Наша сборочная среда предоставляет широкий спектр возможностей как для личного использования, так и для бизнеса. Нам бы хотелось немного подробнее узнать о вас, поэтому, в удобное для вас время, заполните ваш профиль. -

- Также вы можете познакомиться с подробной документацией, включающей в себя не только описание с картинками, но и видеоуроки. -

- Если вы разработчик, то советуем заглянуть в раздел для разработчиков.
- Если вы мейнтейнер, то советуем заглянуть в раздел для мейнтейнеров.
-
-
- - - -
-

Загрузить сообщения

-
- -
- -
-
-
- -
- - - - \ No newline at end of file diff --git a/doc/design/abf-issue page.html b/doc/design/abf-issue page.html deleted file mode 100644 index 3b4dc0328..000000000 --- a/doc/design/abf-issue page.html +++ /dev/null @@ -1,356 +0,0 @@ - - - - - Сборочная среда - - - - - - - -
- -
-
-
-
- - - - - -
- - - -
-
- avatar -
- -
- -
-
- - - -
- -
-
-
-
-
-
- - -
-
- - -
- - - -
-

Регулировка силы нажатия пера

- -
-
-
- avatar -
-
- Mike Shane
- сегодня в 11:45
- Merge pull request #112 from snigipigi/issues -
-
-
-
-
- Наша команда благодарит вас за то, что решили уделить нашему продукту немного внимания. Наша сборочная среда предоставляет широкий спектр возможностей как для личного использования, так и для бизнеса. Нам бы хотелось немного подробнее узнать о вас, поэтому, в удобное для вас время, заполните ваш профиль. -

- Также вы можете познакомиться с подробной документацией, включающей в себя не только описание с картинками, но и видеоуроки. -

- Если вы разработчик, то советуем заглянуть в раздел для разработчиков.
- Если вы мейнтейнер, то советуем заглянуть в раздел для мейнтейнеров.
-
-
- -
- -
- -
-

Добавить комментарий

- -
-
- Notifications for new comments are on. Disable notifications for this Issue -
-
- -
-
-
- -
-
- Closed -
-
-
- pic -
-
- jeni (Jane Conzi) closed the issue today at 10:15 -
-
-
- - -
- - - -
-
-
- -
- - - - \ No newline at end of file diff --git a/doc/design/abf-login.html b/doc/design/abf-login.html deleted file mode 100644 index 70a8a1232..000000000 --- a/doc/design/abf-login.html +++ /dev/null @@ -1,111 +0,0 @@ - - - - - Сборочная среда - - - - - - - -
- - - - -
- -
- - -
- -

Войти в систему

-
- -
-
-
-
- -
-
- Запомнить меня -
-
- -
- -
- -
- -
-
- -
- -
- -
-
-

Войти через:

-
- -
- open - gplus - git -
-
- -
-
-
-
-
-
Неверная пара логин/пароль.
-
-
-
- -
- - - - \ No newline at end of file diff --git a/doc/design/abf-monitoring products.html b/doc/design/abf-monitoring products.html deleted file mode 100644 index a6fbe16e5..000000000 --- a/doc/design/abf-monitoring products.html +++ /dev/null @@ -1,324 +0,0 @@ - - - - - Сборочная среда - - - - - - - - - - - - - - - - -
- -
-
-
-
- - - - - -
- - - -
-
- avatar -
- -
- -
-
- - - -
- -
-
-
-
-
-
- - -
-
- - -
- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
idNameStatusActionNotified at
- 47294729 - - Mandriva 2012 - - Build error - - Download ISO - - 2012-01-19 10:10 UTC -
- 47284728 - - Rosa Directory Server - - Build published - - Logs - - 2012-01-18 21:12 UTC -
- id isn’t setid isn’t set - - Acid Mandriva - - Build pending - - Logs - - -
- -
-
- -
-
-
- -
- - - - \ No newline at end of file diff --git a/doc/design/abf-monitoring task.html b/doc/design/abf-monitoring task.html deleted file mode 100644 index ce3b98e77..000000000 --- a/doc/design/abf-monitoring task.html +++ /dev/null @@ -1,204 +0,0 @@ - - - - - Сборочная среда - - - - - - - -
- -
-
-
-
- - - - - -
- - - -
-
- avatar -
- -
- -
-
- - - -
- -
-
-
-
-
-
- - - - -
-
- - -
- -
- -
-
-

Build published

-
-

2012-01-27 17:28:05 UTC

-
- -

Основные данные

-
Container path
- -
-
User
- -
- Опубликовать - -
- -

Основные данные

-
Platform
- -
-
Packet list repository
- -
-
Includes repository
-
main
-
-
Update type
-
security
-
-
Dependable build requires
-
false
-
-
Automated publishing
-
true
-
-
Version
-
latest_mandriva2011
-
-
Architecture
-
i586
-
-
Recurrent
-
false
-
- -
- -

Build items

-

Item #0

- - - - - - - - - - - - - - - - -
NameVersionStatus
libreofficelatest_mandriva2011Build complete
- -
- -
- -
-
-
- -
- - - - \ No newline at end of file diff --git a/doc/design/abf-monitoring.html b/doc/design/abf-monitoring.html deleted file mode 100644 index 90dbac4c5..000000000 --- a/doc/design/abf-monitoring.html +++ /dev/null @@ -1,361 +0,0 @@ - - - - - Сборочная среда - - - - - - - - - - - - - - - - -
- -
-
-
-
- - - - - - -
- - - -
-
- avatar -
- -
- -
-
- - - -
- -
-
-
-
-
-
- - -
-
- - -
- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
idStatusVersionProjectArchitectureUserActionNotified at
- 47294729 - - Build error - - latest_mandriva2011latest_mandriva2011 - - sambasamba - - i586 - - r0mik (r0mik)r0mik (r0mik) - - action - - 2012-01-19 10:10 UTC -
- 47284728 - - Build published - - latest_masterlatest_master - - mcmc - - i586 - - pasha (Pasha)pasha (Pasha) - - action - - 2012-01-18 21:12 UTC -
- id isn’t setid isn’t set - - Build pending - - latest_masterlatest_master - - mcmc - - i586 - - pasha (Pasha)pasha (Pasha) - - action - - -
- -
-
- -
-
-
- -
- - - - \ No newline at end of file diff --git a/doc/design/abf-my projects.html b/doc/design/abf-my projects.html deleted file mode 100644 index b8b25ec8e..000000000 --- a/doc/design/abf-my projects.html +++ /dev/null @@ -1,187 +0,0 @@ - - - - - Сборочная среда - - - - - - - - - - -
- -
-
-
-
- - - - - -
- - - -
-
- avatar -
- -
- -
-
- - - -
- -
-
-
-
-
-
- -
-
- - -
- -
- Создать проект - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ПроектОписание проектаРоль в проектеПокинуть проект
unlock
gsapronov/ROSA-Jabber
Проект создан для разработки интернет-пейджера, с простым -пользовательским интерфейсом и поддержкой социальных сетей.Чтениеdelete
lock
santaux/WacomDrivers
Мы пытаемся доработать драйвера для полноценной работы -дигитайзеров Wacom.Записьdelete
unlock
snigipini/Gimp-Extensions
Растровому редактору не хватает большого количества -функционала и расширений, которые позволили бы ему решать...Записьdelete
lock
pinovd/Rosa_Media_Player
Под OS ROSA отсутствует нормальный простой интуитивно -понятный видеопроигрыватель.Администраторdelete
lock
gsapronov/Inkscape-Plugins
У векторного редактора ощущается острая нехватка плагинов для -работы.Администраторdelete
-
- -
-
-
- -
- - - - \ No newline at end of file diff --git a/doc/design/abf-notification center.html b/doc/design/abf-notification center.html deleted file mode 100644 index 2c22092c9..000000000 --- a/doc/design/abf-notification center.html +++ /dev/null @@ -1,207 +0,0 @@ - - - - - Сборочная среда - - - - - - - -
- -
-
-
-
- - - - - -
- - -
-
- avatar -
- -
- -
-
- - - -
- -
-
-
-
-
-
-
-
- - -
- - - -
-

Вы можете получать уведомления об изменениях, которые вносят другие участники, в код ваших программ. Уведомления будут высылаться на указанный вами адрес электронной почты mikimaus@rosalab.ru.
- Изменить адрес электронной почты

- - -
- -
- -
- Получать уведомления -
- -
- -

События

- -
- -
- -
- ABF meetups and event announcements -
- -
- -

Код

- -
- -
- -
- Comments on my commits -
- -
- -
- -
- -
- Comments on commits in my repositories -
- -
- -
- -
- -
- Comments after me on commits -
- -
- - -
-   -
- - - -
- -
- -
-
- -
- - - - \ No newline at end of file diff --git a/doc/design/abf-platform create.html b/doc/design/abf-platform create.html deleted file mode 100644 index 14345ed79..000000000 --- a/doc/design/abf-platform create.html +++ /dev/null @@ -1,175 +0,0 @@ - - - - - Сборочная среда - - - - - - - - - -
- -
-
-
-
- - - - - -
- - - -
-
- avatar -
- -
- -
-
- - - -
- -
-
-
-
-
-
- -
-
- - -
- - - -
- Создать платформу - -
- - - - - - - - - - - - - - - - - - - - - -
ПлатформыОписание
rosa2011rosa2011Описание платформы в четыре строчки. Опиание платформы в четыре строчки.
- Описание платформы в четыре строчки. Опиание платформы в четыре строчки.
- Описание платформы в четыре строчки. Опиание платформы в четыре строчки.
- Описание платформы в четыре строчки. Опиание платформы в четыре строчки.
rosa_lts1rosa_lts1Описание платформы в 4 строчки. Опиание платформы в четыре строчки.
- Описание платформы в 4 строчки. Опиание платформы в четыре строчки.
- Описание платформы в 4 строчки. Опиание платформы в четыре строчки.
- Описание платформы в 4 строчки. Опиание платформы в четыре строчки.
mandriva2010.1mandriva2010.1Описание платформы в четыре строчки. Опиание платформы в 4 строчки.
- Описание платформы в четыре строчки. Опиание платформы в 4 строчки.
- Описание платформы в четыре строчки. Опиание платформы в 4 строчки.
- Описание платформы в четыре строчки. Опиание платформы в 4 строчки.
- -
-
- -
-
- -
- - - - \ No newline at end of file diff --git a/doc/design/abf-platform main page products.html b/doc/design/abf-platform main page products.html deleted file mode 100644 index e691f195b..000000000 --- a/doc/design/abf-platform main page products.html +++ /dev/null @@ -1,190 +0,0 @@ - - - - - Сборочная среда - - - - - - - - - -
- -
-
-
-
- - - - - -
- - - -
-
- avatar -
- -
- -
-
- - - -
- -
-
-
-
-
-
- - -
-
- - - - -
- - - - \ No newline at end of file diff --git a/doc/design/abf-platform main page repos.html b/doc/design/abf-platform main page repos.html deleted file mode 100644 index 8169aa8aa..000000000 --- a/doc/design/abf-platform main page repos.html +++ /dev/null @@ -1,196 +0,0 @@ - - - - - Сборочная среда - - - - - - - - - -
- -
-
-
-
- - - - - -
- - - -
-
- avatar -
- -
- -
-
- - - -
- -
-
-
-
-
-
- - -
-
- - - - -
- - - - \ No newline at end of file diff --git a/doc/design/abf-platform main page.html b/doc/design/abf-platform main page.html deleted file mode 100644 index 6800b4e70..000000000 --- a/doc/design/abf-platform main page.html +++ /dev/null @@ -1,159 +0,0 @@ - - - - - Сборочная среда - - - - - - -
- -
-
-
-
- - - - - - -
- - - -
- avatar -
- - -
-
- - - -
- -
-
-
-
-
-
- - -
-
- - -
- - - -
-

О платформе

-

Данный проект создан с целью улучшения поддержки продукции компании Wacom под Linux. В настоящее время ощущается острая проблема с функциональными клавишами как на пере, так и на самом дигитайзере. Особое внимание уделяется профессиональной линейке продукции,серии Intiuos4.

-
- - - -
- -
-
- -
- - - - \ No newline at end of file diff --git a/doc/design/abf-platform preferences.html b/doc/design/abf-platform preferences.html deleted file mode 100644 index 1f6c4fcf6..000000000 --- a/doc/design/abf-platform preferences.html +++ /dev/null @@ -1,206 +0,0 @@ - - - - - Сборочная среда - - - - - - -
- -
-
-
-
- - - - - -
- - - -
-
- avatar -
- -
- -
-
- - - -
- -
-
-
-
-
-
- - - - -
-
- - -
- -
-

О платформе

- -
- Описание платформы: -
- -
- -
- -
-

Владелец

-
- Текущий владелец: -
- -
-
-
- avatar -
-
- jeni (Jane Conzi) -
-
-
-
-
- Новый владелец: -
- -
-
-
- -
- -
-
-
- -
-   -
- - - -
- -
-
- -

Удалить

-
- Внимание! Удаленная платформа восстановлению не подлежит. -
- - - -
- -
- -
-
-
- -
- - - - \ No newline at end of file diff --git a/doc/design/abf-product main page.html b/doc/design/abf-product main page.html deleted file mode 100644 index bb52a074b..000000000 --- a/doc/design/abf-product main page.html +++ /dev/null @@ -1,217 +0,0 @@ - - - - - Сборочная среда - - - - - - - - - -
- -
-
-
-
- - - - - -
- - - -
-
- avatar -
- -
- -
-
- - - -
- -
-
-
-
-
-
- - -
-
- - -
- - - -
-

О продукте

-

Данный продукт создан с целью улучшения поддержки продукции компании Wacom под Linux. В настоящее время ощущается острая проблема с функциональными клавишами как на пере, так и на самом дигитайзере. Особое внимание уделяется профессиональной линейке продукции,серии Intiuos4.

- Собрать -

Мониторинг сборочных заданий

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- id - - Status - - Outcome - - Notified at -
- 47294729 - - Build error - - DonwloadDonwload - - 2012-01-19 10:10 UTC -
- 47284728 - - Build published - - Log errorLog error - - 2012-01-18 21:12 UTC -
- id isn’t setid isn’t set - - Build pending - - Log errorLog error - - -
-
- -
-
- -
- - - - \ No newline at end of file diff --git a/doc/design/abf-product preferences.html b/doc/design/abf-product preferences.html deleted file mode 100644 index 411758bdb..000000000 --- a/doc/design/abf-product preferences.html +++ /dev/null @@ -1,221 +0,0 @@ - - - - - Сборочная среда - - - - - - -
- -
-
-
-
- - - - - -
- - - -
-
- avatar -
- -
- -
-
- - - -
- -
-
-
-
-
-
- - -
-
- - - - -
- - - - \ No newline at end of file diff --git a/doc/design/abf-profile main.html b/doc/design/abf-profile main.html deleted file mode 100644 index 125654789..000000000 --- a/doc/design/abf-profile main.html +++ /dev/null @@ -1,226 +0,0 @@ - - - - - Сборочная среда - - - - - - - -
- -
-
-
-
- - - - - -
- - - -
-
- avatar -
- -
- -
-
- - - -
- -
-
-
-
-
-
-
-
- - -
- - - -
-

mikimaus

-
- Имя: -
- -
- -
-
- -
- Электронная почта: -
- -
- -
-
- -
- Личный веб-сайт: -
- -
- -
-
- -
- Компания: -
- -
- -
-
- -
- Местонахождение: -
- -
- -
-
- -
- Аватарка: -
- -
-
-
- avatar -
- -
-
-
- -
- Опыт работы: -
- -
- -
-
- - -
-   -
- - -
- -
-

- Данные доступны для публичного профиля. Если вы не хотите показывать какие-либо данные, просто не заполняйте их. -

-
- -
- -
-
- -
- - - - \ No newline at end of file diff --git a/doc/design/abf-profile settings.html b/doc/design/abf-profile settings.html deleted file mode 100644 index 4afbd42a8..000000000 --- a/doc/design/abf-profile settings.html +++ /dev/null @@ -1,188 +0,0 @@ - - - - - Сборочная среда - - - - - - - -
- -
-
-
-
- - - - - -
- - -
-
- avatar -
- -
- -
-
- - - -
- -
-
-
-
-
-
-
-
- - -
- - - -
-

Изменить пароль

-
- Старый пароль: -
- -
- -
-
- -
- Новый пароль: -
- -
- -
-
- -
- Повторить пароль: -
- -
- -
-
- -
-   -
- - -
- -
-
- -

Удалить аккаунт

-
- Внимание! Удаленный аккаунт восстановлению не подлежит. -
- - -
- -
- -
-
- -
- - - - \ No newline at end of file diff --git a/doc/design/abf-project main page view.html b/doc/design/abf-project main page view.html deleted file mode 100644 index 68e97b2c3..000000000 --- a/doc/design/abf-project main page view.html +++ /dev/null @@ -1,386 +0,0 @@ - - - - - Сборочная среда - - - - - - - - - - - - - - - - - - - - - - -
- -
-
-
-
- - - - - -
- - - -
-
- avatar -
- -
- -
-
- - - -
- -
-
-
-
-
-
- - -
-
- - -
-
- -
-
- pic -
- -
- чтение и запись -
-
- -
-
-

Текущая ветка:

-
- -
-
- -
-

О проекте

-

- Данный проект создан с целью улучшения поддержки продукции компании Wacom под Linux. В настоящее время ощущается острая проблема с функциональными клавишами как на пере, так и на самом дигитайзере. Особое внимание уделяется профессиональной линейке продукции, серии Intiuos4. Читать далее... -

-
- -

Последний коммит

- -
-
-
- avatar -
-
- Mike Shane внес изменения в проект gsapronov/ROSA-Jabber
- сегодня в 11:45
- Merge pull request #112 from snigipigi/issues
-
- -
-
- -
-
- Наша команда благодарит вас за то, что решили уделить нашему продукту немного внимания. Наша сборочная среда предоставляет широкий спектр возможностей как для личного использования, так и для бизнеса. Нам бы хотелось немного подробнее узнать о вас, поэтому, в удобное для вас время, заполните ваш профиль. -

- Также вы можете познакомиться с подробной документацией, включающей в себя не только описание с картинками, но и видеоуроки. -

- Если вы разработчик, то советуем заглянуть в раздел для разработчиков.
- Если вы мейнтейнер, то советуем заглянуть в раздел для мейнтейнеров.
-
-
- -
- - -

Файлы проекта

-
-
-

rails/actionpack/lib

-

rails/actionpack/lib/Gemfile

-
- -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Имя - - Дата - - Сообщение - - Автор сообщения -
-
-
- Dec 31, 201131 декабря 2011 - - Merger issues with Master - - santaux -
-
-
- Dec 31, 201131 декабря 2011 - - Redo autostart script to start from user - - chipiga -
-
-
- Jan 01, 201201 января 2012 - - Remove some unnessacary comments - - latromni -
-
-
- Jan 02, 201202 января 2012 - - Merger issues with Master - - santaux -
-
-
- Jan 04, 201204 января 2012 - - Add pretty view for test listing - - santaux -
-
-
- Jan 05, 201205 января 2012 - - Initial commit - - chipiga -
-
-
-
-
-
- 100644 | 94 lines (75 sloc) | 2.18kb -
-
- raw | blame | history -
-
-
-
- 1
- 2
- 3
- 4
- 5
- 6
- 7
-
-
source 'https//rubygems.org'
-gemspec
-if ENV[ 'AREL']
-	gem 'arel', :path => ENV['AREL']
-else
-	gem 'arel'
-
-
-
-
-
- -
-
- -
- - - - - - \ No newline at end of file diff --git a/doc/design/abf-project main page.html b/doc/design/abf-project main page.html deleted file mode 100644 index 8eb2e5b1f..000000000 --- a/doc/design/abf-project main page.html +++ /dev/null @@ -1,368 +0,0 @@ - - - - - Сборочная среда - - - - - - - - - - - - - - - - - - - - -
- -
-
-
-
- - - - - -
- - - -
-
- avatar -
- -
- -
-
- - - -
- -
-
-
-
-
-
- - -
-
- - -
-
- -
- -
- чтение и запись -
-
- -
-
-

Текущая ветка:

-
- -
-
- -
-

О проекте

-

- Данный проект создан с целью улучшения поддержки продукции компании Wacom под Linux. В настоящее время ощущается острая проблема с функциональными клавишами как на пере, так и на самом дигитайзере. Особое внимание уделяется профессиональной линейке продукции, серии Intiuos4. Читать далее... -

-
- -

Последний коммит

- -
-
-
- avatar -
-
- Mike Shane внес изменения в проект gsapronov/ROSA-Jabber
- сегодня в 11:45
- Merge pull request #112 from snigipigi/issues
-
- -
-
- -
-
- Наша команда благодарит вас за то, что решили уделить нашему продукту немного внимания. Наша сборочная среда предоставляет широкий спектр возможностей как для личного использования, так и для бизнеса. Нам бы хотелось немного подробнее узнать о вас, поэтому, в удобное для вас время, заполните ваш профиль. -

- Также вы можете познакомиться с подробной документацией, включающей в себя не только описание с картинками, но и видеоуроки. -

- Если вы разработчик, то советуем заглянуть в раздел для разработчиков.
- Если вы мейнтейнер, то советуем заглянуть в раздел для мейнтейнеров.
-
-
- -
- - -

Файлы проекта

-
-
-

rails/actionpack/lib

-

rails/actionpack/lib/Gemfile

-
- -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Имя - - Дата - - Сообщение - - Автор сообщения -
-
-
- Dec 31, 201131 декабря 2011 - - Merger issues with Master - - santaux -
-
-
- Dec 31, 201131 декабря 2011 - - Redo autostart script to start from user - - chipiga -
-
-
- Jan 01, 201201 января 2012 - - Remove some unnessacary comments - - latromni -
-
-
- Jan 02, 201202 января 2012 - - Merger issues with Master - - santaux -
-
-
- Jan 04, 201204 января 2012 - - Add pretty view for test listing - - santaux -
-
-
- Jan 05, 201205 января 2012 - - Initial commit - - chipiga -
-
-
-
-
-
- -
-
- Введите сопровождающее сообщение:
- -
-
- -
-
- -
- - - - - - \ No newline at end of file diff --git a/doc/design/abf-public profile.html b/doc/design/abf-public profile.html deleted file mode 100644 index 1f698205b..000000000 --- a/doc/design/abf-public profile.html +++ /dev/null @@ -1,147 +0,0 @@ - - - - - Сборочная среда - - - - - - -
- -
-
-
-
- - - - - - -
- - - -
-
- avatar -
- -
- -
-
- - - -
- -
-
-
-
-
-
- -
-
- - -
- -
-
- mikimaus -
-
-

mikimaus

- Михаил Маус
- mikimaus@gmail.com
-

Профессиональный опыт:

-

- 5 лет работал в Microsoft разработчиком С++ с 2004 по 2009 г. - с 2009 по настоящее время работаю в компании ROSA Лаб. - на должности разработчика веб-решений. Принимал участие - в разработке облачного сервиса хранения данных MandrivaSync, - также разработал для этого проекта приложения под macosx. - mandriva, ubuntu, windows 7, ios 5, windows phone 7, android. -

-

Список публичных проектов:

-

- ROSA-Jabber
- Gimp-Extensions -

-
-
- -
-
-
- -
- - - - \ No newline at end of file diff --git a/doc/design/abf-registration.html b/doc/design/abf-registration.html deleted file mode 100644 index 8ab50e968..000000000 --- a/doc/design/abf-registration.html +++ /dev/null @@ -1,122 +0,0 @@ - - - - - Сборочная среда - - - - - - - -
- -
- -
- - -
- -
- Никнейм -
-
- -
-
- -
- Имя -
-
- -
-
- -
- Электронная почта -
-
- -
-
- -
- Пароль -
-
- -
-
- -
- Повторите пароль -
-
- -
-
- -
- -
- - -
- -
- - - -
-
-
Использование спецзнаков запрещено.
-
-
- -
-
-
Пароль должен содержать от 5 до 20 символов.
Допустимы только латинские символы, спецзнаки и цифры.
Или пароли не совпадают.
-
-
- -
- - - - \ No newline at end of file diff --git a/doc/design/abf-search.html b/doc/design/abf-search.html deleted file mode 100644 index 34ef51b98..000000000 --- a/doc/design/abf-search.html +++ /dev/null @@ -1,341 +0,0 @@ - - - - - Сборочная среда - - - - - - - - - - - - -
- -
-
-
-
- - - - - -
- - - -
-
- avatar -
- -
- -
-
- - - -
- -
-
-
-
-
-
-
-
- - -
-
- -

Расширенный поиск

- -
- -
-
- -
-
- -
-
- - -
- - - - - - - - - - - - - - - - - - - - - - - -
Проекты (10909349843874)
-

- santaux / WacomDrivers
- Данный проект создан с целью улучшения поддержки продукции компании Wacom под Linux. В настоящее время ощущается острая проблема с - функциональными клавишами как на пере, так и на самом дигитайзере. Особое внимание уделяется профессиональной линейке продукции, - серии Intiuos4. -

-
-

- santaux / WacomDrivers
- Данный проект создан с целью улучшения поддержки продукции компании Wacom под Linux. В настоящее время ощущается острая проблема с - функциональными клавишами как на пере, так и на самом дигитайзере. Особое внимание уделяется профессиональной линейке продукции, - серии Intiuos4. -

-
-

- santaux / WacomDrivers
- Данный проект создан с целью улучшения поддержки продукции компании Wacom под Linux. В настоящее время ощущается острая проблема с - функциональными клавишами как на пере, так и на самом дигитайзере. Особое внимание уделяется профессиональной линейке продукции, - серии Intiuos4. -

-
- Показать все -
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Пользователи / группы (1096)
-
jeni (Jane Conzi)
-
-
miki (Mike Shane)
-
-
vitko (Виталий Усупов)
-
-
miha (Михаил Буданов)
-
- Показать все -
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Платформы (96)
- rosa2011 -
- rosa_lts1 -
- mandriva_2010.1 -
- rosa_tech_preview_2012 -
- Показать все -
-
-
- - - - - - - -
- -
-
- -
- - - - - - \ No newline at end of file diff --git a/doc/design/abf-tracker.html b/doc/design/abf-tracker.html deleted file mode 100644 index c65e8de99..000000000 --- a/doc/design/abf-tracker.html +++ /dev/null @@ -1,715 +0,0 @@ - - - - - Сборочная среда - - - - - - - - - - -
- -
-
-
-
- - - - - -
- - - -
-
- avatar -
- -
- -
-
- - - -
- -
-
-
-
-
-
- - -
-
- - -
- - - -
- -
-
- Открытые (11110) -
-
- Закрытые (99999) -
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Номер - - Описание -
- 4643 - - 4643 - -
assets do not update if fingerprinting is turned on in development 3.2.0
- -
2012-01-19 10:10 UTC by nathanhumber -
-
-
-
- 2-3 stable -
-
-
- -
-
-
- 3-0 stable -
-
-
-
-
- -
-
-
- 2-3 stable -
-
-
- -
-
- # -
-
- ava -
-
-
- _ -
-
- 2 -
-
-
-
- 4633 - - 4633 - -
date_select with both discard_day and include_blank may be broken in 3.2
- -
2012-01-18 21:12 UTC by railsaholic
-
-
-
- 3-0 stable -
-
-
-
-
- - - -
-
- # -
-
- ava -
-
-
- _ -
-
- 5 -
-
-
-
- 4631 - - 4631 - -
Fix counter cache column name if :inverse_of is specified on belongs_to
- -
2012-01-16 02:09 UTC by sahcin87 - -
- -
-
- # -
-
- ava -
-
-
- _ -
-
- 9 -
-
-
-
- -
- -
- -
- - - -
-
-
- -
- - - - \ No newline at end of file diff --git a/doc/design/abf-wiki git access.html b/doc/design/abf-wiki git access.html deleted file mode 100644 index 57dd0889c..000000000 --- a/doc/design/abf-wiki git access.html +++ /dev/null @@ -1,196 +0,0 @@ - - - - - Сборочная среда - - - - - - - -
- -
-
-
-
- - - - - -
- - - -
-
- avatar -
- -
- -
-
- - - -
- -
-
-
-
-
-
- - -
-
- - -
- - - -
-
-
- pic -
- -
- чтение и запись -
- -
-
- -

- Your wiki data can be cloned from a git repository for offline access. You have several options for editing it at this point:
-

    -
  1. With your favorite text editor or IDE.
  2. -
  3. With the built-in web interface, included with the Gollum Ruby API.
  4. -
  5. With the Gollum Ruby API.
-When you're done, you can simply push your changes back to GitHub to see them reflected on the site. The wiki -repositories obey the same access rules as the source repository that they belong to. -

- -
-
- -
-
- -
- - - - \ No newline at end of file diff --git a/doc/design/abf-wiki history.html b/doc/design/abf-wiki history.html deleted file mode 100644 index d5a29700a..000000000 --- a/doc/design/abf-wiki history.html +++ /dev/null @@ -1,270 +0,0 @@ - - - - - Сборочная среда - - - - - - - -
- -
-
-
-
- - - - - - -
- - - -
-
- avatar -
- -
- -
-
- - - -
- -
-
-
-
-
-
- - -
-
- - -
- - - -
- -
- - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
- ava -
- -
-
- -
- today: Updated How To: Allow users to sign_in using their username or -email address (textile) [74a9648] -
- - - -
- ava -
- -
-
- -
- yesterday: Updated How To: Allow users to sign_in using their username or -email address (textile) [74a9648] -
- - - -
- ava -
- -
-
- -
- 16.01.12: Cleaned up a markup typo that was showing through to the -Wiki page. [5b0a209] -
- - - -
- ava -
- -
-
- -
- 16.01.12: Revert 87e661f6bd7fe8d40d018c408d122288dc077547^ ... 8 -7e661f6bd7fe8d40d018c408d122288dc077547 [f6ce813] -
- -
-
- -
-
- -
- - - - \ No newline at end of file diff --git a/doc/design/abf-wiki home.html b/doc/design/abf-wiki home.html deleted file mode 100644 index 7ec8de9b5..000000000 --- a/doc/design/abf-wiki home.html +++ /dev/null @@ -1,213 +0,0 @@ - - - - - Сборочная среда - - - - - - - -
- -
-
-
-
- - - - - -
- - - -
-
- avatar -
- -
- -
-
- - - -
- -
-
-
-
-
-
- - -
-
- - -
- - - - - -
-
- -
- - - - \ No newline at end of file diff --git a/doc/design/abf-wiki new.html b/doc/design/abf-wiki new.html deleted file mode 100644 index 1a0acebe0..000000000 --- a/doc/design/abf-wiki new.html +++ /dev/null @@ -1,217 +0,0 @@ - - - - - Сборочная среда - - - - - - - -
- -
-
-
-
- - - - - -
- - - -
-
- avatar -
- -
- -
-
- - - -
- -
-
-
-
-
-
- - -
-
- - -
- - - -
-
-

Home

-
- -
- -
- -
- - -
- - -
- -
-
- -
- - - - \ No newline at end of file diff --git a/doc/design/abf-wiki pages.html b/doc/design/abf-wiki pages.html deleted file mode 100644 index c850e23d1..000000000 --- a/doc/design/abf-wiki pages.html +++ /dev/null @@ -1,215 +0,0 @@ - - - - - Сборочная среда - - - - - - - -
- -
-
-
-
- - - - - -
- - - -
-
- avatar -
- -
- -
-
- - - -
- -
-
-
-
-
-
- - -
-
- - -
- - - -
- -
- -

- Bug reports
- Contributing
- Custom layouts for devise
- Extensions
- Welcome to the Devise Wiki!
- How To: Redirect with locale after authentication failure
- How To: Add an Admin Role
- How To: Add sign_in, sign_out, and sign_up links to your layout template
- How to: Add timeout in value dynamically
- How To: Allow users to edit their account without providing a password
- How To: Allow users to edit their password
- How To: Allow users to sign in with something other than their email address
- How To: Allow users to sign_in using their username or email address
- How To: Automatically generate password for users (simpler registration)
- How To: change an already existing table to add devise required columns
- How To: Change the default sign_in and sign_out routes
- How To: Change the redirect path after destroying a session i.e. signing out
- How To: Configure a master password
- How To: Controllers and Views tests with Rails 3 (and rspec)
- How To: Create a custom encryptor
- How To: Create a guest user
- How To: Create custom layouts
- How To: Create Haml and Slim Views
- How To: Customize routes to user registration pages
- How To: Customize the redirect after a user edits their profile
- How To: Customize user account status validation when logging in
- How To: Disable user from destroying his account
- How To: Disallow previously used passwords
- How To: Display a custom sign_in form anywhere in your app
- How To: Do not redirect to login page after session timeout
- How To: Embed users in your account model with Mongoid
- How To: Find a user when you have their credentials
- How To: Integrate with CanCan for roles management
-

- - -
- -
-
- -
- - - - \ No newline at end of file diff --git a/doc/design/js/admin-members.js b/doc/design/js/admin-members.js deleted file mode 100644 index cef30a9e3..000000000 --- a/doc/design/js/admin-members.js +++ /dev/null @@ -1,14 +0,0 @@ -function deleteAdminMember() { - if (document.getElementById("niceCheckbox1-1").checked == true) { - $("#admin-table-members-row1").fadeOut("slow"); - } - if (document.getElementById("niceCheckbox2-1").checked == true) { - $("#admin-table-members-row2").fadeOut("slow"); - } - if (document.getElementById("niceCheckbox3-1").checked == true) { - $("#admin-table-members-row3").fadeOut("slow"); - } - if (document.getElementById("niceCheckbox4-1").checked == true) { - $("#admin-table-members-row4").fadeOut("slow"); - } -} \ No newline at end of file diff --git a/doc/design/js/all.js b/doc/design/js/all.js deleted file mode 100644 index ea69bacfd..000000000 --- a/doc/design/js/all.js +++ /dev/null @@ -1,37 +0,0 @@ -var state = 0; - -function droplist() { - if (state == 0) { - $("#droplist").slideToggle("slow"); - state = 1; - } -} - -function loadMessages() { - $("#messages-new").fadeOut("slow"); - $("#new-messages").delay(700).fadeIn("slow"); -} -function loadOldMessages() { - $("#old-messages").fadeIn("slow"); -} - - -$(document).click(function() { - var dl = $("#droplist").css("height"); - var dl2 = $("#droplist").css("display"); - if ((dl2 == "block")&&(dl == "91px")) { - state = 0; - droplist(); - state = 0; - } -}); - -function showActivity(elem) { - $("#activity-bottom"+elem).slideToggle("slow"); - var img = document.getElementById("expand" + elem).className; - if (img == "expand-gray-down") { - document.getElementById("expand" + elem).className = "expand-gray-up"; - } else { - document.getElementById("expand" + elem).className = "expand-gray-down"; - } -} \ No newline at end of file diff --git a/doc/design/js/checkbox-main.js b/doc/design/js/checkbox-main.js deleted file mode 100644 index 714845396..000000000 --- a/doc/design/js/checkbox-main.js +++ /dev/null @@ -1,39 +0,0 @@ -function changeCheck(el) - -{ - var el = el, - input = el.getElementsByTagName("input")[0]; - - if(input.checked) - { - el.style.backgroundPosition="0 0"; - input.checked=false; - } - else - { - el.style.backgroundPosition="0 -18px"; - input.checked=true; - } - return true; -} -function startChangeCheck(el) - -{ - var el = el, - input = el.getElementsByTagName("input")[0]; - if(input.checked) - { - el.style.backgroundPosition="0 -18px"; - } - return true; -} - -function startCheck() -{ - - startChangeCheck(document.getElementById("niceCheckbox1")); - startChangeCheck(document.getElementById("niceCheckbox2")); - startChangeCheck(document.getElementById("niceCheckbox3")); - startChangeCheck(document.getElementById("niceCheckbox4")); - startChangeCheck(document.getElementById("niceCheckbox5")); -} \ No newline at end of file diff --git a/doc/design/js/checkbox.js b/doc/design/js/checkbox.js deleted file mode 100644 index 580724875..000000000 --- a/doc/design/js/checkbox.js +++ /dev/null @@ -1,35 +0,0 @@ -function changeCheck(el) - -{ - var el = el, - input = el.getElementsByTagName("input")[0]; - - if(input.checked) - { - el.style.backgroundPosition="0 0"; - input.checked=false; - } - else - { - el.style.backgroundPosition="0 -17px"; - input.checked=true; - } - return true; -} -function startChangeCheck(el) - -{ - var el = el, - input = el.getElementsByTagName("input")[0]; - if(input.checked) - { - el.style.backgroundPosition="0 -17px"; - } - return true; -} - -function startCheck() -{ - - startChangeCheck(document.getElementById("niceCheckbox1")); -} \ No newline at end of file diff --git a/doc/design/js/codemirror.js b/doc/design/js/codemirror.js deleted file mode 100644 index 3635eef9d..000000000 --- a/doc/design/js/codemirror.js +++ /dev/null @@ -1,2817 +0,0 @@ -// CodeMirror version 2.21 -// -// All functions that need access to the editor's state live inside -// the CodeMirror function. Below that, at the bottom of the file, -// some utilities are defined. - -// CodeMirror is the only global var we claim -var CodeMirror = (function() { - // This is the function that produces an editor instance. It's - // closure is used to store the editor state. - function CodeMirror(place, givenOptions) { - // Determine effective options based on given values and defaults. - var options = {}, defaults = CodeMirror.defaults; - for (var opt in defaults) - if (defaults.hasOwnProperty(opt)) - options[opt] = (givenOptions && givenOptions.hasOwnProperty(opt) ? givenOptions : defaults)[opt]; - - var targetDocument = options["document"]; - // The element in which the editor lives. - var wrapper = targetDocument.createElement("div"); - wrapper.className = "CodeMirror" + (options.lineWrapping ? " CodeMirror-wrap" : ""); - // This mess creates the base DOM structure for the editor. - wrapper.innerHTML = - '
' + // Wraps and hides input textarea - '
' + - '
' + - '
' + // Set to the height of the text, causes scrolling - '
' + // Moved around its parent to cover visible view - '
' + - // Provides positioning relative to (visible) text origin - '
' + - '
' + - '
 
' + // Absolutely positioned blinky cursor - '
' + // DIVs containing the selection and the actual code - '
'; - if (place.appendChild) place.appendChild(wrapper); else place(wrapper); - // I've never seen more elegant code in my life. - var inputDiv = wrapper.firstChild, input = inputDiv.firstChild, - scroller = wrapper.lastChild, code = scroller.firstChild, - mover = code.firstChild, gutter = mover.firstChild, gutterText = gutter.firstChild, - lineSpace = gutter.nextSibling.firstChild, measure = lineSpace.firstChild, - cursor = measure.nextSibling, selectionDiv = cursor.nextSibling, - lineDiv = selectionDiv.nextSibling; - themeChanged(); - // Needed to hide big blue blinking cursor on Mobile Safari - if (ios) input.style.width = "0px"; - if (!webkit) lineSpace.draggable = true; - lineSpace.style.outline = "none"; - if (options.tabindex != null) input.tabIndex = options.tabindex; - if (!options.gutter && !options.lineNumbers) gutter.style.display = "none"; - - // Check for problem with IE innerHTML not working when we have a - // P (or similar) parent node. - try { stringWidth("x"); } - catch (e) { - if (e.message.match(/runtime/i)) - e = new Error("A CodeMirror inside a P-style element does not work in Internet Explorer. (innerHTML bug)"); - throw e; - } - - // Delayed object wrap timeouts, making sure only one is active. blinker holds an interval. - var poll = new Delayed(), highlight = new Delayed(), blinker; - - // mode holds a mode API object. doc is the tree of Line objects, - // work an array of lines that should be parsed, and history the - // undo history (instance of History constructor). - var mode, doc = new BranchChunk([new LeafChunk([new Line("")])]), work, focused; - loadMode(); - // The selection. These are always maintained to point at valid - // positions. Inverted is used to remember that the user is - // selecting bottom-to-top. - var sel = {from: {line: 0, ch: 0}, to: {line: 0, ch: 0}, inverted: false}; - // Selection-related flags. shiftSelecting obviously tracks - // whether the user is holding shift. - var shiftSelecting, lastClick, lastDoubleClick, lastScrollPos = 0, draggingText, - overwrite = false, suppressEdits = false; - // Variables used by startOperation/endOperation to track what - // happened during the operation. - var updateInput, userSelChange, changes, textChanged, selectionChanged, leaveInputAlone, - gutterDirty, callbacks; - // Current visible range (may be bigger than the view window). - var displayOffset = 0, showingFrom = 0, showingTo = 0, lastSizeC = 0; - // bracketHighlighted is used to remember that a backet has been - // marked. - var bracketHighlighted; - // Tracks the maximum line length so that the horizontal scrollbar - // can be kept static when scrolling. - var maxLine = "", maxWidth, tabText = computeTabText(); - - // Initialize the content. - operation(function(){setValue(options.value || ""); updateInput = false;})(); - var history = new History(); - - // Register our event handlers. - connect(scroller, "mousedown", operation(onMouseDown)); - connect(scroller, "dblclick", operation(onDoubleClick)); - connect(lineSpace, "dragstart", onDragStart); - connect(lineSpace, "selectstart", e_preventDefault); - // Gecko browsers fire contextmenu *after* opening the menu, at - // which point we can't mess with it anymore. Context menu is - // handled in onMouseDown for Gecko. - if (!gecko) connect(scroller, "contextmenu", onContextMenu); - connect(scroller, "scroll", function() { - lastScrollPos = scroller.scrollTop; - updateDisplay([]); - if (options.fixedGutter) gutter.style.left = scroller.scrollLeft + "px"; - if (options.onScroll) options.onScroll(instance); - }); - connect(window, "resize", function() {updateDisplay(true);}); - connect(input, "keyup", operation(onKeyUp)); - connect(input, "input", fastPoll); - connect(input, "keydown", operation(onKeyDown)); - connect(input, "keypress", operation(onKeyPress)); - connect(input, "focus", onFocus); - connect(input, "blur", onBlur); - - connect(scroller, "dragenter", e_stop); - connect(scroller, "dragover", e_stop); - connect(scroller, "drop", operation(onDrop)); - connect(scroller, "paste", function(){focusInput(); fastPoll();}); - connect(input, "paste", fastPoll); - connect(input, "cut", operation(function(){ - if (!options.readOnly) replaceSelection(""); - })); - - // IE throws unspecified error in certain cases, when - // trying to access activeElement before onload - var hasFocus; try { hasFocus = (targetDocument.activeElement == input); } catch(e) { } - if (hasFocus) setTimeout(onFocus, 20); - else onBlur(); - - function isLine(l) {return l >= 0 && l < doc.size;} - // The instance object that we'll return. Mostly calls out to - // local functions in the CodeMirror function. Some do some extra - // range checking and/or clipping. operation is used to wrap the - // call so that changes it makes are tracked, and the display is - // updated afterwards. - var instance = wrapper.CodeMirror = { - getValue: getValue, - setValue: operation(setValue), - getSelection: getSelection, - replaceSelection: operation(replaceSelection), - focus: function(){focusInput(); onFocus(); fastPoll();}, - setOption: function(option, value) { - var oldVal = options[option]; - options[option] = value; - if (option == "mode" || option == "indentUnit") loadMode(); - else if (option == "readOnly" && value == "nocursor") {onBlur(); input.blur();} - else if (option == "readOnly" && !value) {resetInput(true);} - else if (option == "theme") themeChanged(); - else if (option == "lineWrapping" && oldVal != value) operation(wrappingChanged)(); - else if (option == "tabSize") operation(tabsChanged)(); - if (option == "lineNumbers" || option == "gutter" || option == "firstLineNumber" || option == "theme") - updateDisplay(true); - }, - getOption: function(option) {return options[option];}, - undo: operation(undo), - redo: operation(redo), - indentLine: operation(function(n, dir) { - if (typeof dir != "string") { - if (dir == null) dir = options.smartIndent ? "smart" : "prev"; - else dir = dir ? "add" : "subtract"; - } - if (isLine(n)) indentLine(n, dir); - }), - indentSelection: operation(indentSelected), - historySize: function() {return {undo: history.done.length, redo: history.undone.length};}, - clearHistory: function() {history = new History();}, - matchBrackets: operation(function(){matchBrackets(true);}), - getTokenAt: operation(function(pos) { - pos = clipPos(pos); - return getLine(pos.line).getTokenAt(mode, getStateBefore(pos.line), pos.ch); - }), - getStateAfter: function(line) { - line = clipLine(line == null ? doc.size - 1: line); - return getStateBefore(line + 1); - }, - cursorCoords: function(start){ - if (start == null) start = sel.inverted; - return pageCoords(start ? sel.from : sel.to); - }, - charCoords: function(pos){return pageCoords(clipPos(pos));}, - coordsChar: function(coords) { - var off = eltOffset(lineSpace); - return coordsChar(coords.x - off.left, coords.y - off.top); - }, - markText: operation(markText), - setBookmark: setBookmark, - setMarker: operation(addGutterMarker), - clearMarker: operation(removeGutterMarker), - setLineClass: operation(setLineClass), - hideLine: operation(function(h) {return setLineHidden(h, true);}), - showLine: operation(function(h) {return setLineHidden(h, false);}), - onDeleteLine: function(line, f) { - if (typeof line == "number") { - if (!isLine(line)) return null; - line = getLine(line); - } - (line.handlers || (line.handlers = [])).push(f); - return line; - }, - lineInfo: lineInfo, - addWidget: function(pos, node, scroll, vert, horiz) { - pos = localCoords(clipPos(pos)); - var top = pos.yBot, left = pos.x; - node.style.position = "absolute"; - code.appendChild(node); - if (vert == "over") top = pos.y; - else if (vert == "near") { - var vspace = Math.max(scroller.offsetHeight, doc.height * textHeight()), - hspace = Math.max(code.clientWidth, lineSpace.clientWidth) - paddingLeft(); - if (pos.yBot + node.offsetHeight > vspace && pos.y > node.offsetHeight) - top = pos.y - node.offsetHeight; - if (left + node.offsetWidth > hspace) - left = hspace - node.offsetWidth; - } - node.style.top = (top + paddingTop()) + "px"; - node.style.left = node.style.right = ""; - if (horiz == "right") { - left = code.clientWidth - node.offsetWidth; - node.style.right = "0px"; - } else { - if (horiz == "left") left = 0; - else if (horiz == "middle") left = (code.clientWidth - node.offsetWidth) / 2; - node.style.left = (left + paddingLeft()) + "px"; - } - if (scroll) - scrollIntoView(left, top, left + node.offsetWidth, top + node.offsetHeight); - }, - - lineCount: function() {return doc.size;}, - clipPos: clipPos, - getCursor: function(start) { - if (start == null) start = sel.inverted; - return copyPos(start ? sel.from : sel.to); - }, - somethingSelected: function() {return !posEq(sel.from, sel.to);}, - setCursor: operation(function(line, ch, user) { - if (ch == null && typeof line.line == "number") setCursor(line.line, line.ch, user); - else setCursor(line, ch, user); - }), - setSelection: operation(function(from, to, user) { - (user ? setSelectionUser : setSelection)(clipPos(from), clipPos(to || from)); - }), - getLine: function(line) {if (isLine(line)) return getLine(line).text;}, - getLineHandle: function(line) {if (isLine(line)) return getLine(line);}, - setLine: operation(function(line, text) { - if (isLine(line)) replaceRange(text, {line: line, ch: 0}, {line: line, ch: getLine(line).text.length}); - }), - removeLine: operation(function(line) { - if (isLine(line)) replaceRange("", {line: line, ch: 0}, clipPos({line: line+1, ch: 0})); - }), - replaceRange: operation(replaceRange), - getRange: function(from, to) {return getRange(clipPos(from), clipPos(to));}, - - execCommand: function(cmd) {return commands[cmd](instance);}, - // Stuff used by commands, probably not much use to outside code. - moveH: operation(moveH), - deleteH: operation(deleteH), - moveV: operation(moveV), - toggleOverwrite: function() {overwrite = !overwrite;}, - - posFromIndex: function(off) { - var lineNo = 0, ch; - doc.iter(0, doc.size, function(line) { - var sz = line.text.length + 1; - if (sz > off) { ch = off; return true; } - off -= sz; - ++lineNo; - }); - return clipPos({line: lineNo, ch: ch}); - }, - indexFromPos: function (coords) { - if (coords.line < 0 || coords.ch < 0) return 0; - var index = coords.ch; - doc.iter(0, coords.line, function (line) { - index += line.text.length + 1; - }); - return index; - }, - scrollTo: function(x, y) { - if (x != null) scroller.scrollTop = x; - if (y != null) scroller.scrollLeft = y; - updateDisplay([]); - }, - - operation: function(f){return operation(f)();}, - refresh: function(){ - updateDisplay(true); - if (scroller.scrollHeight > lastScrollPos) - scroller.scrollTop = lastScrollPos; - }, - getInputField: function(){return input;}, - getWrapperElement: function(){return wrapper;}, - getScrollerElement: function(){return scroller;}, - getGutterElement: function(){return gutter;} - }; - - function getLine(n) { return getLineAt(doc, n); } - function updateLineHeight(line, height) { - gutterDirty = true; - var diff = height - line.height; - for (var n = line; n; n = n.parent) n.height += diff; - } - - function setValue(code) { - var top = {line: 0, ch: 0}; - updateLines(top, {line: doc.size - 1, ch: getLine(doc.size-1).text.length}, - splitLines(code), top, top); - updateInput = true; - } - function getValue(code) { - var text = []; - doc.iter(0, doc.size, function(line) { text.push(line.text); }); - return text.join("\n"); - } - - function onMouseDown(e) { - setShift(e_prop(e, "shiftKey")); - // Check whether this is a click in a widget - for (var n = e_target(e); n != wrapper; n = n.parentNode) - if (n.parentNode == code && n != mover) return; - - // See if this is a click in the gutter - for (var n = e_target(e); n != wrapper; n = n.parentNode) - if (n.parentNode == gutterText) { - if (options.onGutterClick) - options.onGutterClick(instance, indexOf(gutterText.childNodes, n) + showingFrom, e); - return e_preventDefault(e); - } - - var start = posFromMouse(e); - - switch (e_button(e)) { - case 3: - if (gecko && !mac) onContextMenu(e); - return; - case 2: - if (start) setCursor(start.line, start.ch, true); - return; - } - // For button 1, if it was clicked inside the editor - // (posFromMouse returning non-null), we have to adjust the - // selection. - if (!start) {if (e_target(e) == scroller) e_preventDefault(e); return;} - - if (!focused) onFocus(); - - var now = +new Date; - if (lastDoubleClick && lastDoubleClick.time > now - 400 && posEq(lastDoubleClick.pos, start)) { - e_preventDefault(e); - setTimeout(focusInput, 20); - return selectLine(start.line); - } else if (lastClick && lastClick.time > now - 400 && posEq(lastClick.pos, start)) { - lastDoubleClick = {time: now, pos: start}; - e_preventDefault(e); - return selectWordAt(start); - } else { lastClick = {time: now, pos: start}; } - - var last = start, going; - if (dragAndDrop && !options.readOnly && !posEq(sel.from, sel.to) && - !posLess(start, sel.from) && !posLess(sel.to, start)) { - // Let the drag handler handle this. - if (webkit) lineSpace.draggable = true; - var up = connect(targetDocument, "mouseup", operation(function(e2) { - if (webkit) lineSpace.draggable = false; - draggingText = false; - up(); - if (Math.abs(e.clientX - e2.clientX) + Math.abs(e.clientY - e2.clientY) < 10) { - e_preventDefault(e2); - setCursor(start.line, start.ch, true); - focusInput(); - } - }), true); - draggingText = true; - return; - } - e_preventDefault(e); - setCursor(start.line, start.ch, true); - - function extend(e) { - var cur = posFromMouse(e, true); - if (cur && !posEq(cur, last)) { - if (!focused) onFocus(); - last = cur; - setSelectionUser(start, cur); - updateInput = false; - var visible = visibleLines(); - if (cur.line >= visible.to || cur.line < visible.from) - going = setTimeout(operation(function(){extend(e);}), 150); - } - } - - var move = connect(targetDocument, "mousemove", operation(function(e) { - clearTimeout(going); - e_preventDefault(e); - extend(e); - }), true); - var up = connect(targetDocument, "mouseup", operation(function(e) { - clearTimeout(going); - var cur = posFromMouse(e); - if (cur) setSelectionUser(start, cur); - e_preventDefault(e); - focusInput(); - updateInput = true; - move(); up(); - }), true); - } - function onDoubleClick(e) { - for (var n = e_target(e); n != wrapper; n = n.parentNode) - if (n.parentNode == gutterText) return e_preventDefault(e); - var start = posFromMouse(e); - if (!start) return; - lastDoubleClick = {time: +new Date, pos: start}; - e_preventDefault(e); - selectWordAt(start); - } - function onDrop(e) { - e.preventDefault(); - var pos = posFromMouse(e, true), files = e.dataTransfer.files; - if (!pos || options.readOnly) return; - if (files && files.length && window.FileReader && window.File) { - function loadFile(file, i) { - var reader = new FileReader; - reader.onload = function() { - text[i] = reader.result; - if (++read == n) { - pos = clipPos(pos); - operation(function() { - var end = replaceRange(text.join(""), pos, pos); - setSelectionUser(pos, end); - })(); - } - }; - reader.readAsText(file); - } - var n = files.length, text = Array(n), read = 0; - for (var i = 0; i < n; ++i) loadFile(files[i], i); - } - else { - try { - var text = e.dataTransfer.getData("Text"); - if (text) { - var curFrom = sel.from, curTo = sel.to; - setSelectionUser(pos, pos); - if (draggingText) replaceRange("", curFrom, curTo); - replaceSelection(text); - focusInput(); - } - } - catch(e){} - } - } - function onDragStart(e) { - var txt = getSelection(); - // This will reset escapeElement - htmlEscape(txt); - e.dataTransfer.setDragImage(escapeElement, 0, 0); - e.dataTransfer.setData("Text", txt); - } - function handleKeyBinding(e) { - var name = keyNames[e_prop(e, "keyCode")], next = keyMap[options.keyMap].auto, bound, dropShift; - function handleNext() { - return next.call ? next.call(null, instance) : next; - } - if (name == null || e.altGraphKey) { - if (next) options.keyMap = handleNext(); - return null; - } - if (e_prop(e, "altKey")) name = "Alt-" + name; - if (e_prop(e, "ctrlKey")) name = "Ctrl-" + name; - if (e_prop(e, "metaKey")) name = "Cmd-" + name; - if (e_prop(e, "shiftKey") && - (bound = lookupKey("Shift-" + name, options.extraKeys, options.keyMap))) { - dropShift = true; - } else { - bound = lookupKey(name, options.extraKeys, options.keyMap); - } - if (typeof bound == "string") { - if (commands.propertyIsEnumerable(bound)) bound = commands[bound]; - else bound = null; - } - if (next && (bound || !isModifierKey(e))) options.keyMap = handleNext(); - if (!bound) return false; - var prevShift = shiftSelecting; - try { - if (options.readOnly) suppressEdits = true; - if (dropShift) shiftSelecting = null; - bound(instance); - } finally { - shiftSelecting = prevShift; - suppressEdits = false; - } - e_preventDefault(e); - return true; - } - var lastStoppedKey = null; - function onKeyDown(e) { - if (!focused) onFocus(); - if (ie && e.keyCode == 27) { e.returnValue = false; } - if (options.onKeyEvent && options.onKeyEvent(instance, addStop(e))) return; - var code = e_prop(e, "keyCode"); - // IE does strange things with escape. - setShift(code == 16 || e_prop(e, "shiftKey")); - // First give onKeyEvent option a chance to handle this. - var handled = handleKeyBinding(e); - if (window.opera) { - lastStoppedKey = handled ? code : null; - // Opera has no cut event... we try to at least catch the key combo - if (!handled && code == 88 && e_prop(e, mac ? "metaKey" : "ctrlKey")) - replaceSelection(""); - } - } - function onKeyPress(e) { - var keyCode = e_prop(e, "keyCode"), charCode = e_prop(e, "charCode"); - if (window.opera && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return;} - if (options.onKeyEvent && options.onKeyEvent(instance, addStop(e))) return; - if (window.opera && !e.which && handleKeyBinding(e)) return; - if (options.electricChars && mode.electricChars && options.smartIndent && !options.readOnly) { - var ch = String.fromCharCode(charCode == null ? keyCode : charCode); - if (mode.electricChars.indexOf(ch) > -1) - setTimeout(operation(function() {indentLine(sel.to.line, "smart");}), 75); - } - fastPoll(); - } - function onKeyUp(e) { - if (options.onKeyEvent && options.onKeyEvent(instance, addStop(e))) return; - if (e_prop(e, "keyCode") == 16) shiftSelecting = null; - } - - function onFocus() { - if (options.readOnly == "nocursor") return; - if (!focused) { - if (options.onFocus) options.onFocus(instance); - focused = true; - if (wrapper.className.search(/\bCodeMirror-focused\b/) == -1) - wrapper.className += " CodeMirror-focused"; - if (!leaveInputAlone) resetInput(true); - } - slowPoll(); - restartBlink(); - } - function onBlur() { - if (focused) { - if (options.onBlur) options.onBlur(instance); - focused = false; - if (bracketHighlighted) - operation(function(){ - if (bracketHighlighted) { bracketHighlighted(); bracketHighlighted = null; } - })(); - wrapper.className = wrapper.className.replace(" CodeMirror-focused", ""); - } - clearInterval(blinker); - setTimeout(function() {if (!focused) shiftSelecting = null;}, 150); - } - - // Replace the range from from to to by the strings in newText. - // Afterwards, set the selection to selFrom, selTo. - function updateLines(from, to, newText, selFrom, selTo) { - if (suppressEdits) return; - if (history) { - var old = []; - doc.iter(from.line, to.line + 1, function(line) { old.push(line.text); }); - history.addChange(from.line, newText.length, old); - while (history.done.length > options.undoDepth) history.done.shift(); - } - updateLinesNoUndo(from, to, newText, selFrom, selTo); - } - function unredoHelper(from, to, dir) { - var set = from.pop(), len = set ? set.length : 0, out = []; - for (var i = dir > 0 ? 0 : len - 1, e = dir > 0 ? len : -1; i != e; i += dir) { - var change = set[i]; - var replaced = [], end = change.start + change.added; - doc.iter(change.start, end, function(line) { replaced.push(line.text); }); - out.push({start: change.start, added: change.old.length, old: replaced}); - var pos = clipPos({line: change.start + change.old.length - 1, - ch: editEnd(replaced[replaced.length-1], change.old[change.old.length-1])}); - updateLinesNoUndo({line: change.start, ch: 0}, {line: end - 1, ch: getLine(end-1).text.length}, change.old, pos, pos); - } - updateInput = true; - to.push(out); - } - function undo() {unredoHelper(history.done, history.undone, -1);} - function redo() {unredoHelper(history.undone, history.done, 1);} - - function updateLinesNoUndo(from, to, newText, selFrom, selTo) { - if (suppressEdits) return; - var recomputeMaxLength = false, maxLineLength = maxLine.length; - if (!options.lineWrapping) - doc.iter(from.line, to.line, function(line) { - if (line.text.length == maxLineLength) {recomputeMaxLength = true; return true;} - }); - if (from.line != to.line || newText.length > 1) gutterDirty = true; - - var nlines = to.line - from.line, firstLine = getLine(from.line), lastLine = getLine(to.line); - // First adjust the line structure, taking some care to leave highlighting intact. - if (from.ch == 0 && to.ch == 0 && newText[newText.length - 1] == "") { - // This is a whole-line replace. Treated specially to make - // sure line objects move the way they are supposed to. - var added = [], prevLine = null; - if (from.line) { - prevLine = getLine(from.line - 1); - prevLine.fixMarkEnds(lastLine); - } else lastLine.fixMarkStarts(); - for (var i = 0, e = newText.length - 1; i < e; ++i) - added.push(Line.inheritMarks(newText[i], prevLine)); - if (nlines) doc.remove(from.line, nlines, callbacks); - if (added.length) doc.insert(from.line, added); - } else if (firstLine == lastLine) { - if (newText.length == 1) - firstLine.replace(from.ch, to.ch, newText[0]); - else { - lastLine = firstLine.split(to.ch, newText[newText.length-1]); - firstLine.replace(from.ch, null, newText[0]); - firstLine.fixMarkEnds(lastLine); - var added = []; - for (var i = 1, e = newText.length - 1; i < e; ++i) - added.push(Line.inheritMarks(newText[i], firstLine)); - added.push(lastLine); - doc.insert(from.line + 1, added); - } - } else if (newText.length == 1) { - firstLine.replace(from.ch, null, newText[0]); - lastLine.replace(null, to.ch, ""); - firstLine.append(lastLine); - doc.remove(from.line + 1, nlines, callbacks); - } else { - var added = []; - firstLine.replace(from.ch, null, newText[0]); - lastLine.replace(null, to.ch, newText[newText.length-1]); - firstLine.fixMarkEnds(lastLine); - for (var i = 1, e = newText.length - 1; i < e; ++i) - added.push(Line.inheritMarks(newText[i], firstLine)); - if (nlines > 1) doc.remove(from.line + 1, nlines - 1, callbacks); - doc.insert(from.line + 1, added); - } - if (options.lineWrapping) { - var perLine = scroller.clientWidth / charWidth() - 3; - doc.iter(from.line, from.line + newText.length, function(line) { - if (line.hidden) return; - var guess = Math.ceil(line.text.length / perLine) || 1; - if (guess != line.height) updateLineHeight(line, guess); - }); - } else { - doc.iter(from.line, i + newText.length, function(line) { - var l = line.text; - if (l.length > maxLineLength) { - maxLine = l; maxLineLength = l.length; maxWidth = null; - recomputeMaxLength = false; - } - }); - if (recomputeMaxLength) { - maxLineLength = 0; maxLine = ""; maxWidth = null; - doc.iter(0, doc.size, function(line) { - var l = line.text; - if (l.length > maxLineLength) { - maxLineLength = l.length; maxLine = l; - } - }); - } - } - - // Add these lines to the work array, so that they will be - // highlighted. Adjust work lines if lines were added/removed. - var newWork = [], lendiff = newText.length - nlines - 1; - for (var i = 0, l = work.length; i < l; ++i) { - var task = work[i]; - if (task < from.line) newWork.push(task); - else if (task > to.line) newWork.push(task + lendiff); - } - var hlEnd = from.line + Math.min(newText.length, 500); - highlightLines(from.line, hlEnd); - newWork.push(hlEnd); - work = newWork; - startWorker(100); - // Remember that these lines changed, for updating the display - changes.push({from: from.line, to: to.line + 1, diff: lendiff}); - var changeObj = {from: from, to: to, text: newText}; - if (textChanged) { - for (var cur = textChanged; cur.next; cur = cur.next) {} - cur.next = changeObj; - } else textChanged = changeObj; - - // Update the selection - function updateLine(n) {return n <= Math.min(to.line, to.line + lendiff) ? n : n + lendiff;} - setSelection(selFrom, selTo, updateLine(sel.from.line), updateLine(sel.to.line)); - - // Make sure the scroll-size div has the correct height. - if (scroller.clientHeight) - code.style.height = (doc.height * textHeight() + 2 * paddingTop()) + "px"; - } - - function replaceRange(code, from, to) { - from = clipPos(from); - if (!to) to = from; else to = clipPos(to); - code = splitLines(code); - function adjustPos(pos) { - if (posLess(pos, from)) return pos; - if (!posLess(to, pos)) return end; - var line = pos.line + code.length - (to.line - from.line) - 1; - var ch = pos.ch; - if (pos.line == to.line) - ch += code[code.length-1].length - (to.ch - (to.line == from.line ? from.ch : 0)); - return {line: line, ch: ch}; - } - var end; - replaceRange1(code, from, to, function(end1) { - end = end1; - return {from: adjustPos(sel.from), to: adjustPos(sel.to)}; - }); - return end; - } - function replaceSelection(code, collapse) { - replaceRange1(splitLines(code), sel.from, sel.to, function(end) { - if (collapse == "end") return {from: end, to: end}; - else if (collapse == "start") return {from: sel.from, to: sel.from}; - else return {from: sel.from, to: end}; - }); - } - function replaceRange1(code, from, to, computeSel) { - var endch = code.length == 1 ? code[0].length + from.ch : code[code.length-1].length; - var newSel = computeSel({line: from.line + code.length - 1, ch: endch}); - updateLines(from, to, code, newSel.from, newSel.to); - } - - function getRange(from, to) { - var l1 = from.line, l2 = to.line; - if (l1 == l2) return getLine(l1).text.slice(from.ch, to.ch); - var code = [getLine(l1).text.slice(from.ch)]; - doc.iter(l1 + 1, l2, function(line) { code.push(line.text); }); - code.push(getLine(l2).text.slice(0, to.ch)); - return code.join("\n"); - } - function getSelection() { - return getRange(sel.from, sel.to); - } - - var pollingFast = false; // Ensures slowPoll doesn't cancel fastPoll - function slowPoll() { - if (pollingFast) return; - poll.set(options.pollInterval, function() { - startOperation(); - readInput(); - if (focused) slowPoll(); - endOperation(); - }); - } - function fastPoll() { - var missed = false; - pollingFast = true; - function p() { - startOperation(); - var changed = readInput(); - if (!changed && !missed) {missed = true; poll.set(60, p);} - else {pollingFast = false; slowPoll();} - endOperation(); - } - poll.set(20, p); - } - - // Previnput is a hack to work with IME. If we reset the textarea - // on every change, that breaks IME. So we look for changes - // compared to the previous content instead. (Modern browsers have - // events that indicate IME taking place, but these are not widely - // supported or compatible enough yet to rely on.) - var prevInput = ""; - function readInput() { - if (leaveInputAlone || !focused || hasSelection(input) || options.readOnly) return false; - var text = input.value; - if (text == prevInput) return false; - shiftSelecting = null; - var same = 0, l = Math.min(prevInput.length, text.length); - while (same < l && prevInput[same] == text[same]) ++same; - if (same < prevInput.length) - sel.from = {line: sel.from.line, ch: sel.from.ch - (prevInput.length - same)}; - else if (overwrite && posEq(sel.from, sel.to)) - sel.to = {line: sel.to.line, ch: Math.min(getLine(sel.to.line).text.length, sel.to.ch + (text.length - same))}; - replaceSelection(text.slice(same), "end"); - prevInput = text; - return true; - } - function resetInput(user) { - if (!posEq(sel.from, sel.to)) { - prevInput = ""; - input.value = getSelection(); - input.select(); - } else if (user) prevInput = input.value = ""; - } - - function focusInput() { - if (options.readOnly != "nocursor") input.focus(); - } - - function scrollEditorIntoView() { - if (!cursor.getBoundingClientRect) return; - var rect = cursor.getBoundingClientRect(); - // IE returns bogus coordinates when the instance sits inside of an iframe and the cursor is hidden - if (ie && rect.top == rect.bottom) return; - var winH = window.innerHeight || Math.max(document.body.offsetHeight, document.documentElement.offsetHeight); - if (rect.top < 0 || rect.bottom > winH) cursor.scrollIntoView(); - } - function scrollCursorIntoView() { - var cursor = localCoords(sel.inverted ? sel.from : sel.to); - var x = options.lineWrapping ? Math.min(cursor.x, lineSpace.offsetWidth) : cursor.x; - return scrollIntoView(x, cursor.y, x, cursor.yBot); - } - function scrollIntoView(x1, y1, x2, y2) { - var pl = paddingLeft(), pt = paddingTop(), lh = textHeight(); - y1 += pt; y2 += pt; x1 += pl; x2 += pl; - var screen = scroller.clientHeight, screentop = scroller.scrollTop, scrolled = false, result = true; - if (y1 < screentop) {scroller.scrollTop = Math.max(0, y1 - 2*lh); scrolled = true;} - else if (y2 > screentop + screen) {scroller.scrollTop = y2 + lh - screen; scrolled = true;} - - var screenw = scroller.clientWidth, screenleft = scroller.scrollLeft; - var gutterw = options.fixedGutter ? gutter.clientWidth : 0; - if (x1 < screenleft + gutterw) { - if (x1 < 50) x1 = 0; - scroller.scrollLeft = Math.max(0, x1 - 10 - gutterw); - scrolled = true; - } - else if (x2 > screenw + screenleft - 3) { - scroller.scrollLeft = x2 + 10 - screenw; - scrolled = true; - if (x2 > code.clientWidth) result = false; - } - if (scrolled && options.onScroll) options.onScroll(instance); - return result; - } - - function visibleLines() { - var lh = textHeight(), top = scroller.scrollTop - paddingTop(); - var from_height = Math.max(0, Math.floor(top / lh)); - var to_height = Math.ceil((top + scroller.clientHeight) / lh); - return {from: lineAtHeight(doc, from_height), - to: lineAtHeight(doc, to_height)}; - } - // Uses a set of changes plus the current scroll position to - // determine which DOM updates have to be made, and makes the - // updates. - function updateDisplay(changes, suppressCallback) { - if (!scroller.clientWidth) { - showingFrom = showingTo = displayOffset = 0; - return; - } - // Compute the new visible window - var visible = visibleLines(); - // Bail out if the visible area is already rendered and nothing changed. - if (changes !== true && changes.length == 0 && visible.from > showingFrom && visible.to < showingTo) return; - var from = Math.max(visible.from - 100, 0), to = Math.min(doc.size, visible.to + 100); - if (showingFrom < from && from - showingFrom < 20) from = showingFrom; - if (showingTo > to && showingTo - to < 20) to = Math.min(doc.size, showingTo); - - // Create a range of theoretically intact lines, and punch holes - // in that using the change info. - var intact = changes === true ? [] : - computeIntact([{from: showingFrom, to: showingTo, domStart: 0}], changes); - // Clip off the parts that won't be visible - var intactLines = 0; - for (var i = 0; i < intact.length; ++i) { - var range = intact[i]; - if (range.from < from) {range.domStart += (from - range.from); range.from = from;} - if (range.to > to) range.to = to; - if (range.from >= range.to) intact.splice(i--, 1); - else intactLines += range.to - range.from; - } - if (intactLines == to - from) return; - intact.sort(function(a, b) {return a.domStart - b.domStart;}); - - var th = textHeight(), gutterDisplay = gutter.style.display; - lineDiv.style.display = "none"; - patchDisplay(from, to, intact); - lineDiv.style.display = gutter.style.display = ""; - - // Position the mover div to align with the lines it's supposed - // to be showing (which will cover the visible display) - var different = from != showingFrom || to != showingTo || lastSizeC != scroller.clientHeight + th; - // This is just a bogus formula that detects when the editor is - // resized or the font size changes. - if (different) lastSizeC = scroller.clientHeight + th; - showingFrom = from; showingTo = to; - displayOffset = heightAtLine(doc, from); - mover.style.top = (displayOffset * th) + "px"; - if (scroller.clientHeight) - code.style.height = (doc.height * th + 2 * paddingTop()) + "px"; - - // Since this is all rather error prone, it is honoured with the - // only assertion in the whole file. - if (lineDiv.childNodes.length != showingTo - showingFrom) - throw new Error("BAD PATCH! " + JSON.stringify(intact) + " size=" + (showingTo - showingFrom) + - " nodes=" + lineDiv.childNodes.length); - - if (options.lineWrapping) { - maxWidth = scroller.clientWidth; - var curNode = lineDiv.firstChild, heightChanged = false; - doc.iter(showingFrom, showingTo, function(line) { - if (!line.hidden) { - var height = Math.round(curNode.offsetHeight / th) || 1; - if (line.height != height) { - updateLineHeight(line, height); - gutterDirty = heightChanged = true; - } - } - curNode = curNode.nextSibling; - }); - if (heightChanged) - code.style.height = (doc.height * th + 2 * paddingTop()) + "px"; - } else { - if (maxWidth == null) maxWidth = stringWidth(maxLine); - if (maxWidth > scroller.clientWidth) { - lineSpace.style.width = maxWidth + "px"; - // Needed to prevent odd wrapping/hiding of widgets placed in here. - code.style.width = ""; - code.style.width = scroller.scrollWidth + "px"; - } else { - lineSpace.style.width = code.style.width = ""; - } - } - gutter.style.display = gutterDisplay; - if (different || gutterDirty) updateGutter(); - updateSelection(); - if (!suppressCallback && options.onUpdate) options.onUpdate(instance); - return true; - } - - function computeIntact(intact, changes) { - for (var i = 0, l = changes.length || 0; i < l; ++i) { - var change = changes[i], intact2 = [], diff = change.diff || 0; - for (var j = 0, l2 = intact.length; j < l2; ++j) { - var range = intact[j]; - if (change.to <= range.from && change.diff) - intact2.push({from: range.from + diff, to: range.to + diff, - domStart: range.domStart}); - else if (change.to <= range.from || change.from >= range.to) - intact2.push(range); - else { - if (change.from > range.from) - intact2.push({from: range.from, to: change.from, domStart: range.domStart}); - if (change.to < range.to) - intact2.push({from: change.to + diff, to: range.to + diff, - domStart: range.domStart + (change.to - range.from)}); - } - } - intact = intact2; - } - return intact; - } - - function patchDisplay(from, to, intact) { - // The first pass removes the DOM nodes that aren't intact. - if (!intact.length) lineDiv.innerHTML = ""; - else { - function killNode(node) { - var tmp = node.nextSibling; - node.parentNode.removeChild(node); - return tmp; - } - var domPos = 0, curNode = lineDiv.firstChild, n; - for (var i = 0; i < intact.length; ++i) { - var cur = intact[i]; - while (cur.domStart > domPos) {curNode = killNode(curNode); domPos++;} - for (var j = 0, e = cur.to - cur.from; j < e; ++j) {curNode = curNode.nextSibling; domPos++;} - } - while (curNode) curNode = killNode(curNode); - } - // This pass fills in the lines that actually changed. - var nextIntact = intact.shift(), curNode = lineDiv.firstChild, j = from; - var scratch = targetDocument.createElement("div"), newElt; - doc.iter(from, to, function(line) { - if (nextIntact && nextIntact.to == j) nextIntact = intact.shift(); - if (!nextIntact || nextIntact.from > j) { - if (line.hidden) var html = scratch.innerHTML = "
";
-          else {
-            var html = '
' + line.getHTML(tabText) + '
'; - // Kludge to make sure the styled element lies behind the selection (by z-index) - if (line.className) - html = '
 
' + html + "
"; - } - scratch.innerHTML = html; - lineDiv.insertBefore(scratch.firstChild, curNode); - } else { - curNode = curNode.nextSibling; - } - ++j; - }); - } - - function updateGutter() { - if (!options.gutter && !options.lineNumbers) return; - var hText = mover.offsetHeight, hEditor = scroller.clientHeight; - gutter.style.height = (hText - hEditor < 2 ? hEditor : hText) + "px"; - var html = [], i = showingFrom; - doc.iter(showingFrom, Math.max(showingTo, showingFrom + 1), function(line) { - if (line.hidden) { - html.push("
");
-        } else {
-          var marker = line.gutterMarker;
-          var text = options.lineNumbers ? i + options.firstLineNumber : null;
-          if (marker && marker.text)
-            text = marker.text.replace("%N%", text != null ? text : "");
-          else if (text == null)
-            text = "\u00a0";
-          html.push((marker && marker.style ? '
' : "
"), text);
-          for (var j = 1; j < line.height; ++j) html.push("
 "); - html.push("
"); - } - ++i; - }); - gutter.style.display = "none"; - gutterText.innerHTML = html.join(""); - var minwidth = String(doc.size).length, firstNode = gutterText.firstChild, val = eltText(firstNode), pad = ""; - while (val.length + pad.length < minwidth) pad += "\u00a0"; - if (pad) firstNode.insertBefore(targetDocument.createTextNode(pad), firstNode.firstChild); - gutter.style.display = ""; - lineSpace.style.marginLeft = gutter.offsetWidth + "px"; - gutterDirty = false; - } - function updateSelection() { - var collapsed = posEq(sel.from, sel.to); - var fromPos = localCoords(sel.from, true); - var toPos = collapsed ? fromPos : localCoords(sel.to, true); - var headPos = sel.inverted ? fromPos : toPos, th = textHeight(); - var wrapOff = eltOffset(wrapper), lineOff = eltOffset(lineDiv); - inputDiv.style.top = Math.max(0, Math.min(scroller.offsetHeight, headPos.y + lineOff.top - wrapOff.top)) + "px"; - inputDiv.style.left = Math.max(0, Math.min(scroller.offsetWidth, headPos.x + lineOff.left - wrapOff.left)) + "px"; - if (collapsed) { - cursor.style.top = headPos.y + "px"; - cursor.style.left = (options.lineWrapping ? Math.min(headPos.x, lineSpace.offsetWidth) : headPos.x) + "px"; - cursor.style.display = ""; - selectionDiv.style.display = "none"; - } else { - var sameLine = fromPos.y == toPos.y, html = ""; - function add(left, top, right, height) { - html += '
'; - } - if (sel.from.ch && fromPos.y >= 0) { - var right = sameLine ? lineSpace.clientWidth - toPos.x : 0; - add(fromPos.x, fromPos.y, right, th); - } - var middleStart = Math.max(0, fromPos.y + (sel.from.ch ? th : 0)); - var middleHeight = Math.min(toPos.y, lineSpace.clientHeight) - middleStart; - if (middleHeight > 0.2 * th) - add(0, middleStart, 0, middleHeight); - if ((!sameLine || !sel.from.ch) && toPos.y < lineSpace.clientHeight - .5 * th) - add(0, toPos.y, lineSpace.clientWidth - toPos.x, th); - selectionDiv.innerHTML = html; - cursor.style.display = "none"; - selectionDiv.style.display = ""; - } - } - - function setShift(val) { - if (val) shiftSelecting = shiftSelecting || (sel.inverted ? sel.to : sel.from); - else shiftSelecting = null; - } - function setSelectionUser(from, to) { - var sh = shiftSelecting && clipPos(shiftSelecting); - if (sh) { - if (posLess(sh, from)) from = sh; - else if (posLess(to, sh)) to = sh; - } - setSelection(from, to); - userSelChange = true; - } - // Update the selection. Last two args are only used by - // updateLines, since they have to be expressed in the line - // numbers before the update. - function setSelection(from, to, oldFrom, oldTo) { - goalColumn = null; - if (oldFrom == null) {oldFrom = sel.from.line; oldTo = sel.to.line;} - if (posEq(sel.from, from) && posEq(sel.to, to)) return; - if (posLess(to, from)) {var tmp = to; to = from; from = tmp;} - - // Skip over hidden lines. - if (from.line != oldFrom) from = skipHidden(from, oldFrom, sel.from.ch); - if (to.line != oldTo) to = skipHidden(to, oldTo, sel.to.ch); - - if (posEq(from, to)) sel.inverted = false; - else if (posEq(from, sel.to)) sel.inverted = false; - else if (posEq(to, sel.from)) sel.inverted = true; - - sel.from = from; sel.to = to; - selectionChanged = true; - } - function skipHidden(pos, oldLine, oldCh) { - function getNonHidden(dir) { - var lNo = pos.line + dir, end = dir == 1 ? doc.size : -1; - while (lNo != end) { - var line = getLine(lNo); - if (!line.hidden) { - var ch = pos.ch; - if (ch > oldCh || ch > line.text.length) ch = line.text.length; - return {line: lNo, ch: ch}; - } - lNo += dir; - } - } - var line = getLine(pos.line); - if (!line.hidden) return pos; - if (pos.line >= oldLine) return getNonHidden(1) || getNonHidden(-1); - else return getNonHidden(-1) || getNonHidden(1); - } - function setCursor(line, ch, user) { - var pos = clipPos({line: line, ch: ch || 0}); - (user ? setSelectionUser : setSelection)(pos, pos); - } - - function clipLine(n) {return Math.max(0, Math.min(n, doc.size-1));} - function clipPos(pos) { - if (pos.line < 0) return {line: 0, ch: 0}; - if (pos.line >= doc.size) return {line: doc.size-1, ch: getLine(doc.size-1).text.length}; - var ch = pos.ch, linelen = getLine(pos.line).text.length; - if (ch == null || ch > linelen) return {line: pos.line, ch: linelen}; - else if (ch < 0) return {line: pos.line, ch: 0}; - else return pos; - } - - function findPosH(dir, unit) { - var end = sel.inverted ? sel.from : sel.to, line = end.line, ch = end.ch; - var lineObj = getLine(line); - function findNextLine() { - for (var l = line + dir, e = dir < 0 ? -1 : doc.size; l != e; l += dir) { - var lo = getLine(l); - if (!lo.hidden) { line = l; lineObj = lo; return true; } - } - } - function moveOnce(boundToLine) { - if (ch == (dir < 0 ? 0 : lineObj.text.length)) { - if (!boundToLine && findNextLine()) ch = dir < 0 ? lineObj.text.length : 0; - else return false; - } else ch += dir; - return true; - } - if (unit == "char") moveOnce(); - else if (unit == "column") moveOnce(true); - else if (unit == "word") { - var sawWord = false; - for (;;) { - if (dir < 0) if (!moveOnce()) break; - if (isWordChar(lineObj.text.charAt(ch))) sawWord = true; - else if (sawWord) {if (dir < 0) {dir = 1; moveOnce();} break;} - if (dir > 0) if (!moveOnce()) break; - } - } - return {line: line, ch: ch}; - } - function moveH(dir, unit) { - var pos = dir < 0 ? sel.from : sel.to; - if (shiftSelecting || posEq(sel.from, sel.to)) pos = findPosH(dir, unit); - setCursor(pos.line, pos.ch, true); - } - function deleteH(dir, unit) { - if (!posEq(sel.from, sel.to)) replaceRange("", sel.from, sel.to); - else if (dir < 0) replaceRange("", findPosH(dir, unit), sel.to); - else replaceRange("", sel.from, findPosH(dir, unit)); - userSelChange = true; - } - var goalColumn = null; - function moveV(dir, unit) { - var dist = 0, pos = localCoords(sel.inverted ? sel.from : sel.to, true); - if (goalColumn != null) pos.x = goalColumn; - if (unit == "page") dist = Math.min(scroller.clientHeight, window.innerHeight || document.documentElement.clientHeight); - else if (unit == "line") dist = textHeight(); - var target = coordsChar(pos.x, pos.y + dist * dir + 2); - setCursor(target.line, target.ch, true); - goalColumn = pos.x; - } - - function selectWordAt(pos) { - var line = getLine(pos.line).text; - var start = pos.ch, end = pos.ch; - while (start > 0 && isWordChar(line.charAt(start - 1))) --start; - while (end < line.length && isWordChar(line.charAt(end))) ++end; - setSelectionUser({line: pos.line, ch: start}, {line: pos.line, ch: end}); - } - function selectLine(line) { - setSelectionUser({line: line, ch: 0}, {line: line, ch: getLine(line).text.length}); - } - function indentSelected(mode) { - if (posEq(sel.from, sel.to)) return indentLine(sel.from.line, mode); - var e = sel.to.line - (sel.to.ch ? 0 : 1); - for (var i = sel.from.line; i <= e; ++i) indentLine(i, mode); - } - - function indentLine(n, how) { - if (!how) how = "add"; - if (how == "smart") { - if (!mode.indent) how = "prev"; - else var state = getStateBefore(n); - } - - var line = getLine(n), curSpace = line.indentation(options.tabSize), - curSpaceString = line.text.match(/^\s*/)[0], indentation; - if (how == "prev") { - if (n) indentation = getLine(n-1).indentation(options.tabSize); - else indentation = 0; - } - else if (how == "smart") indentation = mode.indent(state, line.text.slice(curSpaceString.length), line.text); - else if (how == "add") indentation = curSpace + options.indentUnit; - else if (how == "subtract") indentation = curSpace - options.indentUnit; - indentation = Math.max(0, indentation); - var diff = indentation - curSpace; - - if (!diff) { - if (sel.from.line != n && sel.to.line != n) return; - var indentString = curSpaceString; - } - else { - var indentString = "", pos = 0; - if (options.indentWithTabs) - for (var i = Math.floor(indentation / options.tabSize); i; --i) {pos += options.tabSize; indentString += "\t";} - while (pos < indentation) {++pos; indentString += " ";} - } - - replaceRange(indentString, {line: n, ch: 0}, {line: n, ch: curSpaceString.length}); - } - - function loadMode() { - mode = CodeMirror.getMode(options, options.mode); - doc.iter(0, doc.size, function(line) { line.stateAfter = null; }); - work = [0]; - startWorker(); - } - function gutterChanged() { - var visible = options.gutter || options.lineNumbers; - gutter.style.display = visible ? "" : "none"; - if (visible) gutterDirty = true; - else lineDiv.parentNode.style.marginLeft = 0; - } - function wrappingChanged(from, to) { - if (options.lineWrapping) { - wrapper.className += " CodeMirror-wrap"; - var perLine = scroller.clientWidth / charWidth() - 3; - doc.iter(0, doc.size, function(line) { - if (line.hidden) return; - var guess = Math.ceil(line.text.length / perLine) || 1; - if (guess != 1) updateLineHeight(line, guess); - }); - lineSpace.style.width = code.style.width = ""; - } else { - wrapper.className = wrapper.className.replace(" CodeMirror-wrap", ""); - maxWidth = null; maxLine = ""; - doc.iter(0, doc.size, function(line) { - if (line.height != 1 && !line.hidden) updateLineHeight(line, 1); - if (line.text.length > maxLine.length) maxLine = line.text; - }); - } - changes.push({from: 0, to: doc.size}); - } - function computeTabText() { - for (var str = '', i = 0; i < options.tabSize; ++i) str += " "; - return str + ""; - } - function tabsChanged() { - tabText = computeTabText(); - updateDisplay(true); - } - function themeChanged() { - scroller.className = scroller.className.replace(/\s*cm-s-\w+/g, "") + - options.theme.replace(/(^|\s)\s*/g, " cm-s-"); - } - - function TextMarker() { this.set = []; } - TextMarker.prototype.clear = operation(function() { - var min = Infinity, max = -Infinity; - for (var i = 0, e = this.set.length; i < e; ++i) { - var line = this.set[i], mk = line.marked; - if (!mk || !line.parent) continue; - var lineN = lineNo(line); - min = Math.min(min, lineN); max = Math.max(max, lineN); - for (var j = 0; j < mk.length; ++j) - if (mk[j].set == this.set) mk.splice(j--, 1); - } - if (min != Infinity) - changes.push({from: min, to: max + 1}); - }); - TextMarker.prototype.find = function() { - var from, to; - for (var i = 0, e = this.set.length; i < e; ++i) { - var line = this.set[i], mk = line.marked; - for (var j = 0; j < mk.length; ++j) { - var mark = mk[j]; - if (mark.set == this.set) { - if (mark.from != null || mark.to != null) { - var found = lineNo(line); - if (found != null) { - if (mark.from != null) from = {line: found, ch: mark.from}; - if (mark.to != null) to = {line: found, ch: mark.to}; - } - } - } - } - } - return {from: from, to: to}; - }; - - function markText(from, to, className) { - from = clipPos(from); to = clipPos(to); - var tm = new TextMarker(); - function add(line, from, to, className) { - getLine(line).addMark(new MarkedText(from, to, className, tm.set)); - } - if (from.line == to.line) add(from.line, from.ch, to.ch, className); - else { - add(from.line, from.ch, null, className); - for (var i = from.line + 1, e = to.line; i < e; ++i) - add(i, null, null, className); - add(to.line, null, to.ch, className); - } - changes.push({from: from.line, to: to.line + 1}); - return tm; - } - - function setBookmark(pos) { - pos = clipPos(pos); - var bm = new Bookmark(pos.ch); - getLine(pos.line).addMark(bm); - return bm; - } - - function addGutterMarker(line, text, className) { - if (typeof line == "number") line = getLine(clipLine(line)); - line.gutterMarker = {text: text, style: className}; - gutterDirty = true; - return line; - } - function removeGutterMarker(line) { - if (typeof line == "number") line = getLine(clipLine(line)); - line.gutterMarker = null; - gutterDirty = true; - } - - function changeLine(handle, op) { - var no = handle, line = handle; - if (typeof handle == "number") line = getLine(clipLine(handle)); - else no = lineNo(handle); - if (no == null) return null; - if (op(line, no)) changes.push({from: no, to: no + 1}); - else return null; - return line; - } - function setLineClass(handle, className) { - return changeLine(handle, function(line) { - if (line.className != className) { - line.className = className; - return true; - } - }); - } - function setLineHidden(handle, hidden) { - return changeLine(handle, function(line, no) { - if (line.hidden != hidden) { - line.hidden = hidden; - updateLineHeight(line, hidden ? 0 : 1); - var fline = sel.from.line, tline = sel.to.line; - if (hidden && (fline == no || tline == no)) { - var from = fline == no ? skipHidden({line: fline, ch: 0}, fline, 0) : sel.from; - var to = tline == no ? skipHidden({line: tline, ch: 0}, tline, 0) : sel.to; - setSelection(from, to); - } - return (gutterDirty = true); - } - }); - } - - function lineInfo(line) { - if (typeof line == "number") { - if (!isLine(line)) return null; - var n = line; - line = getLine(line); - if (!line) return null; - } - else { - var n = lineNo(line); - if (n == null) return null; - } - var marker = line.gutterMarker; - return {line: n, handle: line, text: line.text, markerText: marker && marker.text, - markerClass: marker && marker.style, lineClass: line.className}; - } - - function stringWidth(str) { - measure.innerHTML = "
x
"; - measure.firstChild.firstChild.firstChild.nodeValue = str; - return measure.firstChild.firstChild.offsetWidth || 10; - } - // These are used to go from pixel positions to character - // positions, taking varying character widths into account. - function charFromX(line, x) { - if (x <= 0) return 0; - var lineObj = getLine(line), text = lineObj.text; - function getX(len) { - measure.innerHTML = "
" + lineObj.getHTML(tabText, len) + "
"; - return measure.firstChild.firstChild.offsetWidth; - } - var from = 0, fromX = 0, to = text.length, toX; - // Guess a suitable upper bound for our search. - var estimated = Math.min(to, Math.ceil(x / charWidth())); - for (;;) { - var estX = getX(estimated); - if (estX <= x && estimated < to) estimated = Math.min(to, Math.ceil(estimated * 1.2)); - else {toX = estX; to = estimated; break;} - } - if (x > toX) return to; - // Try to guess a suitable lower bound as well. - estimated = Math.floor(to * 0.8); estX = getX(estimated); - if (estX < x) {from = estimated; fromX = estX;} - // Do a binary search between these bounds. - for (;;) { - if (to - from <= 1) return (toX - x > x - fromX) ? from : to; - var middle = Math.ceil((from + to) / 2), middleX = getX(middle); - if (middleX > x) {to = middle; toX = middleX;} - else {from = middle; fromX = middleX;} - } - } - - var tempId = Math.floor(Math.random() * 0xffffff).toString(16); - function measureLine(line, ch) { - if (ch == 0) return {top: 0, left: 0}; - var extra = ""; - // Include extra text at the end to make sure the measured line is wrapped in the right way. - if (options.lineWrapping) { - var end = line.text.indexOf(" ", ch + 2); - extra = htmlEscape(line.text.slice(ch + 1, end < 0 ? line.text.length : end + (ie ? 5 : 0))); - } - measure.innerHTML = "
" + line.getHTML(tabText, ch) +
-        '' + htmlEscape(line.text.charAt(ch) || " ") + "" +
-        extra + "
"; - var elt = document.getElementById("CodeMirror-temp-" + tempId); - var top = elt.offsetTop, left = elt.offsetLeft; - // Older IEs report zero offsets for spans directly after a wrap - if (ie && top == 0 && left == 0) { - var backup = document.createElement("span"); - backup.innerHTML = "x"; - elt.parentNode.insertBefore(backup, elt.nextSibling); - top = backup.offsetTop; - } - return {top: top, left: left}; - } - function localCoords(pos, inLineWrap) { - var x, lh = textHeight(), y = lh * (heightAtLine(doc, pos.line) - (inLineWrap ? displayOffset : 0)); - if (pos.ch == 0) x = 0; - else { - var sp = measureLine(getLine(pos.line), pos.ch); - x = sp.left; - if (options.lineWrapping) y += Math.max(0, sp.top); - } - return {x: x, y: y, yBot: y + lh}; - } - // Coords must be lineSpace-local - function coordsChar(x, y) { - if (y < 0) y = 0; - var th = textHeight(), cw = charWidth(), heightPos = displayOffset + Math.floor(y / th); - var lineNo = lineAtHeight(doc, heightPos); - if (lineNo >= doc.size) return {line: doc.size - 1, ch: getLine(doc.size - 1).text.length}; - var lineObj = getLine(lineNo), text = lineObj.text; - var tw = options.lineWrapping, innerOff = tw ? heightPos - heightAtLine(doc, lineNo) : 0; - if (x <= 0 && innerOff == 0) return {line: lineNo, ch: 0}; - function getX(len) { - var sp = measureLine(lineObj, len); - if (tw) { - var off = Math.round(sp.top / th); - return Math.max(0, sp.left + (off - innerOff) * scroller.clientWidth); - } - return sp.left; - } - var from = 0, fromX = 0, to = text.length, toX; - // Guess a suitable upper bound for our search. - var estimated = Math.min(to, Math.ceil((x + innerOff * scroller.clientWidth * .9) / cw)); - for (;;) { - var estX = getX(estimated); - if (estX <= x && estimated < to) estimated = Math.min(to, Math.ceil(estimated * 1.2)); - else {toX = estX; to = estimated; break;} - } - if (x > toX) return {line: lineNo, ch: to}; - // Try to guess a suitable lower bound as well. - estimated = Math.floor(to * 0.8); estX = getX(estimated); - if (estX < x) {from = estimated; fromX = estX;} - // Do a binary search between these bounds. - for (;;) { - if (to - from <= 1) return {line: lineNo, ch: (toX - x > x - fromX) ? from : to}; - var middle = Math.ceil((from + to) / 2), middleX = getX(middle); - if (middleX > x) {to = middle; toX = middleX;} - else {from = middle; fromX = middleX;} - } - } - function pageCoords(pos) { - var local = localCoords(pos, true), off = eltOffset(lineSpace); - return {x: off.left + local.x, y: off.top + local.y, yBot: off.top + local.yBot}; - } - - var cachedHeight, cachedHeightFor, measureText; - function textHeight() { - if (measureText == null) { - measureText = "
";
-        for (var i = 0; i < 49; ++i) measureText += "x
"; - measureText += "x
"; - } - var offsetHeight = lineDiv.clientHeight; - if (offsetHeight == cachedHeightFor) return cachedHeight; - cachedHeightFor = offsetHeight; - measure.innerHTML = measureText; - cachedHeight = measure.firstChild.offsetHeight / 50 || 1; - measure.innerHTML = ""; - return cachedHeight; - } - var cachedWidth, cachedWidthFor = 0; - function charWidth() { - if (scroller.clientWidth == cachedWidthFor) return cachedWidth; - cachedWidthFor = scroller.clientWidth; - return (cachedWidth = stringWidth("x")); - } - function paddingTop() {return lineSpace.offsetTop;} - function paddingLeft() {return lineSpace.offsetLeft;} - - function posFromMouse(e, liberal) { - var offW = eltOffset(scroller, true), x, y; - // Fails unpredictably on IE[67] when mouse is dragged around quickly. - try { x = e.clientX; y = e.clientY; } catch (e) { return null; } - // This is a mess of a heuristic to try and determine whether a - // scroll-bar was clicked or not, and to return null if one was - // (and !liberal). - if (!liberal && (x - offW.left > scroller.clientWidth || y - offW.top > scroller.clientHeight)) - return null; - var offL = eltOffset(lineSpace, true); - return coordsChar(x - offL.left, y - offL.top); - } - function onContextMenu(e) { - var pos = posFromMouse(e); - if (!pos || window.opera) return; // Opera is difficult. - if (posEq(sel.from, sel.to) || posLess(pos, sel.from) || !posLess(pos, sel.to)) - operation(setCursor)(pos.line, pos.ch); - - var oldCSS = input.style.cssText; - inputDiv.style.position = "absolute"; - input.style.cssText = "position: fixed; width: 30px; height: 30px; top: " + (e.clientY - 5) + - "px; left: " + (e.clientX - 5) + "px; z-index: 1000; background: white; " + - "border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);"; - leaveInputAlone = true; - var val = input.value = getSelection(); - focusInput(); - input.select(); - function rehide() { - var newVal = splitLines(input.value).join("\n"); - if (newVal != val) operation(replaceSelection)(newVal, "end"); - inputDiv.style.position = "relative"; - input.style.cssText = oldCSS; - leaveInputAlone = false; - resetInput(true); - slowPoll(); - } - - if (gecko) { - e_stop(e); - var mouseup = connect(window, "mouseup", function() { - mouseup(); - setTimeout(rehide, 20); - }, true); - } - else { - setTimeout(rehide, 50); - } - } - - // Cursor-blinking - function restartBlink() { - clearInterval(blinker); - var on = true; - cursor.style.visibility = ""; - blinker = setInterval(function() { - cursor.style.visibility = (on = !on) ? "" : "hidden"; - }, 650); - } - - var matching = {"(": ")>", ")": "(<", "[": "]>", "]": "[<", "{": "}>", "}": "{<"}; - function matchBrackets(autoclear) { - var head = sel.inverted ? sel.from : sel.to, line = getLine(head.line), pos = head.ch - 1; - var match = (pos >= 0 && matching[line.text.charAt(pos)]) || matching[line.text.charAt(++pos)]; - if (!match) return; - var ch = match.charAt(0), forward = match.charAt(1) == ">", d = forward ? 1 : -1, st = line.styles; - for (var off = pos + 1, i = 0, e = st.length; i < e; i+=2) - if ((off -= st[i].length) <= 0) {var style = st[i+1]; break;} - - var stack = [line.text.charAt(pos)], re = /[(){}[\]]/; - function scan(line, from, to) { - if (!line.text) return; - var st = line.styles, pos = forward ? 0 : line.text.length - 1, cur; - for (var i = forward ? 0 : st.length - 2, e = forward ? st.length : -2; i != e; i += 2*d) { - var text = st[i]; - if (st[i+1] != null && st[i+1] != style) {pos += d * text.length; continue;} - for (var j = forward ? 0 : text.length - 1, te = forward ? text.length : -1; j != te; j += d, pos+=d) { - if (pos >= from && pos < to && re.test(cur = text.charAt(j))) { - var match = matching[cur]; - if (match.charAt(1) == ">" == forward) stack.push(cur); - else if (stack.pop() != match.charAt(0)) return {pos: pos, match: false}; - else if (!stack.length) return {pos: pos, match: true}; - } - } - } - } - for (var i = head.line, e = forward ? Math.min(i + 100, doc.size) : Math.max(-1, i - 100); i != e; i+=d) { - var line = getLine(i), first = i == head.line; - var found = scan(line, first && forward ? pos + 1 : 0, first && !forward ? pos : line.text.length); - if (found) break; - } - if (!found) found = {pos: null, match: false}; - var style = found.match ? "CodeMirror-matchingbracket" : "CodeMirror-nonmatchingbracket"; - var one = markText({line: head.line, ch: pos}, {line: head.line, ch: pos+1}, style), - two = found.pos != null && markText({line: i, ch: found.pos}, {line: i, ch: found.pos + 1}, style); - var clear = operation(function(){one.clear(); two && two.clear();}); - if (autoclear) setTimeout(clear, 800); - else bracketHighlighted = clear; - } - - // Finds the line to start with when starting a parse. Tries to - // find a line with a stateAfter, so that it can start with a - // valid state. If that fails, it returns the line with the - // smallest indentation, which tends to need the least context to - // parse correctly. - function findStartLine(n) { - var minindent, minline; - for (var search = n, lim = n - 40; search > lim; --search) { - if (search == 0) return 0; - var line = getLine(search-1); - if (line.stateAfter) return search; - var indented = line.indentation(options.tabSize); - if (minline == null || minindent > indented) { - minline = search - 1; - minindent = indented; - } - } - return minline; - } - function getStateBefore(n) { - var start = findStartLine(n), state = start && getLine(start-1).stateAfter; - if (!state) state = startState(mode); - else state = copyState(mode, state); - doc.iter(start, n, function(line) { - line.highlight(mode, state, options.tabSize); - line.stateAfter = copyState(mode, state); - }); - if (start < n) changes.push({from: start, to: n}); - if (n < doc.size && !getLine(n).stateAfter) work.push(n); - return state; - } - function highlightLines(start, end) { - var state = getStateBefore(start); - doc.iter(start, end, function(line) { - line.highlight(mode, state, options.tabSize); - line.stateAfter = copyState(mode, state); - }); - } - function highlightWorker() { - var end = +new Date + options.workTime; - var foundWork = work.length; - while (work.length) { - if (!getLine(showingFrom).stateAfter) var task = showingFrom; - else var task = work.pop(); - if (task >= doc.size) continue; - var start = findStartLine(task), state = start && getLine(start-1).stateAfter; - if (state) state = copyState(mode, state); - else state = startState(mode); - - var unchanged = 0, compare = mode.compareStates, realChange = false, - i = start, bail = false; - doc.iter(i, doc.size, function(line) { - var hadState = line.stateAfter; - if (+new Date > end) { - work.push(i); - startWorker(options.workDelay); - if (realChange) changes.push({from: task, to: i + 1}); - return (bail = true); - } - var changed = line.highlight(mode, state, options.tabSize); - if (changed) realChange = true; - line.stateAfter = copyState(mode, state); - if (compare) { - if (hadState && compare(hadState, state)) return true; - } else { - if (changed !== false || !hadState) unchanged = 0; - else if (++unchanged > 3 && (!mode.indent || mode.indent(hadState, "") == mode.indent(state, ""))) - return true; - } - ++i; - }); - if (bail) return; - if (realChange) changes.push({from: task, to: i + 1}); - } - if (foundWork && options.onHighlightComplete) - options.onHighlightComplete(instance); - } - function startWorker(time) { - if (!work.length) return; - highlight.set(time, operation(highlightWorker)); - } - - // Operations are used to wrap changes in such a way that each - // change won't have to update the cursor and display (which would - // be awkward, slow, and error-prone), but instead updates are - // batched and then all combined and executed at once. - function startOperation() { - updateInput = userSelChange = textChanged = null; - changes = []; selectionChanged = false; callbacks = []; - } - function endOperation() { - var reScroll = false, updated; - if (selectionChanged) reScroll = !scrollCursorIntoView(); - if (changes.length) updated = updateDisplay(changes, true); - else { - if (selectionChanged) updateSelection(); - if (gutterDirty) updateGutter(); - } - if (reScroll) scrollCursorIntoView(); - if (selectionChanged) {scrollEditorIntoView(); restartBlink();} - - if (focused && !leaveInputAlone && - (updateInput === true || (updateInput !== false && selectionChanged))) - resetInput(userSelChange); - - if (selectionChanged && options.matchBrackets) - setTimeout(operation(function() { - if (bracketHighlighted) {bracketHighlighted(); bracketHighlighted = null;} - if (posEq(sel.from, sel.to)) matchBrackets(false); - }), 20); - var tc = textChanged, cbs = callbacks; // these can be reset by callbacks - if (selectionChanged && options.onCursorActivity) - options.onCursorActivity(instance); - if (tc && options.onChange && instance) - options.onChange(instance, tc); - for (var i = 0; i < cbs.length; ++i) cbs[i](instance); - if (updated && options.onUpdate) options.onUpdate(instance); - } - var nestedOperation = 0; - function operation(f) { - return function() { - if (!nestedOperation++) startOperation(); - try {var result = f.apply(this, arguments);} - finally {if (!--nestedOperation) endOperation();} - return result; - }; - } - - for (var ext in extensions) - if (extensions.propertyIsEnumerable(ext) && - !instance.propertyIsEnumerable(ext)) - instance[ext] = extensions[ext]; - return instance; - } // (end of function CodeMirror) - - // The default configuration options. - CodeMirror.defaults = { - value: "", - mode: null, - theme: "default", - indentUnit: 2, - indentWithTabs: false, - smartIndent: true, - tabSize: 4, - keyMap: "default", - extraKeys: null, - electricChars: true, - onKeyEvent: null, - lineWrapping: false, - lineNumbers: false, - gutter: false, - fixedGutter: false, - firstLineNumber: 1, - readOnly: false, - onChange: null, - onCursorActivity: null, - onGutterClick: null, - onHighlightComplete: null, - onUpdate: null, - onFocus: null, onBlur: null, onScroll: null, - matchBrackets: false, - workTime: 100, - workDelay: 200, - pollInterval: 100, - undoDepth: 40, - tabindex: null, - document: window.document - }; - - var ios = /AppleWebKit/.test(navigator.userAgent) && /Mobile\/\w+/.test(navigator.userAgent); - var mac = ios || /Mac/.test(navigator.platform); - var win = /Win/.test(navigator.platform); - - // Known modes, by name and by MIME - var modes = {}, mimeModes = {}; - CodeMirror.defineMode = function(name, mode) { - if (!CodeMirror.defaults.mode && name != "null") CodeMirror.defaults.mode = name; - modes[name] = mode; - }; - CodeMirror.defineMIME = function(mime, spec) { - mimeModes[mime] = spec; - }; - CodeMirror.getMode = function(options, spec) { - if (typeof spec == "string" && mimeModes.hasOwnProperty(spec)) - spec = mimeModes[spec]; - if (typeof spec == "string") - var mname = spec, config = {}; - else if (spec != null) - var mname = spec.name, config = spec; - var mfactory = modes[mname]; - if (!mfactory) { - if (window.console) console.warn("No mode " + mname + " found, falling back to plain text."); - return CodeMirror.getMode(options, "text/plain"); - } - return mfactory(options, config || {}); - }; - CodeMirror.listModes = function() { - var list = []; - for (var m in modes) - if (modes.propertyIsEnumerable(m)) list.push(m); - return list; - }; - CodeMirror.listMIMEs = function() { - var list = []; - for (var m in mimeModes) - if (mimeModes.propertyIsEnumerable(m)) list.push({mime: m, mode: mimeModes[m]}); - return list; - }; - - var extensions = CodeMirror.extensions = {}; - CodeMirror.defineExtension = function(name, func) { - extensions[name] = func; - }; - - var commands = CodeMirror.commands = { - selectAll: function(cm) {cm.setSelection({line: 0, ch: 0}, {line: cm.lineCount() - 1});}, - killLine: function(cm) { - var from = cm.getCursor(true), to = cm.getCursor(false), sel = !posEq(from, to); - if (!sel && cm.getLine(from.line).length == from.ch) cm.replaceRange("", from, {line: from.line + 1, ch: 0}); - else cm.replaceRange("", from, sel ? to : {line: from.line}); - }, - deleteLine: function(cm) {var l = cm.getCursor().line; cm.replaceRange("", {line: l, ch: 0}, {line: l});}, - undo: function(cm) {cm.undo();}, - redo: function(cm) {cm.redo();}, - goDocStart: function(cm) {cm.setCursor(0, 0, true);}, - goDocEnd: function(cm) {cm.setSelection({line: cm.lineCount() - 1}, null, true);}, - goLineStart: function(cm) {cm.setCursor(cm.getCursor().line, 0, true);}, - goLineStartSmart: function(cm) { - var cur = cm.getCursor(); - var text = cm.getLine(cur.line), firstNonWS = Math.max(0, text.search(/\S/)); - cm.setCursor(cur.line, cur.ch <= firstNonWS && cur.ch ? 0 : firstNonWS, true); - }, - goLineEnd: function(cm) {cm.setSelection({line: cm.getCursor().line}, null, true);}, - goLineUp: function(cm) {cm.moveV(-1, "line");}, - goLineDown: function(cm) {cm.moveV(1, "line");}, - goPageUp: function(cm) {cm.moveV(-1, "page");}, - goPageDown: function(cm) {cm.moveV(1, "page");}, - goCharLeft: function(cm) {cm.moveH(-1, "char");}, - goCharRight: function(cm) {cm.moveH(1, "char");}, - goColumnLeft: function(cm) {cm.moveH(-1, "column");}, - goColumnRight: function(cm) {cm.moveH(1, "column");}, - goWordLeft: function(cm) {cm.moveH(-1, "word");}, - goWordRight: function(cm) {cm.moveH(1, "word");}, - delCharLeft: function(cm) {cm.deleteH(-1, "char");}, - delCharRight: function(cm) {cm.deleteH(1, "char");}, - delWordLeft: function(cm) {cm.deleteH(-1, "word");}, - delWordRight: function(cm) {cm.deleteH(1, "word");}, - indentAuto: function(cm) {cm.indentSelection("smart");}, - indentMore: function(cm) {cm.indentSelection("add");}, - indentLess: function(cm) {cm.indentSelection("subtract");}, - insertTab: function(cm) {cm.replaceSelection("\t", "end");}, - transposeChars: function(cm) { - var cur = cm.getCursor(), line = cm.getLine(cur.line); - if (cur.ch > 0 && cur.ch < line.length - 1) - cm.replaceRange(line.charAt(cur.ch) + line.charAt(cur.ch - 1), - {line: cur.line, ch: cur.ch - 1}, {line: cur.line, ch: cur.ch + 1}); - }, - newlineAndIndent: function(cm) { - cm.replaceSelection("\n", "end"); - cm.indentLine(cm.getCursor().line); - }, - toggleOverwrite: function(cm) {cm.toggleOverwrite();} - }; - - var keyMap = CodeMirror.keyMap = {}; - keyMap.basic = { - "Left": "goCharLeft", "Right": "goCharRight", "Up": "goLineUp", "Down": "goLineDown", - "End": "goLineEnd", "Home": "goLineStartSmart", "PageUp": "goPageUp", "PageDown": "goPageDown", - "Delete": "delCharRight", "Backspace": "delCharLeft", "Tab": "indentMore", "Shift-Tab": "indentLess", - "Enter": "newlineAndIndent", "Insert": "toggleOverwrite" - }; - // Note that the save and find-related commands aren't defined by - // default. Unknown commands are simply ignored. - keyMap.pcDefault = { - "Ctrl-A": "selectAll", "Ctrl-D": "deleteLine", "Ctrl-Z": "undo", "Shift-Ctrl-Z": "redo", "Ctrl-Y": "redo", - "Ctrl-Home": "goDocStart", "Alt-Up": "goDocStart", "Ctrl-End": "goDocEnd", "Ctrl-Down": "goDocEnd", - "Ctrl-Left": "goWordLeft", "Ctrl-Right": "goWordRight", "Alt-Left": "goLineStart", "Alt-Right": "goLineEnd", - "Ctrl-Backspace": "delWordLeft", "Ctrl-Delete": "delWordRight", "Ctrl-S": "save", "Ctrl-F": "find", - "Ctrl-G": "findNext", "Shift-Ctrl-G": "findPrev", "Shift-Ctrl-F": "replace", "Shift-Ctrl-R": "replaceAll", - fallthrough: "basic" - }; - keyMap.macDefault = { - "Cmd-A": "selectAll", "Cmd-D": "deleteLine", "Cmd-Z": "undo", "Shift-Cmd-Z": "redo", "Cmd-Y": "redo", - "Cmd-Up": "goDocStart", "Cmd-End": "goDocEnd", "Cmd-Down": "goDocEnd", "Alt-Left": "goWordLeft", - "Alt-Right": "goWordRight", "Cmd-Left": "goLineStart", "Cmd-Right": "goLineEnd", "Alt-Backspace": "delWordLeft", - "Ctrl-Alt-Backspace": "delWordRight", "Alt-Delete": "delWordRight", "Cmd-S": "save", "Cmd-F": "find", - "Cmd-G": "findNext", "Shift-Cmd-G": "findPrev", "Cmd-Alt-F": "replace", "Shift-Cmd-Alt-F": "replaceAll", - fallthrough: ["basic", "emacsy"] - }; - keyMap["default"] = mac ? keyMap.macDefault : keyMap.pcDefault; - keyMap.emacsy = { - "Ctrl-F": "goCharRight", "Ctrl-B": "goCharLeft", "Ctrl-P": "goLineUp", "Ctrl-N": "goLineDown", - "Alt-F": "goWordRight", "Alt-B": "goWordLeft", "Ctrl-A": "goLineStart", "Ctrl-E": "goLineEnd", - "Ctrl-V": "goPageUp", "Shift-Ctrl-V": "goPageDown", "Ctrl-D": "delCharRight", "Ctrl-H": "delCharLeft", - "Alt-D": "delWordRight", "Alt-Backspace": "delWordLeft", "Ctrl-K": "killLine", "Ctrl-T": "transposeChars" - }; - - function lookupKey(name, extraMap, map) { - function lookup(name, map, ft) { - var found = map[name]; - if (found != null) return found; - if (ft == null) ft = map.fallthrough; - if (ft == null) return map.catchall; - if (typeof ft == "string") return lookup(name, keyMap[ft]); - for (var i = 0, e = ft.length; i < e; ++i) { - found = lookup(name, keyMap[ft[i]]); - if (found != null) return found; - } - return null; - } - return extraMap ? lookup(name, extraMap, map) : lookup(name, keyMap[map]); - } - function isModifierKey(event) { - var name = keyNames[e_prop(event, "keyCode")]; - return name == "Ctrl" || name == "Alt" || name == "Shift" || name == "Mod"; - } - - CodeMirror.fromTextArea = function(textarea, options) { - if (!options) options = {}; - options.value = textarea.value; - if (!options.tabindex && textarea.tabindex) - options.tabindex = textarea.tabindex; - - function save() {textarea.value = instance.getValue();} - if (textarea.form) { - // Deplorable hack to make the submit method do the right thing. - var rmSubmit = connect(textarea.form, "submit", save, true); - if (typeof textarea.form.submit == "function") { - var realSubmit = textarea.form.submit; - function wrappedSubmit() { - save(); - textarea.form.submit = realSubmit; - textarea.form.submit(); - textarea.form.submit = wrappedSubmit; - } - textarea.form.submit = wrappedSubmit; - } - } - - textarea.style.display = "none"; - var instance = CodeMirror(function(node) { - textarea.parentNode.insertBefore(node, textarea.nextSibling); - }, options); - instance.save = save; - instance.getTextArea = function() { return textarea; }; - instance.toTextArea = function() { - save(); - textarea.parentNode.removeChild(instance.getWrapperElement()); - textarea.style.display = ""; - if (textarea.form) { - rmSubmit(); - if (typeof textarea.form.submit == "function") - textarea.form.submit = realSubmit; - } - }; - return instance; - }; - - // Utility functions for working with state. Exported because modes - // sometimes need to do this. - function copyState(mode, state) { - if (state === true) return state; - if (mode.copyState) return mode.copyState(state); - var nstate = {}; - for (var n in state) { - var val = state[n]; - if (val instanceof Array) val = val.concat([]); - nstate[n] = val; - } - return nstate; - } - CodeMirror.copyState = copyState; - function startState(mode, a1, a2) { - return mode.startState ? mode.startState(a1, a2) : true; - } - CodeMirror.startState = startState; - - // The character stream used by a mode's parser. - function StringStream(string, tabSize) { - this.pos = this.start = 0; - this.string = string; - this.tabSize = tabSize || 8; - } - StringStream.prototype = { - eol: function() {return this.pos >= this.string.length;}, - sol: function() {return this.pos == 0;}, - peek: function() {return this.string.charAt(this.pos);}, - next: function() { - if (this.pos < this.string.length) - return this.string.charAt(this.pos++); - }, - eat: function(match) { - var ch = this.string.charAt(this.pos); - if (typeof match == "string") var ok = ch == match; - else var ok = ch && (match.test ? match.test(ch) : match(ch)); - if (ok) {++this.pos; return ch;} - }, - eatWhile: function(match) { - var start = this.pos; - while (this.eat(match)){} - return this.pos > start; - }, - eatSpace: function() { - var start = this.pos; - while (/[\s\u00a0]/.test(this.string.charAt(this.pos))) ++this.pos; - return this.pos > start; - }, - skipToEnd: function() {this.pos = this.string.length;}, - skipTo: function(ch) { - var found = this.string.indexOf(ch, this.pos); - if (found > -1) {this.pos = found; return true;} - }, - backUp: function(n) {this.pos -= n;}, - column: function() {return countColumn(this.string, this.start, this.tabSize);}, - indentation: function() {return countColumn(this.string, null, this.tabSize);}, - match: function(pattern, consume, caseInsensitive) { - if (typeof pattern == "string") { - function cased(str) {return caseInsensitive ? str.toLowerCase() : str;} - if (cased(this.string).indexOf(cased(pattern), this.pos) == this.pos) { - if (consume !== false) this.pos += pattern.length; - return true; - } - } - else { - var match = this.string.slice(this.pos).match(pattern); - if (match && consume !== false) this.pos += match[0].length; - return match; - } - }, - current: function(){return this.string.slice(this.start, this.pos);} - }; - CodeMirror.StringStream = StringStream; - - function MarkedText(from, to, className, set) { - this.from = from; this.to = to; this.style = className; this.set = set; - } - MarkedText.prototype = { - attach: function(line) { this.set.push(line); }, - detach: function(line) { - var ix = indexOf(this.set, line); - if (ix > -1) this.set.splice(ix, 1); - }, - split: function(pos, lenBefore) { - if (this.to <= pos && this.to != null) return null; - var from = this.from < pos || this.from == null ? null : this.from - pos + lenBefore; - var to = this.to == null ? null : this.to - pos + lenBefore; - return new MarkedText(from, to, this.style, this.set); - }, - dup: function() { return new MarkedText(null, null, this.style, this.set); }, - clipTo: function(fromOpen, from, toOpen, to, diff) { - if (this.from != null && this.from >= from) - this.from = Math.max(to, this.from) + diff; - if (this.to != null && this.to > from) - this.to = to < this.to ? this.to + diff : from; - if (fromOpen && to > this.from && (to < this.to || this.to == null)) - this.from = null; - if (toOpen && (from < this.to || this.to == null) && (from > this.from || this.from == null)) - this.to = null; - }, - isDead: function() { return this.from != null && this.to != null && this.from >= this.to; }, - sameSet: function(x) { return this.set == x.set; } - }; - - function Bookmark(pos) { - this.from = pos; this.to = pos; this.line = null; - } - Bookmark.prototype = { - attach: function(line) { this.line = line; }, - detach: function(line) { if (this.line == line) this.line = null; }, - split: function(pos, lenBefore) { - if (pos < this.from) { - this.from = this.to = (this.from - pos) + lenBefore; - return this; - } - }, - isDead: function() { return this.from > this.to; }, - clipTo: function(fromOpen, from, toOpen, to, diff) { - if ((fromOpen || from < this.from) && (toOpen || to > this.to)) { - this.from = 0; this.to = -1; - } else if (this.from > from) { - this.from = this.to = Math.max(to, this.from) + diff; - } - }, - sameSet: function(x) { return false; }, - find: function() { - if (!this.line || !this.line.parent) return null; - return {line: lineNo(this.line), ch: this.from}; - }, - clear: function() { - if (this.line) { - var found = indexOf(this.line.marked, this); - if (found != -1) this.line.marked.splice(found, 1); - this.line = null; - } - } - }; - - // Line objects. These hold state related to a line, including - // highlighting info (the styles array). - function Line(text, styles) { - this.styles = styles || [text, null]; - this.text = text; - this.height = 1; - this.marked = this.gutterMarker = this.className = this.handlers = null; - this.stateAfter = this.parent = this.hidden = null; - } - Line.inheritMarks = function(text, orig) { - var ln = new Line(text), mk = orig && orig.marked; - if (mk) { - for (var i = 0; i < mk.length; ++i) { - if (mk[i].to == null && mk[i].style) { - var newmk = ln.marked || (ln.marked = []), mark = mk[i]; - var nmark = mark.dup(); newmk.push(nmark); nmark.attach(ln); - } - } - } - return ln; - } - Line.prototype = { - // Replace a piece of a line, keeping the styles around it intact. - replace: function(from, to_, text) { - var st = [], mk = this.marked, to = to_ == null ? this.text.length : to_; - copyStyles(0, from, this.styles, st); - if (text) st.push(text, null); - copyStyles(to, this.text.length, this.styles, st); - this.styles = st; - this.text = this.text.slice(0, from) + text + this.text.slice(to); - this.stateAfter = null; - if (mk) { - var diff = text.length - (to - from); - for (var i = 0; i < mk.length; ++i) { - var mark = mk[i]; - mark.clipTo(from == null, from || 0, to_ == null, to, diff); - if (mark.isDead()) {mark.detach(this); mk.splice(i--, 1);} - } - } - }, - // Split a part off a line, keeping styles and markers intact. - split: function(pos, textBefore) { - var st = [textBefore, null], mk = this.marked; - copyStyles(pos, this.text.length, this.styles, st); - var taken = new Line(textBefore + this.text.slice(pos), st); - if (mk) { - for (var i = 0; i < mk.length; ++i) { - var mark = mk[i]; - var newmark = mark.split(pos, textBefore.length); - if (newmark) { - if (!taken.marked) taken.marked = []; - taken.marked.push(newmark); newmark.attach(taken); - } - } - } - return taken; - }, - append: function(line) { - var mylen = this.text.length, mk = line.marked, mymk = this.marked; - this.text += line.text; - copyStyles(0, line.text.length, line.styles, this.styles); - if (mymk) { - for (var i = 0; i < mymk.length; ++i) - if (mymk[i].to == null) mymk[i].to = mylen; - } - if (mk && mk.length) { - if (!mymk) this.marked = mymk = []; - outer: for (var i = 0; i < mk.length; ++i) { - var mark = mk[i]; - if (!mark.from) { - for (var j = 0; j < mymk.length; ++j) { - var mymark = mymk[j]; - if (mymark.to == mylen && mymark.sameSet(mark)) { - mymark.to = mark.to == null ? null : mark.to + mylen; - if (mymark.isDead()) { - mymark.detach(this); - mk.splice(i--, 1); - } - continue outer; - } - } - } - mymk.push(mark); - mark.attach(this); - mark.from += mylen; - if (mark.to != null) mark.to += mylen; - } - } - }, - fixMarkEnds: function(other) { - var mk = this.marked, omk = other.marked; - if (!mk) return; - for (var i = 0; i < mk.length; ++i) { - var mark = mk[i], close = mark.to == null; - if (close && omk) { - for (var j = 0; j < omk.length; ++j) - if (omk[j].sameSet(mark)) {close = false; break;} - } - if (close) mark.to = this.text.length; - } - }, - fixMarkStarts: function() { - var mk = this.marked; - if (!mk) return; - for (var i = 0; i < mk.length; ++i) - if (mk[i].from == null) mk[i].from = 0; - }, - addMark: function(mark) { - mark.attach(this); - if (this.marked == null) this.marked = []; - this.marked.push(mark); - this.marked.sort(function(a, b){return (a.from || 0) - (b.from || 0);}); - }, - // Run the given mode's parser over a line, update the styles - // array, which contains alternating fragments of text and CSS - // classes. - highlight: function(mode, state, tabSize) { - var stream = new StringStream(this.text, tabSize), st = this.styles, pos = 0; - var changed = false, curWord = st[0], prevWord; - if (this.text == "" && mode.blankLine) mode.blankLine(state); - while (!stream.eol()) { - var style = mode.token(stream, state); - var substr = this.text.slice(stream.start, stream.pos); - stream.start = stream.pos; - if (pos && st[pos-1] == style) - st[pos-2] += substr; - else if (substr) { - if (!changed && (st[pos+1] != style || (pos && st[pos-2] != prevWord))) changed = true; - st[pos++] = substr; st[pos++] = style; - prevWord = curWord; curWord = st[pos]; - } - // Give up when line is ridiculously long - if (stream.pos > 5000) { - st[pos++] = this.text.slice(stream.pos); st[pos++] = null; - break; - } - } - if (st.length != pos) {st.length = pos; changed = true;} - if (pos && st[pos-2] != prevWord) changed = true; - // Short lines with simple highlights return null, and are - // counted as changed by the driver because they are likely to - // highlight the same way in various contexts. - return changed || (st.length < 5 && this.text.length < 10 ? null : false); - }, - // Fetch the parser token for a given character. Useful for hacks - // that want to inspect the mode state (say, for completion). - getTokenAt: function(mode, state, ch) { - var txt = this.text, stream = new StringStream(txt); - while (stream.pos < ch && !stream.eol()) { - stream.start = stream.pos; - var style = mode.token(stream, state); - } - return {start: stream.start, - end: stream.pos, - string: stream.current(), - className: style || null, - state: state}; - }, - indentation: function(tabSize) {return countColumn(this.text, null, tabSize);}, - // Produces an HTML fragment for the line, taking selection, - // marking, and highlighting into account. - getHTML: function(tabText, endAt) { - var html = [], first = true; - function span(text, style) { - if (!text) return; - // Work around a bug where, in some compat modes, IE ignores leading spaces - if (first && ie && text.charAt(0) == " ") text = "\u00a0" + text.slice(1); - first = false; - if (style) html.push('', htmlEscape(text).replace(/\t/g, tabText), ""); - else html.push(htmlEscape(text).replace(/\t/g, tabText)); - } - var st = this.styles, allText = this.text, marked = this.marked; - var len = allText.length; - if (endAt != null) len = Math.min(endAt, len); - function styleToClass(style) { - if (!style) return null; - return "cm-" + style.replace(/ +/g, " cm-"); - } - - if (!allText && endAt == null) - span(" "); - else if (!marked || !marked.length) - for (var i = 0, ch = 0; ch < len; i+=2) { - var str = st[i], style = st[i+1], l = str.length; - if (ch + l > len) str = str.slice(0, len - ch); - ch += l; - span(str, styleToClass(style)); - } - else { - var pos = 0, i = 0, text = "", style, sg = 0; - var nextChange = marked[0].from || 0, marks = [], markpos = 0; - function advanceMarks() { - var m; - while (markpos < marked.length && - ((m = marked[markpos]).from == pos || m.from == null)) { - if (m.style != null) marks.push(m); - ++markpos; - } - nextChange = markpos < marked.length ? marked[markpos].from : Infinity; - for (var i = 0; i < marks.length; ++i) { - var to = marks[i].to || Infinity; - if (to == pos) marks.splice(i--, 1); - else nextChange = Math.min(to, nextChange); - } - } - var m = 0; - while (pos < len) { - if (nextChange == pos) advanceMarks(); - var upto = Math.min(len, nextChange); - while (true) { - if (text) { - var end = pos + text.length; - var appliedStyle = style; - for (var j = 0; j < marks.length; ++j) - appliedStyle = (appliedStyle ? appliedStyle + " " : "") + marks[j].style; - span(end > upto ? text.slice(0, upto - pos) : text, appliedStyle); - if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;} - pos = end; - } - text = st[i++]; style = styleToClass(st[i++]); - } - } - } - return html.join(""); - }, - cleanUp: function() { - this.parent = null; - if (this.marked) - for (var i = 0, e = this.marked.length; i < e; ++i) this.marked[i].detach(this); - } - }; - // Utility used by replace and split above - function copyStyles(from, to, source, dest) { - for (var i = 0, pos = 0, state = 0; pos < to; i+=2) { - var part = source[i], end = pos + part.length; - if (state == 0) { - if (end > from) dest.push(part.slice(from - pos, Math.min(part.length, to - pos)), source[i+1]); - if (end >= from) state = 1; - } - else if (state == 1) { - if (end > to) dest.push(part.slice(0, to - pos), source[i+1]); - else dest.push(part, source[i+1]); - } - pos = end; - } - } - - // Data structure that holds the sequence of lines. - function LeafChunk(lines) { - this.lines = lines; - this.parent = null; - for (var i = 0, e = lines.length, height = 0; i < e; ++i) { - lines[i].parent = this; - height += lines[i].height; - } - this.height = height; - } - LeafChunk.prototype = { - chunkSize: function() { return this.lines.length; }, - remove: function(at, n, callbacks) { - for (var i = at, e = at + n; i < e; ++i) { - var line = this.lines[i]; - this.height -= line.height; - line.cleanUp(); - if (line.handlers) - for (var j = 0; j < line.handlers.length; ++j) callbacks.push(line.handlers[j]); - } - this.lines.splice(at, n); - }, - collapse: function(lines) { - lines.splice.apply(lines, [lines.length, 0].concat(this.lines)); - }, - insertHeight: function(at, lines, height) { - this.height += height; - this.lines.splice.apply(this.lines, [at, 0].concat(lines)); - for (var i = 0, e = lines.length; i < e; ++i) lines[i].parent = this; - }, - iterN: function(at, n, op) { - for (var e = at + n; at < e; ++at) - if (op(this.lines[at])) return true; - } - }; - function BranchChunk(children) { - this.children = children; - var size = 0, height = 0; - for (var i = 0, e = children.length; i < e; ++i) { - var ch = children[i]; - size += ch.chunkSize(); height += ch.height; - ch.parent = this; - } - this.size = size; - this.height = height; - this.parent = null; - } - BranchChunk.prototype = { - chunkSize: function() { return this.size; }, - remove: function(at, n, callbacks) { - this.size -= n; - for (var i = 0; i < this.children.length; ++i) { - var child = this.children[i], sz = child.chunkSize(); - if (at < sz) { - var rm = Math.min(n, sz - at), oldHeight = child.height; - child.remove(at, rm, callbacks); - this.height -= oldHeight - child.height; - if (sz == rm) { this.children.splice(i--, 1); child.parent = null; } - if ((n -= rm) == 0) break; - at = 0; - } else at -= sz; - } - if (this.size - n < 25) { - var lines = []; - this.collapse(lines); - this.children = [new LeafChunk(lines)]; - this.children[0].parent = this; - } - }, - collapse: function(lines) { - for (var i = 0, e = this.children.length; i < e; ++i) this.children[i].collapse(lines); - }, - insert: function(at, lines) { - var height = 0; - for (var i = 0, e = lines.length; i < e; ++i) height += lines[i].height; - this.insertHeight(at, lines, height); - }, - insertHeight: function(at, lines, height) { - this.size += lines.length; - this.height += height; - for (var i = 0, e = this.children.length; i < e; ++i) { - var child = this.children[i], sz = child.chunkSize(); - if (at <= sz) { - child.insertHeight(at, lines, height); - if (child.lines && child.lines.length > 50) { - while (child.lines.length > 50) { - var spilled = child.lines.splice(child.lines.length - 25, 25); - var newleaf = new LeafChunk(spilled); - child.height -= newleaf.height; - this.children.splice(i + 1, 0, newleaf); - newleaf.parent = this; - } - this.maybeSpill(); - } - break; - } - at -= sz; - } - }, - maybeSpill: function() { - if (this.children.length <= 10) return; - var me = this; - do { - var spilled = me.children.splice(me.children.length - 5, 5); - var sibling = new BranchChunk(spilled); - if (!me.parent) { // Become the parent node - var copy = new BranchChunk(me.children); - copy.parent = me; - me.children = [copy, sibling]; - me = copy; - } else { - me.size -= sibling.size; - me.height -= sibling.height; - var myIndex = indexOf(me.parent.children, me); - me.parent.children.splice(myIndex + 1, 0, sibling); - } - sibling.parent = me.parent; - } while (me.children.length > 10); - me.parent.maybeSpill(); - }, - iter: function(from, to, op) { this.iterN(from, to - from, op); }, - iterN: function(at, n, op) { - for (var i = 0, e = this.children.length; i < e; ++i) { - var child = this.children[i], sz = child.chunkSize(); - if (at < sz) { - var used = Math.min(n, sz - at); - if (child.iterN(at, used, op)) return true; - if ((n -= used) == 0) break; - at = 0; - } else at -= sz; - } - } - }; - - function getLineAt(chunk, n) { - while (!chunk.lines) { - for (var i = 0;; ++i) { - var child = chunk.children[i], sz = child.chunkSize(); - if (n < sz) { chunk = child; break; } - n -= sz; - } - } - return chunk.lines[n]; - } - function lineNo(line) { - if (line.parent == null) return null; - var cur = line.parent, no = indexOf(cur.lines, line); - for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) { - for (var i = 0, e = chunk.children.length; ; ++i) { - if (chunk.children[i] == cur) break; - no += chunk.children[i].chunkSize(); - } - } - return no; - } - function lineAtHeight(chunk, h) { - var n = 0; - outer: do { - for (var i = 0, e = chunk.children.length; i < e; ++i) { - var child = chunk.children[i], ch = child.height; - if (h < ch) { chunk = child; continue outer; } - h -= ch; - n += child.chunkSize(); - } - return n; - } while (!chunk.lines); - for (var i = 0, e = chunk.lines.length; i < e; ++i) { - var line = chunk.lines[i], lh = line.height; - if (h < lh) break; - h -= lh; - } - return n + i; - } - function heightAtLine(chunk, n) { - var h = 0; - outer: do { - for (var i = 0, e = chunk.children.length; i < e; ++i) { - var child = chunk.children[i], sz = child.chunkSize(); - if (n < sz) { chunk = child; continue outer; } - n -= sz; - h += child.height; - } - return h; - } while (!chunk.lines); - for (var i = 0; i < n; ++i) h += chunk.lines[i].height; - return h; - } - - // The history object 'chunks' changes that are made close together - // and at almost the same time into bigger undoable units. - function History() { - this.time = 0; - this.done = []; this.undone = []; - } - History.prototype = { - addChange: function(start, added, old) { - this.undone.length = 0; - var time = +new Date, cur = this.done[this.done.length - 1], last = cur && cur[cur.length - 1]; - var dtime = time - this.time; - if (dtime > 400 || !last) { - this.done.push([{start: start, added: added, old: old}]); - } else if (last.start > start + added || last.start + last.added < start - last.added + last.old.length) { - cur.push({start: start, added: added, old: old}); - } else { - var oldoff = 0; - if (start < last.start) { - for (var i = last.start - start - 1; i >= 0; --i) - last.old.unshift(old[i]); - last.added += last.start - start; - last.start = start; - } - else if (last.start < start) { - oldoff = start - last.start; - added += oldoff; - } - for (var i = last.added - oldoff, e = old.length; i < e; ++i) - last.old.push(old[i]); - if (last.added < added) last.added = added; - } - this.time = time; - } - }; - - function stopMethod() {e_stop(this);} - // Ensure an event has a stop method. - function addStop(event) { - if (!event.stop) event.stop = stopMethod; - return event; - } - - function e_preventDefault(e) { - if (e.preventDefault) e.preventDefault(); - else e.returnValue = false; - } - function e_stopPropagation(e) { - if (e.stopPropagation) e.stopPropagation(); - else e.cancelBubble = true; - } - function e_stop(e) {e_preventDefault(e); e_stopPropagation(e);} - CodeMirror.e_stop = e_stop; - CodeMirror.e_preventDefault = e_preventDefault; - CodeMirror.e_stopPropagation = e_stopPropagation; - - function e_target(e) {return e.target || e.srcElement;} - function e_button(e) { - if (e.which) return e.which; - else if (e.button & 1) return 1; - else if (e.button & 2) return 3; - else if (e.button & 4) return 2; - } - - // Allow 3rd-party code to override event properties by adding an override - // object to an event object. - function e_prop(e, prop) { - var overridden = e.override && e.override.hasOwnProperty(prop); - return overridden ? e.override[prop] : e[prop]; - } - - // Event handler registration. If disconnect is true, it'll return a - // function that unregisters the handler. - function connect(node, type, handler, disconnect) { - if (typeof node.addEventListener == "function") { - node.addEventListener(type, handler, false); - if (disconnect) return function() {node.removeEventListener(type, handler, false);}; - } - else { - var wrapHandler = function(event) {handler(event || window.event);}; - node.attachEvent("on" + type, wrapHandler); - if (disconnect) return function() {node.detachEvent("on" + type, wrapHandler);}; - } - } - CodeMirror.connect = connect; - - function Delayed() {this.id = null;} - Delayed.prototype = {set: function(ms, f) {clearTimeout(this.id); this.id = setTimeout(f, ms);}}; - - // Detect drag-and-drop - var dragAndDrop = function() { - // IE8 has ondragstart and ondrop properties, but doesn't seem to - // actually support ondragstart the way it's supposed to work. - if (/MSIE [1-8]\b/.test(navigator.userAgent)) return false; - var div = document.createElement('div'); - return "draggable" in div; - }(); - - var gecko = /gecko\/\d{7}/i.test(navigator.userAgent); - var ie = /MSIE \d/.test(navigator.userAgent); - var webkit = /WebKit\//.test(navigator.userAgent); - - var lineSep = "\n"; - // Feature-detect whether newlines in textareas are converted to \r\n - (function () { - var te = document.createElement("textarea"); - te.value = "foo\nbar"; - if (te.value.indexOf("\r") > -1) lineSep = "\r\n"; - }()); - - // Counts the column offset in a string, taking tabs into account. - // Used mostly to find indentation. - function countColumn(string, end, tabSize) { - if (end == null) { - end = string.search(/[^\s\u00a0]/); - if (end == -1) end = string.length; - } - for (var i = 0, n = 0; i < end; ++i) { - if (string.charAt(i) == "\t") n += tabSize - (n % tabSize); - else ++n; - } - return n; - } - - function computedStyle(elt) { - if (elt.currentStyle) return elt.currentStyle; - return window.getComputedStyle(elt, null); - } - - // Find the position of an element by following the offsetParent chain. - // If screen==true, it returns screen (rather than page) coordinates. - function eltOffset(node, screen) { - var bod = node.ownerDocument.body; - var x = 0, y = 0, skipBody = false; - for (var n = node; n; n = n.offsetParent) { - var ol = n.offsetLeft, ot = n.offsetTop; - // Firefox reports weird inverted offsets when the body has a border. - if (n == bod) { x += Math.abs(ol); y += Math.abs(ot); } - else { x += ol, y += ot; } - if (screen && computedStyle(n).position == "fixed") - skipBody = true; - } - var e = screen && !skipBody ? null : bod; - for (var n = node.parentNode; n != e; n = n.parentNode) - if (n.scrollLeft != null) { x -= n.scrollLeft; y -= n.scrollTop;} - return {left: x, top: y}; - } - // Use the faster and saner getBoundingClientRect method when possible. - if (document.documentElement.getBoundingClientRect != null) eltOffset = function(node, screen) { - // Take the parts of bounding client rect that we are interested in so we are able to edit if need be, - // since the returned value cannot be changed externally (they are kept in sync as the element moves within the page) - try { var box = node.getBoundingClientRect(); box = { top: box.top, left: box.left }; } - catch(e) { box = {top: 0, left: 0}; } - if (!screen) { - // Get the toplevel scroll, working around browser differences. - if (window.pageYOffset == null) { - var t = document.documentElement || document.body.parentNode; - if (t.scrollTop == null) t = document.body; - box.top += t.scrollTop; box.left += t.scrollLeft; - } else { - box.top += window.pageYOffset; box.left += window.pageXOffset; - } - } - return box; - }; - - // Get a node's text content. - function eltText(node) { - return node.textContent || node.innerText || node.nodeValue || ""; - } - function selectInput(node) { - if (ios) { // Mobile Safari apparently has a bug where select() is broken. - node.selectionStart = 0; - node.selectionEnd = node.value.length; - } else node.select(); - } - - // Operations on {line, ch} objects. - function posEq(a, b) {return a.line == b.line && a.ch == b.ch;} - function posLess(a, b) {return a.line < b.line || (a.line == b.line && a.ch < b.ch);} - function copyPos(x) {return {line: x.line, ch: x.ch};} - - var escapeElement = document.createElement("pre"); - function htmlEscape(str) { - escapeElement.textContent = str; - return escapeElement.innerHTML; - } - // Recent (late 2011) Opera betas insert bogus newlines at the start - // of the textContent, so we strip those. - if (htmlEscape("a") == "\na") - htmlEscape = function(str) { - escapeElement.textContent = str; - return escapeElement.innerHTML.slice(1); - }; - // Some IEs don't preserve tabs through innerHTML - else if (htmlEscape("\t") != "\t") - htmlEscape = function(str) { - escapeElement.innerHTML = ""; - escapeElement.appendChild(document.createTextNode(str)); - return escapeElement.innerHTML; - }; - CodeMirror.htmlEscape = htmlEscape; - - // Used to position the cursor after an undo/redo by finding the - // last edited character. - function editEnd(from, to) { - if (!to) return 0; - if (!from) return to.length; - for (var i = from.length, j = to.length; i >= 0 && j >= 0; --i, --j) - if (from.charAt(i) != to.charAt(j)) break; - return j + 1; - } - - function indexOf(collection, elt) { - if (collection.indexOf) return collection.indexOf(elt); - for (var i = 0, e = collection.length; i < e; ++i) - if (collection[i] == elt) return i; - return -1; - } - function isWordChar(ch) { - return /\w/.test(ch) || ch.toUpperCase() != ch.toLowerCase(); - } - - // See if "".split is the broken IE version, if so, provide an - // alternative way to split lines. - var splitLines = "\n\nb".split(/\n/).length != 3 ? function(string) { - var pos = 0, nl, result = []; - while ((nl = string.indexOf("\n", pos)) > -1) { - result.push(string.slice(pos, string.charAt(nl-1) == "\r" ? nl - 1 : nl)); - pos = nl + 1; - } - result.push(string.slice(pos)); - return result; - } : function(string){return string.split(/\r?\n/);}; - CodeMirror.splitLines = splitLines; - - var hasSelection = window.getSelection ? function(te) { - try { return te.selectionStart != te.selectionEnd; } - catch(e) { return false; } - } : function(te) { - try {var range = te.ownerDocument.selection.createRange();} - catch(e) {} - if (!range || range.parentElement() != te) return false; - return range.compareEndPoints("StartToEnd", range) != 0; - }; - - CodeMirror.defineMode("null", function() { - return {token: function(stream) {stream.skipToEnd();}}; - }); - CodeMirror.defineMIME("text/plain", "null"); - - var keyNames = {3: "Enter", 8: "Backspace", 9: "Tab", 13: "Enter", 16: "Shift", 17: "Ctrl", 18: "Alt", - 19: "Pause", 20: "CapsLock", 27: "Esc", 32: "Space", 33: "PageUp", 34: "PageDown", 35: "End", - 36: "Home", 37: "Left", 38: "Up", 39: "Right", 40: "Down", 44: "PrintScrn", 45: "Insert", - 46: "Delete", 59: ";", 91: "Mod", 92: "Mod", 93: "Mod", 186: ";", 187: "=", 188: ",", - 189: "-", 190: ".", 191: "/", 192: "`", 219: "[", 220: "\\", 221: "]", 222: "'", 63276: "PageUp", - 63277: "PageDown", 63275: "End", 63273: "Home", 63234: "Left", 63232: "Up", 63235: "Right", - 63233: "Down", 63302: "Insert", 63272: "Delete"}; - CodeMirror.keyNames = keyNames; - (function() { - // Number keys - for (var i = 0; i < 10; i++) keyNames[i + 48] = String(i); - // Alphabetic keys - for (var i = 65; i <= 90; i++) keyNames[i] = String.fromCharCode(i); - // Function keys - for (var i = 1; i <= 12; i++) keyNames[i + 111] = keyNames[i + 63235] = "F" + i; - })(); - - return CodeMirror; -})(); diff --git a/doc/design/js/create-group.js b/doc/design/js/create-group.js deleted file mode 100644 index 7a6dd5a10..000000000 --- a/doc/design/js/create-group.js +++ /dev/null @@ -1,11 +0,0 @@ -$(document).ready(function() { - $("#catchError").click(function() { - $("#error-warp").slideToggle("slow"); - var inp = document.getElementById("name"); - if (inp.className != "error") { - inp.className = "error"; - } else { - inp.className = ""; - } - }); -}); \ No newline at end of file diff --git a/doc/design/js/create-issue.js b/doc/design/js/create-issue.js deleted file mode 100644 index c26f4eda0..000000000 --- a/doc/design/js/create-issue.js +++ /dev/null @@ -1,35 +0,0 @@ -function addPeople(num) { - $("#people"+num).fadeOut(0); - $("#people-sections"+num).fadeIn("slow"); - $("#people-sections-list"+num).fadeIn("slow"); - if ($("#people-span").css("display") != "none") { - $("#people-span").fadeOut(0); - } -} - -function remPeople(num) { - $("#people"+num).fadeIn("slow"); - $("#people-sections"+num).fadeOut(0); - $("#people-sections-list"+num).fadeOut(0); - if (($("#people-sections-list1").css("display") == "none") && ($("#people-sections-list2").css("display") == "none") && ($("#people-sections-list3").css("display") == "none") && ($("#people-sections-list4").css("display") == "none")) { - $("#people-span").fadeIn("slow"); - } -} - -function addFlag(num) { - $("#flag"+num).fadeOut(0); - $("#flag-list"+num).fadeIn("slow"); - $("#flag-list-sections"+num).fadeIn("slow"); - if ($("#flag-span").css("display") != "none") { - $("#flag-span").fadeOut(0); - } -} - -function remFlag(num) { - $("#flag"+num).fadeIn("slow"); - $("#flag-list"+num).fadeOut(0); - $("#flag-list-sections"+num).fadeOut(0); - if (($("#flag-list-sections1").css("display") == "none") && ($("#flag-list-sections2").css("display") == "none") && ($("#flag-list-sections3").css("display") == "none") && ($("#flag-list-sections4").css("display") == "none")) { - $("#flag-span").fadeIn("slow"); - } -} diff --git a/doc/design/js/create-platform.js b/doc/design/js/create-platform.js deleted file mode 100644 index 8eca6b09e..000000000 --- a/doc/design/js/create-platform.js +++ /dev/null @@ -1,9 +0,0 @@ -$(document).ready(function() { - $("#myTable").tablesorter({ - headers: { - 1: { - sorter: false - } - } - }); -}); diff --git a/doc/design/js/cusel-2.5.js b/doc/design/js/cusel-2.5.js deleted file mode 100644 index 9df651844..000000000 --- a/doc/design/js/cusel-2.5.js +++ /dev/null @@ -1,454 +0,0 @@ -function cuSel(params) { - - jQuery(params.changedEl).each( - function(num) - { - var chEl = jQuery(this), - chElWid = chEl.outerWidth(), - chElClass = chEl.prop("class"), - chElId = chEl.prop("id"), - chElName = chEl.prop("name"), - defaultVal = chEl.val(), - activeOpt = chEl.find("option[value='"+defaultVal+"']").eq(0), - defaultText = activeOpt.text(), - disabledSel = chEl.prop("disabled"), - scrollArrows = params.scrollArrows, - chElOnChange = chEl.prop("onchange"), - chElTab = chEl.prop("tabindex"), - chElMultiple = chEl.prop("multiple"); - - if(!chElId || chElMultiple) return false; - - if(!disabledSel) - { - classDisCuselText = "", - classDisCusel=""; - } - else - { - classDisCuselText = "classDisCuselLabel"; - classDisCusel="classDisCusel"; - } - - if(scrollArrows) - { - classDisCusel+=" cuselScrollArrows"; - } - - activeOpt.addClass("cuselActive"); - - var optionStr = chEl.html(), - - - - - spanStr = optionStr.replace(/option/ig,"span").replace(/value=/ig,"val="); - - - if($.browser.msie && parseInt($.browser.version) < 9) - { - var pattern = /(val=)(.*?)(>)/g; - spanStr = spanStr.replace(pattern, "$1'$2'$3"); - } - - - - var cuselFrame = '
'+ - '
'+ - '
'+defaultText+'
'+ - '
'+ - spanStr+ - '
'+ - ''+ - '
'; - - - - chEl.replaceWith(cuselFrame); - - - if(chElOnChange) jQuery("#"+chElId).bind('change',chElOnChange); - - - var newSel = jQuery("#cuselFrame-"+chElId), - arrSpan = newSel.find("span"), - defaultHeight; - - if(!arrSpan.eq(0).text()) - { - defaultHeight = arrSpan.eq(1).innerHeight(); - arrSpan.eq(0).css("height", arrSpan.eq(1).height()); - } - else - { - defaultHeight = arrSpan.eq(0).innerHeight(); - } - - - if(arrSpan.length>params.visRows) - { - newSel.find(".cusel-scroll-wrap").eq(0) - .css({height: defaultHeight*params.visRows+"px", display : "none", visibility: "visible" }) - .children(".cusel-scroll-pane").css("height",defaultHeight*params.visRows+"px"); - } - else - { - newSel.find(".cusel-scroll-wrap").eq(0) - .css({display : "none", visibility: "visible" }); - } - - - - var arrAddTags = jQuery("#cusel-scroll-"+chElId).find("span[addTags]"), - lenAddTags = arrAddTags.length; - - for(i=0;iparams.visRows) - { - refreshScroll - .css({height: defaultHeight*params.visRows+"px", display : "none", visibility: "visible" }) - .children(".cusel-scroll-pane").css("height",defaultHeight*params.visRows+"px"); - } - else - { - refreshScroll - .css({display : "none", visibility: "visible" }); - } - } - -} - -function cuselShowList(cuselWrap) -{ - var cuselMain = cuselWrap.parent(".cusel"); - - - if(cuselWrap.css("display")=="none") - { - $(".cusel-scroll-wrap").css("display","none"); - - cuselMain.addClass("cuselOpen"); - cuselWrap.css("display","block"); - var cuselArrows = false; - if(cuselMain.prop("class").indexOf("cuselScrollArrows")!=-1) cuselArrows=true; - if(!cuselWrap.find(".jScrollPaneContainer").eq(0).is("div")) - { - cuselWrap.find("div").eq(0).jScrollPaneCusel({showArrows:cuselArrows}); - } - - - cuselScrollToCurent(cuselWrap); - } - else - { - cuselWrap.css("display","none"); - cuselMain.removeClass("cuselOpen"); - } -} - - - -function cuselScrollToCurent(cuselWrap) -{ - var cuselScrollEl = null; - if(cuselWrap.find(".cuselOptHover").eq(0).is("span")) cuselScrollEl = cuselWrap.find(".cuselOptHover").eq(0); - else if(cuselWrap.find(".cuselActive").eq(0).is("span")) cuselScrollEl = cuselWrap.find(".cuselActive").eq(0); - - if(cuselWrap.find(".jScrollPaneTrack").eq(0).is("div") && cuselScrollEl) - { - - var posCurrentOpt = cuselScrollEl.position(), - idScrollWrap = cuselWrap.find(".cusel-scroll-pane").eq(0).attr("id"); - - jQuery("#"+idScrollWrap)[0].scrollTo(posCurrentOpt.top); - - } -} diff --git a/doc/design/js/cusel-init.js b/doc/design/js/cusel-init.js deleted file mode 100644 index 04a7f7093..000000000 --- a/doc/design/js/cusel-init.js +++ /dev/null @@ -1,11 +0,0 @@ -jQuery(document).ready(function(){ - -var params = { - changedEl: ".lineForm select", - visRows: 999999, - scrollArrows: false - } - - cuSel(params); - -}); \ No newline at end of file diff --git a/doc/design/js/exsearch.js b/doc/design/js/exsearch.js deleted file mode 100644 index b58515175..000000000 --- a/doc/design/js/exsearch.js +++ /dev/null @@ -1,45 +0,0 @@ -$(document).ready(function() { - $("#selSearch").change(function() { - var selection = document.getElementById("selSearch").value; - if (selection == "all") { - $("#projects").fadeOut(0); - $("#platforms").fadeOut(0); - $("#users").fadeOut(0); - $("#all").fadeIn("fast"); - } - if (selection == "projects") { - $("#all").fadeOut(0); - $("#platforms").fadeOut(0); - $("#users").fadeOut(0); - $("#projects").fadeIn("fast"); - } - if (selection == "users") { - $("#all").fadeOut(0); - $("#projects").fadeOut(0); - $("#platforms").fadeOut(0); - $("#users").fadeIn("fast"); - } - if (selection == "platforms") { - $("#all").fadeOut(0); - $("#projects").fadeOut(0); - $("#users").fadeOut(0); - $("#platforms").fadeIn("fast"); - } - }); - - $("#projects-more").click(function() { - $("#row1-1").fadeIn("fast"); - $("#row1-2").fadeIn("fast"); - }); - - $("#users-more").click(function() { - $("#row2-1").fadeIn("fast"); - $("#row2-2").fadeIn("fast"); - }); - - $("#platforms-more").click(function() { - $("#row3-1").fadeIn("fast"); - $("#row3-2").fadeIn("fast"); - }); - - }); \ No newline at end of file diff --git a/doc/design/js/groups-inside.js b/doc/design/js/groups-inside.js deleted file mode 100644 index cef30a9e3..000000000 --- a/doc/design/js/groups-inside.js +++ /dev/null @@ -1,14 +0,0 @@ -function deleteAdminMember() { - if (document.getElementById("niceCheckbox1-1").checked == true) { - $("#admin-table-members-row1").fadeOut("slow"); - } - if (document.getElementById("niceCheckbox2-1").checked == true) { - $("#admin-table-members-row2").fadeOut("slow"); - } - if (document.getElementById("niceCheckbox3-1").checked == true) { - $("#admin-table-members-row3").fadeOut("slow"); - } - if (document.getElementById("niceCheckbox4-1").checked == true) { - $("#admin-table-members-row4").fadeOut("slow"); - } -} \ No newline at end of file diff --git a/doc/design/js/groups-list.js b/doc/design/js/groups-list.js deleted file mode 100644 index dca428fe4..000000000 --- a/doc/design/js/groups-list.js +++ /dev/null @@ -1,16 +0,0 @@ -$(document).ready(function() { - $("#myTable").tablesorter({ - headers: { - 1: { - sorter: false - }, - 2: { - sorter: false - } - } - }); -}); - -function deleteRow(num) { - $("#Row"+num).fadeOut("slow"); -} \ No newline at end of file diff --git a/doc/design/js/hl/shAutoloader.js b/doc/design/js/hl/shAutoloader.js deleted file mode 100644 index 4e29bddec..000000000 --- a/doc/design/js/hl/shAutoloader.js +++ /dev/null @@ -1,17 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/SyntaxHighlighter - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/SyntaxHighlighter/donate.html - * - * @version - * 3.0.83 (July 02 2010) - * - * @copyright - * Copyright (C) 2004-2010 Alex Gorbatchev. - * - * @license - * Dual licensed under the MIT and GPL licenses. - */ -eval(function(p,a,c,k,e,d){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('(2(){1 h=5;h.I=2(){2 n(c,a){4(1 d=0;d|<|≥|>=|≤|<=|\*|\+|-|\/|÷|\^)/g, - css: 'color2' }, - - { regex: /\b(?:and|as|div|mod|not|or|return(?!\s&)(ing)?|equals|(is(n't| not)? )?equal( to)?|does(n't| not) equal|(is(n't| not)? )?(greater|less) than( or equal( to)?)?|(comes|does(n't| not) come) (after|before)|is(n't| not)?( in)? (back|front) of|is(n't| not)? behind|is(n't| not)?( (in|contained by))?|does(n't| not) contain|contain(s)?|(start|begin|end)(s)? with|((but|end) )?(consider|ignor)ing|prop(erty)?|(a )?ref(erence)?( to)?|repeat (until|while|with)|((end|exit) )?repeat|((else|end) )?if|else|(end )?(script|tell|try)|(on )?error|(put )?into|(of )?(it|me)|its|my|with (timeout( of)?|transaction)|end (timeout|transaction))\b/g, - css: 'keyword' }, - - { regex: /\b\d+(st|nd|rd|th)\b/g, // ordinals - css: 'keyword' }, - - { regex: /\b(?:about|above|against|around|at|below|beneath|beside|between|by|(apart|aside) from|(instead|out) of|into|on(to)?|over|since|thr(ough|u)|under)\b/g, - css: 'color3' }, - - { regex: /\b(?:adding folder items to|after receiving|choose( ((remote )?application|color|folder|from list|URL))?|clipboard info|set the clipboard to|(the )?clipboard|entire contents|display(ing| (alert|dialog|mode))?|document( (edited|file|nib name))?|file( (name|type))?|(info )?for|giving up after|(name )?extension|quoted form|return(ed)?|second(?! item)(s)?|list (disks|folder)|text item(s| delimiters)?|(Unicode )?text|(disk )?item(s)?|((current|list) )?view|((container|key) )?window|with (data|icon( (caution|note|stop))?|parameter(s)?|prompt|properties|seed|title)|case|diacriticals|hyphens|numeric strings|punctuation|white space|folder creation|application(s( folder)?| (processes|scripts position|support))?|((desktop )?(pictures )?|(documents|downloads|favorites|home|keychain|library|movies|music|public|scripts|sites|system|users|utilities|workflows) )folder|desktop|Folder Action scripts|font(s| panel)?|help|internet plugins|modem scripts|(system )?preferences|printer descriptions|scripting (additions|components)|shared (documents|libraries)|startup (disk|items)|temporary items|trash|on server|in AppleTalk zone|((as|long|short) )?user name|user (ID|locale)|(with )?password|in (bundle( with identifier)?|directory)|(close|open for) access|read|write( permission)?|(g|s)et eof|using( delimiters)?|starting at|default (answer|button|color|country code|entr(y|ies)|identifiers|items|name|location|script editor)|hidden( answer)?|open(ed| (location|untitled))?|error (handling|reporting)|(do( shell)?|load|run|store) script|administrator privileges|altering line endings|get volume settings|(alert|boot|input|mount|output|set) volume|output muted|(fax|random )?number|round(ing)?|up|down|toward zero|to nearest|as taught in school|system (attribute|info)|((AppleScript( Studio)?|system) )?version|(home )?directory|(IPv4|primary Ethernet) address|CPU (type|speed)|physical memory|time (stamp|to GMT)|replacing|ASCII (character|number)|localized string|from table|offset|summarize|beep|delay|say|(empty|multiple) selections allowed|(of|preferred) type|invisibles|showing( package contents)?|editable URL|(File|FTP|News|Media|Web) [Ss]ervers|Telnet hosts|Directory services|Remote applications|waiting until completion|saving( (in|to))?|path (for|to( (((current|frontmost) )?application|resource))?)|POSIX (file|path)|(background|RGB) color|(OK|cancel) button name|cancel button|button(s)?|cubic ((centi)?met(re|er)s|yards|feet|inches)|square ((kilo)?met(re|er)s|miles|yards|feet)|(centi|kilo)?met(re|er)s|miles|yards|feet|inches|lit(re|er)s|gallons|quarts|(kilo)?grams|ounces|pounds|degrees (Celsius|Fahrenheit|Kelvin)|print( (dialog|settings))?|clos(e(able)?|ing)|(de)?miniaturized|miniaturizable|zoom(ed|able)|attribute run|action (method|property|title)|phone|email|((start|end)ing|home) page|((birth|creation|current|custom|modification) )?date|((((phonetic )?(first|last|middle))|computer|host|maiden|related) |nick)?name|aim|icq|jabber|msn|yahoo|address(es)?|save addressbook|should enable action|city|country( code)?|formatte(r|d address)|(palette )?label|state|street|zip|AIM [Hh]andle(s)?|my card|select(ion| all)?|unsaved|(alpha )?value|entr(y|ies)|group|(ICQ|Jabber|MSN) handle|person|people|company|department|icon image|job title|note|organization|suffix|vcard|url|copies|collating|pages (across|down)|request print time|target( printer)?|((GUI Scripting|Script menu) )?enabled|show Computer scripts|(de)?activated|awake from nib|became (key|main)|call method|of (class|object)|center|clicked toolbar item|closed|for document|exposed|(can )?hide|idle|keyboard (down|up)|event( (number|type))?|launch(ed)?|load (image|movie|nib|sound)|owner|log|mouse (down|dragged|entered|exited|moved|up)|move|column|localization|resource|script|register|drag (info|types)|resigned (active|key|main)|resiz(e(d)?|able)|right mouse (down|dragged|up)|scroll wheel|(at )?index|should (close|open( untitled)?|quit( after last window closed)?|zoom)|((proposed|screen) )?bounds|show(n)?|behind|in front of|size (mode|to fit)|update(d| toolbar item)?|was (hidden|miniaturized)|will (become active|close|finish launching|hide|miniaturize|move|open|quit|(resign )?active|((maximum|minimum|proposed) )?size|show|zoom)|bundle|data source|movie|pasteboard|sound|tool(bar| tip)|(color|open|save) panel|coordinate system|frontmost|main( (bundle|menu|window))?|((services|(excluded from )?windows) )?menu|((executable|frameworks|resource|scripts|shared (frameworks|support)) )?path|(selected item )?identifier|data|content(s| view)?|character(s)?|click count|(command|control|option|shift) key down|context|delta (x|y|z)|key( code)?|location|pressure|unmodified characters|types|(first )?responder|playing|(allowed|selectable) identifiers|allows customization|(auto saves )?configuration|visible|image( name)?|menu form representation|tag|user(-| )defaults|associated file name|(auto|needs) display|current field editor|floating|has (resize indicator|shadow)|hides when deactivated|level|minimized (image|title)|opaque|position|release when closed|sheet|title(d)?)\b/g, - css: 'color3' }, - - { regex: new RegExp(this.getKeywords(specials), 'gm'), css: 'color3' }, - { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, - { regex: new RegExp(this.getKeywords(ordinals), 'gm'), css: 'keyword' } - ]; - }; - - Brush.prototype = new SyntaxHighlighter.Highlighter(); - Brush.aliases = ['applescript']; - - SyntaxHighlighter.brushes.AppleScript = Brush; - - // CommonJS - typeof(exports) != 'undefined' ? exports.Brush = Brush : null; -})(); diff --git a/doc/design/js/hl/shBrushBash.js b/doc/design/js/hl/shBrushBash.js deleted file mode 100644 index 8c296969f..000000000 --- a/doc/design/js/hl/shBrushBash.js +++ /dev/null @@ -1,59 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/SyntaxHighlighter - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/SyntaxHighlighter/donate.html - * - * @version - * 3.0.83 (July 02 2010) - * - * @copyright - * Copyright (C) 2004-2010 Alex Gorbatchev. - * - * @license - * Dual licensed under the MIT and GPL licenses. - */ -;(function() -{ - // CommonJS - typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; - - function Brush() - { - var keywords = 'if fi then elif else for do done until while break continue case function return in eq ne ge le'; - var commands = 'alias apropos awk basename bash bc bg builtin bzip2 cal cat cd cfdisk chgrp chmod chown chroot' + - 'cksum clear cmp comm command cp cron crontab csplit cut date dc dd ddrescue declare df ' + - 'diff diff3 dig dir dircolors dirname dirs du echo egrep eject enable env ethtool eval ' + - 'exec exit expand export expr false fdformat fdisk fg fgrep file find fmt fold format ' + - 'free fsck ftp gawk getopts grep groups gzip hash head history hostname id ifconfig ' + - 'import install join kill less let ln local locate logname logout look lpc lpr lprint ' + - 'lprintd lprintq lprm ls lsof make man mkdir mkfifo mkisofs mknod more mount mtools ' + - 'mv netstat nice nl nohup nslookup open op passwd paste pathchk ping popd pr printcap ' + - 'printenv printf ps pushd pwd quota quotacheck quotactl ram rcp read readonly renice ' + - 'remsync rm rmdir rsync screen scp sdiff sed select seq set sftp shift shopt shutdown ' + - 'sleep sort source split ssh strace su sudo sum symlink sync tail tar tee test time ' + - 'times touch top traceroute trap tr true tsort tty type ulimit umask umount unalias ' + - 'uname unexpand uniq units unset unshar useradd usermod users uuencode uudecode v vdir ' + - 'vi watch wc whereis which who whoami Wget xargs yes' - ; - - this.regexList = [ - { regex: /^#!.*$/gm, css: 'preprocessor bold' }, - { regex: /\/[\w-\/]+/gm, css: 'plain' }, - { regex: SyntaxHighlighter.regexLib.singleLinePerlComments, css: 'comments' }, // one line comments - { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings - { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings - { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords - { regex: new RegExp(this.getKeywords(commands), 'gm'), css: 'functions' } // commands - ]; - } - - Brush.prototype = new SyntaxHighlighter.Highlighter(); - Brush.aliases = ['bash', 'shell']; - - SyntaxHighlighter.brushes.Bash = Brush; - - // CommonJS - typeof(exports) != 'undefined' ? exports.Brush = Brush : null; -})(); diff --git a/doc/design/js/hl/shBrushCSharp.js b/doc/design/js/hl/shBrushCSharp.js deleted file mode 100644 index 079214efe..000000000 --- a/doc/design/js/hl/shBrushCSharp.js +++ /dev/null @@ -1,65 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/SyntaxHighlighter - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/SyntaxHighlighter/donate.html - * - * @version - * 3.0.83 (July 02 2010) - * - * @copyright - * Copyright (C) 2004-2010 Alex Gorbatchev. - * - * @license - * Dual licensed under the MIT and GPL licenses. - */ -;(function() -{ - // CommonJS - typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; - - function Brush() - { - var keywords = 'abstract as base bool break byte case catch char checked class const ' + - 'continue decimal default delegate do double else enum event explicit ' + - 'extern false finally fixed float for foreach get goto if implicit in int ' + - 'interface internal is lock long namespace new null object operator out ' + - 'override params private protected public readonly ref return sbyte sealed set ' + - 'short sizeof stackalloc static string struct switch this throw true try ' + - 'typeof uint ulong unchecked unsafe ushort using virtual void while'; - - function fixComments(match, regexInfo) - { - var css = (match[0].indexOf("///") == 0) - ? 'color1' - : 'comments' - ; - - return [new SyntaxHighlighter.Match(match[0], match.index, css)]; - } - - this.regexList = [ - { regex: SyntaxHighlighter.regexLib.singleLineCComments, func : fixComments }, // one line comments - { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments - { regex: /@"(?:[^"]|"")*"/g, css: 'string' }, // @-quoted strings - { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings - { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings - { regex: /^\s*#.*/gm, css: 'preprocessor' }, // preprocessor tags like #region and #endregion - { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // c# keyword - { regex: /\bpartial(?=\s+(?:class|interface|struct)\b)/g, css: 'keyword' }, // contextual keyword: 'partial' - { regex: /\byield(?=\s+(?:return|break)\b)/g, css: 'keyword' } // contextual keyword: 'yield' - ]; - - this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags); - }; - - Brush.prototype = new SyntaxHighlighter.Highlighter(); - Brush.aliases = ['c#', 'c-sharp', 'csharp']; - - SyntaxHighlighter.brushes.CSharp = Brush; - - // CommonJS - typeof(exports) != 'undefined' ? exports.Brush = Brush : null; -})(); - diff --git a/doc/design/js/hl/shBrushColdFusion.js b/doc/design/js/hl/shBrushColdFusion.js deleted file mode 100644 index 627dbb9b7..000000000 --- a/doc/design/js/hl/shBrushColdFusion.js +++ /dev/null @@ -1,100 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/SyntaxHighlighter - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/SyntaxHighlighter/donate.html - * - * @version - * 3.0.83 (July 02 2010) - * - * @copyright - * Copyright (C) 2004-2010 Alex Gorbatchev. - * - * @license - * Dual licensed under the MIT and GPL licenses. - */ -;(function() -{ - // CommonJS - typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; - - function Brush() - { - // Contributed by Jen - // http://www.jensbits.com/2009/05/14/coldfusion-brush-for-syntaxhighlighter-plus - - var funcs = 'Abs ACos AddSOAPRequestHeader AddSOAPResponseHeader AjaxLink AjaxOnLoad ArrayAppend ArrayAvg ArrayClear ArrayDeleteAt ' + - 'ArrayInsertAt ArrayIsDefined ArrayIsEmpty ArrayLen ArrayMax ArrayMin ArraySet ArraySort ArraySum ArraySwap ArrayToList ' + - 'Asc ASin Atn BinaryDecode BinaryEncode BitAnd BitMaskClear BitMaskRead BitMaskSet BitNot BitOr BitSHLN BitSHRN BitXor ' + - 'Ceiling CharsetDecode CharsetEncode Chr CJustify Compare CompareNoCase Cos CreateDate CreateDateTime CreateObject ' + - 'CreateODBCDate CreateODBCDateTime CreateODBCTime CreateTime CreateTimeSpan CreateUUID DateAdd DateCompare DateConvert ' + - 'DateDiff DateFormat DatePart Day DayOfWeek DayOfWeekAsString DayOfYear DaysInMonth DaysInYear DE DecimalFormat DecrementValue ' + - 'Decrypt DecryptBinary DeleteClientVariable DeserializeJSON DirectoryExists DollarFormat DotNetToCFType Duplicate Encrypt ' + - 'EncryptBinary Evaluate Exp ExpandPath FileClose FileCopy FileDelete FileExists FileIsEOF FileMove FileOpen FileRead ' + - 'FileReadBinary FileReadLine FileSetAccessMode FileSetAttribute FileSetLastModified FileWrite Find FindNoCase FindOneOf ' + - 'FirstDayOfMonth Fix FormatBaseN GenerateSecretKey GetAuthUser GetBaseTagData GetBaseTagList GetBaseTemplatePath ' + - 'GetClientVariablesList GetComponentMetaData GetContextRoot GetCurrentTemplatePath GetDirectoryFromPath GetEncoding ' + - 'GetException GetFileFromPath GetFileInfo GetFunctionList GetGatewayHelper GetHttpRequestData GetHttpTimeString ' + - 'GetK2ServerDocCount GetK2ServerDocCountLimit GetLocale GetLocaleDisplayName GetLocalHostIP GetMetaData GetMetricData ' + - 'GetPageContext GetPrinterInfo GetProfileSections GetProfileString GetReadableImageFormats GetSOAPRequest GetSOAPRequestHeader ' + - 'GetSOAPResponse GetSOAPResponseHeader GetTempDirectory GetTempFile GetTemplatePath GetTickCount GetTimeZoneInfo GetToken ' + - 'GetUserRoles GetWriteableImageFormats Hash Hour HTMLCodeFormat HTMLEditFormat IIf ImageAddBorder ImageBlur ImageClearRect ' + - 'ImageCopy ImageCrop ImageDrawArc ImageDrawBeveledRect ImageDrawCubicCurve ImageDrawLine ImageDrawLines ImageDrawOval ' + - 'ImageDrawPoint ImageDrawQuadraticCurve ImageDrawRect ImageDrawRoundRect ImageDrawText ImageFlip ImageGetBlob ImageGetBufferedImage ' + - 'ImageGetEXIFTag ImageGetHeight ImageGetIPTCTag ImageGetWidth ImageGrayscale ImageInfo ImageNegative ImageNew ImageOverlay ImagePaste ' + - 'ImageRead ImageReadBase64 ImageResize ImageRotate ImageRotateDrawingAxis ImageScaleToFit ImageSetAntialiasing ImageSetBackgroundColor ' + - 'ImageSetDrawingColor ImageSetDrawingStroke ImageSetDrawingTransparency ImageSharpen ImageShear ImageShearDrawingAxis ImageTranslate ' + - 'ImageTranslateDrawingAxis ImageWrite ImageWriteBase64 ImageXORDrawingMode IncrementValue InputBaseN Insert Int IsArray IsBinary ' + - 'IsBoolean IsCustomFunction IsDate IsDDX IsDebugMode IsDefined IsImage IsImageFile IsInstanceOf IsJSON IsLeapYear IsLocalHost ' + - 'IsNumeric IsNumericDate IsObject IsPDFFile IsPDFObject IsQuery IsSimpleValue IsSOAPRequest IsStruct IsUserInAnyRole IsUserInRole ' + - 'IsUserLoggedIn IsValid IsWDDX IsXML IsXmlAttribute IsXmlDoc IsXmlElem IsXmlNode IsXmlRoot JavaCast JSStringFormat LCase Left Len ' + - 'ListAppend ListChangeDelims ListContains ListContainsNoCase ListDeleteAt ListFind ListFindNoCase ListFirst ListGetAt ListInsertAt ' + - 'ListLast ListLen ListPrepend ListQualify ListRest ListSetAt ListSort ListToArray ListValueCount ListValueCountNoCase LJustify Log ' + - 'Log10 LSCurrencyFormat LSDateFormat LSEuroCurrencyFormat LSIsCurrency LSIsDate LSIsNumeric LSNumberFormat LSParseCurrency LSParseDateTime ' + - 'LSParseEuroCurrency LSParseNumber LSTimeFormat LTrim Max Mid Min Minute Month MonthAsString Now NumberFormat ParagraphFormat ParseDateTime ' + - 'Pi PrecisionEvaluate PreserveSingleQuotes Quarter QueryAddColumn QueryAddRow QueryConvertForGrid QueryNew QuerySetCell QuotedValueList Rand ' + - 'Randomize RandRange REFind REFindNoCase ReleaseComObject REMatch REMatchNoCase RemoveChars RepeatString Replace ReplaceList ReplaceNoCase ' + - 'REReplace REReplaceNoCase Reverse Right RJustify Round RTrim Second SendGatewayMessage SerializeJSON SetEncoding SetLocale SetProfileString ' + - 'SetVariable Sgn Sin Sleep SpanExcluding SpanIncluding Sqr StripCR StructAppend StructClear StructCopy StructCount StructDelete StructFind ' + - 'StructFindKey StructFindValue StructGet StructInsert StructIsEmpty StructKeyArray StructKeyExists StructKeyList StructKeyList StructNew ' + - 'StructSort StructUpdate Tan TimeFormat ToBase64 ToBinary ToScript ToString Trim UCase URLDecode URLEncodedFormat URLSessionFormat Val ' + - 'ValueList VerifyClient Week Wrap Wrap WriteOutput XmlChildPos XmlElemNew XmlFormat XmlGetNodeType XmlNew XmlParse XmlSearch XmlTransform ' + - 'XmlValidate Year YesNoFormat'; - - var keywords = 'cfabort cfajaximport cfajaxproxy cfapplet cfapplication cfargument cfassociate cfbreak cfcache cfcalendar ' + - 'cfcase cfcatch cfchart cfchartdata cfchartseries cfcol cfcollection cfcomponent cfcontent cfcookie cfdbinfo ' + - 'cfdefaultcase cfdirectory cfdiv cfdocument cfdocumentitem cfdocumentsection cfdump cfelse cfelseif cferror ' + - 'cfexchangecalendar cfexchangeconnection cfexchangecontact cfexchangefilter cfexchangemail cfexchangetask ' + - 'cfexecute cfexit cffeed cffile cfflush cfform cfformgroup cfformitem cfftp cffunction cfgrid cfgridcolumn ' + - 'cfgridrow cfgridupdate cfheader cfhtmlhead cfhttp cfhttpparam cfif cfimage cfimport cfinclude cfindex ' + - 'cfinput cfinsert cfinterface cfinvoke cfinvokeargument cflayout cflayoutarea cfldap cflocation cflock cflog ' + - 'cflogin cfloginuser cflogout cfloop cfmail cfmailparam cfmailpart cfmenu cfmenuitem cfmodule cfNTauthenticate ' + - 'cfobject cfobjectcache cfoutput cfparam cfpdf cfpdfform cfpdfformparam cfpdfparam cfpdfsubform cfpod cfpop ' + - 'cfpresentation cfpresentationslide cfpresenter cfprint cfprocessingdirective cfprocparam cfprocresult ' + - 'cfproperty cfquery cfqueryparam cfregistry cfreport cfreportparam cfrethrow cfreturn cfsavecontent cfschedule ' + - 'cfscript cfsearch cfselect cfset cfsetting cfsilent cfslider cfsprydataset cfstoredproc cfswitch cftable ' + - 'cftextarea cfthread cfthrow cftimer cftooltip cftrace cftransaction cftree cftreeitem cftry cfupdate cfwddx ' + - 'cfwindow cfxml cfzip cfzipparam'; - - var operators = 'all and any between cross in join like not null or outer some'; - - this.regexList = [ - { regex: new RegExp('--(.*)$', 'gm'), css: 'comments' }, // one line and multiline comments - { regex: SyntaxHighlighter.regexLib.xmlComments, css: 'comments' }, // single quoted strings - { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings - { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings - { regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'functions' }, // functions - { regex: new RegExp(this.getKeywords(operators), 'gmi'), css: 'color1' }, // operators and such - { regex: new RegExp(this.getKeywords(keywords), 'gmi'), css: 'keyword' } // keyword - ]; - } - - Brush.prototype = new SyntaxHighlighter.Highlighter(); - Brush.aliases = ['coldfusion','cf']; - - SyntaxHighlighter.brushes.ColdFusion = Brush; - - // CommonJS - typeof(exports) != 'undefined' ? exports.Brush = Brush : null; -})(); diff --git a/doc/design/js/hl/shBrushCpp.js b/doc/design/js/hl/shBrushCpp.js deleted file mode 100644 index 9f70d3aed..000000000 --- a/doc/design/js/hl/shBrushCpp.js +++ /dev/null @@ -1,97 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/SyntaxHighlighter - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/SyntaxHighlighter/donate.html - * - * @version - * 3.0.83 (July 02 2010) - * - * @copyright - * Copyright (C) 2004-2010 Alex Gorbatchev. - * - * @license - * Dual licensed under the MIT and GPL licenses. - */ -;(function() -{ - // CommonJS - typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; - - function Brush() - { - // Copyright 2006 Shin, YoungJin - - var datatypes = 'ATOM BOOL BOOLEAN BYTE CHAR COLORREF DWORD DWORDLONG DWORD_PTR ' + - 'DWORD32 DWORD64 FLOAT HACCEL HALF_PTR HANDLE HBITMAP HBRUSH ' + - 'HCOLORSPACE HCONV HCONVLIST HCURSOR HDC HDDEDATA HDESK HDROP HDWP ' + - 'HENHMETAFILE HFILE HFONT HGDIOBJ HGLOBAL HHOOK HICON HINSTANCE HKEY ' + - 'HKL HLOCAL HMENU HMETAFILE HMODULE HMONITOR HPALETTE HPEN HRESULT ' + - 'HRGN HRSRC HSZ HWINSTA HWND INT INT_PTR INT32 INT64 LANGID LCID LCTYPE ' + - 'LGRPID LONG LONGLONG LONG_PTR LONG32 LONG64 LPARAM LPBOOL LPBYTE LPCOLORREF ' + - 'LPCSTR LPCTSTR LPCVOID LPCWSTR LPDWORD LPHANDLE LPINT LPLONG LPSTR LPTSTR ' + - 'LPVOID LPWORD LPWSTR LRESULT PBOOL PBOOLEAN PBYTE PCHAR PCSTR PCTSTR PCWSTR ' + - 'PDWORDLONG PDWORD_PTR PDWORD32 PDWORD64 PFLOAT PHALF_PTR PHANDLE PHKEY PINT ' + - 'PINT_PTR PINT32 PINT64 PLCID PLONG PLONGLONG PLONG_PTR PLONG32 PLONG64 POINTER_32 ' + - 'POINTER_64 PSHORT PSIZE_T PSSIZE_T PSTR PTBYTE PTCHAR PTSTR PUCHAR PUHALF_PTR ' + - 'PUINT PUINT_PTR PUINT32 PUINT64 PULONG PULONGLONG PULONG_PTR PULONG32 PULONG64 ' + - 'PUSHORT PVOID PWCHAR PWORD PWSTR SC_HANDLE SC_LOCK SERVICE_STATUS_HANDLE SHORT ' + - 'SIZE_T SSIZE_T TBYTE TCHAR UCHAR UHALF_PTR UINT UINT_PTR UINT32 UINT64 ULONG ' + - 'ULONGLONG ULONG_PTR ULONG32 ULONG64 USHORT USN VOID WCHAR WORD WPARAM WPARAM WPARAM ' + - 'char bool short int __int32 __int64 __int8 __int16 long float double __wchar_t ' + - 'clock_t _complex _dev_t _diskfree_t div_t ldiv_t _exception _EXCEPTION_POINTERS ' + - 'FILE _finddata_t _finddatai64_t _wfinddata_t _wfinddatai64_t __finddata64_t ' + - '__wfinddata64_t _FPIEEE_RECORD fpos_t _HEAPINFO _HFILE lconv intptr_t ' + - 'jmp_buf mbstate_t _off_t _onexit_t _PNH ptrdiff_t _purecall_handler ' + - 'sig_atomic_t size_t _stat __stat64 _stati64 terminate_function ' + - 'time_t __time64_t _timeb __timeb64 tm uintptr_t _utimbuf ' + - 'va_list wchar_t wctrans_t wctype_t wint_t signed'; - - var keywords = 'break case catch class const __finally __exception __try ' + - 'const_cast continue private public protected __declspec ' + - 'default delete deprecated dllexport dllimport do dynamic_cast ' + - 'else enum explicit extern if for friend goto inline ' + - 'mutable naked namespace new noinline noreturn nothrow ' + - 'register reinterpret_cast return selectany ' + - 'sizeof static static_cast struct switch template this ' + - 'thread throw true false try typedef typeid typename union ' + - 'using uuid virtual void volatile whcar_t while'; - - var functions = 'assert isalnum isalpha iscntrl isdigit isgraph islower isprint' + - 'ispunct isspace isupper isxdigit tolower toupper errno localeconv ' + - 'setlocale acos asin atan atan2 ceil cos cosh exp fabs floor fmod ' + - 'frexp ldexp log log10 modf pow sin sinh sqrt tan tanh jmp_buf ' + - 'longjmp setjmp raise signal sig_atomic_t va_arg va_end va_start ' + - 'clearerr fclose feof ferror fflush fgetc fgetpos fgets fopen ' + - 'fprintf fputc fputs fread freopen fscanf fseek fsetpos ftell ' + - 'fwrite getc getchar gets perror printf putc putchar puts remove ' + - 'rename rewind scanf setbuf setvbuf sprintf sscanf tmpfile tmpnam ' + - 'ungetc vfprintf vprintf vsprintf abort abs atexit atof atoi atol ' + - 'bsearch calloc div exit free getenv labs ldiv malloc mblen mbstowcs ' + - 'mbtowc qsort rand realloc srand strtod strtol strtoul system ' + - 'wcstombs wctomb memchr memcmp memcpy memmove memset strcat strchr ' + - 'strcmp strcoll strcpy strcspn strerror strlen strncat strncmp ' + - 'strncpy strpbrk strrchr strspn strstr strtok strxfrm asctime ' + - 'clock ctime difftime gmtime localtime mktime strftime time'; - - this.regexList = [ - { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments - { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments - { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings - { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings - { regex: /^ *#.*/gm, css: 'preprocessor' }, - { regex: new RegExp(this.getKeywords(datatypes), 'gm'), css: 'color1 bold' }, - { regex: new RegExp(this.getKeywords(functions), 'gm'), css: 'functions bold' }, - { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword bold' } - ]; - }; - - Brush.prototype = new SyntaxHighlighter.Highlighter(); - Brush.aliases = ['cpp', 'c']; - - SyntaxHighlighter.brushes.Cpp = Brush; - - // CommonJS - typeof(exports) != 'undefined' ? exports.Brush = Brush : null; -})(); diff --git a/doc/design/js/hl/shBrushCss.js b/doc/design/js/hl/shBrushCss.js deleted file mode 100644 index 4297a9a64..000000000 --- a/doc/design/js/hl/shBrushCss.js +++ /dev/null @@ -1,91 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/SyntaxHighlighter - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/SyntaxHighlighter/donate.html - * - * @version - * 3.0.83 (July 02 2010) - * - * @copyright - * Copyright (C) 2004-2010 Alex Gorbatchev. - * - * @license - * Dual licensed under the MIT and GPL licenses. - */ -;(function() -{ - // CommonJS - typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; - - function Brush() - { - function getKeywordsCSS(str) - { - return '\\b([a-z_]|)' + str.replace(/ /g, '(?=:)\\b|\\b([a-z_\\*]|\\*|)') + '(?=:)\\b'; - }; - - function getValuesCSS(str) - { - return '\\b' + str.replace(/ /g, '(?!-)(?!:)\\b|\\b()') + '\:\\b'; - }; - - var keywords = 'ascent azimuth background-attachment background-color background-image background-position ' + - 'background-repeat background baseline bbox border-collapse border-color border-spacing border-style border-top ' + - 'border-right border-bottom border-left border-top-color border-right-color border-bottom-color border-left-color ' + - 'border-top-style border-right-style border-bottom-style border-left-style border-top-width border-right-width ' + - 'border-bottom-width border-left-width border-width border bottom cap-height caption-side centerline clear clip color ' + - 'content counter-increment counter-reset cue-after cue-before cue cursor definition-src descent direction display ' + - 'elevation empty-cells float font-size-adjust font-family font-size font-stretch font-style font-variant font-weight font ' + - 'height left letter-spacing line-height list-style-image list-style-position list-style-type list-style margin-top ' + - 'margin-right margin-bottom margin-left margin marker-offset marks mathline max-height max-width min-height min-width orphans ' + - 'outline-color outline-style outline-width outline overflow padding-top padding-right padding-bottom padding-left padding page ' + - 'page-break-after page-break-before page-break-inside pause pause-after pause-before pitch pitch-range play-during position ' + - 'quotes right richness size slope src speak-header speak-numeral speak-punctuation speak speech-rate stemh stemv stress ' + - 'table-layout text-align top text-decoration text-indent text-shadow text-transform unicode-bidi unicode-range units-per-em ' + - 'vertical-align visibility voice-family volume white-space widows width widths word-spacing x-height z-index'; - - var values = 'above absolute all always aqua armenian attr aural auto avoid baseline behind below bidi-override black blink block blue bold bolder '+ - 'both bottom braille capitalize caption center center-left center-right circle close-quote code collapse compact condensed '+ - 'continuous counter counters crop cross crosshair cursive dashed decimal decimal-leading-zero default digits disc dotted double '+ - 'embed embossed e-resize expanded extra-condensed extra-expanded fantasy far-left far-right fast faster fixed format fuchsia '+ - 'gray green groove handheld hebrew help hidden hide high higher icon inline-table inline inset inside invert italic '+ - 'justify landscape large larger left-side left leftwards level lighter lime line-through list-item local loud lower-alpha '+ - 'lowercase lower-greek lower-latin lower-roman lower low ltr marker maroon medium message-box middle mix move narrower '+ - 'navy ne-resize no-close-quote none no-open-quote no-repeat normal nowrap n-resize nw-resize oblique olive once open-quote outset '+ - 'outside overline pointer portrait pre print projection purple red relative repeat repeat-x repeat-y rgb ridge right right-side '+ - 'rightwards rtl run-in screen scroll semi-condensed semi-expanded separate se-resize show silent silver slower slow '+ - 'small small-caps small-caption smaller soft solid speech spell-out square s-resize static status-bar sub super sw-resize '+ - 'table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group teal '+ - 'text-bottom text-top thick thin top transparent tty tv ultra-condensed ultra-expanded underline upper-alpha uppercase upper-latin '+ - 'upper-roman url visible wait white wider w-resize x-fast x-high x-large x-loud x-low x-slow x-small x-soft xx-large xx-small yellow'; - - var fonts = '[mM]onospace [tT]ahoma [vV]erdana [aA]rial [hH]elvetica [sS]ans-serif [sS]erif [cC]ourier mono sans serif'; - - this.regexList = [ - { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments - { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings - { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings - { regex: /\#[a-fA-F0-9]{3,6}/g, css: 'value' }, // html colors - { regex: /(-?\d+)(\.\d+)?(px|em|pt|\:|\%|)/g, css: 'value' }, // sizes - { regex: /!important/g, css: 'color3' }, // !important - { regex: new RegExp(getKeywordsCSS(keywords), 'gm'), css: 'keyword' }, // keywords - { regex: new RegExp(getValuesCSS(values), 'g'), css: 'value' }, // values - { regex: new RegExp(this.getKeywords(fonts), 'g'), css: 'color1' } // fonts - ]; - - this.forHtmlScript({ - left: /(<|<)\s*style.*?(>|>)/gi, - right: /(<|<)\/\s*style\s*(>|>)/gi - }); - }; - - Brush.prototype = new SyntaxHighlighter.Highlighter(); - Brush.aliases = ['css']; - - SyntaxHighlighter.brushes.CSS = Brush; - - // CommonJS - typeof(exports) != 'undefined' ? exports.Brush = Brush : null; -})(); diff --git a/doc/design/js/hl/shBrushDelphi.js b/doc/design/js/hl/shBrushDelphi.js deleted file mode 100644 index e1060d446..000000000 --- a/doc/design/js/hl/shBrushDelphi.js +++ /dev/null @@ -1,55 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/SyntaxHighlighter - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/SyntaxHighlighter/donate.html - * - * @version - * 3.0.83 (July 02 2010) - * - * @copyright - * Copyright (C) 2004-2010 Alex Gorbatchev. - * - * @license - * Dual licensed under the MIT and GPL licenses. - */ -;(function() -{ - // CommonJS - typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; - - function Brush() - { - var keywords = 'abs addr and ansichar ansistring array as asm begin boolean byte cardinal ' + - 'case char class comp const constructor currency destructor div do double ' + - 'downto else end except exports extended false file finalization finally ' + - 'for function goto if implementation in inherited int64 initialization ' + - 'integer interface is label library longint longword mod nil not object ' + - 'of on or packed pansichar pansistring pchar pcurrency pdatetime pextended ' + - 'pint64 pointer private procedure program property pshortstring pstring ' + - 'pvariant pwidechar pwidestring protected public published raise real real48 ' + - 'record repeat set shl shortint shortstring shr single smallint string then ' + - 'threadvar to true try type unit until uses val var varirnt while widechar ' + - 'widestring with word write writeln xor'; - - this.regexList = [ - { regex: /\(\*[\s\S]*?\*\)/gm, css: 'comments' }, // multiline comments (* *) - { regex: /{(?!\$)[\s\S]*?}/gm, css: 'comments' }, // multiline comments { } - { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line - { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings - { regex: /\{\$[a-zA-Z]+ .+\}/g, css: 'color1' }, // compiler Directives and Region tags - { regex: /\b[\d\.]+\b/g, css: 'value' }, // numbers 12345 - { regex: /\$[a-zA-Z0-9]+\b/g, css: 'value' }, // numbers $F5D3 - { regex: new RegExp(this.getKeywords(keywords), 'gmi'), css: 'keyword' } // keyword - ]; - }; - - Brush.prototype = new SyntaxHighlighter.Highlighter(); - Brush.aliases = ['delphi', 'pascal', 'pas']; - - SyntaxHighlighter.brushes.Delphi = Brush; - - // CommonJS - typeof(exports) != 'undefined' ? exports.Brush = Brush : null; -})(); diff --git a/doc/design/js/hl/shBrushDiff.js b/doc/design/js/hl/shBrushDiff.js deleted file mode 100644 index e9b14fc58..000000000 --- a/doc/design/js/hl/shBrushDiff.js +++ /dev/null @@ -1,41 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/SyntaxHighlighter - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/SyntaxHighlighter/donate.html - * - * @version - * 3.0.83 (July 02 2010) - * - * @copyright - * Copyright (C) 2004-2010 Alex Gorbatchev. - * - * @license - * Dual licensed under the MIT and GPL licenses. - */ -;(function() -{ - // CommonJS - typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; - - function Brush() - { - this.regexList = [ - { regex: /^\+\+\+.*$/gm, css: 'color2' }, - { regex: /^\-\-\-.*$/gm, css: 'color2' }, - { regex: /^\s.*$/gm, css: 'color1' }, - { regex: /^@@.*@@$/gm, css: 'variable' }, - { regex: /^\+[^\+]{1}.*$/gm, css: 'string' }, - { regex: /^\-[^\-]{1}.*$/gm, css: 'comments' } - ]; - }; - - Brush.prototype = new SyntaxHighlighter.Highlighter(); - Brush.aliases = ['diff', 'patch']; - - SyntaxHighlighter.brushes.Diff = Brush; - - // CommonJS - typeof(exports) != 'undefined' ? exports.Brush = Brush : null; -})(); diff --git a/doc/design/js/hl/shBrushErlang.js b/doc/design/js/hl/shBrushErlang.js deleted file mode 100644 index 6ba7d9da8..000000000 --- a/doc/design/js/hl/shBrushErlang.js +++ /dev/null @@ -1,52 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/SyntaxHighlighter - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/SyntaxHighlighter/donate.html - * - * @version - * 3.0.83 (July 02 2010) - * - * @copyright - * Copyright (C) 2004-2010 Alex Gorbatchev. - * - * @license - * Dual licensed under the MIT and GPL licenses. - */ -;(function() -{ - // CommonJS - typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; - - function Brush() - { - // Contributed by Jean-Lou Dupont - // http://jldupont.blogspot.com/2009/06/erlang-syntax-highlighter.html - - // According to: http://erlang.org/doc/reference_manual/introduction.html#1.5 - var keywords = 'after and andalso band begin bnot bor bsl bsr bxor '+ - 'case catch cond div end fun if let not of or orelse '+ - 'query receive rem try when xor'+ - // additional - ' module export import define'; - - this.regexList = [ - { regex: new RegExp("[A-Z][A-Za-z0-9_]+", 'g'), css: 'constants' }, - { regex: new RegExp("\\%.+", 'gm'), css: 'comments' }, - { regex: new RegExp("\\?[A-Za-z0-9_]+", 'g'), css: 'preprocessor' }, - { regex: new RegExp("[a-z0-9_]+:[a-z0-9_]+", 'g'), css: 'functions' }, - { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, - { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, - { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } - ]; - }; - - Brush.prototype = new SyntaxHighlighter.Highlighter(); - Brush.aliases = ['erl', 'erlang']; - - SyntaxHighlighter.brushes.Erland = Brush; - - // CommonJS - typeof(exports) != 'undefined' ? exports.Brush = Brush : null; -})(); diff --git a/doc/design/js/hl/shBrushGroovy.js b/doc/design/js/hl/shBrushGroovy.js deleted file mode 100644 index 6ec5c1852..000000000 --- a/doc/design/js/hl/shBrushGroovy.js +++ /dev/null @@ -1,67 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/SyntaxHighlighter - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/SyntaxHighlighter/donate.html - * - * @version - * 3.0.83 (July 02 2010) - * - * @copyright - * Copyright (C) 2004-2010 Alex Gorbatchev. - * - * @license - * Dual licensed under the MIT and GPL licenses. - */ -;(function() -{ - // CommonJS - typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; - - function Brush() - { - // Contributed by Andres Almiray - // http://jroller.com/aalmiray/entry/nice_source_code_syntax_highlighter - - var keywords = 'as assert break case catch class continue def default do else extends finally ' + - 'if in implements import instanceof interface new package property return switch ' + - 'throw throws try while public protected private static'; - var types = 'void boolean byte char short int long float double'; - var constants = 'null'; - var methods = 'allProperties count get size '+ - 'collect each eachProperty eachPropertyName eachWithIndex find findAll ' + - 'findIndexOf grep inject max min reverseEach sort ' + - 'asImmutable asSynchronized flatten intersect join pop reverse subMap toList ' + - 'padRight padLeft contains eachMatch toCharacter toLong toUrl tokenize ' + - 'eachFile eachFileRecurse eachB yte eachLine readBytes readLine getText ' + - 'splitEachLine withReader append encodeBase64 decodeBase64 filterLine ' + - 'transformChar transformLine withOutputStream withPrintWriter withStream ' + - 'withStreams withWriter withWriterAppend write writeLine '+ - 'dump inspect invokeMethod print println step times upto use waitForOrKill '+ - 'getText'; - - this.regexList = [ - { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments - { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments - { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings - { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings - { regex: /""".*"""/g, css: 'string' }, // GStrings - { regex: new RegExp('\\b([\\d]+(\\.[\\d]+)?|0x[a-f0-9]+)\\b', 'gi'), css: 'value' }, // numbers - { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // goovy keyword - { regex: new RegExp(this.getKeywords(types), 'gm'), css: 'color1' }, // goovy/java type - { regex: new RegExp(this.getKeywords(constants), 'gm'), css: 'constants' }, // constants - { regex: new RegExp(this.getKeywords(methods), 'gm'), css: 'functions' } // methods - ]; - - this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags); - } - - Brush.prototype = new SyntaxHighlighter.Highlighter(); - Brush.aliases = ['groovy']; - - SyntaxHighlighter.brushes.Groovy = Brush; - - // CommonJS - typeof(exports) != 'undefined' ? exports.Brush = Brush : null; -})(); diff --git a/doc/design/js/hl/shBrushJScript.js b/doc/design/js/hl/shBrushJScript.js deleted file mode 100644 index ff98daba1..000000000 --- a/doc/design/js/hl/shBrushJScript.js +++ /dev/null @@ -1,52 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/SyntaxHighlighter - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/SyntaxHighlighter/donate.html - * - * @version - * 3.0.83 (July 02 2010) - * - * @copyright - * Copyright (C) 2004-2010 Alex Gorbatchev. - * - * @license - * Dual licensed under the MIT and GPL licenses. - */ -;(function() -{ - // CommonJS - typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; - - function Brush() - { - var keywords = 'break case catch continue ' + - 'default delete do else false ' + - 'for function if in instanceof ' + - 'new null return super switch ' + - 'this throw true try typeof var while with' - ; - - var r = SyntaxHighlighter.regexLib; - - this.regexList = [ - { regex: r.multiLineDoubleQuotedString, css: 'string' }, // double quoted strings - { regex: r.multiLineSingleQuotedString, css: 'string' }, // single quoted strings - { regex: r.singleLineCComments, css: 'comments' }, // one line comments - { regex: r.multiLineCComments, css: 'comments' }, // multiline comments - { regex: /\s*#.*/gm, css: 'preprocessor' }, // preprocessor tags like #region and #endregion - { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // keywords - ]; - - this.forHtmlScript(r.scriptScriptTags); - }; - - Brush.prototype = new SyntaxHighlighter.Highlighter(); - Brush.aliases = ['js', 'jscript', 'javascript']; - - SyntaxHighlighter.brushes.JScript = Brush; - - // CommonJS - typeof(exports) != 'undefined' ? exports.Brush = Brush : null; -})(); diff --git a/doc/design/js/hl/shBrushJava.js b/doc/design/js/hl/shBrushJava.js deleted file mode 100644 index d692fd638..000000000 --- a/doc/design/js/hl/shBrushJava.js +++ /dev/null @@ -1,57 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/SyntaxHighlighter - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/SyntaxHighlighter/donate.html - * - * @version - * 3.0.83 (July 02 2010) - * - * @copyright - * Copyright (C) 2004-2010 Alex Gorbatchev. - * - * @license - * Dual licensed under the MIT and GPL licenses. - */ -;(function() -{ - // CommonJS - typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; - - function Brush() - { - var keywords = 'abstract assert boolean break byte case catch char class const ' + - 'continue default do double else enum extends ' + - 'false final finally float for goto if implements import ' + - 'instanceof int interface long native new null ' + - 'package private protected public return ' + - 'short static strictfp super switch synchronized this throw throws true ' + - 'transient try void volatile while'; - - this.regexList = [ - { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments - { regex: /\/\*([^\*][\s\S]*)?\*\//gm, css: 'comments' }, // multiline comments - { regex: /\/\*(?!\*\/)\*[\s\S]*?\*\//gm, css: 'preprocessor' }, // documentation comments - { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings - { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings - { regex: /\b([\d]+(\.[\d]+)?|0x[a-f0-9]+)\b/gi, css: 'value' }, // numbers - { regex: /(?!\@interface\b)\@[\$\w]+\b/g, css: 'color1' }, // annotation @anno - { regex: /\@interface\b/g, css: 'color2' }, // @interface keyword - { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // java keyword - ]; - - this.forHtmlScript({ - left : /(<|<)%[@!=]?/g, - right : /%(>|>)/g - }); - }; - - Brush.prototype = new SyntaxHighlighter.Highlighter(); - Brush.aliases = ['java']; - - SyntaxHighlighter.brushes.Java = Brush; - - // CommonJS - typeof(exports) != 'undefined' ? exports.Brush = Brush : null; -})(); diff --git a/doc/design/js/hl/shBrushJavaFX.js b/doc/design/js/hl/shBrushJavaFX.js deleted file mode 100644 index 1a150a6ad..000000000 --- a/doc/design/js/hl/shBrushJavaFX.js +++ /dev/null @@ -1,58 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/SyntaxHighlighter - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/SyntaxHighlighter/donate.html - * - * @version - * 3.0.83 (July 02 2010) - * - * @copyright - * Copyright (C) 2004-2010 Alex Gorbatchev. - * - * @license - * Dual licensed under the MIT and GPL licenses. - */ -;(function() -{ - // CommonJS - typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; - - function Brush() - { - // Contributed by Patrick Webster - // http://patrickwebster.blogspot.com/2009/04/javafx-brush-for-syntaxhighlighter.html - var datatypes = 'Boolean Byte Character Double Duration ' - + 'Float Integer Long Number Short String Void' - ; - - var keywords = 'abstract after and as assert at before bind bound break catch class ' - + 'continue def delete else exclusive extends false finally first for from ' - + 'function if import in indexof init insert instanceof into inverse last ' - + 'lazy mixin mod nativearray new not null on or override package postinit ' - + 'protected public public-init public-read replace return reverse sizeof ' - + 'step super then this throw true try tween typeof var where while with ' - + 'attribute let private readonly static trigger' - ; - - this.regexList = [ - { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, - { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, - { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, - { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, - { regex: /(-?\.?)(\b(\d*\.?\d+|\d+\.?\d*)(e[+-]?\d+)?|0x[a-f\d]+)\b\.?/gi, css: 'color2' }, // numbers - { regex: new RegExp(this.getKeywords(datatypes), 'gm'), css: 'variable' }, // datatypes - { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } - ]; - this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags); - }; - - Brush.prototype = new SyntaxHighlighter.Highlighter(); - Brush.aliases = ['jfx', 'javafx']; - - SyntaxHighlighter.brushes.JavaFX = Brush; - - // CommonJS - typeof(exports) != 'undefined' ? exports.Brush = Brush : null; -})(); diff --git a/doc/design/js/hl/shBrushPerl.js b/doc/design/js/hl/shBrushPerl.js deleted file mode 100644 index d94a2e0ec..000000000 --- a/doc/design/js/hl/shBrushPerl.js +++ /dev/null @@ -1,72 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/SyntaxHighlighter - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/SyntaxHighlighter/donate.html - * - * @version - * 3.0.83 (July 02 2010) - * - * @copyright - * Copyright (C) 2004-2010 Alex Gorbatchev. - * - * @license - * Dual licensed under the MIT and GPL licenses. - */ -;(function() -{ - // CommonJS - typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; - - function Brush() - { - // Contributed by David Simmons-Duffin and Marty Kube - - var funcs = - 'abs accept alarm atan2 bind binmode chdir chmod chomp chop chown chr ' + - 'chroot close closedir connect cos crypt defined delete each endgrent ' + - 'endhostent endnetent endprotoent endpwent endservent eof exec exists ' + - 'exp fcntl fileno flock fork format formline getc getgrent getgrgid ' + - 'getgrnam gethostbyaddr gethostbyname gethostent getlogin getnetbyaddr ' + - 'getnetbyname getnetent getpeername getpgrp getppid getpriority ' + - 'getprotobyname getprotobynumber getprotoent getpwent getpwnam getpwuid ' + - 'getservbyname getservbyport getservent getsockname getsockopt glob ' + - 'gmtime grep hex index int ioctl join keys kill lc lcfirst length link ' + - 'listen localtime lock log lstat map mkdir msgctl msgget msgrcv msgsnd ' + - 'oct open opendir ord pack pipe pop pos print printf prototype push ' + - 'quotemeta rand read readdir readline readlink readpipe recv rename ' + - 'reset reverse rewinddir rindex rmdir scalar seek seekdir select semctl ' + - 'semget semop send setgrent sethostent setnetent setpgrp setpriority ' + - 'setprotoent setpwent setservent setsockopt shift shmctl shmget shmread ' + - 'shmwrite shutdown sin sleep socket socketpair sort splice split sprintf ' + - 'sqrt srand stat study substr symlink syscall sysopen sysread sysseek ' + - 'system syswrite tell telldir time times tr truncate uc ucfirst umask ' + - 'undef unlink unpack unshift utime values vec wait waitpid warn write'; - - var keywords = - 'bless caller continue dbmclose dbmopen die do dump else elsif eval exit ' + - 'for foreach goto if import last local my next no our package redo ref ' + - 'require return sub tie tied unless untie until use wantarray while'; - - this.regexList = [ - { regex: new RegExp('#[^!].*$', 'gm'), css: 'comments' }, - { regex: new RegExp('^\\s*#!.*$', 'gm'), css: 'preprocessor' }, // shebang - { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, - { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, - { regex: new RegExp('(\\$|@|%)\\w+', 'g'), css: 'variable' }, - { regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'functions' }, - { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } - ]; - - this.forHtmlScript(SyntaxHighlighter.regexLib.phpScriptTags); - } - - Brush.prototype = new SyntaxHighlighter.Highlighter(); - Brush.aliases = ['perl', 'Perl', 'pl']; - - SyntaxHighlighter.brushes.Perl = Brush; - - // CommonJS - typeof(exports) != 'undefined' ? exports.Brush = Brush : null; -})(); diff --git a/doc/design/js/hl/shBrushPhp.js b/doc/design/js/hl/shBrushPhp.js deleted file mode 100644 index 95e6e4325..000000000 --- a/doc/design/js/hl/shBrushPhp.js +++ /dev/null @@ -1,88 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/SyntaxHighlighter - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/SyntaxHighlighter/donate.html - * - * @version - * 3.0.83 (July 02 2010) - * - * @copyright - * Copyright (C) 2004-2010 Alex Gorbatchev. - * - * @license - * Dual licensed under the MIT and GPL licenses. - */ -;(function() -{ - // CommonJS - typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; - - function Brush() - { - var funcs = 'abs acos acosh addcslashes addslashes ' + - 'array_change_key_case array_chunk array_combine array_count_values array_diff '+ - 'array_diff_assoc array_diff_key array_diff_uassoc array_diff_ukey array_fill '+ - 'array_filter array_flip array_intersect array_intersect_assoc array_intersect_key '+ - 'array_intersect_uassoc array_intersect_ukey array_key_exists array_keys array_map '+ - 'array_merge array_merge_recursive array_multisort array_pad array_pop array_product '+ - 'array_push array_rand array_reduce array_reverse array_search array_shift '+ - 'array_slice array_splice array_sum array_udiff array_udiff_assoc '+ - 'array_udiff_uassoc array_uintersect array_uintersect_assoc '+ - 'array_uintersect_uassoc array_unique array_unshift array_values array_walk '+ - 'array_walk_recursive atan atan2 atanh base64_decode base64_encode base_convert '+ - 'basename bcadd bccomp bcdiv bcmod bcmul bindec bindtextdomain bzclose bzcompress '+ - 'bzdecompress bzerrno bzerror bzerrstr bzflush bzopen bzread bzwrite ceil chdir '+ - 'checkdate checkdnsrr chgrp chmod chop chown chr chroot chunk_split class_exists '+ - 'closedir closelog copy cos cosh count count_chars date decbin dechex decoct '+ - 'deg2rad delete ebcdic2ascii echo empty end ereg ereg_replace eregi eregi_replace error_log '+ - 'error_reporting escapeshellarg escapeshellcmd eval exec exit exp explode extension_loaded '+ - 'feof fflush fgetc fgetcsv fgets fgetss file_exists file_get_contents file_put_contents '+ - 'fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype '+ - 'floatval flock floor flush fmod fnmatch fopen fpassthru fprintf fputcsv fputs fread fscanf '+ - 'fseek fsockopen fstat ftell ftok getallheaders getcwd getdate getenv gethostbyaddr gethostbyname '+ - 'gethostbynamel getimagesize getlastmod getmxrr getmygid getmyinode getmypid getmyuid getopt '+ - 'getprotobyname getprotobynumber getrandmax getrusage getservbyname getservbyport gettext '+ - 'gettimeofday gettype glob gmdate gmmktime ini_alter ini_get ini_get_all ini_restore ini_set '+ - 'interface_exists intval ip2long is_a is_array is_bool is_callable is_dir is_double '+ - 'is_executable is_file is_finite is_float is_infinite is_int is_integer is_link is_long '+ - 'is_nan is_null is_numeric is_object is_readable is_real is_resource is_scalar is_soap_fault '+ - 'is_string is_subclass_of is_uploaded_file is_writable is_writeable mkdir mktime nl2br '+ - 'parse_ini_file parse_str parse_url passthru pathinfo print readlink realpath rewind rewinddir rmdir '+ - 'round str_ireplace str_pad str_repeat str_replace str_rot13 str_shuffle str_split '+ - 'str_word_count strcasecmp strchr strcmp strcoll strcspn strftime strip_tags stripcslashes '+ - 'stripos stripslashes stristr strlen strnatcasecmp strnatcmp strncasecmp strncmp strpbrk '+ - 'strpos strptime strrchr strrev strripos strrpos strspn strstr strtok strtolower strtotime '+ - 'strtoupper strtr strval substr substr_compare'; - - var keywords = 'abstract and array as break case catch cfunction class clone const continue declare default die do ' + - 'else elseif enddeclare endfor endforeach endif endswitch endwhile extends final for foreach ' + - 'function include include_once global goto if implements interface instanceof namespace new ' + - 'old_function or private protected public return require require_once static switch ' + - 'throw try use var while xor '; - - var constants = '__FILE__ __LINE__ __METHOD__ __FUNCTION__ __CLASS__'; - - this.regexList = [ - { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments - { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments - { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings - { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings - { regex: /\$\w+/g, css: 'variable' }, // variables - { regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'functions' }, // common functions - { regex: new RegExp(this.getKeywords(constants), 'gmi'), css: 'constants' }, // constants - { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // keyword - ]; - - this.forHtmlScript(SyntaxHighlighter.regexLib.phpScriptTags); - }; - - Brush.prototype = new SyntaxHighlighter.Highlighter(); - Brush.aliases = ['php']; - - SyntaxHighlighter.brushes.Php = Brush; - - // CommonJS - typeof(exports) != 'undefined' ? exports.Brush = Brush : null; -})(); diff --git a/doc/design/js/hl/shBrushPlain.js b/doc/design/js/hl/shBrushPlain.js deleted file mode 100644 index 9f7d9e90c..000000000 --- a/doc/design/js/hl/shBrushPlain.js +++ /dev/null @@ -1,33 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/SyntaxHighlighter - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/SyntaxHighlighter/donate.html - * - * @version - * 3.0.83 (July 02 2010) - * - * @copyright - * Copyright (C) 2004-2010 Alex Gorbatchev. - * - * @license - * Dual licensed under the MIT and GPL licenses. - */ -;(function() -{ - // CommonJS - typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; - - function Brush() - { - }; - - Brush.prototype = new SyntaxHighlighter.Highlighter(); - Brush.aliases = ['text', 'plain']; - - SyntaxHighlighter.brushes.Plain = Brush; - - // CommonJS - typeof(exports) != 'undefined' ? exports.Brush = Brush : null; -})(); diff --git a/doc/design/js/hl/shBrushPowerShell.js b/doc/design/js/hl/shBrushPowerShell.js deleted file mode 100644 index 0be175296..000000000 --- a/doc/design/js/hl/shBrushPowerShell.js +++ /dev/null @@ -1,74 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/SyntaxHighlighter - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/SyntaxHighlighter/donate.html - * - * @version - * 3.0.83 (July 02 2010) - * - * @copyright - * Copyright (C) 2004-2010 Alex Gorbatchev. - * - * @license - * Dual licensed under the MIT and GPL licenses. - */ -;(function() -{ - // CommonJS - typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; - - function Brush() - { - // Contributes by B.v.Zanten, Getronics - // http://confluence.atlassian.com/display/CONFEXT/New+Code+Macro - - var keywords = 'Add-Content Add-History Add-Member Add-PSSnapin Clear(-Content)? Clear-Item ' + - 'Clear-ItemProperty Clear-Variable Compare-Object ConvertFrom-SecureString Convert-Path ' + - 'ConvertTo-Html ConvertTo-SecureString Copy(-Item)? Copy-ItemProperty Export-Alias ' + - 'Export-Clixml Export-Console Export-Csv ForEach(-Object)? Format-Custom Format-List ' + - 'Format-Table Format-Wide Get-Acl Get-Alias Get-AuthenticodeSignature Get-ChildItem Get-Command ' + - 'Get-Content Get-Credential Get-Culture Get-Date Get-EventLog Get-ExecutionPolicy ' + - 'Get-Help Get-History Get-Host Get-Item Get-ItemProperty Get-Location Get-Member ' + - 'Get-PfxCertificate Get-Process Get-PSDrive Get-PSProvider Get-PSSnapin Get-Service ' + - 'Get-TraceSource Get-UICulture Get-Unique Get-Variable Get-WmiObject Group-Object ' + - 'Import-Alias Import-Clixml Import-Csv Invoke-Expression Invoke-History Invoke-Item ' + - 'Join-Path Measure-Command Measure-Object Move(-Item)? Move-ItemProperty New-Alias ' + - 'New-Item New-ItemProperty New-Object New-PSDrive New-Service New-TimeSpan ' + - 'New-Variable Out-Default Out-File Out-Host Out-Null Out-Printer Out-String Pop-Location ' + - 'Push-Location Read-Host Remove-Item Remove-ItemProperty Remove-PSDrive Remove-PSSnapin ' + - 'Remove-Variable Rename-Item Rename-ItemProperty Resolve-Path Restart-Service Resume-Service ' + - 'Select-Object Select-String Set-Acl Set-Alias Set-AuthenticodeSignature Set-Content ' + - 'Set-Date Set-ExecutionPolicy Set-Item Set-ItemProperty Set-Location Set-PSDebug ' + - 'Set-Service Set-TraceSource Set(-Variable)? Sort-Object Split-Path Start-Service ' + - 'Start-Sleep Start-Transcript Stop-Process Stop-Service Stop-Transcript Suspend-Service ' + - 'Tee-Object Test-Path Trace-Command Update-FormatData Update-TypeData Where(-Object)? ' + - 'Write-Debug Write-Error Write(-Host)? Write-Output Write-Progress Write-Verbose Write-Warning'; - var alias = 'ac asnp clc cli clp clv cpi cpp cvpa diff epal epcsv fc fl ' + - 'ft fw gal gc gci gcm gdr ghy gi gl gm gp gps group gsv ' + - 'gsnp gu gv gwmi iex ihy ii ipal ipcsv mi mp nal ndr ni nv oh rdr ' + - 'ri rni rnp rp rsnp rv rvpa sal sasv sc select si sl sleep sort sp ' + - 'spps spsv sv tee cat cd cp h history kill lp ls ' + - 'mount mv popd ps pushd pwd r rm rmdir echo cls chdir del dir ' + - 'erase rd ren type % \\?'; - - this.regexList = [ - { regex: /#.*$/gm, css: 'comments' }, // one line comments - { regex: /\$[a-zA-Z0-9]+\b/g, css: 'value' }, // variables $Computer1 - { regex: /\-[a-zA-Z]+\b/g, css: 'keyword' }, // Operators -not -and -eq - { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings - { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings - { regex: new RegExp(this.getKeywords(keywords), 'gmi'), css: 'keyword' }, - { regex: new RegExp(this.getKeywords(alias), 'gmi'), css: 'keyword' } - ]; - }; - - Brush.prototype = new SyntaxHighlighter.Highlighter(); - Brush.aliases = ['powershell', 'ps']; - - SyntaxHighlighter.brushes.PowerShell = Brush; - - // CommonJS - typeof(exports) != 'undefined' ? exports.Brush = Brush : null; -})(); diff --git a/doc/design/js/hl/shBrushPython.js b/doc/design/js/hl/shBrushPython.js deleted file mode 100644 index ce7746297..000000000 --- a/doc/design/js/hl/shBrushPython.js +++ /dev/null @@ -1,64 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/SyntaxHighlighter - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/SyntaxHighlighter/donate.html - * - * @version - * 3.0.83 (July 02 2010) - * - * @copyright - * Copyright (C) 2004-2010 Alex Gorbatchev. - * - * @license - * Dual licensed under the MIT and GPL licenses. - */ -;(function() -{ - // CommonJS - typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; - - function Brush() - { - // Contributed by Gheorghe Milas and Ahmad Sherif - - var keywords = 'and assert break class continue def del elif else ' + - 'except exec finally for from global if import in is ' + - 'lambda not or pass print raise return try yield while'; - - var funcs = '__import__ abs all any apply basestring bin bool buffer callable ' + - 'chr classmethod cmp coerce compile complex delattr dict dir ' + - 'divmod enumerate eval execfile file filter float format frozenset ' + - 'getattr globals hasattr hash help hex id input int intern ' + - 'isinstance issubclass iter len list locals long map max min next ' + - 'object oct open ord pow print property range raw_input reduce ' + - 'reload repr reversed round set setattr slice sorted staticmethod ' + - 'str sum super tuple type type unichr unicode vars xrange zip'; - - var special = 'None True False self cls class_'; - - this.regexList = [ - { regex: SyntaxHighlighter.regexLib.singleLinePerlComments, css: 'comments' }, - { regex: /^\s*@\w+/gm, css: 'decorator' }, - { regex: /(['\"]{3})([^\1])*?\1/gm, css: 'comments' }, - { regex: /"(?!")(?:\.|\\\"|[^\""\n])*"/gm, css: 'string' }, - { regex: /'(?!')(?:\.|(\\\')|[^\''\n])*'/gm, css: 'string' }, - { regex: /\+|\-|\*|\/|\%|=|==/gm, css: 'keyword' }, - { regex: /\b\d+\.?\w*/g, css: 'value' }, - { regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'functions' }, - { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, - { regex: new RegExp(this.getKeywords(special), 'gm'), css: 'color1' } - ]; - - this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags); - }; - - Brush.prototype = new SyntaxHighlighter.Highlighter(); - Brush.aliases = ['py', 'python']; - - SyntaxHighlighter.brushes.Python = Brush; - - // CommonJS - typeof(exports) != 'undefined' ? exports.Brush = Brush : null; -})(); diff --git a/doc/design/js/hl/shBrushRuby.js b/doc/design/js/hl/shBrushRuby.js deleted file mode 100644 index ff82130a7..000000000 --- a/doc/design/js/hl/shBrushRuby.js +++ /dev/null @@ -1,55 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/SyntaxHighlighter - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/SyntaxHighlighter/donate.html - * - * @version - * 3.0.83 (July 02 2010) - * - * @copyright - * Copyright (C) 2004-2010 Alex Gorbatchev. - * - * @license - * Dual licensed under the MIT and GPL licenses. - */ -;(function() -{ - // CommonJS - typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; - - function Brush() - { - // Contributed by Erik Peterson. - - var keywords = 'alias and BEGIN begin break case class def define_method defined do each else elsif ' + - 'END end ensure false for if in module new next nil not or raise redo rescue retry return ' + - 'self super then throw true undef unless until when while yield'; - - var builtins = 'Array Bignum Binding Class Continuation Dir Exception FalseClass File::Stat File Fixnum Fload ' + - 'Hash Integer IO MatchData Method Module NilClass Numeric Object Proc Range Regexp String Struct::TMS Symbol ' + - 'ThreadGroup Thread Time TrueClass'; - - this.regexList = [ - { regex: SyntaxHighlighter.regexLib.singleLinePerlComments, css: 'comments' }, // one line comments - { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings - { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings - { regex: /\b[A-Z0-9_]+\b/g, css: 'constants' }, // constants - { regex: /:[a-z][A-Za-z0-9_]*/g, css: 'color2' }, // symbols - { regex: /(\$|@@|@)\w+/g, css: 'variable bold' }, // $global, @instance, and @@class variables - { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords - { regex: new RegExp(this.getKeywords(builtins), 'gm'), css: 'color1' } // builtins - ]; - - this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags); - }; - - Brush.prototype = new SyntaxHighlighter.Highlighter(); - Brush.aliases = ['ruby', 'rails', 'ror', 'rb']; - - SyntaxHighlighter.brushes.Ruby = Brush; - - // CommonJS - typeof(exports) != 'undefined' ? exports.Brush = Brush : null; -})(); diff --git a/doc/design/js/hl/shBrushSass.js b/doc/design/js/hl/shBrushSass.js deleted file mode 100644 index aa04da099..000000000 --- a/doc/design/js/hl/shBrushSass.js +++ /dev/null @@ -1,94 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/SyntaxHighlighter - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/SyntaxHighlighter/donate.html - * - * @version - * 3.0.83 (July 02 2010) - * - * @copyright - * Copyright (C) 2004-2010 Alex Gorbatchev. - * - * @license - * Dual licensed under the MIT and GPL licenses. - */ -;(function() -{ - // CommonJS - typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; - - function Brush() - { - function getKeywordsCSS(str) - { - return '\\b([a-z_]|)' + str.replace(/ /g, '(?=:)\\b|\\b([a-z_\\*]|\\*|)') + '(?=:)\\b'; - }; - - function getValuesCSS(str) - { - return '\\b' + str.replace(/ /g, '(?!-)(?!:)\\b|\\b()') + '\:\\b'; - }; - - var keywords = 'ascent azimuth background-attachment background-color background-image background-position ' + - 'background-repeat background baseline bbox border-collapse border-color border-spacing border-style border-top ' + - 'border-right border-bottom border-left border-top-color border-right-color border-bottom-color border-left-color ' + - 'border-top-style border-right-style border-bottom-style border-left-style border-top-width border-right-width ' + - 'border-bottom-width border-left-width border-width border bottom cap-height caption-side centerline clear clip color ' + - 'content counter-increment counter-reset cue-after cue-before cue cursor definition-src descent direction display ' + - 'elevation empty-cells float font-size-adjust font-family font-size font-stretch font-style font-variant font-weight font ' + - 'height left letter-spacing line-height list-style-image list-style-position list-style-type list-style margin-top ' + - 'margin-right margin-bottom margin-left margin marker-offset marks mathline max-height max-width min-height min-width orphans ' + - 'outline-color outline-style outline-width outline overflow padding-top padding-right padding-bottom padding-left padding page ' + - 'page-break-after page-break-before page-break-inside pause pause-after pause-before pitch pitch-range play-during position ' + - 'quotes right richness size slope src speak-header speak-numeral speak-punctuation speak speech-rate stemh stemv stress ' + - 'table-layout text-align top text-decoration text-indent text-shadow text-transform unicode-bidi unicode-range units-per-em ' + - 'vertical-align visibility voice-family volume white-space widows width widths word-spacing x-height z-index'; - - var values = 'above absolute all always aqua armenian attr aural auto avoid baseline behind below bidi-override black blink block blue bold bolder '+ - 'both bottom braille capitalize caption center center-left center-right circle close-quote code collapse compact condensed '+ - 'continuous counter counters crop cross crosshair cursive dashed decimal decimal-leading-zero digits disc dotted double '+ - 'embed embossed e-resize expanded extra-condensed extra-expanded fantasy far-left far-right fast faster fixed format fuchsia '+ - 'gray green groove handheld hebrew help hidden hide high higher icon inline-table inline inset inside invert italic '+ - 'justify landscape large larger left-side left leftwards level lighter lime line-through list-item local loud lower-alpha '+ - 'lowercase lower-greek lower-latin lower-roman lower low ltr marker maroon medium message-box middle mix move narrower '+ - 'navy ne-resize no-close-quote none no-open-quote no-repeat normal nowrap n-resize nw-resize oblique olive once open-quote outset '+ - 'outside overline pointer portrait pre print projection purple red relative repeat repeat-x repeat-y rgb ridge right right-side '+ - 'rightwards rtl run-in screen scroll semi-condensed semi-expanded separate se-resize show silent silver slower slow '+ - 'small small-caps small-caption smaller soft solid speech spell-out square s-resize static status-bar sub super sw-resize '+ - 'table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group teal '+ - 'text-bottom text-top thick thin top transparent tty tv ultra-condensed ultra-expanded underline upper-alpha uppercase upper-latin '+ - 'upper-roman url visible wait white wider w-resize x-fast x-high x-large x-loud x-low x-slow x-small x-soft xx-large xx-small yellow'; - - var fonts = '[mM]onospace [tT]ahoma [vV]erdana [aA]rial [hH]elvetica [sS]ans-serif [sS]erif [cC]ourier mono sans serif'; - - var statements = '!important !default'; - var preprocessor = '@import @extend @debug @warn @if @for @while @mixin @include'; - - var r = SyntaxHighlighter.regexLib; - - this.regexList = [ - { regex: r.multiLineCComments, css: 'comments' }, // multiline comments - { regex: r.singleLineCComments, css: 'comments' }, // singleline comments - { regex: r.doubleQuotedString, css: 'string' }, // double quoted strings - { regex: r.singleQuotedString, css: 'string' }, // single quoted strings - { regex: /\#[a-fA-F0-9]{3,6}/g, css: 'value' }, // html colors - { regex: /\b(-?\d+)(\.\d+)?(px|em|pt|\:|\%|)\b/g, css: 'value' }, // sizes - { regex: /\$\w+/g, css: 'variable' }, // variables - { regex: new RegExp(this.getKeywords(statements), 'g'), css: 'color3' }, // statements - { regex: new RegExp(this.getKeywords(preprocessor), 'g'), css: 'preprocessor' }, // preprocessor - { regex: new RegExp(getKeywordsCSS(keywords), 'gm'), css: 'keyword' }, // keywords - { regex: new RegExp(getValuesCSS(values), 'g'), css: 'value' }, // values - { regex: new RegExp(this.getKeywords(fonts), 'g'), css: 'color1' } // fonts - ]; - }; - - Brush.prototype = new SyntaxHighlighter.Highlighter(); - Brush.aliases = ['sass', 'scss']; - - SyntaxHighlighter.brushes.Sass = Brush; - - // CommonJS - typeof(exports) != 'undefined' ? exports.Brush = Brush : null; -})(); diff --git a/doc/design/js/hl/shBrushScala.js b/doc/design/js/hl/shBrushScala.js deleted file mode 100644 index 4b0b6f04d..000000000 --- a/doc/design/js/hl/shBrushScala.js +++ /dev/null @@ -1,51 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/SyntaxHighlighter - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/SyntaxHighlighter/donate.html - * - * @version - * 3.0.83 (July 02 2010) - * - * @copyright - * Copyright (C) 2004-2010 Alex Gorbatchev. - * - * @license - * Dual licensed under the MIT and GPL licenses. - */ -;(function() -{ - // CommonJS - typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; - - function Brush() - { - // Contributed by Yegor Jbanov and David Bernard. - - var keywords = 'val sealed case def true trait implicit forSome import match object null finally super ' + - 'override try lazy for var catch throw type extends class while with new final yield abstract ' + - 'else do if return protected private this package false'; - - var keyops = '[_:=><%#@]+'; - - this.regexList = [ - { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments - { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments - { regex: SyntaxHighlighter.regexLib.multiLineSingleQuotedString, css: 'string' }, // multi-line strings - { regex: SyntaxHighlighter.regexLib.multiLineDoubleQuotedString, css: 'string' }, // double-quoted string - { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings - { regex: /0x[a-f0-9]+|\d+(\.\d+)?/gi, css: 'value' }, // numbers - { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords - { regex: new RegExp(keyops, 'gm'), css: 'keyword' } // scala keyword - ]; - } - - Brush.prototype = new SyntaxHighlighter.Highlighter(); - Brush.aliases = ['scala']; - - SyntaxHighlighter.brushes.Scala = Brush; - - // CommonJS - typeof(exports) != 'undefined' ? exports.Brush = Brush : null; -})(); diff --git a/doc/design/js/hl/shBrushSql.js b/doc/design/js/hl/shBrushSql.js deleted file mode 100644 index 5c2cd8806..000000000 --- a/doc/design/js/hl/shBrushSql.js +++ /dev/null @@ -1,66 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/SyntaxHighlighter - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/SyntaxHighlighter/donate.html - * - * @version - * 3.0.83 (July 02 2010) - * - * @copyright - * Copyright (C) 2004-2010 Alex Gorbatchev. - * - * @license - * Dual licensed under the MIT and GPL licenses. - */ -;(function() -{ - // CommonJS - typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; - - function Brush() - { - var funcs = 'abs avg case cast coalesce convert count current_timestamp ' + - 'current_user day isnull left lower month nullif replace right ' + - 'session_user space substring sum system_user upper user year'; - - var keywords = 'absolute action add after alter as asc at authorization begin bigint ' + - 'binary bit by cascade char character check checkpoint close collate ' + - 'column commit committed connect connection constraint contains continue ' + - 'create cube current current_date current_time cursor database date ' + - 'deallocate dec decimal declare default delete desc distinct double drop ' + - 'dynamic else end end-exec escape except exec execute false fetch first ' + - 'float for force foreign forward free from full function global goto grant ' + - 'group grouping having hour ignore index inner insensitive insert instead ' + - 'int integer intersect into is isolation key last level load local max min ' + - 'minute modify move name national nchar next no numeric of off on only ' + - 'open option order out output partial password precision prepare primary ' + - 'prior privileges procedure public read real references relative repeatable ' + - 'restrict return returns revoke rollback rollup rows rule schema scroll ' + - 'second section select sequence serializable set size smallint static ' + - 'statistics table temp temporary then time timestamp to top transaction ' + - 'translation trigger true truncate uncommitted union unique update values ' + - 'varchar varying view when where with work'; - - var operators = 'all and any between cross in join like not null or outer some'; - - this.regexList = [ - { regex: /--(.*)$/gm, css: 'comments' }, // one line and multiline comments - { regex: SyntaxHighlighter.regexLib.multiLineDoubleQuotedString, css: 'string' }, // double quoted strings - { regex: SyntaxHighlighter.regexLib.multiLineSingleQuotedString, css: 'string' }, // single quoted strings - { regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'color2' }, // functions - { regex: new RegExp(this.getKeywords(operators), 'gmi'), css: 'color1' }, // operators and such - { regex: new RegExp(this.getKeywords(keywords), 'gmi'), css: 'keyword' } // keyword - ]; - }; - - Brush.prototype = new SyntaxHighlighter.Highlighter(); - Brush.aliases = ['sql']; - - SyntaxHighlighter.brushes.Sql = Brush; - - // CommonJS - typeof(exports) != 'undefined' ? exports.Brush = Brush : null; -})(); - diff --git a/doc/design/js/hl/shBrushVb.js b/doc/design/js/hl/shBrushVb.js deleted file mode 100644 index be845dc0b..000000000 --- a/doc/design/js/hl/shBrushVb.js +++ /dev/null @@ -1,56 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/SyntaxHighlighter - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/SyntaxHighlighter/donate.html - * - * @version - * 3.0.83 (July 02 2010) - * - * @copyright - * Copyright (C) 2004-2010 Alex Gorbatchev. - * - * @license - * Dual licensed under the MIT and GPL licenses. - */ -;(function() -{ - // CommonJS - typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; - - function Brush() - { - var keywords = 'AddHandler AddressOf AndAlso Alias And Ansi As Assembly Auto ' + - 'Boolean ByRef Byte ByVal Call Case Catch CBool CByte CChar CDate ' + - 'CDec CDbl Char CInt Class CLng CObj Const CShort CSng CStr CType ' + - 'Date Decimal Declare Default Delegate Dim DirectCast Do Double Each ' + - 'Else ElseIf End Enum Erase Error Event Exit False Finally For Friend ' + - 'Function Get GetType GoSub GoTo Handles If Implements Imports In ' + - 'Inherits Integer Interface Is Let Lib Like Long Loop Me Mod Module ' + - 'MustInherit MustOverride MyBase MyClass Namespace New Next Not Nothing ' + - 'NotInheritable NotOverridable Object On Option Optional Or OrElse ' + - 'Overloads Overridable Overrides ParamArray Preserve Private Property ' + - 'Protected Public RaiseEvent ReadOnly ReDim REM RemoveHandler Resume ' + - 'Return Select Set Shadows Shared Short Single Static Step Stop String ' + - 'Structure Sub SyncLock Then Throw To True Try TypeOf Unicode Until ' + - 'Variant When While With WithEvents WriteOnly Xor'; - - this.regexList = [ - { regex: /'.*$/gm, css: 'comments' }, // one line comments - { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings - { regex: /^\s*#.*$/gm, css: 'preprocessor' }, // preprocessor tags like #region and #endregion - { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // vb keyword - ]; - - this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags); - }; - - Brush.prototype = new SyntaxHighlighter.Highlighter(); - Brush.aliases = ['vb', 'vbnet']; - - SyntaxHighlighter.brushes.Vb = Brush; - - // CommonJS - typeof(exports) != 'undefined' ? exports.Brush = Brush : null; -})(); diff --git a/doc/design/js/hl/shBrushXml.js b/doc/design/js/hl/shBrushXml.js deleted file mode 100644 index 69d9fd0b1..000000000 --- a/doc/design/js/hl/shBrushXml.js +++ /dev/null @@ -1,69 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/SyntaxHighlighter - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/SyntaxHighlighter/donate.html - * - * @version - * 3.0.83 (July 02 2010) - * - * @copyright - * Copyright (C) 2004-2010 Alex Gorbatchev. - * - * @license - * Dual licensed under the MIT and GPL licenses. - */ -;(function() -{ - // CommonJS - typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; - - function Brush() - { - function process(match, regexInfo) - { - var constructor = SyntaxHighlighter.Match, - code = match[0], - tag = new XRegExp('(<|<)[\\s\\/\\?]*(?[:\\w-\\.]+)', 'xg').exec(code), - result = [] - ; - - if (match.attributes != null) - { - var attributes, - regex = new XRegExp('(? [\\w:\\-\\.]+)' + - '\\s*=\\s*' + - '(? ".*?"|\'.*?\'|\\w+)', - 'xg'); - - while ((attributes = regex.exec(code)) != null) - { - result.push(new constructor(attributes.name, match.index + attributes.index, 'color1')); - result.push(new constructor(attributes.value, match.index + attributes.index + attributes[0].indexOf(attributes.value), 'string')); - } - } - - if (tag != null) - result.push( - new constructor(tag.name, match.index + tag[0].indexOf(tag.name), 'keyword') - ); - - return result; - } - - this.regexList = [ - { regex: new XRegExp('(\\<|<)\\!\\[[\\w\\s]*?\\[(.|\\s)*?\\]\\](\\>|>)', 'gm'), css: 'color2' }, // - { regex: SyntaxHighlighter.regexLib.xmlComments, css: 'comments' }, // - { regex: new XRegExp('(<|<)[\\s\\/\\?]*(\\w+)(?.*?)[\\s\\/\\?]*(>|>)', 'sg'), func: process } - ]; - }; - - Brush.prototype = new SyntaxHighlighter.Highlighter(); - Brush.aliases = ['xml', 'xhtml', 'xslt', 'html']; - - SyntaxHighlighter.brushes.Xml = Brush; - - // CommonJS - typeof(exports) != 'undefined' ? exports.Brush = Brush : null; -})(); diff --git a/doc/design/js/hl/shCore.js b/doc/design/js/hl/shCore.js deleted file mode 100644 index b47b64547..000000000 --- a/doc/design/js/hl/shCore.js +++ /dev/null @@ -1,17 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/SyntaxHighlighter - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/SyntaxHighlighter/donate.html - * - * @version - * 3.0.83 (July 02 2010) - * - * @copyright - * Copyright (C) 2004-2010 Alex Gorbatchev. - * - * @license - * Dual licensed under the MIT and GPL licenses. - */ -eval(function(p,a,c,k,e,d){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('K M;I(M)1S 2U("2a\'t 4k M 4K 2g 3l 4G 4H");(6(){6 r(f,e){I(!M.1R(f))1S 3m("3s 15 4R");K a=f.1w;f=M(f.1m,t(f)+(e||""));I(a)f.1w={1m:a.1m,19:a.19?a.19.1a(0):N};H f}6 t(f){H(f.1J?"g":"")+(f.4s?"i":"")+(f.4p?"m":"")+(f.4v?"x":"")+(f.3n?"y":"")}6 B(f,e,a,b){K c=u.L,d,h,g;v=R;5K{O(;c--;){g=u[c];I(a&g.3r&&(!g.2p||g.2p.W(b))){g.2q.12=e;I((h=g.2q.X(f))&&h.P===e){d={3k:g.2b.W(b,h,a),1C:h};1N}}}}5v(i){1S i}5q{v=11}H d}6 p(f,e,a){I(3b.Z.1i)H f.1i(e,a);O(a=a||0;a-1},3d:6(g){e+=g}};c1&&p(e,"")>-1){a=15(J.1m,n.Q.W(t(J),"g",""));n.Q.W(f.1a(e.P),a,6(){O(K c=1;c<14.L-2;c++)I(14[c]===1d)e[c]=1d})}I(J.1w&&J.1w.19)O(K b=1;be.P&&J.12--}H e};I(!D)15.Z.1A=6(f){(f=n.X.W(J,f))&&J.1J&&!f[0].L&&J.12>f.P&&J.12--;H!!f};1r.Z.1C=6(f){M.1R(f)||(f=15(f));I(f.1J){K e=n.1C.1p(J,14);f.12=0;H e}H f.X(J)};1r.Z.Q=6(f,e){K a=M.1R(f),b,c;I(a&&1j e.58()==="3f"&&e.1i("${")===-1&&y)H n.Q.1p(J,14);I(a){I(f.1w)b=f.1w.19}Y f+="";I(1j e==="6")c=n.Q.W(J,f,6(){I(b){14[0]=1f 1r(14[0]);O(K d=0;dd.L-3;){i=1r.Z.1a.W(g,-1)+i;g=1Q.3i(g/10)}H(g?d[g]||"":"$")+i}Y{g=+i;I(g<=d.L-3)H d[g];g=b?p(b,i):-1;H g>-1?d[g+1]:h}})})}I(a&&f.1J)f.12=0;H c};1r.Z.1e=6(f,e){I(!M.1R(f))H n.1e.1p(J,14);K a=J+"",b=[],c=0,d,h;I(e===1d||+e<0)e=5D;Y{e=1Q.3i(+e);I(!e)H[]}O(f=M.3c(f);d=f.X(a);){I(f.12>c){b.U(a.1a(c,d.P));d.L>1&&d.P=e)1N}f.12===d.P&&f.12++}I(c===a.L){I(!n.1A.W(f,"")||h)b.U("")}Y b.U(a.1a(c));H b.L>e?b.1a(0,e):b};M.1h(/\\(\\?#[^)]*\\)/,6(f){H n.1A.W(A,f.2S.1a(f.P+f[0].L))?"":"(?:)"});M.1h(/\\((?!\\?)/,6(){J.19.U(N);H"("});M.1h(/\\(\\?<([$\\w]+)>/,6(f){J.19.U(f[1]);J.2N=R;H"("});M.1h(/\\\\k<([\\w$]+)>/,6(f){K e=p(J.19,f[1]);H e>-1?"\\\\"+(e+1)+(3R(f.2S.3a(f.P+f[0].L))?"":"(?:)"):f[0]});M.1h(/\\[\\^?]/,6(f){H f[0]==="[]"?"\\\\b\\\\B":"[\\\\s\\\\S]"});M.1h(/^\\(\\?([5A]+)\\)/,6(f){J.3d(f[1]);H""});M.1h(/(?:\\s+|#.*)+/,6(f){H n.1A.W(A,f.2S.1a(f.P+f[0].L))?"":"(?:)"},M.1B,6(){H J.2K("x")});M.1h(/\\./,6(){H"[\\\\s\\\\S]"},M.1B,6(){H J.2K("s")})})();1j 2e!="1d"&&(2e.M=M);K 1v=6(){6 r(a,b){a.1l.1i(b)!=-1||(a.1l+=" "+b)}6 t(a){H a.1i("3e")==0?a:"3e"+a}6 B(a){H e.1Y.2A[t(a)]}6 p(a,b,c){I(a==N)H N;K d=c!=R?a.3G:[a.2G],h={"#":"1c",".":"1l"}[b.1o(0,1)]||"3h",g,i;g=h!="3h"?b.1o(1):b.5u();I((a[h]||"").1i(g)!=-1)H a;O(a=0;d&&a\'+c+""});H a}6 n(a,b){a.1e("\\n");O(K c="",d=0;d<50;d++)c+=" ";H a=v(a,6(h){I(h.1i("\\t")==-1)H h;O(K g=0;(g=h.1i("\\t"))!=-1;)h=h.1o(0,g)+c.1o(0,b-g%b)+h.1o(g+1,h.L);H h})}6 x(a){H a.Q(/^\\s+|\\s+$/g,"")}6 D(a,b){I(a.Pb.P)H 1;Y I(a.Lb.L)H 1;H 0}6 y(a,b){6 c(k){H k[0]}O(K d=N,h=[],g=b.2D?b.2D:c;(d=b.1I.X(a))!=N;){K i=g(d,b);I(1j i=="3f")i=[1f e.2L(i,d.P,b.23)];h=h.1O(i)}H h}6 E(a){K b=/(.*)((&1G;|&1y;).*)/;H a.Q(e.3A.3M,6(c){K d="",h=N;I(h=b.X(c)){c=h[1];d=h[2]}H\'\'+c+""+d})}6 z(){O(K a=1E.36("1k"),b=[],c=0;c<1z 4I="1Z://2y.3L.3K/4L/5L"><3J><4N 1Z-4M="5G-5M" 6K="2O/1z; 6J=6I-8" /><1t>6L 1v<3B 1L="25-6M:6Q,6P,6O,6N-6F;6y-2f:#6x;2f:#6w;25-22:6v;2O-3D:3C;">1v3v 3.0.76 (72 73 3x)1Z://3u.2w/1v70 17 6U 71.6T 6X-3x 6Y 6D.6t 61 60 J 1k, 5Z 5R 5V <2R/>5U 5T 5S!\'}},1Y:{2j:N,2A:{}},1U:{},3A:{6n:/\\/\\*[\\s\\S]*?\\*\\//2c,6m:/\\/\\/.*$/2c,6l:/#.*$/2c,6k:/"([^\\\\"\\n]|\\\\.)*"/g,6o:/\'([^\\\\\'\\n]|\\\\.)*\'/g,6p:1f M(\'"([^\\\\\\\\"]|\\\\\\\\.)*"\',"3z"),6s:1f M("\'([^\\\\\\\\\']|\\\\\\\\.)*\'","3z"),6q:/(&1y;|<)!--[\\s\\S]*?--(&1G;|>)/2c,3M:/\\w+:\\/\\/[\\w-.\\/?%&=:@;]*/g,6a:{18:/(&1y;|<)\\?=?/g,1b:/\\?(&1G;|>)/g},69:{18:/(&1y;|<)%=?/g,1b:/%(&1G;|>)/g},6d:{18:/(&1y;|<)\\s*1k.*?(&1G;|>)/2T,1b:/(&1y;|<)\\/\\s*1k\\s*(&1G;|>)/2T}},16:{1H:6(a){6 b(i,k){H e.16.2o(i,k,e.13.1x[k])}O(K c=\'\',d=e.16.2x,h=d.2X,g=0;g";H c},2o:6(a,b,c){H\'<2W>\'+c+""},2b:6(a){K b=a.1F,c=b.1l||"";b=B(p(b,".20",R).1c);K d=6(h){H(h=15(h+"6f(\\\\w+)").X(c))?h[1]:N}("6g");b&&d&&e.16.2x[d].2B(b);a.3N()},2x:{2X:["21","2P"],21:{1H:6(a){I(a.V("2l")!=R)H"";K b=a.V("1t");H e.16.2o(a,"21",b?b:e.13.1x.21)},2B:6(a){a=1E.6j(t(a.1c));a.1l=a.1l.Q("47","")}},2P:{2B:6(){K a="68=0";a+=", 18="+(31.30-33)/2+", 32="+(31.2Z-2Y)/2+", 30=33, 2Z=2Y";a=a.Q(/^,/,"");a=1P.6Z("","38",a);a.2C();K b=a.1E;b.6W(e.13.1x.37);b.6V();a.2C()}}}},35:6(a,b){K c;I(b)c=[b];Y{c=1E.36(e.13.34);O(K d=[],h=0;h(.*?))\\\\]$"),s=1f M("(?<27>[\\\\w-]+)\\\\s*:\\\\s*(?<1T>[\\\\w-%#]+|\\\\[.*?\\\\]|\\".*?\\"|\'.*?\')\\\\s*;?","g");(j=s.X(k))!=N;){K o=j.1T.Q(/^[\'"]|[\'"]$/g,"");I(o!=N&&m.1A(o)){o=m.X(o);o=o.2V.L>0?o.2V.1e(/\\s*,\\s*/):[]}l[j.27]=o}g={1F:g,1n:C(i,l)};g.1n.1D!=N&&d.U(g)}H d},1M:6(a,b){K c=J.35(a,b),d=N,h=e.13;I(c.L!==0)O(K g=0;g")==o-3){m=m.4h(0,o-3);s=R}l=s?m:l}I((i.1t||"")!="")k.1t=i.1t;k.1D=j;d.2Q(k);b=d.2F(l);I((i.1c||"")!="")b.1c=i.1c;i.2G.74(b,i)}}},2E:6(a){w(1P,"4k",6(){e.1M(a)})}};e.2E=e.2E;e.1M=e.1M;e.2L=6(a,b,c){J.1T=a;J.P=b;J.L=a.L;J.23=c;J.1V=N};e.2L.Z.1q=6(){H J.1T};e.4l=6(a){6 b(j,l){O(K m=0;md)1N;Y I(g.P==c.P&&g.L>c.L)a[b]=N;Y I(g.P>=c.P&&g.P\'+c+""},3Q:6(a,b){K c="",d=a.1e("\\n").L,h=2u(J.V("2i-1s")),g=J.V("2z-1s-2t");I(g==R)g=(h+d-1).1q().L;Y I(3R(g)==R)g=0;O(K i=0;i\'+j+"":"")+i)}H a},4f:6(a){H a?"<4a>"+a+"":""},4b:6(a,b){6 c(l){H(l=l?l.1V||g:g)?l+" ":""}O(K d=0,h="",g=J.V("1D",""),i=0;i|&1y;2R\\s*\\/?&1G;/2T;I(e.13.46==R)b=b.Q(h,"\\n");I(e.13.44==R)b=b.Q(h,"");b=b.1e("\\n");h=/^\\s*/;g=4Q;O(K i=0;i0;i++){K k=b[i];I(x(k).L!=0){k=h.X(k);I(k==N){a=a;1N a}g=1Q.4q(k[0].L,g)}}I(g>0)O(i=0;i\'+(J.V("16")?e.16.1H(J):"")+\'<3Z 5z="0" 5H="0" 5J="0">\'+J.4f(J.V("1t"))+"<3T><3P>"+(1u?\'<2d 1g="1u">\'+J.3Q(a)+"":"")+\'<2d 1g="17">\'+b+""},2F:6(a){I(a===N)a="";J.17=a;K b=J.3Y("T");b.3X=J.1H(a);J.V("16")&&w(p(b,".16"),"5c",e.16.2b);J.V("3V-17")&&w(p(b,".17"),"56",f);H b},2Q:6(a){J.1c=""+1Q.5d(1Q.5n()*5k).1q();e.1Y.2A[t(J.1c)]=J;J.1n=C(e.2v,a||{});I(J.V("2k")==R)J.1n.16=J.1n.1u=11},5j:6(a){a=a.Q(/^\\s+|\\s+$/g,"").Q(/\\s+/g,"|");H"\\\\b(?:"+a+")\\\\b"},5f:6(a){J.28={18:{1I:a.18,23:"1k"},1b:{1I:a.1b,23:"1k"},17:1f M("(?<18>"+a.18.1m+")(?<17>.*?)(?<1b>"+a.1b.1m+")","5o")}}};H e}();1j 2e!="1d"&&(2e.1v=1v);',62,441,'||||||function|||||||||||||||||||||||||||||||||||||return|if|this|var|length|XRegExp|null|for|index|replace|true||div|push|getParam|call|exec|else|prototype||false|lastIndex|config|arguments|RegExp|toolbar|code|left|captureNames|slice|right|id|undefined|split|new|class|addToken|indexOf|typeof|script|className|source|params|substr|apply|toString|String|line|title|gutter|SyntaxHighlighter|_xregexp|strings|lt|html|test|OUTSIDE_CLASS|match|brush|document|target|gt|getHtml|regex|global|join|style|highlight|break|concat|window|Math|isRegExp|throw|value|brushes|brushName|space|alert|vars|http|syntaxhighlighter|expandSource|size|css|case|font|Fa|name|htmlScript|dA|can|handler|gm|td|exports|color|in|href|first|discoveredBrushes|light|collapse|object|cache|getButtonHtml|trigger|pattern|getLineHtml|nbsp|numbers|parseInt|defaults|com|items|www|pad|highlighters|execute|focus|func|all|getDiv|parentNode|navigator|INSIDE_CLASS|regexList|hasFlag|Match|useScriptTags|hasNamedCapture|text|help|init|br|input|gi|Error|values|span|list|250|height|width|screen|top|500|tagName|findElements|getElementsByTagName|aboutDialog|_blank|appendChild|charAt|Array|copyAsGlobal|setFlag|highlighter_|string|attachEvent|nodeName|floor|backref|output|the|TypeError|sticky|Za|iterate|freezeTokens|scope|type|textarea|alexgorbatchev|version|margin|2010|005896|gs|regexLib|body|center|align|noBrush|require|childNodes|DTD|xhtml1|head|org|w3|url|preventDefault|container|tr|getLineNumbersHtml|isNaN|userAgent|tbody|isLineHighlighted|quick|void|innerHTML|create|table|links|auto|smart|tab|stripBrs|tabs|bloggerMode|collapsed|plain|getCodeLinesHtml|caption|getMatchesHtml|findMatches|figureOutLineNumbers|removeNestedMatches|getTitleHtml|brushNotHtmlScript|substring|createElement|Highlighter|load|HtmlScript|Brush|pre|expand|multiline|min|Can|ignoreCase|find|blur|extended|toLowerCase|aliases|addEventListener|innerText|textContent|wasn|select|createTextNode|removeChild|option|same|frame|xmlns|dtd|twice|1999|equiv|meta|htmlscript|transitional|1E3|expected|PUBLIC|DOCTYPE|on|W3C|XHTML|TR|EN|Transitional||configured|srcElement|Object|after|run|dblclick|matchChain|valueOf|constructor|default|switch|click|round|execAt|forHtmlScript|token|gimy|functions|getKeywords|1E6|escape|within|random|sgi|another|finally|supply|MSIE|ie|toUpperCase|catch|returnValue|definition|event|border|imsx|constructing|one|Infinity|from|when|Content|cellpadding|flags|cellspacing|try|xhtml|Type|spaces|2930402|hosted_button_id|lastIndexOf|donate|active|development|keep|to|xclick|_s|Xml|please|like|you|paypal|cgi|cmd|webscr|bin|highlighted|scrollbars|aspScriptTags|phpScriptTags|sort|max|scriptScriptTags|toolbar_item|_|command|command_|number|getElementById|doubleQuotedString|singleLinePerlComments|singleLineCComments|multiLineCComments|singleQuotedString|multiLineDoubleQuotedString|xmlComments|alt|multiLineSingleQuotedString|If|https|1em|000|fff|background|5em|xx|bottom|75em|Gorbatchev|large|serif|CDATA|continue|utf|charset|content|About|family|sans|Helvetica|Arial|Geneva|3em|nogutter|Copyright|syntax|close|write|2004|Alex|open|JavaScript|highlighter|July|02|replaceChild|offset|83'.split('|'),0,{})) diff --git a/doc/design/js/hl/shLegacy.js b/doc/design/js/hl/shLegacy.js deleted file mode 100644 index 6d9fd4d19..000000000 --- a/doc/design/js/hl/shLegacy.js +++ /dev/null @@ -1,17 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/SyntaxHighlighter - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/SyntaxHighlighter/donate.html - * - * @version - * 3.0.83 (July 02 2010) - * - * @copyright - * Copyright (C) 2004-2010 Alex Gorbatchev. - * - * @license - * Dual licensed under the MIT and GPL licenses. - */ -eval(function(p,a,c,k,e,d){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('3 u={8:{}};u.8={A:4(c,k,l,m,n,o){4 d(a,b){2 a!=1?a:b}4 f(a){2 a!=1?a.E():1}c=c.I(":");3 g=c[0],e={};t={"r":K};M=1;5=8.5;9(3 j R c)e[c[j]]="r";k=f(d(k,5.C));l=f(d(l,5.D));m=f(d(m,5.s));o=f(d(o,5.Q));n=f(d(n,5["x-y"]));2{P:g,C:d(t[e.O],k),D:d(t[e.N],l),s:d({"r":r}[e.s],m),"x-y":d(4(a,b){9(3 h=T S("^"+b+"\\\\[(?\\\\w+)\\\\]$","U"),i=1,p=0;p'; - return parent.insertBefore(p.lastChild, parent.firstChild); - } - - /** - * Returns the value of `html5.elements` as an array. - * @private - * @returns {Array} An array of shived element node names. - */ - function getElements() { - var elements = html5.elements; - return typeof elements == 'string' ? elements.split(' ') : elements; - } - - /** - * Shivs the `createElement` and `createDocumentFragment` methods of the document. - * @private - * @param {Document|DocumentFragment} ownerDocument The document. - */ - function shivMethods(ownerDocument) { - var nodeName, - cache = {}, - docCreateElement = ownerDocument.createElement, - docCreateFragment = ownerDocument.createDocumentFragment, - elements = getElements(), - frag = docCreateFragment(), - index = elements.length; - - function createDocumentFragment() { - var node = frag.cloneNode(false); - return html5.shivMethods ? (shivMethods(node), node) : node; - } - - function createElement(nodeName) { - // avoid shiving elements like button, iframe, input, and textarea - // because IE < 9 cannot set the `name` or `type` attributes of an - // element once it's inserted into a document - var node = (cache[nodeName] || (cache[nodeName] = docCreateElement(nodeName))).cloneNode(false); - return html5.shivMethods && !reSkip.test(nodeName) ? frag.appendChild(node) : node; - } - - while (index--) { - nodeName = elements[index]; - cache[nodeName] = docCreateElement(nodeName); - frag.createElement(nodeName); - } - ownerDocument.createElement = createElement; - ownerDocument.createDocumentFragment = createDocumentFragment; - } - - /*--------------------------------------------------------------------------*/ - - /** - * Shivs the given document. - * @memberOf html5 - * @param {Document} ownerDocument The document to shiv. - * @returns {Document} The shived document. - */ - function shivDocument(ownerDocument) { - var shived; - if (ownerDocument.documentShived) { - return ownerDocument; - } - if (html5.shivCSS && !supportsHtml5Styles) { - shived = !!addStyleSheet(ownerDocument, - // corrects block display not defined in IE6/7/8/9 - 'article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}' + - // corrects audio display not defined in IE6/7/8/9 - 'audio{display:none}' + - // corrects canvas and video display not defined in IE6/7/8/9 - 'canvas,video{display:inline-block;*display:inline;*zoom:1}' + - // corrects 'hidden' attribute and audio[controls] display not present in IE7/8/9 - '[hidden]{display:none}audio[controls]{display:inline-block;*display:inline;*zoom:1}' + - // adds styling not present in IE6/7/8/9 - 'mark{background:#FF0;color:#000}' - ); - } - if (html5.shivMethods && !supportsUnknownElements) { - shived = !shivMethods(ownerDocument); - } - if (shived) { - ownerDocument.documentShived = shived; - } - return ownerDocument; - } - - /*--------------------------------------------------------------------------*/ - - /** - * The `html5` object is exposed so that more elements can be shived and - * existing shiving can be detected on iframes. - * @type Object - * @example - * - * // options can be changed before the script is included - * html5 = { 'elements': 'mark section', 'shivCSS': false, 'shivMethods': false }; - */ - var html5 = { - - /** - * An array or space separated string of node names of the elements to shiv. - * @memberOf html5 - * @type Array|String - */ - 'elements': options.elements || 'abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video'.split(' '), - - /** - * A flag to indicate that the HTML5 style sheet should be inserted. - * @memberOf html5 - * @type Boolean - */ - 'shivCSS': !(options.shivCSS === false), - - /** - * A flag to indicate that the document's `createElement` and `createDocumentFragment` - * methods should be overwritten. - * @memberOf html5 - * @type Boolean - */ - 'shivMethods': !(options.shivMethods === false), - - /** - * A string to describe the type of `html5` object ("default" or "default print"). - * @memberOf html5 - * @type String - */ - 'type': 'default', - - // shivs the document according to the specified `html5` object options - 'shivDocument': shivDocument - }; - - /*--------------------------------------------------------------------------*/ - - // expose html5 - window.html5 = html5; - - // shiv the document - shivDocument(document); - -}(this, document)); \ No newline at end of file diff --git a/doc/design/js/javascript.js b/doc/design/js/javascript.js deleted file mode 100644 index b9388bc9e..000000000 --- a/doc/design/js/javascript.js +++ /dev/null @@ -1,360 +0,0 @@ -CodeMirror.defineMode("javascript", function(config, parserConfig) { - var indentUnit = config.indentUnit; - var jsonMode = parserConfig.json; - - // Tokenizer - - var keywords = function(){ - function kw(type) {return {type: type, style: "keyword"};} - var A = kw("keyword a"), B = kw("keyword b"), C = kw("keyword c"); - var operator = kw("operator"), atom = {type: "atom", style: "atom"}; - return { - "if": A, "while": A, "with": A, "else": B, "do": B, "try": B, "finally": B, - "return": C, "break": C, "continue": C, "new": C, "delete": C, "throw": C, - "var": kw("var"), "const": kw("var"), "let": kw("var"), - "function": kw("function"), "catch": kw("catch"), - "for": kw("for"), "switch": kw("switch"), "case": kw("case"), "default": kw("default"), - "in": operator, "typeof": operator, "instanceof": operator, - "true": atom, "false": atom, "null": atom, "undefined": atom, "NaN": atom, "Infinity": atom - }; - }(); - - var isOperatorChar = /[+\-*&%=<>!?|]/; - - function chain(stream, state, f) { - state.tokenize = f; - return f(stream, state); - } - - function nextUntilUnescaped(stream, end) { - var escaped = false, next; - while ((next = stream.next()) != null) { - if (next == end && !escaped) - return false; - escaped = !escaped && next == "\\"; - } - return escaped; - } - - // Used as scratch variables to communicate multiple values without - // consing up tons of objects. - var type, content; - function ret(tp, style, cont) { - type = tp; content = cont; - return style; - } - - function jsTokenBase(stream, state) { - var ch = stream.next(); - if (ch == '"' || ch == "'") - return chain(stream, state, jsTokenString(ch)); - else if (/[\[\]{}\(\),;\:\.]/.test(ch)) - return ret(ch); - else if (ch == "0" && stream.eat(/x/i)) { - stream.eatWhile(/[\da-f]/i); - return ret("number", "number"); - } - else if (/\d/.test(ch)) { - stream.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/); - return ret("number", "number"); - } - else if (ch == "/") { - if (stream.eat("*")) { - return chain(stream, state, jsTokenComment); - } - else if (stream.eat("/")) { - stream.skipToEnd(); - return ret("comment", "comment"); - } - else if (state.reAllowed) { - nextUntilUnescaped(stream, "/"); - stream.eatWhile(/[gimy]/); // 'y' is "sticky" option in Mozilla - return ret("regexp", "string-2"); - } - else { - stream.eatWhile(isOperatorChar); - return ret("operator", null, stream.current()); - } - } - else if (ch == "#") { - stream.skipToEnd(); - return ret("error", "error"); - } - else if (isOperatorChar.test(ch)) { - stream.eatWhile(isOperatorChar); - return ret("operator", null, stream.current()); - } - else { - stream.eatWhile(/[\w\$_]/); - var word = stream.current(), known = keywords.propertyIsEnumerable(word) && keywords[word]; - return (known && state.kwAllowed) ? ret(known.type, known.style, word) : - ret("variable", "variable", word); - } - } - - function jsTokenString(quote) { - return function(stream, state) { - if (!nextUntilUnescaped(stream, quote)) - state.tokenize = jsTokenBase; - return ret("string", "string"); - }; - } - - function jsTokenComment(stream, state) { - var maybeEnd = false, ch; - while (ch = stream.next()) { - if (ch == "/" && maybeEnd) { - state.tokenize = jsTokenBase; - break; - } - maybeEnd = (ch == "*"); - } - return ret("comment", "comment"); - } - - // Parser - - var atomicTypes = {"atom": true, "number": true, "variable": true, "string": true, "regexp": true}; - - function JSLexical(indented, column, type, align, prev, info) { - this.indented = indented; - this.column = column; - this.type = type; - this.prev = prev; - this.info = info; - if (align != null) this.align = align; - } - - function inScope(state, varname) { - for (var v = state.localVars; v; v = v.next) - if (v.name == varname) return true; - } - - function parseJS(state, style, type, content, stream) { - var cc = state.cc; - // Communicate our context to the combinators. - // (Less wasteful than consing up a hundred closures on every call.) - cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc; - - if (!state.lexical.hasOwnProperty("align")) - state.lexical.align = true; - - while(true) { - var combinator = cc.length ? cc.pop() : jsonMode ? expression : statement; - if (combinator(type, content)) { - while(cc.length && cc[cc.length - 1].lex) - cc.pop()(); - if (cx.marked) return cx.marked; - if (type == "variable" && inScope(state, content)) return "variable-2"; - return style; - } - } - } - - // Combinator utils - - var cx = {state: null, column: null, marked: null, cc: null}; - function pass() { - for (var i = arguments.length - 1; i >= 0; i--) cx.cc.push(arguments[i]); - } - function cont() { - pass.apply(null, arguments); - return true; - } - function register(varname) { - var state = cx.state; - if (state.context) { - cx.marked = "def"; - for (var v = state.localVars; v; v = v.next) - if (v.name == varname) return; - state.localVars = {name: varname, next: state.localVars}; - } - } - - // Combinators - - var defaultVars = {name: "this", next: {name: "arguments"}}; - function pushcontext() { - if (!cx.state.context) cx.state.localVars = defaultVars; - cx.state.context = {prev: cx.state.context, vars: cx.state.localVars}; - } - function popcontext() { - cx.state.localVars = cx.state.context.vars; - cx.state.context = cx.state.context.prev; - } - function pushlex(type, info) { - var result = function() { - var state = cx.state; - state.lexical = new JSLexical(state.indented, cx.stream.column(), type, null, state.lexical, info) - }; - result.lex = true; - return result; - } - function poplex() { - var state = cx.state; - if (state.lexical.prev) { - if (state.lexical.type == ")") - state.indented = state.lexical.indented; - state.lexical = state.lexical.prev; - } - } - poplex.lex = true; - - function expect(wanted) { - return function expecting(type) { - if (type == wanted) return cont(); - else if (wanted == ";") return pass(); - else return cont(arguments.callee); - }; - } - - function statement(type) { - if (type == "var") return cont(pushlex("vardef"), vardef1, expect(";"), poplex); - if (type == "keyword a") return cont(pushlex("form"), expression, statement, poplex); - if (type == "keyword b") return cont(pushlex("form"), statement, poplex); - if (type == "{") return cont(pushlex("}"), block, poplex); - if (type == ";") return cont(); - if (type == "function") return cont(functiondef); - if (type == "for") return cont(pushlex("form"), expect("("), pushlex(")"), forspec1, expect(")"), - poplex, statement, poplex); - if (type == "variable") return cont(pushlex("stat"), maybelabel); - if (type == "switch") return cont(pushlex("form"), expression, pushlex("}", "switch"), expect("{"), - block, poplex, poplex); - if (type == "case") return cont(expression, expect(":")); - if (type == "default") return cont(expect(":")); - if (type == "catch") return cont(pushlex("form"), pushcontext, expect("("), funarg, expect(")"), - statement, poplex, popcontext); - return pass(pushlex("stat"), expression, expect(";"), poplex); - } - function expression(type) { - if (atomicTypes.hasOwnProperty(type)) return cont(maybeoperator); - if (type == "function") return cont(functiondef); - if (type == "keyword c") return cont(maybeexpression); - if (type == "(") return cont(pushlex(")"), maybeexpression, expect(")"), poplex, maybeoperator); - if (type == "operator") return cont(expression); - if (type == "[") return cont(pushlex("]"), commasep(expression, "]"), poplex, maybeoperator); - if (type == "{") return cont(pushlex("}"), commasep(objprop, "}"), poplex, maybeoperator); - return cont(); - } - function maybeexpression(type) { - if (type.match(/[;\}\)\],]/)) return pass(); - return pass(expression); - } - - function maybeoperator(type, value) { - if (type == "operator" && /\+\+|--/.test(value)) return cont(maybeoperator); - if (type == "operator") return cont(expression); - if (type == ";") return; - if (type == "(") return cont(pushlex(")"), commasep(expression, ")"), poplex, maybeoperator); - if (type == ".") return cont(property, maybeoperator); - if (type == "[") return cont(pushlex("]"), expression, expect("]"), poplex, maybeoperator); - } - function maybelabel(type) { - if (type == ":") return cont(poplex, statement); - return pass(maybeoperator, expect(";"), poplex); - } - function property(type) { - if (type == "variable") {cx.marked = "property"; return cont();} - } - function objprop(type) { - if (type == "variable") cx.marked = "property"; - if (atomicTypes.hasOwnProperty(type)) return cont(expect(":"), expression); - } - function commasep(what, end) { - function proceed(type) { - if (type == ",") return cont(what, proceed); - if (type == end) return cont(); - return cont(expect(end)); - } - return function commaSeparated(type) { - if (type == end) return cont(); - else return pass(what, proceed); - }; - } - function block(type) { - if (type == "}") return cont(); - return pass(statement, block); - } - function vardef1(type, value) { - if (type == "variable"){register(value); return cont(vardef2);} - return cont(); - } - function vardef2(type, value) { - if (value == "=") return cont(expression, vardef2); - if (type == ",") return cont(vardef1); - } - function forspec1(type) { - if (type == "var") return cont(vardef1, forspec2); - if (type == ";") return pass(forspec2); - if (type == "variable") return cont(formaybein); - return pass(forspec2); - } - function formaybein(type, value) { - if (value == "in") return cont(expression); - return cont(maybeoperator, forspec2); - } - function forspec2(type, value) { - if (type == ";") return cont(forspec3); - if (value == "in") return cont(expression); - return cont(expression, expect(";"), forspec3); - } - function forspec3(type) { - if (type != ")") cont(expression); - } - function functiondef(type, value) { - if (type == "variable") {register(value); return cont(functiondef);} - if (type == "(") return cont(pushlex(")"), pushcontext, commasep(funarg, ")"), poplex, statement, popcontext); - } - function funarg(type, value) { - if (type == "variable") {register(value); return cont();} - } - - // Interface - - return { - startState: function(basecolumn) { - return { - tokenize: jsTokenBase, - reAllowed: true, - kwAllowed: true, - cc: [], - lexical: new JSLexical((basecolumn || 0) - indentUnit, 0, "block", false), - localVars: null, - context: null, - indented: 0 - }; - }, - - token: function(stream, state) { - if (stream.sol()) { - if (!state.lexical.hasOwnProperty("align")) - state.lexical.align = false; - state.indented = stream.indentation(); - } - if (stream.eatSpace()) return null; - var style = state.tokenize(stream, state); - if (type == "comment") return style; - state.reAllowed = type == "operator" || type == "keyword c" || type.match(/^[\[{}\(,;:]$/); - state.kwAllowed = type != '.'; - return parseJS(state, style, type, content, stream); - }, - - indent: function(state, textAfter) { - if (state.tokenize != jsTokenBase) return 0; - var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical, - type = lexical.type, closing = firstChar == type; - if (type == "vardef") return lexical.indented + 4; - else if (type == "form" && firstChar == "{") return lexical.indented; - else if (type == "stat" || type == "form") return lexical.indented + indentUnit; - else if (lexical.info == "switch" && !closing) - return lexical.indented + (/^(?:case|default)\b/.test(textAfter) ? indentUnit : 2 * indentUnit); - else if (lexical.align) return lexical.column + (closing ? 0 : 1); - else return lexical.indented + (closing ? 0 : indentUnit); - }, - - electricChars: ":{}" - }; -}); - -CodeMirror.defineMIME("text/javascript", "javascript"); -CodeMirror.defineMIME("application/json", {name: "javascript", json: true}); diff --git a/doc/design/js/jquery-1.7.1.min.js b/doc/design/js/jquery-1.7.1.min.js deleted file mode 100644 index 198b3ff07..000000000 --- a/doc/design/js/jquery-1.7.1.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery v1.7.1 jquery.com | jquery.org/license */ -(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!ck[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cl||(cl=c.createElement("iframe"),cl.frameBorder=cl.width=cl.height=0),b.appendChild(cl);if(!cm||!cl.createElement)cm=(cl.contentWindow||cl.contentDocument).document,cm.write((c.compatMode==="CSS1Compat"?"":"")+""),cm.close();d=cm.createElement(a),cm.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cl)}ck[a]=e}return ck[a]}function cu(a,b){var c={};f.each(cq.concat.apply([],cq.slice(0,b)),function(){c[this]=a});return c}function ct(){cr=b}function cs(){setTimeout(ct,0);return cr=f.now()}function cj(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ci(){try{return new a.XMLHttpRequest}catch(b){}}function cc(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){if(c!=="border")for(;g=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?parseFloat(d):j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c
a",d=q.getElementsByTagName("*"),e=q.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=q.getElementsByTagName("input")[0],b={leadingWhitespace:q.firstChild.nodeType===3,tbody:!q.getElementsByTagName("tbody").length,htmlSerialize:!!q.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:q.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete q.test}catch(s){b.deleteExpando=!1}!q.addEventListener&&q.attachEvent&&q.fireEvent&&(q.attachEvent("onclick",function(){b.noCloneEvent=!1}),q.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),q.appendChild(i),k=c.createDocumentFragment(),k.appendChild(q.lastChild),b.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,k.removeChild(i),k.appendChild(q),q.innerHTML="",a.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",q.style.width="2px",q.appendChild(j),b.reliableMarginRight=(parseInt((a.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);if(q.attachEvent)for(o in{submit:1,change:1,focusin:1})n="on"+o,p=n in q,p||(q.setAttribute(n,"return;"),p=typeof q[n]=="function"),b[o+"Bubbles"]=p;k.removeChild(q),k=g=h=j=q=i=null,f(function(){var a,d,e,g,h,i,j,k,m,n,o,r=c.getElementsByTagName("body")[0];!r||(j=1,k="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",m="visibility:hidden;border:0;",n="style='"+k+"border:5px solid #000;padding:0;'",o="
"+""+"
",a=c.createElement("div"),a.style.cssText=m+"width:0;height:0;position:static;top:0;margin-top:"+j+"px",r.insertBefore(a,r.firstChild),q=c.createElement("div"),a.appendChild(q),q.innerHTML="
t
",l=q.getElementsByTagName("td"),p=l[0].offsetHeight===0,l[0].style.display="",l[1].style.display="none",b.reliableHiddenOffsets=p&&l[0].offsetHeight===0,q.innerHTML="",q.style.width=q.style.paddingLeft="1px",f.boxModel=b.boxModel=q.offsetWidth===2,typeof q.style.zoom!="undefined"&&(q.style.display="inline",q.style.zoom=1,b.inlineBlockNeedsLayout=q.offsetWidth===2,q.style.display="",q.innerHTML="
",b.shrinkWrapBlocks=q.offsetWidth!==2),q.style.cssText=k+m,q.innerHTML=o,d=q.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,i={doesNotAddBorder:e.offsetTop!==5,doesAddBorderForTableAndCells:h.offsetTop===5},e.style.position="fixed",e.style.top="20px",i.fixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",i.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,i.doesNotIncludeMarginInBodyOffset=r.offsetTop!==j,r.removeChild(a),q=a=null,f.extend(b,i))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;h=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/\bhover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")}; -f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;le&&i.push({elem:this,matches:d.slice(e)});for(j=0;j0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h0)for(h=g;h=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div
","
"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function() -{for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1>");try{for(var c=0,d=this.length;c1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||!bc.test("<"+a.nodeName)?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");b===c?bh.appendChild(o):U(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return br.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bq,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bq.test(g)?g.replace(bq,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,b){var c,d,e;b=b.replace(bs,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b)));return c}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f===null&&g&&(e=g[b])&&(f=e),!bt.test(f)&&bu.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),bz=bA||bB,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bD=/%20/g,bE=/\[\]$/,bF=/\r?\n/g,bG=/#.*$/,bH=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bI=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bJ=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bK=/^(?:GET|HEAD)$/,bL=/^\/\//,bM=/\?/,bN=/)<[^<]*)*<\/script>/gi,bO=/^(?:select|textarea)/i,bP=/\s+/,bQ=/([?&])_=[^&]*/,bR=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bS=f.fn.load,bT={},bU={},bV,bW,bX=["*/"]+["*"];try{bV=e.href}catch(bY){bV=c.createElement("a"),bV.href="",bV=bV.href}bW=bR.exec(bV.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bS)return bS.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
").append(c.replace(bN,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bO.test(this.nodeName)||bI.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bF,"\r\n")}}):{name:b.name,value:c.replace(bF,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b_(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b_(a,b);return a},ajaxSettings:{url:bV,isLocal:bJ.test(bW[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bX},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bZ(bT),ajaxTransport:bZ(bU),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?cb(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cc(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bH.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bG,"").replace(bL,bW[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bP),d.crossDomain==null&&(r=bR.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bW[1]&&r[2]==bW[2]&&(r[3]||(r[1]==="http:"?80:443))==(bW[3]||(bW[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bT,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bK.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bM.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bQ,"$1_="+x);d.url=y+(y===d.url?(bM.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bX+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=b$(bU,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)ca(g,a[g],c,e);return d.join("&").replace(bD,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cd=f.now(),ce=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cd++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ce.test(b.url)||e&&ce.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ce,l),b.url===j&&(e&&(k=k.replace(ce,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cf=a.ActiveXObject?function(){for(var a in ch)ch[a](0,1)}:!1,cg=0,ch;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ci()||cj()}:ci,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cf&&delete ch[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cg,cf&&(ch||(ch={},f(a).unload(cf)),ch[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var ck={},cl,cm,cn=/^(?:toggle|show|hide)$/,co=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cp,cq=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cr;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cu("show",3),a,b,c);for(var g=0,h=this.length;g=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cy(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,d,"padding")):this[d]():null},f.fn["outer"+c]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,d,a?"margin":"border")):this[d]():null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNumeric(j)?j:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window); \ No newline at end of file diff --git a/doc/design/js/jquery-ui-1.8.17.custom.min.js b/doc/design/js/jquery-ui-1.8.17.custom.min.js deleted file mode 100644 index d9112e057..000000000 --- a/doc/design/js/jquery-ui-1.8.17.custom.min.js +++ /dev/null @@ -1,48 +0,0 @@ -/*! - * jQuery UI 1.8.17 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI - */(function(a,b){function d(b){return!a(b).parents().andSelf().filter(function(){return a.curCSS(this,"visibility")==="hidden"||a.expr.filters.hidden(this)}).length}function c(b,c){var e=b.nodeName.toLowerCase();if("area"===e){var f=b.parentNode,g=f.name,h;if(!b.href||!g||f.nodeName.toLowerCase()!=="map")return!1;h=a("img[usemap=#"+g+"]")[0];return!!h&&d(h)}return(/input|select|textarea|button|object/.test(e)?!b.disabled:"a"==e?b.href||c:c)&&d(b)}a.ui=a.ui||{};a.ui.version||(a.extend(a.ui,{version:"1.8.17",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}}),a.fn.extend({propAttr:a.fn.prop||a.fn.attr,_focus:a.fn.focus,focus:function(b,c){return typeof b=="number"?this.each(function(){var d=this;setTimeout(function(){a(d).focus(),c&&c.call(d)},b)}):this._focus.apply(this,arguments)},scrollParent:function(){var b;a.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?b=this.parents().filter(function(){return/(relative|absolute|fixed)/.test(a.curCSS(this,"position",1))&&/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0):b=this.parents().filter(function(){return/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!b.length?a(document):b},zIndex:function(c){if(c!==b)return this.css("zIndex",c);if(this.length){var d=a(this[0]),e,f;while(d.length&&d[0]!==document){e=d.css("position");if(e==="absolute"||e==="relative"||e==="fixed"){f=parseInt(d.css("zIndex"),10);if(!isNaN(f)&&f!==0)return f}d=d.parent()}}return 0},disableSelection:function(){return this.bind((a.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),a.each(["Width","Height"],function(c,d){function h(b,c,d,f){a.each(e,function(){c-=parseFloat(a.curCSS(b,"padding"+this,!0))||0,d&&(c-=parseFloat(a.curCSS(b,"border"+this+"Width",!0))||0),f&&(c-=parseFloat(a.curCSS(b,"margin"+this,!0))||0)});return c}var e=d==="Width"?["Left","Right"]:["Top","Bottom"],f=d.toLowerCase(),g={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};a.fn["inner"+d]=function(c){if(c===b)return g["inner"+d].call(this);return this.each(function(){a(this).css(f,h(this,c)+"px")})},a.fn["outer"+d]=function(b,c){if(typeof b!="number")return g["outer"+d].call(this,b);return this.each(function(){a(this).css(f,h(this,b,!0,c)+"px")})}}),a.extend(a.expr[":"],{data:function(b,c,d){return!!a.data(b,d[3])},focusable:function(b){return c(b,!isNaN(a.attr(b,"tabindex")))},tabbable:function(b){var d=a.attr(b,"tabindex"),e=isNaN(d);return(e||d>=0)&&c(b,!e)}}),a(function(){var b=document.body,c=b.appendChild(c=document.createElement("div"));a.extend(c.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0}),a.support.minHeight=c.offsetHeight===100,a.support.selectstart="onselectstart"in c,b.removeChild(c).style.display="none"}),a.extend(a.ui,{plugin:{add:function(b,c,d){var e=a.ui[b].prototype;for(var f in d)e.plugins[f]=e.plugins[f]||[],e.plugins[f].push([c,d[f]])},call:function(a,b,c){var d=a.plugins[b];if(!!d&&!!a.element[0].parentNode)for(var e=0;e0)return!0;b[d]=1,e=b[d]>0,b[d]=0;return e},isOverAxis:function(a,b,c){return a>b&&a
'))}$.extend($.ui,{datepicker:{version:"1.8.17"}});var PROP_NAME="datepicker",dpuuid=(new Date).getTime(),instActive;$.extend(Datepicker.prototype,{markerClassName:"hasDatepicker",maxRows:4,log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(a){extendRemove(this._defaults,a||{});return this},_attachDatepicker:function(target,settings){var inlineSettings=null;for(var attrName in this._defaults){var attrValue=target.getAttribute("date:"+attrName);if(attrValue){inlineSettings=inlineSettings||{};try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}}var nodeName=target.nodeName.toLowerCase(),inline=nodeName=="div"||nodeName=="span";target.id||(this.uuid+=1,target.id="dp"+this.uuid);var inst=this._newInst($(target),inline);inst.settings=$.extend({},settings||{},inlineSettings||{}),nodeName=="input"?this._connectDatepicker(target,inst):inline&&this._inlineDatepicker(target,inst)},_newInst:function(a,b){var c=a[0].id.replace(/([^A-Za-z0-9_-])/g,"\\\\$1");return{id:c,input:a,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:b,dpDiv:b?bindHover($('
')):this.dpDiv}},_connectDatepicker:function(a,b){var c=$(a);b.append=$([]),b.trigger=$([]);c.hasClass(this.markerClassName)||(this._attachments(c,b),c.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(a,c,d){b.settings[c]=d}).bind("getData.datepicker",function(a,c){return this._get(b,c)}),this._autoSize(b),$.data(a,PROP_NAME,b),b.settings.disabled&&this._disableDatepicker(a))},_attachments:function(a,b){var c=this._get(b,"appendText"),d=this._get(b,"isRTL");b.append&&b.append.remove(),c&&(b.append=$(''+c+""),a[d?"before":"after"](b.append)),a.unbind("focus",this._showDatepicker),b.trigger&&b.trigger.remove();var e=this._get(b,"showOn");(e=="focus"||e=="both")&&a.focus(this._showDatepicker);if(e=="button"||e=="both"){var f=this._get(b,"buttonText"),g=this._get(b,"buttonImage");b.trigger=$(this._get(b,"buttonImageOnly")?$("").addClass(this._triggerClass).attr({src:g,alt:f,title:f}):$('').addClass(this._triggerClass).html(g==""?f:$("").attr({src:g,alt:f,title:f}))),a[d?"before":"after"](b.trigger),b.trigger.click(function(){$.datepicker._datepickerShowing&&$.datepicker._lastInput==a[0]?$.datepicker._hideDatepicker():$.datepicker._showDatepicker(a[0]);return!1})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b=new Date(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var d=function(a){var b=0,c=0;for(var d=0;db&&(b=a[d].length,c=d);return c};b.setMonth(d(this._get(a,c.match(/MM/)?"monthNames":"monthNamesShort"))),b.setDate(d(this._get(a,c.match(/DD/)?"dayNames":"dayNamesShort"))+20-b.getDay())}a.input.attr("size",this._formatDate(a,b).length)}},_inlineDatepicker:function(a,b){var c=$(a);c.hasClass(this.markerClassName)||(c.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker",function(a,c,d){b.settings[c]=d}).bind("getData.datepicker",function(a,c){return this._get(b,c)}),$.data(a,PROP_NAME,b),this._setDate(b,this._getDefaultDate(b),!0),this._updateDatepicker(b),this._updateAlternate(b),b.settings.disabled&&this._disableDatepicker(a),b.dpDiv.css("display","block"))},_dialogDatepicker:function(a,b,c,d,e){var f=this._dialogInst;if(!f){this.uuid+=1;var g="dp"+this.uuid;this._dialogInput=$(''),this._dialogInput.keydown(this._doKeyDown),$("body").append(this._dialogInput),f=this._dialogInst=this._newInst(this._dialogInput,!1),f.settings={},$.data(this._dialogInput[0],PROP_NAME,f)}extendRemove(f.settings,d||{}),b=b&&b.constructor==Date?this._formatDate(f,b):b,this._dialogInput.val(b),this._pos=e?e.length?e:[e.pageX,e.pageY]:null;if(!this._pos){var h=document.documentElement.clientWidth,i=document.documentElement.clientHeight,j=document.documentElement.scrollLeft||document.body.scrollLeft,k=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[h/2-100+j,i/2-150+k]}this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),f.settings.onSelect=c,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),$.blockUI&&$.blockUI(this.dpDiv),$.data(this._dialogInput[0],PROP_NAME,f);return this},_destroyDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!!b.hasClass(this.markerClassName)){var d=a.nodeName.toLowerCase();$.removeData(a,PROP_NAME),d=="input"?(c.append.remove(),c.trigger.remove(),b.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):(d=="div"||d=="span")&&b.removeClass(this.markerClassName).empty()}},_enableDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!!b.hasClass(this.markerClassName)){var d=a.nodeName.toLowerCase();if(d=="input")a.disabled=!1,c.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""});else if(d=="div"||d=="span"){var e=b.children("."+this._inlineClass);e.children().removeClass("ui-state-disabled"),e.find("select.ui-datepicker-month, select.ui-datepicker-year").removeAttr("disabled")}this._disabledInputs=$.map(this._disabledInputs,function(b){return b==a?null:b})}},_disableDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!!b.hasClass(this.markerClassName)){var d=a.nodeName.toLowerCase();if(d=="input")a.disabled=!0,c.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"});else if(d=="div"||d=="span"){var e=b.children("."+this._inlineClass);e.children().addClass("ui-state-disabled"),e.find("select.ui-datepicker-month, select.ui-datepicker-year").attr("disabled","disabled")}this._disabledInputs=$.map(this._disabledInputs,function(b){return b==a?null:b}),this._disabledInputs[this._disabledInputs.length]=a}},_isDisabledDatepicker:function(a){if(!a)return!1;for(var b=0;b-1}},_doKeyUp:function(a){var b=$.datepicker._getInst(a.target);if(b.input.val()!=b.lastVal)try{var c=$.datepicker.parseDate($.datepicker._get(b,"dateFormat"),b.input?b.input.val():null,$.datepicker._getFormatConfig(b));c&&($.datepicker._setDateFromField(b),$.datepicker._updateAlternate(b),$.datepicker._updateDatepicker(b))}catch(a){$.datepicker.log(a)}return!0},_showDatepicker:function(a){a=a.target||a,a.nodeName.toLowerCase()!="input"&&(a=$("input",a.parentNode)[0]);if(!$.datepicker._isDisabledDatepicker(a)&&$.datepicker._lastInput!=a){var b=$.datepicker._getInst(a);$.datepicker._curInst&&$.datepicker._curInst!=b&&($.datepicker._curInst.dpDiv.stop(!0,!0),b&&$.datepicker._datepickerShowing&&$.datepicker._hideDatepicker($.datepicker._curInst.input[0]));var c=$.datepicker._get(b,"beforeShow"),d=c?c.apply(a,[a,b]):{};if(d===!1)return;extendRemove(b.settings,d),b.lastVal=null,$.datepicker._lastInput=a,$.datepicker._setDateFromField(b),$.datepicker._inDialog&&(a.value=""),$.datepicker._pos||($.datepicker._pos=$.datepicker._findPos(a),$.datepicker._pos[1]+=a.offsetHeight);var e=!1;$(a).parents().each(function(){e|=$(this).css("position")=="fixed";return!e}),e&&$.browser.opera&&($.datepicker._pos[0]-=document.documentElement.scrollLeft,$.datepicker._pos[1]-=document.documentElement.scrollTop);var f={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};$.datepicker._pos=null,b.dpDiv.empty(),b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),$.datepicker._updateDatepicker(b),f=$.datepicker._checkOffset(b,f,e),b.dpDiv.css({position:$.datepicker._inDialog&&$.blockUI?"static":e?"fixed":"absolute",display:"none",left:f.left+"px",top:f.top+"px"});if(!b.inline){var g=$.datepicker._get(b,"showAnim"),h=$.datepicker._get(b,"duration"),i=function(){var a=b.dpDiv.find("iframe.ui-datepicker-cover");if(!!a.length){var c=$.datepicker._getBorders(b.dpDiv);a.css({left:-c[0],top:-c[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()})}};b.dpDiv.zIndex($(a).zIndex()+1),$.datepicker._datepickerShowing=!0,$.effects&&$.effects[g]?b.dpDiv.show(g,$.datepicker._get(b,"showOptions"),h,i):b.dpDiv[g||"show"](g?h:null,i),(!g||!h)&&i(),b.input.is(":visible")&&!b.input.is(":disabled")&&b.input.focus(),$.datepicker._curInst=b}}},_updateDatepicker:function(a){var b=this;b.maxRows=4;var c=$.datepicker._getBorders(a.dpDiv);instActive=a,a.dpDiv.empty().append(this._generateHTML(a));var d=a.dpDiv.find("iframe.ui-datepicker-cover");!d.length||d.css({left:-c[0],top:-c[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()}),a.dpDiv.find("."+this._dayOverClass+" a").mouseover();var e=this._getNumberOfMonths(a),f=e[1],g=17;a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),f>1&&a.dpDiv.addClass("ui-datepicker-multi-"+f).css("width",g*f+"em"),a.dpDiv[(e[0]!=1||e[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi"),a.dpDiv[(this._get(a,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),a==$.datepicker._curInst&&$.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&&!a.input.is(":disabled")&&a.input[0]!=document.activeElement&&a.input.focus();if(a.yearshtml){var h=a.yearshtml;setTimeout(function(){h===a.yearshtml&&a.yearshtml&&a.dpDiv.find("select.ui-datepicker-year:first").replaceWith(a.yearshtml),h=a.yearshtml=null},0)}},_getBorders:function(a){var b=function(a){return{thin:1,medium:2,thick:3}[a]||a};return[parseFloat(b(a.css("border-left-width"))),parseFloat(b(a.css("border-top-width")))]},_checkOffset:function(a,b,c){var d=a.dpDiv.outerWidth(),e=a.dpDiv.outerHeight(),f=a.input?a.input.outerWidth():0,g=a.input?a.input.outerHeight():0,h=document.documentElement.clientWidth+$(document).scrollLeft(),i=document.documentElement.clientHeight+$(document).scrollTop();b.left-=this._get(a,"isRTL")?d-f:0,b.left-=c&&b.left==a.input.offset().left?$(document).scrollLeft():0,b.top-=c&&b.top==a.input.offset().top+g?$(document).scrollTop():0,b.left-=Math.min(b.left,b.left+d>h&&h>d?Math.abs(b.left+d-h):0),b.top-=Math.min(b.top,b.top+e>i&&i>e?Math.abs(e+g):0);return b},_findPos:function(a){var b=this._getInst(a),c=this._get(b,"isRTL");while(a&&(a.type=="hidden"||a.nodeType!=1||$.expr.filters.hidden(a)))a=a[c?"previousSibling":"nextSibling"];var d=$(a).offset();return[d.left,d.top]},_hideDatepicker:function(a){var b=this._curInst;if(!(!b||a&&b!=$.data(a,PROP_NAME))&&this._datepickerShowing){var c=this._get(b,"showAnim"),d=this._get(b,"duration"),e=this,f=function(){$.datepicker._tidyDialog(b),e._curInst=null};$.effects&&$.effects[c]?b.dpDiv.hide(c,$.datepicker._get(b,"showOptions"),d,f):b.dpDiv[c=="slideDown"?"slideUp":c=="fadeIn"?"fadeOut":"hide"](c?d:null,f),c||f(),this._datepickerShowing=!1;var g=this._get(b,"onClose");g&&g.apply(b.input?b.input[0]:null,[b.input?b.input.val():"",b]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),$.blockUI&&($.unblockUI(),$("body").append(this.dpDiv))),this._inDialog=!1}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(a){if(!!$.datepicker._curInst){var b=$(a.target),c=$.datepicker._getInst(b[0]);(b[0].id!=$.datepicker._mainDivId&&b.parents("#"+$.datepicker._mainDivId).length==0&&!b.hasClass($.datepicker.markerClassName)&&!b.hasClass($.datepicker._triggerClass)&&$.datepicker._datepickerShowing&&(!$.datepicker._inDialog||!$.blockUI)||b.hasClass($.datepicker.markerClassName)&&$.datepicker._curInst!=c)&&$.datepicker._hideDatepicker()}},_adjustDate:function(a,b,c){var d=$(a),e=this._getInst(d[0]);this._isDisabledDatepicker(d[0])||(this._adjustInstDate(e,b+(c=="M"?this._get(e,"showCurrentAtPos"):0),c),this._updateDatepicker(e))},_gotoToday:function(a){var b=$(a),c=this._getInst(b[0]);if(this._get(c,"gotoCurrent")&&c.currentDay)c.selectedDay=c.currentDay,c.drawMonth=c.selectedMonth=c.currentMonth,c.drawYear=c.selectedYear=c.currentYear;else{var d=new Date;c.selectedDay=d.getDate(),c.drawMonth=c.selectedMonth=d.getMonth(),c.drawYear=c.selectedYear=d.getFullYear()}this._notifyChange(c),this._adjustDate(b)},_selectMonthYear:function(a,b,c){var d=$(a),e=this._getInst(d[0]);e["selected"+(c=="M"?"Month":"Year")]=e["draw"+(c=="M"?"Month":"Year")]=parseInt(b.options[b.selectedIndex].value,10),this._notifyChange(e),this._adjustDate(d)},_selectDay:function(a,b,c,d){var e=$(a);if(!$(d).hasClass(this._unselectableClass)&&!this._isDisabledDatepicker(e[0])){var f=this._getInst(e[0]);f.selectedDay=f.currentDay=$("a",d).html(),f.selectedMonth=f.currentMonth=b,f.selectedYear=f.currentYear=c,this._selectDate(a,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear))}},_clearDate:function(a){var b=$(a),c=this._getInst(b[0]);this._selectDate(b,"")},_selectDate:function(a,b){var c=$(a),d=this._getInst(c[0]);b=b!=null?b:this._formatDate(d),d.input&&d.input.val(b),this._updateAlternate(d);var e=this._get(d,"onSelect");e?e.apply(d.input?d.input[0]:null,[b,d]):d.input&&d.input.trigger("change"),d.inline?this._updateDatepicker(d):(this._hideDatepicker(),this._lastInput=d.input[0],typeof d.input[0]!="object"&&d.input.focus(),this._lastInput=null)},_updateAlternate:function(a){var b=this._get(a,"altField");if(b){var c=this._get(a,"altFormat")||this._get(a,"dateFormat"),d=this._getDate(a),e=this.formatDate(c,d,this._getFormatConfig(a));$(b).each(function(){$(this).val(e)})}},noWeekends:function(a){var b=a.getDay();return[b>0&&b<6,""]},iso8601Week:function(a){var b=new Date(a.getTime());b.setDate(b.getDate()+4-(b.getDay()||7));var c=b.getTime();b.setMonth(0),b.setDate(1);return Math.floor(Math.round((c-b)/864e5)/7)+1},parseDate:function(a,b,c){if(a==null||b==null)throw"Invalid arguments";b=typeof b=="object"?b.toString():b+"";if(b=="")return null;var d=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff;d=typeof d!="string"?d:(new Date).getFullYear()%100+parseInt(d,10);var e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c?c.dayNames:null)||this._defaults.dayNames,g=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,h=(c?c.monthNames:null)||this._defaults.monthNames,i=-1,j=-1,k=-1,l=-1,m=!1,n=function(b){var c=s+1-1){j=1,k=l;for(;;){var u=this._getDaysInMonth(i,j-1);if(k<=u)break;j++,k-=u}}var t=this._daylightSavingAdjust(new Date(i,j-1,k));if(t.getFullYear()!=i||t.getMonth()+1!=j||t.getDate()!=k)throw"Invalid date";return t},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1e7,formatDate:function(a,b,c){if(!b)return"";var d=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,e=(c?c.dayNames:null)||this._defaults.dayNames,f=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,g=(c?c.monthNames:null)||this._defaults.monthNames,h=function(b){var c=m+112?a.getHours()+2:0);return a},_setDate:function(a,b,c){var d=!b,e=a.selectedMonth,f=a.selectedYear,g=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay=a.currentDay=g.getDate(),a.drawMonth=a.selectedMonth=a.currentMonth=g.getMonth(),a.drawYear=a.selectedYear=a.currentYear=g.getFullYear(),(e!=a.selectedMonth||f!=a.selectedYear)&&!c&&this._notifyChange(a),this._adjustInstDate(a),a.input&&a.input.val(d?"":this._formatDate(a))},_getDate:function(a){var b=!a.currentYear||a.input&&a.input.val()==""?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return b},_generateHTML:function(a){var b=new Date;b=this._daylightSavingAdjust(new Date(b.getFullYear(),b.getMonth(),b.getDate()));var c=this._get(a,"isRTL"),d=this._get(a,"showButtonPanel"),e=this._get(a,"hideIfNoPrevNext"),f=this._get(a,"navigationAsDateFormat"),g=this._getNumberOfMonths(a),h=this._get(a,"showCurrentAtPos"),i=this._get(a,"stepMonths"),j=g[0]!=1||g[1]!=1,k=this._daylightSavingAdjust(a.currentDay?new Date(a.currentYear,a.currentMonth,a.currentDay):new Date(9999,9,9)),l=this._getMinMaxDate(a,"min"),m=this._getMinMaxDate(a,"max"),n=a.drawMonth-h,o=a.drawYear;n<0&&(n+=12,o--);if(m){var p=this._daylightSavingAdjust(new Date(m.getFullYear(),m.getMonth()-g[0]*g[1]+1,m.getDate()));p=l&&pp)n--,n<0&&(n=11,o--)}a.drawMonth=n,a.drawYear=o;var q=this._get(a,"prevText");q=f?this.formatDate(q,this._daylightSavingAdjust(new Date(o,n-i,1)),this._getFormatConfig(a)):q;var r=this._canAdjustMonth(a,-1,o,n)?''+q+"":e?"":''+q+"",s=this._get(a,"nextText");s=f?this.formatDate(s,this._daylightSavingAdjust(new Date(o,n+i,1)),this._getFormatConfig(a)):s;var t=this._canAdjustMonth(a,1,o,n)?''+s+"":e?"":''+s+"",u=this._get(a,"currentText"),v=this._get(a,"gotoCurrent")&&a.currentDay?k:b;u=f?this.formatDate(u,v,this._getFormatConfig(a)):u;var w=a.inline?"":'",x=d?'
'+(c?w:"")+(this._isInRange(a,v)?'":"")+(c?"":w)+"
":"",y=parseInt(this._get(a,"firstDay"),10);y=isNaN(y)?0:y;var z=this._get(a,"showWeek"),A=this._get(a,"dayNames"),B=this._get(a,"dayNamesShort"),C=this._get(a,"dayNamesMin"),D=this._get(a,"monthNames"),E=this._get(a,"monthNamesShort"),F=this._get(a,"beforeShowDay"),G=this._get(a,"showOtherMonths"),H=this._get(a,"selectOtherMonths"),I=this._get(a,"calculateWeek")||this.iso8601Week,J=this._getDefaultDate(a),K="";for(var L=0;L1)switch(N){case 0:Q+=" ui-datepicker-group-first",P=" ui-corner-"+(c?"right":"left");break;case g[1]-1:Q+=" ui-datepicker-group-last",P=" ui-corner-"+(c?"left":"right");break;default:Q+=" ui-datepicker-group-middle",P=""}Q+='">'}Q+='
'+(/all|left/.test(P)&&L==0?c?t:r:"")+(/all|right/.test(P)&&L==0?c?r:t:"")+this._generateMonthYearHeader(a,n,o,l,m,L>0||N>0,D,E)+'
'+"";var R=z?'":"";for(var S=0;S<7;S++){var T=(S+y)%7;R+="=5?' class="ui-datepicker-week-end"':"")+">"+''+C[T]+""}Q+=R+"";var U=this._getDaysInMonth(o,n);o==a.selectedYear&&n==a.selectedMonth&&(a.selectedDay=Math.min(a.selectedDay,U));var V=(this._getFirstDayOfMonth(o,n)-y+7)%7,W=Math.ceil((V+U)/7),X=j?this.maxRows>W?this.maxRows:W:W;this.maxRows=X;var Y=this._daylightSavingAdjust(new Date(o,n,1-V));for(var Z=0;Z";var _=z?'":"";for(var S=0;S<7;S++){var ba=F?F.apply(a.input?a.input[0]:null,[Y]):[!0,""],bb=Y.getMonth()!=n,bc=bb&&!H||!ba[0]||l&&Ym;_+='",Y.setDate(Y.getDate()+1),Y=this._daylightSavingAdjust(Y)}Q+=_+""}n++,n>11&&(n=0,o++),Q+="
'+this._get(a,"weekHeader")+"
'+this._get(a,"calculateWeek")(Y)+""+(bb&&!G?" ":bc?''+Y.getDate()+"":''+Y.getDate()+"")+"
"+(j?""+(g[0]>0&&N==g[1]-1?'
':""):""),M+=Q}K+=M}K+=x+($.browser.msie&&parseInt($.browser.version,10)<7&&!a.inline?'':""),a._keyEvent=!1;return K},_generateMonthYearHeader:function(a,b,c,d,e,f,g,h){var i=this._get(a,"changeMonth"),j=this._get(a,"changeYear"),k=this -._get(a,"showMonthAfterYear"),l='
',m="";if(f||!i)m+=''+g[b]+"";else{var n=d&&d.getFullYear()==c,o=e&&e.getFullYear()==c;m+='"}k||(l+=m+(f||!i||!j?" ":""));if(!a.yearshtml){a.yearshtml="";if(f||!j)l+=''+c+"";else{var q=this._get(a,"yearRange").split(":"),r=(new Date).getFullYear(),s=function(a){var b=a.match(/c[+-].*/)?c+parseInt(a.substring(1),10):a.match(/[+-].*/)?r+parseInt(a,10):parseInt(a,10);return isNaN(b)?r:b},t=s(q[0]),u=Math.max(t,s(q[1]||""));t=d?Math.max(t,d.getFullYear()):t,u=e?Math.min(u,e.getFullYear()):u,a.yearshtml+='",l+=a.yearshtml,a.yearshtml=null}}l+=this._get(a,"yearSuffix"),k&&(l+=(f||!i||!j?" ":"")+m),l+="
";return l},_adjustInstDate:function(a,b,c){var d=a.drawYear+(c=="Y"?b:0),e=a.drawMonth+(c=="M"?b:0),f=Math.min(a.selectedDay,this._getDaysInMonth(d,e))+(c=="D"?b:0),g=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(d,e,f)));a.selectedDay=g.getDate(),a.drawMonth=a.selectedMonth=g.getMonth(),a.drawYear=a.selectedYear=g.getFullYear(),(c=="M"||c=="Y")&&this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min"),d=this._getMinMaxDate(a,"max"),e=c&&bd?d:e;return e},_notifyChange:function(a){var b=this._get(a,"onChangeMonthYear");b&&b.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){var b=this._get(a,"numberOfMonths");return b==null?[1,1]:typeof b=="number"?[1,b]:b},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-this._daylightSavingAdjust(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,d){var e=this._getNumberOfMonths(a),f=this._daylightSavingAdjust(new Date(c,d+(b<0?b:e[0]*e[1]),1));b<0&&f.setDate(this._getDaysInMonth(f.getFullYear(),f.getMonth()));return this._isInRange(a,f)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min"),d=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!d||b.getTime()<=d.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10);return{shortYearCutoff:b,dayNamesShort:this._get(a,"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,d){b||(a.currentDay=a.selectedDay,a.currentMonth=a.selectedMonth,a.currentYear=a.selectedYear);var e=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(d,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),e,this._getFormatConfig(a))}}),$.fn.datepicker=function(a){if(!this.length)return this;$.datepicker.initialized||($(document).mousedown($.datepicker._checkExternalClick).find("body").append($.datepicker.dpDiv),$.datepicker.initialized=!0);var b=Array.prototype.slice.call(arguments,1);if(typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget"))return $.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this[0]].concat(b));if(a=="option"&&arguments.length==2&&typeof arguments[1]=="string")return $.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this[0]].concat(b));return this.each(function(){typeof a=="string"?$.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this].concat(b)):$.datepicker._attachDatepicker(this,a)})},$.datepicker=new Datepicker,$.datepicker.initialized=!1,$.datepicker.uuid=(new Date).getTime(),$.datepicker.version="1.8.17",window["DP_jQuery_"+dpuuid]=$})(jQuery);/* - * jQuery UI Effects 1.8.17 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Effects/ - */jQuery.effects||function(a,b){function l(b){if(!b||typeof b=="number"||a.fx.speeds[b])return!0;if(typeof b=="string"&&!a.effects[b])return!0;return!1}function k(b,c,d,e){typeof b=="object"&&(e=c,d=null,c=b,b=c.effect),a.isFunction(c)&&(e=c,d=null,c={});if(typeof c=="number"||a.fx.speeds[c])e=d,d=c,c={};a.isFunction(d)&&(e=d,d=null),c=c||{},d=d||c.duration,d=a.fx.off?0:typeof d=="number"?d:d in a.fx.speeds?a.fx.speeds[d]:a.fx.speeds._default,e=e||c.complete;return[b,c,d,e]}function j(a,b){var c={_:0},d;for(d in b)a[d]!=b[d]&&(c[d]=b[d]);return c}function i(b){var c,d;for(c in b)d=b[c],(d==null||a.isFunction(d)||c in g||/scrollbar/.test(c)||!/color/i.test(c)&&isNaN(parseFloat(d)))&&delete b[c];return b}function h(){var a=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle,b={},c,d;if(a&&a.length&&a[0]&&a[a[0]]){var e=a.length;while(e--)c=a[e],typeof a[c]=="string"&&(d=c.replace(/\-(\w)/g,function(a,b){return b.toUpperCase()}),b[d]=a[c])}else for(c in a)typeof a[c]=="string"&&(b[c]=a[c]);return b}function d(b,d){var e;do{e=a.curCSS(b,d);if(e!=""&&e!="transparent"||a.nodeName(b,"body"))break;d="backgroundColor"}while(b=b.parentNode);return c(e)}function c(b){var c;if(b&&b.constructor==Array&&b.length==3)return b;if(c=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(b))return[parseInt(c[1],10),parseInt(c[2],10),parseInt(c[3],10)];if(c=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(b))return[parseFloat(c[1])*2.55,parseFloat(c[2])*2.55,parseFloat(c[3])*2.55];if(c=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(b))return[parseInt(c[1],16),parseInt(c[2],16),parseInt(c[3],16)];if(c=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(b))return[parseInt(c[1]+c[1],16),parseInt(c[2]+c[2],16),parseInt(c[3]+c[3],16)];if(c=/rgba\(0, 0, 0, 0\)/.exec(b))return e.transparent;return e[a.trim(b).toLowerCase()]}a.effects={},a.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","borderColor","color","outlineColor"],function(b,e){a.fx.step[e]=function(a){a.colorInit||(a.start=d(a.elem,e),a.end=c(a.end),a.colorInit=!0),a.elem.style[e]="rgb("+Math.max(Math.min(parseInt(a.pos*(a.end[0]-a.start[0])+a.start[0],10),255),0)+","+Math.max(Math.min(parseInt(a.pos*(a.end[1]-a.start[1])+a.start[1],10),255),0)+","+Math.max(Math.min(parseInt(a.pos*(a.end[2]-a.start[2])+a.start[2],10),255),0)+")"}});var e={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},f=["add","remove","toggle"],g={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};a.effects.animateClass=function(b,c,d,e){a.isFunction(d)&&(e=d,d=null);return this.queue(function(){var g=a(this),k=g.attr("style")||" ",l=i(h.call(this)),m,n=g.attr("class");a.each(f,function(a,c){b[c]&&g[c+"Class"](b[c])}),m=i(h.call(this)),g.attr("class",n),g.animate(j(l,m),{queue:!1,duration:c,easing:d,complete:function(){a.each(f,function(a,c){b[c]&&g[c+"Class"](b[c])}),typeof g.attr("style")=="object"?(g.attr("style").cssText="",g.attr("style").cssText=k):g.attr("style",k),e&&e.apply(this,arguments),a.dequeue(this)}})})},a.fn.extend({_addClass:a.fn.addClass,addClass:function(b,c,d,e){return c?a.effects.animateClass.apply(this,[{add:b},c,d,e]):this._addClass(b)},_removeClass:a.fn.removeClass,removeClass:function(b,c,d,e){return c?a.effects.animateClass.apply(this,[{remove:b},c,d,e]):this._removeClass(b)},_toggleClass:a.fn.toggleClass,toggleClass:function(c,d,e,f,g){return typeof d=="boolean"||d===b?e?a.effects.animateClass.apply(this,[d?{add:c}:{remove:c},e,f,g]):this._toggleClass(c,d):a.effects.animateClass.apply(this,[{toggle:c},d,e,f])},switchClass:function(b,c,d,e,f){return a.effects.animateClass.apply(this,[{add:c,remove:b},d,e,f])}}),a.extend(a.effects,{version:"1.8.17",save:function(a,b){for(var c=0;c").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),e=document.activeElement;b.wrap(d),(b[0]===e||a.contains(b[0],e))&&a(e).focus(),d=b.parent(),b.css("position")=="static"?(d.css({position:"relative"}),b.css({position:"relative"})):(a.extend(c,{position:b.css("position"),zIndex:b.css("z-index")}),a.each(["top","left","bottom","right"],function(a,d){c[d]=b.css(d),isNaN(parseInt(c[d],10))&&(c[d]="auto")}),b.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"}));return d.css(c).show()},removeWrapper:function(b){var c,d=document.activeElement;if(b.parent().is(".ui-effects-wrapper")){c=b.parent().replaceWith(b),(b[0]===d||a.contains(b[0],d))&&a(d).focus();return c}return b},setTransition:function(b,c,d,e){e=e||{},a.each(c,function(a,c){unit=b.cssUnit(c),unit[0]>0&&(e[c]=unit[0]*d+unit[1])});return e}}),a.fn.extend({effect:function(b,c,d,e){var f=k.apply(this,arguments),g={options:f[1],duration:f[2],callback:f[3]},h=g.options.mode,i=a.effects[b];if(a.fx.off||!i)return h?this[h](g.duration,g.callback):this.each(function(){g.callback&&g.callback.call(this)});return i.call(this,g)},_show:a.fn.show,show:function(a){if(l(a))return this._show.apply(this,arguments);var b=k.apply(this,arguments);b[1].mode="show";return this.effect.apply(this,b)},_hide:a.fn.hide,hide:function(a){if(l(a))return this._hide.apply(this,arguments);var b=k.apply(this,arguments);b[1].mode="hide";return this.effect.apply(this,b)},__toggle:a.fn.toggle,toggle:function(b){if(l(b)||typeof b=="boolean"||a.isFunction(b))return this.__toggle.apply(this,arguments);var c=k.apply(this,arguments);c[1].mode="toggle";return this.effect.apply(this,c)},cssUnit:function(b){var c=this.css(b),d=[];a.each(["em","px","%","pt"],function(a,b){c.indexOf(b)>0&&(d=[parseFloat(c),b])});return d}}),a.easing.jswing=a.easing.swing,a.extend(a.easing,{def:"easeOutQuad",swing:function(b,c,d,e,f){return a.easing[a.easing.def](b,c,d,e,f)},easeInQuad:function(a,b,c,d,e){return d*(b/=e)*b+c},easeOutQuad:function(a,b,c,d,e){return-d*(b/=e)*(b-2)+c},easeInOutQuad:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b+c;return-d/2*(--b*(b-2)-1)+c},easeInCubic:function(a,b,c,d,e){return d*(b/=e)*b*b+c},easeOutCubic:function(a,b,c,d,e){return d*((b=b/e-1)*b*b+1)+c},easeInOutCubic:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b+c;return d/2*((b-=2)*b*b+2)+c},easeInQuart:function(a,b,c,d,e){return d*(b/=e)*b*b*b+c},easeOutQuart:function(a,b,c,d,e){return-d*((b=b/e-1)*b*b*b-1)+c},easeInOutQuart:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b*b+c;return-d/2*((b-=2)*b*b*b-2)+c},easeInQuint:function(a,b,c,d,e){return d*(b/=e)*b*b*b*b+c},easeOutQuint:function(a,b,c,d,e){return d*((b=b/e-1)*b*b*b*b+1)+c},easeInOutQuint:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b*b*b+c;return d/2*((b-=2)*b*b*b*b+2)+c},easeInSine:function(a,b,c,d,e){return-d*Math.cos(b/e*(Math.PI/2))+d+c},easeOutSine:function(a,b,c,d,e){return d*Math.sin(b/e*(Math.PI/2))+c},easeInOutSine:function(a,b,c,d,e){return-d/2*(Math.cos(Math.PI*b/e)-1)+c},easeInExpo:function(a,b,c,d,e){return b==0?c:d*Math.pow(2,10*(b/e-1))+c},easeOutExpo:function(a,b,c,d,e){return b==e?c+d:d*(-Math.pow(2,-10*b/e)+1)+c},easeInOutExpo:function(a,b,c,d,e){if(b==0)return c;if(b==e)return c+d;if((b/=e/2)<1)return d/2*Math.pow(2,10*(b-1))+c;return d/2*(-Math.pow(2,-10*--b)+2)+c},easeInCirc:function(a,b,c,d,e){return-d*(Math.sqrt(1-(b/=e)*b)-1)+c},easeOutCirc:function(a,b,c,d,e){return d*Math.sqrt(1-(b=b/e-1)*b)+c},easeInOutCirc:function(a,b,c,d,e){if((b/=e/2)<1)return-d/2*(Math.sqrt(1-b*b)-1)+c;return d/2*(Math.sqrt(1-(b-=2)*b)+1)+c},easeInElastic:function(a,b,c,d,e){var f=1.70158,g=0,h=d;if(b==0)return c;if((b/=e)==1)return c+d;g||(g=e*.3);if(h 1) { - arr = arr.concat(checkCellColSpan(table, headerArr,row++)); - } else { - if(table.tHead.length == 1 || (cell.rowSpan > 1 || !r[row+1])) { - arr.push(cell); - } - //headerArr[row] = (i+row); - } - } - return arr; - }; - - function checkHeaderMetadata(cell) { - if(($.metadata) && ($(cell).metadata().sorter === false)) { return true; }; - return false; - } - - function checkHeaderOptions(table,i) { - if((table.config.headers[i]) && (table.config.headers[i].sorter === false)) { return true; }; - return false; - } - - function applyWidget(table) { - var c = table.config.widgets; - var l = c.length; - for(var i=0; i < l; i++) { - - getWidgetById(c[i]).format(table); - } - - } - - function getWidgetById(name) { - var l = widgets.length; - for(var i=0; i < l; i++) { - if(widgets[i].id.toLowerCase() == name.toLowerCase() ) { - return widgets[i]; - } - } - }; - - function formatSortingOrder(v) { - - if(typeof(v) != "Number") { - i = (v.toLowerCase() == "desc") ? 1 : 0; - } else { - i = (v == (0 || 1)) ? v : 0; - } - return i; - } - - function isValueInArray(v, a) { - var l = a.length; - for(var i=0; i < l; i++) { - if(a[i][0] == v) { - return true; - } - } - return false; - } - - function setHeadersCss(table,$headers, list, css) { - // remove all header information - $headers.removeClass(css[0]).removeClass(css[1]); - - var h = []; - $headers.each(function(offset) { - if(!this.sortDisabled) { - h[this.column] = $(this); - } - }); - - var l = list.length; - for(var i=0; i < l; i++) { - h[list[i][0]].addClass(css[list[i][1]]); - } - } - - function fixColumnWidth(table,$headers) { - var c = table.config; - if(c.widthFixed) { - var colgroup = $(''); - $("tr:first td",table.tBodies[0]).each(function() { - colgroup.append($('').css('width',$(this).width())); - }); - $(table).prepend(colgroup); - }; - } - - function updateHeaderSortCount(table,sortList) { - var c = table.config, l = sortList.length; - for(var i=0; i < l; i++) { - var s = sortList[i], o = c.headerList[s[0]]; - o.count = s[1]; - o.count++; - } - } - - /* sorting methods */ - function multisort(table,sortList,cache) { - - if(table.config.debug) { var sortTime = new Date(); } - - var dynamicExp = "var sortWrapper = function(a,b) {", l = sortList.length; - - for(var i=0; i < l; i++) { - - var c = sortList[i][0]; - var order = sortList[i][1]; - var s = (getCachedSortType(table.config.parsers,c) == "text") ? ((order == 0) ? "sortText" : "sortTextDesc") : ((order == 0) ? "sortNumeric" : "sortNumericDesc"); - - var e = "e" + i; - - dynamicExp += "var " + e + " = " + s + "(a[" + c + "],b[" + c + "]); "; - dynamicExp += "if(" + e + ") { return " + e + "; } "; - dynamicExp += "else { "; - } - - // if value is the same keep orignal order - var orgOrderCol = cache.normalized[0].length - 1; - dynamicExp += "return a[" + orgOrderCol + "]-b[" + orgOrderCol + "];"; - - for(var i=0; i < l; i++) { - dynamicExp += "}; "; - } - - dynamicExp += "return 0; "; - dynamicExp += "}; "; - - eval(dynamicExp); - - cache.normalized.sort(sortWrapper); - - if(table.config.debug) { benchmark("Sorting on " + sortList.toString() + " and dir " + order+ " time:", sortTime); } - - return cache; - }; - - function sortText(a,b) { - return ((a < b) ? -1 : ((a > b) ? 1 : 0)); - }; - - function sortTextDesc(a,b) { - return ((b < a) ? -1 : ((b > a) ? 1 : 0)); - }; - - function sortNumeric(a,b) { - return a-b; - }; - - function sortNumericDesc(a,b) { - return b-a; - }; - - function getCachedSortType(parsers,i) { - return parsers[i].type; - }; - - /* public methods */ - this.construct = function(settings) { - - return this.each(function() { - - if(!this.tHead || !this.tBodies) return; - - var $this, $document,$headers, cache, config, shiftDown = 0, sortOrder; - - this.config = {}; - - config = $.extend(this.config, $.tablesorter.defaults, settings); - - // store common expression for speed - $this = $(this); - - // build headers - $headers = buildHeaders(this); - - // try to auto detect column type, and store in tables config - this.config.parsers = buildParserCache(this,$headers); - - - // build the cache for the tbody cells - cache = buildCache(this); - - // get the css class names, could be done else where. - var sortCSS = [config.cssDesc,config.cssAsc]; - - // fixate columns if the users supplies the fixedWidth option - fixColumnWidth(this); - - // apply event handling to headers - // this is to big, perhaps break it out? - $headers.click(function(e) { - - $this.trigger("sortStart"); - - var totalRows = ($this[0].tBodies[0] && $this[0].tBodies[0].rows.length) || 0; - - if(!this.sortDisabled && totalRows > 0) { - - - // store exp, for speed - var $cell = $(this); - - // get current column index - var i = this.column; - - // get current column sort order - this.order = this.count++ % 2; - - // user only whants to sort on one column - if(!e[config.sortMultiSortKey]) { - - // flush the sort list - config.sortList = []; - - if(config.sortForce != null) { - var a = config.sortForce; - for(var j=0; j < a.length; j++) { - if(a[j][0] != i) { - config.sortList.push(a[j]); - } - } - } - - // add column to sort list - config.sortList.push([i,this.order]); - - // multi column sorting - } else { - // the user has clicked on an all ready sortet column. - if(isValueInArray(i,config.sortList)) { - - // revers the sorting direction for all tables. - for(var j=0; j < config.sortList.length; j++) { - var s = config.sortList[j], o = config.headerList[s[0]]; - if(s[0] == i) { - o.count = s[1]; - o.count++; - s[1] = o.count % 2; - } - } - } else { - // add column to sort list array - config.sortList.push([i,this.order]); - } - }; - setTimeout(function() { - //set css for headers - setHeadersCss($this[0],$headers,config.sortList,sortCSS); - appendToTable($this[0],multisort($this[0],config.sortList,cache)); - },1); - // stop normal event by returning false - return false; - } - // cancel selection - }).mousedown(function() { - if(config.cancelSelection) { - this.onselectstart = function() {return false}; - return false; - } - }); - - // apply easy methods that trigger binded events - $this.bind("update",function() { - - // rebuild parsers. - this.config.parsers = buildParserCache(this,$headers); - - // rebuild the cache map - cache = buildCache(this); - - }).bind("sorton",function(e,list) { - - $(this).trigger("sortStart"); - - config.sortList = list; - - // update and store the sortlist - var sortList = config.sortList; - - // update header count index - updateHeaderSortCount(this,sortList); - - //set css for headers - setHeadersCss(this,$headers,sortList,sortCSS); - - - // sort the table and append it to the dom - appendToTable(this,multisort(this,sortList,cache)); - - }).bind("appendCache",function() { - - appendToTable(this,cache); - - }).bind("applyWidgetId",function(e,id) { - - getWidgetById(id).format(this); - - }).bind("applyWidgets",function() { - // apply widgets - applyWidget(this); - }); - - if($.metadata && ($(this).metadata() && $(this).metadata().sortlist)) { - config.sortList = $(this).metadata().sortlist; - } - // if user has supplied a sort list to constructor. - if(config.sortList.length > 0) { - $this.trigger("sorton",[config.sortList]); - } - - // apply widgets - applyWidget(this); - }); - }; - - this.addParser = function(parser) { - var l = parsers.length, a = true; - for(var i=0; i < l; i++) { - if(parsers[i].id.toLowerCase() == parser.id.toLowerCase()) { - a = false; - } - } - if(a) { parsers.push(parser); }; - }; - - this.addWidget = function(widget) { - widgets.push(widget); - }; - - this.formatFloat = function(s) { - var i = parseFloat(s); - return (isNaN(i)) ? 0 : i; - }; - this.formatInt = function(s) { - var i = parseInt(s); - return (isNaN(i)) ? 0 : i; - }; - - this.isDigit = function(s,config) { - var DECIMAL = '\\' + config.decimal; - var exp = '/(^[+]?0(' + DECIMAL +'0+)?$)|(^([-+]?[1-9][0-9]*)$)|(^([-+]?((0?|[1-9][0-9]*)' + DECIMAL +'(0*[1-9][0-9]*)))$)|(^[-+]?[1-9]+[0-9]*' + DECIMAL +'0+$)/'; - return RegExp(exp).test($.trim(s)); - }; - - this.clearTableBody = function(table) { - if($.browser.msie) { - function empty() { - while ( this.firstChild ) this.removeChild( this.firstChild ); - } - empty.apply(table.tBodies[0]); - } else { - table.tBodies[0].innerHTML = ""; - } - }; - } - }); - - // extend plugin scope - $.fn.extend({ - tablesorter: $.tablesorter.construct - }); - - var ts = $.tablesorter; - - // add default parsers - ts.addParser({ - id: "text", - is: function(s) { - return true; - }, - format: function(s) { - return $.trim(s.toLowerCase()); - }, - type: "text" - }); - - ts.addParser({ - id: "digit", - is: function(s,table) { - var c = table.config; - return $.tablesorter.isDigit(s,c); - }, - format: function(s) { - return $.tablesorter.formatFloat(s); - }, - type: "numeric" - }); - - ts.addParser({ - id: "currency", - is: function(s) { - return /^[£$€?.]/.test(s); - }, - format: function(s) { - return $.tablesorter.formatFloat(s.replace(new RegExp(/[^0-9.]/g),"")); - }, - type: "numeric" - }); - - ts.addParser({ - id: "ipAddress", - is: function(s) { - return /^\d{2,3}[\.]\d{2,3}[\.]\d{2,3}[\.]\d{2,3}$/.test(s); - }, - format: function(s) { - var a = s.split("."), r = "", l = a.length; - for(var i = 0; i < l; i++) { - var item = a[i]; - if(item.length == 2) { - r += "0" + item; - } else { - r += item; - } - } - return $.tablesorter.formatFloat(r); - }, - type: "numeric" - }); - - ts.addParser({ - id: "url", - is: function(s) { - return /^(https?|ftp|file):\/\/$/.test(s); - }, - format: function(s) { - return jQuery.trim(s.replace(new RegExp(/(https?|ftp|file):\/\//),'')); - }, - type: "text" - }); - - ts.addParser({ - id: "isoDate", - is: function(s) { - return /^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(s); - }, - format: function(s) { - return $.tablesorter.formatFloat((s != "") ? new Date(s.replace(new RegExp(/-/g),"/")).getTime() : "0"); - }, - type: "numeric" - }); - - ts.addParser({ - id: "percent", - is: function(s) { - return /\%$/.test($.trim(s)); - }, - format: function(s) { - return $.tablesorter.formatFloat(s.replace(new RegExp(/%/g),"")); - }, - type: "numeric" - }); - - ts.addParser({ - id: "usLongDate", - is: function(s) { - return s.match(new RegExp(/^[A-Za-z]{3,10}\.? [0-9]{1,2}, ([0-9]{4}|'?[0-9]{2}) (([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(AM|PM)))$/)); - }, - format: function(s) { - return $.tablesorter.formatFloat(new Date(s).getTime()); - }, - type: "numeric" - }); - - ts.addParser({ - id: "shortDate", - is: function(s) { - return /\d{1,2}[\/\-]\d{1,2}[\/\-]\d{2,4}/.test(s); - }, - format: function(s,table) { - var c = table.config; - s = s.replace(/\-/g,"/"); - if(c.dateFormat == "us") { - // reformat the string in ISO format - s = s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/, "$3/$1/$2"); - } else if(c.dateFormat == "uk") { - //reformat the string in ISO format - s = s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/, "$3/$2/$1"); - } else if(c.dateFormat == "dd/mm/yy" || c.dateFormat == "dd-mm-yy") { - s = s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{2})/, "$1/$2/$3"); - } - return $.tablesorter.formatFloat(new Date(s).getTime()); - }, - type: "numeric" - }); - - ts.addParser({ - id: "time", - is: function(s) { - return /^(([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(am|pm)))$/.test(s); - }, - format: function(s) { - return $.tablesorter.formatFloat(new Date("2000/01/01 " + s).getTime()); - }, - type: "numeric" - }); - - - ts.addParser({ - id: "metadata", - is: function(s) { - return false; - }, - format: function(s,table,cell) { - var c = table.config, p = (!c.parserMetadataName) ? 'sortValue' : c.parserMetadataName; - return $(cell).metadata()[p]; - }, - type: "numeric" - }); - - // add default widgets - ts.addWidget({ - id: "zebra", - format: function(table) { - if(table.config.debug) { var time = new Date(); } - $("tr:visible",table.tBodies[0]) - .filter(':even') - .removeClass(table.config.widgetZebra.css[1]).addClass(table.config.widgetZebra.css[0]) - .end().filter(':odd') - .removeClass(table.config.widgetZebra.css[0]).addClass(table.config.widgetZebra.css[1]); - if(table.config.debug) { $.tablesorter.benchmark("Applying Zebra widget", time); } - } - }); -})(jQuery); \ No newline at end of file diff --git a/doc/design/js/jquery.ui.datepicker-ru.js b/doc/design/js/jquery.ui.datepicker-ru.js deleted file mode 100644 index 50a461352..000000000 --- a/doc/design/js/jquery.ui.datepicker-ru.js +++ /dev/null @@ -1,23 +0,0 @@ -/* Russian (UTF-8) initialisation for the jQuery UI date picker plugin. */ -/* Written by Andrew Stromnov (stromnov@gmail.com). */ -jQuery(function($){ - $.datepicker.regional['ru'] = { - closeText: 'Закрыть', - prevText: '<Пред', - nextText: 'След>', - currentText: 'Сегодня', - monthNames: ['Январь','Февраль','Март','Апрель','Май','Июнь', - 'Июль','Август','Сентябрь','Октябрь','Ноябрь','Декабрь'], - monthNamesShort: ['Янв','Фев','Мар','Апр','Май','Июн', - 'Июл','Авг','Сен','Окт','Ноя','Дек'], - dayNames: ['воскресенье','понедельник','вторник','среда','четверг','пятница','суббота'], - dayNamesShort: ['вск','пнд','втр','срд','чтв','птн','сбт'], - dayNamesMin: ['Вс','Пн','Вт','Ср','Чт','Пт','Сб'], - weekHeader: 'Нед', - dateFormat: 'dd.mm.yy', - firstDay: 1, - isRTL: false, - showMonthAfterYear: false, - yearSuffix: ''}; - $.datepicker.setDefaults($.datepicker.regional['ru']); -}); \ No newline at end of file diff --git a/doc/design/js/login.js b/doc/design/js/login.js deleted file mode 100644 index 377abc4ee..000000000 --- a/doc/design/js/login.js +++ /dev/null @@ -1,33 +0,0 @@ -function logIn() { - $("#hint").fadeIn("slow"); - document.getElementById("login").className="registartion-input-error"; - document.getElementById("pass").className="registartion-input-error"; -} - -function disError(elem) { - $("#hint").fadeOut("fast"); - if (document.getElementById("login").className=="registartion-input-error") { - if (this.id=="login") { - document.getElementById("login").className="registartion-input-focus"; - } else { - document.getElementById("login").className="registartion-input-no-focus"; - } - } - if (document.getElementById("pass").className=="registartion-input-error") { - if (this.id=="pass") { - document.getElementById("pass").className="registartion-input-focus"; - } else { - document.getElementById("pass").className="registartion-input-no-focus"; - } - } - buttonCheck(); -} - -function buttonCheck() { - if ((document.getElementById("login").value!="")&&(document.getElementById("login").value!=" email")&&(document.getElementById("pass").value!="")&&(document.getElementById("pass").value!="")) { - document.getElementById("btnLogin").className = "button"; - - } else { - document.getElementById("btnLogin").className = "button disabled"; - } -} \ No newline at end of file diff --git a/doc/design/js/mode/clike/clike.js b/doc/design/js/mode/clike/clike.js deleted file mode 100644 index c0defd68e..000000000 --- a/doc/design/js/mode/clike/clike.js +++ /dev/null @@ -1,234 +0,0 @@ -CodeMirror.defineMode("clike", function(config, parserConfig) { - var indentUnit = config.indentUnit, - keywords = parserConfig.keywords || {}, - blockKeywords = parserConfig.blockKeywords || {}, - atoms = parserConfig.atoms || {}, - hooks = parserConfig.hooks || {}, - multiLineStrings = parserConfig.multiLineStrings; - var isOperatorChar = /[+\-*&%=<>!?|\/]/; - - var curPunc; - - function tokenBase(stream, state) { - var ch = stream.next(); - if (hooks[ch]) { - var result = hooks[ch](stream, state); - if (result !== false) return result; - } - if (ch == '"' || ch == "'") { - state.tokenize = tokenString(ch); - return state.tokenize(stream, state); - } - if (/[\[\]{}\(\),;\:\.]/.test(ch)) { - curPunc = ch; - return null - } - if (/\d/.test(ch)) { - stream.eatWhile(/[\w\.]/); - return "number"; - } - if (ch == "/") { - if (stream.eat("*")) { - state.tokenize = tokenComment; - return tokenComment(stream, state); - } - if (stream.eat("/")) { - stream.skipToEnd(); - return "comment"; - } - } - if (isOperatorChar.test(ch)) { - stream.eatWhile(isOperatorChar); - return "operator"; - } - stream.eatWhile(/[\w\$_]/); - var cur = stream.current(); - if (keywords.propertyIsEnumerable(cur)) { - if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement"; - return "keyword"; - } - if (atoms.propertyIsEnumerable(cur)) return "atom"; - return "word"; - } - - function tokenString(quote) { - return function(stream, state) { - var escaped = false, next, end = false; - while ((next = stream.next()) != null) { - if (next == quote && !escaped) {end = true; break;} - escaped = !escaped && next == "\\"; - } - if (end || !(escaped || multiLineStrings)) - state.tokenize = tokenBase; - return "string"; - }; - } - - function tokenComment(stream, state) { - var maybeEnd = false, ch; - while (ch = stream.next()) { - if (ch == "/" && maybeEnd) { - state.tokenize = tokenBase; - break; - } - maybeEnd = (ch == "*"); - } - return "comment"; - } - - function Context(indented, column, type, align, prev) { - this.indented = indented; - this.column = column; - this.type = type; - this.align = align; - this.prev = prev; - } - function pushContext(state, col, type) { - return state.context = new Context(state.indented, col, type, null, state.context); - } - function popContext(state) { - var t = state.context.type; - if (t == ")" || t == "]" || t == "}") - state.indented = state.context.indented; - return state.context = state.context.prev; - } - - // Interface - - return { - startState: function(basecolumn) { - return { - tokenize: null, - context: new Context((basecolumn || 0) - indentUnit, 0, "top", false), - indented: 0, - startOfLine: true - }; - }, - - token: function(stream, state) { - var ctx = state.context; - if (stream.sol()) { - if (ctx.align == null) ctx.align = false; - state.indented = stream.indentation(); - state.startOfLine = true; - } - if (stream.eatSpace()) return null; - curPunc = null; - var style = (state.tokenize || tokenBase)(stream, state); - if (style == "comment" || style == "meta") return style; - if (ctx.align == null) ctx.align = true; - - if ((curPunc == ";" || curPunc == ":") && ctx.type == "statement") popContext(state); - else if (curPunc == "{") pushContext(state, stream.column(), "}"); - else if (curPunc == "[") pushContext(state, stream.column(), "]"); - else if (curPunc == "(") pushContext(state, stream.column(), ")"); - else if (curPunc == "}") { - while (ctx.type == "statement") ctx = popContext(state); - if (ctx.type == "}") ctx = popContext(state); - while (ctx.type == "statement") ctx = popContext(state); - } - else if (curPunc == ctx.type) popContext(state); - else if (ctx.type == "}" || ctx.type == "top" || (ctx.type == "statement" && curPunc == "newstatement")) - pushContext(state, stream.column(), "statement"); - state.startOfLine = false; - return style; - }, - - indent: function(state, textAfter) { - if (state.tokenize != tokenBase && state.tokenize != null) return 0; - var ctx = state.context, firstChar = textAfter && textAfter.charAt(0); - if (ctx.type == "statement" && firstChar == "}") ctx = ctx.prev; - var closing = firstChar == ctx.type; - if (ctx.type == "statement") return ctx.indented + (firstChar == "{" ? 0 : indentUnit); - else if (ctx.align) return ctx.column + (closing ? 0 : 1); - else return ctx.indented + (closing ? 0 : indentUnit); - }, - - electricChars: "{}" - }; -}); - -(function() { - function words(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - var cKeywords = "auto if break int case long char register continue return default short do sizeof " + - "double static else struct entry switch extern typedef float union for unsigned " + - "goto while enum void const signed volatile"; - - function cppHook(stream, state) { - if (!state.startOfLine) return false; - stream.skipToEnd(); - return "meta"; - } - - // C#-style strings where "" escapes a quote. - function tokenAtString(stream, state) { - var next; - while ((next = stream.next()) != null) { - if (next == '"' && !stream.eat('"')) { - state.tokenize = null; - break; - } - } - return "string"; - } - - CodeMirror.defineMIME("text/x-csrc", { - name: "clike", - keywords: words(cKeywords), - blockKeywords: words("case do else for if switch while struct"), - atoms: words("null"), - hooks: {"#": cppHook} - }); - CodeMirror.defineMIME("text/x-c++src", { - name: "clike", - keywords: words(cKeywords + " asm dynamic_cast namespace reinterpret_cast try bool explicit new " + - "static_cast typeid catch operator template typename class friend private " + - "this using const_cast inline public throw virtual delete mutable protected " + - "wchar_t"), - blockKeywords: words("catch class do else finally for if struct switch try while"), - atoms: words("true false null"), - hooks: {"#": cppHook} - }); - CodeMirror.defineMIME("text/x-java", { - name: "clike", - keywords: words("abstract assert boolean break byte case catch char class const continue default " + - "do double else enum extends final finally float for goto if implements import " + - "instanceof int interface long native new package private protected public " + - "return short static strictfp super switch synchronized this throw throws transient " + - "try void volatile while"), - blockKeywords: words("catch class do else finally for if switch try while"), - atoms: words("true false null"), - hooks: { - "@": function(stream, state) { - stream.eatWhile(/[\w\$_]/); - return "meta"; - } - } - }); - CodeMirror.defineMIME("text/x-csharp", { - name: "clike", - keywords: words("abstract as base bool break byte case catch char checked class const continue decimal" + - " default delegate do double else enum event explicit extern finally fixed float for" + - " foreach goto if implicit in int interface internal is lock long namespace new object" + - " operator out override params private protected public readonly ref return sbyte sealed short" + - " sizeof stackalloc static string struct switch this throw try typeof uint ulong unchecked" + - " unsafe ushort using virtual void volatile while add alias ascending descending dynamic from get" + - " global group into join let orderby partial remove select set value var yield"), - blockKeywords: words("catch class do else finally for foreach if struct switch try while"), - atoms: words("true false null"), - hooks: { - "@": function(stream, state) { - if (stream.eat('"')) { - state.tokenize = tokenAtString; - return tokenAtString(stream, state); - } - stream.eatWhile(/[\w\$_]/); - return "meta"; - } - } - }); -}()); diff --git a/doc/design/js/mode/clike/index.html b/doc/design/js/mode/clike/index.html deleted file mode 100644 index 5c327451e..000000000 --- a/doc/design/js/mode/clike/index.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - CodeMirror: C-like mode - - - - - - - -

CodeMirror: C-like mode

- -
- - - -

Simple mode that tries to handle C-like languages as well as it - can. Takes two configuration parameters: keywords, an - object whose property names are the keywords in the language, - and useCPP, which determines whether C preprocessor - directives are recognized.

- -

MIME types defined: text/x-csrc - (C code), text/x-c++src (C++ - code), text/x-java (Java - code).

- - diff --git a/doc/design/js/mode/clojure/clojure.js b/doc/design/js/mode/clojure/clojure.js deleted file mode 100644 index a951589eb..000000000 --- a/doc/design/js/mode/clojure/clojure.js +++ /dev/null @@ -1,207 +0,0 @@ -/** - * Author: Hans Engel - * Branched from CodeMirror's Scheme mode (by Koh Zi Han, based on implementation by Koh Zi Chun) - */ -CodeMirror.defineMode("clojure", function (config, mode) { - var BUILTIN = "builtin", COMMENT = "comment", STRING = "string", TAG = "tag", - ATOM = "atom", NUMBER = "number", BRACKET = "bracket", KEYWORD="keyword"; - var INDENT_WORD_SKIP = 2, KEYWORDS_SKIP = 1; - - function makeKeywords(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - - var atoms = makeKeywords("true false nil"); - - var keywords = makeKeywords( - // Control structures - "defn defn- def def- defonce defmulti defmethod defmacro defstruct deftype defprotocol defrecord deftest slice defalias defhinted defmacro- defn-memo defnk defnk defonce- defunbound defunbound- defvar defvar- let letfn do case cond condp for loop recur when when-not when-let when-first if if-let if-not . .. -> ->> doto and or dosync doseq dotimes dorun doall load import unimport ns in-ns refer try catch finally throw with-open with-local-vars binding gen-class gen-and-load-class gen-and-save-class handler-case handle" + - - // Built-ins - "* *1 *2 *3 *agent* *allow-unresolved-vars* *assert *clojure-version* *command-line-args* *compile-files* *compile-path* *e *err* *file* *flush-on-newline* *in* *macro-meta* *math-context* *ns* *out* *print-dup* *print-length* *print-level* *print-meta* *print-readably* *read-eval* *source-path* *use-context-classloader* *warn-on-reflection* + - / < <= = == > >= accessor aclone agent agent-errors aget alength alias all-ns alter alter-meta! alter-var-root amap ancestors and apply areduce array-map aset aset-boolean aset-byte aset-char aset-double aset-float aset-int aset-long aset-short assert assoc assoc! assoc-in associative? atom await await-for await1 bases bean bigdec bigint binding bit-and bit-and-not bit-clear bit-flip bit-not bit-or bit-set bit-shift-left bit-shift-right bit-test bit-xor boolean boolean-array booleans bound-fn bound-fn* butlast byte byte-array bytes case cast char char-array char-escape-string char-name-string char? chars chunk chunk-append chunk-buffer chunk-cons chunk-first chunk-next chunk-rest chunked-seq? class class? clear-agent-errors clojure-version coll? comment commute comp comparator compare compare-and-set! compile complement concat cond condp conj conj! cons constantly construct-proxy contains? count counted? create-ns create-struct cycle dec decimal? declare definline defmacro defmethod defmulti defn defn- defonce defstruct delay delay? deliver deref derive descendants destructure disj disj! dissoc dissoc! distinct distinct? doall doc dorun doseq dosync dotimes doto double double-array doubles drop drop-last drop-while empty empty? ensure enumeration-seq eval even? every? extend extend-protocol extend-type extends? extenders false? ffirst file-seq filter find find-doc find-ns find-var first float float-array float? floats flush fn fn? fnext for force format future future-call future-cancel future-cancelled? future-done? future? gen-class gen-interface gensym get get-in get-method get-proxy-class get-thread-bindings get-validator hash hash-map hash-set identical? identity if-let if-not ifn? import in-ns inc init-proxy instance? int int-array integer? interleave intern interpose into into-array ints io! isa? iterate iterator-seq juxt key keys keyword keyword? last lazy-cat lazy-seq let letfn line-seq list list* list? load load-file load-reader load-string loaded-libs locking long long-array longs loop macroexpand macroexpand-1 make-array make-hierarchy map map? mapcat max max-key memfn memoize merge merge-with meta method-sig methods min min-key mod name namespace neg? newline next nfirst nil? nnext not not-any? not-empty not-every? not= ns ns-aliases ns-imports ns-interns ns-map ns-name ns-publics ns-refers ns-resolve ns-unalias ns-unmap nth nthnext num number? odd? or parents partial partition pcalls peek persistent! pmap pop pop! pop-thread-bindings pos? pr pr-str prefer-method prefers primitives-classnames print print-ctor print-doc print-dup print-method print-namespace-doc print-simple print-special-doc print-str printf println println-str prn prn-str promise proxy proxy-call-with-super proxy-mappings proxy-name proxy-super push-thread-bindings pvalues quot rand rand-int range ratio? rational? rationalize re-find re-groups re-matcher re-matches re-pattern re-seq read read-line read-string reify reduce ref ref-history-count ref-max-history ref-min-history ref-set refer refer-clojure release-pending-sends rem remove remove-method remove-ns repeat repeatedly replace replicate require reset! reset-meta! resolve rest resultset-seq reverse reversible? rseq rsubseq satisfies? second select-keys send send-off seq seq? seque sequence sequential? set set-validator! set? short short-array shorts shutdown-agents slurp some sort sort-by sorted-map sorted-map-by sorted-set sorted-set-by sorted? special-form-anchor special-symbol? split-at split-with str stream? string? struct struct-map subs subseq subvec supers swap! symbol symbol? sync syntax-symbol-anchor take take-last take-nth take-while test the-ns time to-array to-array-2d trampoline transient tree-seq true? type unchecked-add unchecked-dec unchecked-divide unchecked-inc unchecked-multiply unchecked-negate unchecked-remainder unchecked-subtract underive unquote unquote-splicing update-in update-proxy use val vals var-get var-set var? vary-meta vec vector vector? when when-first when-let when-not while with-bindings with-bindings* with-in-str with-loading-context with-local-vars with-meta with-open with-out-str with-precision xml-seq"); - - var indentKeys = makeKeywords( - // Built-ins - "ns fn def defn defmethod bound-fn if if-not case condp when while when-not when-first do future comment doto locking proxy with-open with-precision reify deftype defrecord defprotocol extend extend-protocol extend-type try catch" + - - // Binding forms - "let letfn binding loop for doseq dotimes when-let if-let" + - - // Data structures - "defstruct struct-map assoc" + - - // clojure.test - "testing deftest" + - - // contrib - "handler-case handle dotrace deftrace"); - - var tests = { - digit: /\d/, - digit_or_colon: /[\d:]/, - hex: /[0-9a-fA-F]/, - sign: /[+-]/, - exponent: /[eE]/, - keyword_char: /[^\s\(\[\;\)\]]/, - basic: /[\w\$_\-]/, - lang_keyword: /[\w*+!\-_?:\/]/ - }; - - function stateStack(indent, type, prev) { // represents a state stack object - this.indent = indent; - this.type = type; - this.prev = prev; - } - - function pushStack(state, indent, type) { - state.indentStack = new stateStack(indent, type, state.indentStack); - } - - function popStack(state) { - state.indentStack = state.indentStack.prev; - } - - function isNumber(ch, stream){ - // hex - if ( ch === '0' && 'x' == stream.peek().toLowerCase() ) { - stream.eat('x'); - stream.eatWhile(tests.hex); - return true; - } - - // leading sign - if ( ch == '+' || ch == '-' ) { - stream.eat(tests.sign); - ch = stream.next(); - } - - if ( tests.digit.test(ch) ) { - stream.eat(ch); - stream.eatWhile(tests.digit); - - if ( '.' == stream.peek() ) { - stream.eat('.'); - stream.eatWhile(tests.digit); - } - - if ( 'e' == stream.peek().toLowerCase() ) { - stream.eat(tests.exponent); - stream.eat(tests.sign); - stream.eatWhile(tests.digit); - } - - return true; - } - - return false; - } - - return { - startState: function () { - return { - indentStack: null, - indentation: 0, - mode: false, - }; - }, - - token: function (stream, state) { - if (state.indentStack == null && stream.sol()) { - // update indentation, but only if indentStack is empty - state.indentation = stream.indentation(); - } - - // skip spaces - if (stream.eatSpace()) { - return null; - } - var returnType = null; - - switch(state.mode){ - case "string": // multi-line string parsing mode - var next, escaped = false; - while ((next = stream.next()) != null) { - if (next == "\"" && !escaped) { - - state.mode = false; - break; - } - escaped = !escaped && next == "\\"; - } - returnType = STRING; // continue on in string mode - break; - default: // default parsing mode - var ch = stream.next(); - - if (ch == "\"") { - state.mode = "string"; - returnType = STRING; - } else if (ch == "'" && !( tests.digit_or_colon.test(stream.peek()) )) { - returnType = ATOM; - } else if (ch == ";") { // comment - stream.skipToEnd(); // rest of the line is a comment - returnType = COMMENT; - } else if (isNumber(ch,stream)){ - returnType = NUMBER; - } else if (ch == "(" || ch == "[") { - var keyWord = ''; var indentTemp = stream.column(); - /** - Either - (indent-word .. - (non-indent-word .. - (;something else, bracket, etc. - */ - - while ((letter = stream.eat(tests.keyword_char)) != null) { - keyWord += letter; - } - - if (keyWord.length > 0 && indentKeys.propertyIsEnumerable(keyWord)) { // indent-word - - pushStack(state, indentTemp + INDENT_WORD_SKIP, ch); - } else { // non-indent word - // we continue eating the spaces - stream.eatSpace(); - if (stream.eol() || stream.peek() == ";") { - // nothing significant after - // we restart indentation 1 space after - pushStack(state, indentTemp + 1, ch); - } else { - pushStack(state, indentTemp + stream.current().length, ch); // else we match - } - } - stream.backUp(stream.current().length - 1); // undo all the eating - - returnType = BRACKET; - } else if (ch == ")" || ch == "]") { - returnType = BRACKET; - if (state.indentStack != null && state.indentStack.type == (ch == ")" ? "(" : "[")) { - popStack(state); - } - } else if ( ch == ":" ) { - stream.eatWhile(tests.lang_keyword); - return TAG; - } else { - stream.eatWhile(tests.basic); - - if (keywords && keywords.propertyIsEnumerable(stream.current())) { - returnType = BUILTIN; - } else if ( atoms && atoms.propertyIsEnumerable(stream.current()) ) { - returnType = ATOM; - } else returnType = null; - } - } - - return returnType; - }, - - indent: function (state, textAfter) { - if (state.indentStack == null) return state.indentation; - return state.indentStack.indent; - } - }; -}); - -CodeMirror.defineMIME("text/x-clojure", "clojure"); diff --git a/doc/design/js/mode/clojure/index.html b/doc/design/js/mode/clojure/index.html deleted file mode 100644 index 9762d5892..000000000 --- a/doc/design/js/mode/clojure/index.html +++ /dev/null @@ -1,66 +0,0 @@ - - - - CodeMirror: Clojure mode - - - - - - - -

CodeMirror: Clojure mode

-
- - -

MIME types defined: text/x-clojure.

- - - diff --git a/doc/design/js/mode/coffeescript/LICENSE b/doc/design/js/mode/coffeescript/LICENSE deleted file mode 100644 index 977e284e0..000000000 --- a/doc/design/js/mode/coffeescript/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License - -Copyright (c) 2011 Jeff Pickhardt -Modified from the Python CodeMirror mode, Copyright (c) 2010 Timothy Farrell - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. \ No newline at end of file diff --git a/doc/design/js/mode/coffeescript/coffeescript.js b/doc/design/js/mode/coffeescript/coffeescript.js deleted file mode 100644 index 4f2bd66d2..000000000 --- a/doc/design/js/mode/coffeescript/coffeescript.js +++ /dev/null @@ -1,341 +0,0 @@ -/** - * Link to the project's GitHub page: - * https://github.com/pickhardt/coffeescript-codemirror-mode - */ -CodeMirror.defineMode('coffeescript', function(conf) { - var ERRORCLASS = 'error'; - - function wordRegexp(words) { - return new RegExp("^((" + words.join(")|(") + "))\\b"); - } - - var singleOperators = new RegExp("^[\\+\\-\\*/%&|\\^~<>!\?]"); - var singleDelimiters = new RegExp('^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]'); - var doubleOperators = new RegExp("^((\->)|(\=>)|(\\+\\+)|(\\+\\=)|(\\-\\-)|(\\-\\=)|(\\*\\*)|(\\*\\=)|(\\/\\/)|(\\/\\=)|(==)|(!=)|(<=)|(>=)|(<>)|(<<)|(>>)|(//))"); - var doubleDelimiters = new RegExp("^((\\.\\.)|(\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))"); - var tripleDelimiters = new RegExp("^((\\.\\.\\.)|(//=)|(>>=)|(<<=)|(\\*\\*=))"); - var identifiers = new RegExp("^[_A-Za-z$][_A-Za-z$0-9]*"); - - var wordOperators = wordRegexp(['and', 'or', 'not', - 'is', 'isnt', 'in', - 'instanceof', 'typeof']); - var indentKeywords = ['for', 'while', 'loop', 'if', 'unless', 'else', - 'switch', 'try', 'catch', 'finally', 'class']; - var commonKeywords = ['break', 'by', 'continue', 'debugger', 'delete', - 'do', 'in', 'of', 'new', 'return', 'then', - 'this', 'throw', 'when', 'until']; - - var keywords = wordRegexp(indentKeywords.concat(commonKeywords)); - - indentKeywords = wordRegexp(indentKeywords); - - - var stringPrefixes = new RegExp("^('{3}|\"{3}|['\"])"); - var regexPrefixes = new RegExp("^(/{3}|/)"); - var commonConstants = ['Infinity', 'NaN', 'undefined', 'null', 'true', 'false', 'on', 'off', 'yes', 'no']; - var constants = wordRegexp(commonConstants); - - // Tokenizers - function tokenBase(stream, state) { - // Handle scope changes - if (stream.sol()) { - var scopeOffset = state.scopes[0].offset; - if (stream.eatSpace()) { - var lineOffset = stream.indentation(); - if (lineOffset > scopeOffset) { - return 'indent'; - } else if (lineOffset < scopeOffset) { - return 'dedent'; - } - return null; - } else { - if (scopeOffset > 0) { - dedent(stream, state); - } - } - } - if (stream.eatSpace()) { - return null; - } - - var ch = stream.peek(); - - // Handle multi line comments - if (stream.match("###")) { - state.tokenize = longComment; - return state.tokenize(stream, state); - } - - // Single line comment - if (ch === '#') { - stream.skipToEnd(); - return 'comment'; - } - - // Handle number literals - if (stream.match(/^-?[0-9\.]/, false)) { - var floatLiteral = false; - // Floats - if (stream.match(/^-?\d*\.\d+(e[\+\-]?\d+)?/i)) { - floatLiteral = true; - } - if (stream.match(/^-?\d+\.\d*/)) { - floatLiteral = true; - } - if (stream.match(/^-?\.\d+/)) { - floatLiteral = true; - } - - if (floatLiteral) { - // prevent from getting extra . on 1.. - if (stream.peek() == "."){ - stream.backUp(1); - } - return 'number'; - } - // Integers - var intLiteral = false; - // Hex - if (stream.match(/^-?0x[0-9a-f]+/i)) { - intLiteral = true; - } - // Decimal - if (stream.match(/^-?[1-9]\d*(e[\+\-]?\d+)?/)) { - intLiteral = true; - } - // Zero by itself with no other piece of number. - if (stream.match(/^-?0(?![\dx])/i)) { - intLiteral = true; - } - if (intLiteral) { - return 'number'; - } - } - - // Handle strings - if (stream.match(stringPrefixes)) { - state.tokenize = tokenFactory(stream.current(), 'string'); - return state.tokenize(stream, state); - } - // Handle regex literals - if (stream.match(regexPrefixes)) { - if (stream.current() != '/' || stream.match(/^.*\//, false)) { // prevent highlight of division - state.tokenize = tokenFactory(stream.current(), 'string-2'); - return state.tokenize(stream, state); - } else { - stream.backUp(1); - } - } - - // Handle operators and delimiters - if (stream.match(tripleDelimiters) || stream.match(doubleDelimiters)) { - return 'punctuation'; - } - if (stream.match(doubleOperators) - || stream.match(singleOperators) - || stream.match(wordOperators)) { - return 'operator'; - } - if (stream.match(singleDelimiters)) { - return 'punctuation'; - } - - if (stream.match(constants)) { - return 'atom'; - } - - if (stream.match(keywords)) { - return 'keyword'; - } - - if (stream.match(identifiers)) { - return 'variable'; - } - - // Handle non-detected items - stream.next(); - return ERRORCLASS; - } - - function tokenFactory(delimiter, outclass) { - var singleline = delimiter.length == 1; - return function tokenString(stream, state) { - while (!stream.eol()) { - stream.eatWhile(/[^'"\/\\]/); - if (stream.eat('\\')) { - stream.next(); - if (singleline && stream.eol()) { - return outclass; - } - } else if (stream.match(delimiter)) { - state.tokenize = tokenBase; - return outclass; - } else { - stream.eat(/['"\/]/); - } - } - if (singleline) { - if (conf.mode.singleLineStringErrors) { - outclass = ERRORCLASS - } else { - state.tokenize = tokenBase; - } - } - return outclass; - }; - } - - function longComment(stream, state) { - while (!stream.eol()) { - stream.eatWhile(/[^#]/); - if (stream.match("###")) { - state.tokenize = tokenBase; - break; - } - stream.eatWhile("#"); - } - return "comment" - } - - function indent(stream, state, type) { - type = type || 'coffee'; - var indentUnit = 0; - if (type === 'coffee') { - for (var i = 0; i < state.scopes.length; i++) { - if (state.scopes[i].type === 'coffee') { - indentUnit = state.scopes[i].offset + conf.indentUnit; - break; - } - } - } else { - indentUnit = stream.column() + stream.current().length; - } - state.scopes.unshift({ - offset: indentUnit, - type: type - }); - } - - function dedent(stream, state) { - if (state.scopes.length == 1) return; - if (state.scopes[0].type === 'coffee') { - var _indent = stream.indentation(); - var _indent_index = -1; - for (var i = 0; i < state.scopes.length; ++i) { - if (_indent === state.scopes[i].offset) { - _indent_index = i; - break; - } - } - if (_indent_index === -1) { - return true; - } - while (state.scopes[0].offset !== _indent) { - state.scopes.shift(); - } - return false - } else { - state.scopes.shift(); - return false; - } - } - - function tokenLexer(stream, state) { - var style = state.tokenize(stream, state); - var current = stream.current(); - - // Handle '.' connected identifiers - if (current === '.') { - style = state.tokenize(stream, state); - current = stream.current(); - if (style === 'variable') { - return 'variable'; - } else { - return ERRORCLASS; - } - } - - // Handle properties - if (current === '@') { - stream.eat('@'); - return 'keyword'; - } - - // Handle scope changes. - if (current === 'return') { - state.dedent += 1; - } - if (((current === '->' || current === '=>') && - !state.lambda && - state.scopes[0].type == 'coffee' && - stream.peek() === '') - || style === 'indent') { - indent(stream, state); - } - var delimiter_index = '[({'.indexOf(current); - if (delimiter_index !== -1) { - indent(stream, state, '])}'.slice(delimiter_index, delimiter_index+1)); - } - if (indentKeywords.exec(current)){ - indent(stream, state); - } - if (current == 'then'){ - dedent(stream, state); - } - - - if (style === 'dedent') { - if (dedent(stream, state)) { - return ERRORCLASS; - } - } - delimiter_index = '])}'.indexOf(current); - if (delimiter_index !== -1) { - if (dedent(stream, state)) { - return ERRORCLASS; - } - } - if (state.dedent > 0 && stream.eol() && state.scopes[0].type == 'coffee') { - if (state.scopes.length > 1) state.scopes.shift(); - state.dedent -= 1; - } - - return style; - } - - var external = { - startState: function(basecolumn) { - return { - tokenize: tokenBase, - scopes: [{offset:basecolumn || 0, type:'coffee'}], - lastToken: null, - lambda: false, - dedent: 0 - }; - }, - - token: function(stream, state) { - var style = tokenLexer(stream, state); - - state.lastToken = {style:style, content: stream.current()}; - - if (stream.eol() && stream.lambda) { - state.lambda = false; - } - - return style; - }, - - indent: function(state, textAfter) { - if (state.tokenize != tokenBase) { - return 0; - } - - return state.scopes[0].offset; - } - - }; - return external; -}); - -CodeMirror.defineMIME('text/x-coffeescript', 'coffeescript'); diff --git a/doc/design/js/mode/coffeescript/index.html b/doc/design/js/mode/coffeescript/index.html deleted file mode 100644 index 127c4bf97..000000000 --- a/doc/design/js/mode/coffeescript/index.html +++ /dev/null @@ -1,721 +0,0 @@ - - - - CodeMirror: CoffeeScript mode - - - - - - - -

CodeMirror: CoffeeScript mode

-
- - -

MIME types defined: text/x-coffeescript.

- -

The CoffeeScript mode was written by Jeff Pickhardt (license).

- - - diff --git a/doc/design/js/mode/css/css.js b/doc/design/js/mode/css/css.js deleted file mode 100644 index 45170a3d7..000000000 --- a/doc/design/js/mode/css/css.js +++ /dev/null @@ -1,124 +0,0 @@ -CodeMirror.defineMode("css", function(config) { - var indentUnit = config.indentUnit, type; - function ret(style, tp) {type = tp; return style;} - - function tokenBase(stream, state) { - var ch = stream.next(); - if (ch == "@") {stream.eatWhile(/[\w\\\-]/); return ret("meta", stream.current());} - else if (ch == "/" && stream.eat("*")) { - state.tokenize = tokenCComment; - return tokenCComment(stream, state); - } - else if (ch == "<" && stream.eat("!")) { - state.tokenize = tokenSGMLComment; - return tokenSGMLComment(stream, state); - } - else if (ch == "=") ret(null, "compare"); - else if ((ch == "~" || ch == "|") && stream.eat("=")) return ret(null, "compare"); - else if (ch == "\"" || ch == "'") { - state.tokenize = tokenString(ch); - return state.tokenize(stream, state); - } - else if (ch == "#") { - stream.eatWhile(/[\w\\\-]/); - return ret("atom", "hash"); - } - else if (ch == "!") { - stream.match(/^\s*\w*/); - return ret("keyword", "important"); - } - else if (/\d/.test(ch)) { - stream.eatWhile(/[\w.%]/); - return ret("number", "unit"); - } - else if (/[,.+>*\/]/.test(ch)) { - return ret(null, "select-op"); - } - else if (/[;{}:\[\]]/.test(ch)) { - return ret(null, ch); - } - else { - stream.eatWhile(/[\w\\\-]/); - return ret("variable", "variable"); - } - } - - function tokenCComment(stream, state) { - var maybeEnd = false, ch; - while ((ch = stream.next()) != null) { - if (maybeEnd && ch == "/") { - state.tokenize = tokenBase; - break; - } - maybeEnd = (ch == "*"); - } - return ret("comment", "comment"); - } - - function tokenSGMLComment(stream, state) { - var dashes = 0, ch; - while ((ch = stream.next()) != null) { - if (dashes >= 2 && ch == ">") { - state.tokenize = tokenBase; - break; - } - dashes = (ch == "-") ? dashes + 1 : 0; - } - return ret("comment", "comment"); - } - - function tokenString(quote) { - return function(stream, state) { - var escaped = false, ch; - while ((ch = stream.next()) != null) { - if (ch == quote && !escaped) - break; - escaped = !escaped && ch == "\\"; - } - if (!escaped) state.tokenize = tokenBase; - return ret("string", "string"); - }; - } - - return { - startState: function(base) { - return {tokenize: tokenBase, - baseIndent: base || 0, - stack: []}; - }, - - token: function(stream, state) { - if (stream.eatSpace()) return null; - var style = state.tokenize(stream, state); - - var context = state.stack[state.stack.length-1]; - if (type == "hash" && context == "rule") style = "atom"; - else if (style == "variable") { - if (context == "rule") style = "number"; - else if (!context || context == "@media{") style = "tag"; - } - - if (context == "rule" && /^[\{\};]$/.test(type)) - state.stack.pop(); - if (type == "{") { - if (context == "@media") state.stack[state.stack.length-1] = "@media{"; - else state.stack.push("{"); - } - else if (type == "}") state.stack.pop(); - else if (type == "@media") state.stack.push("@media"); - else if (context == "{" && type != "comment") state.stack.push("rule"); - return style; - }, - - indent: function(state, textAfter) { - var n = state.stack.length; - if (/^\}/.test(textAfter)) - n -= state.stack[state.stack.length-1] == "rule" ? 2 : 1; - return state.baseIndent + n * indentUnit; - }, - - electricChars: "}" - }; -}); - -CodeMirror.defineMIME("text/css", "css"); diff --git a/doc/design/js/mode/css/index.html b/doc/design/js/mode/css/index.html deleted file mode 100644 index 49934346d..000000000 --- a/doc/design/js/mode/css/index.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - CodeMirror: CSS mode - - - - - - - -

CodeMirror: CSS mode

-
- - -

MIME types defined: text/css.

- - - diff --git a/doc/design/js/mode/diff/diff.css b/doc/design/js/mode/diff/diff.css deleted file mode 100644 index 0e96ab21e..000000000 --- a/doc/design/js/mode/diff/diff.css +++ /dev/null @@ -1,3 +0,0 @@ -span.cm-rangeinfo {color: #a0b;} -span.cm-minus {color: red;} -span.cm-plus {color: #2b2;} diff --git a/doc/design/js/mode/diff/diff.js b/doc/design/js/mode/diff/diff.js deleted file mode 100644 index 725bb2c74..000000000 --- a/doc/design/js/mode/diff/diff.js +++ /dev/null @@ -1,13 +0,0 @@ -CodeMirror.defineMode("diff", function() { - return { - token: function(stream) { - var ch = stream.next(); - stream.skipToEnd(); - if (ch == "+") return "plus"; - if (ch == "-") return "minus"; - if (ch == "@") return "rangeinfo"; - } - }; -}); - -CodeMirror.defineMIME("text/x-diff", "diff"); diff --git a/doc/design/js/mode/diff/index.html b/doc/design/js/mode/diff/index.html deleted file mode 100644 index 2540236c7..000000000 --- a/doc/design/js/mode/diff/index.html +++ /dev/null @@ -1,99 +0,0 @@ - - - - CodeMirror: Diff mode - - - - - - - - -

CodeMirror: Diff mode

-
- - -

MIME types defined: text/x-diff.

- - - diff --git a/doc/design/js/mode/gfm/gfm.js b/doc/design/js/mode/gfm/gfm.js deleted file mode 100644 index 1e9d7d872..000000000 --- a/doc/design/js/mode/gfm/gfm.js +++ /dev/null @@ -1,108 +0,0 @@ -CodeMirror.defineMode("gfm", function(config, parserConfig) { - var mdMode = CodeMirror.getMode(config, "markdown"); - var aliases = { - html: "htmlmixed", - js: "javascript", - json: "application/json", - c: "text/x-csrc", - "c++": "text/x-c++src", - java: "text/x-java", - csharp: "text/x-csharp", - "c#": "text/x-csharp", - }; - - // make this lazy so that we don't need to load GFM last - var getMode = (function () { - var i, modes = {}, mimes = {}, mime; - - var list = CodeMirror.listModes(); - for (i = 0; i < list.length; i++) { - modes[list[i]] = list[i]; - } - var mimesList = CodeMirror.listMIMEs(); - for (i = 0; i < mimesList.length; i++) { - mime = mimesList[i].mime; - mimes[mime] = mimesList[i].mime; - } - - for (var a in aliases) { - if (aliases[a] in modes || aliases[a] in mimes) - modes[a] = aliases[a]; - } - - return function (lang) { - return modes[lang] ? CodeMirror.getMode(config, modes[lang]) : null; - } - }()); - - function markdown(stream, state) { - // intercept fenced code blocks - if (stream.sol() && stream.match(/^```([\w+#]*)/)) { - // try switching mode - state.localMode = getMode(RegExp.$1) - if (state.localMode) - state.localState = state.localMode.startState(); - - state.token = local; - return 'code'; - } - - return mdMode.token(stream, state.mdState); - } - - function local(stream, state) { - if (stream.sol() && stream.match(/^```/)) { - state.localMode = state.localState = null; - state.token = markdown; - return 'code'; - } - else if (state.localMode) { - return state.localMode.token(stream, state.localState); - } else { - stream.skipToEnd(); - return 'code'; - } - } - - // custom handleText to prevent emphasis in the middle of a word - // and add autolinking - function handleText(stream, mdState) { - var match; - if (stream.match(/^\w+:\/\/\S+/)) { - return 'linkhref'; - } - if (stream.match(/^[^\[*\\<>` _][^\[*\\<>` ]*[^\[*\\<>` _]/)) { - return mdMode.getType(mdState); - } - if (match = stream.match(/^[^\[*\\<>` ]+/)) { - var word = match[0]; - if (word[0] === '_' && word[word.length-1] === '_') { - stream.backUp(word.length); - return undefined; - } - return mdMode.getType(mdState); - } - if (stream.eatSpace()) { - return null; - } - } - - return { - startState: function() { - var mdState = mdMode.startState(); - mdState.text = handleText; - return {token: markdown, mode: "markdown", mdState: mdState, - localMode: null, localState: null}; - }, - - copyState: function(state) { - return {token: state.token, mode: state.mode, mdState: CodeMirror.copyState(mdMode, state.mdState), - localMode: state.localMode, - localState: state.localMode ? CodeMirror.copyState(state.localMode, state.localState) : null}; - }, - - token: function(stream, state) { - return state.token(stream, state); - } - } -}); diff --git a/doc/design/js/mode/gfm/index.html b/doc/design/js/mode/gfm/index.html deleted file mode 100644 index b27d49abe..000000000 --- a/doc/design/js/mode/gfm/index.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - CodeMirror: GFM mode - - - - - - - - - - - -

CodeMirror: GFM mode

- - -
- - - - - diff --git a/doc/design/js/mode/go/go.js b/doc/design/js/mode/go/go.js deleted file mode 100644 index 1160100d8..000000000 --- a/doc/design/js/mode/go/go.js +++ /dev/null @@ -1,172 +0,0 @@ -CodeMirror.defineMode("go", function(config, parserConfig) { - var indentUnit = config.indentUnit; - - var keywords = { - "break":true, "case":true, "chan":true, "const":true, "continue":true, - "default":true, "defer":true, "else":true, "fallthrough":true, "for":true, - "func":true, "go":true, "goto":true, "if":true, "import":true, "interface":true, - "map":true, "package":true, "range":true, "return":true, "select":true, - "struct":true, "switch":true, "type":true, "var":true, "bool":true, "byte":true, - "complex64":true, "complex128":true, "float32":true, "float64":true, - "int8":true, "int16":true, "int32":true, "int64":true, "string":true, - "uint8":true, "uint16":true, "uint32":true, "uint64":true, "int":true, - "uint":true, "uintptr":true - }; - - var atoms = { - "true":true, "false":true, "iota":true, "nil":true, "append":true, - "cap":true, "close":true, "complex":true, "copy":true, "imag":true, "len":true, - "make":true, "new":true, "panic":true, "print":true, "println":true, - "real":true, "recover":true - }; - - var blockKeywords = { - "else":true, "for":true, "func":true, "if":true, "interface":true, - "select":true, "struct":true, "switch":true - }; - - var isOperatorChar = /[+\-*&^%:=<>!|\/]/; - - var curPunc; - - function tokenBase(stream, state) { - var ch = stream.next(); - if (ch == '"' || ch == "'" || ch == "`") { - state.tokenize = tokenString(ch); - return state.tokenize(stream, state); - } - if (/[\d\.]/.test(ch)) { - if (ch == ".") { - stream.match(/^[0-9]+([eE][\-+]?[0-9]+)?/); - } else if (ch == "0") { - stream.match(/^[xX][0-9a-fA-F]+/) || stream.match(/^0[0-7]+/); - } else { - stream.match(/^[0-9]*\.?[0-9]*([eE][\-+]?[0-9]+)?/); - } - return "number"; - } - if (/[\[\]{}\(\),;\:\.]/.test(ch)) { - curPunc = ch; - return null - } - if (ch == "/") { - if (stream.eat("*")) { - state.tokenize = tokenComment; - return tokenComment(stream, state); - } - if (stream.eat("/")) { - stream.skipToEnd(); - return "comment"; - } - } - if (isOperatorChar.test(ch)) { - stream.eatWhile(isOperatorChar); - return "operator"; - } - stream.eatWhile(/[\w\$_]/); - var cur = stream.current(); - if (keywords.propertyIsEnumerable(cur)) { - if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement"; - return "keyword"; - } - if (atoms.propertyIsEnumerable(cur)) return "atom"; - return "word"; - } - - function tokenString(quote) { - return function(stream, state) { - var escaped = false, next, end = false; - while ((next = stream.next()) != null) { - if (next == quote && !escaped) {end = true; break;} - escaped = !escaped && next == "\\"; - } - if (end || !(escaped || quote == "`")) - state.tokenize = tokenBase; - return "string"; - }; - } - - function tokenComment(stream, state) { - var maybeEnd = false, ch; - while (ch = stream.next()) { - if (ch == "/" && maybeEnd) { - state.tokenize = tokenBase; - break; - } - maybeEnd = (ch == "*"); - } - return "comment"; - } - - function Context(indented, column, type, align, prev) { - this.indented = indented; - this.column = column; - this.type = type; - this.align = align; - this.prev = prev; - } - function pushContext(state, col, type) { - return state.context = new Context(state.indented, col, type, null, state.context); - } - function popContext(state) { - var t = state.context.type; - if (t == ")" || t == "]" || t == "}") - state.indented = state.context.indented; - return state.context = state.context.prev; - } - - // Interface - - return { - startState: function(basecolumn) { - return { - tokenize: null, - context: new Context((basecolumn || 0) - indentUnit, 0, "top", false), - indented: 0, - startOfLine: true - }; - }, - - token: function(stream, state) { - var ctx = state.context; - if (stream.sol()) { - if (ctx.align == null) ctx.align = false; - state.indented = stream.indentation(); - state.startOfLine = true; - } - if (stream.eatSpace()) return null; - curPunc = null; - var style = (state.tokenize || tokenBase)(stream, state); - if (style == "comment") return style; - if (ctx.align == null) ctx.align = true; - - if (curPunc == "{") pushContext(state, stream.column(), "}"); - else if (curPunc == "[") pushContext(state, stream.column(), "]"); - else if (curPunc == "(") pushContext(state, stream.column(), ")"); - else if (curPunc == "}") { - while (ctx.type == "statement") ctx = popContext(state); - if (ctx.type == "}") ctx = popContext(state); - while (ctx.type == "statement") ctx = popContext(state); - } - else if (curPunc == ctx.type) popContext(state); - else if (ctx.type == "}" || ctx.type == "top" || (ctx.type == "statement" && curPunc == "newstatement")) - pushContext(state, stream.column(), "statement"); - state.startOfLine = false; - return style; - }, - - indent: function(state, textAfter) { - if (state.tokenize != tokenBase && state.tokenize != null) return 0; - var ctx = state.context, firstChar = textAfter && textAfter.charAt(0); - if (ctx.type == "statement" && firstChar == "}") ctx = ctx.prev; - var closing = firstChar == ctx.type; - if (ctx.type == "statement") return ctx.indented; - else if (ctx.align) return ctx.column + (closing ? 0 : 1); - else return ctx.indented + (closing ? 0 : indentUnit); - }, - - electricChars: "{}" - }; -}); - -CodeMirror.defineMIME("text/x-go", "go"); diff --git a/doc/design/js/mode/go/index.html b/doc/design/js/mode/go/index.html deleted file mode 100644 index 9cdad1ada..000000000 --- a/doc/design/js/mode/go/index.html +++ /dev/null @@ -1,72 +0,0 @@ - - - - CodeMirror: Go mode - - - - - - - - -

CodeMirror: Go mode

- -
- - - -

MIME type: text/x-go

- - diff --git a/doc/design/js/mode/groovy/groovy.js b/doc/design/js/mode/groovy/groovy.js deleted file mode 100644 index 029e0c9bd..000000000 --- a/doc/design/js/mode/groovy/groovy.js +++ /dev/null @@ -1,210 +0,0 @@ -CodeMirror.defineMode("groovy", function(config, parserConfig) { - function words(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - var keywords = words( - "abstract as assert boolean break byte case catch char class const continue def default " + - "do double else enum extends final finally float for goto if implements import in " + - "instanceof int interface long native new package private protected public return " + - "short static strictfp super switch synchronized threadsafe throw throws transient " + - "try void volatile while"); - var blockKeywords = words("catch class do else finally for if switch try while enum interface def"); - var atoms = words("null true false this"); - - var curPunc; - function tokenBase(stream, state) { - var ch = stream.next(); - if (ch == '"' || ch == "'") { - return startString(ch, stream, state); - } - if (/[\[\]{}\(\),;\:\.]/.test(ch)) { - curPunc = ch; - return null - } - if (/\d/.test(ch)) { - stream.eatWhile(/[\w\.]/); - if (stream.eat(/eE/)) { stream.eat(/\+\-/); stream.eatWhile(/\d/); } - return "number"; - } - if (ch == "/") { - if (stream.eat("*")) { - state.tokenize.push(tokenComment); - return tokenComment(stream, state); - } - if (stream.eat("/")) { - stream.skipToEnd(); - return "comment"; - } - if (expectExpression(state.lastToken)) { - return startString(ch, stream, state); - } - } - if (ch == "-" && stream.eat(">")) { - curPunc = "->"; - return null; - } - if (/[+\-*&%=<>!?|\/~]/.test(ch)) { - stream.eatWhile(/[+\-*&%=<>|~]/); - return "operator"; - } - stream.eatWhile(/[\w\$_]/); - if (ch == "@") { stream.eatWhile(/[\w\$_\.]/); return "meta"; } - if (state.lastToken == ".") return "property"; - if (stream.eat(":")) { curPunc = "proplabel"; return "property"; } - var cur = stream.current(); - if (atoms.propertyIsEnumerable(cur)) { return "atom"; } - if (keywords.propertyIsEnumerable(cur)) { - if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement"; - return "keyword"; - } - return "word"; - } - tokenBase.isBase = true; - - function startString(quote, stream, state) { - var tripleQuoted = false; - if (quote != "/" && stream.eat(quote)) { - if (stream.eat(quote)) tripleQuoted = true; - else return "string"; - } - function t(stream, state) { - var escaped = false, next, end = !tripleQuoted; - while ((next = stream.next()) != null) { - if (next == quote && !escaped) { - if (!tripleQuoted) { break; } - if (stream.match(quote + quote)) { end = true; break; } - } - if (quote == '"' && next == "$" && !escaped && stream.eat("{")) { - state.tokenize.push(tokenBaseUntilBrace()); - return "string"; - } - escaped = !escaped && next == "\\"; - } - if (end) state.tokenize.pop(); - return "string"; - } - state.tokenize.push(t); - return t(stream, state); - } - - function tokenBaseUntilBrace() { - var depth = 1; - function t(stream, state) { - if (stream.peek() == "}") { - depth--; - if (depth == 0) { - state.tokenize.pop(); - return state.tokenize[state.tokenize.length-1](stream, state); - } - } else if (stream.peek() == "{") { - depth++; - } - return tokenBase(stream, state); - } - t.isBase = true; - return t; - } - - function tokenComment(stream, state) { - var maybeEnd = false, ch; - while (ch = stream.next()) { - if (ch == "/" && maybeEnd) { - state.tokenize.pop(); - break; - } - maybeEnd = (ch == "*"); - } - return "comment"; - } - - function expectExpression(last) { - return !last || last == "operator" || last == "->" || /[\.\[\{\(,;:]/.test(last) || - last == "newstatement" || last == "keyword" || last == "proplabel"; - } - - function Context(indented, column, type, align, prev) { - this.indented = indented; - this.column = column; - this.type = type; - this.align = align; - this.prev = prev; - } - function pushContext(state, col, type) { - return state.context = new Context(state.indented, col, type, null, state.context); - } - function popContext(state) { - var t = state.context.type; - if (t == ")" || t == "]" || t == "}") - state.indented = state.context.indented; - return state.context = state.context.prev; - } - - // Interface - - return { - startState: function(basecolumn) { - return { - tokenize: [tokenBase], - context: new Context((basecolumn || 0) - config.indentUnit, 0, "top", false), - indented: 0, - startOfLine: true, - lastToken: null - }; - }, - - token: function(stream, state) { - var ctx = state.context; - if (stream.sol()) { - if (ctx.align == null) ctx.align = false; - state.indented = stream.indentation(); - state.startOfLine = true; - // Automatic semicolon insertion - if (ctx.type == "statement" && !expectExpression(state.lastToken)) { - popContext(state); ctx = state.context; - } - } - if (stream.eatSpace()) return null; - curPunc = null; - var style = state.tokenize[state.tokenize.length-1](stream, state); - if (style == "comment") return style; - if (ctx.align == null) ctx.align = true; - - if ((curPunc == ";" || curPunc == ":") && ctx.type == "statement") popContext(state); - // Handle indentation for {x -> \n ... } - else if (curPunc == "->" && ctx.type == "statement" && ctx.prev.type == "}") { - popContext(state); - state.context.align = false; - } - else if (curPunc == "{") pushContext(state, stream.column(), "}"); - else if (curPunc == "[") pushContext(state, stream.column(), "]"); - else if (curPunc == "(") pushContext(state, stream.column(), ")"); - else if (curPunc == "}") { - while (ctx.type == "statement") ctx = popContext(state); - if (ctx.type == "}") ctx = popContext(state); - while (ctx.type == "statement") ctx = popContext(state); - } - else if (curPunc == ctx.type) popContext(state); - else if (ctx.type == "}" || ctx.type == "top" || (ctx.type == "statement" && curPunc == "newstatement")) - pushContext(state, stream.column(), "statement"); - state.startOfLine = false; - state.lastToken = curPunc || style; - return style; - }, - - indent: function(state, textAfter) { - if (!state.tokenize[state.tokenize.length-1].isBase) return 0; - var firstChar = textAfter && textAfter.charAt(0), ctx = state.context; - if (ctx.type == "statement" && !expectExpression(state.lastToken)) ctx = ctx.prev; - var closing = firstChar == ctx.type; - if (ctx.type == "statement") return ctx.indented + (firstChar == "{" ? 0 : config.indentUnit); - else if (ctx.align) return ctx.column + (closing ? 0 : 1); - else return ctx.indented + (closing ? 0 : config.indentUnit); - }, - - electricChars: "{}" - }; -}); - -CodeMirror.defineMIME("text/x-groovy", "groovy"); diff --git a/doc/design/js/mode/groovy/index.html b/doc/design/js/mode/groovy/index.html deleted file mode 100644 index 226475caa..000000000 --- a/doc/design/js/mode/groovy/index.html +++ /dev/null @@ -1,71 +0,0 @@ - - - - CodeMirror: Groovy mode - - - - - - - -

CodeMirror: Groovy mode

- -
- - - -

MIME types defined: text/x-groovy

- - diff --git a/doc/design/js/mode/haskell/haskell.js b/doc/design/js/mode/haskell/haskell.js deleted file mode 100644 index aac504108..000000000 --- a/doc/design/js/mode/haskell/haskell.js +++ /dev/null @@ -1,242 +0,0 @@ -CodeMirror.defineMode("haskell", function(cmCfg, modeCfg) { - - function switchState(source, setState, f) { - setState(f); - return f(source, setState); - } - - // These should all be Unicode extended, as per the Haskell 2010 report - var smallRE = /[a-z_]/; - var largeRE = /[A-Z]/; - var digitRE = /[0-9]/; - var hexitRE = /[0-9A-Fa-f]/; - var octitRE = /[0-7]/; - var idRE = /[a-z_A-Z0-9']/; - var symbolRE = /[-!#$%&*+.\/<=>?@\\^|~:]/; - var specialRE = /[(),;[\]`{}]/; - var whiteCharRE = /[ \t\v\f]/; // newlines are handled in tokenizer - - function normal(source, setState) { - if (source.eatWhile(whiteCharRE)) { - return null; - } - - var ch = source.next(); - if (specialRE.test(ch)) { - if (ch == '{' && source.eat('-')) { - var t = "comment"; - if (source.eat('#')) { - t = "meta"; - } - return switchState(source, setState, ncomment(t, 1)); - } - return null; - } - - if (ch == '\'') { - if (source.eat('\\')) { - source.next(); // should handle other escapes here - } - else { - source.next(); - } - if (source.eat('\'')) { - return "string"; - } - return "error"; - } - - if (ch == '"') { - return switchState(source, setState, stringLiteral); - } - - if (largeRE.test(ch)) { - source.eatWhile(idRE); - if (source.eat('.')) { - return "qualifier"; - } - return "variable-2"; - } - - if (smallRE.test(ch)) { - source.eatWhile(idRE); - return "variable"; - } - - if (digitRE.test(ch)) { - if (ch == '0') { - if (source.eat(/[xX]/)) { - source.eatWhile(hexitRE); // should require at least 1 - return "integer"; - } - if (source.eat(/[oO]/)) { - source.eatWhile(octitRE); // should require at least 1 - return "number"; - } - } - source.eatWhile(digitRE); - var t = "number"; - if (source.eat('.')) { - t = "number"; - source.eatWhile(digitRE); // should require at least 1 - } - if (source.eat(/[eE]/)) { - t = "number"; - source.eat(/[-+]/); - source.eatWhile(digitRE); // should require at least 1 - } - return t; - } - - if (symbolRE.test(ch)) { - if (ch == '-' && source.eat(/-/)) { - source.eatWhile(/-/); - if (!source.eat(symbolRE)) { - source.skipToEnd(); - return "comment"; - } - } - var t = "variable"; - if (ch == ':') { - t = "variable-2"; - } - source.eatWhile(symbolRE); - return t; - } - - return "error"; - } - - function ncomment(type, nest) { - if (nest == 0) { - return normal; - } - return function(source, setState) { - var currNest = nest; - while (!source.eol()) { - var ch = source.next(); - if (ch == '{' && source.eat('-')) { - ++currNest; - } - else if (ch == '-' && source.eat('}')) { - --currNest; - if (currNest == 0) { - setState(normal); - return type; - } - } - } - setState(ncomment(type, currNest)); - return type; - } - } - - function stringLiteral(source, setState) { - while (!source.eol()) { - var ch = source.next(); - if (ch == '"') { - setState(normal); - return "string"; - } - if (ch == '\\') { - if (source.eol() || source.eat(whiteCharRE)) { - setState(stringGap); - return "string"; - } - if (source.eat('&')) { - } - else { - source.next(); // should handle other escapes here - } - } - } - setState(normal); - return "error"; - } - - function stringGap(source, setState) { - if (source.eat('\\')) { - return switchState(source, setState, stringLiteral); - } - source.next(); - setState(normal); - return "error"; - } - - - var wellKnownWords = (function() { - var wkw = {}; - function setType(t) { - return function () { - for (var i = 0; i < arguments.length; i++) - wkw[arguments[i]] = t; - } - } - - setType("keyword")( - "case", "class", "data", "default", "deriving", "do", "else", "foreign", - "if", "import", "in", "infix", "infixl", "infixr", "instance", "let", - "module", "newtype", "of", "then", "type", "where", "_"); - - setType("keyword")( - "\.\.", ":", "::", "=", "\\", "\"", "<-", "->", "@", "~", "=>"); - - setType("builtin")( - "!!", "$!", "$", "&&", "+", "++", "-", ".", "/", "/=", "<", "<=", "=<<", - "==", ">", ">=", ">>", ">>=", "^", "^^", "||", "*", "**"); - - setType("builtin")( - "Bool", "Bounded", "Char", "Double", "EQ", "Either", "Enum", "Eq", - "False", "FilePath", "Float", "Floating", "Fractional", "Functor", "GT", - "IO", "IOError", "Int", "Integer", "Integral", "Just", "LT", "Left", - "Maybe", "Monad", "Nothing", "Num", "Ord", "Ordering", "Rational", "Read", - "ReadS", "Real", "RealFloat", "RealFrac", "Right", "Show", "ShowS", - "String", "True"); - - setType("builtin")( - "abs", "acos", "acosh", "all", "and", "any", "appendFile", "asTypeOf", - "asin", "asinh", "atan", "atan2", "atanh", "break", "catch", "ceiling", - "compare", "concat", "concatMap", "const", "cos", "cosh", "curry", - "cycle", "decodeFloat", "div", "divMod", "drop", "dropWhile", "either", - "elem", "encodeFloat", "enumFrom", "enumFromThen", "enumFromThenTo", - "enumFromTo", "error", "even", "exp", "exponent", "fail", "filter", - "flip", "floatDigits", "floatRadix", "floatRange", "floor", "fmap", - "foldl", "foldl1", "foldr", "foldr1", "fromEnum", "fromInteger", - "fromIntegral", "fromRational", "fst", "gcd", "getChar", "getContents", - "getLine", "head", "id", "init", "interact", "ioError", "isDenormalized", - "isIEEE", "isInfinite", "isNaN", "isNegativeZero", "iterate", "last", - "lcm", "length", "lex", "lines", "log", "logBase", "lookup", "map", - "mapM", "mapM_", "max", "maxBound", "maximum", "maybe", "min", "minBound", - "minimum", "mod", "negate", "not", "notElem", "null", "odd", "or", - "otherwise", "pi", "pred", "print", "product", "properFraction", - "putChar", "putStr", "putStrLn", "quot", "quotRem", "read", "readFile", - "readIO", "readList", "readLn", "readParen", "reads", "readsPrec", - "realToFrac", "recip", "rem", "repeat", "replicate", "return", "reverse", - "round", "scaleFloat", "scanl", "scanl1", "scanr", "scanr1", "seq", - "sequence", "sequence_", "show", "showChar", "showList", "showParen", - "showString", "shows", "showsPrec", "significand", "signum", "sin", - "sinh", "snd", "span", "splitAt", "sqrt", "subtract", "succ", "sum", - "tail", "take", "takeWhile", "tan", "tanh", "toEnum", "toInteger", - "toRational", "truncate", "uncurry", "undefined", "unlines", "until", - "unwords", "unzip", "unzip3", "userError", "words", "writeFile", "zip", - "zip3", "zipWith", "zipWith3"); - - return wkw; - })(); - - - - return { - startState: function () { return { f: normal }; }, - copyState: function (s) { return { f: s.f }; }, - - token: function(stream, state) { - var t = state.f(stream, function(s) { state.f = s; }); - var w = stream.current(); - return (w in wellKnownWords) ? wellKnownWords[w] : t; - } - }; - -}); - -CodeMirror.defineMIME("text/x-haskell", "haskell"); diff --git a/doc/design/js/mode/haskell/index.html b/doc/design/js/mode/haskell/index.html deleted file mode 100644 index 15706e710..000000000 --- a/doc/design/js/mode/haskell/index.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - CodeMirror: Haskell mode - - - - - - - - -

CodeMirror: Haskell mode

- -
- - - -

MIME types defined: text/x-haskell.

- - diff --git a/doc/design/js/mode/htmlembedded/htmlembedded.js b/doc/design/js/mode/htmlembedded/htmlembedded.js deleted file mode 100644 index 08e170ea9..000000000 --- a/doc/design/js/mode/htmlembedded/htmlembedded.js +++ /dev/null @@ -1,68 +0,0 @@ -CodeMirror.defineMode("htmlembedded", function(config, parserConfig) { - - //config settings - var scriptStartRegex = parserConfig.scriptStartRegex || /^<%/i, - scriptEndRegex = parserConfig.scriptEndRegex || /^%>/i; - - //inner modes - var scriptingMode, htmlMixedMode; - - //tokenizer when in html mode - function htmlDispatch(stream, state) { - if (stream.match(scriptStartRegex, false)) { - state.token=scriptingDispatch; - return scriptingMode.token(stream, state.scriptState); - } - else - return htmlMixedMode.token(stream, state.htmlState); - } - - //tokenizer when in scripting mode - function scriptingDispatch(stream, state) { - if (stream.match(scriptEndRegex, false)) { - state.token=htmlDispatch; - return htmlMixedMode.token(stream, state.htmlState); - } - else - return scriptingMode.token(stream, state.scriptState); - } - - - return { - startState: function() { - scriptingMode = scriptingMode || CodeMirror.getMode(config, parserConfig.scriptingModeSpec); - htmlMixedMode = htmlMixedMode || CodeMirror.getMode(config, "htmlmixed"); - return { - token : parserConfig.startOpen ? scriptingDispatch : htmlDispatch, - htmlState : htmlMixedMode.startState(), - scriptState : scriptingMode.startState() - } - }, - - token: function(stream, state) { - return state.token(stream, state); - }, - - indent: function(state, textAfter) { - if (state.token == htmlDispatch) - return htmlMixedMode.indent(state.htmlState, textAfter); - else - return scriptingMode.indent(state.scriptState, textAfter); - }, - - copyState: function(state) { - return { - token : state.token, - htmlState : CodeMirror.copyState(htmlMixedMode, state.htmlState), - scriptState : CodeMirror.copyState(scriptingMode, state.scriptState) - } - }, - - - electricChars: "/{}:" - } -}); - -CodeMirror.defineMIME("application/x-ejs", { name: "htmlembedded", scriptingModeSpec:"javascript"}); -CodeMirror.defineMIME("application/x-aspx", { name: "htmlembedded", scriptingModeSpec:"text/x-csharp"}); -CodeMirror.defineMIME("application/x-jsp", { name: "htmlembedded", scriptingModeSpec:"text/x-java"}); diff --git a/doc/design/js/mode/htmlembedded/index.html b/doc/design/js/mode/htmlembedded/index.html deleted file mode 100644 index c1374e58c..000000000 --- a/doc/design/js/mode/htmlembedded/index.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - CodeMirror: Html Embedded Scripts mode - - - - - - - - - - - -

CodeMirror: Html Embedded Scripts mode

- -
- - - -

Mode for html embedded scripts like JSP and ASP.NET. Depends on HtmlMixed which in turn depends on - JavaScript, CSS and XML.
Other dependancies include those of the scriping language chosen.

- -

MIME types defined: application/x-aspx (ASP.NET), - application/x-ejs (Embedded Javascript), application/x-jsp (JavaServer Pages)

- - diff --git a/doc/design/js/mode/htmlmixed/htmlmixed.js b/doc/design/js/mode/htmlmixed/htmlmixed.js deleted file mode 100644 index a94dc45fc..000000000 --- a/doc/design/js/mode/htmlmixed/htmlmixed.js +++ /dev/null @@ -1,83 +0,0 @@ -CodeMirror.defineMode("htmlmixed", function(config, parserConfig) { - var htmlMode = CodeMirror.getMode(config, {name: "xml", htmlMode: true}); - var jsMode = CodeMirror.getMode(config, "javascript"); - var cssMode = CodeMirror.getMode(config, "css"); - - function html(stream, state) { - var style = htmlMode.token(stream, state.htmlState); - if (style == "tag" && stream.current() == ">" && state.htmlState.context) { - if (/^script$/i.test(state.htmlState.context.tagName)) { - state.token = javascript; - state.localState = jsMode.startState(htmlMode.indent(state.htmlState, "")); - state.mode = "javascript"; - } - else if (/^style$/i.test(state.htmlState.context.tagName)) { - state.token = css; - state.localState = cssMode.startState(htmlMode.indent(state.htmlState, "")); - state.mode = "css"; - } - } - return style; - } - function maybeBackup(stream, pat, style) { - var cur = stream.current(); - var close = cur.search(pat); - if (close > -1) stream.backUp(cur.length - close); - return style; - } - function javascript(stream, state) { - if (stream.match(/^<\/\s*script\s*>/i, false)) { - state.token = html; - state.curState = null; - state.mode = "html"; - return html(stream, state); - } - return maybeBackup(stream, /<\/\s*script\s*>/, - jsMode.token(stream, state.localState)); - } - function css(stream, state) { - if (stream.match(/^<\/\s*style\s*>/i, false)) { - state.token = html; - state.localState = null; - state.mode = "html"; - return html(stream, state); - } - return maybeBackup(stream, /<\/\s*style\s*>/, - cssMode.token(stream, state.localState)); - } - - return { - startState: function() { - var state = htmlMode.startState(); - return {token: html, localState: null, mode: "html", htmlState: state}; - }, - - copyState: function(state) { - if (state.localState) - var local = CodeMirror.copyState(state.token == css ? cssMode : jsMode, state.localState); - return {token: state.token, localState: local, mode: state.mode, - htmlState: CodeMirror.copyState(htmlMode, state.htmlState)}; - }, - - token: function(stream, state) { - return state.token(stream, state); - }, - - indent: function(state, textAfter) { - if (state.token == html || /^\s*<\//.test(textAfter)) - return htmlMode.indent(state.htmlState, textAfter); - else if (state.token == javascript) - return jsMode.indent(state.localState, textAfter); - else - return cssMode.indent(state.localState, textAfter); - }, - - compareStates: function(a, b) { - return htmlMode.compareStates(a.htmlState, b.htmlState); - }, - - electricChars: "/{}:" - } -}); - -CodeMirror.defineMIME("text/html", "htmlmixed"); diff --git a/doc/design/js/mode/htmlmixed/index.html b/doc/design/js/mode/htmlmixed/index.html deleted file mode 100644 index 63fc41209..000000000 --- a/doc/design/js/mode/htmlmixed/index.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - CodeMirror: HTML mixed mode - - - - - - - - - - -

CodeMirror: HTML mixed mode

-
- - -

The HTML mixed mode depends on the XML, JavaScript, and CSS modes.

- -

MIME types defined: text/html - (redefined, only takes effect if you load this parser after the - XML parser).

- - - diff --git a/doc/design/js/mode/javascript/index.html b/doc/design/js/mode/javascript/index.html deleted file mode 100644 index c3ab91dc6..000000000 --- a/doc/design/js/mode/javascript/index.html +++ /dev/null @@ -1,77 +0,0 @@ - - - - CodeMirror: JavaScript mode - - - - - - - -

CodeMirror: JavaScript mode

- -
- - - -

JavaScript mode supports a single configuration - option, json, which will set the mode to expect JSON - data rather than a JavaScript program.

- -

MIME types defined: text/javascript, application/json.

- - diff --git a/doc/design/js/mode/javascript/javascript.js b/doc/design/js/mode/javascript/javascript.js deleted file mode 100644 index b9388bc9e..000000000 --- a/doc/design/js/mode/javascript/javascript.js +++ /dev/null @@ -1,360 +0,0 @@ -CodeMirror.defineMode("javascript", function(config, parserConfig) { - var indentUnit = config.indentUnit; - var jsonMode = parserConfig.json; - - // Tokenizer - - var keywords = function(){ - function kw(type) {return {type: type, style: "keyword"};} - var A = kw("keyword a"), B = kw("keyword b"), C = kw("keyword c"); - var operator = kw("operator"), atom = {type: "atom", style: "atom"}; - return { - "if": A, "while": A, "with": A, "else": B, "do": B, "try": B, "finally": B, - "return": C, "break": C, "continue": C, "new": C, "delete": C, "throw": C, - "var": kw("var"), "const": kw("var"), "let": kw("var"), - "function": kw("function"), "catch": kw("catch"), - "for": kw("for"), "switch": kw("switch"), "case": kw("case"), "default": kw("default"), - "in": operator, "typeof": operator, "instanceof": operator, - "true": atom, "false": atom, "null": atom, "undefined": atom, "NaN": atom, "Infinity": atom - }; - }(); - - var isOperatorChar = /[+\-*&%=<>!?|]/; - - function chain(stream, state, f) { - state.tokenize = f; - return f(stream, state); - } - - function nextUntilUnescaped(stream, end) { - var escaped = false, next; - while ((next = stream.next()) != null) { - if (next == end && !escaped) - return false; - escaped = !escaped && next == "\\"; - } - return escaped; - } - - // Used as scratch variables to communicate multiple values without - // consing up tons of objects. - var type, content; - function ret(tp, style, cont) { - type = tp; content = cont; - return style; - } - - function jsTokenBase(stream, state) { - var ch = stream.next(); - if (ch == '"' || ch == "'") - return chain(stream, state, jsTokenString(ch)); - else if (/[\[\]{}\(\),;\:\.]/.test(ch)) - return ret(ch); - else if (ch == "0" && stream.eat(/x/i)) { - stream.eatWhile(/[\da-f]/i); - return ret("number", "number"); - } - else if (/\d/.test(ch)) { - stream.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/); - return ret("number", "number"); - } - else if (ch == "/") { - if (stream.eat("*")) { - return chain(stream, state, jsTokenComment); - } - else if (stream.eat("/")) { - stream.skipToEnd(); - return ret("comment", "comment"); - } - else if (state.reAllowed) { - nextUntilUnescaped(stream, "/"); - stream.eatWhile(/[gimy]/); // 'y' is "sticky" option in Mozilla - return ret("regexp", "string-2"); - } - else { - stream.eatWhile(isOperatorChar); - return ret("operator", null, stream.current()); - } - } - else if (ch == "#") { - stream.skipToEnd(); - return ret("error", "error"); - } - else if (isOperatorChar.test(ch)) { - stream.eatWhile(isOperatorChar); - return ret("operator", null, stream.current()); - } - else { - stream.eatWhile(/[\w\$_]/); - var word = stream.current(), known = keywords.propertyIsEnumerable(word) && keywords[word]; - return (known && state.kwAllowed) ? ret(known.type, known.style, word) : - ret("variable", "variable", word); - } - } - - function jsTokenString(quote) { - return function(stream, state) { - if (!nextUntilUnescaped(stream, quote)) - state.tokenize = jsTokenBase; - return ret("string", "string"); - }; - } - - function jsTokenComment(stream, state) { - var maybeEnd = false, ch; - while (ch = stream.next()) { - if (ch == "/" && maybeEnd) { - state.tokenize = jsTokenBase; - break; - } - maybeEnd = (ch == "*"); - } - return ret("comment", "comment"); - } - - // Parser - - var atomicTypes = {"atom": true, "number": true, "variable": true, "string": true, "regexp": true}; - - function JSLexical(indented, column, type, align, prev, info) { - this.indented = indented; - this.column = column; - this.type = type; - this.prev = prev; - this.info = info; - if (align != null) this.align = align; - } - - function inScope(state, varname) { - for (var v = state.localVars; v; v = v.next) - if (v.name == varname) return true; - } - - function parseJS(state, style, type, content, stream) { - var cc = state.cc; - // Communicate our context to the combinators. - // (Less wasteful than consing up a hundred closures on every call.) - cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc; - - if (!state.lexical.hasOwnProperty("align")) - state.lexical.align = true; - - while(true) { - var combinator = cc.length ? cc.pop() : jsonMode ? expression : statement; - if (combinator(type, content)) { - while(cc.length && cc[cc.length - 1].lex) - cc.pop()(); - if (cx.marked) return cx.marked; - if (type == "variable" && inScope(state, content)) return "variable-2"; - return style; - } - } - } - - // Combinator utils - - var cx = {state: null, column: null, marked: null, cc: null}; - function pass() { - for (var i = arguments.length - 1; i >= 0; i--) cx.cc.push(arguments[i]); - } - function cont() { - pass.apply(null, arguments); - return true; - } - function register(varname) { - var state = cx.state; - if (state.context) { - cx.marked = "def"; - for (var v = state.localVars; v; v = v.next) - if (v.name == varname) return; - state.localVars = {name: varname, next: state.localVars}; - } - } - - // Combinators - - var defaultVars = {name: "this", next: {name: "arguments"}}; - function pushcontext() { - if (!cx.state.context) cx.state.localVars = defaultVars; - cx.state.context = {prev: cx.state.context, vars: cx.state.localVars}; - } - function popcontext() { - cx.state.localVars = cx.state.context.vars; - cx.state.context = cx.state.context.prev; - } - function pushlex(type, info) { - var result = function() { - var state = cx.state; - state.lexical = new JSLexical(state.indented, cx.stream.column(), type, null, state.lexical, info) - }; - result.lex = true; - return result; - } - function poplex() { - var state = cx.state; - if (state.lexical.prev) { - if (state.lexical.type == ")") - state.indented = state.lexical.indented; - state.lexical = state.lexical.prev; - } - } - poplex.lex = true; - - function expect(wanted) { - return function expecting(type) { - if (type == wanted) return cont(); - else if (wanted == ";") return pass(); - else return cont(arguments.callee); - }; - } - - function statement(type) { - if (type == "var") return cont(pushlex("vardef"), vardef1, expect(";"), poplex); - if (type == "keyword a") return cont(pushlex("form"), expression, statement, poplex); - if (type == "keyword b") return cont(pushlex("form"), statement, poplex); - if (type == "{") return cont(pushlex("}"), block, poplex); - if (type == ";") return cont(); - if (type == "function") return cont(functiondef); - if (type == "for") return cont(pushlex("form"), expect("("), pushlex(")"), forspec1, expect(")"), - poplex, statement, poplex); - if (type == "variable") return cont(pushlex("stat"), maybelabel); - if (type == "switch") return cont(pushlex("form"), expression, pushlex("}", "switch"), expect("{"), - block, poplex, poplex); - if (type == "case") return cont(expression, expect(":")); - if (type == "default") return cont(expect(":")); - if (type == "catch") return cont(pushlex("form"), pushcontext, expect("("), funarg, expect(")"), - statement, poplex, popcontext); - return pass(pushlex("stat"), expression, expect(";"), poplex); - } - function expression(type) { - if (atomicTypes.hasOwnProperty(type)) return cont(maybeoperator); - if (type == "function") return cont(functiondef); - if (type == "keyword c") return cont(maybeexpression); - if (type == "(") return cont(pushlex(")"), maybeexpression, expect(")"), poplex, maybeoperator); - if (type == "operator") return cont(expression); - if (type == "[") return cont(pushlex("]"), commasep(expression, "]"), poplex, maybeoperator); - if (type == "{") return cont(pushlex("}"), commasep(objprop, "}"), poplex, maybeoperator); - return cont(); - } - function maybeexpression(type) { - if (type.match(/[;\}\)\],]/)) return pass(); - return pass(expression); - } - - function maybeoperator(type, value) { - if (type == "operator" && /\+\+|--/.test(value)) return cont(maybeoperator); - if (type == "operator") return cont(expression); - if (type == ";") return; - if (type == "(") return cont(pushlex(")"), commasep(expression, ")"), poplex, maybeoperator); - if (type == ".") return cont(property, maybeoperator); - if (type == "[") return cont(pushlex("]"), expression, expect("]"), poplex, maybeoperator); - } - function maybelabel(type) { - if (type == ":") return cont(poplex, statement); - return pass(maybeoperator, expect(";"), poplex); - } - function property(type) { - if (type == "variable") {cx.marked = "property"; return cont();} - } - function objprop(type) { - if (type == "variable") cx.marked = "property"; - if (atomicTypes.hasOwnProperty(type)) return cont(expect(":"), expression); - } - function commasep(what, end) { - function proceed(type) { - if (type == ",") return cont(what, proceed); - if (type == end) return cont(); - return cont(expect(end)); - } - return function commaSeparated(type) { - if (type == end) return cont(); - else return pass(what, proceed); - }; - } - function block(type) { - if (type == "}") return cont(); - return pass(statement, block); - } - function vardef1(type, value) { - if (type == "variable"){register(value); return cont(vardef2);} - return cont(); - } - function vardef2(type, value) { - if (value == "=") return cont(expression, vardef2); - if (type == ",") return cont(vardef1); - } - function forspec1(type) { - if (type == "var") return cont(vardef1, forspec2); - if (type == ";") return pass(forspec2); - if (type == "variable") return cont(formaybein); - return pass(forspec2); - } - function formaybein(type, value) { - if (value == "in") return cont(expression); - return cont(maybeoperator, forspec2); - } - function forspec2(type, value) { - if (type == ";") return cont(forspec3); - if (value == "in") return cont(expression); - return cont(expression, expect(";"), forspec3); - } - function forspec3(type) { - if (type != ")") cont(expression); - } - function functiondef(type, value) { - if (type == "variable") {register(value); return cont(functiondef);} - if (type == "(") return cont(pushlex(")"), pushcontext, commasep(funarg, ")"), poplex, statement, popcontext); - } - function funarg(type, value) { - if (type == "variable") {register(value); return cont();} - } - - // Interface - - return { - startState: function(basecolumn) { - return { - tokenize: jsTokenBase, - reAllowed: true, - kwAllowed: true, - cc: [], - lexical: new JSLexical((basecolumn || 0) - indentUnit, 0, "block", false), - localVars: null, - context: null, - indented: 0 - }; - }, - - token: function(stream, state) { - if (stream.sol()) { - if (!state.lexical.hasOwnProperty("align")) - state.lexical.align = false; - state.indented = stream.indentation(); - } - if (stream.eatSpace()) return null; - var style = state.tokenize(stream, state); - if (type == "comment") return style; - state.reAllowed = type == "operator" || type == "keyword c" || type.match(/^[\[{}\(,;:]$/); - state.kwAllowed = type != '.'; - return parseJS(state, style, type, content, stream); - }, - - indent: function(state, textAfter) { - if (state.tokenize != jsTokenBase) return 0; - var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical, - type = lexical.type, closing = firstChar == type; - if (type == "vardef") return lexical.indented + 4; - else if (type == "form" && firstChar == "{") return lexical.indented; - else if (type == "stat" || type == "form") return lexical.indented + indentUnit; - else if (lexical.info == "switch" && !closing) - return lexical.indented + (/^(?:case|default)\b/.test(textAfter) ? indentUnit : 2 * indentUnit); - else if (lexical.align) return lexical.column + (closing ? 0 : 1); - else return lexical.indented + (closing ? 0 : indentUnit); - }, - - electricChars: ":{}" - }; -}); - -CodeMirror.defineMIME("text/javascript", "javascript"); -CodeMirror.defineMIME("application/json", {name: "javascript", json: true}); diff --git a/doc/design/js/mode/jinja2/index.html b/doc/design/js/mode/jinja2/index.html deleted file mode 100644 index 021a2829a..000000000 --- a/doc/design/js/mode/jinja2/index.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - CodeMirror: Jinja2 mode - - - - - - - -

CodeMirror: Jinja2 mode

-
- - - diff --git a/doc/design/js/mode/jinja2/jinja2.js b/doc/design/js/mode/jinja2/jinja2.js deleted file mode 100644 index 75419d846..000000000 --- a/doc/design/js/mode/jinja2/jinja2.js +++ /dev/null @@ -1,42 +0,0 @@ -CodeMirror.defineMode("jinja2", function(config, parserConf) { - var keywords = ["block", "endblock", "for", "endfor", "in", "true", "false", - "loop", "none", "self", "super", "if", "as", "not", "and", - "else", "import", "with", "without", "context"]; - keywords = new RegExp("^((" + keywords.join(")|(") + "))\\b"); - - function tokenBase (stream, state) { - var ch = stream.next(); - if (ch == "{") { - if (ch = stream.eat(/\{|%|#/)) { - stream.eat("-"); - state.tokenize = inTag(ch); - return "tag"; - } - } - } - function inTag (close) { - if (close == "{") { - close = "}"; - } - return function (stream, state) { - var ch = stream.next(); - if ((ch == close || (ch == "-" && stream.eat(close))) - && stream.eat("}")) { - state.tokenize = tokenBase; - return "tag"; - } - if (stream.match(keywords)) { - return "keyword"; - } - return close == "#" ? "comment" : "string"; - }; - } - return { - startState: function () { - return {tokenize: tokenBase}; - }, - token: function (stream, state) { - return state.tokenize(stream, state); - } - }; -}); diff --git a/doc/design/js/mode/less/index.html b/doc/design/js/mode/less/index.html deleted file mode 100644 index 3081b6f3b..000000000 --- a/doc/design/js/mode/less/index.html +++ /dev/null @@ -1,577 +0,0 @@ - - - - - CodeMirror: LESS mode - - - - - - - - -

CodeMirror: LESS mode

-
- - -

MIME types defined: text/less.

- - diff --git a/doc/design/js/mode/less/less.js b/doc/design/js/mode/less/less.js deleted file mode 100644 index 29a0a1f13..000000000 --- a/doc/design/js/mode/less/less.js +++ /dev/null @@ -1,186 +0,0 @@ -CodeMirror.defineMode("less", function(config) { - var indentUnit = config.indentUnit, type; - function ret(style, tp) {type = tp; return style;} - //html5 tags - var tags = ["a","abbr","acronym","address","applet","area","article","aside","audio","b","base","basefont","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","command","datalist","dd","del","details","dfn","dir","div","dl","dt","em","embed","fieldset","figcaption","figure","font","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","keygen","kbd","label","legend","li","link","map","mark","menu","meta","meter","nav","noframes","noscript","object","ol","optgroup","option","output","p","param","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strike","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","tt","u","ul","var","video","wbr"]; - - function inTagsArray(val){ - for(var i=0; i*\/]/.test(ch)) {//removed . dot character original was [,.+>*\/] - return ret(null, "select-op"); - } - else if (/[;{}:\[\]()]/.test(ch)) { //added () char for lesscss original was [;{}:\[\]] - if(ch == ":"){ - stream.eatWhile(/[active|hover|link|visited]/); - if( stream.current().match(/[active|hover|link|visited]/)){ - return ret("tag", "tag"); - }else{ - return ret(null, ch); - } - }else{ - return ret(null, ch); - } - } - else if (ch == ".") { // lesscss - stream.eatWhile(/[\a-zA-Z0-9\-_]/); - return ret("tag", "tag"); - } - else if (ch == "#") { // lesscss - stream.match(/([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})/); - if(stream.current().length >1){ - if(stream.current().match(/([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})/) != null){ - return ret("number", "unit"); - }else{ - stream.eatWhile(/[\w\-]/); - return ret("atom", "tag"); - } - }else{ - stream.eatWhile(/[\w\-]/); - return ret("atom", "tag"); - } - } - else if (ch == "&") { - stream.eatWhile(/[\w\-]/); - return ret(null, ch); - } - else { - stream.eatWhile(/[\w\\\-_.%{]/); - if( stream.eat("(") ){ // lesscss - return ret(null, ch); - }else if( stream.current().match(/\-\d|\-.\d/) ){ // lesscss match e.g.: -5px -0.4 etc... - return ret("number", "unit"); - }else if( inTagsArray(stream.current()) ){ // lesscss match html tags - return ret("tag", "tag"); - }else{ - return ret("variable", "variable"); - } - } - - } - - function tokenSComment(stream, state) {// SComment = Slash comment - stream.skipToEnd(); - state.tokenize = tokenBase; - return ret("comment", "comment"); - } - - function tokenCComment(stream, state) { - var maybeEnd = false, ch; - while ((ch = stream.next()) != null) { - if (maybeEnd && ch == "/") { - state.tokenize = tokenBase; - break; - } - maybeEnd = (ch == "*"); - } - return ret("comment", "comment"); - } - - function tokenSGMLComment(stream, state) { - var dashes = 0, ch; - while ((ch = stream.next()) != null) { - if (dashes >= 2 && ch == ">") { - state.tokenize = tokenBase; - break; - } - dashes = (ch == "-") ? dashes + 1 : 0; - } - return ret("comment", "comment"); - } - - function tokenString(quote) { - return function(stream, state) { - var escaped = false, ch; - while ((ch = stream.next()) != null) { - if (ch == quote && !escaped) - break; - escaped = !escaped && ch == "\\"; - } - if (!escaped) state.tokenize = tokenBase; - return ret("string", "string"); - }; - } - - return { - startState: function(base) { - return {tokenize: tokenBase, - baseIndent: base || 0, - stack: []}; - }, - - token: function(stream, state) { - if (stream.eatSpace()) return null; - var style = state.tokenize(stream, state); - - var context = state.stack[state.stack.length-1]; - if (type == "hash" && context == "rule") style = "atom"; - else if (style == "variable") { - if (context == "rule") style = null; //"tag" - else if (!context || context == "@media{") style = "tag"; - } - - if (context == "rule" && /^[\{\};]$/.test(type)) - state.stack.pop(); - if (type == "{") { - if (context == "@media") state.stack[state.stack.length-1] = "@media{"; - else state.stack.push("{"); - } - else if (type == "}") state.stack.pop(); - else if (type == "@media") state.stack.push("@media"); - else if (context == "{" && type != "comment") state.stack.push("rule"); - return style; - }, - - indent: function(state, textAfter) { - var n = state.stack.length; - if (/^\}/.test(textAfter)) - n -= state.stack[state.stack.length-1] == "rule" ? 2 : 1; - return state.baseIndent + n * indentUnit; - }, - - electricChars: "}" - }; -}); - -CodeMirror.defineMIME("text/less", "less"); diff --git a/doc/design/js/mode/lua/index.html b/doc/design/js/mode/lua/index.html deleted file mode 100644 index 600ddb0e4..000000000 --- a/doc/design/js/mode/lua/index.html +++ /dev/null @@ -1,72 +0,0 @@ - - - - CodeMirror: Lua mode - - - - - - - - -

CodeMirror: Lua mode

-
- - -

Loosely based on Franciszek - Wawrzak's CodeMirror - 1 mode. One configuration parameter is - supported, specials, to which you can provide an - array of strings to have those identifiers highlighted with - the lua-special style.

-

MIME types defined: text/x-lua.

- - - diff --git a/doc/design/js/mode/lua/lua.js b/doc/design/js/mode/lua/lua.js deleted file mode 100644 index 60e84a926..000000000 --- a/doc/design/js/mode/lua/lua.js +++ /dev/null @@ -1,140 +0,0 @@ -// LUA mode. Ported to CodeMirror 2 from Franciszek Wawrzak's -// CodeMirror 1 mode. -// highlights keywords, strings, comments (no leveling supported! ("[==[")), tokens, basic indenting - -CodeMirror.defineMode("lua", function(config, parserConfig) { - var indentUnit = config.indentUnit; - - function prefixRE(words) { - return new RegExp("^(?:" + words.join("|") + ")", "i"); - } - function wordRE(words) { - return new RegExp("^(?:" + words.join("|") + ")$", "i"); - } - var specials = wordRE(parserConfig.specials || []); - - // long list of standard functions from lua manual - var builtins = wordRE([ - "_G","_VERSION","assert","collectgarbage","dofile","error","getfenv","getmetatable","ipairs","load", - "loadfile","loadstring","module","next","pairs","pcall","print","rawequal","rawget","rawset","require", - "select","setfenv","setmetatable","tonumber","tostring","type","unpack","xpcall", - - "coroutine.create","coroutine.resume","coroutine.running","coroutine.status","coroutine.wrap","coroutine.yield", - - "debug.debug","debug.getfenv","debug.gethook","debug.getinfo","debug.getlocal","debug.getmetatable", - "debug.getregistry","debug.getupvalue","debug.setfenv","debug.sethook","debug.setlocal","debug.setmetatable", - "debug.setupvalue","debug.traceback", - - "close","flush","lines","read","seek","setvbuf","write", - - "io.close","io.flush","io.input","io.lines","io.open","io.output","io.popen","io.read","io.stderr","io.stdin", - "io.stdout","io.tmpfile","io.type","io.write", - - "math.abs","math.acos","math.asin","math.atan","math.atan2","math.ceil","math.cos","math.cosh","math.deg", - "math.exp","math.floor","math.fmod","math.frexp","math.huge","math.ldexp","math.log","math.log10","math.max", - "math.min","math.modf","math.pi","math.pow","math.rad","math.random","math.randomseed","math.sin","math.sinh", - "math.sqrt","math.tan","math.tanh", - - "os.clock","os.date","os.difftime","os.execute","os.exit","os.getenv","os.remove","os.rename","os.setlocale", - "os.time","os.tmpname", - - "package.cpath","package.loaded","package.loaders","package.loadlib","package.path","package.preload", - "package.seeall", - - "string.byte","string.char","string.dump","string.find","string.format","string.gmatch","string.gsub", - "string.len","string.lower","string.match","string.rep","string.reverse","string.sub","string.upper", - - "table.concat","table.insert","table.maxn","table.remove","table.sort" - ]); - var keywords = wordRE(["and","break","elseif","false","nil","not","or","return", - "true","function", "end", "if", "then", "else", "do", - "while", "repeat", "until", "for", "in", "local" ]); - - var indentTokens = wordRE(["function", "if","repeat","do", "\\(", "{"]); - var dedentTokens = wordRE(["end", "until", "\\)", "}"]); - var dedentPartial = prefixRE(["end", "until", "\\)", "}", "else", "elseif"]); - - function readBracket(stream) { - var level = 0; - while (stream.eat("=")) ++level; - stream.eat("["); - return level; - } - - function normal(stream, state) { - var ch = stream.next(); - if (ch == "-" && stream.eat("-")) { - if (stream.eat("[")) - return (state.cur = bracketed(readBracket(stream), "comment"))(stream, state); - stream.skipToEnd(); - return "comment"; - } - if (ch == "\"" || ch == "'") - return (state.cur = string(ch))(stream, state); - if (ch == "[" && /[\[=]/.test(stream.peek())) - return (state.cur = bracketed(readBracket(stream), "string"))(stream, state); - if (/\d/.test(ch)) { - stream.eatWhile(/[\w.%]/); - return "number"; - } - if (/[\w_]/.test(ch)) { - stream.eatWhile(/[\w\\\-_.]/); - return "variable"; - } - return null; - } - - function bracketed(level, style) { - return function(stream, state) { - var curlev = null, ch; - while ((ch = stream.next()) != null) { - if (curlev == null) {if (ch == "]") curlev = 0;} - else if (ch == "=") ++curlev; - else if (ch == "]" && curlev == level) { state.cur = normal; break; } - else curlev = null; - } - return style; - }; - } - - function string(quote) { - return function(stream, state) { - var escaped = false, ch; - while ((ch = stream.next()) != null) { - if (ch == quote && !escaped) break; - escaped = !escaped && ch == "\\"; - } - if (!escaped) state.cur = normal; - return "string"; - }; - } - - return { - startState: function(basecol) { - return {basecol: basecol || 0, indentDepth: 0, cur: normal}; - }, - - token: function(stream, state) { - if (stream.eatSpace()) return null; - var style = state.cur(stream, state); - var word = stream.current(); - if (style == "variable") { - if (keywords.test(word)) style = "keyword"; - else if (builtins.test(word)) style = "builtin"; - else if (specials.test(word)) style = "variable-2"; - } - if ((style != "comment") && (style != "string")){ - if (indentTokens.test(word)) ++state.indentDepth; - else if (dedentTokens.test(word)) --state.indentDepth; - } - return style; - }, - - indent: function(state, textAfter) { - var closing = dedentPartial.test(textAfter); - return state.basecol + indentUnit * (state.indentDepth - (closing ? 1 : 0)); - } - }; -}); - -CodeMirror.defineMIME("text/x-lua", "lua"); diff --git a/doc/design/js/mode/markdown/index.html b/doc/design/js/mode/markdown/index.html deleted file mode 100644 index 3a60c03ff..000000000 --- a/doc/design/js/mode/markdown/index.html +++ /dev/null @@ -1,339 +0,0 @@ - - - - CodeMirror: Markdown mode - - - - - - - - - -

CodeMirror: Markdown mode

- - -
- - - -

MIME types defined: text/x-markdown.

- - - diff --git a/doc/design/js/mode/markdown/markdown.js b/doc/design/js/mode/markdown/markdown.js deleted file mode 100644 index 455bb43c5..000000000 --- a/doc/design/js/mode/markdown/markdown.js +++ /dev/null @@ -1,242 +0,0 @@ -CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { - - var htmlMode = CodeMirror.getMode(cmCfg, { name: 'xml', htmlMode: true }); - - var header = 'header' - , code = 'comment' - , quote = 'quote' - , list = 'string' - , hr = 'hr' - , linktext = 'link' - , linkhref = 'string' - , em = 'em' - , strong = 'strong' - , emstrong = 'emstrong'; - - var hrRE = /^[*-=_]/ - , ulRE = /^[*-+]\s+/ - , olRE = /^[0-9]\.\s+/ - , headerRE = /^(?:\={3,}|-{3,})$/ - , codeRE = /^(k:\t|\s{4,})/ - , textRE = /^[^\[*_\\<>`]+/; - - function switchInline(stream, state, f) { - state.f = state.inline = f; - return f(stream, state); - } - - function switchBlock(stream, state, f) { - state.f = state.block = f; - return f(stream, state); - } - - - // Blocks - - function blockNormal(stream, state) { - if (stream.match(codeRE)) { - stream.skipToEnd(); - return code; - } - - if (stream.eatSpace()) { - return null; - } - - if (stream.peek() === '#' || stream.match(headerRE)) { - stream.skipToEnd(); - return header; - } - if (stream.eat('>')) { - state.indentation++; - return quote; - } - if (stream.peek() === '[') { - return switchInline(stream, state, footnoteLink); - } - if (hrRE.test(stream.peek())) { - var re = new RegExp('(?:\s*['+stream.peek()+']){3,}$'); - if (stream.match(re, true)) { - return hr; - } - } - - var match; - if (match = stream.match(ulRE, true) || stream.match(olRE, true)) { - state.indentation += match[0].length; - return list; - } - - return switchInline(stream, state, state.inline); - } - - function htmlBlock(stream, state) { - var style = htmlMode.token(stream, state.htmlState); - if (style === 'tag' && state.htmlState.type !== 'openTag' && !state.htmlState.context) { - state.f = inlineNormal; - state.block = blockNormal; - } - return style; - } - - - // Inline - function getType(state) { - return state.strong ? (state.em ? emstrong : strong) - : (state.em ? em : null); - } - - function handleText(stream, state) { - if (stream.match(textRE, true)) { - return getType(state); - } - return undefined; - } - - function inlineNormal(stream, state) { - var style = state.text(stream, state) - if (typeof style !== 'undefined') - return style; - - var ch = stream.next(); - - if (ch === '\\') { - stream.next(); - return getType(state); - } - if (ch === '`') { - return switchInline(stream, state, inlineElement(code, '`')); - } - if (ch === '[') { - return switchInline(stream, state, linkText); - } - if (ch === '<' && stream.match(/^\w/, false)) { - stream.backUp(1); - return switchBlock(stream, state, htmlBlock); - } - - var t = getType(state); - if (ch === '*' || ch === '_') { - if (stream.eat(ch)) { - return (state.strong = !state.strong) ? getType(state) : t; - } - return (state.em = !state.em) ? getType(state) : t; - } - - return getType(state); - } - - function linkText(stream, state) { - while (!stream.eol()) { - var ch = stream.next(); - if (ch === '\\') stream.next(); - if (ch === ']') { - state.inline = state.f = linkHref; - return linktext; - } - } - return linktext; - } - - function linkHref(stream, state) { - stream.eatSpace(); - var ch = stream.next(); - if (ch === '(' || ch === '[') { - return switchInline(stream, state, inlineElement(linkhref, ch === '(' ? ')' : ']')); - } - return 'error'; - } - - function footnoteLink(stream, state) { - if (stream.match(/^[^\]]*\]:/, true)) { - state.f = footnoteUrl; - return linktext; - } - return switchInline(stream, state, inlineNormal); - } - - function footnoteUrl(stream, state) { - stream.eatSpace(); - stream.match(/^[^\s]+/, true); - state.f = state.inline = inlineNormal; - return linkhref; - } - - function inlineRE(endChar) { - if (!inlineRE[endChar]) { - // match any not-escaped-non-endChar and any escaped char - // then match endChar or eol - inlineRE[endChar] = new RegExp('^(?:[^\\\\\\' + endChar + ']|\\\\.)*(?:\\' + endChar + '|$)'); - } - return inlineRE[endChar]; - } - - function inlineElement(type, endChar, next) { - next = next || inlineNormal; - return function(stream, state) { - stream.match(inlineRE(endChar)); - state.inline = state.f = next; - return type; - }; - } - - return { - startState: function() { - return { - f: blockNormal, - - block: blockNormal, - htmlState: htmlMode.startState(), - indentation: 0, - - inline: inlineNormal, - text: handleText, - em: false, - strong: false - }; - }, - - copyState: function(s) { - return { - f: s.f, - - block: s.block, - htmlState: CodeMirror.copyState(htmlMode, s.htmlState), - indentation: s.indentation, - - inline: s.inline, - text: s.text, - em: s.em, - strong: s.strong - }; - }, - - token: function(stream, state) { - if (stream.sol()) { - state.f = state.block; - var previousIndentation = state.indentation - , currentIndentation = 0; - while (previousIndentation > 0) { - if (stream.eat(' ')) { - previousIndentation--; - currentIndentation++; - } else if (previousIndentation >= 4 && stream.eat('\t')) { - previousIndentation -= 4; - currentIndentation += 4; - } else { - break; - } - } - state.indentation = currentIndentation; - - if (currentIndentation > 0) return null; - } - return state.f(stream, state); - }, - - getType: getType - }; - -}); - -CodeMirror.defineMIME("text/x-markdown", "markdown"); diff --git a/doc/design/js/mode/mysql/index.html b/doc/design/js/mode/mysql/index.html deleted file mode 100644 index 006918c0c..000000000 --- a/doc/design/js/mode/mysql/index.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - CodeMirror: MySQL mode - - - - - - - -

CodeMirror: MySQL mode

-
- - -

MIME types defined: text/x-mysql.

- - - diff --git a/doc/design/js/mode/mysql/mysql.js b/doc/design/js/mode/mysql/mysql.js deleted file mode 100644 index dca5b0f61..000000000 --- a/doc/design/js/mode/mysql/mysql.js +++ /dev/null @@ -1,188 +0,0 @@ -/* - * MySQL Mode for CodeMirror 2 by MySQL-Tools - * @author James Thorne (partydroid) - * @link http://github.com/partydroid/MySQL-Tools - * @link http://mysqltools.org - * @version 02/Jan/2012 -*/ -CodeMirror.defineMode("mysql", function(config) { - var indentUnit = config.indentUnit; - var curPunc; - - function wordRegexp(words) { - return new RegExp("^(?:" + words.join("|") + ")$", "i"); - } - var ops = wordRegexp(["str", "lang", "langmatches", "datatype", "bound", "sameterm", "isiri", "isuri", - "isblank", "isliteral", "union", "a"]); - var keywords = wordRegexp([ - ('ACCESSIBLE'),('ALTER'),('AS'),('BEFORE'),('BINARY'),('BY'),('CASE'),('CHARACTER'),('COLUMN'),('CONTINUE'),('CROSS'),('CURRENT_TIMESTAMP'),('DATABASE'),('DAY_MICROSECOND'),('DEC'),('DEFAULT'), - ('DESC'),('DISTINCT'),('DOUBLE'),('EACH'),('ENCLOSED'),('EXIT'),('FETCH'),('FLOAT8'),('FOREIGN'),('GRANT'),('HIGH_PRIORITY'),('HOUR_SECOND'),('IN'),('INNER'),('INSERT'),('INT2'),('INT8'), - ('INTO'),('JOIN'),('KILL'),('LEFT'),('LINEAR'),('LOCALTIME'),('LONG'),('LOOP'),('MATCH'),('MEDIUMTEXT'),('MINUTE_SECOND'),('NATURAL'),('NULL'),('OPTIMIZE'),('OR'),('OUTER'),('PRIMARY'), - ('RANGE'),('READ_WRITE'),('REGEXP'),('REPEAT'),('RESTRICT'),('RIGHT'),('SCHEMAS'),('SENSITIVE'),('SHOW'),('SPECIFIC'),('SQLSTATE'),('SQL_CALC_FOUND_ROWS'),('STARTING'),('TERMINATED'), - ('TINYINT'),('TRAILING'),('UNDO'),('UNLOCK'),('USAGE'),('UTC_DATE'),('VALUES'),('VARCHARACTER'),('WHERE'),('WRITE'),('ZEROFILL'),('ALL'),('AND'),('ASENSITIVE'),('BIGINT'),('BOTH'),('CASCADE'), - ('CHAR'),('COLLATE'),('CONSTRAINT'),('CREATE'),('CURRENT_TIME'),('CURSOR'),('DAY_HOUR'),('DAY_SECOND'),('DECLARE'),('DELETE'),('DETERMINISTIC'),('DIV'),('DUAL'),('ELSEIF'),('EXISTS'),('FALSE'), - ('FLOAT4'),('FORCE'),('FULLTEXT'),('HAVING'),('HOUR_MINUTE'),('IGNORE'),('INFILE'),('INSENSITIVE'),('INT1'),('INT4'),('INTERVAL'),('ITERATE'),('KEYS'),('LEAVE'),('LIMIT'),('LOAD'),('LOCK'), - ('LONGTEXT'),('MASTER_SSL_VERIFY_SERVER_CERT'),('MEDIUMINT'),('MINUTE_MICROSECOND'),('MODIFIES'),('NO_WRITE_TO_BINLOG'),('ON'),('OPTIONALLY'),('OUT'),('PRECISION'),('PURGE'),('READS'), - ('REFERENCES'),('RENAME'),('REQUIRE'),('REVOKE'),('SCHEMA'),('SELECT'),('SET'),('SPATIAL'),('SQLEXCEPTION'),('SQL_BIG_RESULT'),('SSL'),('TABLE'),('TINYBLOB'),('TO'),('TRUE'),('UNIQUE'), - ('UPDATE'),('USING'),('UTC_TIMESTAMP'),('VARCHAR'),('WHEN'),('WITH'),('YEAR_MONTH'),('ADD'),('ANALYZE'),('ASC'),('BETWEEN'),('BLOB'),('CALL'),('CHANGE'),('CHECK'),('CONDITION'),('CONVERT'), - ('CURRENT_DATE'),('CURRENT_USER'),('DATABASES'),('DAY_MINUTE'),('DECIMAL'),('DELAYED'),('DESCRIBE'),('DISTINCTROW'),('DROP'),('ELSE'),('ESCAPED'),('EXPLAIN'),('FLOAT'),('FOR'),('FROM'), - ('GROUP'),('HOUR_MICROSECOND'),('IF'),('INDEX'),('INOUT'),('INT'),('INT3'),('INTEGER'),('IS'),('KEY'),('LEADING'),('LIKE'),('LINES'),('LOCALTIMESTAMP'),('LONGBLOB'),('LOW_PRIORITY'), - ('MEDIUMBLOB'),('MIDDLEINT'),('MOD'),('NOT'),('NUMERIC'),('OPTION'),('ORDER'),('OUTFILE'),('PROCEDURE'),('READ'),('REAL'),('RELEASE'),('REPLACE'),('RETURN'),('RLIKE'),('SECOND_MICROSECOND'), - ('SEPARATOR'),('SMALLINT'),('SQL'),('SQLWARNING'),('SQL_SMALL_RESULT'),('STRAIGHT_JOIN'),('THEN'),('TINYTEXT'),('TRIGGER'),('UNION'),('UNSIGNED'),('USE'),('UTC_TIME'),('VARBINARY'),('VARYING'), - ('WHILE'),('XOR'),('FULL'),('COLUMNS'),('MIN'),('MAX'),('STDEV'),('COUNT') - ]); - var operatorChars = /[*+\-<>=&|]/; - - function tokenBase(stream, state) { - var ch = stream.next(); - curPunc = null; - if (ch == "$" || ch == "?") { - stream.match(/^[\w\d]*/); - return "variable-2"; - } - else if (ch == "<" && !stream.match(/^[\s\u00a0=]/, false)) { - stream.match(/^[^\s\u00a0>]*>?/); - return "atom"; - } - else if (ch == "\"" || ch == "'") { - state.tokenize = tokenLiteral(ch); - return state.tokenize(stream, state); - } - else if (ch == "`") { - state.tokenize = tokenOpLiteral(ch); - return state.tokenize(stream, state); - } - else if (/[{}\(\),\.;\[\]]/.test(ch)) { - curPunc = ch; - return null; - } - else if (ch == "-") { - ch2 = stream.next(); - if(ch2=="-") - { - stream.skipToEnd(); - return "comment"; - } - - } - else if (operatorChars.test(ch)) { - stream.eatWhile(operatorChars); - return null; - } - else if (ch == ":") { - stream.eatWhile(/[\w\d\._\-]/); - return "atom"; - } - else { - stream.eatWhile(/[_\w\d]/); - if (stream.eat(":")) { - stream.eatWhile(/[\w\d_\-]/); - return "atom"; - } - var word = stream.current(), type; - if (ops.test(word)) - return null; - else if (keywords.test(word)) - return "keyword"; - else - return "variable"; - } - } - - function tokenLiteral(quote) { - return function(stream, state) { - var escaped = false, ch; - while ((ch = stream.next()) != null) { - if (ch == quote && !escaped) { - state.tokenize = tokenBase; - break; - } - escaped = !escaped && ch == "\\"; - } - return "string"; - }; - } - - function tokenOpLiteral(quote) { - return function(stream, state) { - var escaped = false, ch; - while ((ch = stream.next()) != null) { - if (ch == quote && !escaped) { - state.tokenize = tokenBase; - break; - } - escaped = !escaped && ch == "\\"; - } - return "variable-2"; - }; - } - - - function pushContext(state, type, col) { - state.context = {prev: state.context, indent: state.indent, col: col, type: type}; - } - function popContext(state) { - state.indent = state.context.indent; - state.context = state.context.prev; - } - - return { - startState: function(base) { - return {tokenize: tokenBase, - context: null, - indent: 0, - col: 0}; - }, - - token: function(stream, state) { - if (stream.sol()) { - if (state.context && state.context.align == null) state.context.align = false; - state.indent = stream.indentation(); - } - if (stream.eatSpace()) return null; - var style = state.tokenize(stream, state); - - if (style != "comment" && state.context && state.context.align == null && state.context.type != "pattern") { - state.context.align = true; - } - - if (curPunc == "(") pushContext(state, ")", stream.column()); - else if (curPunc == "[") pushContext(state, "]", stream.column()); - else if (curPunc == "{") pushContext(state, "}", stream.column()); - else if (/[\]\}\)]/.test(curPunc)) { - while (state.context && state.context.type == "pattern") popContext(state); - if (state.context && curPunc == state.context.type) popContext(state); - } - else if (curPunc == "." && state.context && state.context.type == "pattern") popContext(state); - else if (/atom|string|variable/.test(style) && state.context) { - if (/[\}\]]/.test(state.context.type)) - pushContext(state, "pattern", stream.column()); - else if (state.context.type == "pattern" && !state.context.align) { - state.context.align = true; - state.context.col = stream.column(); - } - } - - return style; - }, - - indent: function(state, textAfter) { - var firstChar = textAfter && textAfter.charAt(0); - var context = state.context; - if (/[\]\}]/.test(firstChar)) - while (context && context.type == "pattern") context = context.prev; - - var closing = context && firstChar == context.type; - if (!context) - return 0; - else if (context.type == "pattern") - return context.col; - else if (context.align) - return context.col + (closing ? 0 : 1); - else - return context.indent + (closing ? 0 : indentUnit); - } - }; -}); - -CodeMirror.defineMIME("text/x-mysql", "mysql"); diff --git a/doc/design/js/mode/ntriples/index.html b/doc/design/js/mode/ntriples/index.html deleted file mode 100644 index 08d33babb..000000000 --- a/doc/design/js/mode/ntriples/index.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - CodeMirror: NTriples mode - - - - - - - -

CodeMirror: NTriples mode

-
- -
- - -

MIME types defined: text/n-triples.

- - diff --git a/doc/design/js/mode/ntriples/ntriples.js b/doc/design/js/mode/ntriples/ntriples.js deleted file mode 100644 index 3b6cb4167..000000000 --- a/doc/design/js/mode/ntriples/ntriples.js +++ /dev/null @@ -1,172 +0,0 @@ -/********************************************************** -* This script provides syntax highlighting support for -* the Ntriples format. -* Ntriples format specification: -* http://www.w3.org/TR/rdf-testcases/#ntriples -***********************************************************/ - -/* - The following expression defines the defined ASF grammar transitions. - - pre_subject -> - { - ( writing_subject_uri | writing_bnode_uri ) - -> pre_predicate - -> writing_predicate_uri - -> pre_object - -> writing_object_uri | writing_object_bnode | - ( - writing_object_literal - -> writing_literal_lang | writing_literal_type - ) - -> post_object - -> BEGIN - } otherwise { - -> ERROR - } -*/ -CodeMirror.defineMode("ntriples", function() { - - Location = { - PRE_SUBJECT : 0, - WRITING_SUB_URI : 1, - WRITING_BNODE_URI : 2, - PRE_PRED : 3, - WRITING_PRED_URI : 4, - PRE_OBJ : 5, - WRITING_OBJ_URI : 6, - WRITING_OBJ_BNODE : 7, - WRITING_OBJ_LITERAL : 8, - WRITING_LIT_LANG : 9, - WRITING_LIT_TYPE : 10, - POST_OBJ : 11, - ERROR : 12 - }; - function transitState(currState, c) { - var currLocation = currState.location; - var ret; - - // Opening. - if (currLocation == Location.PRE_SUBJECT && c == '<') ret = Location.WRITING_SUB_URI; - else if(currLocation == Location.PRE_SUBJECT && c == '_') ret = Location.WRITING_BNODE_URI; - else if(currLocation == Location.PRE_PRED && c == '<') ret = Location.WRITING_PRED_URI; - else if(currLocation == Location.PRE_OBJ && c == '<') ret = Location.WRITING_OBJ_URI; - else if(currLocation == Location.PRE_OBJ && c == '_') ret = Location.WRITING_OBJ_BNODE; - else if(currLocation == Location.PRE_OBJ && c == '"') ret = Location.WRITING_OBJ_LITERAL; - - // Closing. - else if(currLocation == Location.WRITING_SUB_URI && c == '>') ret = Location.PRE_PRED; - else if(currLocation == Location.WRITING_BNODE_URI && c == ' ') ret = Location.PRE_PRED; - else if(currLocation == Location.WRITING_PRED_URI && c == '>') ret = Location.PRE_OBJ; - else if(currLocation == Location.WRITING_OBJ_URI && c == '>') ret = Location.POST_OBJ; - else if(currLocation == Location.WRITING_OBJ_BNODE && c == ' ') ret = Location.POST_OBJ; - else if(currLocation == Location.WRITING_OBJ_LITERAL && c == '"') ret = Location.POST_OBJ; - else if(currLocation == Location.WRITING_LIT_LANG && c == ' ') ret = Location.POST_OBJ; - else if(currLocation == Location.WRITING_LIT_TYPE && c == '>') ret = Location.POST_OBJ; - - // Closing typed and language literal. - else if(currLocation == Location.WRITING_OBJ_LITERAL && c == '@') ret = Location.WRITING_LIT_LANG; - else if(currLocation == Location.WRITING_OBJ_LITERAL && c == '^') ret = Location.WRITING_LIT_TYPE; - - // Spaces. - else if( c == ' ' && - ( - currLocation == Location.PRE_SUBJECT || - currLocation == Location.PRE_PRED || - currLocation == Location.PRE_OBJ || - currLocation == Location.POST_OBJ - ) - ) ret = currLocation; - - // Reset. - else if(currLocation == Location.POST_OBJ && c == '.') ret = Location.PRE_SUBJECT; - - // Error - else ret = Location.ERROR; - - currState.location=ret; - } - - untilSpace = function(c) { return c != ' '; }; - untilEndURI = function(c) { return c != '>'; }; - return { - startState: function() { - return { - location : Location.PRE_SUBJECT, - uris : [], - anchors : [], - bnodes : [], - langs : [], - types : [] - }; - }, - token: function(stream, state) { - var ch = stream.next(); - if(ch == '<') { - transitState(state, ch); - var parsedURI = ''; - stream.eatWhile( function(c) { if( c != '#' && c != '>' ) { parsedURI += c; return true; } return false;} ); - state.uris.push(parsedURI); - if( stream.match('#', false) ) return 'variable'; - stream.next(); - transitState(state, '>'); - return 'variable'; - } - if(ch == '#') { - var parsedAnchor = ''; - stream.eatWhile(function(c) { if(c != '>' && c != ' ') { parsedAnchor+= c; return true; } return false}); - state.anchors.push(parsedAnchor); - return 'variable-2'; - } - if(ch == '>') { - transitState(state, '>'); - return 'variable'; - } - if(ch == '_') { - transitState(state, ch); - var parsedBNode = ''; - stream.eatWhile(function(c) { if( c != ' ' ) { parsedBNode += c; return true; } return false;}); - state.bnodes.push(parsedBNode); - stream.next(); - transitState(state, ' '); - return 'builtin'; - } - if(ch == '"') { - transitState(state, ch); - stream.eatWhile( function(c) { return c != '"'; } ); - stream.next(); - if( stream.peek() != '@' && stream.peek() != '^' ) { - transitState(state, '"'); - } - return 'string'; - } - if( ch == '@' ) { - transitState(state, '@'); - var parsedLang = ''; - stream.eatWhile(function(c) { if( c != ' ' ) { parsedLang += c; return true; } return false;}); - state.langs.push(parsedLang); - stream.next(); - transitState(state, ' '); - return 'string-2'; - } - if( ch == '^' ) { - stream.next(); - transitState(state, '^'); - var parsedType = ''; - stream.eatWhile(function(c) { if( c != '>' ) { parsedType += c; return true; } return false;} ); - state.types.push(parsedType); - stream.next(); - transitState(state, '>'); - return 'variable'; - } - if( ch == ' ' ) { - transitState(state, ch); - } - if( ch == '.' ) { - transitState(state, ch); - } - } - }; -}); - -CodeMirror.defineMIME("text/n-triples", "ntriples"); diff --git a/doc/design/js/mode/pascal/LICENSE b/doc/design/js/mode/pascal/LICENSE deleted file mode 100644 index 8e3747e74..000000000 --- a/doc/design/js/mode/pascal/LICENSE +++ /dev/null @@ -1,7 +0,0 @@ -Copyright (c) 2011 souceLair - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/doc/design/js/mode/pascal/index.html b/doc/design/js/mode/pascal/index.html deleted file mode 100644 index 6af6b460e..000000000 --- a/doc/design/js/mode/pascal/index.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - CodeMirror: Pascal mode - - - - - - - -

CodeMirror: Pascal mode

- -
- - - -

MIME types defined: text/x-pascal.

- - diff --git a/doc/design/js/mode/pascal/pascal.js b/doc/design/js/mode/pascal/pascal.js deleted file mode 100644 index 86c6f71c9..000000000 --- a/doc/design/js/mode/pascal/pascal.js +++ /dev/null @@ -1,138 +0,0 @@ -CodeMirror.defineMode("pascal", function(config) { - function words(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - var keywords = words("and array begin case const div do downto else end file for forward integer " + - "boolean char function goto if in label mod nil not of or packed procedure " + - "program record repeat set string then to type until var while with"); - var blockKeywords = words("case do else for if switch while struct then of"); - var atoms = {"null": true}; - - var isOperatorChar = /[+\-*&%=<>!?|\/]/; - var curPunc; - - function tokenBase(stream, state) { - var ch = stream.next(); - if (ch == "#" && state.startOfLine) { - stream.skipToEnd(); - return "meta"; - } - if (ch == '"' || ch == "'") { - state.tokenize = tokenString(ch); - return state.tokenize(stream, state); - } - if (ch == "(" && stream.eat("*")) { - state.tokenize = tokenComment; - return tokenComment(stream, state); - } - if (/[\[\]{}\(\),;\:\.]/.test(ch)) { - curPunc = ch; - return null - } - if (/\d/.test(ch)) { - stream.eatWhile(/[\w\.]/); - return "number"; - } - if (ch == "/") { - if (stream.eat("/")) { - stream.skipToEnd(); - return "comment"; - } - } - if (isOperatorChar.test(ch)) { - stream.eatWhile(isOperatorChar); - return "operator"; - } - stream.eatWhile(/[\w\$_]/); - var cur = stream.current(); - if (keywords.propertyIsEnumerable(cur)) { - if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement"; - return "keyword"; - } - if (atoms.propertyIsEnumerable(cur)) return "atom"; - return "word"; - } - - function tokenString(quote) { - return function(stream, state) { - var escaped = false, next, end = false; - while ((next = stream.next()) != null) { - if (next == quote && !escaped) {end = true; break;} - escaped = !escaped && next == "\\"; - } - if (end || !escaped) state.tokenize = null; - return "string"; - }; - } - - function tokenComment(stream, state) { - var maybeEnd = false, ch; - while (ch = stream.next()) { - if (ch == ")" && maybeEnd) { - state.tokenize = null; - break; - } - maybeEnd = (ch == "*"); - } - return "comment"; - } - - function Context(indented, column, type, align, prev) { - this.indented = indented; - this.column = column; - this.type = type; - this.align = align; - this.prev = prev; - } - function pushContext(state, col, type) { - return state.context = new Context(state.indented, col, type, null, state.context); - } - function popContext(state) { - var t = state.context.type; - if (t == ")" || t == "]" ) - state.indented = state.context.indented; - return state.context = state.context.prev; - } - - // Interface - - return { - startState: function(basecolumn) { - return { - tokenize: null, - context: new Context((basecolumn || 0) - config.indentUnit, 0, "top", false), - indented: 0, - startOfLine: true - }; - }, - - token: function(stream, state) { - var ctx = state.context; - if (stream.sol()) { - if (ctx.align == null) ctx.align = false; - state.indented = stream.indentation(); - state.startOfLine = true; - } - if (stream.eatSpace()) return null; - curPunc = null; - var style = (state.tokenize || tokenBase)(stream, state); - if (style == "comment" || style == "meta") return style; - if (ctx.align == null) ctx.align = true; - - if ((curPunc == ";" || curPunc == ":") && ctx.type == "statement") popContext(state); - else if (curPunc == "[") pushContext(state, stream.column(), "]"); - else if (curPunc == "(") pushContext(state, stream.column(), ")"); - else if (curPunc == ctx.type) popContext(state); - else if ( ctx.type == "top" || (ctx.type == "statement" && curPunc == "newstatement")) - pushContext(state, stream.column(), "statement"); - state.startOfLine = false; - return style; - }, - - electricChars: "{}" - }; -}); - -CodeMirror.defineMIME("text/x-pascal", "pascal"); diff --git a/doc/design/js/mode/perl/LICENSE b/doc/design/js/mode/perl/LICENSE deleted file mode 100644 index 96f4115af..000000000 --- a/doc/design/js/mode/perl/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (C) 2011 by Sabaca under the MIT license. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/doc/design/js/mode/perl/index.html b/doc/design/js/mode/perl/index.html deleted file mode 100644 index 5ef55d323..000000000 --- a/doc/design/js/mode/perl/index.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - CodeMirror: Perl mode - - - - - - - -

CodeMirror: Perl mode

- -
- - - -

MIME types defined: text/x-perl.

- - diff --git a/doc/design/js/mode/perl/perl.js b/doc/design/js/mode/perl/perl.js deleted file mode 100644 index e2e1cbef9..000000000 --- a/doc/design/js/mode/perl/perl.js +++ /dev/null @@ -1,816 +0,0 @@ -// CodeMirror2 mode/perl/perl.js (text/x-perl) beta 0.10 (2011-11-08) -// This is a part of CodeMirror from https://github.com/sabaca/CodeMirror_mode_perl (mail@sabaca.com) -CodeMirror.defineMode("perl",function(config,parserConfig){ - // http://perldoc.perl.org - var PERL={ // null - magic touch - // 1 - keyword - // 2 - def - // 3 - atom - // 4 - operator - // 5 - variable-2 (predefined) - // [x,y] - x=1,2,3; y=must be defined if x{...} - // PERL operators - '->' : 4, - '++' : 4, - '--' : 4, - '**' : 4, - // ! ~ \ and unary + and - - '=~' : 4, - '!~' : 4, - '*' : 4, - '/' : 4, - '%' : 4, - 'x' : 4, - '+' : 4, - '-' : 4, - '.' : 4, - '<<' : 4, - '>>' : 4, - // named unary operators - '<' : 4, - '>' : 4, - '<=' : 4, - '>=' : 4, - 'lt' : 4, - 'gt' : 4, - 'le' : 4, - 'ge' : 4, - '==' : 4, - '!=' : 4, - '<=>' : 4, - 'eq' : 4, - 'ne' : 4, - 'cmp' : 4, - '~~' : 4, - '&' : 4, - '|' : 4, - '^' : 4, - '&&' : 4, - '||' : 4, - '//' : 4, - '..' : 4, - '...' : 4, - '?' : 4, - ':' : 4, - '=' : 4, - '+=' : 4, - '-=' : 4, - '*=' : 4, // etc. ??? - ',' : 4, - '=>' : 4, - '::' : 4, - // list operators (rightward) - 'not' : 4, - 'and' : 4, - 'or' : 4, - 'xor' : 4, - // PERL predefined variables (I know, what this is a paranoid idea, but may be needed for people, who learn PERL, and for me as well, ...and may be for you?;) - 'BEGIN' : [5,1], - 'END' : [5,1], - 'PRINT' : [5,1], - 'PRINTF' : [5,1], - 'GETC' : [5,1], - 'READ' : [5,1], - 'READLINE' : [5,1], - 'DESTROY' : [5,1], - 'TIE' : [5,1], - 'TIEHANDLE' : [5,1], - 'UNTIE' : [5,1], - 'STDIN' : 5, - 'STDIN_TOP' : 5, - 'STDOUT' : 5, - 'STDOUT_TOP' : 5, - 'STDERR' : 5, - 'STDERR_TOP' : 5, - '$ARG' : 5, - '$_' : 5, - '@ARG' : 5, - '@_' : 5, - '$LIST_SEPARATOR' : 5, - '$"' : 5, - '$PROCESS_ID' : 5, - '$PID' : 5, - '$$' : 5, - '$REAL_GROUP_ID' : 5, - '$GID' : 5, - '$(' : 5, - '$EFFECTIVE_GROUP_ID' : 5, - '$EGID' : 5, - '$)' : 5, - '$PROGRAM_NAME' : 5, - '$0' : 5, - '$SUBSCRIPT_SEPARATOR' : 5, - '$SUBSEP' : 5, - '$;' : 5, - '$REAL_USER_ID' : 5, - '$UID' : 5, - '$<' : 5, - '$EFFECTIVE_USER_ID' : 5, - '$EUID' : 5, - '$>' : 5, - '$a' : 5, - '$b' : 5, - '$COMPILING' : 5, - '$^C' : 5, - '$DEBUGGING' : 5, - '$^D' : 5, - '${^ENCODING}' : 5, - '$ENV' : 5, - '%ENV' : 5, - '$SYSTEM_FD_MAX' : 5, - '$^F' : 5, - '@F' : 5, - '${^GLOBAL_PHASE}' : 5, - '$^H' : 5, - '%^H' : 5, - '@INC' : 5, - '%INC' : 5, - '$INPLACE_EDIT' : 5, - '$^I' : 5, - '$^M' : 5, - '$OSNAME' : 5, - '$^O' : 5, - '${^OPEN}' : 5, - '$PERLDB' : 5, - '$^P' : 5, - '$SIG' : 5, - '%SIG' : 5, - '$BASETIME' : 5, - '$^T' : 5, - '${^TAINT}' : 5, - '${^UNICODE}' : 5, - '${^UTF8CACHE}' : 5, - '${^UTF8LOCALE}' : 5, - '$PERL_VERSION' : 5, - '$^V' : 5, - '${^WIN32_SLOPPY_STAT}' : 5, - '$EXECUTABLE_NAME' : 5, - '$^X' : 5, - '$1' : 5, // - regexp $1, $2... - '$MATCH' : 5, - '$&' : 5, - '${^MATCH}' : 5, - '$PREMATCH' : 5, - '$`' : 5, - '${^PREMATCH}' : 5, - '$POSTMATCH' : 5, - "$'" : 5, - '${^POSTMATCH}' : 5, - '$LAST_PAREN_MATCH' : 5, - '$+' : 5, - '$LAST_SUBMATCH_RESULT' : 5, - '$^N' : 5, - '@LAST_MATCH_END' : 5, - '@+' : 5, - '%LAST_PAREN_MATCH' : 5, - '%+' : 5, - '@LAST_MATCH_START' : 5, - '@-' : 5, - '%LAST_MATCH_START' : 5, - '%-' : 5, - '$LAST_REGEXP_CODE_RESULT' : 5, - '$^R' : 5, - '${^RE_DEBUG_FLAGS}' : 5, - '${^RE_TRIE_MAXBUF}' : 5, - '$ARGV' : 5, - '@ARGV' : 5, - 'ARGV' : 5, - 'ARGVOUT' : 5, - '$OUTPUT_FIELD_SEPARATOR' : 5, - '$OFS' : 5, - '$,' : 5, - '$INPUT_LINE_NUMBER' : 5, - '$NR' : 5, - '$.' : 5, - '$INPUT_RECORD_SEPARATOR' : 5, - '$RS' : 5, - '$/' : 5, - '$OUTPUT_RECORD_SEPARATOR' : 5, - '$ORS' : 5, - '$\\' : 5, - '$OUTPUT_AUTOFLUSH' : 5, - '$|' : 5, - '$ACCUMULATOR' : 5, - '$^A' : 5, - '$FORMAT_FORMFEED' : 5, - '$^L' : 5, - '$FORMAT_PAGE_NUMBER' : 5, - '$%' : 5, - '$FORMAT_LINES_LEFT' : 5, - '$-' : 5, - '$FORMAT_LINE_BREAK_CHARACTERS' : 5, - '$:' : 5, - '$FORMAT_LINES_PER_PAGE' : 5, - '$=' : 5, - '$FORMAT_TOP_NAME' : 5, - '$^' : 5, - '$FORMAT_NAME' : 5, - '$~' : 5, - '${^CHILD_ERROR_NATIVE}' : 5, - '$EXTENDED_OS_ERROR' : 5, - '$^E' : 5, - '$EXCEPTIONS_BEING_CAUGHT' : 5, - '$^S' : 5, - '$WARNING' : 5, - '$^W' : 5, - '${^WARNING_BITS}' : 5, - '$OS_ERROR' : 5, - '$ERRNO' : 5, - '$!' : 5, - '%OS_ERROR' : 5, - '%ERRNO' : 5, - '%!' : 5, - '$CHILD_ERROR' : 5, - '$?' : 5, - '$EVAL_ERROR' : 5, - '$@' : 5, - '$OFMT' : 5, - '$#' : 5, - '$*' : 5, - '$ARRAY_BASE' : 5, - '$[' : 5, - '$OLD_PERL_VERSION' : 5, - '$]' : 5, - // PERL blocks - 'if' :[1,1], - elsif :[1,1], - 'else' :[1,1], - 'while' :[1,1], - unless :[1,1], - 'for' :[1,1], - foreach :[1,1], - // PERL functions - 'abs' :1, // - absolute value function - accept :1, // - accept an incoming socket connect - alarm :1, // - schedule a SIGALRM - 'atan2' :1, // - arctangent of Y/X in the range -PI to PI - bind :1, // - binds an address to a socket - binmode :1, // - prepare binary files for I/O - bless :1, // - create an object - bootstrap :1, // - 'break' :1, // - break out of a "given" block - caller :1, // - get context of the current subroutine call - chdir :1, // - change your current working directory - chmod :1, // - changes the permissions on a list of files - chomp :1, // - remove a trailing record separator from a string - chop :1, // - remove the last character from a string - chown :1, // - change the owership on a list of files - chr :1, // - get character this number represents - chroot :1, // - make directory new root for path lookups - close :1, // - close file (or pipe or socket) handle - closedir :1, // - close directory handle - connect :1, // - connect to a remote socket - 'continue' :[1,1], // - optional trailing block in a while or foreach - 'cos' :1, // - cosine function - crypt :1, // - one-way passwd-style encryption - dbmclose :1, // - breaks binding on a tied dbm file - dbmopen :1, // - create binding on a tied dbm file - 'default' :1, // - defined :1, // - test whether a value, variable, or function is defined - 'delete' :1, // - deletes a value from a hash - die :1, // - raise an exception or bail out - 'do' :1, // - turn a BLOCK into a TERM - dump :1, // - create an immediate core dump - each :1, // - retrieve the next key/value pair from a hash - endgrent :1, // - be done using group file - endhostent :1, // - be done using hosts file - endnetent :1, // - be done using networks file - endprotoent :1, // - be done using protocols file - endpwent :1, // - be done using passwd file - endservent :1, // - be done using services file - eof :1, // - test a filehandle for its end - 'eval' :1, // - catch exceptions or compile and run code - 'exec' :1, // - abandon this program to run another - exists :1, // - test whether a hash key is present - exit :1, // - terminate this program - 'exp' :1, // - raise I to a power - fcntl :1, // - file control system call - fileno :1, // - return file descriptor from filehandle - flock :1, // - lock an entire file with an advisory lock - fork :1, // - create a new process just like this one - format :1, // - declare a picture format with use by the write() function - formline :1, // - internal function used for formats - getc :1, // - get the next character from the filehandle - getgrent :1, // - get next group record - getgrgid :1, // - get group record given group user ID - getgrnam :1, // - get group record given group name - gethostbyaddr :1, // - get host record given its address - gethostbyname :1, // - get host record given name - gethostent :1, // - get next hosts record - getlogin :1, // - return who logged in at this tty - getnetbyaddr :1, // - get network record given its address - getnetbyname :1, // - get networks record given name - getnetent :1, // - get next networks record - getpeername :1, // - find the other end of a socket connection - getpgrp :1, // - get process group - getppid :1, // - get parent process ID - getpriority :1, // - get current nice value - getprotobyname :1, // - get protocol record given name - getprotobynumber :1, // - get protocol record numeric protocol - getprotoent :1, // - get next protocols record - getpwent :1, // - get next passwd record - getpwnam :1, // - get passwd record given user login name - getpwuid :1, // - get passwd record given user ID - getservbyname :1, // - get services record given its name - getservbyport :1, // - get services record given numeric port - getservent :1, // - get next services record - getsockname :1, // - retrieve the sockaddr for a given socket - getsockopt :1, // - get socket options on a given socket - given :1, // - glob :1, // - expand filenames using wildcards - gmtime :1, // - convert UNIX time into record or string using Greenwich time - 'goto' :1, // - create spaghetti code - grep :1, // - locate elements in a list test true against a given criterion - hex :1, // - convert a string to a hexadecimal number - 'import' :1, // - patch a module's namespace into your own - index :1, // - find a substring within a string - int :1, // - get the integer portion of a number - ioctl :1, // - system-dependent device control system call - 'join' :1, // - join a list into a string using a separator - keys :1, // - retrieve list of indices from a hash - kill :1, // - send a signal to a process or process group - last :1, // - exit a block prematurely - lc :1, // - return lower-case version of a string - lcfirst :1, // - return a string with just the next letter in lower case - length :1, // - return the number of bytes in a string - 'link' :1, // - create a hard link in the filesytem - listen :1, // - register your socket as a server - local : 2, // - create a temporary value for a global variable (dynamic scoping) - localtime :1, // - convert UNIX time into record or string using local time - lock :1, // - get a thread lock on a variable, subroutine, or method - 'log' :1, // - retrieve the natural logarithm for a number - lstat :1, // - stat a symbolic link - m :null, // - match a string with a regular expression pattern - map :1, // - apply a change to a list to get back a new list with the changes - mkdir :1, // - create a directory - msgctl :1, // - SysV IPC message control operations - msgget :1, // - get SysV IPC message queue - msgrcv :1, // - receive a SysV IPC message from a message queue - msgsnd :1, // - send a SysV IPC message to a message queue - my : 2, // - declare and assign a local variable (lexical scoping) - 'new' :1, // - next :1, // - iterate a block prematurely - no :1, // - unimport some module symbols or semantics at compile time - oct :1, // - convert a string to an octal number - open :1, // - open a file, pipe, or descriptor - opendir :1, // - open a directory - ord :1, // - find a character's numeric representation - our : 2, // - declare and assign a package variable (lexical scoping) - pack :1, // - convert a list into a binary representation - 'package' :1, // - declare a separate global namespace - pipe :1, // - open a pair of connected filehandles - pop :1, // - remove the last element from an array and return it - pos :1, // - find or set the offset for the last/next m//g search - print :1, // - output a list to a filehandle - printf :1, // - output a formatted list to a filehandle - prototype :1, // - get the prototype (if any) of a subroutine - push :1, // - append one or more elements to an array - q :null, // - singly quote a string - qq :null, // - doubly quote a string - qr :null, // - Compile pattern - quotemeta :null, // - quote regular expression magic characters - qw :null, // - quote a list of words - qx :null, // - backquote quote a string - rand :1, // - retrieve the next pseudorandom number - read :1, // - fixed-length buffered input from a filehandle - readdir :1, // - get a directory from a directory handle - readline :1, // - fetch a record from a file - readlink :1, // - determine where a symbolic link is pointing - readpipe :1, // - execute a system command and collect standard output - recv :1, // - receive a message over a Socket - redo :1, // - start this loop iteration over again - ref :1, // - find out the type of thing being referenced - rename :1, // - change a filename - require :1, // - load in external functions from a library at runtime - reset :1, // - clear all variables of a given name - 'return' :1, // - get out of a function early - reverse :1, // - flip a string or a list - rewinddir :1, // - reset directory handle - rindex :1, // - right-to-left substring search - rmdir :1, // - remove a directory - s :null, // - replace a pattern with a string - say :1, // - print with newline - scalar :1, // - force a scalar context - seek :1, // - reposition file pointer for random-access I/O - seekdir :1, // - reposition directory pointer - select :1, // - reset default output or do I/O multiplexing - semctl :1, // - SysV semaphore control operations - semget :1, // - get set of SysV semaphores - semop :1, // - SysV semaphore operations - send :1, // - send a message over a socket - setgrent :1, // - prepare group file for use - sethostent :1, // - prepare hosts file for use - setnetent :1, // - prepare networks file for use - setpgrp :1, // - set the process group of a process - setpriority :1, // - set a process's nice value - setprotoent :1, // - prepare protocols file for use - setpwent :1, // - prepare passwd file for use - setservent :1, // - prepare services file for use - setsockopt :1, // - set some socket options - shift :1, // - remove the first element of an array, and return it - shmctl :1, // - SysV shared memory operations - shmget :1, // - get SysV shared memory segment identifier - shmread :1, // - read SysV shared memory - shmwrite :1, // - write SysV shared memory - shutdown :1, // - close down just half of a socket connection - 'sin' :1, // - return the sine of a number - sleep :1, // - block for some number of seconds - socket :1, // - create a socket - socketpair :1, // - create a pair of sockets - 'sort' :1, // - sort a list of values - splice :1, // - add or remove elements anywhere in an array - 'split' :1, // - split up a string using a regexp delimiter - sprintf :1, // - formatted print into a string - 'sqrt' :1, // - square root function - srand :1, // - seed the random number generator - stat :1, // - get a file's status information - state :1, // - declare and assign a state variable (persistent lexical scoping) - study :1, // - optimize input data for repeated searches - 'sub' :1, // - declare a subroutine, possibly anonymously - 'substr' :1, // - get or alter a portion of a stirng - symlink :1, // - create a symbolic link to a file - syscall :1, // - execute an arbitrary system call - sysopen :1, // - open a file, pipe, or descriptor - sysread :1, // - fixed-length unbuffered input from a filehandle - sysseek :1, // - position I/O pointer on handle used with sysread and syswrite - system :1, // - run a separate program - syswrite :1, // - fixed-length unbuffered output to a filehandle - tell :1, // - get current seekpointer on a filehandle - telldir :1, // - get current seekpointer on a directory handle - tie :1, // - bind a variable to an object class - tied :1, // - get a reference to the object underlying a tied variable - time :1, // - return number of seconds since 1970 - times :1, // - return elapsed time for self and child processes - tr :null, // - transliterate a string - truncate :1, // - shorten a file - uc :1, // - return upper-case version of a string - ucfirst :1, // - return a string with just the next letter in upper case - umask :1, // - set file creation mode mask - undef :1, // - remove a variable or function definition - unlink :1, // - remove one link to a file - unpack :1, // - convert binary structure into normal perl variables - unshift :1, // - prepend more elements to the beginning of a list - untie :1, // - break a tie binding to a variable - use :1, // - load in a module at compile time - utime :1, // - set a file's last access and modify times - values :1, // - return a list of the values in a hash - vec :1, // - test or set particular bits in a string - wait :1, // - wait for any child process to die - waitpid :1, // - wait for a particular child process to die - wantarray :1, // - get void vs scalar vs list context of current subroutine call - warn :1, // - print debugging info - when :1, // - write :1, // - print a picture record - y :null}; // - transliterate a string - - var RXstyle="string-2"; - var RXmodifiers=/[goseximacplud]/; // NOTE: "m", "s", "y" and "tr" need to correct real modifiers for each regexp type - - function tokenChain(stream,state,chain,style,tail){ // NOTE: chain.length > 2 is not working now (it's for s[...][...]geos;) - state.chain=null; // 12 3tail - state.style=null; - state.tail=null; - state.tokenize=function(stream,state){ - var e=false,c,i=0; - while(c=stream.next()){ - if(c===chain[i]&&!e){ - if(chain[++i]!==undefined){ - state.chain=chain[i]; - state.style=style; - state.tail=tail} - else if(tail) - stream.eatWhile(tail); - state.tokenize=tokenPerl; - return style} - e=!e&&c=="\\"} - return style}; - return state.tokenize(stream,state)} - - function tokenSOMETHING(stream,state,string){ - state.tokenize=function(stream,state){ - if(stream.string==string) - state.tokenize=tokenPerl; - stream.skipToEnd(); - return "string"}; - return state.tokenize(stream,state)} - - function tokenPerl(stream,state){ - if(stream.eatSpace()) - return null; - if(state.chain) - return tokenChain(stream,state,state.chain,state.style,state.tail); - if(stream.match(/^\-?[\d\.]/,false)) - if(stream.match(/^(\-?(\d*\.\d+(e[+-]?\d+)?|\d+\.\d*)|0x[\da-fA-F]+|0b[01]+|\d+(e[+-]?\d+)?)/)) - return 'number'; - if(stream.match(/^<<(?=\w)/)){ // NOTE: <"],RXstyle,RXmodifiers)} - if(/[\^'"!~\/]/.test(c)){ - stream.eatSuffix(1); - return tokenChain(stream,state,[stream.eat(c)],RXstyle,RXmodifiers)}} - else if(c=="q"){ - c=stream.look(1); - if(c=="("){ - stream.eatSuffix(2); - return tokenChain(stream,state,[")"],"string")} - if(c=="["){ - stream.eatSuffix(2); - return tokenChain(stream,state,["]"],"string")} - if(c=="{"){ - stream.eatSuffix(2); - return tokenChain(stream,state,["}"],"string")} - if(c=="<"){ - stream.eatSuffix(2); - return tokenChain(stream,state,[">"],"string")} - if(/[\^'"!~\/]/.test(c)){ - stream.eatSuffix(1); - return tokenChain(stream,state,[stream.eat(c)],"string")}} - else if(c=="w"){ - c=stream.look(1); - if(c=="("){ - stream.eatSuffix(2); - return tokenChain(stream,state,[")"],"bracket")} - if(c=="["){ - stream.eatSuffix(2); - return tokenChain(stream,state,["]"],"bracket")} - if(c=="{"){ - stream.eatSuffix(2); - return tokenChain(stream,state,["}"],"bracket")} - if(c=="<"){ - stream.eatSuffix(2); - return tokenChain(stream,state,[">"],"bracket")} - if(/[\^'"!~\/]/.test(c)){ - stream.eatSuffix(1); - return tokenChain(stream,state,[stream.eat(c)],"bracket")}} - else if(c=="r"){ - c=stream.look(1); - if(c=="("){ - stream.eatSuffix(2); - return tokenChain(stream,state,[")"],RXstyle,RXmodifiers)} - if(c=="["){ - stream.eatSuffix(2); - return tokenChain(stream,state,["]"],RXstyle,RXmodifiers)} - if(c=="{"){ - stream.eatSuffix(2); - return tokenChain(stream,state,["}"],RXstyle,RXmodifiers)} - if(c=="<"){ - stream.eatSuffix(2); - return tokenChain(stream,state,[">"],RXstyle,RXmodifiers)} - if(/[\^'"!~\/]/.test(c)){ - stream.eatSuffix(1); - return tokenChain(stream,state,[stream.eat(c)],RXstyle,RXmodifiers)}} - else if(/[\^'"!~\/(\[{<]/.test(c)){ - if(c=="("){ - stream.eatSuffix(1); - return tokenChain(stream,state,[")"],"string")} - if(c=="["){ - stream.eatSuffix(1); - return tokenChain(stream,state,["]"],"string")} - if(c=="{"){ - stream.eatSuffix(1); - return tokenChain(stream,state,["}"],"string")} - if(c=="<"){ - stream.eatSuffix(1); - return tokenChain(stream,state,[">"],"string")} - if(/[\^'"!~\/]/.test(c)){ - return tokenChain(stream,state,[stream.eat(c)],"string")}}}} - if(ch=="m"){ - var c=stream.look(-2); - if(!(c&&/\w/.test(c))){ - c=stream.eat(/[(\[{<\^'"!~\/]/); - if(c){ - if(/[\^'"!~\/]/.test(c)){ - return tokenChain(stream,state,[c],RXstyle,RXmodifiers)} - if(c=="("){ - return tokenChain(stream,state,[")"],RXstyle,RXmodifiers)} - if(c=="["){ - return tokenChain(stream,state,["]"],RXstyle,RXmodifiers)} - if(c=="{"){ - return tokenChain(stream,state,["}"],RXstyle,RXmodifiers)} - if(c=="<"){ - return tokenChain(stream,state,[">"],RXstyle,RXmodifiers)}}}} - if(ch=="s"){ - var c=/[\/>\]})\w]/.test(stream.look(-2)); - if(!c){ - c=stream.eat(/[(\[{<\^'"!~\/]/); - if(c){ - if(c=="[") - return tokenChain(stream,state,["]","]"],RXstyle,RXmodifiers); - if(c=="{") - return tokenChain(stream,state,["}","}"],RXstyle,RXmodifiers); - if(c=="<") - return tokenChain(stream,state,[">",">"],RXstyle,RXmodifiers); - if(c=="(") - return tokenChain(stream,state,[")",")"],RXstyle,RXmodifiers); - return tokenChain(stream,state,[c,c],RXstyle,RXmodifiers)}}} - if(ch=="y"){ - var c=/[\/>\]})\w]/.test(stream.look(-2)); - if(!c){ - c=stream.eat(/[(\[{<\^'"!~\/]/); - if(c){ - if(c=="[") - return tokenChain(stream,state,["]","]"],RXstyle,RXmodifiers); - if(c=="{") - return tokenChain(stream,state,["}","}"],RXstyle,RXmodifiers); - if(c=="<") - return tokenChain(stream,state,[">",">"],RXstyle,RXmodifiers); - if(c=="(") - return tokenChain(stream,state,[")",")"],RXstyle,RXmodifiers); - return tokenChain(stream,state,[c,c],RXstyle,RXmodifiers)}}} - if(ch=="t"){ - var c=/[\/>\]})\w]/.test(stream.look(-2)); - if(!c){ - c=stream.eat("r");if(c){ - c=stream.eat(/[(\[{<\^'"!~\/]/); - if(c){ - if(c=="[") - return tokenChain(stream,state,["]","]"],RXstyle,RXmodifiers); - if(c=="{") - return tokenChain(stream,state,["}","}"],RXstyle,RXmodifiers); - if(c=="<") - return tokenChain(stream,state,[">",">"],RXstyle,RXmodifiers); - if(c=="(") - return tokenChain(stream,state,[")",")"],RXstyle,RXmodifiers); - return tokenChain(stream,state,[c,c],RXstyle,RXmodifiers)}}}} - if(ch=="`"){ - return tokenChain(stream,state,[ch],"variable-2")} - if(ch=="/"){ - if(!/~\s*$/.test(stream.prefix())) - return "operator"; - else - return tokenChain(stream,state,[ch],RXstyle,RXmodifiers)} - if(ch=="$"){ - var p=stream.pos; - if(stream.eatWhile(/\d/)||stream.eat("{")&&stream.eatWhile(/\d/)&&stream.eat("}")) - return "variable-2"; - else - stream.pos=p} - if(/[$@%]/.test(ch)){ - var p=stream.pos; - if(stream.eat("^")&&stream.eat(/[A-Z]/)||!/[@$%&]/.test(stream.look(-2))&&stream.eat(/[=|\\\-#?@;:&`~\^!\[\]*'"$+.,\/<>()]/)){ - var c=stream.current(); - if(PERL[c]) - return "variable-2"} - stream.pos=p} - if(/[$@%&]/.test(ch)){ - if(stream.eatWhile(/[\w$\[\]]/)||stream.eat("{")&&stream.eatWhile(/[\w$\[\]]/)&&stream.eat("}")){ - var c=stream.current(); - if(PERL[c]) - return "variable-2"; - else - return "variable"}} - if(ch=="#"){ - if(stream.look(-2)!="$"){ - stream.skipToEnd(); - return "comment"}} - if(/[:+\-\^*$&%@=<>!?|\/~\.]/.test(ch)){ - var p=stream.pos; - stream.eatWhile(/[:+\-\^*$&%@=<>!?|\/~\.]/); - if(PERL[stream.current()]) - return "operator"; - else - stream.pos=p} - if(ch=="_"){ - if(stream.pos==1){ - if(stream.suffix(6)=="_END__"){ - return tokenChain(stream,state,['\0'],"comment")} - else if(stream.suffix(7)=="_DATA__"){ - return tokenChain(stream,state,['\0'],"variable-2")} - else if(stream.suffix(7)=="_C__"){ - return tokenChain(stream,state,['\0'],"string")}}} - if(/\w/.test(ch)){ - var p=stream.pos; - if(stream.look(-2)=="{"&&(stream.look(0)=="}"||stream.eatWhile(/\w/)&&stream.look(0)=="}")) - return "string"; - else - stream.pos=p} - if(/[A-Z]/.test(ch)){ - var l=stream.look(-2); - var p=stream.pos; - stream.eatWhile(/[A-Z_]/); - if(/[\da-z]/.test(stream.look(0))){ - stream.pos=p} - else{ - var c=PERL[stream.current()]; - if(!c) - return "meta"; - if(c[1]) - c=c[0]; - if(l!=":"){ - if(c==1) - return "keyword"; - else if(c==2) - return "def"; - else if(c==3) - return "atom"; - else if(c==4) - return "operator"; - else if(c==5) - return "variable-2"; - else - return "meta"} - else - return "meta"}} - if(/[a-zA-Z_]/.test(ch)){ - var l=stream.look(-2); - stream.eatWhile(/\w/); - var c=PERL[stream.current()]; - if(!c) - return "meta"; - if(c[1]) - c=c[0]; - if(l!=":"){ - if(c==1) - return "keyword"; - else if(c==2) - return "def"; - else if(c==3) - return "atom"; - else if(c==4) - return "operator"; - else if(c==5) - return "variable-2"; - else - return "meta"} - else - return "meta"} - return null} - - return{ - startState:function(){ - return{ - tokenize:tokenPerl, - chain:null, - style:null, - tail:null}}, - token:function(stream,state){ - return (state.tokenize||tokenPerl)(stream,state)}, - electricChars:"{}"}}); - -CodeMirror.defineMIME("text/x-perl", "perl"); - -// it's like "peek", but need for look-ahead or look-behind if index < 0 -CodeMirror.StringStream.prototype.look=function(c){ - return this.string.charAt(this.pos+(c||0))}; - -// return a part of prefix of current stream from current position -CodeMirror.StringStream.prototype.prefix=function(c){ - if(c){ - var x=this.pos-c; - return this.string.substr((x>=0?x:0),c)} - else{ - return this.string.substr(0,this.pos-1)}}; - -// return a part of suffix of current stream from current position -CodeMirror.StringStream.prototype.suffix=function(c){ - var y=this.string.length; - var x=y-this.pos+1; - return this.string.substr(this.pos,(c&&c=(y=this.string.length-1)) - this.pos=y; - else - this.pos=x}; diff --git a/doc/design/js/mode/php/index.html b/doc/design/js/mode/php/index.html deleted file mode 100644 index 7949044e6..000000000 --- a/doc/design/js/mode/php/index.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - CodeMirror: PHP mode - - - - - - - - - - - -

CodeMirror: PHP mode

- -
- - - -

Simple HTML/PHP mode based on - the C-like mode. Depends on XML, - JavaScript, CSS, and C-like modes.

- -

MIME types defined: application/x-httpd-php (HTML with PHP code), text/x-php (plain, non-wrapped PHP code).

- - diff --git a/doc/design/js/mode/php/php.js b/doc/design/js/mode/php/php.js deleted file mode 100644 index 2b3285670..000000000 --- a/doc/design/js/mode/php/php.js +++ /dev/null @@ -1,121 +0,0 @@ -(function() { - function keywords(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - function heredoc(delim) { - return function(stream, state) { - if (stream.match(delim)) state.tokenize = null; - else stream.skipToEnd(); - return "string"; - } - } - var phpConfig = { - name: "clike", - keywords: keywords("abstract and array as break case catch cfunction class clone const continue declare " + - "default do else elseif enddeclare endfor endforeach endif endswitch endwhile extends " + - "final for foreach function global goto if implements interface instanceof namespace " + - "new or private protected public static switch throw try use var while xor return" + - "die echo empty exit eval include include_once isset list require require_once print unset"), - blockKeywords: keywords("catch do else elseif for foreach if switch try while"), - atoms: keywords("true false null TRUE FALSE NULL"), - multiLineStrings: true, - hooks: { - "$": function(stream, state) { - stream.eatWhile(/[\w\$_]/); - return "variable-2"; - }, - "<": function(stream, state) { - if (stream.match(/</; - state.mode = 'php'; - } - else if (style == "tag" && stream.current() == ">" && state.curState.context) { - if (/^script$/i.test(state.curState.context.tagName)) { - state.curMode = jsMode; - state.curState = jsMode.startState(htmlMode.indent(state.curState, "")); - state.curClose = /^<\/\s*script\s*>/i; - state.mode = 'javascript'; - } - else if (/^style$/i.test(state.curState.context.tagName)) { - state.curMode = cssMode; - state.curState = cssMode.startState(htmlMode.indent(state.curState, "")); - state.curClose = /^<\/\s*style\s*>/i; - state.mode = 'css'; - } - } - return style; - } - else if (stream.match(state.curClose, false)) { - state.curMode = htmlMode; - state.curState = state.html; - state.curClose = null; - state.mode = 'html'; - return dispatch(stream, state); - } - else return state.curMode.token(stream, state.curState); - } - - return { - startState: function() { - var html = htmlMode.startState(); - return {html: html, - php: phpMode.startState(), - curMode: parserConfig.startOpen ? phpMode : htmlMode, - curState: parserConfig.startOpen ? phpMode.startState() : html, - curClose: parserConfig.startOpen ? /^\?>/ : null, - mode: parserConfig.startOpen ? 'php' : 'html'} - }, - - copyState: function(state) { - var html = state.html, htmlNew = CodeMirror.copyState(htmlMode, html), - php = state.php, phpNew = CodeMirror.copyState(phpMode, php), cur; - if (state.curState == html) cur = htmlNew; - else if (state.curState == php) cur = phpNew; - else cur = CodeMirror.copyState(state.curMode, state.curState); - return {html: htmlNew, php: phpNew, curMode: state.curMode, curState: cur, - curClose: state.curClose, mode: state.mode}; - }, - - token: dispatch, - - indent: function(state, textAfter) { - if ((state.curMode != phpMode && /^\s*<\//.test(textAfter)) || - (state.curMode == phpMode && /^\?>/.test(textAfter))) - return htmlMode.indent(state.html, textAfter); - return state.curMode.indent(state.curState, textAfter); - }, - - electricChars: "/{}:" - } - }); - CodeMirror.defineMIME("application/x-httpd-php", "php"); - CodeMirror.defineMIME("application/x-httpd-php-open", {name: "php", startOpen: true}); - CodeMirror.defineMIME("text/x-php", phpConfig); -})(); diff --git a/doc/design/js/mode/plsql/index.html b/doc/design/js/mode/plsql/index.html deleted file mode 100644 index be603d990..000000000 --- a/doc/design/js/mode/plsql/index.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - CodeMirror: Oracle PL/SQL mode - - - - - - - -

CodeMirror: Oracle PL/SQL mode

- -
- - - -

- Simple mode that handles Oracle PL/SQL language (and Oracle SQL, of course). -

- -

MIME type defined: text/x-plsql - (PLSQL code) - diff --git a/doc/design/js/mode/plsql/plsql.js b/doc/design/js/mode/plsql/plsql.js deleted file mode 100644 index a2ac2e8df..000000000 --- a/doc/design/js/mode/plsql/plsql.js +++ /dev/null @@ -1,217 +0,0 @@ -CodeMirror.defineMode("plsql", function(config, parserConfig) { - var indentUnit = config.indentUnit, - keywords = parserConfig.keywords, - functions = parserConfig.functions, - types = parserConfig.types, - sqlplus = parserConfig.sqlplus, - multiLineStrings = parserConfig.multiLineStrings; - var isOperatorChar = /[+\-*&%=<>!?:\/|]/; - function chain(stream, state, f) { - state.tokenize = f; - return f(stream, state); - } - - var type; - function ret(tp, style) { - type = tp; - return style; - } - - function tokenBase(stream, state) { - var ch = stream.next(); - // start of string? - if (ch == '"' || ch == "'") - return chain(stream, state, tokenString(ch)); - // is it one of the special signs []{}().,;? Seperator? - else if (/[\[\]{}\(\),;\.]/.test(ch)) - return ret(ch); - // start of a number value? - else if (/\d/.test(ch)) { - stream.eatWhile(/[\w\.]/); - return ret("number", "number"); - } - // multi line comment or simple operator? - else if (ch == "/") { - if (stream.eat("*")) { - return chain(stream, state, tokenComment); - } - else { - stream.eatWhile(isOperatorChar); - return ret("operator", "operator"); - } - } - // single line comment or simple operator? - else if (ch == "-") { - if (stream.eat("-")) { - stream.skipToEnd(); - return ret("comment", "comment"); - } - else { - stream.eatWhile(isOperatorChar); - return ret("operator", "operator"); - } - } - // pl/sql variable? - else if (ch == "@" || ch == "$") { - stream.eatWhile(/[\w\d\$_]/); - return ret("word", "variable"); - } - // is it a operator? - else if (isOperatorChar.test(ch)) { - stream.eatWhile(isOperatorChar); - return ret("operator", "operator"); - } - else { - // get the whole word - stream.eatWhile(/[\w\$_]/); - // is it one of the listed keywords? - if (keywords && keywords.propertyIsEnumerable(stream.current().toLowerCase())) return ret("keyword", "keyword"); - // is it one of the listed functions? - if (functions && functions.propertyIsEnumerable(stream.current().toLowerCase())) return ret("keyword", "builtin"); - // is it one of the listed types? - if (types && types.propertyIsEnumerable(stream.current().toLowerCase())) return ret("keyword", "variable-2"); - // is it one of the listed sqlplus keywords? - if (sqlplus && sqlplus.propertyIsEnumerable(stream.current().toLowerCase())) return ret("keyword", "variable-3"); - // default: just a "word" - return ret("word", "plsql-word"); - } - } - - function tokenString(quote) { - return function(stream, state) { - var escaped = false, next, end = false; - while ((next = stream.next()) != null) { - if (next == quote && !escaped) {end = true; break;} - escaped = !escaped && next == "\\"; - } - if (end || !(escaped || multiLineStrings)) - state.tokenize = tokenBase; - return ret("string", "plsql-string"); - }; - } - - function tokenComment(stream, state) { - var maybeEnd = false, ch; - while (ch = stream.next()) { - if (ch == "/" && maybeEnd) { - state.tokenize = tokenBase; - break; - } - maybeEnd = (ch == "*"); - } - return ret("comment", "plsql-comment"); - } - - // Interface - - return { - startState: function(basecolumn) { - return { - tokenize: tokenBase, - startOfLine: true - }; - }, - - token: function(stream, state) { - if (stream.eatSpace()) return null; - var style = state.tokenize(stream, state); - return style; - } - }; -}); - -(function() { - function keywords(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - var cKeywords = "abort accept access add all alter and any array arraylen as asc assert assign at attributes audit " + - "authorization avg " + - "base_table begin between binary_integer body boolean by " + - "case cast char char_base check close cluster clusters colauth column comment commit compress connect " + - "connected constant constraint crash create current currval cursor " + - "data_base database date dba deallocate debugoff debugon decimal declare default definition delay delete " + - "desc digits dispose distinct do drop " + - "else elsif enable end entry escape exception exception_init exchange exclusive exists exit external " + - "fast fetch file for force form from function " + - "generic goto grant group " + - "having " + - "identified if immediate in increment index indexes indicator initial initrans insert interface intersect " + - "into is " + - "key " + - "level library like limited local lock log logging long loop " + - "master maxextents maxtrans member minextents minus mislabel mode modify multiset " + - "new next no noaudit nocompress nologging noparallel not nowait number_base " + - "object of off offline on online only open option or order out " + - "package parallel partition pctfree pctincrease pctused pls_integer positive positiven pragma primary prior " + - "private privileges procedure public " + - "raise range raw read rebuild record ref references refresh release rename replace resource restrict return " + - "returning reverse revoke rollback row rowid rowlabel rownum rows run " + - "savepoint schema segment select separate session set share snapshot some space split sql start statement " + - "storage subtype successful synonym " + - "tabauth table tables tablespace task terminate then to trigger truncate type " + - "union unique unlimited unrecoverable unusable update use using " + - "validate value values variable view views " + - "when whenever where while with work"; - - var cFunctions = "abs acos add_months ascii asin atan atan2 average " + - "bfilename " + - "ceil chartorowid chr concat convert cos cosh count " + - "decode deref dual dump dup_val_on_index " + - "empty error exp " + - "false floor found " + - "glb greatest " + - "hextoraw " + - "initcap instr instrb isopen " + - "last_day least lenght lenghtb ln lower lpad ltrim lub " + - "make_ref max min mod months_between " + - "new_time next_day nextval nls_charset_decl_len nls_charset_id nls_charset_name nls_initcap nls_lower " + - "nls_sort nls_upper nlssort no_data_found notfound null nvl " + - "others " + - "power " + - "rawtohex reftohex round rowcount rowidtochar rpad rtrim " + - "sign sin sinh soundex sqlcode sqlerrm sqrt stddev substr substrb sum sysdate " + - "tan tanh to_char to_date to_label to_multi_byte to_number to_single_byte translate true trunc " + - "uid upper user userenv " + - "variance vsize"; - - var cTypes = "bfile blob " + - "character clob " + - "dec " + - "float " + - "int integer " + - "mlslabel " + - "natural naturaln nchar nclob number numeric nvarchar2 " + - "real rowtype " + - "signtype smallint string " + - "varchar varchar2"; - - var cSqlplus = "appinfo arraysize autocommit autoprint autorecovery autotrace " + - "blockterminator break btitle " + - "cmdsep colsep compatibility compute concat copycommit copytypecheck " + - "define describe " + - "echo editfile embedded escape exec execute " + - "feedback flagger flush " + - "heading headsep " + - "instance " + - "linesize lno loboffset logsource long longchunksize " + - "markup " + - "native newpage numformat numwidth " + - "pagesize pause pno " + - "recsep recsepchar release repfooter repheader " + - "serveroutput shiftinout show showmode size spool sqlblanklines sqlcase sqlcode sqlcontinue sqlnumber " + - "sqlpluscompatibility sqlprefix sqlprompt sqlterminator suffix " + - "tab term termout time timing trimout trimspool ttitle " + - "underline " + - "verify version " + - "wrap"; - - CodeMirror.defineMIME("text/x-plsql", { - name: "plsql", - keywords: keywords(cKeywords), - functions: keywords(cFunctions), - types: keywords(cTypes), - sqlplus: keywords(cSqlplus) - }); -}()); diff --git a/doc/design/js/mode/python/LICENSE.txt b/doc/design/js/mode/python/LICENSE.txt deleted file mode 100644 index 918866b42..000000000 --- a/doc/design/js/mode/python/LICENSE.txt +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License - -Copyright (c) 2010 Timothy Farrell - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. \ No newline at end of file diff --git a/doc/design/js/mode/python/index.html b/doc/design/js/mode/python/index.html deleted file mode 100644 index 47e0e9d07..000000000 --- a/doc/design/js/mode/python/index.html +++ /dev/null @@ -1,122 +0,0 @@ - - - - CodeMirror: Python mode - - - - - - - -

CodeMirror: Python mode

- -
- -

Configuration Options:

-
    -
  • version - 2/3 - The version of Python to recognize. Default is 2.
  • -
  • singleLineStringErrors - true/false - If you have a single-line string that is not terminated at the end of the line, this will show subsequent lines as errors if true, otherwise it will consider the newline as the end of the string. Default is false.
  • -
- -

MIME types defined: text/x-python.

- - diff --git a/doc/design/js/mode/python/python.js b/doc/design/js/mode/python/python.js deleted file mode 100644 index cfe8a774a..000000000 --- a/doc/design/js/mode/python/python.js +++ /dev/null @@ -1,340 +0,0 @@ -CodeMirror.defineMode("python", function(conf, parserConf) { - var ERRORCLASS = 'error'; - - function wordRegexp(words) { - return new RegExp("^((" + words.join(")|(") + "))\\b"); - } - - var singleOperators = new RegExp("^[\\+\\-\\*/%&|\\^~<>!]"); - var singleDelimiters = new RegExp('^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]'); - var doubleOperators = new RegExp("^((==)|(!=)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))"); - var doubleDelimiters = new RegExp("^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))"); - var tripleDelimiters = new RegExp("^((//=)|(>>=)|(<<=)|(\\*\\*=))"); - var identifiers = new RegExp("^[_A-Za-z][_A-Za-z0-9]*"); - - var wordOperators = wordRegexp(['and', 'or', 'not', 'is', 'in']); - var commonkeywords = ['as', 'assert', 'break', 'class', 'continue', - 'def', 'del', 'elif', 'else', 'except', 'finally', - 'for', 'from', 'global', 'if', 'import', - 'lambda', 'pass', 'raise', 'return', - 'try', 'while', 'with', 'yield']; - var commonBuiltins = ['abs', 'all', 'any', 'bin', 'bool', 'bytearray', 'callable', 'chr', - 'classmethod', 'compile', 'complex', 'delattr', 'dict', 'dir', 'divmod', - 'enumerate', 'eval', 'filter', 'float', 'format', 'frozenset', - 'getattr', 'globals', 'hasattr', 'hash', 'help', 'hex', 'id', - 'input', 'int', 'isinstance', 'issubclass', 'iter', 'len', - 'list', 'locals', 'map', 'max', 'memoryview', 'min', 'next', - 'object', 'oct', 'open', 'ord', 'pow', 'property', 'range', - 'repr', 'reversed', 'round', 'set', 'setattr', 'slice', - 'sorted', 'staticmethod', 'str', 'sum', 'super', 'tuple', - 'type', 'vars', 'zip', '__import__', 'NotImplemented', - 'Ellipsis', '__debug__']; - var py2 = {'builtins': ['apply', 'basestring', 'buffer', 'cmp', 'coerce', 'execfile', - 'file', 'intern', 'long', 'raw_input', 'reduce', 'reload', - 'unichr', 'unicode', 'xrange', 'False', 'True', 'None'], - 'keywords': ['exec', 'print']}; - var py3 = {'builtins': ['ascii', 'bytes', 'exec', 'print'], - 'keywords': ['nonlocal', 'False', 'True', 'None']}; - - if (!!parserConf.version && parseInt(parserConf.version, 10) === 3) { - commonkeywords = commonkeywords.concat(py3.keywords); - commonBuiltins = commonBuiltins.concat(py3.builtins); - var stringPrefixes = new RegExp("^(([rb]|(br))?('{3}|\"{3}|['\"]))", "i"); - } else { - commonkeywords = commonkeywords.concat(py2.keywords); - commonBuiltins = commonBuiltins.concat(py2.builtins); - var stringPrefixes = new RegExp("^(([rub]|(ur)|(br))?('{3}|\"{3}|['\"]))", "i"); - } - var keywords = wordRegexp(commonkeywords); - var builtins = wordRegexp(commonBuiltins); - - var indentInfo = null; - - // tokenizers - function tokenBase(stream, state) { - // Handle scope changes - if (stream.sol()) { - var scopeOffset = state.scopes[0].offset; - if (stream.eatSpace()) { - var lineOffset = stream.indentation(); - if (lineOffset > scopeOffset) { - indentInfo = 'indent'; - } else if (lineOffset < scopeOffset) { - indentInfo = 'dedent'; - } - return null; - } else { - if (scopeOffset > 0) { - dedent(stream, state); - } - } - } - if (stream.eatSpace()) { - return null; - } - - var ch = stream.peek(); - - // Handle Comments - if (ch === '#') { - stream.skipToEnd(); - return 'comment'; - } - - // Handle Number Literals - if (stream.match(/^[0-9\.]/, false)) { - var floatLiteral = false; - // Floats - if (stream.match(/^\d*\.\d+(e[\+\-]?\d+)?/i)) { floatLiteral = true; } - if (stream.match(/^\d+\.\d*/)) { floatLiteral = true; } - if (stream.match(/^\.\d+/)) { floatLiteral = true; } - if (floatLiteral) { - // Float literals may be "imaginary" - stream.eat(/J/i); - return 'number'; - } - // Integers - var intLiteral = false; - // Hex - if (stream.match(/^0x[0-9a-f]+/i)) { intLiteral = true; } - // Binary - if (stream.match(/^0b[01]+/i)) { intLiteral = true; } - // Octal - if (stream.match(/^0o[0-7]+/i)) { intLiteral = true; } - // Decimal - if (stream.match(/^[1-9]\d*(e[\+\-]?\d+)?/)) { - // Decimal literals may be "imaginary" - stream.eat(/J/i); - // TODO - Can you have imaginary longs? - intLiteral = true; - } - // Zero by itself with no other piece of number. - if (stream.match(/^0(?![\dx])/i)) { intLiteral = true; } - if (intLiteral) { - // Integer literals may be "long" - stream.eat(/L/i); - return 'number'; - } - } - - // Handle Strings - if (stream.match(stringPrefixes)) { - state.tokenize = tokenStringFactory(stream.current()); - return state.tokenize(stream, state); - } - - // Handle operators and Delimiters - if (stream.match(tripleDelimiters) || stream.match(doubleDelimiters)) { - return null; - } - if (stream.match(doubleOperators) - || stream.match(singleOperators) - || stream.match(wordOperators)) { - return 'operator'; - } - if (stream.match(singleDelimiters)) { - return null; - } - - if (stream.match(keywords)) { - return 'keyword'; - } - - if (stream.match(builtins)) { - return 'builtin'; - } - - if (stream.match(identifiers)) { - return 'variable'; - } - - // Handle non-detected items - stream.next(); - return ERRORCLASS; - } - - function tokenStringFactory(delimiter) { - while ('rub'.indexOf(delimiter.charAt(0).toLowerCase()) >= 0) { - delimiter = delimiter.substr(1); - } - var singleline = delimiter.length == 1; - var OUTCLASS = 'string'; - - return function tokenString(stream, state) { - while (!stream.eol()) { - stream.eatWhile(/[^'"\\]/); - if (stream.eat('\\')) { - stream.next(); - if (singleline && stream.eol()) { - return OUTCLASS; - } - } else if (stream.match(delimiter)) { - state.tokenize = tokenBase; - return OUTCLASS; - } else { - stream.eat(/['"]/); - } - } - if (singleline) { - if (parserConf.singleLineStringErrors) { - return ERRORCLASS; - } else { - state.tokenize = tokenBase; - } - } - return OUTCLASS; - }; - } - - function indent(stream, state, type) { - type = type || 'py'; - var indentUnit = 0; - if (type === 'py') { - if (state.scopes[0].type !== 'py') { - state.scopes[0].offset = stream.indentation(); - return; - } - for (var i = 0; i < state.scopes.length; ++i) { - if (state.scopes[i].type === 'py') { - indentUnit = state.scopes[i].offset + conf.indentUnit; - break; - } - } - } else { - indentUnit = stream.column() + stream.current().length; - } - state.scopes.unshift({ - offset: indentUnit, - type: type - }); - } - - function dedent(stream, state, type) { - type = type || 'py'; - if (state.scopes.length == 1) return; - if (state.scopes[0].type === 'py') { - var _indent = stream.indentation(); - var _indent_index = -1; - for (var i = 0; i < state.scopes.length; ++i) { - if (_indent === state.scopes[i].offset) { - _indent_index = i; - break; - } - } - if (_indent_index === -1) { - return true; - } - while (state.scopes[0].offset !== _indent) { - state.scopes.shift(); - } - return false - } else { - if (type === 'py') { - state.scopes[0].offset = stream.indentation(); - return false; - } else { - if (state.scopes[0].type != type) { - return true; - } - state.scopes.shift(); - return false; - } - } - } - - function tokenLexer(stream, state) { - indentInfo = null; - var style = state.tokenize(stream, state); - var current = stream.current(); - - // Handle '.' connected identifiers - if (current === '.') { - style = state.tokenize(stream, state); - current = stream.current(); - if (style === 'variable' || style === 'builtin') { - return 'variable'; - } else { - return ERRORCLASS; - } - } - - // Handle decorators - if (current === '@') { - style = state.tokenize(stream, state); - current = stream.current(); - if (style === 'variable' - || current === '@staticmethod' - || current === '@classmethod') { - return 'meta'; - } else { - return ERRORCLASS; - } - } - - // Handle scope changes. - if (current === 'pass' || current === 'return') { - state.dedent += 1; - } - if ((current === ':' && !state.lambda && state.scopes[0].type == 'py') - || indentInfo === 'indent') { - indent(stream, state); - } - var delimiter_index = '[({'.indexOf(current); - if (delimiter_index !== -1) { - indent(stream, state, '])}'.slice(delimiter_index, delimiter_index+1)); - } - if (indentInfo === 'dedent') { - if (dedent(stream, state)) { - return ERRORCLASS; - } - } - delimiter_index = '])}'.indexOf(current); - if (delimiter_index !== -1) { - if (dedent(stream, state, current)) { - return ERRORCLASS; - } - } - if (state.dedent > 0 && stream.eol() && state.scopes[0].type == 'py') { - if (state.scopes.length > 1) state.scopes.shift(); - state.dedent -= 1; - } - - return style; - } - - var external = { - startState: function(basecolumn) { - return { - tokenize: tokenBase, - scopes: [{offset:basecolumn || 0, type:'py'}], - lastToken: null, - lambda: false, - dedent: 0 - }; - }, - - token: function(stream, state) { - var style = tokenLexer(stream, state); - - state.lastToken = {style:style, content: stream.current()}; - - if (stream.eol() && stream.lambda) { - state.lambda = false; - } - - return style; - }, - - indent: function(state, textAfter) { - if (state.tokenize != tokenBase) { - return 0; - } - - return state.scopes[0].offset; - } - - }; - return external; -}); - -CodeMirror.defineMIME("text/x-python", "python"); diff --git a/doc/design/js/mode/r/LICENSE b/doc/design/js/mode/r/LICENSE deleted file mode 100644 index 2510ae16c..000000000 --- a/doc/design/js/mode/r/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -Copyright (c) 2011, Ubalo, Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Ubalo, Inc nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL UBALO, INC BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/doc/design/js/mode/r/index.html b/doc/design/js/mode/r/index.html deleted file mode 100644 index 69775055d..000000000 --- a/doc/design/js/mode/r/index.html +++ /dev/null @@ -1,73 +0,0 @@ - - - - CodeMirror: R mode - - - - - - - -

CodeMirror: R mode

-
- - -

MIME types defined: text/x-rsrc.

- -

Development of the CodeMirror R mode was kindly sponsored - by Ubalo, who hold - the license.

- - - diff --git a/doc/design/js/mode/r/r.js b/doc/design/js/mode/r/r.js deleted file mode 100644 index 53647f23f..000000000 --- a/doc/design/js/mode/r/r.js +++ /dev/null @@ -1,141 +0,0 @@ -CodeMirror.defineMode("r", function(config) { - function wordObj(str) { - var words = str.split(" "), res = {}; - for (var i = 0; i < words.length; ++i) res[words[i]] = true; - return res; - } - var atoms = wordObj("NULL NA Inf NaN NA_integer_ NA_real_ NA_complex_ NA_character_"); - var builtins = wordObj("list quote bquote eval return call parse deparse"); - var keywords = wordObj("if else repeat while function for in next break"); - var blockkeywords = wordObj("if else repeat while function for"); - var opChars = /[+\-*\/^<>=!&|~$:]/; - var curPunc; - - function tokenBase(stream, state) { - curPunc = null; - var ch = stream.next(); - if (ch == "#") { - stream.skipToEnd(); - return "comment"; - } else if (ch == "0" && stream.eat("x")) { - stream.eatWhile(/[\da-f]/i); - return "number"; - } else if (ch == "." && stream.eat(/\d/)) { - stream.match(/\d*(?:e[+\-]?\d+)?/); - return "number"; - } else if (/\d/.test(ch)) { - stream.match(/\d*(?:\.\d+)?(?:e[+\-]\d+)?L?/); - return "number"; - } else if (ch == "'" || ch == '"') { - state.tokenize = tokenString(ch); - return "string"; - } else if (ch == "." && stream.match(/.[.\d]+/)) { - return "keyword"; - } else if (/[\w\.]/.test(ch) && ch != "_") { - stream.eatWhile(/[\w\.]/); - var word = stream.current(); - if (atoms.propertyIsEnumerable(word)) return "atom"; - if (keywords.propertyIsEnumerable(word)) { - if (blockkeywords.propertyIsEnumerable(word)) curPunc = "block"; - return "keyword"; - } - if (builtins.propertyIsEnumerable(word)) return "builtin"; - return "variable"; - } else if (ch == "%") { - if (stream.skipTo("%")) stream.next(); - return "variable-2"; - } else if (ch == "<" && stream.eat("-")) { - return "arrow"; - } else if (ch == "=" && state.ctx.argList) { - return "arg-is"; - } else if (opChars.test(ch)) { - if (ch == "$") return "dollar"; - stream.eatWhile(opChars); - return "operator"; - } else if (/[\(\){}\[\];]/.test(ch)) { - curPunc = ch; - if (ch == ";") return "semi"; - return null; - } else { - return null; - } - } - - function tokenString(quote) { - return function(stream, state) { - if (stream.eat("\\")) { - var ch = stream.next(); - if (ch == "x") stream.match(/^[a-f0-9]{2}/i); - else if ((ch == "u" || ch == "U") && stream.eat("{") && stream.skipTo("}")) stream.next(); - else if (ch == "u") stream.match(/^[a-f0-9]{4}/i); - else if (ch == "U") stream.match(/^[a-f0-9]{8}/i); - else if (/[0-7]/.test(ch)) stream.match(/^[0-7]{1,2}/); - return "string-2"; - } else { - var next; - while ((next = stream.next()) != null) { - if (next == quote) { state.tokenize = tokenBase; break; } - if (next == "\\") { stream.backUp(1); break; } - } - return "string"; - } - }; - } - - function push(state, type, stream) { - state.ctx = {type: type, - indent: state.indent, - align: null, - column: stream.column(), - prev: state.ctx}; - } - function pop(state) { - state.indent = state.ctx.indent; - state.ctx = state.ctx.prev; - } - - return { - startState: function(base) { - return {tokenize: tokenBase, - ctx: {type: "top", - indent: -config.indentUnit, - align: false}, - indent: 0, - afterIdent: false}; - }, - - token: function(stream, state) { - if (stream.sol()) { - if (state.ctx.align == null) state.ctx.align = false; - state.indent = stream.indentation(); - } - if (stream.eatSpace()) return null; - var style = state.tokenize(stream, state); - if (style != "comment" && state.ctx.align == null) state.ctx.align = true; - - var ctype = state.ctx.type; - if ((curPunc == ";" || curPunc == "{" || curPunc == "}") && ctype == "block") pop(state); - if (curPunc == "{") push(state, "}", stream); - else if (curPunc == "(") { - push(state, ")", stream); - if (state.afterIdent) state.ctx.argList = true; - } - else if (curPunc == "[") push(state, "]", stream); - else if (curPunc == "block") push(state, "block", stream); - else if (curPunc == ctype) pop(state); - state.afterIdent = style == "variable" || style == "keyword"; - return style; - }, - - indent: function(state, textAfter) { - if (state.tokenize != tokenBase) return 0; - var firstChar = textAfter && textAfter.charAt(0), ctx = state.ctx, - closing = firstChar == ctx.type; - if (ctx.type == "block") return ctx.indent + (firstChar == "{" ? 0 : config.indentUnit); - else if (ctx.align) return ctx.column + (closing ? 0 : 1); - else return ctx.indent + (closing ? 0 : config.indentUnit); - } - }; -}); - -CodeMirror.defineMIME("text/x-rsrc", "r"); diff --git a/doc/design/js/mode/rpm/changes/changes.js b/doc/design/js/mode/rpm/changes/changes.js deleted file mode 100644 index cb45f9e52..000000000 --- a/doc/design/js/mode/rpm/changes/changes.js +++ /dev/null @@ -1,19 +0,0 @@ -CodeMirror.defineMode("changes", function(config, modeConfig) { - var headerSeperator = /^-+$/; - var headerLine = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ?\d{1,2} \d{2}:\d{2}(:\d{2})? [A-Z]{3,4} \d{4} - /; - var simpleEmail = /^[\w+.-]+@[\w.-]+/; - - return { - token: function(stream) { - if (stream.sol()) { - if (stream.match(headerSeperator)) { return 'tag'; } - if (stream.match(headerLine)) { return 'tag'; } - } - if (stream.match(simpleEmail)) { return 'string'; } - stream.next(); - return null; - } - }; -}); - -CodeMirror.defineMIME("text/x-rpm-changes", "changes"); diff --git a/doc/design/js/mode/rpm/changes/index.html b/doc/design/js/mode/rpm/changes/index.html deleted file mode 100644 index b7ff952d8..000000000 --- a/doc/design/js/mode/rpm/changes/index.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - CodeMirror: RPM changes mode - - - - - - - -

CodeMirror: RPM changes mode

- -
- - -

MIME types defined: text/x-rpm-changes.

- - diff --git a/doc/design/js/mode/rpm/spec/index.html b/doc/design/js/mode/rpm/spec/index.html deleted file mode 100644 index e3bca1521..000000000 --- a/doc/design/js/mode/rpm/spec/index.html +++ /dev/null @@ -1,99 +0,0 @@ - - - - CodeMirror: RPM spec mode - - - - - - - - -

CodeMirror: RPM spec mode

- -
- - -

MIME types defined: text/x-rpm-spec.

- - diff --git a/doc/design/js/mode/rpm/spec/spec.css b/doc/design/js/mode/rpm/spec/spec.css deleted file mode 100644 index d0a5d430c..000000000 --- a/doc/design/js/mode/rpm/spec/spec.css +++ /dev/null @@ -1,5 +0,0 @@ -.cm-s-default span.cm-preamble {color: #b26818; font-weight: bold;} -.cm-s-default span.cm-macro {color: #b218b2;} -.cm-s-default span.cm-section {color: green; font-weight: bold;} -.cm-s-default span.cm-script {color: red;} -.cm-s-default span.cm-issue {color: yellow;} diff --git a/doc/design/js/mode/rpm/spec/spec.js b/doc/design/js/mode/rpm/spec/spec.js deleted file mode 100644 index 3b5c08c92..000000000 --- a/doc/design/js/mode/rpm/spec/spec.js +++ /dev/null @@ -1,66 +0,0 @@ -// Quick and dirty spec file highlighting - -CodeMirror.defineMode("spec", function(config, modeConfig) { - var arch = /^(i386|i586|i686|x86_64|ppc64|ppc|ia64|s390x|s390|sparc64|sparcv9|sparc|noarch|alphaev6|alpha|hppa|mipsel)/; - - var preamble = /^(Name|Version|Release|License|Summary|Url|Group|Source|BuildArch|BuildRequires|BuildRoot|AutoReqProv|Provides|Requires(\(\w+\))?|Obsoletes|Conflicts|Recommends|Source\d*|Patch\d*|ExclusiveArch|NoSource|Supplements):/; - var section = /^%(debug_package|package|description|prep|build|install|files|clean|changelog|preun|postun|pre|post|triggerin|triggerun|pretrans|posttrans|verifyscript|check|triggerpostun|triggerprein|trigger)/; - var control_flow_complex = /^%(ifnarch|ifarch|if)/; // rpm control flow macros - var control_flow_simple = /^%(else|endif)/; // rpm control flow macros - var operators = /^(\!|\?|\<\=|\<|\>\=|\>|\=\=|\&\&|\|\|)/; // operators in control flow macros - - return { - startState: function () { - return { - controlFlow: false, - macroParameters: false, - section: false, - }; - }, - token: function (stream, state) { - var ch = stream.peek(); - if (ch == "#") { stream.skipToEnd(); return "comment"; } - - if (stream.sol()) { - if (stream.match(preamble)) { return "preamble"; } - if (stream.match(section)) { return "section"; } - } - - if (stream.match(/^\$\w+/)) { return "def"; } // Variables like '$RPM_BUILD_ROOT' - if (stream.match(/^\$\{\w+\}/)) { return "def"; } // Variables like '${RPM_BUILD_ROOT}' - - if (stream.match(control_flow_simple)) { return "keyword"; } - if (stream.match(control_flow_complex)) { - state.controlFlow = true; - return "keyword"; - } - if (state.controlFlow) { - if (stream.match(operators)) { return "operator"; } - if (stream.match(/^(\d+)/)) { return "number"; } - if (stream.eol()) { state.controlFlow = false; } - } - - if (stream.match(arch)) { return "number"; } - - // Macros like '%make_install' or '%attr(0775,root,root)' - if (stream.match(/^%[\w]+/)) { - if (stream.match(/^\(/)) { state.macroParameters = true; } - return "macro"; - } - if (state.macroParameters) { - if (stream.match(/^\d+/)) { return "number";} - if (stream.match(/^\)/)) { - state.macroParameters = false; - return "macro"; - } - } - if (stream.match(/^%\{\??[\w \-]+\}/)) { return "macro"; } // Macros like '%{defined fedora}' - - //TODO: Include bash script sub-parser (CodeMirror supports that) - stream.next(); - return null; - } - }; -}); - -CodeMirror.defineMIME("text/x-rpm-spec", "spec"); diff --git a/doc/design/js/mode/rst/index.html b/doc/design/js/mode/rst/index.html deleted file mode 100644 index fd75a284c..000000000 --- a/doc/design/js/mode/rst/index.html +++ /dev/null @@ -1,525 +0,0 @@ - - - - CodeMirror: reStructuredText mode - - - - - - - -

CodeMirror: reStructuredText mode

- -
- - -

The reStructuredText mode supports one configuration parameter:

-
-
verbatim (string)
-
A name or MIME type of a mode that will be used for highlighting - verbatim blocks. By default, reStructuredText mode uses uniform color - for whole block of verbatim text if no mode is given.
-
-

If python mode is available, - it will be used for highlighting blocks containing Python/IPython terminal - sessions (blocks starting with >>> (for Python) or - In [num]: (for IPython). - -

MIME types defined: text/x-rst.

- - - diff --git a/doc/design/js/mode/rst/rst.js b/doc/design/js/mode/rst/rst.js deleted file mode 100644 index 411bac56f..000000000 --- a/doc/design/js/mode/rst/rst.js +++ /dev/null @@ -1,326 +0,0 @@ -CodeMirror.defineMode('rst', function(config, options) { - function setState(state, fn, ctx) { - state.fn = fn; - setCtx(state, ctx); - } - - function setCtx(state, ctx) { - state.ctx = ctx || {}; - } - - function setNormal(state, ch) { - if (ch && (typeof ch !== 'string')) { - var str = ch.current(); - ch = str[str.length-1]; - } - - setState(state, normal, {back: ch}); - } - - function hasMode(mode) { - if (mode) { - var modes = CodeMirror.listModes(); - - for (var i in modes) { - if (modes[i] == mode) { - return true; - } - } - } - - return false; - } - - function getMode(mode) { - if (hasMode(mode)) { - return CodeMirror.getMode(config, mode); - } else { - return null; - } - } - - var verbatimMode = getMode(options.verbatim); - var pythonMode = getMode('python'); - - var reSection = /^[!"#$%&'()*+,-./:;<=>?@[\\\]^_`{|}~]/; - var reDirective = /^\s*\w([-:.\w]*\w)?::(\s|$)/; - var reHyperlink = /^\s*_[\w-]+:(\s|$)/; - var reFootnote = /^\s*\[(\d+|#)\](\s|$)/; - var reCitation = /^\s*\[[A-Za-z][\w-]*\](\s|$)/; - var reFootnoteRef = /^\[(\d+|#)\]_/; - var reCitationRef = /^\[[A-Za-z][\w-]*\]_/; - var reDirectiveMarker = /^\.\.(\s|$)/; - var reVerbatimMarker = /^::\s*$/; - var rePreInline = /^[-\s"([{/:.,;!?\\_]/; - var reEnumeratedList = /^\s*((\d+|[A-Za-z#])[.)]|\((\d+|[A-Z-a-z#])\))\s/; - var reBulletedList = /^\s*[-\+\*]\s/; - var reExamples = /^\s+(>>>|In \[\d+\]:)\s/; - - function normal(stream, state) { - var ch, sol, i; - - if (stream.eat(/\\/)) { - ch = stream.next(); - setNormal(state, ch); - return null; - } - - sol = stream.sol(); - - if (sol && (ch = stream.eat(reSection))) { - for (i = 0; stream.eat(ch); i++); - - if (i >= 3 && stream.match(/^\s*$/)) { - setNormal(state, null); - return 'header'; - } else { - stream.backUp(i + 1); - } - } - - if (sol && stream.match(reDirectiveMarker)) { - if (!stream.eol()) { - setState(state, directive); - } - return 'meta'; - } - - if (stream.match(reVerbatimMarker)) { - if (!verbatimMode) { - setState(state, verbatim); - } else { - var mode = verbatimMode; - - setState(state, verbatim, { - mode: mode, - local: mode.startState() - }); - } - return 'meta'; - } - - if (sol && stream.match(reExamples, false)) { - if (!pythonMode) { - setState(state, verbatim); - return 'meta'; - } else { - var mode = pythonMode; - - setState(state, verbatim, { - mode: mode, - local: mode.startState() - }); - - return null; - } - } - - function testBackward(re) { - return sol || !state.ctx.back || re.test(state.ctx.back); - } - - function testForward(re) { - return stream.eol() || stream.match(re, false); - } - - function testInline(re) { - return stream.match(re) && testBackward(/\W/) && testForward(/\W/); - } - - if (testInline(reFootnoteRef)) { - setNormal(state, stream); - return 'footnote'; - } - - if (testInline(reCitationRef)) { - setNormal(state, stream); - return 'citation'; - } - - ch = stream.next(); - - if (testBackward(rePreInline)) { - if ((ch === ':' || ch === '|') && stream.eat(/\S/)) { - var token; - - if (ch === ':') { - token = 'builtin'; - } else { - token = 'atom'; - } - - setState(state, inline, { - ch: ch, - wide: false, - prev: null, - token: token - }); - - return token; - } - - if (ch === '*' || ch === '`') { - var orig = ch, - wide = false; - - ch = stream.next(); - - if (ch == orig) { - wide = true; - ch = stream.next(); - } - - if (ch && !/\s/.test(ch)) { - var token; - - if (orig === '*') { - token = wide ? 'strong' : 'em'; - } else { - token = wide ? 'string' : 'string-2'; - } - - setState(state, inline, { - ch: orig, // inline() has to know what to search for - wide: wide, // are we looking for `ch` or `chch` - prev: null, // terminator must not be preceeded with whitespace - token: token // I don't want to recompute this all the time - }); - - return token; - } - } - } - - setNormal(state, ch); - return null; - } - - function inline(stream, state) { - var ch = stream.next(), - token = state.ctx.token; - - function finish(ch) { - state.ctx.prev = ch; - return token; - } - - if (ch != state.ctx.ch) { - return finish(ch); - } - - if (/\s/.test(state.ctx.prev)) { - return finish(ch); - } - - if (state.ctx.wide) { - ch = stream.next(); - - if (ch != state.ctx.ch) { - return finish(ch); - } - } - - if (!stream.eol() && !rePostInline.test(stream.peek())) { - if (state.ctx.wide) { - stream.backUp(1); - } - - return finish(ch); - } - - setState(state, normal); - setNormal(state, ch); - - return token; - } - - function directive(stream, state) { - var token = null; - - if (stream.match(reDirective)) { - token = 'attribute'; - } else if (stream.match(reHyperlink)) { - token = 'link'; - } else if (stream.match(reFootnote)) { - token = 'quote'; - } else if (stream.match(reCitation)) { - token = 'quote'; - } else { - stream.eatSpace(); - - if (stream.eol()) { - setNormal(state, stream); - return null; - } else { - stream.skipToEnd(); - setState(state, comment); - return 'comment'; - } - } - - // FIXME this is unreachable - setState(state, body, {start: true}); - return token; - } - - function body(stream, state) { - var token = 'body'; - - if (!state.ctx.start || stream.sol()) { - return block(stream, state, token); - } - - stream.skipToEnd(); - setCtx(state); - - return token; - } - - function comment(stream, state) { - return block(stream, state, 'comment'); - } - - function verbatim(stream, state) { - if (!verbatimMode) { - return block(stream, state, 'meta'); - } else { - if (stream.sol()) { - if (!stream.eatSpace()) { - setNormal(state, stream); - } - - return null; - } - - return verbatimMode.token(stream, state.ctx.local); - } - } - - function block(stream, state, token) { - if (stream.eol() || stream.eatSpace()) { - stream.skipToEnd(); - return token; - } else { - setNormal(state, stream); - return null; - } - } - - return { - startState: function() { - return {fn: normal, ctx: {}}; - }, - - copyState: function(state) { - return {fn: state.fn, ctx: state.ctx}; - }, - - token: function(stream, state) { - var token = state.fn(stream, state); - return token; - } - }; -}); - -CodeMirror.defineMIME("text/x-rst", "rst"); diff --git a/doc/design/js/mode/ruby/LICENSE b/doc/design/js/mode/ruby/LICENSE deleted file mode 100644 index ac09fc403..000000000 --- a/doc/design/js/mode/ruby/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -Copyright (c) 2011, Ubalo, Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the Ubalo, Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL UBALO, INC BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/doc/design/js/mode/ruby/index.html b/doc/design/js/mode/ruby/index.html deleted file mode 100644 index 6d33db192..000000000 --- a/doc/design/js/mode/ruby/index.html +++ /dev/null @@ -1,171 +0,0 @@ - - - - CodeMirror: Ruby mode - - - - - - - -

CodeMirror: Ruby mode

-
- - -

MIME types defined: text/x-ruby.

- -

Development of the CodeMirror Ruby mode was kindly sponsored - by Ubalo, who hold - the license.

- - - diff --git a/doc/design/js/mode/ruby/ruby.js b/doc/design/js/mode/ruby/ruby.js deleted file mode 100644 index 1708a1285..000000000 --- a/doc/design/js/mode/ruby/ruby.js +++ /dev/null @@ -1,200 +0,0 @@ -CodeMirror.defineMode("ruby", function(config, parserConfig) { - function wordObj(words) { - var o = {}; - for (var i = 0, e = words.length; i < e; ++i) o[words[i]] = true; - return o; - } - var keywords = wordObj([ - "alias", "and", "BEGIN", "begin", "break", "case", "class", "def", "defined?", "do", "else", - "elsif", "END", "end", "ensure", "false", "for", "if", "in", "module", "next", "not", "or", - "redo", "rescue", "retry", "return", "self", "super", "then", "true", "undef", "unless", - "until", "when", "while", "yield", "nil", "raise", "throw", "catch", "fail", "loop", "callcc", - "caller", "lambda", "proc", "public", "protected", "private", "require", "load", - "require_relative", "extend", "autoload" - ]); - var indentWords = wordObj(["def", "class", "case", "for", "while", "do", "module", "then", - "catch", "loop", "proc", "begin"]); - var dedentWords = wordObj(["end", "until"]); - var matching = {"[": "]", "{": "}", "(": ")"}; - var curPunc; - - function chain(newtok, stream, state) { - state.tokenize.push(newtok); - return newtok(stream, state); - } - - function tokenBase(stream, state) { - curPunc = null; - if (stream.sol() && stream.match("=begin") && stream.eol()) { - state.tokenize.push(readBlockComment); - return "comment"; - } - if (stream.eatSpace()) return null; - var ch = stream.next(); - if (ch == "`" || ch == "'" || ch == '"' || - (ch == "/" && !stream.eol() && stream.peek() != " ")) { - return chain(readQuoted(ch, "string", ch == '"'), stream, state); - } else if (ch == "%") { - var style, embed = false; - if (stream.eat("s")) style = "atom"; - else if (stream.eat(/[WQ]/)) { style = "string"; embed = true; } - else if (stream.eat(/[wxqr]/)) style = "string"; - var delim = stream.eat(/[^\w\s]/); - if (!delim) return "operator"; - if (matching.propertyIsEnumerable(delim)) delim = matching[delim]; - return chain(readQuoted(delim, style, embed, true), stream, state); - } else if (ch == "#") { - stream.skipToEnd(); - return "comment"; - } else if (ch == "<" && stream.eat("<")) { - stream.eat("-"); - stream.eat(/[\'\"\`]/); - var match = stream.match(/^\w+/); - stream.eat(/[\'\"\`]/); - if (match) return chain(readHereDoc(match[0]), stream, state); - return null; - } else if (ch == "0") { - if (stream.eat("x")) stream.eatWhile(/[\da-fA-F]/); - else if (stream.eat("b")) stream.eatWhile(/[01]/); - else stream.eatWhile(/[0-7]/); - return "number"; - } else if (/\d/.test(ch)) { - stream.match(/^[\d_]*(?:\.[\d_]+)?(?:[eE][+\-]?[\d_]+)?/); - return "number"; - } else if (ch == "?") { - while (stream.match(/^\\[CM]-/)) {} - if (stream.eat("\\")) stream.eatWhile(/\w/); - else stream.next(); - return "string"; - } else if (ch == ":") { - if (stream.eat("'")) return chain(readQuoted("'", "atom", false), stream, state); - if (stream.eat('"')) return chain(readQuoted('"', "atom", true), stream, state); - stream.eatWhile(/[\w\?]/); - return "atom"; - } else if (ch == "@") { - stream.eat("@"); - stream.eatWhile(/[\w\?]/); - return "variable-2"; - } else if (ch == "$") { - stream.next(); - stream.eatWhile(/[\w\?]/); - return "variable-3"; - } else if (/\w/.test(ch)) { - stream.eatWhile(/[\w\?]/); - if (stream.eat(":")) return "atom"; - return "ident"; - } else if (ch == "|" && (state.varList || state.lastTok == "{" || state.lastTok == "do")) { - curPunc = "|"; - return null; - } else if (/[\(\)\[\]{}\\;]/.test(ch)) { - curPunc = ch; - return null; - } else if (ch == "-" && stream.eat(">")) { - return "arrow"; - } else if (/[=+\-\/*:\.^%<>~|]/.test(ch)) { - stream.eatWhile(/[=+\-\/*:\.^%<>~|]/); - return "operator"; - } else { - return null; - } - } - - function tokenBaseUntilBrace() { - var depth = 1; - return function(stream, state) { - if (stream.peek() == "}") { - depth--; - if (depth == 0) { - state.tokenize.pop(); - return state.tokenize[state.tokenize.length-1](stream, state); - } - } else if (stream.peek() == "{") { - depth++; - } - return tokenBase(stream, state); - }; - } - function readQuoted(quote, style, embed, unescaped) { - return function(stream, state) { - var escaped = false, ch; - while ((ch = stream.next()) != null) { - if (ch == quote && (unescaped || !escaped)) { - state.tokenize.pop(); - break; - } - if (embed && ch == "#" && !escaped && stream.eat("{")) { - state.tokenize.push(tokenBaseUntilBrace(arguments.callee)); - break; - } - escaped = !escaped && ch == "\\"; - } - return style; - }; - } - function readHereDoc(phrase) { - return function(stream, state) { - if (stream.match(phrase)) state.tokenize.pop(); - else stream.skipToEnd(); - return "string"; - }; - } - function readBlockComment(stream, state) { - if (stream.sol() && stream.match("=end") && stream.eol()) - state.tokenize.pop(); - stream.skipToEnd(); - return "comment"; - } - - return { - startState: function() { - return {tokenize: [tokenBase], - indented: 0, - context: {type: "top", indented: -config.indentUnit}, - continuedLine: false, - lastTok: null, - varList: false}; - }, - - token: function(stream, state) { - if (stream.sol()) state.indented = stream.indentation(); - var style = state.tokenize[state.tokenize.length-1](stream, state), kwtype; - if (style == "ident") { - var word = stream.current(); - style = keywords.propertyIsEnumerable(stream.current()) ? "keyword" - : /^[A-Z]/.test(word) ? "tag" - : (state.lastTok == "def" || state.lastTok == "class" || state.varList) ? "def" - : "variable"; - if (indentWords.propertyIsEnumerable(word)) kwtype = "indent"; - else if (dedentWords.propertyIsEnumerable(word)) kwtype = "dedent"; - else if ((word == "if" || word == "unless") && stream.column() == stream.indentation()) - kwtype = "indent"; - } - if (curPunc || (style && style != "comment")) state.lastTok = word || curPunc || style; - if (curPunc == "|") state.varList = !state.varList; - - if (kwtype == "indent" || /[\(\[\{]/.test(curPunc)) - state.context = {prev: state.context, type: curPunc || style, indented: state.indented}; - else if ((kwtype == "dedent" || /[\)\]\}]/.test(curPunc)) && state.context.prev) - state.context = state.context.prev; - - if (stream.eol()) - state.continuedLine = (curPunc == "\\" || style == "operator"); - return style; - }, - - indent: function(state, textAfter) { - if (state.tokenize[state.tokenize.length-1] != tokenBase) return 0; - var firstChar = textAfter && textAfter.charAt(0); - var ct = state.context; - var closing = ct.type == matching[firstChar] || - ct.type == "keyword" && /^(?:end|until|else|elsif|when|rescue)\b/.test(textAfter); - return ct.indented + (closing ? 0 : config.indentUnit) + - (state.continuedLine ? config.indentUnit : 0); - }, - electricChars: "}de" // enD and rescuE - - }; -}); - -CodeMirror.defineMIME("text/x-ruby", "ruby"); - diff --git a/doc/design/js/mode/rust/index.html b/doc/design/js/mode/rust/index.html deleted file mode 100644 index 3b811e35d..000000000 --- a/doc/design/js/mode/rust/index.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - CodeMirror: Rust mode - - - - - - - -

CodeMirror: Rust mode

- -
- - - -

MIME types defined: text/x-rustsrc.

- - diff --git a/doc/design/js/mode/rust/rust.js b/doc/design/js/mode/rust/rust.js deleted file mode 100644 index 2a5caac28..000000000 --- a/doc/design/js/mode/rust/rust.js +++ /dev/null @@ -1,432 +0,0 @@ -CodeMirror.defineMode("rust", function() { - var indentUnit = 4, altIndentUnit = 2; - var valKeywords = { - "if": "if-style", "while": "if-style", "else": "else-style", - "do": "else-style", "ret": "else-style", "fail": "else-style", - "break": "atom", "cont": "atom", "const": "let", "resource": "fn", - "let": "let", "fn": "fn", "for": "for", "alt": "alt", "iface": "iface", - "impl": "impl", "type": "type", "enum": "enum", "mod": "mod", - "as": "op", "true": "atom", "false": "atom", "assert": "op", "check": "op", - "claim": "op", "native": "ignore", "unsafe": "ignore", "import": "else-style", - "export": "else-style", "copy": "op", "log": "op", "log_err": "op", - "use": "op", "bind": "op", "self": "atom" - }; - var typeKeywords = function() { - var keywords = {"fn": "fn", "block": "fn", "obj": "obj"}; - var atoms = "bool uint int i8 i16 i32 i64 u8 u16 u32 u64 float f32 f64 str char".split(" "); - for (var i = 0, e = atoms.length; i < e; ++i) keywords[atoms[i]] = "atom"; - return keywords; - }(); - var operatorChar = /[+\-*&%=<>!?|\.@]/; - - // Tokenizer - - // Used as scratch variable to communicate multiple values without - // consing up tons of objects. - var tcat, content; - function r(tc, style) { - tcat = tc; - return style; - } - - function tokenBase(stream, state) { - var ch = stream.next(); - if (ch == '"') { - state.tokenize = tokenString; - return state.tokenize(stream, state); - } - if (ch == "'") { - tcat = "atom"; - if (stream.eat("\\")) { - if (stream.skipTo("'")) { stream.next(); return "string"; } - else { return "error"; } - } else { - stream.next(); - return stream.eat("'") ? "string" : "error"; - } - } - if (ch == "/") { - if (stream.eat("/")) { stream.skipToEnd(); return "comment"; } - if (stream.eat("*")) { - state.tokenize = tokenComment(1); - return state.tokenize(stream, state); - } - } - if (ch == "#") { - if (stream.eat("[")) { tcat = "open-attr"; return null; } - stream.eatWhile(/\w/); - return r("macro", "meta"); - } - if (ch == ":" && stream.match(":<")) { - return r("op", null); - } - if (ch.match(/\d/) || (ch == "." && stream.eat(/\d/))) { - var flp = false; - if (!stream.match(/^x[\da-f]+/i) && !stream.match(/^b[01]+/)) { - stream.eatWhile(/\d/); - if (stream.eat(".")) { flp = true; stream.eatWhile(/\d/); } - if (stream.match(/^e[+\-]?\d+/i)) { flp = true; } - } - if (flp) stream.match(/^f(?:32|64)/); - else stream.match(/^[ui](?:8|16|32|64)/); - return r("atom", "number"); - } - if (ch.match(/[()\[\]{}:;,]/)) return r(ch, null); - if (ch == "-" && stream.eat(">")) return r("->", null); - if (ch.match(operatorChar)) { - stream.eatWhile(operatorChar); - return r("op", null); - } - stream.eatWhile(/\w/); - content = stream.current(); - if (stream.match(/^::\w/)) { - stream.backUp(1); - return r("prefix", "variable-2"); - } - if (state.keywords.propertyIsEnumerable(content)) - return r(state.keywords[content], content.match(/true|false/) ? "atom" : "keyword"); - return r("name", "variable"); - } - - function tokenString(stream, state) { - var ch, escaped = false; - while (ch = stream.next()) { - if (ch == '"' && !escaped) { - state.tokenize = tokenBase; - return r("atom", "string"); - } - escaped = !escaped && ch == "\\"; - } - // Hack to not confuse the parser when a string is split in - // pieces. - return r("op", "string"); - } - - function tokenComment(depth) { - return function(stream, state) { - var lastCh = null, ch; - while (ch = stream.next()) { - if (ch == "/" && lastCh == "*") { - if (depth == 1) { - state.tokenize = tokenBase; - break; - } else { - state.tokenize = tokenComment(depth - 1); - return state.tokenize(stream, state); - } - } - if (ch == "*" && lastCh == "/") { - state.tokenize = tokenComment(depth + 1); - return state.tokenize(stream, state); - } - lastCh = ch; - } - return "comment"; - }; - } - - // Parser - - var cx = {state: null, stream: null, marked: null, cc: null}; - function pass() { - for (var i = arguments.length - 1; i >= 0; i--) cx.cc.push(arguments[i]); - } - function cont() { - pass.apply(null, arguments); - return true; - } - - function pushlex(type, info) { - var result = function() { - var state = cx.state; - state.lexical = {indented: state.indented, column: cx.stream.column(), - type: type, prev: state.lexical, info: info}; - }; - result.lex = true; - return result; - } - function poplex() { - var state = cx.state; - if (state.lexical.prev) { - if (state.lexical.type == ")") - state.indented = state.lexical.indented; - state.lexical = state.lexical.prev; - } - } - function typecx() { cx.state.keywords = typeKeywords; } - function valcx() { cx.state.keywords = valKeywords; } - poplex.lex = typecx.lex = valcx.lex = true; - - function commasep(comb, end) { - function more(type) { - if (type == ",") return cont(comb, more); - if (type == end) return cont(); - return cont(more); - } - return function(type) { - if (type == end) return cont(); - return pass(comb, more); - }; - } - - function stat_of(comb, tag) { - return cont(pushlex("stat", tag), comb, poplex, block); - } - function block(type) { - if (type == "}") return cont(); - if (type == "let") return stat_of(letdef1, "let"); - if (type == "fn") return stat_of(fndef); - if (type == "type") return cont(pushlex("stat"), tydef, endstatement, poplex, block); - if (type == "enum") return stat_of(enumdef); - if (type == "mod") return stat_of(mod); - if (type == "iface") return stat_of(iface); - if (type == "impl") return stat_of(impl); - if (type == "open-attr") return cont(pushlex("]"), commasep(expression, "]"), poplex); - if (type == "ignore" || type.match(/[\]\);,]/)) return cont(block); - return pass(pushlex("stat"), expression, poplex, endstatement, block); - } - function endstatement(type) { - if (type == ";") return cont(); - return pass(); - } - function expression(type) { - if (type == "atom" || type == "name") return cont(maybeop); - if (type == "{") return cont(pushlex("}"), exprbrace, poplex); - if (type.match(/[\[\(]/)) return matchBrackets(type, expression); - if (type.match(/[\]\)\};,]/)) return pass(); - if (type == "if-style") return cont(expression, expression); - if (type == "else-style" || type == "op") return cont(expression); - if (type == "for") return cont(pattern, maybetype, inop, expression, expression); - if (type == "alt") return cont(expression, altbody); - if (type == "fn") return cont(fndef); - if (type == "macro") return cont(macro); - return cont(); - } - function maybeop(type) { - if (content == ".") return cont(maybeprop); - if (content == "::<"){return cont(typarams, maybeop);} - if (type == "op" || content == ":") return cont(expression); - if (type == "(" || type == "[") return matchBrackets(type, expression); - return pass(); - } - function maybeprop(type) { - if (content.match(/^\w+$/)) {cx.marked = "variable"; return cont(maybeop);} - return pass(expression); - } - function exprbrace(type) { - if (type == "op") { - if (content == "|") return cont(blockvars, poplex, pushlex("}", "block"), block); - if (content == "||") return cont(poplex, pushlex("}", "block"), block); - } - if (content == "mutable" || (content.match(/^\w+$/) && cx.stream.peek() == ":" - && !cx.stream.match("::", false))) - return pass(record_of(expression)); - return pass(block); - } - function record_of(comb) { - function ro(type) { - if (content == "mutable" || content == "with") {cx.marked = "keyword"; return cont(ro);} - if (content.match(/^\w*$/)) {cx.marked = "variable"; return cont(ro);} - if (type == ":") return cont(comb, ro); - if (type == "}") return cont(); - return cont(ro); - } - return ro; - } - function blockvars(type) { - if (type == "name") {cx.marked = "def"; return cont(blockvars);} - if (type == "op" && content == "|") return cont(); - return cont(blockvars); - } - - function letdef1(type) { - if (type.match(/[\]\)\};]/)) return cont(); - if (content == "=") return cont(expression, letdef2); - if (type == ",") return cont(letdef1); - return pass(pattern, maybetype, letdef1); - } - function letdef2(type) { - if (type.match(/[\]\)\};,]/)) return pass(letdef1); - else return pass(expression, letdef2); - } - function maybetype(type) { - if (type == ":") return cont(typecx, rtype, valcx); - return pass(); - } - function inop(type) { - if (type == "name" && content == "in") {cx.marked = "keyword"; return cont();} - return pass(); - } - function fndef(type) { - if (content == "@" || content == "~") {cx.marked = "keyword"; return cont(fndef);} - if (type == "name") {cx.marked = "def"; return cont(fndef);} - if (content == "<") return cont(typarams, fndef); - if (type == "{") return pass(expression); - if (type == "(") return cont(pushlex(")"), commasep(argdef, ")"), poplex, fndef); - if (type == "->") return cont(typecx, rtype, valcx, fndef); - if (type == ";") return cont(); - return cont(fndef); - } - function tydef(type) { - if (type == "name") {cx.marked = "def"; return cont(tydef);} - if (content == "<") return cont(typarams, tydef); - if (content == "=") return cont(typecx, rtype, valcx); - return cont(tydef); - } - function enumdef(type) { - if (type == "name") {cx.marked = "def"; return cont(enumdef);} - if (content == "<") return cont(typarams, enumdef); - if (content == "=") return cont(typecx, rtype, valcx, endstatement); - if (type == "{") return cont(pushlex("}"), typecx, enumblock, valcx, poplex); - return cont(enumdef); - } - function enumblock(type) { - if (type == "}") return cont(); - if (type == "(") return cont(pushlex(")"), commasep(rtype, ")"), poplex, enumblock); - if (content.match(/^\w+$/)) cx.marked = "def"; - return cont(enumblock); - } - function mod(type) { - if (type == "name") {cx.marked = "def"; return cont(mod);} - if (type == "{") return cont(pushlex("}"), block, poplex); - return pass(); - } - function iface(type) { - if (type == "name") {cx.marked = "def"; return cont(iface);} - if (content == "<") return cont(typarams, iface); - if (type == "{") return cont(pushlex("}"), block, poplex); - return pass(); - } - function impl(type) { - if (content == "<") return cont(typarams, impl); - if (content == "of" || content == "for") {cx.marked = "keyword"; return cont(rtype, impl);} - if (type == "name") {cx.marked = "def"; return cont(impl);} - if (type == "{") return cont(pushlex("}"), block, poplex); - return pass(); - } - function typarams(type) { - if (content == ">") return cont(); - if (content == ",") return cont(typarams); - if (content == ":") return cont(rtype, typarams); - return pass(rtype, typarams); - } - function argdef(type) { - if (type == "name") {cx.marked = "def"; return cont(argdef);} - if (type == ":") return cont(typecx, rtype, valcx); - return pass(); - } - function rtype(type) { - if (type == "name") {cx.marked = "variable-3"; return cont(rtypemaybeparam); } - if (content == "mutable") {cx.marked = "keyword"; return cont(rtype);} - if (type == "atom") return cont(rtypemaybeparam); - if (type == "op" || type == "obj") return cont(rtype); - if (type == "fn") return cont(fntype); - if (type == "{") return cont(pushlex("{"), record_of(rtype), poplex); - return matchBrackets(type, rtype); - } - function rtypemaybeparam(type) { - if (content == "<") return cont(typarams); - return pass(); - } - function fntype(type) { - if (type == "(") return cont(pushlex("("), commasep(rtype, ")"), poplex, fntype); - if (type == "->") return cont(rtype); - return pass(); - } - function pattern(type) { - if (type == "name") {cx.marked = "def"; return cont(patternmaybeop);} - if (type == "atom") return cont(patternmaybeop); - if (type == "op") return cont(pattern); - if (type.match(/[\]\)\};,]/)) return pass(); - return matchBrackets(type, pattern); - } - function patternmaybeop(type) { - if (type == "op" && content == ".") return cont(); - if (content == "to") {cx.marked = "keyword"; return cont(pattern);} - else return pass(); - } - function altbody(type) { - if (type == "{") return cont(pushlex("}", "alt"), altblock1, poplex); - return pass(); - } - function altblock1(type) { - if (type == "}") return cont(); - if (type == "|") return cont(altblock1); - if (content == "when") {cx.marked = "keyword"; return cont(expression, altblock2);} - if (type.match(/[\]\);,]/)) return cont(altblock1); - return pass(pattern, altblock2); - } - function altblock2(type) { - if (type == "{") return cont(pushlex("}", "alt"), block, poplex, altblock1); - else return pass(altblock1); - } - - function macro(type) { - if (type.match(/[\[\(\{]/)) return matchBrackets(type, expression); - return pass(); - } - function matchBrackets(type, comb) { - if (type == "[") return cont(pushlex("]"), commasep(comb, "]"), poplex); - if (type == "(") return cont(pushlex(")"), commasep(comb, ")"), poplex); - if (type == "{") return cont(pushlex("}"), commasep(comb, "}"), poplex); - return cont(); - } - - function parse(state, stream, style) { - var cc = state.cc; - // Communicate our context to the combinators. - // (Less wasteful than consing up a hundred closures on every call.) - cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc; - - while (true) { - var combinator = cc.length ? cc.pop() : block; - if (combinator(tcat)) { - while(cc.length && cc[cc.length - 1].lex) - cc.pop()(); - return cx.marked || style; - } - } - } - - return { - startState: function() { - return { - tokenize: tokenBase, - cc: [], - lexical: {indented: -indentUnit, column: 0, type: "top", align: false}, - keywords: valKeywords, - indented: 0 - }; - }, - - token: function(stream, state) { - if (stream.sol()) { - if (!state.lexical.hasOwnProperty("align")) - state.lexical.align = false; - state.indented = stream.indentation(); - } - if (stream.eatSpace()) return null; - tcat = content = null; - var style = state.tokenize(stream, state); - if (style == "comment") return style; - if (!state.lexical.hasOwnProperty("align")) - state.lexical.align = true; - if (tcat == "prefix") return style; - if (!content) content = stream.current(); - return parse(state, stream, style); - }, - - indent: function(state, textAfter) { - if (state.tokenize != tokenBase) return 0; - var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical, - type = lexical.type, closing = firstChar == type; - if (type == "stat") return lexical.indented + indentUnit; - if (lexical.align) return lexical.column + (closing ? 0 : 1); - return lexical.indented + (closing ? 0 : (lexical.info == "alt" ? altIndentUnit : indentUnit)); - }, - - electricChars: "{}" - }; -}); - -CodeMirror.defineMIME("text/x-rustsrc", "rust"); diff --git a/doc/design/js/mode/scheme/index.html b/doc/design/js/mode/scheme/index.html deleted file mode 100644 index 2a6105fa9..000000000 --- a/doc/design/js/mode/scheme/index.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - CodeMirror: Scheme mode - - - - - - - -

CodeMirror: Scheme mode

-
- - -

MIME types defined: text/x-scheme.

- - - diff --git a/doc/design/js/mode/scheme/scheme.js b/doc/design/js/mode/scheme/scheme.js deleted file mode 100644 index caf78db09..000000000 --- a/doc/design/js/mode/scheme/scheme.js +++ /dev/null @@ -1,202 +0,0 @@ -/** - * Author: Koh Zi Han, based on implementation by Koh Zi Chun - */ -CodeMirror.defineMode("scheme", function (config, mode) { - var BUILTIN = "builtin", COMMENT = "comment", STRING = "string", - ATOM = "atom", NUMBER = "number", BRACKET = "bracket", KEYWORD="keyword"; - var INDENT_WORD_SKIP = 2, KEYWORDS_SKIP = 1; - - function makeKeywords(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - - var keywords = makeKeywords("λ case-lambda call/cc class define-class exit-handler field import inherit init-field interface let*-values let-values let/ec mixin opt-lambda override protect provide public rename require require-for-syntax syntax syntax-case syntax-error unit/sig unless when with-syntax and begin call-with-current-continuation call-with-input-file call-with-output-file case cond define define-syntax delay do dynamic-wind else for-each if lambda let let* let-syntax letrec letrec-syntax map or syntax-rules abs acos angle append apply asin assoc assq assv atan boolean? caar cadr call-with-input-file call-with-output-file call-with-values car cdddar cddddr cdr ceiling char->integer char-alphabetic? char-ci<=? char-ci=? char-ci>? char-downcase char-lower-case? char-numeric? char-ready? char-upcase char-upper-case? char-whitespace? char<=? char=? char>? char? close-input-port close-output-port complex? cons cos current-input-port current-output-port denominator display eof-object? eq? equal? eqv? eval even? exact->inexact exact? exp expt #f floor force gcd imag-part inexact->exact inexact? input-port? integer->char integer? interaction-environment lcm length list list->string list->vector list-ref list-tail list? load log magnitude make-polar make-rectangular make-string make-vector max member memq memv min modulo negative? newline not null-environment null? number->string number? numerator odd? open-input-file open-output-file output-port? pair? peek-char port? positive? procedure? quasiquote quote quotient rational? rationalize read read-char real-part real? remainder reverse round scheme-report-environment set! set-car! set-cdr! sin sqrt string string->list string->number string->symbol string-append string-ci<=? string-ci=? string-ci>? string-copy string-fill! string-length string-ref string-set! string<=? string=? string>? string? substring symbol->string symbol? #t tan transcript-off transcript-on truncate values vector vector->list vector-fill! vector-length vector-ref vector-set! with-input-from-file with-output-to-file write write-char zero?"); - var indentKeys = makeKeywords("define let letrec let* lambda"); - - - function stateStack(indent, type, prev) { // represents a state stack object - this.indent = indent; - this.type = type; - this.prev = prev; - } - - function pushStack(state, indent, type) { - state.indentStack = new stateStack(indent, type, state.indentStack); - } - - function popStack(state) { - state.indentStack = state.indentStack.prev; - } - - /** - * Scheme numbers are complicated unfortunately. - * Checks if we're looking at a number, which might be possibly a fraction. - * Also checks that it is not part of a longer identifier. Returns true/false accordingly. - */ - function isNumber(ch, stream){ - if(/[0-9]/.exec(ch) != null){ - stream.eatWhile(/[0-9]/); - stream.eat(/\//); - stream.eatWhile(/[0-9]/); - if (stream.eol() || !(/[a-zA-Z\-\_\/]/.exec(stream.peek()))) return true; - stream.backUp(stream.current().length - 1); // undo all the eating - } - return false; - } - - return { - startState: function () { - return { - indentStack: null, - indentation: 0, - mode: false, - sExprComment: false - }; - }, - - token: function (stream, state) { - if (state.indentStack == null && stream.sol()) { - // update indentation, but only if indentStack is empty - state.indentation = stream.indentation(); - } - - // skip spaces - if (stream.eatSpace()) { - return null; - } - var returnType = null; - - switch(state.mode){ - case "string": // multi-line string parsing mode - var next, escaped = false; - while ((next = stream.next()) != null) { - if (next == "\"" && !escaped) { - - state.mode = false; - break; - } - escaped = !escaped && next == "\\"; - } - returnType = STRING; // continue on in scheme-string mode - break; - case "comment": // comment parsing mode - var next, maybeEnd = false; - while ((next = stream.next()) != null) { - if (next == "#" && maybeEnd) { - - state.mode = false; - break; - } - maybeEnd = (next == "|"); - } - returnType = COMMENT; - break; - case "s-expr-comment": // s-expr commenting mode - state.mode = false; - if(stream.peek() == "(" || stream.peek() == "["){ - // actually start scheme s-expr commenting mode - state.sExprComment = 0; - }else{ - // if not we just comment the entire of the next token - stream.eatWhile(/[^/s]/); // eat non spaces - returnType = COMMENT; - break; - } - default: // default parsing mode - var ch = stream.next(); - - if (ch == "\"") { - state.mode = "string"; - returnType = STRING; - - } else if (ch == "'") { - returnType = ATOM; - } else if (ch == '#') { - if (stream.eat("|")) { // Multi-line comment - state.mode = "comment"; // toggle to comment mode - returnType = COMMENT; - } else if (stream.eat(/[tf]/)) { // #t/#f (atom) - returnType = ATOM; - } else if (stream.eat(';')) { // S-Expr comment - state.mode = "s-expr-comment"; - returnType = COMMENT; - } - - } else if (ch == ";") { // comment - stream.skipToEnd(); // rest of the line is a comment - returnType = COMMENT; - } else if (ch == "-"){ - - if(!isNaN(parseInt(stream.peek()))){ - stream.eatWhile(/[\/0-9]/); - returnType = NUMBER; - }else{ - returnType = null; - } - } else if (isNumber(ch,stream)){ - returnType = NUMBER; - } else if (ch == "(" || ch == "[") { - var keyWord = ''; var indentTemp = stream.column(); - /** - Either - (indent-word .. - (non-indent-word .. - (;something else, bracket, etc. - */ - - while ((letter = stream.eat(/[^\s\(\[\;\)\]]/)) != null) { - keyWord += letter; - } - - if (keyWord.length > 0 && indentKeys.propertyIsEnumerable(keyWord)) { // indent-word - - pushStack(state, indentTemp + INDENT_WORD_SKIP, ch); - } else { // non-indent word - // we continue eating the spaces - stream.eatSpace(); - if (stream.eol() || stream.peek() == ";") { - // nothing significant after - // we restart indentation 1 space after - pushStack(state, indentTemp + 1, ch); - } else { - pushStack(state, indentTemp + stream.current().length, ch); // else we match - } - } - stream.backUp(stream.current().length - 1); // undo all the eating - - if(typeof state.sExprComment == "number") state.sExprComment++; - - returnType = BRACKET; - } else if (ch == ")" || ch == "]") { - returnType = BRACKET; - if (state.indentStack != null && state.indentStack.type == (ch == ")" ? "(" : "[")) { - popStack(state); - - if(typeof state.sExprComment == "number"){ - if(--state.sExprComment == 0){ - returnType = COMMENT; // final closing bracket - state.sExprComment = false; // turn off s-expr commenting mode - } - } - } - } else { - stream.eatWhile(/[\w\$_\-]/); - - if (keywords && keywords.propertyIsEnumerable(stream.current())) { - returnType = BUILTIN; - }else returnType = null; - } - } - return (typeof state.sExprComment == "number") ? COMMENT : returnType; - }, - - indent: function (state, textAfter) { - if (state.indentStack == null) return state.indentation; - return state.indentStack.indent; - } - }; -}); - -CodeMirror.defineMIME("text/x-scheme", "scheme"); \ No newline at end of file diff --git a/doc/design/js/mode/smalltalk/index.html b/doc/design/js/mode/smalltalk/index.html deleted file mode 100644 index 8a85c39ee..000000000 --- a/doc/design/js/mode/smalltalk/index.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - CodeMirror: Smalltalk mode - - - - - - - -

CodeMirror: Smalltalk mode

- -
- - - -

Simple Smalltalk mode.

- -

MIME types defined: text/x-stsrc.

- - diff --git a/doc/design/js/mode/smalltalk/smalltalk.js b/doc/design/js/mode/smalltalk/smalltalk.js deleted file mode 100644 index e002e666f..000000000 --- a/doc/design/js/mode/smalltalk/smalltalk.js +++ /dev/null @@ -1,139 +0,0 @@ -CodeMirror.defineMode('smalltalk', function(config, modeConfig) { - - var specialChars = /[+\-/\\*~<>=@%|&?!.:;^]/; - var keywords = /true|false|nil|self|super|thisContext/; - - var Context = function(tokenizer, parent) { - this.next = tokenizer; - this.parent = parent; - }; - - var Token = function(name, context, eos) { - this.name = name; - this.context = context; - this.eos = eos; - }; - - var State = function() { - this.context = new Context(next, null); - this.expectVariable = true; - this.indentation = 0; - this.userIndentationDelta = 0; - }; - - State.prototype.userIndent = function(indentation) { - this.userIndentationDelta = indentation > 0 ? (indentation / config.indentUnit - this.indentation) : 0; - }; - - var next = function(stream, context, state) { - var token = new Token(null, context, false); - var char = stream.next(); - - if (char === '"') { - token = nextComment(stream, new Context(nextComment, context)); - - } else if (char === '\'') { - token = nextString(stream, new Context(nextString, context)); - - } else if (char === '#') { - stream.eatWhile(/[^ .]/); - token.name = 'string-2'; - - } else if (char === '$') { - stream.eatWhile(/[^ ]/); - token.name = 'string-2'; - - } else if (char === '|' && state.expectVariable) { - token.context = new Context(nextTemporaries, context); - - } else if (/[\[\]{}()]/.test(char)) { - token.name = 'bracket'; - token.eos = /[\[{(]/.test(char); - - if (char === '[') { - state.indentation++; - } else if (char === ']') { - state.indentation = Math.max(0, state.indentation - 1); - } - - } else if (specialChars.test(char)) { - stream.eatWhile(specialChars); - token.name = 'operator'; - token.eos = char !== ';'; // ; cascaded message expression - - } else if (/\d/.test(char)) { - stream.eatWhile(/[\w\d]/); - token.name = 'number' - - } else if (/[\w_]/.test(char)) { - stream.eatWhile(/[\w\d_]/); - token.name = state.expectVariable ? (keywords.test(stream.current()) ? 'keyword' : 'variable') : null; - - } else { - token.eos = state.expectVariable; - } - - return token; - }; - - var nextComment = function(stream, context) { - stream.eatWhile(/[^"]/); - return new Token('comment', stream.eat('"') ? context.parent : context, true); - }; - - var nextString = function(stream, context) { - stream.eatWhile(/[^']/); - return new Token('string', stream.eat('\'') ? context.parent : context, false); - }; - - var nextTemporaries = function(stream, context, state) { - var token = new Token(null, context, false); - var char = stream.next(); - - if (char === '|') { - token.context = context.parent; - token.eos = true; - - } else { - stream.eatWhile(/[^|]/); - token.name = 'variable'; - } - - return token; - } - - return { - startState: function() { - return new State; - }, - - token: function(stream, state) { - state.userIndent(stream.indentation()); - - if (stream.eatSpace()) { - return null; - } - - var token = state.context.next(stream, state.context, state); - state.context = token.context; - state.expectVariable = token.eos; - - state.lastToken = token; - return token.name; - }, - - blankLine: function(state) { - state.userIndent(0); - }, - - indent: function(state, textAfter) { - var i = state.context.next === next && textAfter && textAfter.charAt(0) === ']' ? -1 : state.userIndentationDelta; - return (state.indentation + i) * config.indentUnit; - }, - - electricChars: ']' - }; - -}); - -CodeMirror.defineMIME('text/x-stsrc', {name: 'smalltalk'}); \ No newline at end of file diff --git a/doc/design/js/mode/sparql/index.html b/doc/design/js/mode/sparql/index.html deleted file mode 100644 index d7772f6bc..000000000 --- a/doc/design/js/mode/sparql/index.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - CodeMirror: SPARQL mode - - - - - - - -

CodeMirror: SPARQL mode

-
- - -

MIME types defined: application/x-sparql-query.

- - - diff --git a/doc/design/js/mode/sparql/sparql.js b/doc/design/js/mode/sparql/sparql.js deleted file mode 100644 index ceb52942f..000000000 --- a/doc/design/js/mode/sparql/sparql.js +++ /dev/null @@ -1,143 +0,0 @@ -CodeMirror.defineMode("sparql", function(config) { - var indentUnit = config.indentUnit; - var curPunc; - - function wordRegexp(words) { - return new RegExp("^(?:" + words.join("|") + ")$", "i"); - } - var ops = wordRegexp(["str", "lang", "langmatches", "datatype", "bound", "sameterm", "isiri", "isuri", - "isblank", "isliteral", "union", "a"]); - var keywords = wordRegexp(["base", "prefix", "select", "distinct", "reduced", "construct", "describe", - "ask", "from", "named", "where", "order", "limit", "offset", "filter", "optional", - "graph", "by", "asc", "desc"]); - var operatorChars = /[*+\-<>=&|]/; - - function tokenBase(stream, state) { - var ch = stream.next(); - curPunc = null; - if (ch == "$" || ch == "?") { - stream.match(/^[\w\d]*/); - return "variable-2"; - } - else if (ch == "<" && !stream.match(/^[\s\u00a0=]/, false)) { - stream.match(/^[^\s\u00a0>]*>?/); - return "atom"; - } - else if (ch == "\"" || ch == "'") { - state.tokenize = tokenLiteral(ch); - return state.tokenize(stream, state); - } - else if (/[{}\(\),\.;\[\]]/.test(ch)) { - curPunc = ch; - return null; - } - else if (ch == "#") { - stream.skipToEnd(); - return "comment"; - } - else if (operatorChars.test(ch)) { - stream.eatWhile(operatorChars); - return null; - } - else if (ch == ":") { - stream.eatWhile(/[\w\d\._\-]/); - return "atom"; - } - else { - stream.eatWhile(/[_\w\d]/); - if (stream.eat(":")) { - stream.eatWhile(/[\w\d_\-]/); - return "atom"; - } - var word = stream.current(), type; - if (ops.test(word)) - return null; - else if (keywords.test(word)) - return "keyword"; - else - return "variable"; - } - } - - function tokenLiteral(quote) { - return function(stream, state) { - var escaped = false, ch; - while ((ch = stream.next()) != null) { - if (ch == quote && !escaped) { - state.tokenize = tokenBase; - break; - } - escaped = !escaped && ch == "\\"; - } - return "string"; - }; - } - - function pushContext(state, type, col) { - state.context = {prev: state.context, indent: state.indent, col: col, type: type}; - } - function popContext(state) { - state.indent = state.context.indent; - state.context = state.context.prev; - } - - return { - startState: function(base) { - return {tokenize: tokenBase, - context: null, - indent: 0, - col: 0}; - }, - - token: function(stream, state) { - if (stream.sol()) { - if (state.context && state.context.align == null) state.context.align = false; - state.indent = stream.indentation(); - } - if (stream.eatSpace()) return null; - var style = state.tokenize(stream, state); - - if (style != "comment" && state.context && state.context.align == null && state.context.type != "pattern") { - state.context.align = true; - } - - if (curPunc == "(") pushContext(state, ")", stream.column()); - else if (curPunc == "[") pushContext(state, "]", stream.column()); - else if (curPunc == "{") pushContext(state, "}", stream.column()); - else if (/[\]\}\)]/.test(curPunc)) { - while (state.context && state.context.type == "pattern") popContext(state); - if (state.context && curPunc == state.context.type) popContext(state); - } - else if (curPunc == "." && state.context && state.context.type == "pattern") popContext(state); - else if (/atom|string|variable/.test(style) && state.context) { - if (/[\}\]]/.test(state.context.type)) - pushContext(state, "pattern", stream.column()); - else if (state.context.type == "pattern" && !state.context.align) { - state.context.align = true; - state.context.col = stream.column(); - } - } - - return style; - }, - - indent: function(state, textAfter) { - var firstChar = textAfter && textAfter.charAt(0); - var context = state.context; - if (/[\]\}]/.test(firstChar)) - while (context && context.type == "pattern") context = context.prev; - - var closing = context && firstChar == context.type; - if (!context) - return 0; - else if (context.type == "pattern") - return context.col; - else if (context.align) - return context.col + (closing ? 0 : 1); - else - return context.indent + (closing ? 0 : indentUnit); - } - }; -}); - -CodeMirror.defineMIME("application/x-sparql-query", "sparql"); diff --git a/doc/design/js/mode/stex/index.html b/doc/design/js/mode/stex/index.html deleted file mode 100644 index ccd9dd83a..000000000 --- a/doc/design/js/mode/stex/index.html +++ /dev/null @@ -1,95 +0,0 @@ - - - - CodeMirror: sTeX mode - - - - - - - -

CodeMirror: sTeX mode

-
- - -

MIME types defined: text/stex.

- - - diff --git a/doc/design/js/mode/stex/stex.js b/doc/design/js/mode/stex/stex.js deleted file mode 100644 index bb47fb45c..000000000 --- a/doc/design/js/mode/stex/stex.js +++ /dev/null @@ -1,167 +0,0 @@ -/* - * Author: Constantin Jucovschi (c.jucovschi@jacobs-university.de) - * Licence: MIT - */ - -CodeMirror.defineMode("stex", function(cmCfg, modeCfg) -{ - function pushCommand(state, command) { - state.cmdState.push(command); - } - - function peekCommand(state) { - if (state.cmdState.length>0) - return state.cmdState[state.cmdState.length-1]; - else - return null; - } - - function popCommand(state) { - if (state.cmdState.length>0) { - var plug = state.cmdState.pop(); - plug.closeBracket(); - } - } - - function applyMostPowerful(state) { - var context = state.cmdState; - for (var i = context.length - 1; i >= 0; i--) { - var plug = context[i]; - if (plug.name=="DEFAULT") - continue; - return plug.styleIdentifier(); - } - return null; - } - - function addPluginPattern(pluginName, cmdStyle, brackets, styles) { - return function () { - this.name=pluginName; - this.bracketNo = 0; - this.style=cmdStyle; - this.styles = styles; - this.brackets = brackets; - - this.styleIdentifier = function(content) { - if (this.bracketNo<=this.styles.length) - return this.styles[this.bracketNo-1]; - else - return null; - }; - this.openBracket = function(content) { - this.bracketNo++; - return "bracket"; - }; - this.closeBracket = function(content) { - }; - } - } - - var plugins = new Array(); - - plugins["importmodule"] = addPluginPattern("importmodule", "tag", "{[", ["string", "builtin"]); - plugins["documentclass"] = addPluginPattern("documentclass", "tag", "{[", ["", "atom"]); - plugins["usepackage"] = addPluginPattern("documentclass", "tag", "[", ["atom"]); - plugins["begin"] = addPluginPattern("documentclass", "tag", "[", ["atom"]); - plugins["end"] = addPluginPattern("documentclass", "tag", "[", ["atom"]); - - plugins["DEFAULT"] = function () { - this.name="DEFAULT"; - this.style="tag"; - - this.styleIdentifier = function(content) { - }; - this.openBracket = function(content) { - }; - this.closeBracket = function(content) { - }; - }; - - function setState(state, f) { - state.f = f; - } - - function normal(source, state) { - if (source.match(/^\\[a-z]+/)) { - var cmdName = source.current(); - cmdName = cmdName.substr(1, cmdName.length-1); - var plug = plugins[cmdName]; - if (typeof(plug) == 'undefined') { - plug = plugins["DEFAULT"]; - } - plug = new plug(); - pushCommand(state, plug); - setState(state, beginParams); - return plug.style; - } - - var ch = source.next(); - if (ch == "%") { - setState(state, inCComment); - return "comment"; - } - else if (ch=='}' || ch==']') { - plug = peekCommand(state); - if (plug) { - plug.closeBracket(ch); - setState(state, beginParams); - } else - return "error"; - return "bracket"; - } else if (ch=='{' || ch=='[') { - plug = plugins["DEFAULT"]; - plug = new plug(); - pushCommand(state, plug); - return "bracket"; - } - else if (/\d/.test(ch)) { - source.eatWhile(/[\w.%]/); - return "atom"; - } - else { - source.eatWhile(/[\w-_]/); - return applyMostPowerful(state); - } - } - - function inCComment(source, state) { - source.skipToEnd(); - setState(state, normal); - return "comment"; - } - - function beginParams(source, state) { - var ch = source.peek(); - if (ch == '{' || ch == '[') { - var lastPlug = peekCommand(state); - var style = lastPlug.openBracket(ch); - source.eat(ch); - setState(state, normal); - return "bracket"; - } - if (/[ \t\r]/.test(ch)) { - source.eat(ch); - return null; - } - setState(state, normal); - lastPlug = peekCommand(state); - if (lastPlug) { - popCommand(state); - } - return normal(source, state); - } - - return { - startState: function() { return { f:normal, cmdState:[] }; }, - copyState: function(s) { return { f: s.f, cmdState: s.cmdState.slice(0, s.cmdState.length) }; }, - - token: function(stream, state) { - var t = state.f(stream, state); - var w = stream.current(); - return t; - } - }; -}); - - -CodeMirror.defineMIME("text/x-stex", "stex"); diff --git a/doc/design/js/mode/tiddlywiki/index.html b/doc/design/js/mode/tiddlywiki/index.html deleted file mode 100644 index 36d0975ce..000000000 --- a/doc/design/js/mode/tiddlywiki/index.html +++ /dev/null @@ -1,183 +0,0 @@ - - - - CodeMirror: TiddlyWiki mode - - - - - - - - -

CodeMirror: TiddlyWiki mode

- -
- - - -

TiddlyWiki mode supports a single configuration.

- -

MIME types defined: text/x-tiddlywiki.

- - diff --git a/doc/design/js/mode/tiddlywiki/tiddlywiki.css b/doc/design/js/mode/tiddlywiki/tiddlywiki.css deleted file mode 100644 index 767f3de2a..000000000 --- a/doc/design/js/mode/tiddlywiki/tiddlywiki.css +++ /dev/null @@ -1,21 +0,0 @@ -.cm-s-default span.cm-header {color: blue; font-weight:bold;} -.cm-s-default span.cm-code {color: #a50;} -.cm-s-default span.cm-code-inline {color: #660;} - -.cm-s-default span.cm-quote {color: #555;} -.cm-s-default span.cm-list {color: #c60;} -.cm-s-default span.cm-hr {color: #999;} -.cm-s-default span.cm-em {font-style: italic;} -.cm-s-default span.cm-strong {font-weight: bold;} - -.cm-s-default span.cm-link-external {color: blue;} -.cm-s-default span.cm-brace {color: #170; font-weight: bold;} -.cm-s-default span.cm-macro {color: #9E3825;} -.cm-s-default span.cm-table {color: blue;} -.cm-s-default span.cm-warning {color: red; font-weight: bold;} - -.cm-s-default span.cm-underlined {text-decoration: underline;} -.cm-s-default span.cm-line-through {text-decoration: line-through;} - -.cm-s-default span.cm-comment {color: #666;} - diff --git a/doc/design/js/mode/tiddlywiki/tiddlywiki.js b/doc/design/js/mode/tiddlywiki/tiddlywiki.js deleted file mode 100644 index e07124c22..000000000 --- a/doc/design/js/mode/tiddlywiki/tiddlywiki.js +++ /dev/null @@ -1,374 +0,0 @@ -/*** - |''Name''|tiddlywiki.js| - |''Description''|Enables TiddlyWikiy syntax highlighting using CodeMirror2| - |''Author''|PMario| - |''Version''|0.1.6| - |''Status''|''beta''| - |''Source''|[[GitHub|https://github.com/pmario/CodeMirror2/blob/tw-syntax/mode/tiddlywiki]]| - |''Documentation''|http://codemirror.tiddlyspace.com/| - |''License''|[[MIT License|http://www.opensource.org/licenses/mit-license.php]]| - |''CoreVersion''|2.5.0| - |''Requires''|codemirror.js| - |''Keywords''|syntax highlighting color code mirror codemirror| - ! Info - CoreVersion parameter is needed for TiddlyWiki only! - ***/ -//{{{ -CodeMirror.defineMode("tiddlywiki", function (config, parserConfig) { - var indentUnit = config.indentUnit; - - // Tokenizer - var textwords = function () { - function kw(type) { - return { - type: type, - style: "text" - }; - } - return {}; - }(); - - var keywords = function () { - function kw(type) { - return { type: type, style: "macro"}; - } - return { - "allTags": kw('allTags'), "closeAll": kw('closeAll'), "list": kw('list'), - "newJournal": kw('newJournal'), "newTiddler": kw('newTiddler'), - "permaview": kw('permaview'), "saveChanges": kw('saveChanges'), - "search": kw('search'), "slider": kw('slider'), "tabs": kw('tabs'), - "tag": kw('tag'), "tagging": kw('tagging'), "tags": kw('tags'), - "tiddler": kw('tiddler'), "timeline": kw('timeline'), - "today": kw('today'), "version": kw('version'), "option": kw('option'), - - "with": kw('with'), - "filter": kw('filter') - }; - }(); - - var isSpaceName = /[\w_\-]/i, - reHR = /^\-\-\-\-+$/, - reWikiCommentStart = /^\/\*\*\*$/, // /*** - reWikiCommentStop = /^\*\*\*\/$/, // ***/ - reBlockQuote = /^<<<$/, - - reJsCodeStart = /^\/\/\{\{\{$/, // //{{{ - reJsCodeStop = /^\/\/\}\}\}$/, // //}}} - reXmlCodeStart = /^$/, - reXmlCodeStop = /^$/, - - reCodeBlockStart = /^\{\{\{$/, - reCodeBlockStop = /^\}\}\}$/, - - reCodeStart = /\{\{\{/, - reUntilCodeStop = /.*?\}\}\}/; - - function chain(stream, state, f) { - state.tokenize = f; - return f(stream, state); - } - - // used for strings - function nextUntilUnescaped(stream, end) { - var escaped = false, - next; - while ((next = stream.next()) != null) { - if (next == end && !escaped) return false; - escaped = !escaped && next == "\\"; - } - return escaped; - } - - // Used as scratch variables to communicate multiple values without - // consing up tons of objects. - var type, content; - - function ret(tp, style, cont) { - type = tp; - content = cont; - return style; - } - - function jsTokenBase(stream, state) { - var sol = stream.sol(), - ch, tch; - - state.block = false; // indicates the start of a code block. - - ch = stream.peek(); // don't eat, to make match simpler - - // check start of blocks - if (sol && /[<\/\*{}\-]/.test(ch)) { - if (stream.match(reCodeBlockStart)) { - state.block = true; - return chain(stream, state, twTokenCode); - } - if (stream.match(reBlockQuote)) { - return ret('quote', 'quote'); - } - if (stream.match(reWikiCommentStart) || stream.match(reWikiCommentStop)) { - return ret('code', 'code'); - } - if (stream.match(reJsCodeStart) || stream.match(reJsCodeStop) || stream.match(reXmlCodeStart) || stream.match(reXmlCodeStop)) { - return ret('code', 'code'); - } - if (stream.match(reHR)) { - return ret('hr', 'hr'); - } - } // sol - var ch = stream.next(); - - if (sol && /[\/\*!#;:>|]/.test(ch)) { - if (ch == "!") { // tw header - stream.skipToEnd(); - return ret("header", "header"); - } - if (ch == "*") { // tw list - stream.eatWhile('*'); - return ret("list", "list"); - } - if (ch == "#") { // tw numbered list - stream.eatWhile('#'); - return ret("list", "list"); - } - if (ch == ";") { // tw list - stream.eatWhile(';'); - return ret("list", "list"); - } - if (ch == ":") { // tw list - stream.eatWhile(':'); - return ret("list", "list"); - } - if (ch == ">") { // single line quote - stream.eatWhile(">"); - return ret("quote", "quote"); - } - if (ch == '|') { - return ret('table', 'table'); - } - } - - if (ch == '{' && stream.match(/\{\{/)) { - return chain(stream, state, twTokenCode); - } - - // rudimentary html:// file:// link matching. TW knows much more ... - if (/[hf]/i.test(ch)) { - if (/[ti]/i.test(stream.peek()) && stream.match(/\b(ttps?|tp|ile):\/\/[\-A-Z0-9+&@#\/%?=~_|$!:,.;]*[A-Z0-9+&@#\/%=~_|$]/i)) { - return ret("link-external", "link-external"); - } - } - // just a little string indicator, don't want to have the whole string covered - if (ch == '"') { - return ret('string', 'string'); - } - if (/[\[\]]/.test(ch)) { // check for [[..]] - if (stream.peek() == ch) { - stream.next(); - return ret('brace', 'brace'); - } - } - if (ch == "@") { // check for space link. TODO fix @@...@@ highlighting - stream.eatWhile(isSpaceName); - return ret("link-external", "link-external"); - } - if (/\d/.test(ch)) { // numbers - stream.eatWhile(/\d/); - return ret("number", "number"); - } - if (ch == "/") { // tw invisible comment - if (stream.eat("%")) { - return chain(stream, state, twTokenComment); - } - else if (stream.eat("/")) { // - return chain(stream, state, twTokenEm); - } - } - if (ch == "_") { // tw underline - if (stream.eat("_")) { - return chain(stream, state, twTokenUnderline); - } - } - if (ch == "-") { // tw strikethrough TODO looks ugly .. different handling see below; - if (stream.eat("-")) { - return chain(stream, state, twTokenStrike); - } - } - if (ch == "'") { // tw bold - if (stream.eat("'")) { - return chain(stream, state, twTokenStrong); - } - } - if (ch == "<") { // tw macro - if (stream.eat("<")) { - return chain(stream, state, twTokenMacro); - } - } - else { - return ret(ch); - } - - stream.eatWhile(/[\w\$_]/); - var word = stream.current(), - known = textwords.propertyIsEnumerable(word) && textwords[word]; - - return known ? ret(known.type, known.style, word) : ret("text", null, word); - - } // jsTokenBase() - - function twTokenString(quote) { - return function (stream, state) { - if (!nextUntilUnescaped(stream, quote)) state.tokenize = jsTokenBase; - return ret("string", "string"); - }; - } - - // tw invisible comment - function twTokenComment(stream, state) { - var maybeEnd = false, - ch; - while (ch = stream.next()) { - if (ch == "/" && maybeEnd) { - state.tokenize = jsTokenBase; - break; - } - maybeEnd = (ch == "%"); - } - return ret("comment", "comment"); - } - - // tw strong / bold - function twTokenStrong(stream, state) { - var maybeEnd = false, - ch; - while (ch = stream.next()) { - if (ch == "'" && maybeEnd) { - state.tokenize = jsTokenBase; - break; - } - maybeEnd = (ch == "'"); - } - return ret("text", "strong"); - } - - // tw code - function twTokenCode(stream, state) { - var ch, sb = state.block; - - if (sb && stream.current()) { - return ret("code", "code"); - } - - if (!sb && stream.match(reUntilCodeStop)) { - state.tokenize = jsTokenBase; - return ret("code", "code-inline"); - } - - if (sb && stream.sol() && stream.match(reCodeBlockStop)) { - state.tokenize = jsTokenBase; - return ret("code", "code"); - } - - ch = stream.next(); - return (sb) ? ret("code", "code") : ret("code", "code-inline"); - } - - // tw em / italic - function twTokenEm(stream, state) { - var maybeEnd = false, - ch; - while (ch = stream.next()) { - if (ch == "/" && maybeEnd) { - state.tokenize = jsTokenBase; - break; - } - maybeEnd = (ch == "/"); - } - return ret("text", "em"); - } - - // tw underlined text - function twTokenUnderline(stream, state) { - var maybeEnd = false, - ch; - while (ch = stream.next()) { - if (ch == "_" && maybeEnd) { - state.tokenize = jsTokenBase; - break; - } - maybeEnd = (ch == "_"); - } - return ret("text", "underlined"); - } - - // tw strike through text looks ugly - // TODO just strike through the first and last 2 chars if possible. - function twTokenStrike(stream, state) { - var maybeEnd = false, - ch, nr; - - while (ch = stream.next()) { - if (ch == "-" && maybeEnd) { - state.tokenize = jsTokenBase; - break; - } - maybeEnd = (ch == "-"); - } - return ret("text", "line-through"); - } - - // macro - function twTokenMacro(stream, state) { - var ch, tmp, word, known; - - if (stream.current() == '<<') { - return ret('brace', 'macro'); - } - - ch = stream.next(); - if (!ch) { - state.tokenize = jsTokenBase; - return ret(ch); - } - if (ch == ">") { - if (stream.peek() == '>') { - stream.next(); - state.tokenize = jsTokenBase; - return ret("brace", "macro"); - } - } - - stream.eatWhile(/[\w\$_]/); - word = stream.current(); - known = keywords.propertyIsEnumerable(word) && keywords[word]; - - if (known) { - return ret(known.type, known.style, word); - } - else { - return ret("macro", null, word); - } - } - - // Interface - return { - startState: function (basecolumn) { - return { - tokenize: jsTokenBase, - indented: 0, - level: 0 - }; - }, - - token: function (stream, state) { - if (stream.eatSpace()) return null; - var style = state.tokenize(stream, state); - return style; - }, - - electricChars: "" - }; -}); - -CodeMirror.defineMIME("text/x-tiddlywiki", "tiddlywiki"); -//}}} diff --git a/doc/design/js/mode/velocity/index.html b/doc/design/js/mode/velocity/index.html deleted file mode 100644 index 49dba3820..000000000 --- a/doc/design/js/mode/velocity/index.html +++ /dev/null @@ -1,103 +0,0 @@ - - - - CodeMirror: Velocity mode - - - - - - - - -

CodeMirror: Velocity mode

-
- - -

MIME types defined: text/velocity.

- - - diff --git a/doc/design/js/mode/velocity/velocity.js b/doc/design/js/mode/velocity/velocity.js deleted file mode 100644 index 0b80c7581..000000000 --- a/doc/design/js/mode/velocity/velocity.js +++ /dev/null @@ -1,146 +0,0 @@ -CodeMirror.defineMode("velocity", function(config) { - function parseWords(str) { - var obj = {}, words = str.split(" "); - for (var i = 0; i < words.length; ++i) obj[words[i]] = true; - return obj; - } - - var indentUnit = config.indentUnit - var keywords = parseWords("#end #else #break #stop #[[ #]] " + - "#{end} #{else} #{break} #{stop}"); - var functions = parseWords("#if #elseif #foreach #set #include #parse #macro #define #evaluate " + - "#{if} #{elseif} #{foreach} #{set} #{include} #{parse} #{macro} #{define} #{evaluate}"); - var specials = parseWords("$foreach.count $foreach.hasNext $foreach.first $foreach.last $foreach.topmost $foreach.parent $velocityCount"); - var isOperatorChar = /[+\-*&%=<>!?:\/|]/; - var multiLineStrings =true; - - function chain(stream, state, f) { - state.tokenize = f; - return f(stream, state); - } - function tokenBase(stream, state) { - var beforeParams = state.beforeParams; - state.beforeParams = false; - var ch = stream.next(); - // start of string? - if ((ch == '"' || ch == "'") && state.inParams) - return chain(stream, state, tokenString(ch)); - // is it one of the special signs []{}().,;? Seperator? - else if (/[\[\]{}\(\),;\.]/.test(ch)) { - if (ch == "(" && beforeParams) state.inParams = true; - else if (ch == ")") state.inParams = false; - return null; - } - // start of a number value? - else if (/\d/.test(ch)) { - stream.eatWhile(/[\w\.]/); - return "number"; - } - // multi line comment? - else if (ch == "#" && stream.eat("*")) { - return chain(stream, state, tokenComment); - } - // unparsed content? - else if (ch == "#" && stream.match(/ *\[ *\[/)) { - return chain(stream, state, tokenUnparsed); - } - // single line comment? - else if (ch == "#" && stream.eat("#")) { - stream.skipToEnd(); - return "comment"; - } - // variable? - else if (ch == "$") { - stream.eatWhile(/[\w\d\$_\.{}]/); - // is it one of the specials? - if (specials && specials.propertyIsEnumerable(stream.current().toLowerCase())) { - return "keyword"; - } - else { - state.beforeParams = true; - return "builtin"; - } - } - // is it a operator? - else if (isOperatorChar.test(ch)) { - stream.eatWhile(isOperatorChar); - return "operator"; - } - else { - // get the whole word - stream.eatWhile(/[\w\$_{}]/); - var word = stream.current().toLowerCase(); - // is it one of the listed keywords? - if (keywords && keywords.propertyIsEnumerable(word)) - return "keyword"; - // is it one of the listed functions? - if (functions && functions.propertyIsEnumerable(word) || - stream.current().match(/^#[a-z0-9_]+ *$/i) && stream.peek()=="(") { - state.beforeParams = true; - return "keyword"; - } - // default: just a "word" - return null; - } - } - - function tokenString(quote) { - return function(stream, state) { - var escaped = false, next, end = false; - while ((next = stream.next()) != null) { - if (next == quote && !escaped) { - end = true; - break; - } - escaped = !escaped && next == "\\"; - } - if (end) state.tokenize = tokenBase; - return "string"; - }; - } - - function tokenComment(stream, state) { - var maybeEnd = false, ch; - while (ch = stream.next()) { - if (ch == "#" && maybeEnd) { - state.tokenize = tokenBase; - break; - } - maybeEnd = (ch == "*"); - } - return "comment"; - } - - function tokenUnparsed(stream, state) { - var maybeEnd = 0, ch; - while (ch = stream.next()) { - if (ch == "#" && maybeEnd == 2) { - state.tokenize = tokenBase; - break; - } - if (ch == "]") - maybeEnd++; - else if (ch != " ") - maybeEnd = 0; - } - return "meta"; - } - // Interface - - return { - startState: function(basecolumn) { - return { - tokenize: tokenBase, - beforeParams: false, - inParams: false - }; - }, - - token: function(stream, state) { - if (stream.eatSpace()) return null; - return state.tokenize(stream, state); - } - }; -}); - -CodeMirror.defineMIME("text/velocity", "velocity"); diff --git a/doc/design/js/mode/verilog/index.html b/doc/design/js/mode/verilog/index.html deleted file mode 100644 index 775dd5374..000000000 --- a/doc/design/js/mode/verilog/index.html +++ /dev/null @@ -1,210 +0,0 @@ - - - - CodeMirror: Verilog mode - - - - - - - -

CodeMirror: Verilog mode

- -
- - - -

Simple mode that tries to handle Verilog-like languages as well as it - can. Takes one configuration parameters: keywords, an - object whose property names are the keywords in the language.

- -

MIME types defined: text/x-verilog (Verilog code).

- - diff --git a/doc/design/js/mode/verilog/verilog.js b/doc/design/js/mode/verilog/verilog.js deleted file mode 100644 index 736d16ad0..000000000 --- a/doc/design/js/mode/verilog/verilog.js +++ /dev/null @@ -1,194 +0,0 @@ -CodeMirror.defineMode("verilog", function(config, parserConfig) { - var indentUnit = config.indentUnit, - keywords = parserConfig.keywords || {}, - blockKeywords = parserConfig.blockKeywords || {}, - atoms = parserConfig.atoms || {}, - hooks = parserConfig.hooks || {}, - multiLineStrings = parserConfig.multiLineStrings; - var isOperatorChar = /[&|~> - - - CodeMirror: XML mode - - - - - - - -

CodeMirror: XML mode

-
- -

The XML mode supports two configuration parameters:

-
-
htmlMode (boolean)
-
This switches the mode to parse HTML instead of XML. This - means attributes do not have to be quoted, and some elements - (such as br) do not require a closing tag.
-
alignCDATA (boolean)
-
Setting this to true will force the opening tag of CDATA - blocks to not be indented.
-
- -

MIME types defined: application/xml, text/html.

- - diff --git a/doc/design/js/mode/xml/xml.js b/doc/design/js/mode/xml/xml.js deleted file mode 100644 index fa3802c50..000000000 --- a/doc/design/js/mode/xml/xml.js +++ /dev/null @@ -1,260 +0,0 @@ -CodeMirror.defineMode("xml", function(config, parserConfig) { - var indentUnit = config.indentUnit; - var Kludges = parserConfig.htmlMode ? { - autoSelfClosers: {"br": true, "img": true, "hr": true, "link": true, "input": true, - "meta": true, "col": true, "frame": true, "base": true, "area": true}, - doNotIndent: {"pre": true}, - allowUnquoted: true - } : {autoSelfClosers: {}, doNotIndent: {}, allowUnquoted: false}; - var alignCDATA = parserConfig.alignCDATA; - - // Return variables for tokenizers - var tagName, type; - - function inText(stream, state) { - function chain(parser) { - state.tokenize = parser; - return parser(stream, state); - } - - var ch = stream.next(); - if (ch == "<") { - if (stream.eat("!")) { - if (stream.eat("[")) { - if (stream.match("CDATA[")) return chain(inBlock("atom", "]]>")); - else return null; - } - else if (stream.match("--")) return chain(inBlock("comment", "-->")); - else if (stream.match("DOCTYPE", true, true)) { - stream.eatWhile(/[\w\._\-]/); - return chain(doctype(1)); - } - else return null; - } - else if (stream.eat("?")) { - stream.eatWhile(/[\w\._\-]/); - state.tokenize = inBlock("meta", "?>"); - return "meta"; - } - else { - type = stream.eat("/") ? "closeTag" : "openTag"; - stream.eatSpace(); - tagName = ""; - var c; - while ((c = stream.eat(/[^\s\u00a0=<>\"\'\/?]/))) tagName += c; - state.tokenize = inTag; - return "tag"; - } - } - else if (ch == "&") { - var ok; - if (stream.eat("#")) { - if (stream.eat("x")) { - ok = stream.eatWhile(/[a-fA-F\d]/) && stream.eat(";"); - } else { - ok = stream.eatWhile(/[\d]/) && stream.eat(";"); - } - } else { - ok = stream.eatWhile(/[\w]/) && stream.eat(";"); - } - return ok ? "atom" : "error"; - } - else { - stream.eatWhile(/[^&<]/); - return null; - } - } - - function inTag(stream, state) { - var ch = stream.next(); - if (ch == ">" || (ch == "/" && stream.eat(">"))) { - state.tokenize = inText; - type = ch == ">" ? "endTag" : "selfcloseTag"; - return "tag"; - } - else if (ch == "=") { - type = "equals"; - return null; - } - else if (/[\'\"]/.test(ch)) { - state.tokenize = inAttribute(ch); - return state.tokenize(stream, state); - } - else { - stream.eatWhile(/[^\s\u00a0=<>\"\'\/?]/); - return "word"; - } - } - - function inAttribute(quote) { - return function(stream, state) { - while (!stream.eol()) { - if (stream.next() == quote) { - state.tokenize = inTag; - break; - } - } - return "string"; - }; - } - - function inBlock(style, terminator) { - return function(stream, state) { - while (!stream.eol()) { - if (stream.match(terminator)) { - state.tokenize = inText; - break; - } - stream.next(); - } - return style; - }; - } - function doctype(depth) { - return function(stream, state) { - var ch; - while ((ch = stream.next()) != null) { - if (ch == "<") { - state.tokenize = doctype(depth + 1); - return state.tokenize(stream, state); - } else if (ch == ">") { - if (depth == 1) { - state.tokenize = inText; - break; - } else { - state.tokenize = doctype(depth - 1); - return state.tokenize(stream, state); - } - } - } - return "meta"; - }; - } - - var curState, setStyle; - function pass() { - for (var i = arguments.length - 1; i >= 0; i--) curState.cc.push(arguments[i]); - } - function cont() { - pass.apply(null, arguments); - return true; - } - - function pushContext(tagName, startOfLine) { - var noIndent = Kludges.doNotIndent.hasOwnProperty(tagName) || (curState.context && curState.context.noIndent); - curState.context = { - prev: curState.context, - tagName: tagName, - indent: curState.indented, - startOfLine: startOfLine, - noIndent: noIndent - }; - } - function popContext() { - if (curState.context) curState.context = curState.context.prev; - } - - function element(type) { - if (type == "openTag") { - curState.tagName = tagName; - return cont(attributes, endtag(curState.startOfLine)); - } else if (type == "closeTag") { - var err = false; - if (curState.context) { - err = curState.context.tagName != tagName; - } else { - err = true; - } - if (err) setStyle = "error"; - return cont(endclosetag(err)); - } - return cont(); - } - function endtag(startOfLine) { - return function(type) { - if (type == "selfcloseTag" || - (type == "endTag" && Kludges.autoSelfClosers.hasOwnProperty(curState.tagName.toLowerCase()))) - return cont(); - if (type == "endTag") {pushContext(curState.tagName, startOfLine); return cont();} - return cont(); - }; - } - function endclosetag(err) { - return function(type) { - if (err) setStyle = "error"; - if (type == "endTag") { popContext(); return cont(); } - setStyle = "error"; - return cont(arguments.callee); - } - } - - function attributes(type) { - if (type == "word") {setStyle = "attribute"; return cont(attributes);} - if (type == "equals") return cont(attvalue, attributes); - if (type == "string") {setStyle = "error"; return cont(attributes);} - return pass(); - } - function attvalue(type) { - if (type == "word" && Kludges.allowUnquoted) {setStyle = "string"; return cont();} - if (type == "string") return cont(attvaluemaybe); - return pass(); - } - function attvaluemaybe(type) { - if (type == "string") return cont(attvaluemaybe); - else return pass(); - } - - return { - startState: function() { - return {tokenize: inText, cc: [], indented: 0, startOfLine: true, tagName: null, context: null}; - }, - - token: function(stream, state) { - if (stream.sol()) { - state.startOfLine = true; - state.indented = stream.indentation(); - } - if (stream.eatSpace()) return null; - - setStyle = type = tagName = null; - var style = state.tokenize(stream, state); - state.type = type; - if ((style || type) && style != "comment") { - curState = state; - while (true) { - var comb = state.cc.pop() || element; - if (comb(type || style)) break; - } - } - state.startOfLine = false; - return setStyle || style; - }, - - indent: function(state, textAfter, fullLine) { - var context = state.context; - if ((state.tokenize != inTag && state.tokenize != inText) || - context && context.noIndent) - return fullLine ? fullLine.match(/^(\s*)/)[0].length : 0; - if (alignCDATA && / - - - CodeMirror: Pure XML mode - - - - - - - -

CodeMirror: XML mode

-
- - -

This is my XML parser, based on the original:

-
    -
  • No html mode - this is pure xml
  • -
  • Illegal attributes and element names are errors
  • -
  • Attributes must have a value
  • -
  • XML declaration supported (e.g.: <?xml version="1.0" encoding="utf-8" standalone="no" ?>)
  • -
  • CDATA and comment blocks are not indented (except for their start-tag)
  • -
  • Better handling of errors per line with the state object - provides good infrastructure for extending it
  • -
- -

What's missing:

-
    -
  • Make sure only a single root element exists at the document level
  • -
  • Multi-line attributes should NOT indent
  • -
  • Start tags are not painted red when they have no matching end tags (is this really wrong?)
  • -
- -

MIME types defined: application/xml, text/xml.

- -

@author: Dror BG (deebug.dev[at]gmail.com)
-

@date: August, 2011
-

@github: https://github.com/deebugger/CodeMirror2

- -

MIME types defined: application/xml, text/xml.

- - diff --git a/doc/design/js/mode/xmlpure/xmlpure.js b/doc/design/js/mode/xmlpure/xmlpure.js deleted file mode 100644 index 18d710cf3..000000000 --- a/doc/design/js/mode/xmlpure/xmlpure.js +++ /dev/null @@ -1,490 +0,0 @@ -/** - * xmlpure.js - * - * Building upon and improving the CodeMirror 2 XML parser - * @author: Dror BG (deebug.dev@gmail.com) - * @date: August, 2011 - */ - -CodeMirror.defineMode("xmlpure", function(config, parserConfig) { - // constants - var STYLE_ERROR = "error"; - var STYLE_INSTRUCTION = "comment"; - var STYLE_COMMENT = "comment"; - var STYLE_ELEMENT_NAME = "tag"; - var STYLE_ATTRIBUTE = "attribute"; - var STYLE_WORD = "string"; - var STYLE_TEXT = "atom"; - var STYLE_ENTITIES = "string"; - - var TAG_INSTRUCTION = "!instruction"; - var TAG_CDATA = "!cdata"; - var TAG_COMMENT = "!comment"; - var TAG_TEXT = "!text"; - - var doNotIndent = { - "!cdata": true, - "!comment": true, - "!text": true, - "!instruction": true - }; - - // options - var indentUnit = config.indentUnit; - - /////////////////////////////////////////////////////////////////////////// - // helper functions - - // chain a parser to another parser - function chain(stream, state, parser) { - state.tokenize = parser; - return parser(stream, state); - } - - // parse a block (comment, CDATA or text) - function inBlock(style, terminator, nextTokenize) { - return function(stream, state) { - while (!stream.eol()) { - if (stream.match(terminator)) { - popContext(state); - state.tokenize = nextTokenize; - break; - } - stream.next(); - } - return style; - }; - } - - // go down a level in the document - // (hint: look at who calls this function to know what the contexts are) - function pushContext(state, tagName) { - var noIndent = doNotIndent.hasOwnProperty(tagName) || (state.context && state.context.doIndent); - var newContext = { - tagName: tagName, - prev: state.context, - indent: state.context ? state.context.indent + indentUnit : 0, - lineNumber: state.lineNumber, - indented: state.indented, - noIndent: noIndent - }; - state.context = newContext; - } - - // go up a level in the document - function popContext(state) { - if (state.context) { - var oldContext = state.context; - state.context = oldContext.prev; - return oldContext; - } - - // we shouldn't be here - it means we didn't have a context to pop - return null; - } - - // return true if the current token is seperated from the tokens before it - // which means either this is the start of the line, or there is at least - // one space or tab character behind the token - // otherwise returns false - function isTokenSeparated(stream) { - return stream.sol() || - stream.string.charAt(stream.start - 1) == " " || - stream.string.charAt(stream.start - 1) == "\t"; - } - - /////////////////////////////////////////////////////////////////////////// - // context: document - // - // an XML document can contain: - // - a single declaration (if defined, it must be the very first line) - // - exactly one root element - // @todo try to actually limit the number of root elements to 1 - // - zero or more comments - function parseDocument(stream, state) { - if(stream.eat("<")) { - if(stream.eat("?")) { - // processing instruction - pushContext(state, TAG_INSTRUCTION); - state.tokenize = parseProcessingInstructionStartTag; - return STYLE_INSTRUCTION; - } else if(stream.match("!--")) { - // new context: comment - pushContext(state, TAG_COMMENT); - return chain(stream, state, inBlock(STYLE_COMMENT, "-->", parseDocument)); - } else if(stream.eatSpace() || stream.eol() ) { - stream.skipToEnd(); - return STYLE_ERROR; - } else { - // element - state.tokenize = parseElementTagName; - return STYLE_ELEMENT_NAME; - } - } - - // error on line - stream.skipToEnd(); - return STYLE_ERROR; - } - - /////////////////////////////////////////////////////////////////////////// - // context: XML element start-tag or end-tag - // - // - element start-tag can contain attributes - // - element start-tag may self-close (or start an element block if it doesn't) - // - element end-tag can contain only the tag name - function parseElementTagName(stream, state) { - // get the name of the tag - var startPos = stream.pos; - if(stream.match(/^[a-zA-Z_:][-a-zA-Z0-9_:.]*/)) { - // element start-tag - var tagName = stream.string.substring(startPos, stream.pos); - pushContext(state, tagName); - state.tokenize = parseElement; - return STYLE_ELEMENT_NAME; - } else if(stream.match(/^\/[a-zA-Z_:][-a-zA-Z0-9_:.]*( )*>/)) { - // element end-tag - var endTagName = stream.string.substring(startPos + 1, stream.pos - 1).trim(); - var oldContext = popContext(state); - state.tokenize = state.context == null ? parseDocument : parseElementBlock; - if(oldContext == null || endTagName != oldContext.tagName) { - // the start and end tag names should match - error - return STYLE_ERROR; - } - return STYLE_ELEMENT_NAME; - } else { - // no tag name - error - state.tokenize = state.context == null ? parseDocument : parseElementBlock; - stream.eatWhile(/[^>]/); - stream.eat(">"); - return STYLE_ERROR; - } - - stream.skipToEnd(); - return null; - } - - function parseElement(stream, state) { - if(stream.match(/^\/>/)) { - // self-closing tag - popContext(state); - state.tokenize = state.context == null ? parseDocument : parseElementBlock; - return STYLE_ELEMENT_NAME; - } else if(stream.eat(/^>/)) { - state.tokenize = parseElementBlock; - return STYLE_ELEMENT_NAME; - } else if(isTokenSeparated(stream) && stream.match(/^[a-zA-Z_:][-a-zA-Z0-9_:.]*( )*=/)) { - // attribute - state.tokenize = parseAttribute; - return STYLE_ATTRIBUTE; - } - - // no other options - this is an error - state.tokenize = state.context == null ? parseDocument : parseDocument; - stream.eatWhile(/[^>]/); - stream.eat(">"); - return STYLE_ERROR; - } - - /////////////////////////////////////////////////////////////////////////// - // context: attribute - // - // attribute values may contain everything, except: - // - the ending quote (with ' or ") - this marks the end of the value - // - the character "<" - should never appear - // - ampersand ("&") - unless it starts a reference: a string that ends with a semi-colon (";") - // ---> note: this parser is lax in what may be put into a reference string, - // ---> consult http://www.w3.org/TR/REC-xml/#NT-Reference if you want to make it tighter - function parseAttribute(stream, state) { - var quote = stream.next(); - if(quote != "\"" && quote != "'") { - // attribute must be quoted - stream.skipToEnd(); - state.tokenize = parseElement; - return STYLE_ERROR; - } - - state.tokParams.quote = quote; - state.tokenize = parseAttributeValue; - return STYLE_WORD; - } - - // @todo: find out whether this attribute value spans multiple lines, - // and if so, push a context for it in order not to indent it - // (or something of the sort..) - function parseAttributeValue(stream, state) { - var ch = ""; - while(!stream.eol()) { - ch = stream.next(); - if(ch == state.tokParams.quote) { - // end quote found - state.tokenize = parseElement; - return STYLE_WORD; - } else if(ch == "<") { - // can't have less-than signs in an attribute value, ever - stream.skipToEnd() - state.tokenize = parseElement; - return STYLE_ERROR; - } else if(ch == "&") { - // reference - look for a semi-colon, or return error if none found - ch = stream.next(); - - // make sure that semi-colon isn't right after the ampersand - if(ch == ';') { - stream.skipToEnd() - state.tokenize = parseElement; - return STYLE_ERROR; - } - - // make sure no less-than characters slipped in - while(!stream.eol() && ch != ";") { - if(ch == "<") { - // can't have less-than signs in an attribute value, ever - stream.skipToEnd() - state.tokenize = parseElement; - return STYLE_ERROR; - } - ch = stream.next(); - } - if(stream.eol() && ch != ";") { - // no ampersand found - error - stream.skipToEnd(); - state.tokenize = parseElement; - return STYLE_ERROR; - } - } - } - - // attribute value continues to next line - return STYLE_WORD; - } - - /////////////////////////////////////////////////////////////////////////// - // context: element block - // - // a block can contain: - // - elements - // - text - // - CDATA sections - // - comments - function parseElementBlock(stream, state) { - if(stream.eat("<")) { - if(stream.match("?")) { - pushContext(state, TAG_INSTRUCTION); - state.tokenize = parseProcessingInstructionStartTag; - return STYLE_INSTRUCTION; - } else if(stream.match("!--")) { - // new context: comment - pushContext(state, TAG_COMMENT); - return chain(stream, state, inBlock(STYLE_COMMENT, "-->", - state.context == null ? parseDocument : parseElementBlock)); - } else if(stream.match("![CDATA[")) { - // new context: CDATA section - pushContext(state, TAG_CDATA); - return chain(stream, state, inBlock(STYLE_TEXT, "]]>", - state.context == null ? parseDocument : parseElementBlock)); - } else if(stream.eatSpace() || stream.eol() ) { - stream.skipToEnd(); - return STYLE_ERROR; - } else { - // element - state.tokenize = parseElementTagName; - return STYLE_ELEMENT_NAME; - } - } else if(stream.eat("&")) { - stream.eatWhile(/[^;]/); - stream.eat(";"); - return STYLE_ENTITIES; - } else { - // new context: text - pushContext(state, TAG_TEXT); - state.tokenize = parseText; - return null; - } - - state.tokenize = state.context == null ? parseDocument : parseElementBlock; - stream.skipToEnd(); - return null; - } - - function parseText(stream, state) { - stream.eatWhile(/[^<]/); - if(!stream.eol()) { - // we cannot possibly be in the document context, - // just inside an element block - popContext(state); - state.tokenize = parseElementBlock; - } - return STYLE_TEXT; - } - - /////////////////////////////////////////////////////////////////////////// - // context: XML processing instructions - // - // XML processing instructions (PIs) allow documents to contain instructions for applications. - // PI format: - // - 'name' can be anything other than 'xml' (case-insensitive) - // - 'data' can be anything which doesn't contain '?>' - // XML declaration is a special PI (see XML declaration context below) - function parseProcessingInstructionStartTag(stream, state) { - if(stream.match("xml", true, true)) { - // xml declaration - if(state.lineNumber > 1 || stream.pos > 5) { - state.tokenize = parseDocument; - stream.skipToEnd(); - return STYLE_ERROR; - } else { - state.tokenize = parseDeclarationVersion; - return STYLE_INSTRUCTION; - } - } - - // regular processing instruction - if(isTokenSeparated(stream) || stream.match("?>")) { - // we have a space after the start-tag, or nothing but the end-tag - // either way - error! - state.tokenize = parseDocument; - stream.skipToEnd(); - return STYLE_ERROR; - } - - state.tokenize = parseProcessingInstructionBody; - return STYLE_INSTRUCTION; - } - - function parseProcessingInstructionBody(stream, state) { - stream.eatWhile(/[^?]/); - if(stream.eat("?")) { - if(stream.eat(">")) { - popContext(state); - state.tokenize = state.context == null ? parseDocument : parseElementBlock; - } - } - return STYLE_INSTRUCTION; - } - - - /////////////////////////////////////////////////////////////////////////// - // context: XML declaration - // - // XML declaration is of the following format: - // - // - must start at the first character of the first line - // - may span multiple lines - // - must include 'version' - // - may include 'encoding' and 'standalone' (in that order after 'version') - // - attribute names must be lowercase - // - cannot contain anything else on the line - function parseDeclarationVersion(stream, state) { - state.tokenize = parseDeclarationEncoding; - - if(isTokenSeparated(stream) && stream.match(/^version( )*=( )*"([a-zA-Z0-9_.:]|\-)+"/)) { - return STYLE_INSTRUCTION; - } - stream.skipToEnd(); - return STYLE_ERROR; - } - - function parseDeclarationEncoding(stream, state) { - state.tokenize = parseDeclarationStandalone; - - if(isTokenSeparated(stream) && stream.match(/^encoding( )*=( )*"[A-Za-z]([A-Za-z0-9._]|\-)*"/)) { - return STYLE_INSTRUCTION; - } - return null; - } - - function parseDeclarationStandalone(stream, state) { - state.tokenize = parseDeclarationEndTag; - - if(isTokenSeparated(stream) && stream.match(/^standalone( )*=( )*"(yes|no)"/)) { - return STYLE_INSTRUCTION; - } - return null; - } - - function parseDeclarationEndTag(stream, state) { - state.tokenize = parseDocument; - - if(stream.match("?>") && stream.eol()) { - popContext(state); - return STYLE_INSTRUCTION; - } - stream.skipToEnd(); - return STYLE_ERROR; - } - - /////////////////////////////////////////////////////////////////////////// - // returned object - return { - electricChars: "/[", - - startState: function() { - return { - tokenize: parseDocument, - tokParams: {}, - lineNumber: 0, - lineError: false, - context: null, - indented: 0 - }; - }, - - token: function(stream, state) { - if(stream.sol()) { - // initialize a new line - state.lineNumber++; - state.lineError = false; - state.indented = stream.indentation(); - } - - // eat all (the spaces) you can - if(stream.eatSpace()) return null; - - // run the current tokenize function, according to the state - var style = state.tokenize(stream, state); - - // is there an error somewhere in the line? - state.lineError = (state.lineError || style == "error"); - - return style; - }, - - blankLine: function(state) { - // blank lines are lines too! - state.lineNumber++; - state.lineError = false; - }, - - indent: function(state, textAfter) { - if(state.context) { - if(state.context.noIndent == true) { - // do not indent - no return value at all - return; - } - if(textAfter.match(/^<\/.*/)) { - // end-tag - indent back to last context - return state.context.indent; - } - if(textAfter.match(/^ - - - CodeMirror: YAML mode - - - - - - - -

CodeMirror: YAML mode

-
- - -

MIME types defined: text/x-yaml.

- - - diff --git a/doc/design/js/mode/yaml/yaml.js b/doc/design/js/mode/yaml/yaml.js deleted file mode 100644 index 59e2641a0..000000000 --- a/doc/design/js/mode/yaml/yaml.js +++ /dev/null @@ -1,95 +0,0 @@ -CodeMirror.defineMode("yaml", function() { - - var cons = ['true', 'false', 'on', 'off', 'yes', 'no']; - var keywordRegex = new RegExp("\\b(("+cons.join(")|(")+"))$", 'i'); - - return { - token: function(stream, state) { - var ch = stream.peek(); - var esc = state.escaped; - state.escaped = false; - /* comments */ - if (ch == "#") { stream.skipToEnd(); return "comment"; } - if (state.literal && stream.indentation() > state.keyCol) { - stream.skipToEnd(); return "string"; - } else if (state.literal) { state.literal = false; } - if (stream.sol()) { - state.keyCol = 0; - state.pair = false; - state.pairStart = false; - /* document start */ - if(stream.match(/---/)) { return "def"; } - /* document end */ - if (stream.match(/\.\.\./)) { return "def"; } - /* array list item */ - if (stream.match(/\s*-\s+/)) { return 'meta'; } - } - /* pairs (associative arrays) -> key */ - if (!state.pair && stream.match(/^\s*([a-z0-9\._-])+(?=\s*:)/i)) { - state.pair = true; - state.keyCol = stream.indentation(); - return "atom"; - } - if (state.pair && stream.match(/^:\s*/)) { state.pairStart = true; return 'meta'; } - - /* inline pairs/lists */ - if (stream.match(/^(\{|\}|\[|\])/)) { - if (ch == '{') - state.inlinePairs++; - else if (ch == '}') - state.inlinePairs--; - else if (ch == '[') - state.inlineList++; - else - state.inlineList--; - return 'meta'; - } - - /* list seperator */ - if (state.inlineList > 0 && !esc && ch == ',') { - stream.next(); - return 'meta'; - } - /* pairs seperator */ - if (state.inlinePairs > 0 && !esc && ch == ',') { - state.keyCol = 0; - state.pair = false; - state.pairStart = false; - stream.next(); - return 'meta'; - } - - /* start of value of a pair */ - if (state.pairStart) { - /* block literals */ - if (stream.match(/^\s*(\||\>)\s*/)) { state.literal = true; return 'meta'; }; - /* references */ - if (stream.match(/^\s*(\&|\*)[a-z0-9\._-]+\b/i)) { return 'variable-2'; } - /* numbers */ - if (state.inlinePairs == 0 && stream.match(/^\s*-?[0-9\.\,]+\s?$/)) { return 'number'; } - if (state.inlinePairs > 0 && stream.match(/^\s*-?[0-9\.\,]+\s?(?=(,|}))/)) { return 'number'; } - /* keywords */ - if (stream.match(keywordRegex)) { return 'keyword'; } - } - - /* nothing found, continue */ - state.pairStart = false; - state.escaped = (ch == '\\'); - stream.next(); - return null; - }, - startState: function() { - return { - pair: false, - pairStart: false, - keyCol: 0, - inlinePairs: 0, - inlineList: 0, - literal: false, - escaped: false - }; - } - }; -}); - -CodeMirror.defineMIME("text/x-yaml", "yaml"); diff --git a/doc/design/js/monitoring-products.js b/doc/design/js/monitoring-products.js deleted file mode 100644 index 92a7eacf1..000000000 --- a/doc/design/js/monitoring-products.js +++ /dev/null @@ -1,20 +0,0 @@ -$(function(){ - - // Datepicker - $('.datepicker').datepicker({ - showOtherMonths: true, - selectOtherMonths: true, - inline: true - }); - -}); - -$(document).ready(function() { - $("#myTable").tablesorter({ - headers: { - 3: { - sorter: false - } - } - }); -}); \ No newline at end of file diff --git a/doc/design/js/monitoring.js b/doc/design/js/monitoring.js deleted file mode 100644 index 4d23576cc..000000000 --- a/doc/design/js/monitoring.js +++ /dev/null @@ -1,25 +0,0 @@ -$(function(){ - - // Datepicker - $('.datepicker').datepicker({ - showOtherMonths: true, - selectOtherMonths: true, - inline: true - }); - -}); - -$(document).ready(function() { - /*$("#myTable").tablesorter({ - headers: { - 6: { - sorter: false - } - } - });*/ - - $("img.delete-row").click(function() { - var row = this.id.split("delete-")[1]; - $("#"+row).fadeOut("slow"); - }); -}); \ No newline at end of file diff --git a/doc/design/js/myprojects.js b/doc/design/js/myprojects.js deleted file mode 100644 index 96e4284d9..000000000 --- a/doc/design/js/myprojects.js +++ /dev/null @@ -1,16 +0,0 @@ -$(document).ready(function() { - /*$("#myTable").tablesorter({ - headers: { - 1: { - sorter: false - }, - 3: { - sorter: false - } - } - }); */ -}); - -function deleteRow(num) { - $("#Row"+num).fadeOut("slow"); -} \ No newline at end of file diff --git a/doc/design/js/platform-product-main.js b/doc/design/js/platform-product-main.js deleted file mode 100644 index 760cbe54a..000000000 --- a/doc/design/js/platform-product-main.js +++ /dev/null @@ -1,11 +0,0 @@ -$(document).ready(function() { - $("#myTable").tablesorter({ - headers: { - 2: { - sorter: false - } - } - }); - - -}); diff --git a/doc/design/js/platform-product.js b/doc/design/js/platform-product.js deleted file mode 100644 index 18804782f..000000000 --- a/doc/design/js/platform-product.js +++ /dev/null @@ -1,17 +0,0 @@ -$(document).ready(function() { - /*$("#myTable").tablesorter({ - headers: { - 1: { - sorter: false - } - } - }); - */ - - $("img.delete-row").click(function(){ - var row = this.id.split("delete-")[1]; - $("#"+row).fadeOut("slow"); - }); - - -}); diff --git a/doc/design/js/platform-repos.js b/doc/design/js/platform-repos.js deleted file mode 100644 index 15e713895..000000000 --- a/doc/design/js/platform-repos.js +++ /dev/null @@ -1,17 +0,0 @@ -$(document).ready(function() { - /*$("#myTable").tablesorter({ - headers: { - 2: { - sorter: false - } - } - }); - */ - - $("img.delete-row").click(function(){ - var row = this.id.split("delete-")[1]; - $("#"+row).fadeOut("slow"); - }); - - -}); diff --git a/doc/design/js/project-page.js b/doc/design/js/project-page.js deleted file mode 100644 index e55f19a38..000000000 --- a/doc/design/js/project-page.js +++ /dev/null @@ -1,20 +0,0 @@ -/*$(document).ready(function() { -$("#myTable").tablesorter({ - headers: { - 2: { - sorter: false - } - } - -}); -}); -*/ -$(document).ready(function() { - $("a.files-see").click(function() { - $("#file1").fadeOut(0); - $("#file2").fadeIn("slow"); - $("#file-name1").fadeOut(0); - $("#file-name2").fadeIn("slow"); - $("#fork-and-edit").fadeIn("slow"); - }); -}); diff --git a/doc/design/js/radio.js b/doc/design/js/radio.js deleted file mode 100644 index c79a8613a..000000000 --- a/doc/design/js/radio.js +++ /dev/null @@ -1,120 +0,0 @@ -jQuery(document).ready(function(){ - -jQuery(".niceRadio").each( - -function() { - - changeRadioStart(jQuery(this)); - -}); - - -}); - - -function changeRadio(el) - -{ - - var el = el, - input = el.find("input").eq(0); - var nm=input.attr("name"); - - jQuery(".niceRadio input").each( - - function() { - - if(jQuery(this).attr("name")==nm) - { - jQuery(this).parent().removeClass("radioChecked"); - } - - - }); - - - if(el.attr("class").indexOf("niceRadioDisabled")==-1) - { - el.addClass("radioChecked"); - input.attr("checked", true); - } - - return true; -} - -function changeVisualRadio(input) -{ - - var wrapInput = input.parent(); - var nm=input.attr("name"); - - jQuery(".niceRadio input").each( - - function() { - - if(jQuery(this).attr("name")==nm) - { - jQuery(this).parent().removeClass("radioChecked"); - } - - - }); - - if(input.attr("checked")) - { - wrapInput.addClass("radioChecked"); - } -} - -function changeRadioStart(el) - -{ - -try -{ -var el = el, - radioName = el.attr("name"), - radioId = el.attr("id"), - radioChecked = el.attr("checked"), - radioDisabled = el.attr("disabled"), - radioTab = el.attr("tabindex"), - radioValue = el.attr("value"); - if(radioChecked) - el.after(""+ - ""); - else - el.after(""+ - ""); - - - if(radioDisabled) - { - el.next().addClass("niceRadioDisabled"); - el.next().find("input").eq(0).attr("disabled","disabled"); - } - - el.next().bind("mousedown", function(e) { - changeRadio(jQuery(this)); - $(this).find("input:radio").change(); - }); - - if(jQuery.browser.msie) el.next().find("input").eq(0).bind("click", function(e) { changeVisualRadio(jQuery(this)) }); - else el.next().find("input").eq(0).bind("change", function(e) { changeVisualRadio(jQuery(this)) }); - el.remove(); -} -catch(e) -{ - -} - - return true; -} diff --git a/doc/design/js/registration.js b/doc/design/js/registration.js deleted file mode 100644 index 368c74867..000000000 --- a/doc/design/js/registration.js +++ /dev/null @@ -1,72 +0,0 @@ -function logIn() { - $("#hintLogin").fadeIn("slow"); - document.getElementById("login").className="registartion-input-error"; - $("#hintName").fadeIn("slow"); - document.getElementById("name").className="registartion-input-error"; - $("#hintEmail").fadeIn("slow"); - document.getElementById("email").className="registartion-input-error"; - $("#hintPassword").fadeIn("slow"); - document.getElementById("pass").className="registartion-input-error"; - document.getElementById("pass2").className="registartion-input-error"; -} - -function disError(elem) { - $("#hintLogin").fadeOut("fast"); - $("#hintName").fadeOut("fast"); - $("#hintEmail").fadeOut("fast"); - $("#hintPassword").fadeOut("fast"); - if (document.getElementById("login").className=="registartion-input-error") { - if (this.id=="login") { - document.getElementById("login").className="registartion-input-focus"; - } else { - document.getElementById("login").className="registartion-input-no-focus"; - } - } - if (document.getElementById("name").className=="registartion-input-error") { - if (this.id=="name") { - document.getElementById("name").className="registartion-input-focus"; - } else { - document.getElementById("name").className="registartion-input-no-focus"; - } - } - if (document.getElementById("email").className=="registartion-input-error") { - if (this.id=="email") { - document.getElementById("email").className="registartion-input-focus"; - } else { - document.getElementById("email").className="registartion-input-no-focus"; - } - } - if (document.getElementById("pass").className=="registartion-input-error") { - if (this.id=="pass") { - document.getElementById("pass").className="registartion-input-focus"; - } else { - document.getElementById("pass").className="registartion-input-no-focus"; - } - } - if (document.getElementById("pass2").className=="registartion-input-error") { - if (this.id=="pass2") { - document.getElementById("pass2").className="registartion-input-focus"; - } else { - document.getElementById("pass2").className="registartion-input-no-focus"; - } - } - buttonCheck(); -} - -/*function disError(elem) { - buttonCheck(); - }*/ - -function buttonCheck() { - if ((document.getElementById("login").value!="")&&(document.getElementById("name").value!="")&&(document.getElementById("pass").value!="")&&(document.getElementById("pass2").value!="")&&(document.getElementById("email").value!="")) { - document.getElementById("btnLogin").className = "button"; - } else { - document.getElementById("btnLogin").className = "button disabled"; - } -} - -$(document).ready(function() { - $("#btnLogin").click(function() { - logIn(); - }); -}); \ No newline at end of file diff --git a/doc/design/js/switcher.js b/doc/design/js/switcher.js deleted file mode 100644 index 4522e7687..000000000 --- a/doc/design/js/switcher.js +++ /dev/null @@ -1,54 +0,0 @@ -function switchThis() { - var doc = document.getElementById("switcher"); - if (doc.className == "switcher") { - doc.className = "switcher-off"; - $("#open-comment").fadeOut(0); - $("#closed-comment").fadeIn("slow"); - } else { - doc.className = "switcher"; - $("#closed-comment").fadeOut(0); - $("#open-comment").fadeIn("slow"); - } -} - -function preload() { - if (document.images) { - var imgsrc = preload.arguments; - arr=new Array(imgsrc.length); - - for (var j=0; j