diff options
417 files changed, 4413 insertions, 1923 deletions
diff --git a/.hound.yml b/.hound.yml new file mode 100644 index 00000000000..3bde29fb2bf --- /dev/null +++ b/.hound.yml @@ -0,0 +1,4 @@ +# Prefer single quotes +StringLiterals: + EnforcedStyle: single_quotes + Enabled: true diff --git a/CHANGELOG b/CHANGELOG index a5962fdfdc7..25868e0a4bf 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,12 @@ +v 7.2.0 + - Explore page + - Add project stars (Ciro Santilli) + - Log Sidekiq arguments + - Fix cpu usage issue in Firefox + - Better labels: colors, ability to rename and remove + - Improve the way merge request collects diffs + - Improve compare page for large diffs + v 7.1.0 - Remove observers - Improve MR discussions @@ -7,6 +16,24 @@ v 7.1.0 - Add @all mention for comments - Dont show reply button if user is not signed in - Expose more information for issues with webhook + - Add a mention of the merge request into the default merge request commit message + - Improve code highlight, introduce support for more languages like Go, Clojure, Erlang etc + - Fix concurrency issue in repository download + - Dont allow repository name start with ? + - Improve email threading (Pierre de La Morinerie) + - Cleaner help page + - Group milestones + - Improved email notifications + - Contributors API (sponsored by Mobbr) + - Fix LDAP TLS authentication (Boris HUISGEN) + - Show VERSION information on project sidebar + - Improve branch removal logic when accept MR + - Fix bug where comment form is spawned inside the Reply button + - Remove Dir.chdir from Satellite#lock for thread-safety + - Increased default git max_size value from 5MB to 20MB in gitlab.yml. Please update your configs! + - Show error message in case of timeout in satellite when create MR + - Show first 100 files for huge diff instead of hiding all + - Change default admin email from admin@local.host to admin@example.com v 7.0.0 - The CPU no longer overheats when you hold down the spacebar diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b3065ac8880..f02ba2216d2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -42,7 +42,7 @@ Please send a merge request with a tested solution or a merge request with a fai 1. **Observed behavior** 1. **Relevant logs and/or screenshots:** Please use code blocks (\`\`\`) to format console output, logs, and code as it's very hard to read otherwise. 1. **Output of checks** - * Results of GitLab [Application Check](doc/install/installation.md#check-application-status) (`sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production`); we will only investigate if the tests are passing + * Results of GitLab [Application Check](doc/install/installation.md#check-application-status) (`sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true`); we will only investigate if the tests are passing * Version of GitLab you are running; we will only investigate issues in the latest stable and development releases as per the [maintenance policy](MAINTENANCE.md) * Add the last commit sha1 of the GitLab version you used to replicate the issue (obtainable from the help page) * Describe your setup (use relevant parts from `sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`) @@ -65,17 +65,17 @@ If you can, please submit a merge request with the fix or improvements including 1. If you have multiple commits please combine them into one commit by [squashing them](http://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) 1. Push the commit to your fork 1. Submit a merge request (MR) to the master branch -1. The MR title should describes the change you want to make +1. The MR title should describe the change you want to make 1. The MR description should give a motive for your change and the method you used to achieve it 1. If the MR changes the UI it should include before and after screenshots 1. If the MR changes CSS classes please include the list of affected pages `grep css-class ./app -R` 1. Link relevant [issues](https://gitlab.com/gitlab-org/gitlab-ce/issues) and/or [feature requests](http://feedback.gitlab.com/) from the merge request description and leave a comment on them with a link back to the MR -1. Be prepared to answer questions and incorporate feedback even if requests for this arrive weeks or months after your MR submittion +1. Be prepared to answer questions and incorporate feedback even if requests for this arrive weeks or months after your MR submission 1. If your MR touches code that executes shell commands, make sure it adheres to the [shell command guidelines]( doc/development/shell_commands.md). The **official merge window** is in the beginning of the month from the 1st to the 7th day of the month. The best time to submit a MR and get feedback fast. Before this time the GitLab B.V. team is still dealing with work that is created by the monthly release such as assisting subscribers with upgrade issues, the release of Enterprise Edition and the upgrade of GitLab Cloud. After the 7th it is already getting closer to the release date of the next version. This means there is less time to fix the issues created by merging large new features. -Please keep the change in a single MR **as small as possible**. If you want to contribute a large feature think very hard what the minimum viable change is. Can you split functionality? Can you only submit the backend/API code? Can you start with a very simple UI? The smaller a MR is the more likely it is it will be merged, after that you can send more MR's to enhance it. +Please keep the change in a single MR **as small as possible**. If you want to contribute a large feature think very hard what the minimum viable change is. Can you split functionality? Can you only submit the backend/API code? Can you start with a very simple UI? Can you do part of the refactor? The increased reviewability of small MR's that leads to higher code quality is more important to us than having a mimimal commit log. The smaller a MR is the more likely it is it will be merged (quickly), after that you can send more MR's to enhance it. For examples of feedback on merge requests please look at already [closed merge requests](https://gitlab.com/gitlab-org/gitlab-ce/merge_requests?assignee_id=&label_name=&milestone_id=&scope=&sort=&state=closed). If you would like quick feedback on your merge request feel free to mention one of the Merge Marshalls of [the core-team](https://about.gitlab.com/core-team/). Please ensure that your merge request meets the following contribution acceptance criteria. @@ -97,7 +97,8 @@ For examples of feedback on merge requests please look at already [closed merge 1. Keeps the GitLab code base clean and well structured 1. Contains functionality we think other users will benefit from too 1. Doesn't add configuration options since they complicate future changes -1. Contains a single commit (please use `git rebase -i` to squash commits) +1. Initially contains a single commit (please use `git rebase -i` to squash commits) +1. Changes after submitting the merge request should be in separate commits (no squashing). You will be asked to squash when the review is over, before merging. 1. It conforms to the following style guides ## Style guides @@ -10,8 +10,6 @@ end gem "rails", "~> 4.1.0" -gem "protected_attributes" - # Make links from text gem 'rails_autolink', '~> 1.1' @@ -23,8 +21,8 @@ gem "mysql2", group: :mysql gem "pg", group: :postgres # Auth -gem "devise", '3.0.4' -gem "devise-async", '0.8.0' +gem "devise", '3.2.4' +gem "devise-async", '0.9.0' gem 'omniauth', "~> 1.1.3" gem 'omniauth-google-oauth2' gem 'omniauth-twitter' @@ -48,7 +46,6 @@ gem "gitlab-linguist", "~> 3.0.0", require: "linguist" # API gem "grape", "~> 0.6.1" -# Replace with rubygems when nesteted entities get released gem "grape-entity", "~> 0.4.2" gem 'rack-cors', require: 'rack/cors' @@ -82,16 +79,20 @@ gem "six" gem "seed-fu" # Markdown to HTML -gem "redcarpet", "~> 2.2.2" gem "github-markup" -gem "org-ruby" # For rendering .org files + +# Required markup gems by github-markdown +gem 'redcarpet', '~> 2.2.2' +gem 'RedCloth' +gem 'rdoc', '~>3.6' +gem 'org-ruby', '= 0.9.1' +gem 'creole', '~>0.3.6' +gem 'wikicloth', '=0.8.1' +gem 'asciidoctor', '= 0.1.4' # Diffs gem 'diffy', '~> 3.0.3' -# Asciidoc to HTML -gem "asciidoctor" - # Application server group :unicorn do gem "unicorn", '~> 4.6.3' @@ -176,6 +177,7 @@ gem "font-awesome-rails", '~> 3.2' gem "gitlab_emoji", "~> 0.0.1.1" gem "gon", '~> 5.0.0' gem 'nprogress-rails' +gem 'request_store' group :development do gem "annotate", "~> 2.6.0.beta2" diff --git a/Gemfile.lock b/Gemfile.lock index 382633c2246..c77d20debd9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,7 @@ GEM remote: https://rubygems.org/ specs: + RedCloth (4.2.9) ace-rails-ap (2.0.1) actionmailer (4.1.1) actionpack (= 4.1.1) @@ -40,7 +41,7 @@ GEM axiom-types (0.0.5) descendants_tracker (~> 0.0.1) ice_nine (~> 0.9) - bcrypt-ruby (3.1.2) + bcrypt (3.1.7) better_errors (1.0.1) coderay (>= 1.0.0) erubis (>= 2.6.6) @@ -86,6 +87,7 @@ GEM thor crack (0.4.1) safe_yaml (~> 0.9.0) + creole (0.3.8) d3_rails (3.1.10) railties (>= 3.1.0) daemons (1.1.9) @@ -94,13 +96,14 @@ GEM default_value_for (3.0.0) activerecord (>= 3.2.0, < 5.0) descendants_tracker (0.0.3) - devise (3.0.4) - bcrypt-ruby (~> 3.0) + devise (3.2.4) + bcrypt (~> 3.0) orm_adapter (~> 0.1) railties (>= 3.2.6, < 5) + thread_safe (~> 0.1) warden (~> 1.2.3) - devise-async (0.8.0) - devise (>= 2.2, < 3.2) + devise-async (0.9.0) + devise (~> 3.2) diff-lcs (1.2.5) diffy (3.0.3) docile (1.1.1) @@ -120,6 +123,7 @@ GEM eventmachine (1.0.3) excon (0.32.1) execjs (2.0.2) + expression_parser (0.9.0) factory_girl (4.3.0) activesupport (>= 3.0.0) factory_girl_rails (4.3.0) @@ -164,7 +168,7 @@ GEM multi_json gitlab-grack (2.0.0.pre) rack (~> 1.5.1) - gitlab-grit (2.6.9) + gitlab-grit (2.6.10) charlock_holmes (~> 0.6) diff-lcs (~> 1.1) mime-types (~> 1.15) @@ -175,7 +179,7 @@ GEM mime-types (~> 1.19) gitlab_emoji (0.0.1.1) emoji (~> 1.0.1) - gitlab_git (6.0.0) + gitlab_git (6.1.0) activesupport (~> 4.0) charlock_holmes (~> 0.6) gitlab-grit (~> 2.6) @@ -240,7 +244,7 @@ GEM json (~> 1.8) multi_xml (>= 0.5.2) httpauth (0.2.0) - i18n (0.6.9) + i18n (0.6.11) ice_nine (0.10.0) jasmine (2.0.2) jasmine-core (~> 2.0.0) @@ -282,7 +286,7 @@ GEM method_source (0.8.2) mime-types (1.25.1) mini_portile (0.6.0) - minitest (5.3.4) + minitest (5.3.5) multi_json (1.10.1) multi_xml (0.5.5) multipart-post (1.2.0) @@ -319,7 +323,7 @@ GEM omniauth-twitter (1.0.1) multi_json (~> 1.3) omniauth-oauth (~> 1.0) - org-ruby (0.9.6) + org-ruby (0.9.1) rubypants (>= 0.2.0) orm_adapter (0.5.0) pg (0.15.1) @@ -331,8 +335,6 @@ GEM websocket-driver (>= 0.2.0) polyglot (0.3.4) posix-spawn (0.3.8) - protected_attributes (1.0.5) - activemodel (>= 4.0.1, < 5.0) pry (0.9.12.4) coderay (~> 1.0) method_source (~> 0.8) @@ -410,9 +412,11 @@ GEM redis-store (1.1.4) redis (>= 2.2) ref (1.0.5) + request_store (1.0.5) require_all (1.3.2) rest-client (1.6.7) mime-types (>= 1.16) + rinku (1.7.3) rouge (1.3.3) rspec (2.14.1) rspec-core (~> 2.14.0) @@ -563,6 +567,10 @@ GEM addressable (>= 2.2.7) crack (>= 0.3.2) websocket-driver (0.3.3) + wikicloth (0.8.1) + builder + expression_parser + rinku xpath (2.0.0) nokogiri (~> 1.3) @@ -570,10 +578,11 @@ PLATFORMS ruby DEPENDENCIES + RedCloth ace-rails-ap acts-as-taggable-on annotate (~> 2.6.0.beta2) - asciidoctor + asciidoctor (= 0.1.4) awesome_print better_errors binding_of_caller @@ -583,11 +592,12 @@ DEPENDENCIES coffee-rails colored coveralls + creole (~> 0.3.6) d3_rails (~> 3.1.4) database_cleaner default_value_for (~> 3.0.0) - devise (= 3.0.4) - devise-async (= 0.8.0) + devise (= 3.2.4) + devise-async (= 0.9.0) diffy (~> 3.0.3) dropzonejs-rails email_spec @@ -632,10 +642,9 @@ DEPENDENCIES omniauth-github omniauth-google-oauth2 omniauth-twitter - org-ruby + org-ruby (= 0.9.1) pg poltergeist (~> 1.5.1) - protected_attributes pry quiet_assets (~> 1.0.1) rack-attack @@ -647,8 +656,10 @@ DEPENDENCIES raphael-rails (~> 2.1.2) rb-fsevent rb-inotify + rdoc (~> 3.6) redcarpet (~> 2.2.2) redis-rails + request_store rspec-rails sanitize (~> 2.0) sass-rails (~> 4.0.2) @@ -682,3 +693,4 @@ DEPENDENCIES unicorn-worker-killer version_sorter webmock + wikicloth (= 0.8.1) diff --git a/README.md b/README.md index 07c5c61e939..bcee4e064fa 100644 --- a/README.md +++ b/README.md @@ -127,3 +127,12 @@ All documentation can be found on [doc.gitlab.com/ce/](http://doc.gitlab.com/ce/ ## Getting help Please see [Getting help for GitLab](https://www.gitlab.com/getting-help/) on our website for the many options to get help. + +## Is it any good? + +[Yes](https://news.ycombinator.com/item?id=3067434) + +## Is it awesome? + +Thanks for [asking this question](https://twitter.com/supersloth/status/489462789384056832) Joshua. +[These people](https://twitter.com/gitlabhq/favorites) seem to like it. @@ -1 +1 @@ -7.1.0.pre +7.2.0.pre diff --git a/app/assets/images/brand_logo.png b/app/assets/images/brand_logo.png Binary files differnew file mode 100644 index 00000000000..09b1689ca45 --- /dev/null +++ b/app/assets/images/brand_logo.png diff --git a/app/assets/javascripts/application.js.coffee b/app/assets/javascripts/application.js.coffee index 5b124554c38..a28f76ddd15 100644 --- a/app/assets/javascripts/application.js.coffee +++ b/app/assets/javascripts/application.js.coffee @@ -23,7 +23,7 @@ #= require g.raphael-min #= require g.bar-min #= require branch-graph -#= require highlightjs.min +#= require highlight.pack #= require ace/ace #= require d3 #= require underscore diff --git a/app/assets/javascripts/extensions/array.js b/app/assets/javascripts/extensions/array.js index 7fccc9c9d5f..24f9e00097c 100644 --- a/app/assets/javascripts/extensions/array.js +++ b/app/assets/javascripts/extensions/array.js @@ -4,4 +4,4 @@ Array.prototype.first = function() { Array.prototype.last = function() { return this[this.length-1]; -}
\ No newline at end of file +} diff --git a/app/assets/javascripts/groups.js.coffee b/app/assets/javascripts/groups.js.coffee index 7850eb14e74..49d6605980b 100644 --- a/app/assets/javascripts/groups.js.coffee +++ b/app/assets/javascripts/groups.js.coffee @@ -14,4 +14,4 @@ $ -> $('.js-group-avatar-input').bind "change", -> form = $(this).closest("form") filename = $(this).val().replace(/^.*[\\\/]/, '') - form.find(".js-avatar-filename").text(filename)
\ No newline at end of file + form.find(".js-avatar-filename").text(filename) diff --git a/app/assets/javascripts/markdown_area.js.coffee b/app/assets/javascripts/markdown_area.js.coffee index e71fd1fbf3b..bee2785562d 100644 --- a/app/assets/javascripts/markdown_area.js.coffee +++ b/app/assets/javascripts/markdown_area.js.coffee @@ -20,6 +20,9 @@ $(document).ready -> $(".div-dropzone-hover").append iconPicture $(".div-dropzone").append divSpinner $(".div-dropzone-spinner").append iconSpinner + $(".div-dropzone-spinner").css + "opacity": 0 + "display": "none" dropzone = $(".div-dropzone").dropzone( url: project_image_path_upload @@ -66,13 +69,17 @@ $(document).ready -> return sending: -> - $(".div-dropzone-spinner").css "opacity", 0.7 + $(".div-dropzone-spinner").css + "opacity": 0.7 + "display": "inherit" return complete: -> $(".dz-preview").remove() $(".markdown-area").trigger "input" - $(".div-dropzone-spinner").css "opacity", 0 + $(".div-dropzone-spinner").css + "opacity": 0 + "display": "none" return ) @@ -163,10 +170,14 @@ $(document).ready -> val + url + "\n" showSpinner = (e) -> - $(".div-dropzone-spinner").css "opacity", 0.7 + $(".div-dropzone-spinner").css + "opacity": 0.7 + "display": "inherit" closeSpinner = -> - $(".div-dropzone-spinner").css "opacity", 0 + $(".div-dropzone-spinner").css + "opacity": 0 + "display": "none" showError = (message) -> checkIfMsgExists = $(".error-alert").children().length @@ -179,7 +190,7 @@ $(document).ready -> $(".markdown-selector").click (e) -> e.preventDefault() - $(".div-dropzone").click() + $(@).closest(".div-dropzone-wrapper").find(".div-dropzone").click() return - return
\ No newline at end of file + return diff --git a/app/assets/javascripts/notes.js.coffee b/app/assets/javascripts/notes.js.coffee index 91a4ccaba43..607b109dc0b 100644 --- a/app/assets/javascripts/notes.js.coffee +++ b/app/assets/javascripts/notes.js.coffee @@ -376,7 +376,7 @@ class Notes ### replyToDiscussionNote: (e) => form = $(".js-new-note-form") - replyLink = $(e.target) + replyLink = $(e.target).closest(".js-discussion-reply-button") replyLink.hide() # insert the form after the button diff --git a/app/assets/javascripts/profile.js.coffee b/app/assets/javascripts/profile.js.coffee index b37a78ac197..0e99921f899 100644 --- a/app/assets/javascripts/profile.js.coffee +++ b/app/assets/javascripts/profile.js.coffee @@ -27,4 +27,4 @@ $ -> filename = $(this).val().replace(/^.*[\\\/]/, '') form.find(".js-avatar-filename").text(filename) - $('.profile-groups-avatars').tooltip("placement": "top")
\ No newline at end of file + $('.profile-groups-avatars').tooltip("placement": "top") diff --git a/app/assets/javascripts/project.js.coffee b/app/assets/javascripts/project.js.coffee index 4262418fd5e..f7c64b4b816 100644 --- a/app/assets/javascripts/project.js.coffee +++ b/app/assets/javascripts/project.js.coffee @@ -46,3 +46,8 @@ $ -> $.cookie('hide_no_ssh_message', 'false', { path: path }) $(@).parents('.no-ssh-key-message').hide() e.preventDefault() + + $('.project-side .star').on 'ajax:success', (e, data, status, xhr) -> + $(@).toggleClass('on').find('.count').html(data.star_count) + .on 'ajax:error', (e, xhr, status, error) -> + new Flash('Star toggle failed. Try again later.', 'alert') diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index b596af38311..0d404f15055 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -59,4 +59,4 @@ /** * Styles for responsive sidebar */ -@import "semantic-ui/modules/sidebar" +@import "semantic-ui/modules/sidebar"; diff --git a/app/assets/stylesheets/behaviors.scss b/app/assets/stylesheets/behaviors.scss index 23f206ce3dc..be4c4d07f1c 100644 --- a/app/assets/stylesheets/behaviors.scss +++ b/app/assets/stylesheets/behaviors.scss @@ -4,3 +4,9 @@ .js-details-container .content.hide { display: block; } .js-details-container.open .content { display: block; } .js-details-container.open .content.hide { display: none; } + +// Toggle between two states. +.js-toggler-container .turn-on { display: block; } +.js-toggler-container .turn-off { display: none; } +.js-toggler-container.on .turn-on { display: none; } +.js-toggler-container.on .turn-off { display: block; } diff --git a/app/assets/stylesheets/generic/buttons.scss b/app/assets/stylesheets/generic/buttons.scss index 36fc771a9dc..d098f1ecaa2 100644 --- a/app/assets/stylesheets/generic/buttons.scss +++ b/app/assets/stylesheets/generic/buttons.scss @@ -6,7 +6,7 @@ vertical-align: middle; cursor: pointer; background-image: none; - border: 1px solid transparent; + border: $btn-border; white-space: nowrap; padding: 6px 12px; font-size: 13px; @@ -19,7 +19,6 @@ user-select: none; color: #444444; background-color: #fff; - border-color: #ccc; text-shadow: none; &.hover, @@ -152,16 +151,16 @@ } &.btn-close { - color: #B94A48; - font-weight: bold; + color: $bg_danger; + border-color: $border_danger; &:hover { color: #B94A48; } } &.btn-reopen { - color: #468847; - font-weight: bold; + color: $bg_success; + border-color: $border_success; &:hover { color: #468847; } diff --git a/app/assets/stylesheets/generic/common.scss b/app/assets/stylesheets/generic/common.scss index b9942b5cb5d..991561cd503 100644 --- a/app/assets/stylesheets/generic/common.scss +++ b/app/assets/stylesheets/generic/common.scss @@ -337,3 +337,7 @@ table { .wiki .highlight, .note-body .highlight { margin-bottom: 9px; } + +.footer-links a { + margin-right: 15px; +} diff --git a/app/assets/stylesheets/main/variables.scss b/app/assets/stylesheets/main/variables.scss index c49f7db788e..02ce2c8338f 100644 --- a/app/assets/stylesheets/main/variables.scss +++ b/app/assets/stylesheets/main/variables.scss @@ -10,6 +10,8 @@ $hover: #D9EDF7; $link_color: #446e9b; $link_hover_color: #2FA0BB; +$btn-border: 1px solid #ccc; + /* * Success colors (green) */ diff --git a/app/assets/stylesheets/sections/commits.scss b/app/assets/stylesheets/sections/commits.scss index f00d024f389..684e8377a7b 100644 --- a/app/assets/stylesheets/sections/commits.scss +++ b/app/assets/stylesheets/sections/commits.scss @@ -112,7 +112,9 @@ .commit-stat-summary { color: #666; - line-height: 2; + font-size: 14px; + font-weight: normal; + padding: 10px 0; } .commit-info-row { @@ -177,10 +179,18 @@ li.commit { .commit-row-description { font-size: 14px; - border-left: 1px solid #e5e5e5; - padding: 0 15px 0 7px; + border-left: 1px solid #EEE; + padding: 10px 15px; margin: 5px 0 10px 5px; + background: #f9f9f9; display: none; + + pre { + border: none; + background: inherit; + padding: 0; + margin: 0; + } } .commit-row-info { diff --git a/app/assets/stylesheets/sections/diff.scss b/app/assets/stylesheets/sections/diff.scss index f4926e2f523..88b188dbe8d 100644 --- a/app/assets/stylesheets/sections/diff.scss +++ b/app/assets/stylesheets/sections/diff.scss @@ -40,12 +40,12 @@ font-size: 12px; .old { span.idiff { - background-color: #FAA; + background-color: #F99; } } .new { span.idiff { - background-color: #AFA; + background-color: #8F8; } } diff --git a/app/assets/stylesheets/sections/explore.scss b/app/assets/stylesheets/sections/explore.scss new file mode 100644 index 00000000000..9b92128624c --- /dev/null +++ b/app/assets/stylesheets/sections/explore.scss @@ -0,0 +1,8 @@ +.explore-title { + text-align: center; + + h3 { + font-weight: normal; + font-size: 30px; + } +} diff --git a/app/assets/stylesheets/sections/groups.scss b/app/assets/stylesheets/sections/groups.scss index 60ec79acadb..e49fe1a9dd6 100644 --- a/app/assets/stylesheets/sections/groups.scss +++ b/app/assets/stylesheets/sections/groups.scss @@ -7,3 +7,7 @@ .member-search-form { float: left; } + +.milestone-row { + @include str-truncated(90%); +} diff --git a/app/assets/stylesheets/sections/header.scss b/app/assets/stylesheets/sections/header.scss index 29cb0f4b87c..e0e0d60c387 100644 --- a/app/assets/stylesheets/sections/header.scss +++ b/app/assets/stylesheets/sections/header.scss @@ -53,13 +53,9 @@ header { font-size: 18px; .app_logo { margin-left: -15px; } + .title { - display: inline-block; - overflow: hidden; - text-overflow: ellipsis; - vertical-align: top; - white-space: nowrap; - max-width: 70%; + @include str-truncated(70%); } .navbar-collapse { @@ -130,6 +126,7 @@ header { margin: 0; margin-left: 5px; @include header-font; + @include str-truncated(37%); } .profile-pic { @@ -254,7 +251,7 @@ header { .search .search-input { width: 300px; &:focus { - width: 400px; + width: 330px; } } @@ -262,7 +259,7 @@ header { .search .search-input { width: 200px; &:focus { - width: 300px; + width: 230px; } } } diff --git a/app/assets/stylesheets/sections/issues.scss b/app/assets/stylesheets/sections/issues.scss index 495a7cb3113..a7fa715d2e0 100644 --- a/app/assets/stylesheets/sections/issues.scss +++ b/app/assets/stylesheets/sections/issues.scss @@ -63,26 +63,10 @@ @media (min-width: 800px) { .issues_bulk_update .select2-container { min-width: 120px; } } @media (min-width: 1200px) { .issues_bulk_update .select2-container { min-width: 160px; } } -.issues-holder { - .issues_filters { - } - - .issues_bulk_update { - margin: 0; - form { - float:left; - } - - .update_selected_issues { - margin-left: 4px; - } - - .select2-container .select2-choice { - height: 32px; - line-height: 28px; - color: #444 !important; - font-weight: 500; - } +.issues_bulk_update { + .select2-container .select2-choice { + color: #444 !important; + font-weight: 500; } } @@ -110,7 +94,7 @@ } } -.issue-show-labels .label { +.issue-show-labels .color-label { padding: 6px 10px; } diff --git a/app/assets/stylesheets/sections/labels.scss b/app/assets/stylesheets/sections/labels.scss new file mode 100644 index 00000000000..d1590e42fcb --- /dev/null +++ b/app/assets/stylesheets/sections/labels.scss @@ -0,0 +1,21 @@ +.suggest-colors { + margin-top: 5px; + a { + @include border-radius(4px); + width: 30px; + height: 30px; + display: inline-block; + margin-right: 10px; + } +} + +.manage-labels-list { + .label { + padding: 9px; + font-size: 14px; + } +} + +.color-label { + padding: 3px 4px; +} diff --git a/app/assets/stylesheets/sections/login.scss b/app/assets/stylesheets/sections/login.scss index a78a9cd4879..54887b7c401 100644 --- a/app/assets/stylesheets/sections/login.scss +++ b/app/assets/stylesheets/sections/login.scss @@ -6,11 +6,13 @@ } .login-box{ - max-width: 304px; - position: relative; - @include border-radius(5px); - margin: auto; - background: white; + } + + .brand-image { + img { + max-width: 100%; + margin-bottom: 20px; + } } .login-logo{ @@ -19,7 +21,7 @@ } .form-control { - background-color: #f1f1f1; + background-color: #F5F5F5; font-size: 16px; padding: 14px 10px; width: 100%; @@ -41,6 +43,10 @@ margin-bottom:0px; @include border-radius(0); } + + &:active, &:focus { + background-color: #FFF; + } } .login-box a.forgot { diff --git a/app/assets/stylesheets/sections/merge_requests.scss b/app/assets/stylesheets/sections/merge_requests.scss index 12044db6702..3db6da2a9f9 100644 --- a/app/assets/stylesheets/sections/merge_requests.scss +++ b/app/assets/stylesheets/sections/merge_requests.scss @@ -1,6 +1,6 @@ -/** - * MR -> show: Automerge widget + /** + * MR -> show: Automerge widget * */ .automerge_widget { @@ -48,10 +48,10 @@ .label-branch { @include border-radius(4px); - padding: 2px 4px; + padding: 3px 4px; border: none; - background: #555; - color: #fff; + background: $hover; + color: #333; font-family: $monospace_font; font-weight: normal; overflow: hidden; diff --git a/app/assets/stylesheets/sections/projects.scss b/app/assets/stylesheets/sections/projects.scss index 34dd3448f53..6757cbd30f6 100644 --- a/app/assets/stylesheets/sections/projects.scss +++ b/app/assets/stylesheets/sections/projects.scss @@ -172,8 +172,8 @@ ul.nav.nav-projects-tabs { } .public-clone { - background: #333; - color: #f5f5f5; + background: #EEE; + color: #777; padding: 6px 10px; margin: 1px; font-weight: normal; @@ -190,28 +190,39 @@ ul.nav.nav-projects-tabs { .project-side { .btn-block { background-image: none; - .btn, - &.btn, - &.btn-group ul.dropdown-menu { + + .btn, &.btn { + text-align: left; + padding: 10px 15px; background-color: #F1f1f1; border-color: #EEE; + &:hover { background-color: #eee; border-color: #DDD; } } - &.btn-group-justified { - .btn { - width: 100%; - } - .dropdown-toggle { - width: 26px; - } + + .count { + float: right; + font-weight: 500; + text-shadow: 0 1px #FFF; } - ul { + + &.btn-group-justified { + .btn { + width: 100%; + } + .dropdown-toggle { + width: 30px; + padding: 10px; + } + ul { width: 100%; + } } } + .project-fork-icon { float: left; font-size: 26px; diff --git a/app/assets/stylesheets/sections/tree.scss b/app/assets/stylesheets/sections/tree.scss index b08f94f55a0..678a6cd716d 100644 --- a/app/assets/stylesheets/sections/tree.scss +++ b/app/assets/stylesheets/sections/tree.scss @@ -28,6 +28,7 @@ } td { border-color: #F1F1F1 !important; + border-bottom: 1px solid; } &:hover { td { diff --git a/app/controllers/admin/broadcast_messages_controller.rb b/app/controllers/admin/broadcast_messages_controller.rb index 9a70ef9d199..e1643bb34bf 100644 --- a/app/controllers/admin/broadcast_messages_controller.rb +++ b/app/controllers/admin/broadcast_messages_controller.rb @@ -6,7 +6,7 @@ class Admin::BroadcastMessagesController < Admin::ApplicationController end def create - @broadcast_message = BroadcastMessage.new(params[:broadcast_message]) + @broadcast_message = BroadcastMessage.new(broadcast_message_params) if @broadcast_message.save redirect_to admin_broadcast_messages_path, notice: 'Broadcast Message was successfully created.' @@ -29,4 +29,11 @@ class Admin::BroadcastMessagesController < Admin::ApplicationController def broadcast_messages @broadcast_messages ||= BroadcastMessage.order("starts_at DESC").page(params[:page]) end + + def broadcast_message_params + params.require(:broadcast_message).permit( + :alert_type, :color, :ends_at, :font, + :message, :starts_at + ) + end end diff --git a/app/controllers/admin/groups_controller.rb b/app/controllers/admin/groups_controller.rb index 1a523d081dd..0388997ec69 100644 --- a/app/controllers/admin/groups_controller.rb +++ b/app/controllers/admin/groups_controller.rb @@ -20,7 +20,7 @@ class Admin::GroupsController < Admin::ApplicationController end def create - @group = Group.new(params[:group]) + @group = Group.new(group_params) @group.path = @group.name.dup.parameterize if @group.name if @group.save @@ -32,7 +32,7 @@ class Admin::GroupsController < Admin::ApplicationController end def update - if @group.update_attributes(params[:group]) + if @group.update_attributes(group_params) redirect_to [:admin, @group], notice: 'Group was successfully updated.' else render "edit" @@ -56,4 +56,8 @@ class Admin::GroupsController < Admin::ApplicationController def group @group = Group.find_by(path: params[:id]) end + + def group_params + params.require(:group).permit(:name, :description, :path, :avatar) + end end diff --git a/app/controllers/admin/hooks_controller.rb b/app/controllers/admin/hooks_controller.rb index c5bf76f8c39..0a463239d74 100644 --- a/app/controllers/admin/hooks_controller.rb +++ b/app/controllers/admin/hooks_controller.rb @@ -5,7 +5,7 @@ class Admin::HooksController < Admin::ApplicationController end def create - @hook = SystemHook.new(params[:hook]) + @hook = SystemHook.new(hook_params) if @hook.save redirect_to admin_hooks_path, notice: 'Hook was successfully created.' @@ -37,4 +37,8 @@ class Admin::HooksController < Admin::ApplicationController redirect_to :back end + + def hook_params + params.require(:hook).permit(:url) + end end diff --git a/app/controllers/admin/users_controller.rb b/app/controllers/admin/users_controller.rb index f0040bf5e87..f63df27eebd 100644 --- a/app/controllers/admin/users_controller.rb +++ b/app/controllers/admin/users_controller.rb @@ -13,7 +13,7 @@ class Admin::UsersController < Admin::ApplicationController end def new - @user = User.build_user + @user = User.new end def edit @@ -37,17 +37,15 @@ class Admin::UsersController < Admin::ApplicationController end def create - admin = params[:user].delete("admin") - opts = { force_random_password: true, - password_expires_at: Time.now + password_expires_at: nil } - @user = User.build_user(params[:user].merge(opts), as: :admin) - @user.admin = (admin && admin.to_i > 0) + @user = User.new(user_params.merge(opts)) @user.created_by_id = current_user.id @user.generate_password + @user.generate_reset_token @user.skip_confirmation! respond_to do |format| @@ -62,19 +60,17 @@ class Admin::UsersController < Admin::ApplicationController end def update - admin = params[:user].delete("admin") - - if params[:user][:password].blank? - params[:user].delete(:password) - params[:user].delete(:password_confirmation) - end + user_params_with_pass = user_params.dup - if admin.present? - user.admin = !admin.to_i.zero? + if params[:user][:password].present? + user_params_with_pass.merge!( + password: params[:user][:password], + password_confirmation: params[:user][:password_confirmation], + ) end respond_to do |format| - if user.update_attributes(params[:user], as: :admin) + if user.update_attributes(user_params_with_pass) user.confirm! format.html { redirect_to [:admin, user], notice: 'User was successfully updated.' } format.json { head :ok } @@ -115,4 +111,13 @@ class Admin::UsersController < Admin::ApplicationController def user @user ||= User.find_by!(username: params[:id]) end + + def user_params + params.require(:user).permit( + :email, :remember_me, :bio, :name, :username, + :skype, :linkedin, :twitter, :website_url, :color_scheme_id, :theme_id, :force_random_password, + :extern_uid, :provider, :password_expires_at, :avatar, :hide_no_ssh_key, + :projects_limit, :can_create_group, :admin + ) + end end diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index d58890fa33b..d0546a441e1 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,6 +1,7 @@ require 'gon' class ApplicationController < ActionController::Base + before_filter :authenticate_user_from_token! before_filter :authenticate_user! before_filter :reject_blocked! before_filter :check_password_expiration @@ -28,6 +29,25 @@ class ApplicationController < ActionController::Base protected + # From https://github.com/plataformatec/devise/wiki/How-To:-Simple-Token-Authentication-Example + # https://gist.github.com/josevalim/fb706b1e933ef01e4fb6 + def authenticate_user_from_token! + user_token = if params[:authenticity_token].presence + params[:authenticity_token].presence + elsif params[:private_token].presence + params[:private_token].presence + end + user = user_token && User.find_by_authentication_token(user_token.to_s) + + if user + # Notice we are passing store false, so the user is not + # actually stored in the session and a token is needed + # for every request. If you want the token to work as a + # sign in token, you can simply remove store: false. + sign_in user, store: false + end + end + def log_exception(exception) application_trace = ActionDispatch::ExceptionWrapper.new(env, exception).application_trace application_trace.map!{ |t| " #{t}\n" } @@ -48,7 +68,7 @@ class ApplicationController < ActionController::Base flash[:alert] = "Your account is blocked. Retry when an admin has unblocked it." new_user_session_path else - @return_to || root_path + stored_location_for(:redirect) || stored_location_for(resource) || root_path end end @@ -226,8 +246,7 @@ class ApplicationController < ActionController::Base end def configure_permitted_parameters - devise_parameter_sanitizer.for(:sign_in) { |u| u.permit(:username, :email, :password, :login, :remember_me) } - devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(:username, :email, :name, :password, :password_confirmation) } + devise_parameter_sanitizer.sanitize(:sign_in) { |u| u.permit(:username, :email, :password, :login, :remember_me) } end def hexdigest(string) diff --git a/app/controllers/dashboard_controller.rb b/app/controllers/dashboard_controller.rb index 233b91680f6..5aff526d1b5 100644 --- a/app/controllers/dashboard_controller.rb +++ b/app/controllers/dashboard_controller.rb @@ -46,11 +46,11 @@ class DashboardController < ApplicationController @projects = @projects.where(namespace_id: Group.find_by(name: params[:group])) if params[:group].present? @projects = @projects.where(visibility_level: params[:visibility_level]) if params[:visibility_level].present? @projects = @projects.includes(:namespace) - @projects = @projects.tagged_with(params[:label]) if params[:label].present? + @projects = @projects.tagged_with(params[:tag]) if params[:tag].present? @projects = @projects.sort(@sort = params[:sort]) @projects = @projects.page(params[:page]).per(30) - @labels = current_user.authorized_projects.tags_on(:labels) + @tags = current_user.authorized_projects.tags_on(:tags) @groups = current_user.authorized_groups end diff --git a/app/controllers/explore/groups_controller.rb b/app/controllers/explore/groups_controller.rb new file mode 100644 index 00000000000..f8e1a31e0b3 --- /dev/null +++ b/app/controllers/explore/groups_controller.rb @@ -0,0 +1,14 @@ +class Explore::GroupsController < ApplicationController + skip_before_filter :authenticate_user!, + :reject_blocked, :set_current_user_for_observers, + :add_abilities + + layout "explore" + + def index + @groups = GroupsFinder.new.execute(current_user) + @groups = @groups.search(params[:search]) if params[:search].present? + @groups = @groups.sort(@sort = params[:sort]) + @groups = @groups.page(params[:page]).per(20) + end +end diff --git a/app/controllers/explore/projects_controller.rb b/app/controllers/explore/projects_controller.rb new file mode 100644 index 00000000000..b6fa8b7e387 --- /dev/null +++ b/app/controllers/explore/projects_controller.rb @@ -0,0 +1,25 @@ +class Explore::ProjectsController < ApplicationController + skip_before_filter :authenticate_user!, + :reject_blocked, + :add_abilities + + layout 'explore' + + def index + @projects = ProjectsFinder.new.execute(current_user) + @projects = @projects.search(params[:search]) if params[:search].present? + @projects = @projects.sort(@sort = params[:sort]) + @projects = @projects.includes(:namespace).page(params[:page]).per(20) + end + + def trending + @trending_projects = TrendingProjectsFinder.new.execute(current_user) + @trending_projects = @trending_projects.page(params[:page]).per(10) + end + + def starred + @starred_projects = ProjectsFinder.new.execute(current_user) + @starred_projects = @starred_projects.order('star_count DESC') + @starred_projects = @starred_projects.page(params[:page]).per(10) + end +end diff --git a/app/controllers/groups/milestones_controller.rb b/app/controllers/groups/milestones_controller.rb new file mode 100644 index 00000000000..860d8e03922 --- /dev/null +++ b/app/controllers/groups/milestones_controller.rb @@ -0,0 +1,56 @@ +class Groups::MilestonesController < ApplicationController + layout 'group' + + before_filter :authorize_group_milestone!, only: :update + + def index + project_milestones = case params[:status] + when 'all'; status + when 'closed'; status('closed') + else status('active') + end + @group_milestones = Milestones::GroupService.new(project_milestones).execute + @group_milestones = Kaminari.paginate_array(@group_milestones).page(params[:page]).per(30) + end + + def show + project_milestones = Milestone.where(project_id: group.projects).order("due_date ASC") + @group_milestone = Milestones::GroupService.new(project_milestones).milestone(title) + end + + def update + project_milestones = Milestone.where(project_id: group.projects).order("due_date ASC") + @group_milestones = Milestones::GroupService.new(project_milestones).milestone(title) + + @group_milestones.milestones.each do |milestone| + Milestones::UpdateService.new(milestone.project, current_user, params[:milestone]).execute(milestone) + end + + respond_to do |format| + format.js + format.html do + redirect_to group_milestones_path(group) + end + end + end + + private + + def group + @group ||= Group.find_by(path: params[:group_id]) + end + + def title + params[:title] + end + + def status(state = nil) + conditions = { project_id: group.projects } + conditions.reverse_merge!(state: state) if state + Milestone.where(conditions).order("title ASC") + end + + def authorize_group_milestone! + return render_404 unless can?(current_user, :manage_group, group) + end +end diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rb index a2629c51384..ddde90d3ee0 100644 --- a/app/controllers/groups_controller.rb +++ b/app/controllers/groups_controller.rb @@ -22,7 +22,7 @@ class GroupsController < ApplicationController end def create - @group = Group.new(params[:group]) + @group = Group.new(group_params) @group.path = @group.name.dup.parameterize if @group.name if @group.save @@ -84,7 +84,7 @@ class GroupsController < ApplicationController end def update - if @group.update_attributes(params[:group]) + if @group.update_attributes(group_params) redirect_to edit_group_path(@group), notice: 'Group was successfully updated.' else render action: "edit" @@ -159,4 +159,8 @@ class GroupsController < ApplicationController params[:state] = 'opened' if params[:state].blank? params[:group_id] = @group.id end + + def group_params + params.require(:group).permit(:name, :description, :path, :avatar) + end end diff --git a/app/controllers/profiles/emails_controller.rb b/app/controllers/profiles/emails_controller.rb index 40c352dab0c..f3f0e69b83a 100644 --- a/app/controllers/profiles/emails_controller.rb +++ b/app/controllers/profiles/emails_controller.rb @@ -7,7 +7,7 @@ class Profiles::EmailsController < ApplicationController end def create - @email = current_user.emails.new(params[:email]) + @email = current_user.emails.new(email_params) flash[:alert] = @email.errors.full_messages.first unless @email.save @@ -23,4 +23,10 @@ class Profiles::EmailsController < ApplicationController format.js { render nothing: true } end end + + private + + def email_params + params.require(:email).permit(:email) + end end diff --git a/app/controllers/profiles/keys_controller.rb b/app/controllers/profiles/keys_controller.rb index 6713cd7c8c7..88414b13564 100644 --- a/app/controllers/profiles/keys_controller.rb +++ b/app/controllers/profiles/keys_controller.rb @@ -15,7 +15,7 @@ class Profiles::KeysController < ApplicationController end def create - @key = current_user.keys.new(params[:key]) + @key = current_user.keys.new(key_params) if @key.save redirect_to profile_key_path(@key) @@ -53,4 +53,9 @@ class Profiles::KeysController < ApplicationController end end + private + + def key_params + params.require(:key).permit(:title, :key) + end end diff --git a/app/controllers/profiles/passwords_controller.rb b/app/controllers/profiles/passwords_controller.rb index df6954554ea..1191ce47eba 100644 --- a/app/controllers/profiles/passwords_controller.rb +++ b/app/controllers/profiles/passwords_controller.rb @@ -11,8 +11,13 @@ class Profiles::PasswordsController < ApplicationController end def create - new_password = params[:user][:password] - new_password_confirmation = params[:user][:password_confirmation] + unless @user.valid_password?(user_params[:current_password]) + redirect_to new_profile_password_path, alert: 'You must provide a valid current password' + return + end + + new_password = user_params[:password] + new_password_confirmation = user_params[:password_confirmation] result = @user.update_attributes( password: new_password, @@ -31,11 +36,11 @@ class Profiles::PasswordsController < ApplicationController end def update - password_attributes = params[:user].select do |key, value| + password_attributes = user_params.select do |key, value| %w(password password_confirmation).include?(key.to_s) end - unless @user.valid_password?(params[:user][:current_password]) + unless @user.valid_password?(user_params[:current_password]) redirect_to edit_profile_password_path, alert: 'You must provide a valid current password' return end @@ -74,4 +79,8 @@ class Profiles::PasswordsController < ApplicationController def authorize_change_password! return render_404 if @user.ldap_user? end + + def user_params + params.require(:user).permit(:current_password, :password, :password_confirmation) + end end diff --git a/app/controllers/profiles_controller.rb b/app/controllers/profiles_controller.rb index 9c9a129b26b..e877f9b9049 100644 --- a/app/controllers/profiles_controller.rb +++ b/app/controllers/profiles_controller.rb @@ -14,9 +14,9 @@ class ProfilesController < ApplicationController end def update - params[:user].delete(:email) if @user.ldap_user? + user_params.except!(:email) if @user.ldap_user? - if @user.update_attributes(params[:user]) + if @user.update_attributes(user_params) flash[:notice] = "Profile was successfully updated" else flash[:alert] = "Failed to update profile" @@ -41,7 +41,7 @@ class ProfilesController < ApplicationController end def update_username - @user.update_attributes(username: params[:user][:username]) + @user.update_attributes(username: user_params[:username]) respond_to do |format| format.js @@ -57,4 +57,12 @@ class ProfilesController < ApplicationController def authorize_change_username! return render_404 unless @user.can_change_username? end + + def user_params + params.require(:user).permit( + :email, :password, :password_confirmation, :bio, :name, :username, + :skype, :linkedin, :twitter, :website_url, :color_scheme_id, :theme_id, + :avatar, :hide_no_ssh_key, + ) + end end diff --git a/app/controllers/projects/blob_controller.rb b/app/controllers/projects/blob_controller.rb index a1a8bed09f4..db3d173b98d 100644 --- a/app/controllers/projects/blob_controller.rb +++ b/app/controllers/projects/blob_controller.rb @@ -30,8 +30,12 @@ class Projects::BlobController < Projects::ApplicationController def blob @blob ||= @repository.blob_at(@commit.id, @path) - return not_found! unless @blob - - @blob + if @blob + @blob + elsif tree.entries.any? + redirect_to project_tree_path(@project, File.join(@ref, @path)) and return + else + return not_found! + end end end diff --git a/app/controllers/projects/commit_controller.rb b/app/controllers/projects/commit_controller.rb index 860ab408299..c344297ba8a 100644 --- a/app/controllers/projects/commit_controller.rb +++ b/app/controllers/projects/commit_controller.rb @@ -20,11 +20,10 @@ class Projects::CommitController < Projects::ApplicationController end begin - @suppress_diff = true if commit.diff_suppress? && !params[:force_show_diff] - @force_suppress_diff = commit.diff_force_suppress? + @diffs = @commit.diffs rescue Grit::Git::GitTimeout - @suppress_diff = true - @status = :huge_commit + @diffs = [] + @diff_timeout = true end @note = project.build_commit_note(commit) @@ -38,12 +37,7 @@ class Projects::CommitController < Projects::ApplicationController } respond_to do |format| - format.html do - if @status == :huge_commit - render "huge_commit" and return - end - end - + format.html format.diff { render text: @commit.to_diff } format.patch { render text: @commit.to_patch } end diff --git a/app/controllers/projects/compare_controller.rb b/app/controllers/projects/compare_controller.rb index 234b6058ff0..7a671e8455d 100644 --- a/app/controllers/projects/compare_controller.rb +++ b/app/controllers/projects/compare_controller.rb @@ -8,18 +8,21 @@ class Projects::CompareController < Projects::ApplicationController end def show - compare = Gitlab::Git::Compare.new(@repository.raw_repository, params[:from], params[:to], MergeRequestDiff::COMMITS_SAFE_SIZE) + base_ref = params[:from] + head_ref = params[:to] - @commits = compare.commits - @commit = compare.commit - @diffs = compare.diffs - @refs_are_same = compare.same - @line_notes = [] - @timeout = compare.timeout + compare_result = CompareService.new.execute( + current_user, + @project, + head_ref, + @project, + base_ref + ) - diff_line_count = Commit::diff_line_count(@diffs) - @suppress_diff = Commit::diff_suppress?(@diffs, diff_line_count) && !params[:force_show_diff] - @force_suppress_diff = Commit::diff_force_suppress?(@diffs, diff_line_count) + @commits = compare_result.commits + @diffs = compare_result.diffs + @commit = @commits.last + @line_notes = [] end def create diff --git a/app/controllers/projects/deploy_keys_controller.rb b/app/controllers/projects/deploy_keys_controller.rb index 6e1a76ff417..d20937ea8ea 100644 --- a/app/controllers/projects/deploy_keys_controller.rb +++ b/app/controllers/projects/deploy_keys_controller.rb @@ -22,7 +22,7 @@ class Projects::DeployKeysController < Projects::ApplicationController end def create - @key = DeployKey.new(params[:deploy_key]) + @key = DeployKey.new(deploy_key_params) if @key.valid? && @project.deploy_keys << @key redirect_to project_deploy_keys_path(@project) @@ -58,4 +58,8 @@ class Projects::DeployKeysController < Projects::ApplicationController def available_keys @available_keys ||= current_user.accessible_deploy_keys end + + def deploy_key_params + params.require(:deploy_key).permit(:key, :title) + end end diff --git a/app/controllers/projects/edit_tree_controller.rb b/app/controllers/projects/edit_tree_controller.rb index be611892bb0..ca83b21f429 100644 --- a/app/controllers/projects/edit_tree_controller.rb +++ b/app/controllers/projects/edit_tree_controller.rb @@ -28,8 +28,6 @@ class Projects::EditTreeController < Projects::BaseTreeController def preview @content = params[:content] - #FIXME workaround https://github.com/gitlabhq/gitlabhq/issues/5936 - @content += "\n" if @blob.data.end_with?("\n") diffy = Diffy::Diff.new(@blob.data, @content, diff: '-U 3', include_diff_info: true) diff --git a/app/controllers/projects/hooks_controller.rb b/app/controllers/projects/hooks_controller.rb index c43d26385f7..c8269ed99ce 100644 --- a/app/controllers/projects/hooks_controller.rb +++ b/app/controllers/projects/hooks_controller.rb @@ -12,7 +12,7 @@ class Projects::HooksController < Projects::ApplicationController end def create - @hook = @project.hooks.new(params[:hook]) + @hook = @project.hooks.new(hook_params) @hook.save if @hook.valid? @@ -24,7 +24,12 @@ class Projects::HooksController < Projects::ApplicationController end def test - TestHookService.new.execute(hook, current_user) + if !@project.empty_repo? + TestHookService.new.execute(hook, current_user) + flash[:notice] = 'Hook successfully executed.' + else + flash[:alert] = 'Hook execution failed. Ensure the project has commits.' + end redirect_to :back end @@ -40,4 +45,8 @@ class Projects::HooksController < Projects::ApplicationController def hook @hook ||= @project.hooks.find(params[:id]) end + + def hook_params + params.require(:hook).permit(:url, :push_events, :issues_events, :merge_requests_events, :tag_push_events) + end end diff --git a/app/controllers/projects/issues_controller.rb b/app/controllers/projects/issues_controller.rb index ffe65cb41c5..bde90466ea1 100644 --- a/app/controllers/projects/issues_controller.rb +++ b/app/controllers/projects/issues_controller.rb @@ -42,7 +42,11 @@ class Projects::IssuesController < Projects::ApplicationController end def new - @issue = @project.issues.new(params[:issue]) + params[:issue] ||= ActionController::Parameters.new( + assignee_id: "" + ) + + @issue = @project.issues.new(issue_params) respond_with(@issue) end @@ -59,7 +63,7 @@ class Projects::IssuesController < Projects::ApplicationController end def create - @issue = Issues::CreateService.new(project, current_user, params[:issue]).execute + @issue = Issues::CreateService.new(project, current_user, issue_params).execute respond_to do |format| format.html do @@ -76,7 +80,7 @@ class Projects::IssuesController < Projects::ApplicationController end def update - @issue = Issues::UpdateService.new(project, current_user, params[:issue]).execute(issue) + @issue = Issues::UpdateService.new(project, current_user, issue_params).execute(issue) respond_to do |format| format.js @@ -144,4 +148,11 @@ class Projects::IssuesController < Projects::ApplicationController raise ActiveRecord::RecordNotFound.new end end + + def issue_params + params.require(:issue).permit( + :title, :assignee_id, :position, :description, + :milestone_id, :state_event, label_ids: [] + ) + end end diff --git a/app/controllers/projects/labels_controller.rb b/app/controllers/projects/labels_controller.rb index 30fcb64cbb2..d049012f6d8 100644 --- a/app/controllers/projects/labels_controller.rb +++ b/app/controllers/projects/labels_controller.rb @@ -1,12 +1,38 @@ class Projects::LabelsController < Projects::ApplicationController before_filter :module_enabled - + before_filter :label, only: [:edit, :update, :destroy] before_filter :authorize_labels! + before_filter :authorize_admin_labels!, except: [:index] respond_to :js, :html def index - @labels = @project.issues_labels + @labels = @project.labels.order_by_name.page(params[:page]).per(20) + end + + def new + @label = @project.labels.new + end + + def create + @label = @project.labels.create(label_params) + + if @label.valid? + redirect_to project_labels_path(@project) + else + render 'new' + end + end + + def edit + end + + def update + if @label.update_attributes(label_params) + redirect_to project_labels_path(@project) + else + render 'edit' + end end def generate @@ -21,6 +47,12 @@ class Projects::LabelsController < Projects::ApplicationController end end + def destroy + @label.destroy + + redirect_to project_labels_path(@project), notice: 'Label was removed' + end + protected def module_enabled @@ -28,4 +60,16 @@ class Projects::LabelsController < Projects::ApplicationController return render_404 end end + + def label_params + params.require(:label).permit(:title, :color) + end + + def label + @label = @project.labels.find(params[:id]) + end + + def authorize_admin_labels! + return render_404 unless can?(current_user, :admin_label, @project) + end end diff --git a/app/controllers/projects/merge_requests_controller.rb b/app/controllers/projects/merge_requests_controller.rb index 89f4ab01a3f..8dca0400693 100644 --- a/app/controllers/projects/merge_requests_controller.rb +++ b/app/controllers/projects/merge_requests_controller.rb @@ -34,6 +34,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController def show @note_counts = Note.where(commit_id: @merge_request.commits.map(&:id)). group(:commit_id).count + respond_to do |format| format.html format.diff { render text: @merge_request.to_diff(current_user) } @@ -43,16 +44,13 @@ class Projects::MergeRequestsController < Projects::ApplicationController def diffs @commit = @merge_request.last_commit - @comments_allowed = @reply_allowed = true - @comments_target = {noteable_type: 'MergeRequest', - noteable_id: @merge_request.id} + @comments_target = { + noteable_type: 'MergeRequest', + noteable_id: @merge_request.id + } @line_notes = @merge_request.notes.where("line_code is not null") - diff_line_count = Commit::diff_line_count(@merge_request.diffs) - @suppress_diff = Commit::diff_suppress?(@merge_request.diffs, diff_line_count) && !params[:force_show_diff] - @force_suppress_diff = Commit::diff_force_suppress?(@merge_request.diffs, diff_line_count) - respond_to do |format| format.html format.json { render json: { html: view_to_html_string("projects/merge_requests/show/_diffs") } } @@ -60,46 +58,22 @@ class Projects::MergeRequestsController < Projects::ApplicationController end def new - @merge_request = MergeRequest.new(params[:merge_request]) - @merge_request.source_project = @project unless @merge_request.source_project - @merge_request.target_project ||= (@project.forked_from_project || @project) - @target_branches = @merge_request.target_project.nil? ? [] : @merge_request.target_project.repository.branch_names - @merge_request.target_branch ||= @merge_request.target_project.default_branch - @source_project = @merge_request.source_project - - if @merge_request.target_branch && @merge_request.source_branch - compare_action = Gitlab::Satellite::CompareAction.new( - current_user, - @merge_request.target_project, - @merge_request.target_branch, - @merge_request.source_project, - @merge_request.source_branch - ) - - @compare_failed = false - @commits = compare_action.commits - - if @commits - @commits.map! { |commit| Commit.new(commit) } - @commit = @commits.first - else - # false value because failed to get commits from satellite - @commits = [] - @compare_failed = true - end + params[:merge_request] ||= ActionController::Parameters.new(source_project: @project) + @merge_request = MergeRequests::BuildService.new(project, current_user, merge_request_params).execute - @note_counts = Note.where(commit_id: @commits.map(&:id)). - group(:commit_id).count + @target_branches = if @merge_request.target_project + @merge_request.target_project.repository.branch_names + else + [] + end - @diffs = compare_action.diffs - @merge_request.title = @merge_request.source_branch.titleize.humanize - @target_project = @merge_request.target_project - @target_repo = @target_project.repository - - diff_line_count = Commit::diff_line_count(@diffs) - @suppress_diff = Commit::diff_suppress?(@diffs, diff_line_count) - @force_suppress_diff = @suppress_diff - end + @target_project = merge_request.target_project + @source_project = merge_request.source_project + @commits = @merge_request.compare_commits + @commit = @merge_request.compare_commits.last + @diffs = @merge_request.compare_diffs + @note_counts = Note.where(commit_id: @commits.map(&:id)). + group(:commit_id).count end def edit @@ -110,7 +84,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController def create @target_branches ||= [] - @merge_request = MergeRequests::CreateService.new(project, current_user, params[:merge_request]).execute + @merge_request = MergeRequests::CreateService.new(project, current_user, merge_request_params).execute if @merge_request.valid? redirect_to project_merge_request_path(@merge_request.target_project, @merge_request), notice: 'Merge request was successfully created.' @@ -122,7 +96,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController end def update - @merge_request = MergeRequests::UpdateService.new(project, current_user, params[:merge_request]).execute(@merge_request) + @merge_request = MergeRequests::UpdateService.new(project, current_user, merge_request_params).execute(@merge_request) if @merge_request.valid? respond_to do |format| @@ -263,4 +237,12 @@ class Projects::MergeRequestsController < Projects::ApplicationController can?(current_user, action, project) end + + def merge_request_params + params.require(:merge_request).permit( + :title, :assignee_id, :source_project_id, :source_branch, + :target_project_id, :target_branch, :milestone_id, + :state_event, :description, label_ids: [] + ) + end end diff --git a/app/controllers/projects/milestones_controller.rb b/app/controllers/projects/milestones_controller.rb index c38c77d6b85..d338cdedfaf 100644 --- a/app/controllers/projects/milestones_controller.rb +++ b/app/controllers/projects/milestones_controller.rb @@ -37,7 +37,7 @@ class Projects::MilestonesController < Projects::ApplicationController end def create - @milestone = Milestones::CreateService.new(project, current_user, params[:milestone]).execute + @milestone = Milestones::CreateService.new(project, current_user, milestone_params).execute if @milestone.save redirect_to project_milestone_path(@project, @milestone) @@ -47,7 +47,7 @@ class Projects::MilestonesController < Projects::ApplicationController end def update - @milestone = Milestones::UpdateService.new(project, current_user, params[:milestone]).execute(milestone) + @milestone = Milestones::UpdateService.new(project, current_user, milestone_params).execute(milestone) respond_to do |format| format.js @@ -105,4 +105,8 @@ class Projects::MilestonesController < Projects::ApplicationController def module_enabled return render_404 unless @project.issues_enabled end + + def milestone_params + params.require(:milestone).permit(:title, :description, :due_date, :state_event) + end end diff --git a/app/controllers/projects/notes_controller.rb b/app/controllers/projects/notes_controller.rb index 66cc1a3dec7..2154b6ed2eb 100644 --- a/app/controllers/projects/notes_controller.rb +++ b/app/controllers/projects/notes_controller.rb @@ -21,7 +21,7 @@ class Projects::NotesController < Projects::ApplicationController end def create - @note = Notes::CreateService.new(project, current_user, params[:note]).execute + @note = Notes::CreateService.new(project, current_user, note_params).execute respond_to do |format| format.json { render_note_json(@note) } @@ -30,7 +30,7 @@ class Projects::NotesController < Projects::ApplicationController end def update - note.update_attributes(params[:note]) + note.update_attributes(note_params) note.reset_events_cache respond_to do |format| @@ -109,4 +109,11 @@ class Projects::NotesController < Projects::ApplicationController def authorize_admin_note! return access_denied! unless can?(current_user, :admin_note, note) end + + def note_params + params.require(:note).permit( + :note, :noteable, :noteable_id, :noteable_type, :project_id, + :attachment, :line_code, :commit_id + ) + end end diff --git a/app/controllers/projects/protected_branches_controller.rb b/app/controllers/projects/protected_branches_controller.rb index e39e97af8dd..bd31b1d3c54 100644 --- a/app/controllers/projects/protected_branches_controller.rb +++ b/app/controllers/projects/protected_branches_controller.rb @@ -11,7 +11,7 @@ class Projects::ProtectedBranchesController < Projects::ApplicationController end def create - @project.protected_branches.create(params[:protected_branch]) + @project.protected_branches.create(protected_branch_params) redirect_to project_protected_branches_path(@project) end @@ -23,4 +23,10 @@ class Projects::ProtectedBranchesController < Projects::ApplicationController format.js { render nothing: true } end end + + private + + def protected_branch_params + params.require(:protected_branch).permit(:name) + end end diff --git a/app/controllers/projects/refs_controller.rb b/app/controllers/projects/refs_controller.rb index 8834a995081..7997c726fbb 100644 --- a/app/controllers/projects/refs_controller.rb +++ b/app/controllers/projects/refs_controller.rb @@ -37,7 +37,7 @@ class Projects::RefsController < Projects::ApplicationController 0 end - @limit = 10 + @limit = 25 @path = params[:path] diff --git a/app/controllers/projects/repositories_controller.rb b/app/controllers/projects/repositories_controller.rb index 28fed8b0e3f..f76ddb34bc4 100644 --- a/app/controllers/projects/repositories_controller.rb +++ b/app/controllers/projects/repositories_controller.rb @@ -22,6 +22,7 @@ class Projects::RepositoriesController < Projects::ApplicationController if file_path # Send file to user + response.headers["Content-Length"] = File.open(file_path).size.to_s send_file file_path else render_404 diff --git a/app/controllers/projects/services_controller.rb b/app/controllers/projects/services_controller.rb index 6db22186c14..b143dec3a93 100644 --- a/app/controllers/projects/services_controller.rb +++ b/app/controllers/projects/services_controller.rb @@ -16,7 +16,7 @@ class Projects::ServicesController < Projects::ApplicationController end def update - if @service.update_attributes(params[:service]) + if @service.update_attributes(service_params) redirect_to edit_project_service_path(@project, @service.to_param) else render 'edit' @@ -36,4 +36,11 @@ class Projects::ServicesController < Projects::ApplicationController def service @service ||= @project.services.find { |service| service.to_param == params[:id] } end + + def service_params + params.require(:service).permit( + :title, :token, :type, :active, :api_key, :subdomain, + :room, :recipients, :project_url + ) + end end diff --git a/app/controllers/projects/snippets_controller.rb b/app/controllers/projects/snippets_controller.rb index f93f2d5f9bb..25026973118 100644 --- a/app/controllers/projects/snippets_controller.rb +++ b/app/controllers/projects/snippets_controller.rb @@ -25,7 +25,7 @@ class Projects::SnippetsController < Projects::ApplicationController end def create - @snippet = @project.snippets.build(params[:project_snippet]) + @snippet = @project.snippets.build(snippet_params) @snippet.author = current_user if @snippet.save @@ -39,7 +39,7 @@ class Projects::SnippetsController < Projects::ApplicationController end def update - if @snippet.update_attributes(params[:project_snippet]) + if @snippet.update_attributes(snippet_params) redirect_to project_snippet_path(@project, @snippet) else respond_with(@snippet) @@ -86,4 +86,8 @@ class Projects::SnippetsController < Projects::ApplicationController def module_enabled return render_404 unless @project.snippets_enabled end + + def snippet_params + params.require(:project_snippet).permit(:title, :content, :file_name, :private) + end end diff --git a/app/controllers/projects/team_members_controller.rb b/app/controllers/projects/team_members_controller.rb index 44068878cd1..1de5bac9ee8 100644 --- a/app/controllers/projects/team_members_controller.rb +++ b/app/controllers/projects/team_members_controller.rb @@ -27,7 +27,7 @@ class Projects::TeamMembersController < Projects::ApplicationController def update @user_project_relation = project.users_projects.find_by(user_id: member) - @user_project_relation.update_attributes(params[:team_member]) + @user_project_relation.update_attributes(member_params) unless @user_project_relation.valid? flash[:alert] = "User should have at least one role" @@ -67,4 +67,8 @@ class Projects::TeamMembersController < Projects::ApplicationController def member @member ||= User.find_by(username: params[:id]) end + + def member_params + params.require(:team_member).permit(:user_id, :project_access) + end end diff --git a/app/controllers/projects/tree_controller.rb b/app/controllers/projects/tree_controller.rb index 30c94ec6da0..4d033b36848 100644 --- a/app/controllers/projects/tree_controller.rb +++ b/app/controllers/projects/tree_controller.rb @@ -1,7 +1,14 @@ # Controller for viewing a repository's file structure class Projects::TreeController < Projects::BaseTreeController def show - return not_found! if tree.entries.empty? + + if tree.entries.empty? + if @repository.blob_at(@commit.id, @path) + redirect_to project_blob_path(@project, File.join(@ref, @path)) and return + else + return not_found! + end + end respond_to do |format| format.html diff --git a/app/controllers/projects/wikis_controller.rb b/app/controllers/projects/wikis_controller.rb index 496064c9a65..0e03956e738 100644 --- a/app/controllers/projects/wikis_controller.rb +++ b/app/controllers/projects/wikis_controller.rb @@ -12,12 +12,10 @@ class Projects::WikisController < Projects::ApplicationController def show @page = @project_wiki.find_page(params[:id], params[:version_id]) - gollum_wiki = @project_wiki.wiki - file = gollum_wiki.file(params[:id], gollum_wiki.ref, true) if @page render 'show' - elsif file + elsif file = @project_wiki.find_file(params[:id], params[:version_id]) if file.on_disk? send_file file.on_disk_path, disposition: 'inline' else diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 0d15b458b70..f23afaf28fa 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -20,7 +20,7 @@ class ProjectsController < ApplicationController end def create - @project = ::Projects::CreateService.new(current_user, params[:project]).execute + @project = ::Projects::CreateService.new(current_user, project_params).execute flash[:notice] = 'Project was successfully created.' if @project.saved? respond_to do |format| @@ -29,7 +29,7 @@ class ProjectsController < ApplicationController end def update - status = ::Projects::UpdateService.new(@project, current_user, params).execute + status = ::Projects::UpdateService.new(@project, current_user, project_params).execute respond_to do |format| if status @@ -44,7 +44,7 @@ class ProjectsController < ApplicationController end def transfer - ::Projects::TransferService.new(project, current_user, params[:project]).execute + ::Projects::TransferService.new(project, current_user, project_params).execute end def show @@ -60,6 +60,8 @@ class ProjectsController < ApplicationController @events = event_filter.apply_filter(@events) @events = @events.limit(limit).offset(params[:offset] || 0) + @show_star = !(current_user && current_user.starred?(@project)) + respond_to do |format| format.html do if @project.empty_repo? @@ -85,7 +87,7 @@ class ProjectsController < ApplicationController redirect_to import_project_path(@project) end - @project.import_url = params[:project][:import_url] + @project.import_url = project_params[:import_url] if @project.save @project.reload @@ -167,6 +169,12 @@ class ProjectsController < ApplicationController end end + def toggle_star + current_user.toggle_star(@project) + @project.reload + render json: { star_count: @project.star_count } + end + private def upload_path @@ -185,4 +193,12 @@ class ProjectsController < ApplicationController def user_layout current_user ? "projects" : "public_projects" end + + def project_params + params.require(:project).permit( + :name, :path, :description, :issues_tracker, :tag_list, + :issues_enabled, :merge_requests_enabled, :snippets_enabled, :issues_tracker_id, :default_branch, + :wiki_enabled, :visibility_level, :import_url, :last_activity_at, :namespace_id + ) + end end diff --git a/app/controllers/public/projects_controller.rb b/app/controllers/public/projects_controller.rb deleted file mode 100644 index d6238f79547..00000000000 --- a/app/controllers/public/projects_controller.rb +++ /dev/null @@ -1,14 +0,0 @@ -class Public::ProjectsController < ApplicationController - skip_before_filter :authenticate_user!, - :reject_blocked, :set_current_user_for_observers, - :add_abilities - - layout 'public' - - def index - @projects = Project.publicish(current_user) - @projects = @projects.search(params[:search]) if params[:search].present? - @projects = @projects.sort(@sort = params[:sort]) - @projects = @projects.includes(:namespace).page(params[:page]).per(20) - end -end diff --git a/app/controllers/registrations_controller.rb b/app/controllers/registrations_controller.rb index 5f18bac82ed..9e70978992f 100644 --- a/app/controllers/registrations_controller.rb +++ b/app/controllers/registrations_controller.rb @@ -13,7 +13,14 @@ class RegistrationsController < Devise::RegistrationsController def build_resource(hash=nil) super - self.resource.with_defaults + end + + def after_sign_up_path_for resource + new_user_session_path + end + + def after_inactive_sign_up_path_for resource + new_user_session_path end private @@ -21,4 +28,8 @@ class RegistrationsController < Devise::RegistrationsController def signup_enabled? redirect_to new_user_session_path unless Gitlab.config.gitlab.signup_enabled end + + def sign_up_params + params.require(:user).permit(:username, :email, :name, :password, :password_confirmation) + end end diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb new file mode 100644 index 00000000000..1bdba75c5e7 --- /dev/null +++ b/app/controllers/sessions_controller.rb @@ -0,0 +1,27 @@ +class SessionsController < Devise::SessionsController + + def new + redirect_path = if request.referer.present? && (params['redirect_to_referer'] == 'yes') + referer_uri = URI(request.referer) + if referer_uri.host == Gitlab.config.gitlab.host + referer_uri.path + else + request.fullpath + end + else + request.fullpath + end + + # Prevent a 'you are already signed in' message directly after signing: + # we should never redirect to '/users/sign_in' after signing in successfully. + unless redirect_path == '/users/sign_in' + store_location_for(:redirect, redirect_path) + end + + super + end + + def create + super + end +end diff --git a/app/controllers/snippets_controller.rb b/app/controllers/snippets_controller.rb index 4fe98f804dc..e75db61e680 100644 --- a/app/controllers/snippets_controller.rb +++ b/app/controllers/snippets_controller.rb @@ -51,7 +51,7 @@ class SnippetsController < ApplicationController end def create - @snippet = PersonalSnippet.new(params[:personal_snippet]) + @snippet = PersonalSnippet.new(snippet_params) @snippet.author = current_user if @snippet.save @@ -65,7 +65,7 @@ class SnippetsController < ApplicationController end def update - if @snippet.update_attributes(params[:personal_snippet]) + if @snippet.update_attributes(snippet_params) redirect_to snippet_path(@snippet) else respond_with @snippet @@ -109,4 +109,8 @@ class SnippetsController < ApplicationController def set_title @title = 'Snippets' end + + def snippet_params + params.require(:personal_snippet).permit(:title, :content, :file_name, :private) + end end diff --git a/app/controllers/users_groups_controller.rb b/app/controllers/users_groups_controller.rb index b9bdc189522..a35a12a866b 100644 --- a/app/controllers/users_groups_controller.rb +++ b/app/controllers/users_groups_controller.rb @@ -14,7 +14,7 @@ class UsersGroupsController < ApplicationController def update @member = @group.users_groups.find(params[:id]) - @member.update_attributes(params[:users_group]) + @member.update_attributes(member_params) end def destroy @@ -41,4 +41,8 @@ class UsersGroupsController < ApplicationController return render_404 end end + + def member_params + params.require(:users_group).permit(:group_access, :user_id) + end end diff --git a/app/controllers/users_sessions_controller.rb b/app/controllers/users_sessions_controller.rb deleted file mode 100644 index 656c92376fd..00000000000 --- a/app/controllers/users_sessions_controller.rb +++ /dev/null @@ -1,6 +0,0 @@ -class UsersSessionsController < Devise::SessionsController - def create - @return_to = params[:return_to] - super - end -end diff --git a/app/finders/base_finder.rb b/app/finders/base_finder.rb index 7150bb2e31b..ec5f5919d7e 100644 --- a/app/finders/base_finder.rb +++ b/app/finders/base_finder.rb @@ -125,7 +125,13 @@ class BaseFinder def by_label(items) if params[:label_name].present? - items = items.tagged_with(params[:label_name]) + label_names = params[:label_name].split(",") + + item_ids = LabelLink.joins(:label). + where('labels.title in (?)', label_names). + where(target_type: klass.name).pluck(:target_id) + + items = items.where(id: item_ids) end items diff --git a/app/finders/notes_finder.rb b/app/finders/notes_finder.rb index ea055694cd7..bef82d7f0fd 100644 --- a/app/finders/notes_finder.rb +++ b/app/finders/notes_finder.rb @@ -14,7 +14,7 @@ class NotesFinder project.issues.find(target_id).notes.inc_author.fresh when "merge_request" project.merge_requests.find(target_id).mr_and_commit_notes.inc_author.fresh - when "snippet" + when "snippet", "project_snippet" project.snippets.find(target_id).notes.fresh else raise 'invalid target_type' diff --git a/app/finders/trending_projects_finder.rb b/app/finders/trending_projects_finder.rb new file mode 100644 index 00000000000..32d7968924a --- /dev/null +++ b/app/finders/trending_projects_finder.rb @@ -0,0 +1,19 @@ +class TrendingProjectsFinder + def execute(current_user, start_date = nil) + start_date ||= Date.today - 1.month + + projects = projects_for(current_user) + + # Determine trending projects based on comments count + # for period of time - ex. month + projects.joins(:notes).where('notes.created_at > ?', start_date). + select("projects.*, count(notes.id) as ncount"). + group("projects.id").order("ncount DESC") + end + + private + + def projects_for(current_user) + ProjectsFinder.new.execute(current_user) + end +end diff --git a/app/helpers/appearances_helper.rb b/app/helpers/appearances_helper.rb new file mode 100644 index 00000000000..96e5d43a369 --- /dev/null +++ b/app/helpers/appearances_helper.rb @@ -0,0 +1,17 @@ +module AppearancesHelper + def brand_item + nil + end + + def brand_title + 'GitLab Community Edition' + end + + def brand_image + nil + end + + def brand_text + nil + end +end diff --git a/app/helpers/commits_helper.rb b/app/helpers/commits_helper.rb index 4d27cf2851e..9a8b3928bf4 100644 --- a/app/helpers/commits_helper.rb +++ b/app/helpers/commits_helper.rb @@ -1,3 +1,4 @@ +# encoding: utf-8 module CommitsHelper # Returns a link to the commit author. If the author has a matching user and # is a member of the current @project it will link to the team member page. @@ -180,6 +181,17 @@ module CommitsHelper return old_lines, new_lines end + def link_to_browse_code(project, commit) + if current_controller?(:projects, :commits) + if @repo.blob_at(commit.id, @path) + return link_to "Browse File »", project_blob_path(project, tree_join(commit.id, @path)), class: "pull-right" + elsif @path.present? + return link_to "Browse Dir »", project_tree_path(project, tree_join(commit.id, @path)), class: "pull-right" + end + end + link_to "Browse Code »", project_tree_path(project, commit), class: "pull-right" + end + protected # Private: Returns a link to a person. If the person has a matching user and diff --git a/app/helpers/dashboard_helper.rb b/app/helpers/dashboard_helper.rb index d5712ab3374..c4e33e3308f 100644 --- a/app/helpers/dashboard_helper.rb +++ b/app/helpers/dashboard_helper.rb @@ -35,4 +35,42 @@ module DashboardHelper path << "?#{options.to_param}" path end + + def assigned_entities_count(current_user, entity, scope = nil) + items = current_user.send("assigned_" + entity.pluralize).opened + + if scope.kind_of?(Group) + items = items.of_group(scope) + elsif scope.kind_of?(Project) + items = items.of_projects(scope) + end + + items.count + end + + def authored_entities_count(current_user, entity, scope = nil) + items = current_user.send(entity.pluralize).opened + + if scope.kind_of?(Group) + items = items.of_group(scope) + elsif scope.kind_of?(Project) + items = items.of_projects(scope) + end + + items.count + end + + def authorized_entities_count(current_user, entity, scope = nil) + items = entity.classify.constantize.opened + + if scope.kind_of?(Group) + items = items.of_group(scope) + elsif scope.kind_of?(Project) + items = items.of_projects(scope) + else + items = items.of_projects(current_user.authorized_projects) + end + + items.count + end end diff --git a/app/helpers/diff_helper.rb b/app/helpers/diff_helper.rb new file mode 100644 index 00000000000..ee4d4fbdff5 --- /dev/null +++ b/app/helpers/diff_helper.rb @@ -0,0 +1,22 @@ +module DiffHelper + def safe_diff_files(diffs) + if diff_hard_limit_enabled? + diffs.first(Commit::DIFF_HARD_LIMIT_FILES) + else + diffs.first(Commit::DIFF_SAFE_FILES) + end + end + + def show_diff_size_warninig?(diffs) + safe_diff_files(diffs).size < diffs.size + end + + def diff_hard_limit_enabled? + # Enabling hard limit allows user to see more diff information + if params[:force_show_diff].present? + true + else + false + end + end +end diff --git a/app/helpers/events_helper.rb b/app/helpers/events_helper.rb index f0530c74828..c7e8fdad7a0 100644 --- a/app/helpers/events_helper.rb +++ b/app/helpers/events_helper.rb @@ -64,7 +64,16 @@ module EventsHelper project_issue_url(event.project, event.issue) elsif event.merge_request? project_merge_request_url(event.project, event.merge_request) - + elsif event.note? + if event.note_target + if event.note_commit? + project_commit_path(event.project, event.note_commit_id, anchor: dom_id(event.target)) + elsif event.note_project_snippet? + project_snippet_path(event.project, event.note_target) + else + event_note_target_path(event) + end + end elsif event.push? if event.push_with_commits? if event.commits_count > 1 @@ -83,6 +92,10 @@ module EventsHelper render "events/event_issue", issue: event.issue elsif event.push? render "events/event_push", event: event + elsif event.merge_request? + render "events/event_merge_request", merge_request: event.merge_request + elsif event.note? + render "events/event_note", note: event.note end end diff --git a/app/helpers/gitlab_markdown_helper.rb b/app/helpers/gitlab_markdown_helper.rb index db5b4eacd1f..c112e98508c 100644 --- a/app/helpers/gitlab_markdown_helper.rb +++ b/app/helpers/gitlab_markdown_helper.rb @@ -63,10 +63,14 @@ module GitlabMarkdownHelper paths = extract_paths(text) paths.uniq.each do |file_path| - new_path = rebuild_path(file_path) - # Finds quoted path so we don't replace other mentions of the string - # eg. "doc/api" will be replaced and "/home/doc/api/text" won't - text.gsub!("\"#{file_path}\"", "\"/#{new_path}\"") + # If project does not have repository + # its nothing to rebuild + if @repository.exists? && !@repository.empty? + new_path = rebuild_path(file_path) + # Finds quoted path so we don't replace other mentions of the string + # eg. "doc/api" will be replaced and "/home/doc/api/text" won't + text.gsub!("\"#{file_path}\"", "\"/#{new_path}\"") + end end text @@ -91,7 +95,12 @@ module GitlabMarkdownHelper end def link_to_ignore?(link) - ignored_protocols.map{ |protocol| link.include?(protocol) }.any? + if link =~ /\#\w+/ + # ignore anchors like <a href="#my-header"> + true + else + ignored_protocols.map{ |protocol| link.include?(protocol) }.any? + end end def ignored_protocols @@ -129,7 +138,7 @@ module GitlabMarkdownHelper # If we are at doc/api/README.md and the README.md contains relative links like [Users](users.md) # this takes the request path(doc/api/README.md), and replaces the README.md with users.md so the path looks like doc/api/users.md # If we are at doc/api and the README.md shown in below the tree view - # this takes the rquest path(doc/api) and adds users.md so the path looks like doc/api/users.md + # this takes the request path(doc/api) and adds users.md so the path looks like doc/api/users.md def build_nested_path(path, request_path) return request_path if path == "" return path unless request_path @@ -169,7 +178,7 @@ module GitlabMarkdownHelper def current_sha if @commit @commit.id - else + elsif @repository && !@repository.empty? @repository.head_commit.sha end end diff --git a/app/helpers/groups_helper.rb b/app/helpers/groups_helper.rb index cfc9a572cac..0dc53dedeb7 100644 --- a/app/helpers/groups_helper.rb +++ b/app/helpers/groups_helper.rb @@ -31,6 +31,17 @@ module GroupsHelper end title + end + + def group_filter_path(entity, options={}) + exist_opts = { + status: params[:status] + } + + options = exist_opts.merge(options) + path = request.path + path << "?#{options.to_param}" + path end end diff --git a/app/helpers/labels_helper.rb b/app/helpers/labels_helper.rb index 4d20b827a0d..37f3832e54f 100644 --- a/app/helpers/labels_helper.rb +++ b/app/helpers/labels_helper.rb @@ -1,28 +1,37 @@ module LabelsHelper - def issue_label_names - @project.issues_labels.map(&:name) + def project_label_names + @project.labels.pluck(:title) end - def labels_autocomplete_source - labels = @project.issues_labels - labels = labels.map{ |l| { label: l.name, value: l.name } } - labels.to_json + def render_colored_label(label) + label_color = label.color || "#428bca" + text_color = text_color_for_bg(label_color) + + content_tag :span, class: 'label color-label', style: "background:#{label_color};color:#{text_color}" do + label.name + end + end + + def suggested_colors + [ + '#d9534f', + '#f0ad4e', + '#428bca', + '#5cb85c', + '#34495e', + '#7f8c8d', + '#8e44ad', + '#FFECDB' + ] end - def label_css_class(name) - klass = Gitlab::IssuesLabels + def text_color_for_bg(bg_color) + r, g, b = bg_color.slice(1,7).scan(/.{2}/).map(&:hex) - case name.downcase - when *klass.warning_labels - 'label-warning' - when *klass.neutral_labels - 'label-primary' - when *klass.positive_labels - 'label-success' - when *klass.important_labels - 'label-danger' + if (r + g + b) > 500 + "#333" else - 'label-info' + "#FFF" end end end diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index ba4c7068e90..8350f5dc072 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -122,6 +122,40 @@ module ProjectsHelper options_for_select(values, current_tracker) end + def link_to_toggle_star(title, starred, signed_in) + cls = 'btn btn-block' + cls += ' disabled' unless signed_in + + toggle_html = content_tag('span', class: 'toggle') do + toggle_text = if starred + 'Unstar' + else + 'Star' + end + + content_tag('i', ' ', class: 'icon-star') + toggle_text + end + + count_html = content_tag('span', class: 'count') do + @project.star_count.to_s + end + + link_opts = { + title: title, + class: cls, + method: :post, + remote: true, + data: {type: 'json'} + } + + + content_tag 'span', class: starred ? 'turn-on' : 'turn-off' do + link_to toggle_star_project_path(@project), link_opts do + toggle_html + count_html + end + end + end + private def get_project_nav_tabs(project, current_user) @@ -221,4 +255,10 @@ module ProjectsHelper "Never" end end + + def contribution_guide_url(project) + if project && project.repository.contribution_guide + project_blob_path(project, tree_join(project.default_branch, project.repository.contribution_guide.name)) + end + end end diff --git a/app/helpers/tree_helper.rb b/app/helpers/tree_helper.rb index 2d82b6a0b47..bde2a60faa9 100644 --- a/app/helpers/tree_helper.rb +++ b/app/helpers/tree_helper.rb @@ -44,8 +44,8 @@ module TreeHelper # # Returns boolean def markup?(filename) - filename.downcase.end_with?(*%w(.textile .rdoc .org .creole - .mediawiki .rst .adoc .asciidoc .pod)) + filename.downcase.end_with?(*%w(.textile .rdoc .org .creole .wiki .mediawiki + .rst .adoc .asciidoc .asc)) end def gitlab_markdown?(filename) diff --git a/app/mailers/emails/issues.rb b/app/mailers/emails/issues.rb index a096df9dc0d..e5346235963 100644 --- a/app/mailers/emails/issues.rb +++ b/app/mailers/emails/issues.rb @@ -4,10 +4,10 @@ module Emails @issue = Issue.find(issue_id) @project = @issue.project @target_url = project_issue_url(@project, @issue) - set_message_id("issue_#{issue_id}") - mail(from: sender(@issue.author_id), - to: recipient(recipient_id), - subject: subject("#{@issue.title} (##{@issue.iid})")) + mail_new_thread(@issue, + from: sender(@issue.author_id), + to: recipient(recipient_id), + subject: subject("#{@issue.title} (##{@issue.iid})")) end def reassigned_issue_email(recipient_id, issue_id, previous_assignee_id, updated_by_user_id) @@ -15,10 +15,10 @@ module Emails @previous_assignee = User.find_by(id: previous_assignee_id) if previous_assignee_id @project = @issue.project @target_url = project_issue_url(@project, @issue) - set_reference("issue_#{issue_id}") - mail(from: sender(updated_by_user_id), - to: recipient(recipient_id), - subject: subject("#{@issue.title} (##{@issue.iid})")) + mail_answer_thread(@issue, + from: sender(updated_by_user_id), + to: recipient(recipient_id), + subject: subject("#{@issue.title} (##{@issue.iid})")) end def closed_issue_email(recipient_id, issue_id, updated_by_user_id) @@ -26,10 +26,10 @@ module Emails @project = @issue.project @updated_by = User.find updated_by_user_id @target_url = project_issue_url(@project, @issue) - set_reference("issue_#{issue_id}") - mail(from: sender(updated_by_user_id), - to: recipient(recipient_id), - subject: subject("#{@issue.title} (##{@issue.iid})")) + mail_answer_thread(@issue, + from: sender(updated_by_user_id), + to: recipient(recipient_id), + subject: subject("#{@issue.title} (##{@issue.iid})")) end def issue_status_changed_email(recipient_id, issue_id, status, updated_by_user_id) @@ -38,10 +38,10 @@ module Emails @project = @issue.project @updated_by = User.find updated_by_user_id @target_url = project_issue_url(@project, @issue) - set_reference("issue_#{issue_id}") - mail(from: sender(updated_by_user_id), - to: recipient(recipient_id), - subject: subject("#{@issue.title} (##{@issue.iid})")) + mail_answer_thread(@issue, + from: sender(updated_by_user_id), + to: recipient(recipient_id), + subject: subject("#{@issue.title} (##{@issue.iid})")) end end end diff --git a/app/mailers/emails/merge_requests.rb b/app/mailers/emails/merge_requests.rb index ea5671c4502..935987e2ed1 100644 --- a/app/mailers/emails/merge_requests.rb +++ b/app/mailers/emails/merge_requests.rb @@ -4,10 +4,10 @@ module Emails @merge_request = MergeRequest.find(merge_request_id) @project = @merge_request.project @target_url = project_merge_request_url(@project, @merge_request) - set_message_id("merge_request_#{merge_request_id}") - mail(from: sender(@merge_request.author_id), - to: recipient(recipient_id), - subject: subject("#{@merge_request.title} (##{@merge_request.iid})")) + mail_new_thread(@merge_request, + from: sender(@merge_request.author_id), + to: recipient(recipient_id), + subject: subject("#{@merge_request.title} (##{@merge_request.iid})")) end def reassigned_merge_request_email(recipient_id, merge_request_id, previous_assignee_id, updated_by_user_id) @@ -15,10 +15,10 @@ module Emails @previous_assignee = User.find_by(id: previous_assignee_id) if previous_assignee_id @project = @merge_request.project @target_url = project_merge_request_url(@project, @merge_request) - set_reference("merge_request_#{merge_request_id}") - mail(from: sender(updated_by_user_id), - to: recipient(recipient_id), - subject: subject("#{@merge_request.title} (##{@merge_request.iid})")) + mail_answer_thread(@merge_request, + from: sender(updated_by_user_id), + to: recipient(recipient_id), + subject: subject("#{@merge_request.title} (##{@merge_request.iid})")) end def closed_merge_request_email(recipient_id, merge_request_id, updated_by_user_id) @@ -26,20 +26,32 @@ module Emails @updated_by = User.find updated_by_user_id @project = @merge_request.project @target_url = project_merge_request_url(@project, @merge_request) - set_reference("merge_request_#{merge_request_id}") - mail(from: sender(updated_by_user_id), - to: recipient(recipient_id), - subject: subject("#{@merge_request.title} (##{@merge_request.iid})")) + mail_answer_thread(@merge_request, + from: sender(updated_by_user_id), + to: recipient(recipient_id), + subject: subject("#{@merge_request.title} (##{@merge_request.iid})")) end def merged_merge_request_email(recipient_id, merge_request_id, updated_by_user_id) @merge_request = MergeRequest.find(merge_request_id) @project = @merge_request.project @target_url = project_merge_request_url(@project, @merge_request) + mail_answer_thread(@merge_request, + from: sender(updated_by_user_id), + to: recipient(recipient_id), + subject: subject("#{@merge_request.title} (##{@merge_request.iid})")) + end + + def merge_request_status_email(recipient_id, merge_request_id, status, updated_by_user_id) + @merge_request = MergeRequest.find(merge_request_id) + @mr_status = status + @project = @merge_request.project + @updated_by = User.find updated_by_user_id + @target_url = project_merge_request_url(@project, @merge_request) set_reference("merge_request_#{merge_request_id}") mail(from: sender(updated_by_user_id), to: recipient(recipient_id), - subject: subject("#{@merge_request.title} (##{@merge_request.iid})")) + subject: subject("#{@merge_request.title} (##{@merge_request.iid}) #{@mr_status}")) end end diff --git a/app/mailers/emails/notes.rb b/app/mailers/emails/notes.rb index b7fedbd3707..ef9af726a6c 100644 --- a/app/mailers/emails/notes.rb +++ b/app/mailers/emails/notes.rb @@ -5,9 +5,10 @@ module Emails @commit = @note.noteable @project = @note.project @target_url = project_commit_url(@project, @commit, anchor: "note_#{@note.id}") - mail(from: sender(@note.author_id), - to: recipient(recipient_id), - subject: subject("#{@commit.title} (#{@commit.short_id})")) + mail_answer_thread(@commit, + from: sender(@note.author_id), + to: recipient(recipient_id), + subject: subject("#{@commit.title} (#{@commit.short_id})")) end def note_issue_email(recipient_id, note_id) @@ -15,10 +16,10 @@ module Emails @issue = @note.noteable @project = @note.project @target_url = project_issue_url(@project, @issue, anchor: "note_#{@note.id}") - set_reference("issue_#{@issue.id}") - mail(from: sender(@note.author_id), - to: recipient(recipient_id), - subject: subject("#{@issue.title} (##{@issue.iid})")) + mail_answer_thread(@issue, + from: sender(@note.author_id), + to: recipient(recipient_id), + subject: subject("#{@issue.title} (##{@issue.iid})")) end def note_merge_request_email(recipient_id, note_id) @@ -26,10 +27,10 @@ module Emails @merge_request = @note.noteable @project = @note.project @target_url = project_merge_request_url(@project, @merge_request, anchor: "note_#{@note.id}") - set_reference("merge_request_#{@merge_request.id}") - mail(from: sender(@note.author_id), - to: recipient(recipient_id), - subject: subject("#{@merge_request.title} (##{@merge_request.iid})")) + mail_answer_thread(@merge_request, + from: sender(@note.author_id), + to: recipient(recipient_id), + subject: subject("#{@merge_request.title} (##{@merge_request.iid})")) end end end diff --git a/app/mailers/emails/profile.rb b/app/mailers/emails/profile.rb index f02d95fd557..f8a7d133d1d 100644 --- a/app/mailers/emails/profile.rb +++ b/app/mailers/emails/profile.rb @@ -1,9 +1,10 @@ module Emails module Profile - def new_user_email(user_id, password) + def new_user_email(user_id, password, token = nil) @user = User.find(user_id) @password = password @target_url = user_url(@user) + @token = token mail(to: @user.email, subject: subject("Account was created for you")) end diff --git a/app/mailers/notify.rb b/app/mailers/notify.rb index 84a0da0129d..bd438bab89a 100644 --- a/app/mailers/notify.rb +++ b/app/mailers/notify.rb @@ -1,4 +1,6 @@ class Notify < ActionMailer::Base + include ActionDispatch::Routing::PolymorphicRoutes + include Emails::Issues include Emails::MergeRequests include Emails::Notes @@ -53,14 +55,6 @@ class Notify < ActionMailer::Base end end - # Set the Message-ID header field - # - # local_part - The local part of the message ID - # - def set_message_id(local_part) - headers["Message-ID"] = "<#{local_part}@#{Gitlab.config.gitlab.host}>" - end - # Set the References header field # # local_part - The local part of the referenced message ID @@ -93,4 +87,40 @@ class Notify < ActionMailer::Base subject << extra.join(' | ') if extra.present? subject end + + # Return a string suitable for inclusion in the 'Message-Id' mail header. + # + # The message-id is generated from the unique URL to a model object. + def message_id(model) + model_name = model.class.model_name.singular_route_key + "<#{model_name}_#{model.id}@#{Gitlab.config.gitlab.host}>" + end + + # Send an email that starts a new conversation thread, + # with headers suitable for grouping by thread in email clients. + # + # See: mail_answer_thread + def mail_new_thread(model, headers = {}, &block) + headers['Message-ID'] = message_id(model) + mail(headers, &block) + end + + # Send an email that responds to an existing conversation thread, + # with headers suitable for grouping by thread in email clients. + # + # For grouping emails by thread, email clients heuristics require the answers to: + # + # * have a subject that begin by 'Re: ' + # * have a 'In-Reply-To' or 'References' header that references the original 'Message-ID' + # + def mail_answer_thread(model, headers = {}, &block) + headers['In-Reply-To'] = message_id(model) + headers['References'] = message_id(model) + + if (headers[:subject]) + headers[:subject].prepend('Re: ') + end + + mail(headers, &block) + end end diff --git a/app/models/ability.rb b/app/models/ability.rb index 234578b5e18..f1d57de63bb 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -67,40 +67,42 @@ class Ability def project_abilities(user, project) rules = [] + key = "/user/#{user.id}/project/#{project.id}" + RequestStore.store[key] ||= begin + team = project.team - team = project.team + # Rules based on role in project + if team.master?(user) + rules += project_master_rules - # Rules based on role in project - if team.master?(user) - rules += project_master_rules + elsif team.developer?(user) + rules += project_dev_rules - elsif team.developer?(user) - rules += project_dev_rules + elsif team.reporter?(user) + rules += project_report_rules - elsif team.reporter?(user) - rules += project_report_rules + elsif team.guest?(user) + rules += project_guest_rules + end - elsif team.guest?(user) - rules += project_guest_rules - end + if project.public? || project.internal? + rules += public_project_rules + end - if project.public? || project.internal? - rules += public_project_rules - end + if project.owner == user || user.admin? + rules += project_admin_rules + end - if project.owner == user || user.admin? - rules += project_admin_rules - end + if project.group && project.group.has_owner?(user) + rules += project_admin_rules + end - if project.group && project.group.has_owner?(user) - rules += project_admin_rules - end + if project.archived? + rules -= project_archived_rules + end - if project.archived? - rules -= project_archived_rules + rules end - - rules end def public_project_rules @@ -140,6 +142,7 @@ class Ability :write_wiki, :modify_issue, :admin_issue, + :admin_label, :push_code ] end diff --git a/app/models/broadcast_message.rb b/app/models/broadcast_message.rb index ce8b7973cd9..4d0c04bcc3d 100644 --- a/app/models/broadcast_message.rb +++ b/app/models/broadcast_message.rb @@ -14,8 +14,6 @@ # class BroadcastMessage < ActiveRecord::Base - attr_accessible :alert_type, :color, :ends_at, :font, :message, :starts_at - validates :message, presence: true validates :starts_at, presence: true validates :ends_at, presence: true diff --git a/app/models/commit.rb b/app/models/commit.rb index 82876e10446..ff5392957ce 100644 --- a/app/models/commit.rb +++ b/app/models/commit.rb @@ -12,6 +12,7 @@ class Commit # User can force display of diff above this size DIFF_SAFE_FILES = 100 DIFF_SAFE_LINES = 5000 + # Commits above this size will not be rendered in HTML DIFF_HARD_LIMIT_FILES = 1000 DIFF_HARD_LIMIT_LINES = 50000 @@ -23,23 +24,7 @@ class Commit # Calculate number of lines to render for diffs def diff_line_count(diffs) - diffs.reduce(0){|sum, d| sum + d.diff.lines.count} - end - - def diff_suppress?(diffs, line_count = nil) - # optimize - check file count first - return true if diffs.size > DIFF_SAFE_FILES - - line_count ||= Commit::diff_line_count(diffs) - line_count > DIFF_SAFE_LINES - end - - def diff_force_suppress?(diffs, line_count = nil) - # optimize - check file count first - return true if diffs.size > DIFF_HARD_LIMIT_FILES - - line_count ||= Commit::diff_line_count(diffs) - line_count > DIFF_HARD_LIMIT_LINES + diffs.reduce(0) { |sum, d| sum + d.diff.lines.count } end end @@ -60,14 +45,6 @@ class Commit @diff_line_count end - def diff_suppress? - Commit::diff_suppress?(self.diffs, diff_line_count) - end - - def diff_force_suppress? - Commit::diff_force_suppress?(self.diffs, diff_line_count) - end - # Returns a string describing the commit for use in a link title # # Example diff --git a/app/models/concerns/issuable.rb b/app/models/concerns/issuable.rb index 9a227fcef59..517e4548624 100644 --- a/app/models/concerns/issuable.rb +++ b/app/models/concerns/issuable.rb @@ -13,6 +13,8 @@ module Issuable belongs_to :assignee, class_name: "User" belongs_to :milestone has_many :notes, as: :noteable, dependent: :destroy + has_many :label_links, as: :target, dependent: :destroy + has_many :labels, through: :label_links validates :author, presence: true validates :title, presence: true, length: { within: 0..255 } @@ -131,4 +133,15 @@ module Issuable object_attributes: self.attributes } end + + def label_names + labels.order('title ASC').pluck(:title) + end + + def add_labels_by_names(label_names) + label_names.each do |label_name| + label = project.labels.find_or_create_by(title: label_name.strip) + self.labels << label + end + end end diff --git a/app/models/concerns/token_authenticatable.rb b/app/models/concerns/token_authenticatable.rb new file mode 100644 index 00000000000..9b88ec1cc38 --- /dev/null +++ b/app/models/concerns/token_authenticatable.rb @@ -0,0 +1,31 @@ +module TokenAuthenticatable + extend ActiveSupport::Concern + + module ClassMethods + def find_by_authentication_token(authentication_token = nil) + if authentication_token + where(authentication_token: authentication_token).first + end + end + end + + def ensure_authentication_token + if authentication_token.blank? + self.authentication_token = generate_authentication_token + end + end + + def reset_authentication_token! + self.authentication_token = generate_authentication_token + save + end + + private + + def generate_authentication_token + loop do + token = Devise.friendly_token + break token unless self.class.unscoped.where(authentication_token: token).first + end + end +end diff --git a/app/models/deploy_keys_project.rb b/app/models/deploy_keys_project.rb index 739d749830a..f23d8205ddc 100644 --- a/app/models/deploy_keys_project.rb +++ b/app/models/deploy_keys_project.rb @@ -10,13 +10,10 @@ # class DeployKeysProject < ActiveRecord::Base - attr_accessible :key_id, :project_id - belongs_to :project belongs_to :deploy_key validates :deploy_key_id, presence: true validates :deploy_key_id, uniqueness: { scope: [:project_id], message: "already exists in project" } - validates :project_id, presence: true end diff --git a/app/models/email.rb b/app/models/email.rb index 9068c2b87b6..57f476bd519 100644 --- a/app/models/email.rb +++ b/app/models/email.rb @@ -10,16 +10,8 @@ # class Email < ActiveRecord::Base - attr_accessible :email, :user_id - - # - # Relations - # belongs_to :user - # - # Validations - # validates :user_id, presence: true validates :email, presence: true, email: { strict_mode: true }, uniqueness: true validate :unique_email, if: ->(email) { email.email_changed? } diff --git a/app/models/event.rb b/app/models/event.rb index 1a8d55c54b4..9e296c00281 100644 --- a/app/models/event.rb +++ b/app/models/event.rb @@ -15,9 +15,6 @@ # class Event < ActiveRecord::Base - attr_accessible :project, :action, :data, :author_id, :project_id, - :target_id, :target_type - default_scope { where.not(author_id: nil) } CREATED = 1 @@ -33,6 +30,7 @@ class Event < ActiveRecord::Base delegate :name, :email, to: :author, prefix: true, allow_nil: true delegate :title, to: :issue, prefix: true, allow_nil: true delegate :title, to: :merge_request, prefix: true, allow_nil: true + delegate :title, to: :note, prefix: true, allow_nil: true belongs_to :author, class_name: "User" belongs_to :project @@ -72,6 +70,12 @@ class Event < ActiveRecord::Base author_id: user.id ) end + + def reset_event_cache_for(target) + Event.where(target_id: target.id, target_type: target.class.to_s). + order('id DESC').limit(100). + update_all(updated_at: Time.now) + end end def proper? @@ -150,6 +154,10 @@ class Event < ActiveRecord::Base target if target_type == "MergeRequest" end + def note + target if target_type == "Note" + end + def action_name if closed? "closed" diff --git a/app/models/forked_project_link.rb b/app/models/forked_project_link.rb index 17add270f67..9b0c6263a96 100644 --- a/app/models/forked_project_link.rb +++ b/app/models/forked_project_link.rb @@ -10,10 +10,6 @@ # class ForkedProjectLink < ActiveRecord::Base - attr_accessible :forked_from_project_id, :forked_to_project_id - - # Relations belongs_to :forked_to_project, class_name: Project belongs_to :forked_from_project, class_name: Project - end diff --git a/app/models/group.rb b/app/models/group.rb index e51e19ab60c..66239f7fe6f 100644 --- a/app/models/group.rb +++ b/app/models/group.rb @@ -20,8 +20,6 @@ class Group < Namespace has_many :users_groups, dependent: :destroy has_many :users, through: :users_groups - attr_accessible :avatar - validate :avatar_type, if: ->(user) { user.avatar_changed? } validates :avatar, file_size: { maximum: 100.kilobytes.to_i } @@ -75,4 +73,20 @@ class Group < Namespace def public_profile? projects.public_only.any? end + + class << self + def search(query) + where("LOWER(namespaces.name) LIKE :query", query: "%#{query.downcase}%") + end + + def sort(method) + case method.to_s + when "newest" then reorder("namespaces.created_at DESC") + when "oldest" then reorder("namespaces.created_at ASC") + when "recently_updated" then reorder("namespaces.updated_at DESC") + when "last_updated" then reorder("namespaces.updated_at ASC") + else reorder("namespaces.path, namespaces.name ASC") + end + end + end end diff --git a/app/models/group_milestone.rb b/app/models/group_milestone.rb new file mode 100644 index 00000000000..33915313789 --- /dev/null +++ b/app/models/group_milestone.rb @@ -0,0 +1,95 @@ +class GroupMilestone + + def initialize(title, milestones) + @title = title + @milestones = milestones + end + + def title + @title + end + + def safe_title + @title.parameterize + end + + def milestones + @milestones + end + + def projects + milestones.map { |milestone| milestone.project } + end + + def issue_count + milestones.map { |milestone| milestone.issues.count }.sum + end + + def merge_requests_count + milestones.map { |milestone| milestone.merge_requests.count }.sum + end + + def open_items_count + milestones.map { |milestone| milestone.open_items_count }.sum + end + + def closed_items_count + milestones.map { |milestone| milestone.closed_items_count }.sum + end + + def total_items_count + milestones.map { |milestone| milestone.total_items_count }.sum + end + + def percent_complete + ((closed_items_count * 100) / total_items_count).abs + rescue ZeroDivisionError + 100 + end + + def state + state = milestones.map { |milestone| milestone.state } + + if state.count('closed') == state.size + 'closed' + else + 'active' + end + end + + def active? + state == 'active' + end + + def closed? + state == 'closed' + end + + def issues + @group_issues ||= milestones.map { |milestone| milestone.issues }.flatten.group_by(&:state) + end + + def merge_requests + @group_merge_requests ||= milestones.map { |milestone| milestone.merge_requests }.flatten.group_by(&:state) + end + + def participants + milestones.map { |milestone| milestone.participants.uniq }.reject(&:empty?).flatten + end + + def opened_issues + issues.values_at("opened", "reopened").compact.flatten + end + + def closed_issues + issues['closed'] + end + + def opened_merge_requests + merge_requests.values_at("opened", "reopened").compact.flatten + end + + def closed_merge_requests + merge_requests.values_at("closed", "merged", "locked").compact.flatten + end +end diff --git a/app/models/issue.rb b/app/models/issue.rb index f0c2e552273..92a8ff9b677 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -32,12 +32,6 @@ class Issue < ActiveRecord::Base scope :of_group, ->(group) { where(project_id: group.project_ids) } scope :of_user_team, ->(team) { where(project_id: team.project_ids, assignee_id: team.member_ids) } - - attr_accessible :title, :assignee_id, :position, :description, - :milestone_id, :label_list, :state_event - - acts_as_taggable_on :labels - scope :cared, ->(user) { where(assignee_id: user) } scope :open_for, ->(user) { opened.assigned_to(user) } @@ -70,8 +64,6 @@ class Issue < ActiveRecord::Base # Thus it will automatically generate a new fragment # when the event is updated because the key changes. def reset_events_cache - Event.where(target_id: self.id, target_type: 'Issue'). - order('id DESC').limit(100). - update_all(updated_at: Time.now) + Event.reset_event_cache_for(self) end end diff --git a/app/models/key.rb b/app/models/key.rb index 035c9efa016..d59993b1905 100644 --- a/app/models/key.rb +++ b/app/models/key.rb @@ -19,8 +19,6 @@ class Key < ActiveRecord::Base belongs_to :user - attr_accessible :key, :title - before_validation :strip_white_space, :generate_fingerpint validates :title, presence: true, length: { within: 0..255 } diff --git a/app/models/label.rb b/app/models/label.rb new file mode 100644 index 00000000000..ce982579675 --- /dev/null +++ b/app/models/label.rb @@ -0,0 +1,21 @@ +class Label < ActiveRecord::Base + belongs_to :project + has_many :label_links, dependent: :destroy + has_many :issues, through: :label_links, source: :target, source_type: 'Issue' + + validates :color, format: { with: /\A\#[0-9A-Fa-f]{6}+\Z/ }, allow_blank: true + validates :project, presence: true + + # Dont allow '?', '&', and ',' for label titles + validates :title, presence: true, format: { with: /\A[^&\?,&]*\z/ } + + scope :order_by_name, -> { reorder("labels.title ASC") } + + def name + title + end + + def open_issues_count + issues.opened.count + end +end diff --git a/app/models/label_link.rb b/app/models/label_link.rb new file mode 100644 index 00000000000..47bd6eaf35f --- /dev/null +++ b/app/models/label_link.rb @@ -0,0 +1,7 @@ +class LabelLink < ActiveRecord::Base + belongs_to :target, polymorphic: true + belongs_to :label + + validates :target, presence: true + validates :label, presence: true +end diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb index bfea209bf6d..b5705ef151d 100644 --- a/app/models/merge_request.rb +++ b/app/models/merge_request.rb @@ -36,18 +36,16 @@ class MergeRequest < ActiveRecord::Base delegate :commits, :diffs, :last_commit, :last_commit_short_sha, to: :merge_request_diff, prefix: nil - attr_accessible :title, :assignee_id, :source_project_id, :source_branch, - :target_project_id, :target_branch, :milestone_id, - :state_event, :description, :label_list - attr_accessor :should_remove_source_branch # When this attribute is true some MR validation is ignored # It allows us to close or modify broken merge requests attr_accessor :allow_broken - ActsAsTaggableOn.strict_case_match = true - acts_as_taggable_on :labels + # Temporary fields to store compare vars + # when creating new merge request + attr_accessor :can_be_created, :compare_failed, + :compare_commits, :compare_diffs state_machine :state, initial: :opened do event :close do @@ -62,11 +60,11 @@ class MergeRequest < ActiveRecord::Base transition closed: :reopened end - event :lock do + event :lock_mr do transition [:reopened, :opened] => :locked end - event :unlock do + event :unlock_mr do transition locked: :reopened end @@ -286,9 +284,7 @@ class MergeRequest < ActiveRecord::Base # Thus it will automatically generate a new fragment # when the event is updated because the key changes. def reset_events_cache - Event.where(target_id: self.id, target_type: 'MergeRequest'). - order('id DESC').limit(100). - update_all(updated_at: Time.now) + Event.reset_event_cache_for(self) end def merge_commit_message @@ -297,6 +293,8 @@ class MergeRequest < ActiveRecord::Base message << title.to_s message << "\n\n" message << description.to_s + message << "\n\n" + message << "See merge request !#{iid}" message end diff --git a/app/models/merge_request_diff.rb b/app/models/merge_request_diff.rb index 7dce71a677b..248fa18353e 100644 --- a/app/models/merge_request_diff.rb +++ b/app/models/merge_request_diff.rb @@ -22,8 +22,6 @@ class MergeRequestDiff < ActiveRecord::Base belongs_to :merge_request - attr_accessible :state, :st_commits, :st_diffs - delegate :target_branch, :source_branch, to: :merge_request, prefix: nil state_machine :state, initial: :empty do @@ -85,11 +83,7 @@ class MergeRequestDiff < ActiveRecord::Base # Collect array of Git::Commit objects # between target and source branches def unmerged_commits - commits = if merge_request.for_fork? - compare_action.commits - else - repository.commits_between(target_branch, source_branch) - end + commits = compare_result.commits if commits.present? commits = Commit.decorate(commits). @@ -149,12 +143,7 @@ class MergeRequestDiff < ActiveRecord::Base # Collect array of Git::Diff objects # between target and source branches def unmerged_diffs - diffs = if merge_request.for_fork? - compare_action.diffs - else - Gitlab::Git::Diff.between(repository, source_branch, target_branch) - end - + diffs = compare_result.diffs diffs ||= [] diffs rescue Gitlab::Git::Diff::TimeoutError => ex @@ -168,13 +157,13 @@ class MergeRequestDiff < ActiveRecord::Base private - def compare_action - Gitlab::Satellite::CompareAction.new( + def compare_result + @compare_result ||= CompareService.new.execute( merge_request.author, + merge_request.source_project, + merge_request.source_branch, merge_request.target_project, merge_request.target_branch, - merge_request.source_project, - merge_request.source_branch ) end end diff --git a/app/models/milestone.rb b/app/models/milestone.rb index 39ab0b536a3..8fd3e56d2ee 100644 --- a/app/models/milestone.rb +++ b/app/models/milestone.rb @@ -16,8 +16,6 @@ class Milestone < ActiveRecord::Base include InternalId - attr_accessible :title, :description, :due_date, :state_event - belongs_to :project has_many :issues has_many :merge_requests diff --git a/app/models/namespace.rb b/app/models/namespace.rb index 446e5f04c63..b19b72906e7 100644 --- a/app/models/namespace.rb +++ b/app/models/namespace.rb @@ -16,8 +16,6 @@ class Namespace < ActiveRecord::Base include Gitlab::ShellAdapter - attr_accessible :name, :description, :path - has_many :projects, dependent: :destroy belongs_to :owner, class_name: "User" @@ -25,12 +23,12 @@ class Namespace < ActiveRecord::Base validates :name, presence: true, uniqueness: true, length: { within: 0..255 }, format: { with: Gitlab::Regex.name_regex, - message: "only letters, digits, spaces & '_' '-' '.' allowed." } + message: Gitlab::Regex.name_regex_message } validates :description, length: { within: 0..255 } validates :path, uniqueness: { case_sensitive: false }, presence: true, length: { within: 1..255 }, exclusion: { in: Gitlab::Blacklist.path }, format: { with: Gitlab::Regex.path_regex, - message: "only letters, digits & '_' '-' '.' allowed. Letter should be first" } + message: Gitlab::Regex.path_regex_message } delegate :name, to: :owner, allow_nil: true, prefix: true diff --git a/app/models/note.rb b/app/models/note.rb index 94d45aa43db..7ff6444cc9b 100644 --- a/app/models/note.rb +++ b/app/models/note.rb @@ -25,8 +25,6 @@ class Note < ActiveRecord::Base default_value_for :system, false - attr_accessible :note, :noteable, :noteable_id, :noteable_type, :project_id, - :attachment, :line_code, :commit_id attr_mentionable :note belongs_to :project @@ -63,13 +61,13 @@ class Note < ActiveRecord::Base def create_status_change_note(noteable, project, author, status, source) body = "_Status changed to #{status}#{' by ' + source.gfm_reference if source}_" - create({ + create( noteable: noteable, project: project, author: author, note: body, system: true - }, without_protection: true) + ) end # +noteable+ was referenced from +mentioner+, by including GFM in either +mentioner+'s description or an associated Note. @@ -88,7 +86,7 @@ class Note < ActiveRecord::Base note_options.merge!(noteable: noteable) end - create(note_options, without_protection: true) + create(note_options) end def create_milestone_change_note(noteable, project, author, milestone) @@ -98,13 +96,13 @@ class Note < ActiveRecord::Base "_Milestone changed to #{milestone.title}_" end - create({ + create( noteable: noteable, project: project, author: author, note: body, system: true - }, without_protection: true) + ) end def create_assignee_change_note(noteable, project, author, assignee) @@ -116,7 +114,7 @@ class Note < ActiveRecord::Base author: author, note: body, system: true - }, without_protection: true) + }) end def discussions_from_notes(notes) @@ -329,9 +327,7 @@ class Note < ActiveRecord::Base # Thus it will automatically generate a new fragment # when the event is updated because the key changes. def reset_events_cache - Event.where(target_id: self.id, target_type: 'Note'). - order('id DESC').limit(100). - update_all(updated_at: Time.now) + Event.reset_event_cache_for(self) end def set_references diff --git a/app/models/project.rb b/app/models/project.rb index 762b540b7a3..0e93e32162d 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -22,29 +22,26 @@ # visibility_level :integer default(0), not null # archived :boolean default(FALSE), not null # import_status :string(255) +# star_count :integer # class Project < ActiveRecord::Base include Gitlab::ShellAdapter include Gitlab::VisibilityLevel + include Gitlab::ConfigHelper + extend Gitlab::ConfigHelper extend Enumerize default_value_for :archived, false - default_value_for :issues_enabled, true - default_value_for :merge_requests_enabled, true - default_value_for :wiki_enabled, true + default_value_for :visibility_level, gitlab_config_features.visibility_level + default_value_for :issues_enabled, gitlab_config_features.issues + default_value_for :merge_requests_enabled, gitlab_config_features.merge_requests + default_value_for :wiki_enabled, gitlab_config_features.wiki default_value_for :wall_enabled, false - default_value_for :snippets_enabled, true + default_value_for :snippets_enabled, gitlab_config_features.snippets ActsAsTaggableOn.strict_case_match = true - - attr_accessible :name, :path, :description, :issues_tracker, :label_list, - :issues_enabled, :merge_requests_enabled, :snippets_enabled, :issues_tracker_id, - :wiki_enabled, :visibility_level, :import_url, :last_activity_at, as: [:default, :admin] - - attr_accessible :namespace_id, :creator_id, as: :admin - - acts_as_taggable_on :labels, :issues_default_labels + acts_as_taggable_on :tags attr_accessor :new_default_branch @@ -73,6 +70,7 @@ class Project < ActiveRecord::Base # Merge requests from source project should be kept when source project was removed has_many :fork_merge_requests, foreign_key: "source_project_id", class_name: MergeRequest has_many :issues, -> { order "state DESC, created_at DESC" }, dependent: :destroy + has_many :labels, dependent: :destroy has_many :services, dependent: :destroy has_many :events, dependent: :destroy has_many :milestones, dependent: :destroy @@ -84,6 +82,8 @@ class Project < ActiveRecord::Base has_many :users, through: :users_projects has_many :deploy_keys_projects, dependent: :destroy has_many :deploy_keys, through: :deploy_keys_projects + has_many :users_star_projects, dependent: :destroy + has_many :starrers, through: :users_star_projects, source: :user delegate :name, to: :owner, allow_nil: true, prefix: true delegate :members, to: :team, prefix: true @@ -93,13 +93,16 @@ class Project < ActiveRecord::Base validates :description, length: { maximum: 2000 }, allow_blank: true validates :name, presence: true, length: { within: 0..255 }, format: { with: Gitlab::Regex.project_name_regex, - message: "only letters, digits, spaces & '_' '-' '.' allowed. Letter or digit should be first" } + message: Gitlab::Regex.project_regex_message } validates :path, presence: true, length: { within: 0..255 }, exclusion: { in: Gitlab::Blacklist.path }, format: { with: Gitlab::Regex.path_regex, - message: "only letters, digits & '_' '-' '.' allowed. Letter or digit should be first" } + message: Gitlab::Regex.path_regex_message } validates :issues_enabled, :merge_requests_enabled, :wiki_enabled, inclusion: { in: [true, false] } + validates :visibility_level, + exclusion: { in: gitlab_config.restricted_visibility_levels }, + if: -> { gitlab_config.restricted_visibility_levels.any? } validates :issues_tracker_id, length: { maximum: 255 }, allow_blank: true validates :namespace, presence: true validates_uniqueness_of :name, scope: :namespace_id @@ -107,6 +110,7 @@ class Project < ActiveRecord::Base validates :import_url, format: { with: URI::regexp(%w(git http https)), message: "should be a valid url" }, if: :import? + validates :star_count, numericality: { greater_than_or_equal_to: 0 } validate :check_limit, on: :create # Scopes @@ -243,7 +247,7 @@ class Project < ActiveRecord::Base end def check_limit - unless creator.can_create_project? + unless creator.can_create_project? or namespace.kind == 'group' errors[:limit_reached] << ("Your project limit is #{creator.projects_limit} projects! Please contact your administrator to increase it") end rescue @@ -255,7 +259,7 @@ class Project < ActiveRecord::Base end def web_url - [Gitlab.config.gitlab.url, path_with_namespace].join("/") + [gitlab_config.url, path_with_namespace].join("/") end def web_url_without_protocol @@ -278,13 +282,6 @@ class Project < ActiveRecord::Base self.id end - # Tags are shared by issues and merge requests - def issues_labels - @issues_labels ||= (issues_default_labels + - merge_requests.tags_on(:labels) + - issues.tags_on(:labels)).uniq.sort_by(&:name) - end - def issue_exists?(issue_id) if used_default_issues_tracker? self.issues.where(iid: issue_id).first.present? @@ -391,7 +388,11 @@ class Project < ActiveRecord::Base services.each do |service| # Call service hook only if it is active - service.execute(data) if service.active + begin + service.execute(data) if service.active + rescue => e + logger.error(e) + end end end @@ -476,7 +477,7 @@ class Project < ActiveRecord::Base end def http_url_to_repo - [Gitlab.config.gitlab.url, "/", path_with_namespace, ".git"].join('') + [gitlab_config.url, "/", path_with_namespace, ".git"].join('') end # Check if current branch name is marked as protected in the system @@ -571,4 +572,8 @@ class Project < ActiveRecord::Base def update_repository_size update_attribute(:repository_size, repository.size) end + + def forks_count + ForkedProjectLink.where(forked_from_project_id: self.id).count + end end diff --git a/app/models/project_hook.rb b/app/models/project_hook.rb index 6db6767a88d..21867a9316c 100644 --- a/app/models/project_hook.rb +++ b/app/models/project_hook.rb @@ -18,8 +18,6 @@ class ProjectHook < WebHook belongs_to :project - attr_accessible :push_events, :issues_events, :merge_requests_events, :tag_push_events - scope :push_hooks, -> { where(push_events: true) } scope :tag_push_hooks, -> { where(tag_push_events: true) } scope :issue_hooks, -> { where(issues_events: true) } diff --git a/app/models/project_services/assembla_service.rb b/app/models/project_services/assembla_service.rb index 06e9d6118d2..9a8cbb32ac1 100644 --- a/app/models/project_services/assembla_service.rb +++ b/app/models/project_services/assembla_service.rb @@ -18,8 +18,6 @@ # class AssemblaService < Service - attr_accessible :subdomain - include HTTParty validates :token, presence: true, if: :activated? diff --git a/app/models/project_services/campfire_service.rb b/app/models/project_services/campfire_service.rb index 19030ecffa2..83e1bac1ef2 100644 --- a/app/models/project_services/campfire_service.rb +++ b/app/models/project_services/campfire_service.rb @@ -18,8 +18,6 @@ # class CampfireService < Service - attr_accessible :subdomain, :room - validates :token, presence: true, if: :activated? def title diff --git a/app/models/project_services/emails_on_push_service.rb b/app/models/project_services/emails_on_push_service.rb index 04775c4f2b2..be5bab4ec32 100644 --- a/app/models/project_services/emails_on_push_service.rb +++ b/app/models/project_services/emails_on_push_service.rb @@ -18,8 +18,6 @@ # class EmailsOnPushService < Service - attr_accessible :recipients - validates :recipients, presence: true, if: :activated? def title diff --git a/app/models/project_services/gitlab_ci_service.rb b/app/models/project_services/gitlab_ci_service.rb index ef395e0ec68..58ddce45288 100644 --- a/app/models/project_services/gitlab_ci_service.rb +++ b/app/models/project_services/gitlab_ci_service.rb @@ -18,8 +18,6 @@ # class GitlabCiService < CiService - attr_accessible :project_url - validates :project_url, presence: true, if: :activated? validates :token, presence: true, if: :activated? diff --git a/app/models/project_services/hipchat_service.rb b/app/models/project_services/hipchat_service.rb index d62f61856d1..9c6fe7dab21 100644 --- a/app/models/project_services/hipchat_service.rb +++ b/app/models/project_services/hipchat_service.rb @@ -18,8 +18,6 @@ # class HipchatService < Service - attr_accessible :room - validates :token, presence: true, if: :activated? def title diff --git a/app/models/project_services/slack_service.rb b/app/models/project_services/slack_service.rb index 50fd62def1d..7e54188abf7 100644 --- a/app/models/project_services/slack_service.rb +++ b/app/models/project_services/slack_service.rb @@ -18,9 +18,6 @@ # class SlackService < Service - attr_accessible :room - attr_accessible :subdomain - validates :room, presence: true, if: :activated? validates :subdomain, presence: true, if: :activated? validates :token, presence: true, if: :activated? diff --git a/app/models/project_wiki.rb b/app/models/project_wiki.rb index 08a52782475..a8ba5efcc7c 100644 --- a/app/models/project_wiki.rb +++ b/app/models/project_wiki.rb @@ -72,6 +72,15 @@ class ProjectWiki end end + def find_file(name, version = nil, try_on_disk = true) + version = wiki.ref if version.nil? # Gollum::Wiki#file ? + if wiki_file = wiki.file(name, version, try_on_disk) + wiki_file + else + nil + end + end + def create_page(title, content, format = :markdown, message = nil) commit = commit_details(:created, message, title) diff --git a/app/models/protected_branch.rb b/app/models/protected_branch.rb index d2b2b1218d1..1b06dd77523 100644 --- a/app/models/protected_branch.rb +++ b/app/models/protected_branch.rb @@ -12,8 +12,6 @@ class ProtectedBranch < ActiveRecord::Base include Gitlab::ShellAdapter - attr_accessible :name - belongs_to :project validates :name, presence: true validates :project, presence: true diff --git a/app/models/repository.rb b/app/models/repository.rb index 22c16abe480..d9b0d1fbe22 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -134,7 +134,7 @@ class Repository def graph_log Rails.cache.fetch(cache_key(:graph_log)) do - stats = Gitlab::Git::GitStats.new(raw, root_ref) + stats = Gitlab::Git::GitStats.new(raw, root_ref, Gitlab.config.git.timeout) stats.parsed_log end end @@ -242,4 +242,41 @@ class Repository branches end end + + def contributors + log = graph_log.group_by { |i| i[:author_email] } + + log.map do |email, contributions| + contributor = Gitlab::Contributor.new + contributor.email = email + + contributions.each do |contribution| + if contributor.name.blank? + contributor.name = contribution[:author_name] + end + + contributor.commits += 1 + contributor.additions += contribution[:additions] || 0 + contributor.deletions += contribution[:deletions] || 0 + end + + contributor + end + end + + def blob_for_diff(commit, diff) + file = blob_at(commit.id, diff.new_path) + + unless file + file = prev_blob_for_diff(commit, diff) + end + + file + end + + def prev_blob_for_diff(commit, diff) + if commit.parent_id + blob_at(commit.parent_id, diff.old_path) + end + end end diff --git a/app/models/service.rb b/app/models/service.rb index d655937079d..0dc6d514b46 100644 --- a/app/models/service.rb +++ b/app/models/service.rb @@ -22,8 +22,6 @@ class Service < ActiveRecord::Base default_value_for :active, false - attr_accessible :title, :token, :type, :active, :api_key - belongs_to :project has_one :service_hook diff --git a/app/models/snippet.rb b/app/models/snippet.rb index 9e4409daa1a..2c38e7939bd 100644 --- a/app/models/snippet.rb +++ b/app/models/snippet.rb @@ -18,8 +18,6 @@ class Snippet < ActiveRecord::Base include Linguist::BlobHelper - attr_accessible :title, :content, :file_name, :expires_at, :private - default_value_for :private, true belongs_to :author, class_name: "User" diff --git a/app/models/user.rb b/app/models/user.rb index 63d819a0f36..9ab3ea025c3 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -50,31 +50,25 @@ require 'carrierwave/orm/activerecord' require 'file_size_validator' class User < ActiveRecord::Base + include Gitlab::ConfigHelper + extend Gitlab::ConfigHelper + include TokenAuthenticatable + default_value_for :admin, false - default_value_for :can_create_group, true + default_value_for :can_create_group, gitlab_config.default_can_create_group default_value_for :can_create_team, false default_value_for :hide_no_ssh_key, false + default_value_for :projects_limit, gitlab_config.default_projects_limit + default_value_for :theme_id, gitlab_config.default_theme - devise :database_authenticatable, :token_authenticatable, :lockable, :async, + devise :database_authenticatable, :lockable, :async, :recoverable, :rememberable, :trackable, :validatable, :omniauthable, :confirmable, :registerable - attr_accessible :email, :password, :password_confirmation, :remember_me, :bio, :name, :username, - :skype, :linkedin, :twitter, :website_url, :color_scheme_id, :theme_id, :force_random_password, - :extern_uid, :provider, :password_expires_at, :avatar, :hide_no_ssh_key, - as: [:default, :admin] - - attr_accessible :projects_limit, :can_create_group, - as: :admin - attr_accessor :force_random_password # Virtual attribute for authenticating by either username or email attr_accessor :login - # Add login to attr_accessible - attr_accessible :login - - # # Relations # @@ -97,6 +91,8 @@ class User < ActiveRecord::Base has_many :personal_projects, through: :namespace, source: :projects has_many :projects, through: :users_projects has_many :created_projects, foreign_key: :creator_id, class_name: 'Project' + has_many :users_star_projects, dependent: :destroy + has_many :starred_projects, through: :users_star_projects, source: :project has_many :snippets, dependent: :destroy, foreign_key: :author_id, class_name: "Snippet" has_many :users_projects, dependent: :destroy @@ -120,7 +116,7 @@ class User < ActiveRecord::Base validates :username, presence: true, uniqueness: { case_sensitive: false }, exclusion: { in: Gitlab::Blacklist.path }, format: { with: Gitlab::Regex.username_regex, - message: "only letters, digits & '_' '-' '.' allowed. Letter should be first" } + message: Gitlab::Regex.username_regex_message } validates :notification_level, inclusion: { in: Notification.notification_levels }, presence: true validate :namespace_uniq, if: ->(user) { user.username_changed? } @@ -223,20 +219,8 @@ class User < ActiveRecord::Base where('users.username = ? OR users.id = ?', name_or_id.to_s, name_or_id.to_i).first end - def build_user(attrs = {}, options= {}) - if options[:as] == :admin - User.new(defaults.merge(attrs.symbolize_keys), options) - else - User.new(attrs, options).with_defaults - end - end - - def defaults - { - projects_limit: Gitlab.config.gitlab.default_projects_limit, - can_create_group: Gitlab.config.gitlab.default_can_create_group, - theme_id: Gitlab.config.gitlab.default_theme - } + def build_user(attrs = {}) + User.new(attrs) end end @@ -258,6 +242,15 @@ class User < ActiveRecord::Base end end + def generate_reset_token + @reset_token, enc = Devise.token_generator.generate(self.class, :reset_password_token) + + self.reset_password_token = enc + self.reset_password_sent_at = Time.now.utc + + @reset_token + end + def namespace_uniq namespace_name = self.username if Namespace.find_by(path: namespace_name) @@ -314,7 +307,7 @@ class User < ActiveRecord::Base end def can_change_username? - Gitlab.config.gitlab.username_changing_enabled + gitlab_config.username_changing_enabled end def can_create_project? @@ -489,7 +482,7 @@ class User < ActiveRecord::Base def avatar_url(size = nil) if avatar.present? - URI::join(Gitlab.config.gitlab.url, avatar.url).to_s + [gitlab_config.url, avatar.url].join("/") else GravatarService.new.execute(email, size) end @@ -506,7 +499,7 @@ class User < ActiveRecord::Base def post_create_hook log_info("User \"#{self.name}\" (#{self.email}) was created") - notification_service.new_user(self) + notification_service.new_user(self, @reset_token) system_hook_service.execute_hooks_for(self, :create) end @@ -526,4 +519,18 @@ class User < ActiveRecord::Base def system_hook_service SystemHooksService.new end + + def starred?(project) + starred_projects.exists?(project) + end + + def toggle_star(project) + user_star_project = users_star_projects. + where(project: project, user: self).take + if user_star_project + user_star_project.destroy + else + UsersStarProject.create!(project: project, user: self) + end + end end diff --git a/app/models/users_group.rb b/app/models/users_group.rb index 242c8abb3ca..270f968ef61 100644 --- a/app/models/users_group.rb +++ b/app/models/users_group.rb @@ -19,8 +19,6 @@ class UsersGroup < ActiveRecord::Base Gitlab::Access.options_with_owner end - attr_accessible :group_access, :user_id - belongs_to :user belongs_to :group diff --git a/app/models/users_project.rb b/app/models/users_project.rb index 6495bed4e61..60bdf7a3cfb 100644 --- a/app/models/users_project.rb +++ b/app/models/users_project.rb @@ -16,8 +16,6 @@ class UsersProject < ActiveRecord::Base include Notifiable include Gitlab::Access - attr_accessible :user, :user_id, :project_access - belongs_to :user belongs_to :project @@ -126,7 +124,7 @@ class UsersProject < ActiveRecord::Base author_id: self.user.id ) - notification_service.new_team_member(self) + notification_service.new_team_member(self) unless owner? system_hook_service.execute_hooks_for(self, :create) end diff --git a/app/models/users_star_project.rb b/app/models/users_star_project.rb new file mode 100644 index 00000000000..80e756bd00c --- /dev/null +++ b/app/models/users_star_project.rb @@ -0,0 +1,19 @@ +# == Schema Information +# +# Table name: users_star_projects +# +# id :integer not null, primary key +# starrer_id :integer not null +# project_id :integer not null +# created_at :datetime +# updated_at :datetime +# + +class UsersStarProject < ActiveRecord::Base + belongs_to :project, counter_cache: :star_count + belongs_to :user + + validates :user, presence: true + validates :user_id, uniqueness: { scope: [:project_id] } + validates :project, presence: true +end diff --git a/app/models/web_hook.rb b/app/models/web_hook.rb index 76854da5c38..6cf0c1f683e 100644 --- a/app/models/web_hook.rb +++ b/app/models/web_hook.rb @@ -22,8 +22,6 @@ class WebHook < ActiveRecord::Base default_value_for :issues_events, false default_value_for :merge_requests_events, false - attr_accessible :url - # HTTParty timeout default_timeout 10 diff --git a/app/services/compare_service.rb b/app/services/compare_service.rb new file mode 100644 index 00000000000..c5e04702914 --- /dev/null +++ b/app/services/compare_service.rb @@ -0,0 +1,27 @@ +# Compare 2 branches for one repo or between repositories +# and return Gitlab::CompareResult object that responds to commits and diffs +class CompareService + def execute(current_user, source_project, source_branch, target_project, target_branch) + # Try to compare branches to get commits list and diffs + # + # Note: Use satellite only when need to compare between to repos + # because satellites are slower then operations on bare repo + if target_project == source_project + Gitlab::CompareResult.new( + Gitlab::Git::Compare.new( + target_project.repository.raw_repository, + target_branch, + source_branch, + ) + ) + else + Gitlab::Satellite::CompareAction.new( + current_user, + target_project, + target_branch, + source_project, + source_branch + ).result + end + end +end diff --git a/app/services/files/create_service.rb b/app/services/files/create_service.rb index 1998fb79e7d..82e4d7b684f 100644 --- a/app/services/files/create_service.rb +++ b/app/services/files/create_service.rb @@ -21,7 +21,10 @@ module Files file_path = path unless file_name =~ Gitlab::Regex.path_regex - return error("Your changes could not be committed, because file name contains not allowed characters") + return error( + 'Your changes could not be committed, because the file name ' + + Gitlab::Regex.path_regex_message + ) end blob = repository.blob_at_branch(ref, file_path) diff --git a/app/services/issues/create_service.rb b/app/services/issues/create_service.rb index 6d05d417f1b..d5c17906a55 100644 --- a/app/services/issues/create_service.rb +++ b/app/services/issues/create_service.rb @@ -1,10 +1,12 @@ module Issues class CreateService < Issues::BaseService def execute - issue = project.issues.new(params) + label_params = params[:label_ids] + issue = project.issues.new(params.except(:label_ids)) issue.author = current_user if issue.save + issue.update_attributes(label_ids: label_params) notification_service.new_issue(issue, current_user) event_service.open_issue(issue, current_user) issue.create_cross_references!(issue.project, current_user) diff --git a/app/services/issues/reopen_service.rb b/app/services/issues/reopen_service.rb index b23d56258a8..1e5c398516d 100644 --- a/app/services/issues/reopen_service.rb +++ b/app/services/issues/reopen_service.rb @@ -4,6 +4,7 @@ module Issues if issue.reopen event_service.reopen_issue(issue, current_user) create_note(issue) + notification_service.reopen_issue(issue, current_user) execute_hooks(issue, 'reopen') end diff --git a/app/services/issues/update_service.rb b/app/services/issues/update_service.rb index 169e1e95b4b..a0e57144435 100644 --- a/app/services/issues/update_service.rb +++ b/app/services/issues/update_service.rb @@ -1,7 +1,7 @@ module Issues class UpdateService < Issues::BaseService def execute(issue) - state = params.delete('state_event') || params.delete(:state_event) + state = params[:state_event] case state when 'reopen' @@ -10,7 +10,7 @@ module Issues Issues::CloseService.new(project, current_user, {}).execute(issue) end - if params.present? && issue.update_attributes(params) + if params.present? && issue.update_attributes(params.except(:state_event)) issue.reset_events_cache if issue.previous_changes.include?('milestone_id') diff --git a/app/services/merge_requests/auto_merge_service.rb b/app/services/merge_requests/auto_merge_service.rb index e35c03275f2..20b88d1510c 100644 --- a/app/services/merge_requests/auto_merge_service.rb +++ b/app/services/merge_requests/auto_merge_service.rb @@ -6,7 +6,7 @@ module MergeRequests # Called when you do merge via GitLab UI class AutoMergeService < BaseMergeService def execute(merge_request, current_user, commit_message) - merge_request.lock + merge_request.lock_mr if Gitlab::Satellite::MergeAction.new(current_user, merge_request).merge!(commit_message) merge_request.merge @@ -17,11 +17,11 @@ module MergeRequests true else - merge_request.unlock + merge_request.unlock_mr false end rescue - merge_request.unlock if merge_request.locked? + merge_request.unlock_mr if merge_request.locked? merge_request.mark_as_unmergeable false end diff --git a/app/services/merge_requests/build_service.rb b/app/services/merge_requests/build_service.rb new file mode 100644 index 00000000000..1475973e543 --- /dev/null +++ b/app/services/merge_requests/build_service.rb @@ -0,0 +1,68 @@ +module MergeRequests + class BuildService < MergeRequests::BaseService + def execute + merge_request = MergeRequest.new(params) + + # Set MR attributes + merge_request.can_be_created = false + merge_request.compare_failed = false + merge_request.compare_commits = [] + merge_request.compare_diffs = [] + merge_request.source_project = project unless merge_request.source_project + merge_request.target_project ||= (project.forked_from_project || project) + merge_request.target_branch ||= merge_request.target_project.default_branch + + unless merge_request.target_branch && merge_request.source_branch + return build_failed(merge_request, "You must select source and target branches") + end + + # Generate suggested MR title based on source branch name + merge_request.title = merge_request.source_branch.titleize.humanize + + compare_result = CompareService.new.execute( + current_user, + merge_request.source_project, + merge_request.source_branch, + merge_request.target_project, + merge_request.target_branch, + ) + + commits = compare_result.commits + + # At this point we decide if merge request can be created + # If we have at least one commit to merge -> creation allowed + if commits.present? + merge_request.compare_commits = Commit.decorate(commits) + merge_request.can_be_created = true + merge_request.compare_failed = false + + # Try to collect diff for merge request. + diffs = compare_result.diffs + + if diffs.present? + merge_request.compare_diffs = diffs + + elsif diffs == false + # satellite timeout return false + merge_request.can_be_created = false + merge_request.compare_failed = true + end + else + merge_request.can_be_created = false + merge_request.compare_failed = false + end + + merge_request + + rescue Gitlab::Satellite::BranchesWithoutParent + return build_failed(merge_request, "Selected branches have no common commit so they cannot be merged.") + end + + def build_failed(merge_request, message) + merge_request.errors.add(:base, message) + merge_request.compare_commits = [] + merge_request.can_be_created = false + merge_request + end + end +end diff --git a/app/services/merge_requests/create_service.rb b/app/services/merge_requests/create_service.rb index d1bf827f3fc..ca8d80f6c0c 100644 --- a/app/services/merge_requests/create_service.rb +++ b/app/services/merge_requests/create_service.rb @@ -1,12 +1,14 @@ module MergeRequests class CreateService < MergeRequests::BaseService def execute - merge_request = MergeRequest.new(params) + label_params = params[:label_ids] + merge_request = MergeRequest.new(params.except(:label_ids)) merge_request.source_project = project merge_request.target_project ||= project merge_request.author = current_user if merge_request.save + merge_request.update_attributes(label_ids: label_params) event_service.open_mr(merge_request, current_user) notification_service.new_merge_request(merge_request, current_user) merge_request.create_cross_references!(merge_request.project, current_user) diff --git a/app/services/merge_requests/reopen_service.rb b/app/services/merge_requests/reopen_service.rb index 2eb13d3e0e1..bd68919a550 100644 --- a/app/services/merge_requests/reopen_service.rb +++ b/app/services/merge_requests/reopen_service.rb @@ -3,6 +3,7 @@ module MergeRequests def execute(merge_request) if merge_request.reopen event_service.reopen_mr(merge_request, current_user) + notification_service.reopen_mr(merge_request, current_user) create_note(merge_request) execute_hooks(merge_request) merge_request.reload_code diff --git a/app/services/merge_requests/update_service.rb b/app/services/merge_requests/update_service.rb index f1aa8b73930..6e416a0080c 100644 --- a/app/services/merge_requests/update_service.rb +++ b/app/services/merge_requests/update_service.rb @@ -7,10 +7,10 @@ module MergeRequests def execute(merge_request) # We dont allow change of source/target projects # after merge request was created - params.delete(:source_project_id) - params.delete(:target_project_id) + params.except!(:source_project_id) + params.except!(:target_project_id) - state = params.delete('state_event') || params.delete(:state_event) + state = params[:state_event] case state when 'reopen' @@ -19,7 +19,7 @@ module MergeRequests MergeRequests::CloseService.new(project, current_user, {}).execute(merge_request) end - if params.present? && merge_request.update_attributes(params) + if params.present? && merge_request.update_attributes(params.except(:state_event)) merge_request.reset_events_cache if merge_request.previous_changes.include?('milestone_id') diff --git a/app/services/milestones/group_service.rb b/app/services/milestones/group_service.rb new file mode 100644 index 00000000000..11d702f1e7b --- /dev/null +++ b/app/services/milestones/group_service.rb @@ -0,0 +1,26 @@ +module Milestones + class GroupService < Milestones::BaseService + def initialize(project_milestones) + @project_milestones = project_milestones.group_by(&:title) + end + + def execute + build(@project_milestones) + end + + def milestone(title) + if title + group_milestone = @project_milestones[title].group_by(&:title) + build(group_milestone).first + else + nil + end + end + + private + + def build(milestone) + milestone.map{ |title, milestones| GroupMilestone.new(title, milestones) } + end + end +end diff --git a/app/services/milestones/update_service.rb b/app/services/milestones/update_service.rb index 307e96a2b36..ed64847f429 100644 --- a/app/services/milestones/update_service.rb +++ b/app/services/milestones/update_service.rb @@ -1,7 +1,7 @@ module Milestones class UpdateService < Milestones::BaseService def execute(milestone) - state = params.delete('state_event') || params.delete(:state_event) + state = params[:state_event] case state when 'activate' @@ -11,7 +11,7 @@ module Milestones end if params.present? - milestone.update_attributes(params) + milestone.update_attributes(params.except(:state_event)) end milestone diff --git a/app/services/notification_service.rb b/app/services/notification_service.rb index 650b6008db8..36d33e0d7ca 100644 --- a/app/services/notification_service.rb +++ b/app/services/notification_service.rb @@ -80,6 +80,10 @@ class NotificationService close_resource_email(merge_request, merge_request.target_project, current_user, 'closed_merge_request_email') end + def reopen_issue(issue, current_user) + reopen_resource_email(issue, issue.project, current_user, 'issue_status_changed_email', 'reopened') + end + # When we merge a merge request we should send next emails: # # * merge_request author if their notification level is not Disabled @@ -89,16 +93,21 @@ class NotificationService def merge_mr(merge_request, current_user) recipients = reject_muted_users([merge_request.author, merge_request.assignee], merge_request.target_project) recipients = recipients.concat(project_watchers(merge_request.target_project)).uniq + recipients.delete(current_user) recipients.each do |recipient| mailer.merged_merge_request_email(recipient.id, merge_request.id, current_user.id) end end + def reopen_mr(merge_request, current_user) + reopen_resource_email(merge_request, merge_request.target_project, current_user, 'merge_request_status_email', 'reopened') + end + # Notify new user with email after creation - def new_user(user) + def new_user(user, token = nil) # Don't email omniauth created users - mailer.new_user_email(user.id, user.password) unless user.extern_uid? + mailer.new_user_email(user.id, user.password, token) unless user.extern_uid? end # Notify users on new note in system @@ -301,7 +310,9 @@ class NotificationService end def reassign_resource_email(target, project, current_user, method) - recipients = User.where(id: [target.assignee_id, target.assignee_id_was]) + assignee_id_was = previous_record(target, "assignee_id") + + recipients = User.where(id: [target.assignee_id, assignee_id_was]) # Add watchers to email list recipients = recipients.concat(project_watchers(project)) @@ -313,11 +324,29 @@ class NotificationService recipients.delete(current_user) recipients.each do |recipient| - mailer.send(method, recipient.id, target.id, target.assignee_id_was, current_user.id) + mailer.send(method, recipient.id, target.id, assignee_id_was, current_user.id) + end + end + + def reopen_resource_email(target, project, current_user, method, status) + recipients = reject_muted_users([target.author, target.assignee], project) + recipients = recipients.concat(project_watchers(project)).uniq + recipients.delete(current_user) + + recipients.each do |recipient| + mailer.send(method, recipient.id, target.id, status, current_user.id) end end def mailer Notify.delay end + + def previous_record(object, attribute) + if object && attribute + if object.previous_changes.include?(attribute) + object.previous_changes[attribute].first + end + end + end end diff --git a/app/services/projects/create_service.rb b/app/services/projects/create_service.rb index dfadcfd296a..3565e4e4f70 100644 --- a/app/services/projects/create_service.rb +++ b/app/services/projects/create_service.rb @@ -5,27 +5,13 @@ module Projects end def execute - # get namespace id - namespace_id = params.delete(:namespace_id) + @project = Project.new(params) - # check that user is allowed to set specified visibility_level + # Reset visibility levet if is not allowed to set it unless Gitlab::VisibilityLevel.allowed_for?(current_user, params[:visibility_level]) - params.delete(:visibility_level) + @project.visibility_level = default_features.visibility_level end - # Load default feature settings - default_features = Gitlab.config.gitlab.default_projects_features - - default_opts = { - issues_enabled: default_features.issues, - wiki_enabled: default_features.wiki, - snippets_enabled: default_features.snippets, - merge_requests_enabled: default_features.merge_requests, - visibility_level: default_features.visibility_level - }.stringify_keys - - @project = Project.new(default_opts.merge(params)) - # Parametrize path for project # # Ex. @@ -33,13 +19,14 @@ module Projects # @project.path = @project.name.dup.parameterize unless @project.path.present? + # get namespace id + namespace_id = params[:namespace_id] if namespace_id # Find matching namespace and check if it allowed # for current user if namespace_id passed. - if allowed_namespace?(current_user, namespace_id) - @project.namespace_id = namespace_id - else + unless allowed_namespace?(current_user, namespace_id) + @project.namespace_id = nil deny_namespace return @project end diff --git a/app/services/projects/transfer_service.rb b/app/services/projects/transfer_service.rb index d115e92a105..e39fe882cb1 100644 --- a/app/services/projects/transfer_service.rb +++ b/app/services/projects/transfer_service.rb @@ -12,7 +12,7 @@ module Projects class TransferError < StandardError; end def execute - namespace_id = params.delete(:namespace_id) + namespace_id = params[:namespace_id] namespace = Namespace.find_by(id: namespace_id) if allowed_transfer?(current_user, project, namespace) diff --git a/app/services/projects/update_service.rb b/app/services/projects/update_service.rb index 551a3653cad..36877a61679 100644 --- a/app/services/projects/update_service.rb +++ b/app/services/projects/update_service.rb @@ -1,23 +1,18 @@ module Projects class UpdateService < BaseService - def execute(role = :default) - params[:project].delete(:namespace_id) + def execute # check that user is allowed to set specified visibility_level - unless can?(current_user, :change_visibility_level, project) && Gitlab::VisibilityLevel.allowed_for?(current_user, params[:project][:visibility_level]) - params[:project].delete(:visibility_level) + unless can?(current_user, :change_visibility_level, project) && Gitlab::VisibilityLevel.allowed_for?(current_user, params[:visibility_level]) + params[:visibility_level] = project.visibility_level end - new_branch = params[:project].delete(:default_branch) + new_branch = params[:default_branch] if project.repository.exists? && new_branch && new_branch != project.default_branch project.change_head(new_branch) end - if project.update_attributes(params[:project], as: role) - if project.previous_changes.include?('namespace_id') - project.send_move_instructions - end - + if project.update_attributes(params.except(:default_branch)) if project.previous_changes.include?('path') project.rename_repo end diff --git a/app/views/admin/users/_form.html.haml b/app/views/admin/users/_form.html.haml index d00772d4dfe..e18dd9bc905 100644 --- a/app/views/admin/users/_form.html.haml +++ b/app/views/admin/users/_form.html.haml @@ -31,9 +31,9 @@ = f.label :password, class: 'control-label' .col-sm-10 %strong - A temporary password will be generated and sent to user. + Reset link will be generated and sent to the user. %br - User will be forced to change it after first sign in + User will be forced to set the password on first sign in. - else %fieldset %legend Password diff --git a/app/views/dashboard/_projects_filter.html.haml b/app/views/dashboard/_projects_filter.html.haml index 8c9893ba84f..e4fa2d59e8a 100644 --- a/app/views/dashboard/_projects_filter.html.haml +++ b/app/views/dashboard/_projects_filter.html.haml @@ -44,12 +44,12 @@ -- if @labels.present? +- if @tags.present? %fieldset - %legend Labels + %legend Tags %ul.nav.nav-pills.nav-stacked.nav-small - - @labels.each do |label| - %li{ class: (label.name == params[:label]) ? 'active' : 'light' } - = link_to projects_dashboard_filter_path(scope: params[:scope], label: label.name) do + - @tags.each do |tag| + %li{ class: (tag.name == params[:tag]) ? 'active' : 'light' } + = link_to projects_dashboard_filter_path(scope: params[:scope], tag: tag.name) do %i.icon-tag - = label.name + = tag.name diff --git a/app/views/dashboard/_zero_authorized_projects.html.haml b/app/views/dashboard/_zero_authorized_projects.html.haml index ee086d88e3e..ff85e32bc4e 100644 --- a/app/views/dashboard/_zero_authorized_projects.html.haml +++ b/app/views/dashboard/_zero_authorized_projects.html.haml @@ -46,5 +46,5 @@ %br Public projects are an easy way to allow everyone to have read-only access. .link_holder - = link_to public_projects_path, class: "btn btn-new" do + = link_to explore_projects_path, class: "btn btn-new" do Browse public projects » diff --git a/app/views/dashboard/issues.html.haml b/app/views/dashboard/issues.html.haml index 9888da2f7f2..d3ff291eaa8 100644 --- a/app/views/dashboard/issues.html.haml +++ b/app/views/dashboard/issues.html.haml @@ -1,6 +1,5 @@ %h3.page-title Issues - %span.pull-right #{@issues.total_count} issues %p.light List all issues from all projects you have access to. diff --git a/app/views/dashboard/merge_requests.html.haml b/app/views/dashboard/merge_requests.html.haml index ee3bec2849d..7a9ea9f6f90 100644 --- a/app/views/dashboard/merge_requests.html.haml +++ b/app/views/dashboard/merge_requests.html.haml @@ -1,6 +1,5 @@ %h3.page-title Merge Requests - %span.pull-right #{@merge_requests.total_count} merge requests %p.light diff --git a/app/views/dashboard/projects.html.haml b/app/views/dashboard/projects.html.haml index e1c9a5941e9..2714ebc53de 100644 --- a/app/views/dashboard/projects.html.haml +++ b/app/views/dashboard/projects.html.haml @@ -54,10 +54,10 @@ %span.label %i.icon-archive Archived - - project.labels.each do |label| + - project.tags.each do |tag| %span.label.label-info %i.icon-tag - = label.name + = tag.name - if project.description.present? %p= truncate project.description, length: 100 .last-activity diff --git a/app/views/devise/confirmations/new.html.haml b/app/views/devise/confirmations/new.html.haml index bf634d9de60..08e17490865 100755 --- a/app/views/devise/confirmations/new.html.haml +++ b/app/views/devise/confirmations/new.html.haml @@ -1,15 +1,13 @@ -.login-box - %h3.page-title Resend confirmation instructions - = form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| - .devise-errors - = devise_error_messages! - .clearfix.append-bottom-20 - = f.email_field :email, placeholder: 'Email', class: "form-control", required: true - .clearfix.append-bottom-10 - = f.submit "Resend confirmation instructions", class: 'btn btn-success' - %hr - %p - %span.light - Already have login and password? - %strong - = link_to "Sign in", new_session_path(resource_name) +.login-box.panel.panel-default + .panel-heading + %h3.panel-title Resend confirmation instructions + .panel-body + = form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| + .devise-errors + = devise_error_messages! + .clearfix.append-bottom-20 + = f.email_field :email, placeholder: 'Email', class: "form-control", required: true + .clearfix.append-bottom-10 + = f.submit "Resend confirmation instructions", class: 'btn btn-success' + .panel-footer + = render 'devise/shared/sign_in_link' diff --git a/app/views/devise/mailer/confirmation_instructions.html.erb b/app/views/devise/mailer/confirmation_instructions.html.erb index 553d08369e9..cb1291cf3bf 100644 --- a/app/views/devise/mailer/confirmation_instructions.html.erb +++ b/app/views/devise/mailer/confirmation_instructions.html.erb @@ -6,4 +6,4 @@ <p>You can confirm your account through the link below:</p> <% end %> -<p><%= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @resource.confirmation_token) %></p> +<p><%= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @token) %></p> diff --git a/app/views/devise/mailer/reset_password_instructions.html.erb b/app/views/devise/mailer/reset_password_instructions.html.erb index e1144e943b4..7913e88beb6 100644 --- a/app/views/devise/mailer/reset_password_instructions.html.erb +++ b/app/views/devise/mailer/reset_password_instructions.html.erb @@ -2,7 +2,7 @@ <p>Someone has requested a link to change your password, and you can do this through the link below.</p> -<p><%= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @resource.reset_password_token) %></p> +<p><%= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token) %></p> <p>If you didn't request this, please ignore this email.</p> <p>Your password won't change until you access the link above and create a new one.</p> diff --git a/app/views/devise/mailer/unlock_instructions.html.erb b/app/views/devise/mailer/unlock_instructions.html.erb index 0429883f05b..8c2a4f0c2d9 100644 --- a/app/views/devise/mailer/unlock_instructions.html.erb +++ b/app/views/devise/mailer/unlock_instructions.html.erb @@ -4,4 +4,4 @@ <p>Click the link below to unlock your account:</p> -<p><%= link_to 'Unlock my account', unlock_url(@resource, unlock_token: @resource.unlock_token) %></p> +<p><%= link_to 'Unlock my account', unlock_url(@resource, unlock_token: @token) %></p> diff --git a/app/views/devise/passwords/edit.html.haml b/app/views/devise/passwords/edit.html.haml index 95c52608e1f..efcd0296176 100644 --- a/app/views/devise/passwords/edit.html.haml +++ b/app/views/devise/passwords/edit.html.haml @@ -1,15 +1,18 @@ -= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put, class: "login-box" }) do |f| - %h3 Change your password - .devise-errors - = devise_error_messages! - = f.hidden_field :reset_password_token - %div - = f.password_field :password, class: "form-control top", placeholder: "New password", required: true - %div - = f.password_field :password_confirmation, class: "form-control bottom", placeholder: "Confirm new password", required: true - %div - .clearfix.append-bottom-10 - = f.submit "Change my password", class: "btn btn-primary" - = link_to "Sign in", new_session_path(resource_name), class: "btn pull-right" - %div - = link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) +.login-box.panel.panel-default + .panel-heading + %h3.panel-title Change your password + .panel-body + = form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| + .devise-errors + = devise_error_messages! + = f.hidden_field :reset_password_token + %div + = f.password_field :password, class: "form-control top", placeholder: "New password", required: true + %div + = f.password_field :password_confirmation, class: "form-control bottom", placeholder: "Confirm new password", required: true + .clearfix.append-bottom-10 + = f.submit "Change my password", class: "btn btn-primary" + .panel-footer + %p + = link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) + = render 'devise/shared/sign_in_link' diff --git a/app/views/devise/passwords/new.html.haml b/app/views/devise/passwords/new.html.haml index 040821ca32a..bf44dee5ad7 100755 --- a/app/views/devise/passwords/new.html.haml +++ b/app/views/devise/passwords/new.html.haml @@ -1,14 +1,13 @@ -= form_for(resource, as: resource_name, url: password_path(resource_name), html: { class: "login-box", method: :post }) do |f| - %h3.page-title Reset password - .devise-errors - = devise_error_messages! - .clearfix.append-bottom-20 - = f.email_field :email, placeholder: "Email", class: "form-control", required: true - .clearfix.append-bottom-10 - = f.submit "Reset password", class: "btn-primary btn" - %hr - %p - %span.light - Already have login and password? - %strong - = link_to "Sign in", new_session_path(resource_name) +.login-box.panel.panel-default + .panel-heading + %h3.panel-title Reset password + .panel-body + = form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| + .devise-errors + = devise_error_messages! + .clearfix.append-bottom-20 + = f.email_field :email, placeholder: "Email", class: "form-control", required: true + .clearfix.append-bottom-10 + = f.submit "Reset password", class: "btn-primary btn" + .panel-footer + = render 'devise/shared/sign_in_link' diff --git a/app/views/devise/registrations/new.html.haml b/app/views/devise/registrations/new.html.haml index 24bc0406544..52d484949b6 100644 --- a/app/views/devise/registrations/new.html.haml +++ b/app/views/devise/registrations/new.html.haml @@ -1,24 +1,27 @@ -= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { class: "login-box" }) do |f| - %h3.page-title Sign Up - .devise-errors - = devise_error_messages! - %div - = f.text_field :name, class: "form-control top", placeholder: "Name", required: true - %div - = f.text_field :username, class: "form-control middle", placeholder: "Username", required: true - %div - = f.email_field :email, class: "form-control middle", placeholder: "Email", required: true - %div - = f.password_field :password, class: "form-control middle", placeholder: "Password", required: true - %div - = f.password_field :password_confirmation, class: "form-control bottom", placeholder: "Confirm password", required: true - %div - = f.submit "Sign up", class: "btn-create btn" - %hr - %p - %span.light - Have an account? - %strong - = link_to "Sign in", new_session_path(resource_name) - %p - = link_to "Forgot your password?", new_password_path(resource_name) +.login-box.panel.panel-success + .panel-heading + %h3.panel-title Sign up + .panel-body + = form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| + .devise-errors + = devise_error_messages! + %div + = f.text_field :name, class: "form-control top", placeholder: "Name", required: true + %div + = f.text_field :username, class: "form-control middle", placeholder: "Username", required: true + %div + = f.email_field :email, class: "form-control middle", placeholder: "Email", required: true + %div + = f.password_field :password, class: "form-control middle", placeholder: "Password", required: true + %div + = f.password_field :password_confirmation, class: "form-control bottom", placeholder: "Confirm password", required: true + %div + = f.submit "Sign up", class: "btn-create btn" + .panel-footer + %p + %span.light + Have an account? + %strong + = link_to "Sign in", new_session_path(resource_name) + %p + = link_to "Forgot your password?", new_password_path(resource_name) diff --git a/app/views/devise/sessions/_new_base.html.haml b/app/views/devise/sessions/_new_base.html.haml index 989fcb4a63f..4e196044892 100644 --- a/app/views/devise/sessions/_new_base.html.haml +++ b/app/views/devise/sessions/_new_base.html.haml @@ -7,8 +7,6 @@ = f.check_box :remember_me %span Remember me %div - = hidden_field_tag 'return_to', params[:return_to] - = f.submit "Sign in", class: "btn-create btn" - + = f.submit "Sign in", class: "btn-save btn" .pull-right = link_to "Forgot your password?", new_password_path(resource_name), class: "btn" diff --git a/app/views/devise/sessions/_new_ldap.html.haml b/app/views/devise/sessions/_new_ldap.html.haml index bb1d0a4001f..6c5a878e904 100644 --- a/app/views/devise/sessions/_new_ldap.html.haml +++ b/app/views/devise/sessions/_new_ldap.html.haml @@ -2,4 +2,4 @@ = text_field_tag :username, nil, {class: "form-control top", placeholder: "LDAP Login", autofocus: "autofocus"} = password_field_tag :password, nil, {class: "form-control bottom", placeholder: "Password"} %br/ - = submit_tag "LDAP Sign in", class: "btn-create btn" + = submit_tag "LDAP Sign in", class: "btn-save btn" diff --git a/app/views/devise/sessions/new.html.haml b/app/views/devise/sessions/new.html.haml index 31221ae9c37..f53d6f09daf 100644 --- a/app/views/devise/sessions/new.html.haml +++ b/app/views/devise/sessions/new.html.haml @@ -1,43 +1,42 @@ -.login-box - %h3.page-title Sign in - - if ldap_enabled? && gitlab_config.signin_enabled - %ul.nav.nav-tabs - %li.active - = link_to 'LDAP', '#tab-ldap', 'data-toggle' => 'tab' - %li - = link_to 'Standard', '#tab-signin', 'data-toggle' => 'tab' - .tab-content - %div#tab-ldap.tab-pane.active - = render partial: 'devise/sessions/new_ldap' - %div#tab-signin.tab-pane - = render partial: 'devise/sessions/new_base' +.login-box.panel.panel-primary + .panel-heading + %h3.panel-title Sign in + .panel-body + - if ldap_enabled? && gitlab_config.signin_enabled + %ul.nav.nav-tabs + %li.active + = link_to 'LDAP', '#tab-ldap', 'data-toggle' => 'tab' + %li + = link_to 'Standard', '#tab-signin', 'data-toggle' => 'tab' + .tab-content + %div#tab-ldap.tab-pane.active + = render partial: 'devise/sessions/new_ldap' + %div#tab-signin.tab-pane + = render partial: 'devise/sessions/new_base' + + - elsif ldap_enabled? + = render partial: 'devise/sessions/new_ldap' + - elsif gitlab_config.signin_enabled + = render partial: 'devise/sessions/new_base' + - else + %div + No authentication methods configured. + + = render 'devise/sessions/oauth_providers' if Gitlab.config.omniauth.enabled && devise_mapping.omniauthable? + + .panel-footer + - if gitlab_config.signup_enabled + %p + %span.light + Don't have an account? + %strong + = link_to "Sign up", new_registration_path(resource_name) - - elsif ldap_enabled? - = render partial: 'devise/sessions/new_ldap' - - - elsif gitlab_config.signin_enabled - = render partial: 'devise/sessions/new_base' - - - else - %div - No authentication methods configured. - - - = render 'devise/sessions/oauth_providers' if Gitlab.config.omniauth.enabled && devise_mapping.omniauthable? - %hr - - - if gitlab_config.signup_enabled %p - %span.light - Don't have an account? - %strong - = link_to "Sign up", new_registration_path(resource_name) - - %p - %span.light Did not receive confirmation email? - = link_to "Send again", new_confirmation_path(resource_name) + %span.light Did not receive confirmation email? + = link_to "Send again", new_confirmation_path(resource_name) - - if extra_config.has_key?('sign_in_text') - %hr - = markdown(extra_config.sign_in_text) + - if extra_config.has_key?('sign_in_text') + %hr + = markdown(extra_config.sign_in_text) diff --git a/app/views/devise/shared/_sign_in_link.html.haml b/app/views/devise/shared/_sign_in_link.html.haml new file mode 100644 index 00000000000..fafc4b82f53 --- /dev/null +++ b/app/views/devise/shared/_sign_in_link.html.haml @@ -0,0 +1,5 @@ +%p + %span.light + Already have login and password? + %strong + = link_to "Sign in", new_session_path(resource_name) diff --git a/app/views/events/_event_issue.atom.haml b/app/views/events/_event_issue.atom.haml index 64dc02e3f56..56801107d05 100644 --- a/app/views/events/_event_issue.atom.haml +++ b/app/views/events/_event_issue.atom.haml @@ -1,2 +1,2 @@ %div{:xmlns => "http://www.w3.org/1999/xhtml"} - %p= simple_format issue.description + %p= markdown issue.description diff --git a/app/views/events/_event_merge_request.atom.haml b/app/views/events/_event_merge_request.atom.haml new file mode 100644 index 00000000000..dea256bb7f2 --- /dev/null +++ b/app/views/events/_event_merge_request.atom.haml @@ -0,0 +1,2 @@ +%div{xmlns: "http://www.w3.org/1999/xhtml"} + %p= markdown merge_request.description diff --git a/app/views/events/_event_note.atom.haml b/app/views/events/_event_note.atom.haml new file mode 100644 index 00000000000..96039ad18dc --- /dev/null +++ b/app/views/events/_event_note.atom.haml @@ -0,0 +1,2 @@ +%div{:xmlns => "http://www.w3.org/1999/xhtml"} + %p= markdown note.note diff --git a/app/views/events/_event_push.atom.haml b/app/views/events/_event_push.atom.haml index e44b366040f..17228c430ca 100644 --- a/app/views/events/_event_push.atom.haml +++ b/app/views/events/_event_push.atom.haml @@ -6,7 +6,7 @@ %i at = commit[:timestamp].to_time.to_s(:short) - %blockquote= simple_format(escape_once(commit[:message])) + %blockquote= markdown(escape_once(commit[:message])) - if event.commits_count > 15 %p %i diff --git a/app/views/explore/groups/index.html.haml b/app/views/explore/groups/index.html.haml new file mode 100644 index 00000000000..80ddd5c1bde --- /dev/null +++ b/app/views/explore/groups/index.html.haml @@ -0,0 +1,51 @@ +.clearfix + .pull-left + = form_tag explore_groups_path, method: :get, class: 'form-inline form-tiny' do |f| + .form-group + = search_field_tag :search, params[:search], placeholder: "Filter by name", class: "form-control search-text-input input-mn-300", id: "groups_search" + .form-group + = submit_tag 'Search', class: "btn btn-primary wide" + + .pull-right + .dropdown.inline + %a.dropdown-toggle.btn{href: '#', "data-toggle" => "dropdown"} + %span.light sort: + - if @sort.present? + = @sort.humanize + - else + Name + %b.caret + %ul.dropdown-menu + %li + = link_to explore_groups_path(sort: nil) do + Name + = link_to explore_groups_path(sort: 'newest') do + Newest + = link_to explore_groups_path(sort: 'oldest') do + Oldest + = link_to explore_groups_path(sort: 'recently_updated') do + Recently updated + = link_to explore_groups_path(sort: 'last_updated') do + Last updated + +%hr + +%ul.bordered-list + - @groups.each do |group| + %li + .clearfix + %h4 + = link_to group_path(id: group.path) do + %i.icon-group + = group.name + .clearfix + %p + = truncate group.description, length: 150 + .clearfix + %p.light + #{pluralize(group.members.size, 'member')}, #{pluralize(group.projects.count, 'project')} + - unless @groups.present? + .nothing-here-block No public groups + + += paginate @groups, theme: "gitlab" diff --git a/app/views/explore/projects/_project.html.haml b/app/views/explore/projects/_project.html.haml new file mode 100644 index 00000000000..a9498416c8a --- /dev/null +++ b/app/views/explore/projects/_project.html.haml @@ -0,0 +1,25 @@ +%li + %h4.project-title + .project-access-icon + = visibility_level_icon(project.visibility_level) + = link_to project.name_with_namespace, project + + - if current_page?(starred_explore_projects_path) + %strong.pull-right + = pluralize project.star_count, 'star' + + - if project.description.present? + %p.project-description.str-truncated + = project.description + + .repo-info + - unless project.empty_repo? + = link_to pluralize(project.repository.round_commit_count, 'commit'), project_commits_path(project, project.default_branch) + · + = link_to pluralize(project.repository.branch_names.count, 'branch'), project_branches_path(project) + · + = link_to pluralize(project.repository.tag_names.count, 'tag'), project_tags_path(project) + - else + %i.icon-warning-sign + Empty repository + diff --git a/app/views/explore/projects/index.html.haml b/app/views/explore/projects/index.html.haml new file mode 100644 index 00000000000..c8bf78385e8 --- /dev/null +++ b/app/views/explore/projects/index.html.haml @@ -0,0 +1,38 @@ +.clearfix + .pull-left + = form_tag explore_projects_path, method: :get, class: 'form-inline form-tiny' do |f| + .form-group + = search_field_tag :search, params[:search], placeholder: "Filter by name", class: "form-control search-text-input input-mn-300", id: "projects_search" + .form-group + = submit_tag 'Search', class: "btn btn-primary wide" + + .pull-right + .dropdown.inline + %a.dropdown-toggle.btn{href: '#', "data-toggle" => "dropdown"} + %span.light sort: + - if @sort.present? + = @sort.humanize + - else + Name + %b.caret + %ul.dropdown-menu + %li + = link_to explore_projects_path(sort: nil) do + Name + = link_to explore_projects_path(sort: 'newest') do + Newest + = link_to explore_projects_path(sort: 'oldest') do + Oldest + = link_to explore_projects_path(sort: 'recently_updated') do + Recently updated + = link_to explore_projects_path(sort: 'last_updated') do + Last updated + +%hr +.public-projects + %ul.bordered-list.top-list + = render @projects + - unless @projects.present? + .nothing-here-block No public projects + + = paginate @projects, theme: "gitlab" diff --git a/app/views/explore/projects/starred.html.haml b/app/views/explore/projects/starred.html.haml new file mode 100644 index 00000000000..9c793d4050c --- /dev/null +++ b/app/views/explore/projects/starred.html.haml @@ -0,0 +1,10 @@ +.explore-trending-block + %p.lead + %i.icon-comments-alt + See most starred projects + %hr + .public-projects + %ul.bordered-list + = render @starred_projects + + = paginate @starred_projects, theme: 'gitlab' diff --git a/app/views/explore/projects/trending.html.haml b/app/views/explore/projects/trending.html.haml new file mode 100644 index 00000000000..18bb1ac0ba4 --- /dev/null +++ b/app/views/explore/projects/trending.html.haml @@ -0,0 +1,11 @@ +.explore-trending-block + %p.lead + %i.icon-comments-alt + See most discussed projects for last month + %hr + .public-projects + %ul.bordered-list + = render @trending_projects + + .center + = link_to 'Show all projects', explore_projects_path, class: 'btn btn-primary' diff --git a/app/views/groups/_filter.html.haml b/app/views/groups/_filter.html.haml index fe8c0669c0e..393be3f1d12 100644 --- a/app/views/groups/_filter.html.haml +++ b/app/views/groups/_filter.html.haml @@ -1,29 +1,12 @@ = form_tag group_filter_path(entity), method: 'get' do %fieldset %ul.nav.nav-pills.nav-stacked - %li{class: ("active" if !params[:status])} - = link_to group_filter_path(entity, status: nil) do - Open + %li{class: ("active" if (params[:status] == 'active' || !params[:status]))} + = link_to group_filter_path(entity, status: 'active') do + Active %li{class: ("active" if params[:status] == 'closed')} = link_to group_filter_path(entity, status: 'closed') do Closed %li{class: ("active" if params[:status] == 'all')} = link_to group_filter_path(entity, status: 'all') do All - - %fieldset - %legend Projects: - %ul.nav.nav-pills.nav-stacked - - @projects.each do |project| - - unless entities_per_project(project, entity).zero? - %li{class: ("active" if params[:project_id] == project.id.to_s)} - = link_to group_filter_path(entity, project_id: project.id) do - = project.name_with_namespace - %small.pull-right= entities_per_project(project, entity) - - if @projects.blank? - .nothing-here-block This group has no projects yet - - %fieldset - %hr - = link_to "Reset", group_filter_path(entity), class: 'btn pull-right' - diff --git a/app/views/groups/issues.html.haml b/app/views/groups/issues.html.haml index 0eec2d6be0b..0152ae86833 100644 --- a/app/views/groups/issues.html.haml +++ b/app/views/groups/issues.html.haml @@ -1,6 +1,5 @@ %h3.page-title Issues - %span.pull-right #{@issues.total_count} issues %p.light Only issues from diff --git a/app/views/groups/merge_requests.html.haml b/app/views/groups/merge_requests.html.haml index 71adb2c5516..71d346d0469 100644 --- a/app/views/groups/merge_requests.html.haml +++ b/app/views/groups/merge_requests.html.haml @@ -1,6 +1,5 @@ %h3.page-title Merge Requests - %span.pull-right #{@merge_requests.total_count} merge requests %p.light Only merge requests from diff --git a/app/views/groups/milestones/_issue.html.haml b/app/views/groups/milestones/_issue.html.haml new file mode 100644 index 00000000000..c95c2e89670 --- /dev/null +++ b/app/views/groups/milestones/_issue.html.haml @@ -0,0 +1,10 @@ +%li{ id: dom_id(issue, 'sortable'), class: 'issue-row', 'data-iid' => issue.iid } + %span.milestone-row + - project = issue.project + %strong #{project.name} · + = link_to [project, issue] do + %span.cgray ##{issue.iid} + = link_to_gfm issue.title, [project, issue], title: issue.title + .pull-right.assignee-icon + - if issue.assignee + = image_tag avatar_icon(issue.assignee.email, 16), class: "avatar s16" diff --git a/app/views/groups/milestones/_issues.html.haml b/app/views/groups/milestones/_issues.html.haml new file mode 100644 index 00000000000..9f350b772bd --- /dev/null +++ b/app/views/groups/milestones/_issues.html.haml @@ -0,0 +1,6 @@ +.panel.panel-default + .panel-heading= title + %ul{ class: "well-list issues-sortable-list" } + - if issues + - issues.each do |issue| + = render 'issue', issue: issue diff --git a/app/views/groups/milestones/_merge_request.html.haml b/app/views/groups/milestones/_merge_request.html.haml new file mode 100644 index 00000000000..e0c903bfdb2 --- /dev/null +++ b/app/views/groups/milestones/_merge_request.html.haml @@ -0,0 +1,10 @@ +%li{ id: dom_id(merge_request, 'sortable'), class: 'mr-row', 'data-iid' => merge_request.iid } + %span.milestone-row + - project = merge_request.project + %strong #{project.name} · + = link_to [project, merge_request] do + %span.cgray ##{merge_request.iid} + = link_to_gfm merge_request.title, [project, merge_request], title: merge_request.title + .pull-right.assignee-icon + - if merge_request.assignee + = image_tag avatar_icon(merge_request.assignee.email, 16), class: "avatar s16" diff --git a/app/views/groups/milestones/_merge_requests.html.haml b/app/views/groups/milestones/_merge_requests.html.haml new file mode 100644 index 00000000000..50057e2c636 --- /dev/null +++ b/app/views/groups/milestones/_merge_requests.html.haml @@ -0,0 +1,6 @@ +.panel.panel-default + .panel-heading= title + %ul{ class: "well-list merge_requests-sortable-list" } + - if merge_requests + - merge_requests.each do |merge_request| + = render 'merge_request', merge_request: merge_request diff --git a/app/views/groups/milestones/index.html.haml b/app/views/groups/milestones/index.html.haml new file mode 100644 index 00000000000..54e901173f0 --- /dev/null +++ b/app/views/groups/milestones/index.html.haml @@ -0,0 +1,50 @@ +%h3.page-title + Milestones + %span.pull-right #{@group_milestones.count} milestones + +%p.light + Only milestones from + %strong #{@group.name} + group are listed here. + +%hr + +.row + .fixed.sidebar-expand-button.hidden-lg.hidden-md + %i.icon-list.icon-2x + .col-md-3.responsive-side + = render 'groups/filter', entity: 'milestone' + .col-md-9 + .panel.panel-default + %ul.well-list + - if @group_milestones.blank? + %li + .nothing-here-block No milestones to show + - else + - @group_milestones.each do |milestone| + %li{class: "milestone milestone-#{milestone.closed? ? 'closed' : 'open'}", id: dom_id(milestone.milestones.first) } + .pull-right + - if can?(current_user, :manage_group, @group) + - if milestone.closed? + = link_to 'Reopen Milestone', group_milestone_path(@group, milestone.safe_title, title: milestone.title, milestone: {state_event: :activate }), method: :put, class: "btn btn-small btn-grouped btn-reopen" + - else + = link_to 'Close Milestone', group_milestone_path(@group, milestone.safe_title, title: milestone.title, milestone: {state_event: :close }), method: :put, class: "btn btn-small btn-close" + %h4 + = link_to_gfm truncate(milestone.title, length: 100), group_milestone_path(@group, milestone.safe_title, title: milestone.title) + %div + %div + = link_to group_milestone_path(@group, milestone.safe_title, title: milestone.title) do + = pluralize milestone.issue_count, 'Issue' + + = link_to group_milestone_path(@group, milestone.safe_title, title: milestone.title) do + = pluralize milestone.merge_requests_count, 'Merge Request' + + %span.light #{milestone.percent_complete}% complete + .progress.progress-info + .progress-bar{style: "width: #{milestone.percent_complete}%;"} + %div + %br + - milestone.projects.each do |project| + %span.label.label-default + = project.name + = paginate @group_milestones, theme: "gitlab" diff --git a/app/views/groups/milestones/show.html.haml b/app/views/groups/milestones/show.html.haml new file mode 100644 index 00000000000..411d1822be0 --- /dev/null +++ b/app/views/groups/milestones/show.html.haml @@ -0,0 +1,88 @@ +%h3.page-title + Milestone #{@group_milestone.title} + .pull-right + - if can?(current_user, :manage_group, @group) + - if @group_milestone.active? + = link_to 'Close Milestone', group_milestone_path(@group, @group_milestone.safe_title, title: @group_milestone.title, milestone: {state_event: :close }), method: :put, class: "btn btn-small btn-close" + - else + = link_to 'Reopen Milestone', group_milestone_path(@group, @group_milestone.safe_title, title: @group_milestone.title, milestone: {state_event: :activate }), method: :put, class: "btn btn-small btn-grouped btn-reopen" + +- if (@group_milestone.total_items_count == @group_milestone.closed_items_count) && @group_milestone.active? + .alert.alert-success + %span All issues for this milestone are closed. You may close the milestone now. + +.back-link + = link_to group_milestones_path(@group) do + ← To milestones list + +.issue-box{ class: "issue-box-#{@group_milestone.closed? ? 'closed' : 'open'}" } + .state.clearfix + .state-label + - if @group_milestone.closed? + Closed + - else + Open + + %h4.title + = gfm escape_once(@group_milestone.title) + + .description + - @group_milestone.milestones.each do |milestone| + %hr + %h4 + = link_to "#{milestone.project.name} - #{milestone.title}", project_milestone_path(milestone.project, milestone) + %span.pull-right= milestone.expires_at + - if milestone.closed? + %span.label.label-danger #{milestone.state} + = preserve do + - if milestone.description.present? + = milestone.description + + .context + %p + Progress: + #{@group_milestone.closed_items_count} closed + – + #{@group_milestone.open_items_count} open + + .progress.progress-info + .progress-bar{style: "width: #{@group_milestone.percent_complete}%;"} + +%ul.nav.nav-tabs + %li.active + = link_to '#tab-issues', 'data-toggle' => 'tab' do + Issues + %span.badge= @group_milestone.issue_count + %li + = link_to '#tab-merge-requests', 'data-toggle' => 'tab' do + Merge Requests + %span.badge= @group_milestone.merge_requests_count + %li + = link_to '#tab-participants', 'data-toggle' => 'tab' do + Participants + %span.badge= @group_milestone.participants.count + +.tab-content + .tab-pane.active#tab-issues + .row + .col-md-6 + = render 'issues', title: "Open", issues: @group_milestone.opened_issues + .col-md-6 + = render 'issues', title: "Closed", issues: @group_milestone.closed_issues + + .tab-pane#tab-merge-requests + .row + .col-md-6 + = render 'merge_requests', title: "Open", merge_requests: @group_milestone.opened_merge_requests + .col-md-6 + = render 'merge_requests', title: "Closed", merge_requests: @group_milestone.closed_merge_requests + + .tab-pane#tab-participants + %ul.bordered-list + - @group_milestone.participants.each do |user| + %li + = link_to user, title: user.name, class: "darken" do + = image_tag avatar_icon(user.email, 32), class: "avatar s32" + %strong= truncate(user.name, lenght: 40) + %br + %small.cgray= user.username diff --git a/app/views/help/index.html.haml b/app/views/help/index.html.haml index a89ccde7924..219693af09f 100644 --- a/app/views/help/index.html.haml +++ b/app/views/help/index.html.haml @@ -1,5 +1,5 @@ -.jumbotron - %h2 +%div + %h1 GitLab %span= Gitlab::VERSION %small= Gitlab::REVISION @@ -16,7 +16,17 @@ %br Read more about GitLab at #{link_to "www.gitlab.com", "https://www.gitlab.com/", target: "_blank"}. +%hr + .row + .col-md-8 + .documentation-index + = preserve do + - readme_text = File.read(Rails.root.join("doc", "README.md")) + - text = readme_text.dup + - readme_text.scan(/\]\(([^(]+)\)/) { |match| text.gsub!(match.first, "help/#{match.first}") } + = markdown text + .col-md-4 .panel.panel-default .panel-heading @@ -32,13 +42,3 @@ %li Use = link_to "shortcuts", '#', onclick: "new Shortcuts()" - - .col-md-8 - .panel.panel-default.documentation-index - .panel-heading Documentation - .panel-body - = preserve do - - readme_text = File.read(Rails.root.join("doc", "README.md")) - - text = readme_text.dup - - readme_text.scan(/\]\(([^(]+)\)/) { |match| text.gsub!(match.first, "help/#{match.first}") } - = markdown text diff --git a/app/views/layouts/_head.html.haml b/app/views/layouts/_head.html.haml index 32dff0c6708..0c27f679dee 100644 --- a/app/views/layouts/_head.html.haml +++ b/app/views/layouts/_head.html.haml @@ -7,6 +7,7 @@ -# https://github.com/gitlabhq/gitlabhq/pull/5958#issuecomment-45397555 - if controller_name == 'projects' && action_name == 'show' %meta{name: "go-import", content: "#{@project.web_url_without_protocol} git #{@project.web_url}.git"} + %meta{content: "GitLab Community Edition", name: "description"} %title = "#{title} | " if defined?(title) diff --git a/app/views/layouts/_head_panel.html.haml b/app/views/layouts/_head_panel.html.haml index fba56b5dc3b..7c727aca785 100644 --- a/app/views/layouts/_head_panel.html.haml +++ b/app/views/layouts/_head_panel.html.haml @@ -24,7 +24,7 @@ 'data-original-title' => 'Help' do %i.icon-question-sign %li - = link_to public_root_path, title: "Public area", class: 'has_bottom_tooltip', 'data-original-title' => 'Public area' do + = link_to explore_root_path, title: "Explore", class: 'has_bottom_tooltip', 'data-original-title' => 'Public area' do %i.icon-globe %li = link_to user_snippets_path(current_user), title: "My snippets", class: 'has_bottom_tooltip', 'data-original-title' => 'My snippets' do diff --git a/app/views/layouts/_public_head_panel.html.haml b/app/views/layouts/_public_head_panel.html.haml index 25984df0444..945c66e2adf 100644 --- a/app/views/layouts/_public_head_panel.html.haml +++ b/app/views/layouts/_public_head_panel.html.haml @@ -3,7 +3,7 @@ .container %div.app_logo %span.separator - = link_to public_root_path, class: "home" do + = link_to explore_root_path, class: "home" do %h1 GITLAB %span.separator %h1.title= title @@ -13,10 +13,10 @@ %i.icon-reorder .pull-right.hidden-xs - = link_to "Sign in", new_session_path(:user, return_to: request.fullpath), class: 'btn btn-sign-in btn-new' + = link_to "Sign in", new_session_path(:user, redirect_to_referer: 'yes'), class: 'btn btn-sign-in btn-new' .navbar-collapse.collapse %ul.nav.navbar-nav %li.visible-xs - = link_to "Sign in", new_session_path(:user, return_to: request.fullpath) + = link_to "Sign in", new_session_path(:user, redirect_to_referer: 'yes') diff --git a/app/views/layouts/admin.html.haml b/app/views/layouts/admin.html.haml index c7a827555a7..1ea91a1914f 100644 --- a/app/views/layouts/admin.html.haml +++ b/app/views/layouts/admin.html.haml @@ -10,4 +10,4 @@ .container .content= yield - = yield :embedded_scripts
\ No newline at end of file + = yield :embedded_scripts diff --git a/app/views/layouts/devise.html.haml b/app/views/layouts/devise.html.haml index 36c682c48a6..00b1959912f 100644 --- a/app/views/layouts/devise.html.haml +++ b/app/views/layouts/devise.html.haml @@ -5,13 +5,34 @@ = render "layouts/flash" .container .content - .center - %h1 GitLab - %p.light - GitLab is open source software to collaborate on code. - %br - Sign in or browse for #{link_to "public projects", public_projects_path}. + .login-title + %h1= brand_title %hr .container .content - = yield + .row + .col-md-7 + - if brand_item + .brand-image + = brand_image + .brand_text + = brand_text + - else + .brand-image.hidden-sm.hidden-xs + = image_tag 'brand_logo.png' + .brand_text.hidden-xs + %h2 Open source software to collaborate on code + + %p.lead + Manage git repositories with fine grained access controls that keep your code secure. + Perform code reviews and enhance collaboration with merge requests. + Each project can also have an issue tracker and a wiki. + + .col-md-5 + = yield + %hr + .container + .footer-links + = link_to "Explore", explore_root_path + = link_to "Documentation", "http://doc.gitlab.com/" + = link_to "About GitLab", "https://about.gitlab.com/" diff --git a/app/views/layouts/explore.html.haml b/app/views/layouts/explore.html.haml new file mode 100644 index 00000000000..d023846c5eb --- /dev/null +++ b/app/views/layouts/explore.html.haml @@ -0,0 +1,30 @@ +- page_title = 'Explore' +!!! 5 +%html{ lang: "en"} + = render "layouts/head", title: page_title + %body{class: "#{app_theme} application", :'data-page' => body_data_page} + = render "layouts/broadcast" + - if current_user + = render "layouts/head_panel", title: page_title + - else + = render "layouts/public_head_panel", title: page_title + .container.navless-container + .content + .explore-title + %h3 + Explore GitLab + %p.lead + Discover projects and groups. Share your projects with others + + + %ul.nav.nav-tabs + = nav_link(path: 'projects#trending') do + = link_to 'Trending Projects', explore_root_path + = nav_link(path: 'projects#starred') do + = link_to 'Most Starred Projects', starred_explore_projects_path + = nav_link(path: 'projects#index') do + = link_to 'All Projects', explore_projects_path + = nav_link(controller: :groups) do + = link_to 'All Groups', explore_groups_path + + = yield diff --git a/app/views/layouts/nav/_admin.html.haml b/app/views/layouts/nav/_admin.html.haml index 48c569f8684..c57216f01c8 100644 --- a/app/views/layouts/nav/_admin.html.haml +++ b/app/views/layouts/nav/_admin.html.haml @@ -1,13 +1,13 @@ %ul = nav_link(controller: :dashboard, html_options: {class: 'home'}) do = link_to admin_root_path, title: "Stats" do - %i.icon-home + Overview = nav_link(controller: :projects) do = link_to "Projects", admin_projects_path - = nav_link(controller: :groups) do - = link_to "Groups", admin_groups_path = nav_link(controller: :users) do = link_to "Users", admin_users_path + = nav_link(controller: :groups) do + = link_to "Groups", admin_groups_path = nav_link(controller: :logs) do = link_to "Logs", admin_logs_path = nav_link(controller: :broadcast_messages) do diff --git a/app/views/layouts/nav/_dashboard.html.haml b/app/views/layouts/nav/_dashboard.html.haml index 12fd49e609f..a300bbc1904 100644 --- a/app/views/layouts/nav/_dashboard.html.haml +++ b/app/views/layouts/nav/_dashboard.html.haml @@ -1,7 +1,7 @@ %ul = nav_link(path: 'dashboard#show', html_options: {class: 'home'}) do = link_to root_path, title: "Home" do - %i.icon-home + Activity = nav_link(path: 'dashboard#projects') do = link_to projects_dashboard_path do Projects diff --git a/app/views/layouts/nav/_group.html.haml b/app/views/layouts/nav/_group.html.haml index 36b102dc25a..9095a843c9f 100644 --- a/app/views/layouts/nav/_group.html.haml +++ b/app/views/layouts/nav/_group.html.haml @@ -1,7 +1,10 @@ %ul = nav_link(path: 'groups#show', html_options: {class: 'home'}) do = link_to group_path(@group), title: "Home" do - %i.icon-home + Activity + = nav_link(controller: [:group, :milestones]) do + = link_to group_milestones_path(@group) do + Milestones = nav_link(path: 'groups#issues') do = link_to issues_group_path(@group) do Issues diff --git a/app/views/layouts/nav/_profile.html.haml b/app/views/layouts/nav/_profile.html.haml index 35d0d417502..1de5ee99cf4 100644 --- a/app/views/layouts/nav/_profile.html.haml +++ b/app/views/layouts/nav/_profile.html.haml @@ -1,7 +1,7 @@ %ul = nav_link(path: 'profiles#show', html_options: {class: 'home'}) do = link_to profile_path, title: "Profile" do - %i.icon-home + Profile = nav_link(controller: :accounts) do = link_to "Account", profile_account_path = nav_link(controller: :emails) do diff --git a/app/views/layouts/nav/_project.html.haml b/app/views/layouts/nav/_project.html.haml index dd48ff6ce38..69491c2529e 100644 --- a/app/views/layouts/nav/_project.html.haml +++ b/app/views/layouts/nav/_project.html.haml @@ -1,7 +1,7 @@ %ul = nav_link(path: 'projects#show', html_options: {class: "home"}) do = link_to project_path(@project), title: "Project" do - %i.icon-home + Activity - if project_nav_tab? :files = nav_link(controller: %w(tree blob blame edit_tree new_tree)) do diff --git a/app/views/layouts/notify.html.haml b/app/views/layouts/notify.html.haml index 991d4f0c6d8..ab421d63f1a 100644 --- a/app/views/layouts/notify.html.haml +++ b/app/views/layouts/notify.html.haml @@ -4,6 +4,10 @@ %title GitLab :css + img { + max-width: 100%; + height: auto; + } p.details { font-style:italic; color:#777 diff --git a/app/views/layouts/projects.html.haml b/app/views/layouts/projects.html.haml index 11c815c52a7..f02eca6bd7c 100644 --- a/app/views/layouts/projects.html.haml +++ b/app/views/layouts/projects.html.haml @@ -14,4 +14,4 @@ .container .content= yield - = yield :embedded_scripts
\ No newline at end of file + = yield :embedded_scripts diff --git a/app/views/layouts/public.html.haml b/app/views/layouts/public.html.haml deleted file mode 100644 index 3c76bbb9575..00000000000 --- a/app/views/layouts/public.html.haml +++ /dev/null @@ -1,11 +0,0 @@ -!!! 5 -%html{ lang: "en"} - = render "layouts/head", title: "Public Projects" - %body{class: "#{app_theme} application", :'data-page' => body_data_page} - = render "layouts/broadcast" - - if current_user - = render "layouts/head_panel", title: "Public Projects" - - else - = render "layouts/public_head_panel", title: "Public Projects" - .container.navless-container - .content= yield diff --git a/app/views/notify/merge_request_status_email.html.haml b/app/views/notify/merge_request_status_email.html.haml new file mode 100644 index 00000000000..c9bf04f514e --- /dev/null +++ b/app/views/notify/merge_request_status_email.html.haml @@ -0,0 +1,2 @@ +%p + = "Merge Request ##{@merge_request.iid} was #{@mr_status} by #{@updated_by.name}" diff --git a/app/views/notify/merge_request_status_email.text.haml b/app/views/notify/merge_request_status_email.text.haml new file mode 100644 index 00000000000..8750bf86e2c --- /dev/null +++ b/app/views/notify/merge_request_status_email.text.haml @@ -0,0 +1,8 @@ += "Merge Request ##{@merge_request.iid} was #{@mr_status} by #{@updated_by.name}" + +Merge Request url: #{project_merge_request_url(@merge_request.target_project, @merge_request)} + += merge_path_description(@merge_request, 'to') + +Author: #{@merge_request.author_name} +Assignee: #{@merge_request.assignee_name} diff --git a/app/views/notify/new_user_email.html.haml b/app/views/notify/new_user_email.html.haml index 09518cd3c7f..ebbe98dd472 100644 --- a/app/views/notify/new_user_email.html.haml +++ b/app/views/notify/new_user_email.html.haml @@ -11,11 +11,4 @@ - if @user.created_by_id %p - password.................................. - %code= @password - - %p - You will be forced to change this password immediately after login. - -%p - = link_to "Click here to login", root_url + = link_to "Click here to set your password", edit_password_url(@user, :reset_password_token => @token) diff --git a/app/views/notify/new_user_email.text.erb b/app/views/notify/new_user_email.text.erb index c21c95d3047..96b26879a77 100644 --- a/app/views/notify/new_user_email.text.erb +++ b/app/views/notify/new_user_email.text.erb @@ -4,10 +4,5 @@ The Administrator created an account for you. Now you are a member of the compan login.................. <%= @user.email %> <% if @user.created_by_id %> - password............... <%= @password %> - - You will be forced to change this password immediately after login. + <%= link_to "Click here to set your password", edit_password_url(@user, :reset_password_token => @token) %> <% end %> - - -Click here to login: <%= url_for(root_url) %> diff --git a/app/views/notify/project_was_moved_email.html.haml b/app/views/notify/project_was_moved_email.html.haml index 3e761c43435..1667c59bc07 100644 --- a/app/views/notify/project_was_moved_email.html.haml +++ b/app/views/notify/project_was_moved_email.html.haml @@ -5,7 +5,11 @@ = link_to project_url(@project) do = @project.name_with_namespace %p - To update the remote url in your local repository run: + To update the remote url in your local repository run (for ssh): %p{ style: "background:#f5f5f5; padding:10px; border:1px solid #ddd" } git remote set-url origin #{@project.ssh_url_to_repo} +%p + or for http(s): +%p{ style: "background:#f5f5f5; padding:10px; border:1px solid #ddd" } + git remote set-url origin #{@project.http_url_to_repo} %br diff --git a/app/views/notify/project_was_moved_email.text.erb b/app/views/notify/project_was_moved_email.text.erb index 7889c7b9cc4..664148fb3ba 100644 --- a/app/views/notify/project_was_moved_email.text.erb +++ b/app/views/notify/project_was_moved_email.text.erb @@ -4,5 +4,7 @@ The project is now located under <%= project_url(@project) %> -To update the remote url in your local repository run: +To update the remote url in your local repository run (for ssh): git remote set-url origin <%= @project.ssh_url_to_repo %> +or for http(s): + git remote set-url origin <%= @project.http_url_to_repo %> diff --git a/app/views/notify/reassigned_issue_email.html.haml b/app/views/notify/reassigned_issue_email.html.haml index 07227a3e68c..f1458df5c7b 100644 --- a/app/views/notify/reassigned_issue_email.html.haml +++ b/app/views/notify/reassigned_issue_email.html.haml @@ -4,5 +4,8 @@ from %strong #{@previous_assignee.name} to - %strong #{@issue.assignee_name} + - if @issue.assignee_id + %strong #{@issue.assignee_name} + - else + %strong Unassigned diff --git a/app/views/notify/reassigned_issue_email.text.erb b/app/views/notify/reassigned_issue_email.text.erb index bc0d0567922..4becac2749c 100644 --- a/app/views/notify/reassigned_issue_email.text.erb +++ b/app/views/notify/reassigned_issue_email.text.erb @@ -2,4 +2,4 @@ Reassigned Issue <%= @issue.iid %> <%= url_for(project_issue_url(@issue.project, @issue)) %> -Assignee changed <%= "from #{@previous_assignee.name}" if @previous_assignee %> to <%= @issue.assignee_name %> +Assignee changed <%= "from #{@previous_assignee.name}" if @previous_assignee %> to <%= "#{@issue.assignee_id ? @issue.assignee_name : 'Unassigned'}" %> diff --git a/app/views/notify/repository_push_email.html.haml b/app/views/notify/repository_push_email.html.haml index 85a01a567f3..0358810afdc 100644 --- a/app/views/notify/repository_push_email.html.haml +++ b/app/views/notify/repository_push_email.html.haml @@ -5,7 +5,9 @@ %ul - @commits.each do |commit| %li - #{commit.short_id} - #{commit.title} + %strong #{commit.short_id} + %span by #{commit.author_name} + %pre #{commit.safe_message} %h4 Changes: - @diffs.each do |diff| @@ -23,6 +25,4 @@ %br - if @compare.timeout - %h5 To prevent performance issues changes are hidden -- elsif @compare.commits_over_limit? - %h5 Changes are not shown due to large amount of commits + %h5 Huge diff. To prevent performance issues changes are hidden diff --git a/app/views/notify/repository_push_email.text.haml b/app/views/notify/repository_push_email.text.haml index a15b8efe1f7..4d7c972a16a 100644 --- a/app/views/notify/repository_push_email.text.haml +++ b/app/views/notify/repository_push_email.text.haml @@ -3,7 +3,9 @@ \ Commits: - @commits.each do |commit| - #{commit.short_id} - #{truncate(commit.title, length: 40)} + #{commit.short_id} by #{commit.author_name} + #{commit.safe_message} + \- - - - - \ \ Changes: @@ -21,5 +23,3 @@ Changes: \ - if @compare.timeout Huge diff. To prevent performance issues it was hidden -- elsif @compare.commits_over_limit? - Changes are not shown due to large amount of commits diff --git a/app/views/profiles/passwords/new.html.haml b/app/views/profiles/passwords/new.html.haml index b72232ee36b..aef7348fd20 100644 --- a/app/views/profiles/passwords/new.html.haml +++ b/app/views/profiles/passwords/new.html.haml @@ -12,6 +12,9 @@ %li= msg .form-group + = f.label :current_password, class: 'control-label' + .col-sm-10= f.password_field :current_password, required: true, class: 'form-control' + .form-group = f.label :password, class: 'control-label' .col-sm-10= f.password_field :password, required: true, class: 'form-control' .form-group diff --git a/app/views/profiles/show.html.haml b/app/views/profiles/show.html.haml index 9a4c13af975..e03a43cbf1f 100644 --- a/app/views/profiles/show.html.haml +++ b/app/views/profiles/show.html.haml @@ -68,12 +68,14 @@ %p.light - if @user.avatar? You can change your avatar here - %br - or remove the current avatar to revert to #{link_to "gravatar.com", "http://gravatar.com"} + - if Gitlab.config.gravatar.enabled + %br + or remove the current avatar to revert to #{link_to "gravatar.com", "http://gravatar.com"} - else You can upload an avatar here - %br - or change it at #{link_to "gravatar.com", "http://gravatar.com"} + - if Gitlab.config.gravatar.enabled + %br + or change it at #{link_to "gravatar.com", "http://gravatar.com"} %hr %a.choose-btn.btn.btn-small.js-choose-user-avatar-button %i.icon-paper-clip diff --git a/app/views/projects/_home_panel.html.haml b/app/views/projects/_home_panel.html.haml index 52a6d201099..62348f26f0a 100644 --- a/app/views/projects/_home_panel.html.haml +++ b/app/views/projects/_home_panel.html.haml @@ -17,18 +17,19 @@ .col-md-7 .project-home-desc - if @project.description.present? - = auto_link @project.description, link: :urls + = auto_link ERB::Util.html_escape(@project.description), link: :urls - if can?(current_user, :admin_project, @project) – %strong= link_to 'Edit', edit_project_path - elsif !@project.empty_repo? && @repository.readme - readme = @repository.readme + – = link_to project_blob_path(@project, tree_join(@repository.root_ref, readme.name)) do = readme.name - - unless empty_repo - .col-md-5 - .project-home-links + .col-md-5 + .project-home-links + - unless empty_repo = link_to pluralize(number_with_delimiter(@repository.commit_count), 'commit'), project_commits_path(@project, @ref || @repository.root_ref) = link_to pluralize(number_with_delimiter(@repository.branch_names.count), 'branch'), project_branches_path(@project) = link_to pluralize(number_with_delimiter(@repository.tag_names.count), 'tag'), project_tags_path(@project) diff --git a/app/views/projects/commit/huge_commit.html.haml b/app/views/projects/commit/huge_commit.html.haml deleted file mode 100644 index 398ce771426..00000000000 --- a/app/views/projects/commit/huge_commit.html.haml +++ /dev/null @@ -1,3 +0,0 @@ -= render "projects/commit/commit_box" -.alert.alert-danger - %h4 Commit diffs are too big to be displayed diff --git a/app/views/projects/commit/show.html.haml b/app/views/projects/commit/show.html.haml index da1b4c10f87..0a15aef6cb7 100644 --- a/app/views/projects/commit/show.html.haml +++ b/app/views/projects/commit/show.html.haml @@ -1,3 +1,3 @@ = render "commit_box" -= render "projects/commits/diffs", diffs: @commit.diffs, project: @project += render "projects/commits/diffs", diffs: @diffs, project: @project = render "projects/notes/notes_with_form" diff --git a/app/views/projects/commits/_commit.html.haml b/app/views/projects/commits/_commit.html.haml index 74146b5f196..abe0d4cff46 100644 --- a/app/views/projects/commits/_commit.html.haml +++ b/app/views/projects/commits/_commit.html.haml @@ -7,7 +7,8 @@ - if commit.description? %a.text-expander.js-toggle-button ... - = link_to "Browse Code »", project_tree_path(project, commit), class: "pull-right" + = link_to_browse_code(project, commit) + .notes_count - if @note_counts - note_count = @note_counts.fetch(commit.id, 0) @@ -21,7 +22,8 @@ - if commit.description? .commit-row-description.js-toggle-content - = simple_format(commit.description) + %pre + = commit.description .commit-row-info = commit_author_link(commit, avatar: true, size: 16) diff --git a/app/views/projects/commits/_diff_file.html.haml b/app/views/projects/commits/_diff_file.html.haml new file mode 100644 index 00000000000..9cbcb84aead --- /dev/null +++ b/app/views/projects/commits/_diff_file.html.haml @@ -0,0 +1,47 @@ +- file = project.repository.blob_for_diff(@commit, diff) +- return unless file +.diff-file{id: "diff-#{i}"} + .diff-header{id: "file-path-#{hexdigest(diff.new_path || diff.old_path)}"} + - if diff.deleted_file + %span= diff.old_path + + .diff-btn-group + - if @commit.parent_ids.present? + = link_to project_blob_path(project, tree_join(@commit.parent_id, diff.new_path)), { class: 'btn btn-small view-file' } do + View file @ + %span.commit-short-id= @commit.short_id(6) + - else + %span= diff.new_path + - if diff_file_mode_changed?(diff) + %span.file-mode= "#{diff.a_mode} → #{diff.b_mode}" + + .diff-btn-group + = link_to "#", class: "js-toggle-diff-comments btn btn-small" do + %i.icon-chevron-down + Diff comments + + + - if @merge_request && @merge_request.source_project + = link_to project_edit_tree_path(@merge_request.source_project, tree_join(@merge_request.source_branch, diff.new_path), from_merge_request_id: @merge_request.id), { class: 'btn btn-small' } do + Edit + + + = link_to project_blob_path(project, tree_join(@commit.id, diff.new_path)), { class: 'btn btn-small view-file' } do + View file @ + %span.commit-short-id= @commit.short_id(6) + + + .diff-content + -# Skipp all non non-supported blobs + - return unless file.respond_to?('text?') + - if file.text? + - if params[:view] == 'parallel' + = render "projects/commits/parallel_view", diff: diff, project: project, file: file, index: i + - else + = render "projects/commits/text_file", diff: diff, index: i + - elsif file.image? + - old_file = project.repository.prev_blob_for_diff(@commit, diff) + = render "projects/commits/image", diff: diff, old_file: old_file, file: file, index: i + - else + .nothing-here-block No preview for this file type + diff --git a/app/views/projects/commits/_diff_head.html.haml b/app/views/projects/commits/_diff_head.html.haml deleted file mode 100644 index 5aa542287fe..00000000000 --- a/app/views/projects/commits/_diff_head.html.haml +++ /dev/null @@ -1,26 +0,0 @@ -%ul.bordered-list - - diffs.each_with_index do |diff, i| - %li - - if diff.deleted_file - %span.deleted-file - %a{href: "#diff-#{i}"} - %i.icon-minus - = diff.old_path - - elsif diff.renamed_file - %span.renamed-file - %a{href: "#diff-#{i}"} - %i.icon-minus - = diff.old_path - = "->" - = diff.new_path - - elsif diff.new_file - %span.new-file - %a{href: "#diff-#{i}"} - %i.icon-plus - = diff.new_path - - else - %span.edit-file - %a{href: "#diff-#{i}"} - %i.icon-adjust - = diff.new_path - diff --git a/app/views/projects/commits/_diff_stats.html.haml b/app/views/projects/commits/_diff_stats.html.haml new file mode 100644 index 00000000000..846a1ee10e6 --- /dev/null +++ b/app/views/projects/commits/_diff_stats.html.haml @@ -0,0 +1,41 @@ +.js-toggle-container + .commit-stat-summary + Showing + %strong.cdark #{pluralize(diffs.count, "changed file")} + - if current_controller?(:commit) + - unless @commit.has_zero_stats? + with + %strong.cgreen #{@commit.stats.additions} additions + and + %strong.cred #{@commit.stats.deletions} deletions + + = link_to '#', class: 'btn btn-small js-toggle-button' do + Show diff stats + %i.icon-chevron-down + .file-stats.js-toggle-content.hide + %ul.bordered-list + - diffs.each_with_index do |diff, i| + %li + - if diff.deleted_file + %span.deleted-file + %a{href: "#diff-#{i}"} + %i.icon-minus + = diff.old_path + - elsif diff.renamed_file + %span.renamed-file + %a{href: "#diff-#{i}"} + %i.icon-minus + = diff.old_path + = "->" + = diff.new_path + - elsif diff.new_file + %span.new-file + %a{href: "#diff-#{i}"} + %i.icon-plus + = diff.new_path + - else + %span.edit-file + %a{href: "#diff-#{i}"} + %i.icon-adjust + = diff.new_path + diff --git a/app/views/projects/commits/_diff_warning.html.haml b/app/views/projects/commits/_diff_warning.html.haml new file mode 100644 index 00000000000..05d516efa11 --- /dev/null +++ b/app/views/projects/commits/_diff_warning.html.haml @@ -0,0 +1,19 @@ +.bs-callout.bs-callout-warning + %h4 + Too many changes. + .pull-right + - unless diff_hard_limit_enabled? + = link_to "Reload with full diff", url_for(params.merge(force_show_diff: true)), class: "btn btn-small btn-warning" + + - if current_controller?(:commit) or current_controller?(:merge_requests) + - if current_controller?(:commit) + = link_to "Plain diff", project_commit_path(@project, @commit, format: :diff), class: "btn btn-warning btn-small" + = link_to "Email patch", project_commit_path(@project, @commit, format: :patch), class: "btn btn-warning btn-small" + - elsif @merge_request && @merge_request.persisted? + = link_to "Plain diff", project_merge_request_path(@project, @merge_request, format: :diff), class: "btn btn-warning btn-small" + = link_to "Email patch", project_merge_request_path(@project, @merge_request, format: :patch), class: "btn btn-warning btn-small" + %p + To preserve performance only + %strong #{safe_diff_files(diffs).size} of #{diffs.size} + files displayed. + diff --git a/app/views/projects/commits/_diffs.html.haml b/app/views/projects/commits/_diffs.html.haml index fcdb40468d9..64d6a2f09cf 100644 --- a/app/views/projects/commits/_diffs.html.haml +++ b/app/views/projects/commits/_diffs.html.haml @@ -1,91 +1,23 @@ -- @suppress_diff ||= @suppress_diff || @force_suppress_diff -- if @suppress_diff - .alert.alert-warning - %p - %strong Warning! This is a large diff. - %p - To preserve performance the diff is not shown. - - if current_controller?(:commit) or current_controller?(:merge_requests) - - if current_controller?(:commit) - Please, download the diff as - = link_to "plain diff", project_commit_path(@project, @commit, format: :diff), class: "underlined-link" - or - = link_to "email patch", project_commit_path(@project, @commit, format: :patch), class: "underlined-link" - instead. - - elsif @merge_request && @merge_request.persisted? - Please, download the diff as - = link_to "plain diff", project_merge_request_path(@project, @merge_request, format: :diff), class: "underlined-link" - or - = link_to "email patch", project_merge_request_path(@project, @merge_request, format: :patch), class: "underlined-link" - instead. - - unless @force_suppress_diff - %p - If you still want to see the diff - = link_to "click this link", url_for(force_show_diff: true), class: "underlined-link" - -%p.commit-stat-summary - Showing - %strong.cdark #{pluralize(diffs.count, "changed file")} - - if current_controller?(:commit) - - unless @commit.has_zero_stats? - with - %strong.cgreen #{@commit.stats.additions} additions - and - %strong.cred #{@commit.stats.deletions} deletions - - if params[:view] == 'parallel' - = link_to "Inline Diff", url_for(view: 'inline'), {id: "commit-diff-viewtype", class: 'btn btn-tiny pull-right'} - - else - = link_to "Side-by-side Diff", url_for(view: 'parallel'), {id: "commit-diff-viewtype", class: 'btn btn-tiny pull-right'} -.file-stats - = render "projects/commits/diff_head", diffs: diffs +.row + .col-md-8 + = render 'projects/commits/diff_stats', diffs: diffs + .col-md-4 + %ul.nav.nav-tabs + %li.pull-right{class: params[:view] == 'parallel' ? 'active' : ''} + = link_to "Side-by-side Diff", url_for(view: 'parallel'), {id: "commit-diff-viewtype"} + %li.pull-right{class: params[:view] != 'parallel' ? 'active' : ''} + = link_to "Inline Diff", url_for(view: 'inline'), {id: "commit-diff-viewtype"} + +- if show_diff_size_warninig?(diffs) + = render 'projects/commits/diff_warning', diffs: diffs .files - - unless @suppress_diff - - diffs.each_with_index do |diff, i| - - file = project.repository.blob_at(@commit.id, diff.new_path) - - file = project.repository.blob_at(@commit.parent_id, diff.old_path) unless file - - next unless file - .diff-file{id: "diff-#{i}"} - .diff-header{id: "file-path-#{hexdigest(diff.new_path || diff.old_path)}"} - - if diff.deleted_file - %span= diff.old_path - - .diff-btn-group - - if @commit.parent_ids.present? - = link_to project_blob_path(project, tree_join(@commit.parent_id, diff.new_path)), { class: 'btn btn-small view-file' } do - View file @ - %span.commit-short-id= @commit.short_id(6) - - else - %span= diff.new_path - - if diff_file_mode_changed?(diff) - %span.file-mode= "#{diff.a_mode} → #{diff.b_mode}" - - .diff-btn-group - = link_to "#", class: "js-toggle-diff-comments btn btn-small" do - %i.icon-chevron-down - Diff comments - + - safe_diff_files(diffs).each_with_index do |diff, i| + = render 'projects/commits/diff_file', diff: diff, i: i, project: project - - if @merge_request && @merge_request.source_project - = link_to project_edit_tree_path(@merge_request.source_project, tree_join(@merge_request.source_branch, diff.new_path), from_merge_request_id: @merge_request.id), { class: 'btn btn-small' } do - Edit - - - = link_to project_blob_path(project, tree_join(@commit.id, diff.new_path)), { class: 'btn btn-small view-file' } do - View file @ - %span.commit-short-id= @commit.short_id(6) - - - .diff-content - -# Skipp all non non-supported blobs - - next unless file.respond_to?('text?') - - if file.text? - - if params[:view] == 'parallel' - = render "projects/commits/parallel_view", diff: diff, project: project, file: file, index: i - - else - = render "projects/commits/text_file", diff: diff, index: i - - elsif file.image? - - old_file = project.repository.blob_at(@commit.parent_id, diff.old_path) if @commit.parent_id - = render "projects/commits/image", diff: diff, old_file: old_file, file: file, index: i - - else - .nothing-here-block No preview for this file type +- if @diff_timeout + .alert.alert-danger + %h4 + Failed to collect changes + %p + Maybe diff is really big and operation failed with timeout. Try to get diff localy diff --git a/app/views/projects/commits/_text_file.html.haml b/app/views/projects/commits/_text_file.html.haml index 8ced4133294..f5b0d711416 100644 --- a/app/views/projects/commits/_text_file.html.haml +++ b/app/views/projects/commits/_text_file.html.haml @@ -1,4 +1,4 @@ -- too_big = diff.diff.lines.count > 1000 +- too_big = diff.diff.lines.count > Commit::DIFF_SAFE_LINES - if too_big %a.supp_diff_link Changes suppressed. Click to show diff --git a/app/views/projects/compare/show.html.haml b/app/views/projects/compare/show.html.haml index b232d2a6b26..240bfe7484e 100644 --- a/app/views/projects/compare/show.html.haml +++ b/app/views/projects/compare/show.html.haml @@ -18,18 +18,7 @@ - else %ul.well-list= render Commit.decorate(@commits), project: @project - %h4 Changes - - if @diffs.present? - = render "projects/commits/diffs", diffs: @diffs, project: @project - - elsif @commits.size > MergeRequestDiff::COMMITS_SAFE_SIZE - .bs-callout.bs-callout-danger - %h4 This comparison includes more than #{MergeRequestDiff::COMMITS_SAFE_SIZE} commits. - %p To preserve performance the line changes are not shown. - - elsif @timeout - .bs-callout.bs-callout-danger - %h4 Number of changed files for this comparison is extremely large. - %p Use command line to browse through changes for this comparison. - + = render "projects/commits/diffs", diffs: @diffs, project: @project - else .light-well diff --git a/app/views/projects/edit.html.haml b/app/views/projects/edit.html.haml index 6eaa3e7559a..99b6d8ad288 100644 --- a/app/views/projects/edit.html.haml +++ b/app/views/projects/edit.html.haml @@ -33,12 +33,12 @@ %fieldset.features %legend - Labels: + Tags: .form-group - = f.label :label_list, "Labels", class: 'control-label' + = f.label :tag_list, "Tags", class: 'control-label' .col-sm-10 - = f.text_field :label_list, maxlength: 2000, class: "form-control" - %p.hint Separate labels with commas. + = f.text_field :tag_list, maxlength: 2000, class: "form-control" + %p.hint Separate tags with commas. %fieldset.features %legend diff --git a/app/views/projects/edit_tree/show.html.haml b/app/views/projects/edit_tree/show.html.haml index 16fc1ab1f91..05050e7df7c 100644 --- a/app/views/projects/edit_tree/show.html.haml +++ b/app/views/projects/edit_tree/show.html.haml @@ -16,7 +16,7 @@ .btn-group.tree-btn-group = link_to "Cancel", @after_edit_path, class: "btn btn-tiny btn-cancel", data: { confirm: leave_edit_message } .file-content.code - %pre.js-edit-mode-pane#editor= @blob.data + %pre.js-edit-mode-pane#editor .js-edit-mode-pane#preview.hide .center %h2 @@ -43,6 +43,7 @@ ace.config.set("modePath", gon.relative_url_root + "#{Gitlab::Application.config.assets.prefix}/ace") var ace_mode = "#{@blob.language.try(:ace_mode)}"; var editor = ace.edit("editor"); + editor.setValue("#{escape_javascript(@blob.data)}"); if (ace_mode) { editor.getSession().setMode('ace/mode/' + ace_mode); } diff --git a/app/views/projects/issues/_form.html.haml b/app/views/projects/issues/_form.html.haml index d29a7973100..b2a8e8e091e 100644 --- a/app/views/projects/issues/_form.html.haml +++ b/app/views/projects/issues/_form.html.haml @@ -3,15 +3,19 @@ %hr - if @repository.exists? && !@repository.empty? && @repository.contribution_guide && !@issue.persisted? - contribution_guide_url = project_blob_path(@project, tree_join(@repository.root_ref, @repository.contribution_guide.name)) - .alert.alert-info.col-sm-10.col-sm-offset-2 - ="Please review the <strong>#{link_to "guidelines for contribution", contribution_guide_url}</strong> to this repository.".html_safe + .row + .col-sm-10.col-sm-offset-2 + .alert.alert-info + = "Please review the <strong>#{link_to "guidelines for contribution", contribution_guide_url}</strong> to this repository.".html_safe = form_for [@project, @issue], html: { class: 'form-horizontal issue-form' } do |f| -if @issue.errors.any? - .alert.alert-danger - - @issue.errors.full_messages.each do |msg| - %span= msg - %br + .row + .col-sm-10.col-sm-offset-2 + .alert.alert-danger + - @issue.errors.full_messages.each do |msg| + %span= msg + %br .form-group = f.label :title, class: 'control-label' do %strong= 'Title *' @@ -44,14 +48,11 @@ .col-sm-10= f.select(:milestone_id, milestone_options(@issue), { include_blank: "Select milestone" }, {class: 'select2'}) .form-group - = f.label :label_list, class: 'control-label' do + = f.label :label_ids, class: 'control-label' do %i.icon-tag Labels .col-sm-10 - = f.text_field :label_list, maxlength: 2000, class: "form-control" - %p.hint Separate labels with commas. - - + = f.collection_select :label_ids, @project.labels.all, :id, :name, { selected: @issue.label_ids }, multiple: true, class: 'select2' .form-actions - if @issue.new_record? @@ -63,35 +64,6 @@ = link_to "Cancel", cancel_path, class: 'btn btn-cancel' :javascript - $("#issue_label_list") - .bind( "keydown", function( event ) { - if ( event.keyCode === $.ui.keyCode.TAB && - $( this ).data( "autocomplete" ).menu.active ) { - event.preventDefault(); - } - }) - .bind("click", function(event) { - $(this).autocomplete("search", ""); - }) - .autocomplete({ - minLength: 0, - source: function( request, response ) { - response( $.ui.autocomplete.filter( - #{raw labels_autocomplete_source}, extractLast( request.term ) ) ); - }, - focus: function() { - return false; - }, - select: function(event, ui) { - var terms = split( this.value ); - terms.pop(); - terms.push( ui.item.value ); - terms.push( "" ); - this.value = terms.join( ", " ); - return false; - } - }); - $('.assign-to-me-link').on('click', function(e){ $('#issue_assignee_id').val("#{current_user.id}").trigger("change"); e.preventDefault(); diff --git a/app/views/projects/issues/_head.html.haml b/app/views/projects/issues/_head.html.haml index 716ea7cefed..dad547d4ebc 100644 --- a/app/views/projects/issues/_head.html.haml +++ b/app/views/projects/issues/_head.html.haml @@ -2,8 +2,6 @@ = nav_link(controller: :issues) do = link_to project_issues_path(@project), class: "tab" do Browse Issues - - if current_controller?(:issues) - %span.badge.issue_counter #{@issues.total_count} = nav_link(controller: :milestones) do = link_to 'Milestones', project_milestones_path(@project), class: "tab" = nav_link(controller: :labels) do diff --git a/app/views/projects/issues/_issue.html.haml b/app/views/projects/issues/_issue.html.haml index 3fc04c26cf2..db28b831182 100644 --- a/app/views/projects/issues/_issue.html.haml +++ b/app/views/projects/issues/_issue.html.haml @@ -31,16 +31,14 @@ .issue-labels - issue.labels.each do |label| - %span{class: "label #{label_css_class(label.name)}"} - %i.icon-tag - = label.name + = render_colored_label(label) .issue-actions - if can? current_user, :modify_issue, issue - if issue.closed? - = link_to 'Reopen', project_issue_path(issue.project, issue, issue: {state_event: :reopen }, status_only: true), method: :put, class: "btn btn-small btn-grouped reopen_issue", remote: true + = link_to 'Reopen', project_issue_path(issue.project, issue, issue: {state_event: :reopen }, status_only: true), method: :put, class: "btn btn-small btn-grouped reopen_issue btn-reopen", remote: true - else - = link_to 'Close', project_issue_path(issue.project, issue, issue: {state_event: :close }, status_only: true), method: :put, class: "btn btn-small btn-grouped close_issue", remote: true + = link_to 'Close', project_issue_path(issue.project, issue, issue: {state_event: :close }, status_only: true), method: :put, class: "btn btn-small btn-grouped close_issue btn-close", remote: true = link_to edit_project_issue_path(issue.project, issue), class: "btn btn-small edit-issue-link btn-grouped" do %i.icon-edit Edit diff --git a/app/views/projects/issues/index.html.haml b/app/views/projects/issues/index.html.haml index 2e66d059565..5de77b8bf32 100644 --- a/app/views/projects/issues/index.html.haml +++ b/app/views/projects/issues/index.html.haml @@ -4,6 +4,6 @@ %i.icon-list.icon-2x .col-md-3.responsive-side = render 'shared/project_filter', project_entities_path: project_issues_path(@project), - labels: true, redirect: 'issues' + labels: true, redirect: 'issues', entity: 'issue' .col-md-9.issues-holder = render "issues" diff --git a/app/views/projects/issues/show.html.haml b/app/views/projects/issues/show.html.haml index 695eb225754..bd5f01ff6a7 100644 --- a/app/views/projects/issues/show.html.haml +++ b/app/views/projects/issues/show.html.haml @@ -68,9 +68,6 @@ .issue-show-labels.pull-right - @issue.labels.each do |label| - %span{class: "label #{label_css_class(label.name)}"} - %i.icon-tag - = label.name - + = render_colored_label(label) .voting_notes#notes= render "projects/notes/notes_with_form" diff --git a/app/views/projects/labels/_form.html.haml b/app/views/projects/labels/_form.html.haml new file mode 100644 index 00000000000..2a5c907febe --- /dev/null +++ b/app/views/projects/labels/_form.html.haml @@ -0,0 +1,49 @@ += form_for [@project, @label], html: { class: 'form-horizontal label-form' } do |f| + -if @label.errors.any? + .row + .col-sm-10.col-sm-offset-2 + .bs-callout.bs-callout-danger + - @label.errors.full_messages.each do |msg| + %span= msg + %br + + .form-group + = f.label :title, class: 'control-label' + .col-sm-10 + = f.text_field :title, class: "form-control", required: true + .form-group + = f.label :color, "Background Color", class: 'control-label' + .col-sm-10 + .input-group + .input-group-addon.label-color-preview + = f.text_field :color, placeholder: "#AA33EE", class: "form-control" + .help-block + 6 character hex values starting with a # sign. + %br + Or you can choose one of suggested colors below + + .suggest-colors + - suggested_colors.each do |color| + = link_to '#', style: "background-color: #{color}", data: { color: color } do + + + .form-actions + = f.submit 'Save', class: 'btn btn-save' + = link_to "Cancel", project_labels_path(@project), class: 'btn btn-cancel' + + +:coffeescript + updateColorPreview = -> + previewColor = $('input#label_color').val() + $('div.label-color-preview').css('background-color', previewColor) + + $('.suggest-colors a').on 'click', (e) -> + color = $(this).data("color") + $('input#label_color').val(color) + updateColorPreview() + e.preventDefault() + + $('input#label_color').on 'input', -> + updateColorPreview() + + updateColorPreview() diff --git a/app/views/projects/labels/_label.html.haml b/app/views/projects/labels/_label.html.haml index 6e1ca0d8f2f..725bf852078 100644 --- a/app/views/projects/labels/_label.html.haml +++ b/app/views/projects/labels/_label.html.haml @@ -1,13 +1,10 @@ -- frequency = @project.issues.tagged_with(label.name).count -%li - %span{class: "label #{label_css_class(label.name)}"} - %i.icon-tag - - if frequency.zero? - %span.light= label.name - - else - = label.name +%li{id: dom_id(label)} + = render_colored_label(label) .pull-right - - unless frequency.zero? - = link_to project_issues_path(label_name: label.name) do - = pluralize(frequency, 'issue') - = "»" + %strong.append-right-20 + = link_to project_issues_path(@project, label_name: label.name) do + = pluralize label.open_issues_count, 'open issue' + + - if can? current_user, :admin_label, @project + = link_to 'Edit', edit_project_label_path(@project, label), class: 'btn' + = link_to 'Remove', project_label_path(@project, label), class: 'btn btn-remove', method: :delete, data: {confirm: "Remove this label? Are you sure?"} diff --git a/app/views/projects/labels/edit.html.haml b/app/views/projects/labels/edit.html.haml new file mode 100644 index 00000000000..52435c5d892 --- /dev/null +++ b/app/views/projects/labels/edit.html.haml @@ -0,0 +1,8 @@ +%h3 + Edit label + %span.light #{@label.name} +.back-link + = link_to project_labels_path(@project) do + ← To labels list +%hr += render 'form' diff --git a/app/views/projects/labels/index.html.haml b/app/views/projects/labels/index.html.haml index 329cf9ceba8..075779a9c88 100644 --- a/app/views/projects/labels/index.html.haml +++ b/app/views/projects/labels/index.html.haml @@ -1,10 +1,17 @@ = render "projects/issues/head" +- if can? current_user, :admin_label, @project + = link_to new_project_label_path(@project), class: "pull-right btn btn-new" do + New label +%h3.page-title + Labels +%hr + - if @labels.present? - %ul.bordered-list.labels-table - - @labels.each do |label| - = render 'label', label: label + %ul.bordered-list.manage-labels-list + = render @labels + = paginate @labels, theme: 'gitlab' - else .light-well - .nothing-here-block Add first label to your issues or #{link_to 'generate', generate_project_labels_path(@project), method: :post} default set of labels + .nothing-here-block Create first label or #{link_to 'generate', generate_project_labels_path(@project), method: :post} default set of labels diff --git a/app/views/projects/labels/new.html.haml b/app/views/projects/labels/new.html.haml new file mode 100644 index 00000000000..850da0b192b --- /dev/null +++ b/app/views/projects/labels/new.html.haml @@ -0,0 +1,6 @@ +%h3 New label +.back-link + = link_to project_labels_path(@project) do + ← To labels list +%hr += render 'form' diff --git a/app/views/projects/merge_requests/_form.html.haml b/app/views/projects/merge_requests/_form.html.haml index 9ef232b5268..0af89b6e376 100644 --- a/app/views/projects/merge_requests/_form.html.haml +++ b/app/views/projects/merge_requests/_form.html.haml @@ -46,14 +46,12 @@ .col-sm-10= f.select(:milestone_id, milestone_options(@merge_request), { include_blank: "Select milestone" }, {class: 'select2'}) - - if @merge_request.persisted? # Only allow labels on edit to avoid fork vs upstream repo labels issue - .form-group - = f.label :label_list, class: 'control-label' do - %i.icon-tag - Labels - .col-sm-10 - = f.text_field :label_list, maxlength: 2000, class: "form-control" - %p.hint Separate labels with commas. + .form-group + = f.label :label_ids, class: 'control-label' do + %i.icon-tag + Labels + .col-sm-10 + = f.collection_select :label_ids, @merge_request.target_project.labels.all, :id, :name, { selected: @merge_request.label_ids }, multiple: true, class: 'select2' .form-actions - if @merge_request.new_record? @@ -74,33 +72,4 @@ e.preventDefault(); }); - $("#merge_request_label_list") - .bind( "keydown", function( event ) { - if ( event.keyCode === $.ui.keyCode.TAB && - $( this ).data( "autocomplete" ).menu.active ) { - event.preventDefault(); - } - }) - .bind("click", function(event) { - $(this).autocomplete("search", ""); - }) - .autocomplete({ - minLength: 0, - source: function( request, response ) { - response( $.ui.autocomplete.filter( - #{raw labels_autocomplete_source}, extractLast( request.term ) ) ); - }, - focus: function() { - return false; - }, - select: function(event, ui) { - var terms = split( this.value ); - terms.pop(); - terms.push( ui.item.value ); - terms.push( "" ); - this.value = terms.join( ", " ); - return false; - } - }); - window.project_image_path_upload = "#{upload_image_project_path @project}"; diff --git a/app/views/projects/merge_requests/_merge_request.html.haml b/app/views/projects/merge_requests/_merge_request.html.haml index c9a80ec22ef..7f5de232dcf 100644 --- a/app/views/projects/merge_requests/_merge_request.html.haml +++ b/app/views/projects/merge_requests/_merge_request.html.haml @@ -34,6 +34,4 @@ .merge-request-labels - merge_request.labels.each do |label| - %span{class: "label #{label_css_class(label.name)}"} - %i.icon-tag - = label.name + = render_colored_label(label) diff --git a/app/views/projects/merge_requests/_new_compare.html.haml b/app/views/projects/merge_requests/_new_compare.html.haml index 18e3f419c72..99726172154 100644 --- a/app/views/projects/merge_requests/_new_compare.html.haml +++ b/app/views/projects/merge_requests/_new_compare.html.haml @@ -27,13 +27,13 @@ .panel-footer .mr_target_commit - -if @merge_request.errors.any? + - if @merge_request.errors.any? .alert.alert-danger - @merge_request.errors.full_messages.each do |msg| %div= msg - - if @merge_request.source_branch.present? && @merge_request.target_branch.present? - - if @compare_failed + - elsif @merge_request.source_branch.present? && @merge_request.target_branch.present? + - if @merge_request.compare_failed .alert.alert-danger %h4 Compare failed %p We can't compare selected branches. It may be because of huge diff or satellite timeout. Please try again or select different branches. diff --git a/app/views/projects/merge_requests/_new_submit.html.haml b/app/views/projects/merge_requests/_new_submit.html.haml index 34a30975e07..7c43d355987 100644 --- a/app/views/projects/merge_requests/_new_submit.html.haml +++ b/app/views/projects/merge_requests/_new_submit.html.haml @@ -2,11 +2,9 @@ New merge request %p.slead From - %strong.monospace - #{@merge_request.source_project_namespace}:#{@merge_request.source_branch} - into - %strong.monospace - #{@merge_request.target_project_namespace}:#{@merge_request.target_branch} + %strong.label-branch #{@merge_request.source_project_namespace}:#{@merge_request.source_branch} + %span into + %strong.label-branch #{@merge_request.target_project_namespace}:#{@merge_request.target_branch} %span.pull-right = link_to 'Change branches', new_project_merge_request_path(@project) @@ -43,12 +41,18 @@ %i.icon-time Milestone %div= f.select(:milestone_id, milestone_options(@merge_request), { include_blank: "Select milestone" }, {class: 'select2'}) + .form-group + = f.label :label_ids do + %i.icon-tag + Labels + %div + = f.collection_select :label_ids, @merge_request.target_project.labels.all, :id, :name, { selected: @merge_request.label_ids }, multiple: true, class: 'select2' + .panel-footer - - if @target_repo.contribution_guide - - contribution_guide_url = project_blob_path(@target_project, tree_join(@target_repo.root_ref, @target_repo.contribution_guide.name)) + - if contribution_guide_url(@target_project) %p Please review the - %strong #{link_to "guidelines for contribution", contribution_guide_url} + %strong #{link_to "guidelines for contribution", contribution_guide_url(@target_project)} to this repository. = f.hidden_field :source_project_id = f.hidden_field :target_project_id @@ -76,6 +80,10 @@ .bs-callout.bs-callout-danger %h4 This comparison includes more than #{MergeRequestDiff::COMMITS_SAFE_SIZE} commits. %p To preserve performance the line changes are not shown. + - else + .bs-callout.bs-callout-danger + %h4 This comparison includes huge diff. + %p To preserve performance the line changes are not shown. :javascript diff --git a/app/views/projects/merge_requests/index.html.haml b/app/views/projects/merge_requests/index.html.haml index 4bb803eb6df..0954fa8fcea 100644 --- a/app/views/projects/merge_requests/index.html.haml +++ b/app/views/projects/merge_requests/index.html.haml @@ -4,14 +4,13 @@ New Merge Request %h3.page-title Merge Requests - %span (#{@merge_requests.total_count}) %hr .row .fixed.sidebar-expand-button.hidden-lg.hidden-md %i.icon-list.icon-2x .col-md-3.responsive-side = render 'shared/project_filter', project_entities_path: project_merge_requests_path(@project), - labels: true, redirect: 'merge_requests' + labels: true, redirect: 'merge_requests', entity: 'merge_request' .col-md-9 .mr-filters.append-bottom-10 .dropdown.inline diff --git a/app/views/projects/merge_requests/new.html.haml b/app/views/projects/merge_requests/new.html.haml index c24e5916721..4756903d0e0 100644 --- a/app/views/projects/merge_requests/new.html.haml +++ b/app/views/projects/merge_requests/new.html.haml @@ -1,4 +1,4 @@ -- if @commits.present? +- if @merge_request.can_be_created = render 'new_submit' - else = render 'new_compare' diff --git a/app/views/projects/merge_requests/show/_mr_accept.html.haml b/app/views/projects/merge_requests/show/_mr_accept.html.haml index 07e05f55012..ead19ec05cf 100644 --- a/app/views/projects/merge_requests/show/_mr_accept.html.haml +++ b/app/views/projects/merge_requests/show/_mr_accept.html.haml @@ -38,7 +38,7 @@ .accept-group .pull-left = f.submit "Accept Merge Request", class: "btn btn-create accept_merge_request" - - if can_remove_branch?(@merge_request.source_project, @merge_request.source_branch) + - if can_remove_branch?(@merge_request.source_project, @merge_request.source_branch) && !@merge_request.for_fork? .remove_branch_holder.pull-left = label_tag :should_remove_source_branch, class: "checkbox" do = check_box_tag :should_remove_source_branch diff --git a/app/views/projects/merge_requests/show/_mr_ci.html.haml b/app/views/projects/merge_requests/show/_mr_ci.html.haml index 507a9e507f1..b77eeac6123 100644 --- a/app/views/projects/merge_requests/show/_mr_ci.html.haml +++ b/app/views/projects/merge_requests/show/_mr_ci.html.haml @@ -1,21 +1,21 @@ - if @commits.any? .ci_widget.ci-success{style: "display:none"} %i.icon-ok - %strong CI build passed + %span CI build passed for #{@merge_request.last_commit_short_sha}. = link_to "Build page", ci_build_details_path(@merge_request) .ci_widget.ci-failed{style: "display:none"} %i.icon-remove - %strong CI build failed + %span CI build failed for #{@merge_request.last_commit_short_sha}. = link_to "Build page", ci_build_details_path(@merge_request) - [:running, :pending].each do |status| .ci_widget{class: "ci-#{status}", style: "display:none"} %i.icon-time - %strong CI build #{status} + %span CI build #{status} for #{@merge_request.last_commit_short_sha}. = link_to "Build page", ci_build_details_path(@merge_request) @@ -26,4 +26,4 @@ .ci_widget.ci-error{style: "display:none"} %i.icon-remove - %strong Cannot connect to the CI server. Please check your settings and try again. + %span Cannot connect to the CI server. Please check your settings and try again. diff --git a/app/views/projects/merge_requests/show/_mr_title.html.haml b/app/views/projects/merge_requests/show/_mr_title.html.haml index 2c905413bc3..563a5244993 100644 --- a/app/views/projects/merge_requests/show/_mr_title.html.haml +++ b/app/views/projects/merge_requests/show/_mr_title.html.haml @@ -28,15 +28,13 @@ = link_to project_merge_requests_path(@project) do ← To merge requests - %span.prepend-left-20.monospace - -if @merge_request.for_fork? - %span - %strong - #{truncate(@merge_request.source_project_path, length: 25)}: - #{@merge_request.source_branch} - → - %span= @merge_request.target_branch + %span.prepend-left-20 + %span From + - if @merge_request.for_fork? + %strong.label-branch #{@merge_request.source_project_namespace}:#{@merge_request.source_branch} + %span into + %strong.label-branch #{@merge_request.target_project_namespace}:#{@merge_request.target_branch} - else - %span= @merge_request.source_branch - → - %span= @merge_request.target_branch + %strong.label-branch #{@merge_request.source_branch} + %span into + %strong.label-branch #{@merge_request.target_branch} diff --git a/app/views/projects/merge_requests/show/_participants.html.haml b/app/views/projects/merge_requests/show/_participants.html.haml index 0dabd965e52..007c111f7fb 100644 --- a/app/views/projects/merge_requests/show/_participants.html.haml +++ b/app/views/projects/merge_requests/show/_participants.html.haml @@ -5,7 +5,4 @@ .merge-request-show-labels.pull-right - @merge_request.labels.each do |label| - %span{class: "label #{label_css_class(label.name)}"} - %i.icon-tag - = label.name - + = render_colored_label(label) diff --git a/app/views/projects/milestones/_issue.html.haml b/app/views/projects/milestones/_issue.html.haml index 08ccd0cdc8a..b5ec0fc9882 100644 --- a/app/views/projects/milestones/_issue.html.haml +++ b/app/views/projects/milestones/_issue.html.haml @@ -2,7 +2,7 @@ %span.str-truncated = link_to [@project, issue] do %span.cgray ##{issue.iid} - = link_to_gfm issue.title, [@project, issue] + = link_to_gfm issue.title, [@project, issue], title: issue.title .pull-right.assignee-icon - if issue.assignee = image_tag avatar_icon(issue.assignee.email, 16), class: "avatar s16" diff --git a/app/views/projects/milestones/_merge_request.html.haml b/app/views/projects/milestones/_merge_request.html.haml index d630c4518dd..d54cb3f8e74 100644 --- a/app/views/projects/milestones/_merge_request.html.haml +++ b/app/views/projects/milestones/_merge_request.html.haml @@ -2,4 +2,4 @@ %span.str-truncated = link_to [@project, merge_request] do %span.cgray ##{merge_request.iid} - = link_to_gfm truncate(merge_request.title, length: 60), [@project, merge_request] + = link_to_gfm merge_request.title, [@project, merge_request], title: merge_request.title diff --git a/app/views/projects/milestones/_milestone.html.haml b/app/views/projects/milestones/_milestone.html.haml index 5579659d60e..4018d132a55 100644 --- a/app/views/projects/milestones/_milestone.html.haml +++ b/app/views/projects/milestones/_milestone.html.haml @@ -4,7 +4,7 @@ = link_to edit_project_milestone_path(milestone.project, milestone), class: "btn btn-small edit-milestone-link btn-grouped" do %i.icon-edit Edit - = link_to 'Close Milestone', project_milestone_path(@project, milestone, milestone: {state_event: :close }), method: :put, remote: true, class: "btn btn-small btn-remove" + = link_to 'Close Milestone', project_milestone_path(@project, milestone, milestone: {state_event: :close }), method: :put, remote: true, class: "btn btn-small btn-close" %h4 = link_to_gfm truncate(milestone.title, length: 100), project_milestone_path(milestone.project, milestone) - if milestone.expired? and not milestone.closed? diff --git a/app/views/projects/milestones/show.html.haml b/app/views/projects/milestones/show.html.haml index 5cf7f332118..42c3f45f6c9 100644 --- a/app/views/projects/milestones/show.html.haml +++ b/app/views/projects/milestones/show.html.haml @@ -7,9 +7,9 @@ %i.icon-edit Edit - if @milestone.active? - = link_to 'Close Milestone', project_milestone_path(@project, @milestone, milestone: {state_event: :close }), method: :put, class: "btn btn-remove btn-grouped" + = link_to 'Close Milestone', project_milestone_path(@project, @milestone, milestone: {state_event: :close }), method: :put, class: "btn btn-close btn-grouped" - else - = link_to 'Reopen Milestone', project_milestone_path(@project, @milestone, milestone: {state_event: :activate }), method: :put, class: "btn btn-grouped" + = link_to 'Reopen Milestone', project_milestone_path(@project, @milestone, milestone: {state_event: :activate }), method: :put, class: "btn btn-reopen btn-grouped" - if @milestone.issues.any? && @milestone.can_be_closed? .alert.alert-success diff --git a/app/views/projects/repositories/_download_archive.html.haml b/app/views/projects/repositories/_download_archive.html.haml index 88c1cfa28e0..0bf59a20384 100644 --- a/app/views/projects/repositories/_download_archive.html.haml +++ b/app/views/projects/repositories/_download_archive.html.haml @@ -34,4 +34,4 @@ %span zip = link_to archive_project_repository_path(@project, ref: ref, format: 'tar.gz'), class: 'btn', rel: 'nofollow' do %i.icon-download-alt - %span tar.gz
\ No newline at end of file + %span tar.gz diff --git a/app/views/projects/show.html.haml b/app/views/projects/show.html.haml index c4e5087b0a1..0fd290b5398 100644 --- a/app/views/projects/show.html.haml +++ b/app/views/projects/show.html.haml @@ -15,24 +15,37 @@ Archived project! %p Repository is read-only - - if @project.forked_from_project .alert.alert-success %i.icon-code-fork.project-fork-icon Forked from: %br = link_to @project.forked_from_project.name_with_namespace, project_path(@project.forked_from_project) - - unless @project.empty_repo? - - if current_user && can?(current_user, :fork_project, @project) && @project.namespace != current_user.namespace - - if current_user.already_forked?(@project) - = link_to project_path(current_user.fork_of(@project)), class: 'btn btn-block' do - %i.icon-compass - Go to fork + + .star-buttons + %span.star.js-toggler-container{class: @show_star ? 'on' : ''} + - if current_user + = link_to_toggle_star('Star this project.', false, true) + = link_to_toggle_star('Unstar this project.', true, true) - else - = link_to fork_project_path(@project), title: "Fork", class: "btn btn-block", method: "POST" do - %i.icon-code-fork - Fork repository + = link_to_toggle_star('You must sign in to star a project.', false, false) + - unless @project.empty_repo? + .fork-buttons + - if current_user && can?(current_user, :fork_project, @project) && @project.namespace != current_user.namespace + - if current_user.already_forked?(@project) + = link_to project_path(current_user.fork_of(@project)), class: 'btn btn-block' do + %i.icon-compass + Go to fork + %span.count + = @project.forks_count + - else + = link_to fork_project_path(@project), title: "Fork", class: "btn btn-block", method: "POST" do + %i.icon-code-fork + Fork repository + %span.count + = @project.forks_count + - unless @project.empty_repo? - if can? current_user, :download_code, @project = render 'projects/repositories/download_archive', btn_class: 'btn-block btn-group-justified', split_button: true @@ -48,7 +61,8 @@ - version = @repository.version = link_to project_blob_path(@project, tree_join(@repository.root_ref, version.name)), class: 'btn btn-block' do Version: - = @repository.blob_by_oid(version.id).data + %span.count + = @repository.blob_by_oid(version.id).data .prepend-top-10 %p diff --git a/app/views/public/projects/index.html.haml b/app/views/public/projects/index.html.haml deleted file mode 100644 index 624ec0b9b95..00000000000 --- a/app/views/public/projects/index.html.haml +++ /dev/null @@ -1,68 +0,0 @@ -%h3.page-title - Projects (#{@projects.total_count}) -.light - You can browse public projects in read-only mode until signed in. -%hr -.clearfix - .pull-left - = form_tag public_projects_path, method: :get, class: 'form-inline form-tiny' do |f| - .form-group - = search_field_tag :search, params[:search], placeholder: "Filter by name", class: "form-control search-text-input input-mn-300", id: "projects_search" - .form-group - = submit_tag 'Search', class: "btn btn-primary wide" - - .pull-right - .dropdown.inline - %a.dropdown-toggle.btn{href: '#', "data-toggle" => "dropdown"} - %span.light sort: - - if @sort.present? - = @sort.humanize - - else - Name - %b.caret - %ul.dropdown-menu - %li - = link_to public_projects_path(sort: nil) do - Name - = link_to public_projects_path(sort: 'newest') do - Newest - = link_to public_projects_path(sort: 'oldest') do - Oldest - = link_to public_projects_path(sort: 'recently_updated') do - Recently updated - = link_to public_projects_path(sort: 'last_updated') do - Last updated - -%hr -.public-projects - %ul.bordered-list.top-list - - @projects.each do |project| - %li - %h4 - = link_to project_path(project) do - = project.name_with_namespace - - if project.internal? - %small.access-icon - = internal_icon - Internal - .pull-right - %pre.public-clone git clone #{project.http_url_to_repo} - - - if project.description.present? - %p - = project.description - - .repo-info - - unless project.empty_repo? - = link_to pluralize(project.repository.round_commit_count, 'commit'), project_commits_path(project, project.default_branch) - · - = link_to pluralize(project.repository.branch_names.count, 'branch'), project_branches_path(project) - · - = link_to pluralize(project.repository.tag_names.count, 'tag'), project_tags_path(project) - - else - %i.icon-warning-sign - Empty repository - - unless @projects.present? - .nothing-here-block No public projects - - = paginate @projects, theme: "gitlab" diff --git a/app/views/search/results/_issue.html.haml b/app/views/search/results/_issue.html.haml index 7a24b76bced..8147cf272fb 100644 --- a/app/views/search/results/_issue.html.haml +++ b/app/views/search/results/_issue.html.haml @@ -6,4 +6,4 @@ = truncate issue.title, length: 50 %span.light (#{issue.project.name_with_namespace}) - if issue.closed? - %span.label Closed + %span.label.label-danger Closed diff --git a/app/views/search/results/_merge_request.html.haml b/app/views/search/results/_merge_request.html.haml index 22d7587f6c1..de2a79970c1 100644 --- a/app/views/search/results/_merge_request.html.haml +++ b/app/views/search/results/_merge_request.html.haml @@ -8,5 +8,7 @@ %span.light (#{merge_request.source_project.name_with_namespace}:#{merge_request.source_branch} → #{merge_request.target_project.name_with_namespace}:#{merge_request.target_branch}) - else %span.light (#{merge_request.source_branch} → #{merge_request.target_branch}) - - if merge_request.closed? - %span.label Closed + - if merge_request.merged? + %span.label.label-primary Merged + - elsif merge_request.closed? + %span.label.label-danger Closed diff --git a/app/views/shared/_filter.html.haml b/app/views/shared/_filter.html.haml index 19ecc458e29..9e65ce11ade 100644 --- a/app/views/shared/_filter.html.haml +++ b/app/views/shared/_filter.html.haml @@ -6,12 +6,18 @@ %li{class: ("active" if params[:scope] == 'assigned-to-me')} = link_to filter_path(entity, scope: 'assigned-to-me') do Assigned to me + %span.pull-right + = assigned_entities_count(current_user, entity, @group) %li{class: ("active" if params[:scope] == 'authored')} = link_to filter_path(entity, scope: 'authored') do Created by me + %span.pull-right + = authored_entities_count(current_user, entity, @group) %li{class: ("active" if params[:scope] == 'all')} = link_to filter_path(entity, scope: 'all') do Everyone's + %span.pull-right + = authorized_entities_count(current_user, entity, @group) %fieldset.status-filter %legend State diff --git a/app/views/shared/_project_filter.html.haml b/app/views/shared/_project_filter.html.haml index 743b4fba542..5e7d1c2c885 100644 --- a/app/views/shared/_project_filter.html.haml +++ b/app/views/shared/_project_filter.html.haml @@ -6,12 +6,18 @@ %li{class: ("active" if params[:scope] == 'all')} = link_to project_filter_path(scope: 'all') do Everyone's + %span.pull-right + = authorized_entities_count(current_user, entity, @project) %li{class: ("active" if params[:scope] == 'assigned-to-me')} = link_to project_filter_path(scope: 'assigned-to-me') do Assigned to me + %span.pull-right + = assigned_entities_count(current_user, entity, @project) %li{class: ("active" if params[:scope] == 'created-by-me')} = link_to project_filter_path(scope: 'created-by-me') do Created by me + %span.pull-right + = authored_entities_count(current_user, entity, @project) %fieldset %legend State @@ -28,23 +34,26 @@ - if defined?(labels) %fieldset - %legend Labels + %legend + Labels + %small.pull-right + = link_to project_labels_path(@project), class: 'light' do + %i.icon-edit %ul.nav.nav-pills.nav-stacked.nav-small.labels-filter - - issue_label_names.each do |label_name| - %li{class: label_filter_class(label_name)} - = link_to labels_filter_path(label_name) do - %span{class: "label #{label_css_class(label_name)}"} - %i.icon-tag - = label_name - - if selected_label?(label_name) + - @project.labels.order_by_name.each do |label| + %li{class: label_filter_class(label.name)} + = link_to labels_filter_path(label.name) do + = render_colored_label(label) + - if selected_label?(label.name) .pull-right %i.icon-remove - - if issue_label_names.empty? - .light-well - Add first label to your issues - %br - or #{link_to 'generate', generate_project_labels_path(@project, redirect: redirect), method: :post} default set of labels + - if @project.labels.empty? + .light-well + Create first label at + = link_to 'labels page', project_labels_path(@project) + %br + or #{link_to 'generate', generate_project_labels_path(@project, redirect: redirect), method: :post} default set of labels %fieldset - if %w(state scope milestone_id assignee_id label_name).select { |k| params[k].present? }.any? diff --git a/app/views/users/_groups.html.haml b/app/views/users/_groups.html.haml index 412df943fcc..09b2985d498 100644 --- a/app/views/users/_groups.html.haml +++ b/app/views/users/_groups.html.haml @@ -1,3 +1,3 @@ - groups.each do |group| = link_to group, class: 'profile-groups-avatars', :title => group.name do - = image_tag group_icon(group.path)
\ No newline at end of file + = image_tag group_icon(group.path) diff --git a/app/workers/emails_on_push_worker.rb b/app/workers/emails_on_push_worker.rb index 5e81810cbdb..2947c8e3ecd 100644 --- a/app/workers/emails_on_push_worker.rb +++ b/app/workers/emails_on_push_worker.rb @@ -13,7 +13,7 @@ class EmailsOnPushWorker return true end - compare = Gitlab::Git::Compare.new(project.repository.raw_repository, before_sha, after_sha, MergeRequestDiff::COMMITS_SAFE_SIZE) + compare = Gitlab::Git::Compare.new(project.repository.raw_repository, before_sha, after_sha) # Do not send emails if git compare failed return false unless compare && compare.commits.present? diff --git a/config/application.rb b/config/application.rb index 0a77f58f6d1..58a5949c653 100644 --- a/config/application.rb +++ b/config/application.rb @@ -41,12 +41,6 @@ module Gitlab # like if you have constraints or database-specific column types # config.active_record.schema_format = :sql - # Enforce whitelist mode for mass assignment. - # This will create an empty whitelist of attributes available for mass-assignment for all models - # in your app. As such, your models will need to explicitly whitelist or blacklist accessible - # parameters by using an attr_accessible or attr_protected declaration. - config.active_record.whitelist_attributes = true - # Enable the asset pipeline config.assets.enabled = true config.assets.paths << Emoji.images_path diff --git a/config/database.yml.postgresql b/config/database.yml.postgresql index 66960551cfd..7067e0fe402 100644 --- a/config/database.yml.postgresql +++ b/config/database.yml.postgresql @@ -10,7 +10,6 @@ production: # password: # host: localhost # port: 5432 - # socket: /tmp/postgresql.sock # # Development specific @@ -22,7 +21,6 @@ development: pool: 5 username: postgres password: - # socket: /tmp/postgresql.sock # # Staging specific @@ -34,7 +32,6 @@ staging: pool: 5 username: postgres password: - # socket: /tmp/postgresql.sock # Warning: The database defined as "test" will be erased and # re-generated from your development database when you run "rake". @@ -46,4 +43,3 @@ test: &test pool: 5 username: postgres password: - # socket: /tmp/postgresql.sock diff --git a/config/environments/development.rb b/config/environments/development.rb index e4c7649fda0..356e26bd68c 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -19,9 +19,6 @@ Gitlab::Application.configure do # Only use best-standards-support built into browsers config.action_dispatch.best_standards_support = :builtin - # Raise exception on mass assignment protection for Active Record models - config.active_record.mass_assignment_sanitizer = :strict - # Do not compress assets config.assets.compress = false diff --git a/config/environments/test.rb b/config/environments/test.rb index 3860dc5c74c..25b082b98da 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -26,9 +26,6 @@ Gitlab::Application.configure do # ActionMailer::Base.deliveries array. config.action_mailer.delivery_method = :test - # Raise exception on mass assignment protection for Active Record models - # config.active_record.mass_assignment_sanitizer = :strict - # Print deprecation notices to the stderr config.active_support.deprecation = :stderr diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example index 806984e8d40..dff709b66b8 100644 --- a/config/gitlab.yml.example +++ b/config/gitlab.yml.example @@ -49,14 +49,15 @@ production: &base ## COLOR = 5 # default_theme: 2 # default: 2 - - ## Users management - # default: false - Account passwords are not sent via the email if signup is enabled. + ## Users can create accounts + # This also allows normal users to sign up for accounts themselves + # default: false - By default GitLab administrators must create all new accounts # signup_enabled: true - # - # default: true - If set to false, standard login form won't be shown on the sign-in page - # signin_enabled: false + ## Standard login settings + # The standard login can be disabled to force login via LDAP + # default: true - If set to false the standard login form won't be shown on the sign-in page + # signin_enabled: false # Restrict setting visibility levels for non-admin users. # The default is to allow all levels. @@ -66,6 +67,7 @@ production: &base # If a commit message matches this regular expression, all issues referenced from the matched text will be closed. # This happens when the commit is pushed or merged into the default branch of a project. # When not specified the default issue_closing_pattern as specified below will be used. + # Tip: you can test your closing pattern at http://rubular.com # issue_closing_pattern: '([Cc]lose[sd]|[Ff]ixe[sd]) #(\d+)' ## Default project features settings @@ -196,6 +198,7 @@ production: &base satellites: # Relative paths are relative to Rails.root (default: tmp/repo_satellites/) path: /home/git/gitlab-satellites/ + timeout: 30 ## Backup settings backup: @@ -225,7 +228,7 @@ production: &base # The next value is the maximum memory size grit can use # Given in number of bytes per git object (e.g. a commit) # This value can be increased if you have very large commits - max_size: 5242880 # 5.megabytes + max_size: 20971520 # 20.megabytes # Git timeout to read a commit, in seconds timeout: 10 diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index f55e69c08f6..49e35d5bb68 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -139,6 +139,7 @@ Settings.git['timeout'] ||= 10 Settings['satellites'] ||= Settingslogic.new({}) Settings.satellites['path'] = File.expand_path(Settings.satellites['path'] || "tmp/repo_satellites/", Rails.root) +Settings.satellites['timeout'] ||= 30 # # Extra customization @@ -150,6 +151,6 @@ Settings['extra'] ||= Settingslogic.new({}) # if Rails.env.test? Settings.gitlab['default_projects_limit'] = 42 - Settings.gitlab['default_can_create_group'] = false + Settings.gitlab['default_can_create_group'] = true Settings.gitlab['default_can_create_team'] = false end diff --git a/config/initializers/4_sidekiq.rb b/config/initializers/4_sidekiq.rb index c90d376273d..228b14cb526 100644 --- a/config/initializers/4_sidekiq.rb +++ b/config/initializers/4_sidekiq.rb @@ -12,6 +12,10 @@ Sidekiq.configure_server do |config| url: resque_url, namespace: 'resque:gitlab' } + + config.server_middleware do |chain| + chain.add Gitlab::SidekiqMiddleware::ArgumentsLogger + end end Sidekiq.configure_client do |config| diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index 50669ece7a8..34f4f386988 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -155,10 +155,6 @@ Devise.setup do |config| # REST_AUTH_SITE_KEY to pepper) # config.encryptor = :sha512 - # ==> Configuration for :token_authenticatable - # Defines name of the authentication token params key - config.token_authentication_key = :private_token - # Authentication through token does not store user in session and needs # to be supplied on each request. Useful if you are using the token as API token. config.skip_session_storage << :token_auth diff --git a/config/locales/devise.en.yml b/config/locales/devise.en.yml index 275273a0b12..1cbcde5b3da 100644 --- a/config/locales/devise.en.yml +++ b/config/locales/devise.en.yml @@ -25,6 +25,9 @@ en: sessions: signed_in: 'Signed in successfully.' signed_out: 'Signed out successfully.' + users_sessions: + user: + signed_in: 'Signed in successfully.' passwords: send_instructions: 'You will receive an email with instructions about how to reset your password in a few minutes.' updated: 'Your password was changed successfully. You are now signed in.' diff --git a/config/routes.rb b/config/routes.rb index 14ff52f387a..261fbb50e38 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -47,13 +47,24 @@ Gitlab::Application.routes.draw do get "/s/:username" => "snippets#user_index", as: :user_snippets, constraints: { username: /.*/ } # - # Public namespace + # Explroe area # - namespace :public do - resources :projects, only: [:index] - root to: "projects#index" + namespace :explore do + resources :projects, only: [:index] do + collection do + get :trending + get :starred + end + end + + resources :groups, only: [:index] + root to: "projects#trending" end + # Compatibility with old routing + get 'public' => "explore/projects#index" + get 'public/projects' => "explore/projects#index" + # # Attachments serving # @@ -151,14 +162,16 @@ Gitlab::Application.routes.draw do end resources :users_groups, only: [:create, :update, :destroy] + scope module: :groups do resource :avatar, only: [:destroy] + resources :milestones end end resources :projects, constraints: { id: /[^\/]+/ }, only: [:new, :create] - devise_for :users, controllers: { omniauth_callbacks: :omniauth_callbacks, registrations: :registrations , passwords: :passwords, sessions: :users_sessions } + devise_for :users, controllers: { omniauth_callbacks: :omniauth_callbacks, registrations: :registrations , passwords: :passwords, sessions: :sessions } devise_scope :user do get "/users/auth/:provider/omniauth_error" => "omniauth_callbacks#omniauth_error", as: :omniauth_error @@ -173,6 +186,7 @@ Gitlab::Application.routes.draw do post :archive post :unarchive post :upload_image + post :toggle_star get :autocomplete_sources get :import put :retry_import @@ -283,7 +297,7 @@ Gitlab::Application.routes.draw do end end - resources :labels, only: [:index] do + resources :labels, constraints: {id: /\d+/} do collection do post :generate end diff --git a/db/fixtures/development/01_admin.rb b/db/fixtures/development/01_admin.rb index 42d18435340..176845fd8a8 100644 --- a/db/fixtures/development/01_admin.rb +++ b/db/fixtures/development/01_admin.rb @@ -2,7 +2,7 @@ User.seed(:id, [ { id: 1, name: "Administrator", - email: "admin@local.host", + email: "admin@example.com", username: 'root', password: "5iveL!fe", password_confirmation: "5iveL!fe", diff --git a/db/fixtures/production/001_admin.rb b/db/fixtures/production/001_admin.rb index a919fad7040..c00ba3c10ba 100644 --- a/db/fixtures/production/001_admin.rb +++ b/db/fixtures/production/001_admin.rb @@ -1,5 +1,5 @@ admin = User.create( - email: "admin@local.host", + email: "admin@example.com", name: "Administrator", username: 'root', password: "5iveL!fe", @@ -18,7 +18,7 @@ if admin.valid? puts %q[ Administrator account created: -login.........admin@local.host +login.........root password......5iveL!fe ] end diff --git a/db/migrate/20140407135544_fix_namespaces.rb b/db/migrate/20140407135544_fix_namespaces.rb index 8c4f2b0f6b1..59665d538f0 100644 --- a/db/migrate/20140407135544_fix_namespaces.rb +++ b/db/migrate/20140407135544_fix_namespaces.rb @@ -7,4 +7,4 @@ class FixNamespaces < ActiveRecord::Migration def down end -end
\ No newline at end of file +end diff --git a/db/migrate/20140625115202_create_users_star_projects.rb b/db/migrate/20140625115202_create_users_star_projects.rb new file mode 100644 index 00000000000..412f0f6f34b --- /dev/null +++ b/db/migrate/20140625115202_create_users_star_projects.rb @@ -0,0 +1,15 @@ +class CreateUsersStarProjects < ActiveRecord::Migration + def change + create_table :users_star_projects do |t| + t.integer :project_id, null: false + t.integer :user_id, null: false + t.timestamps + end + add_index :users_star_projects, :user_id + add_index :users_star_projects, :project_id + add_index :users_star_projects, [:user_id, :project_id], unique: true + + add_column :projects, :star_count, :integer, default: 0, null: false + add_index :projects, :star_count, using: :btree + end +end diff --git a/db/migrate/20140729134820_create_labels.rb b/db/migrate/20140729134820_create_labels.rb new file mode 100644 index 00000000000..3a4b6a152dc --- /dev/null +++ b/db/migrate/20140729134820_create_labels.rb @@ -0,0 +1,11 @@ +class CreateLabels < ActiveRecord::Migration + def change + create_table :labels do |t| + t.string :title + t.string :color + t.integer :project_id + + t.timestamps + end + end +end diff --git a/db/migrate/20140729140420_create_label_links.rb b/db/migrate/20140729140420_create_label_links.rb new file mode 100644 index 00000000000..2bfc4ae2094 --- /dev/null +++ b/db/migrate/20140729140420_create_label_links.rb @@ -0,0 +1,11 @@ +class CreateLabelLinks < ActiveRecord::Migration + def change + create_table :label_links do |t| + t.integer :label_id + t.integer :target_id + t.string :target_type + + t.timestamps + end + end +end diff --git a/db/migrate/20140729145339_migrate_project_tags.rb b/db/migrate/20140729145339_migrate_project_tags.rb new file mode 100644 index 00000000000..5760e4bfeaa --- /dev/null +++ b/db/migrate/20140729145339_migrate_project_tags.rb @@ -0,0 +1,9 @@ +class MigrateProjectTags < ActiveRecord::Migration + def up + ActsAsTaggableOn::Tagging.where(taggable_type: 'Project', context: 'labels').update_all(context: 'tags') + end + + def down + ActsAsTaggableOn::Tagging.where(taggable_type: 'Project', context: 'tags').update_all(context: 'labels') + end +end diff --git a/db/migrate/20140729152420_migrate_taggable_labels.rb b/db/migrate/20140729152420_migrate_taggable_labels.rb new file mode 100644 index 00000000000..0b844720ba1 --- /dev/null +++ b/db/migrate/20140729152420_migrate_taggable_labels.rb @@ -0,0 +1,27 @@ +class MigrateTaggableLabels < ActiveRecord::Migration + def up + taggings = ActsAsTaggableOn::Tagging.where(taggable_type: ['Issue', 'MergeRequest'], context: 'labels') + taggings.find_each(batch_size: 500) do |tagging| + create_label_from_tagging(tagging) + end + end + + def down + Label.destroy_all + LabelLink.destroy_all + end + + private + + def create_label_from_tagging(tagging) + target = tagging.taggable + label_name = tagging.tag.name + label = target.project.labels.find_or_create_by(title: label_name) + + if LabelLink.create(label: label, target: target) + print '.' + else + print 'F' + end + end +end diff --git a/db/migrate/20140730111702_add_index_to_labels.rb b/db/migrate/20140730111702_add_index_to_labels.rb new file mode 100644 index 00000000000..494241c873c --- /dev/null +++ b/db/migrate/20140730111702_add_index_to_labels.rb @@ -0,0 +1,7 @@ +class AddIndexToLabels < ActiveRecord::Migration + def change + add_index "labels", :project_id + add_index "label_links", :label_id + add_index "label_links", [:target_id, :target_type] + end +end diff --git a/db/schema.rb b/db/schema.rb index 345b6fd3b68..9159556ac72 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20140611135229) do +ActiveRecord::Schema.define(version: 20140730111702) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -109,6 +109,27 @@ ActiveRecord::Schema.define(version: 20140611135229) do add_index "keys", ["user_id"], name: "index_keys_on_user_id", using: :btree + create_table "label_links", force: true do |t| + t.integer "label_id" + t.integer "target_id" + t.string "target_type" + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "label_links", ["label_id"], name: "index_label_links_on_label_id", using: :btree + add_index "label_links", ["target_id", "target_type"], name: "index_label_links_on_target_id_and_target_type", using: :btree + + create_table "labels", force: true do |t| + t.string "title" + t.string "color" + t.integer "project_id" + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "labels", ["project_id"], name: "index_labels_on_project_id", using: :btree + create_table "merge_request_diffs", force: true do |t| t.string "state" t.text "st_commits" @@ -224,11 +245,13 @@ ActiveRecord::Schema.define(version: 20140611135229) do t.boolean "archived", default: false, null: false t.string "import_status" t.float "repository_size", default: 0.0 + t.integer "star_count", default: 0, null: false end add_index "projects", ["creator_id"], name: "index_projects_on_creator_id", using: :btree add_index "projects", ["last_activity_at"], name: "index_projects_on_last_activity_at", using: :btree add_index "projects", ["namespace_id"], name: "index_projects_on_namespace_id", using: :btree + add_index "projects", ["star_count"], name: "index_projects_on_star_count", using: :btree create_table "protected_branches", force: true do |t| t.integer "project_id", null: false @@ -369,6 +392,17 @@ ActiveRecord::Schema.define(version: 20140611135229) do add_index "users_projects", ["project_id"], name: "index_users_projects_on_project_id", using: :btree add_index "users_projects", ["user_id"], name: "index_users_projects_on_user_id", using: :btree + create_table "users_star_projects", force: true do |t| + t.integer "project_id", null: false + t.integer "user_id", null: false + t.datetime "created_at" + t.datetime "updated_at" + end + + add_index "users_star_projects", ["project_id"], name: "index_users_star_projects_on_project_id", using: :btree + add_index "users_star_projects", ["user_id", "project_id"], name: "index_users_star_projects_on_user_id_and_project_id", unique: true, using: :btree + add_index "users_star_projects", ["user_id"], name: "index_users_star_projects_on_user_id", using: :btree + create_table "web_hooks", force: true do |t| t.string "url" t.integer "project_id" diff --git a/doc/api/merge_requests.md b/doc/api/merge_requests.md index 27c0d644e11..a46472a0812 100644 --- a/doc/api/merge_requests.md +++ b/doc/api/merge_requests.md @@ -30,7 +30,7 @@ Parameters: "author": { "id": 1, "username": "admin", - "email": "admin@local.host", + "email": "admin@example.com", "name": "Administrator", "state": "active", "created_at": "2012-04-29T08:46:00Z" @@ -38,7 +38,7 @@ Parameters: "assignee": { "id": 1, "username": "admin", - "email": "admin@local.host", + "email": "admin@example.com", "name": "Administrator", "state": "active", "created_at": "2012-04-29T08:46:00Z" @@ -74,7 +74,7 @@ Parameters: "author": { "id": 1, "username": "admin", - "email": "admin@local.host", + "email": "admin@example.com", "name": "Administrator", "state": "active", "created_at": "2012-04-29T08:46:00Z" @@ -82,7 +82,7 @@ Parameters: "assignee": { "id": 1, "username": "admin", - "email": "admin@local.host", + "email": "admin@example.com", "name": "Administrator", "state": "active", "created_at": "2012-04-29T08:46:00Z" @@ -120,7 +120,7 @@ Parameters: "author": { "id": 1, "username": "admin", - "email": "admin@local.host", + "email": "admin@example.com", "name": "Administrator", "state": "active", "created_at": "2012-04-29T08:46:00Z" @@ -128,7 +128,7 @@ Parameters: "assignee": { "id": 1, "username": "admin", - "email": "admin@local.host", + "email": "admin@example.com", "name": "Administrator", "state": "active", "created_at": "2012-04-29T08:46:00Z" @@ -167,7 +167,7 @@ Parameters: "author": { "id": 1, "username": "admin", - "email": "admin@local.host", + "email": "admin@example.com", "name": "Administrator", "state": "active", "created_at": "2012-04-29T08:46:00Z" @@ -175,7 +175,7 @@ Parameters: "assignee": { "id": 1, "username": "admin", - "email": "admin@local.host", + "email": "admin@example.com", "name": "Administrator", "state": "active", "created_at": "2012-04-29T08:46:00Z" @@ -218,7 +218,7 @@ Parameters: "author": { "id": 1, "username": "admin", - "email": "admin@local.host", + "email": "admin@example.com", "name": "Administrator", "state": "active", "created_at": "2012-04-29T08:46:00Z" @@ -226,7 +226,7 @@ Parameters: "assignee": { "id": 1, "username": "admin", - "email": "admin@local.host", + "email": "admin@example.com", "name": "Administrator", "state": "active", "created_at": "2012-04-29T08:46:00Z" @@ -253,7 +253,7 @@ Parameters: "author": { "id": 1, "username": "admin", - "email": "admin@local.host", + "email": "admin@example.com", "name": "Administrator", "blocked": false, "created_at": "2012-04-29T08:46:00Z" @@ -282,7 +282,7 @@ Parameters: "author": { "id": 11, "username": "admin", - "email": "admin@local.host", + "email": "admin@example.com", "name": "Administrator", "state": "active", "created_at": "2014-03-06T08:17:35.000Z" @@ -293,7 +293,7 @@ Parameters: "author": { "id": 11, "username": "admin", - "email": "admin@local.host", + "email": "admin@example.com", "name": "Administrator", "state": "active", "created_at": "2014-03-06T08:17:35.000Z" diff --git a/doc/api/projects.md b/doc/api/projects.md index d32af678fcc..e27f0c0226b 100644 --- a/doc/api/projects.md +++ b/doc/api/projects.md @@ -86,7 +86,7 @@ GET /projects #### List owned projects -Get a list of projects owned by the authenticated user. +Get a list of projects which are owned by the authenticated user. ``` GET /projects/owned @@ -102,7 +102,7 @@ GET /projects/all ### Get single project -Get a specific project, identified by project ID or NAMESPACE/PROJECT_NAME , which is owned by the authentication user. +Get a specific project, identified by project ID or NAMESPACE/PROJECT_NAME, which is owned by the authenticated user. If using namespaced projects call make sure that the NAMESPACE/PROJECT_NAME is URL-encoded, eg. `/api/v3/projects/diaspora%2Fdiaspora` (where `/` is represented by `%2F`). ``` @@ -163,7 +163,7 @@ Parameters: ### Get project events -Get a project events for specific project. +Get the events for the specified project. Sorted from newest to latest ``` @@ -237,7 +237,7 @@ Parameters: ### Create project -Creates new project owned by user. +Creates a new project owned by the authenticated user. ``` POST /projects @@ -259,7 +259,7 @@ Parameters: ### Create project for user -Creates a new project owned by user. Available only for admins. +Creates a new project owned by the specified user. Available only for admins. ``` POST /projects/user/:user_id @@ -277,11 +277,12 @@ Parameters: + `snippets_enabled` (optional) + `public` (optional) - if `true` same as setting visibility_level = 20 + `visibility_level` (optional) +* `import_url` (optional) ## Remove project -Removes project with all resources(issues, merge requests etc) +Removes a project including all associated resources (issues, merge requests etc.) ``` DELETE /projects/:id @@ -296,7 +297,7 @@ Parameters: ### List project team members -Get a list of project team members. +Get a list of a project's team members. ``` GET /projects/:id/members @@ -353,7 +354,7 @@ Parameters: ### Edit project team member -Updates project team member to a specified access level. +Updates a project team member to a specified access level. ``` PUT /projects/:id/members/:user_id @@ -368,7 +369,7 @@ Parameters: ### Remove project team member -Removes user from project team. +Removes a user from a project team. ``` DELETE /projects/:id/members/:user_id @@ -389,7 +390,7 @@ rely on the returned JSON structure. ### List project hooks -Get list of project hooks. +Get a list of project hooks. ``` GET /projects/:id/hooks @@ -402,7 +403,7 @@ Parameters: ### Get project hook -Get a specific hook for project. +Get a specific hook for a project. ``` GET /projects/:id/hooks/:hook_id @@ -428,7 +429,7 @@ Parameters: ### Add project hook -Adds a hook to project. +Adds a hook to a specified project. ``` POST /projects/:id/hooks @@ -445,7 +446,7 @@ Parameters: ### Edit project hook -Edits a hook for project. +Edits a hook for a specified project. ``` PUT /projects/:id/hooks/:hook_id @@ -463,7 +464,7 @@ Parameters: ### Delete project hook -Removes a hook from project. This is an idempotent method and can be called multiple times. +Removes a hook from a project. This is an idempotent method and can be called multiple times. Either the hook is available or not. ``` @@ -590,7 +591,7 @@ Parameters: ## Admin fork relation -Allows modification of the forked relationship between existing projects. . Available only for admins. +Allows modification of the forked relationship between existing projects. Available only for admins. ### Create a forked from/to relation between existing projects. @@ -616,7 +617,7 @@ Parameter: ## Search for projects by name -Search for projects by name which are public or the calling user has access to +Search for projects by name which are accessible to the authenticated user. ``` GET /projects/search/:query diff --git a/doc/api/repositories.md b/doc/api/repositories.md index 26ae3e87232..2539e3edbf9 100644 --- a/doc/api/repositories.md +++ b/doc/api/repositories.md @@ -220,3 +220,32 @@ Response: "compare_same_ref": false } ``` + +## Contributors + +Get repository contributors list + +``` +GET /projects/:id/repository/contributors +``` + +Parameters: ++ `id` (required) - The ID of a project + +Response: + +``` +[{ + "name": "Dmitriy Zaporozhets", + "email": "dmitriy.zaporozhets@gmail.com", + "commits": 117, + "additions": 2097, + "deletions": 517 +}, { + "name": "Jacob Vosmaer", + "email": "contact@jacobvosmaer.nl", + "commits": 33, + "additions": 338, + "deletions": 244 +}] +``` diff --git a/doc/api/users.md b/doc/api/users.md index a7e9518408c..57078353fd0 100644 --- a/doc/api/users.md +++ b/doc/api/users.md @@ -6,7 +6,7 @@ Get a list of users. This function takes pagination parameters `page` and `per_page` to restrict the list of users. -### For normal users: +### For normal users ``` GET /users @@ -31,8 +31,7 @@ GET /users ] ``` - -### For admins: +### For admins ``` GET /users @@ -92,7 +91,7 @@ Also see `def search query` in `app/models/user.rb`. Get a single user. -#### For user: +### For user ``` GET /users/:id @@ -112,8 +111,7 @@ Parameters: } ``` - -#### For admin: +### For admin ``` GET /users/:id @@ -161,13 +159,13 @@ Parameters: - `username` (required) - Username - `name` (required) - Name - `skype` (optional) - Skype ID -- `linkedin` (optional) - Linkedin +- `linkedin` (optional) - LinkedIn - `twitter` (optional) - Twitter account -- `website_url` (optional) - Website url +- `website_url` (optional) - Website URL - `projects_limit` (optional) - Number of projects user can create - `extern_uid` (optional) - External UID - `provider` (optional) - External provider name -- `bio` (optional) - User's bio +- `bio` (optional) - User's biography - `admin` (optional) - User is admin - true or false (default) - `can_create_group` (optional) - User can create groups - true or false @@ -181,26 +179,32 @@ PUT /users/:id Parameters: -- `email` - Email -- `username` - Username -- `name` - Name -- `password` - Password -- `skype` - Skype ID -- `linkedin` - Linkedin -- `twitter` - Twitter account -- `website_url` - Website url -- `projects_limit` - Limit projects each user can create -- `extern_uid` - External UID -- `provider` - External provider name -- `bio` - User's bio -- `admin` (optional) - User is admin - true or false (default) -- `can_create_group` (optional) - User can create groups - true or false - -Note, at the moment this method does only return a 404 error, even in cases where a 409 (Conflict) would be more appropriate, e.g. when renaming the email address to some existing one. +- `email` - Email +- `username` - Username +- `name` - Name +- `password` - Password +- `skype` - Skype ID +- `linkedin` - LinkedIn +- `twitter` - Twitter account +- `website_url` - Website URL +- `projects_limit` - Limit projects each user can create +- `extern_uid` - External UID +- `provider` - External provider name +- `bio` - User's biography +- `admin` (optional) - User is admin - true or false (default) +- `can_create_group` (optional) - User can create groups - true or false + +Note, at the moment this method does only return a 404 error, +even in cases where a 409 (Conflict) would be more appropriate, +e.g. when renaming the email address to some existing one. ## User deletion -Deletes a user. Available only for administrators. This is an idempotent function, calling this function for a non-existent user id still returns a status code `200 Ok`. The JSON response differs if the user was actually deleted or not. In the former the user is returned and in the latter not. +Deletes a user. Available only for administrators. +This is an idempotent function, calling this function for a non-existent user id +still returns a status code `200 Ok`. +The JSON response differs if the user was actually deleted or not. +In the former the user is returned and in the latter not. ``` DELETE /users/:id @@ -310,7 +314,7 @@ POST /user/keys Parameters: - `title` (required) - new SSH Key's title -- `key` (required) - new SSH key +- `key` (required) - new SSH key ## Add SSH key for user @@ -322,15 +326,17 @@ POST /users/:id/keys Parameters: -- `id` (required) - id of specified user +- `id` (required) - id of specified user - `title` (required) - new SSH Key's title -- `key` (required) - new SSH key +- `key` (required) - new SSH key Will return created key with status `201 Created` on success, or `404 Not found` on fail. ## Delete SSH key for current user -Deletes key owned by currently authenticated user. This is an idempotent function and calling it on a key that is already deleted or not available results in `200 Ok`. +Deletes key owned by currently authenticated user. +This is an idempotent function and calling it on a key that is already deleted +or not available results in `200 Ok`. ``` DELETE /user/keys/:id @@ -351,6 +357,6 @@ DELETE /users/:uid/keys/:id Parameters: - `uid` (required) - id of specified user -- `id` (required) - SSH key ID +- `id` (required) - SSH key ID Will return `200 Ok` on success, or `404 Not found` if either user or key cannot be found. diff --git a/doc/development/gitlab_diagram_overview.odg b/doc/development/gitlab_diagram_overview.odg Binary files differindex b7e02f8fa78..9bfc7313ff4 100644 --- a/doc/development/gitlab_diagram_overview.odg +++ b/doc/development/gitlab_diagram_overview.odg diff --git a/doc/development/gitlab_diagram_overview.png b/doc/development/gitlab_diagram_overview.png Binary files differindex b5831cf0a4c..d9b9eed3d8f 100644 --- a/doc/development/gitlab_diagram_overview.png +++ b/doc/development/gitlab_diagram_overview.png diff --git a/doc/development/rake_tasks.md b/doc/development/rake_tasks.md index 9e75b3a6275..6d9ac161e91 100644 --- a/doc/development/rake_tasks.md +++ b/doc/development/rake_tasks.md @@ -2,7 +2,7 @@ ## Setup db with developer seeds: -Note that if your db user does not have advanced privilegies you must create db manually before run this command +Note that if your db user does not have advanced privileges you must create the db manually before running this command. ``` bundle exec rake setup @@ -10,7 +10,7 @@ bundle exec rake setup ## Run tests -This runs all test suite present in GitLab +This runs all test suites present in GitLab. ``` bundle exec rake test @@ -18,7 +18,7 @@ bundle exec rake test ## Generate searchable docs for source code -You can find results under `doc/code` directory +You can find results under the `doc/code` directory. ``` bundle exec rake gitlab:generate_docs diff --git a/doc/install/installation.md b/doc/install/installation.md index 37f9377256c..f3d21ac4482 100644 --- a/doc/install/installation.md +++ b/doc/install/installation.md @@ -78,7 +78,7 @@ Is the system packaged Git too old? Remove it and compile from source. # When editing config/gitlab.yml (Step 5), change the git bin_path to /usr/local/bin/git -**Note:** In order to receive mail notifications, make sure to install a mail server. By default, Debian is shipped with exim4 whereas Ubuntu does not ship with one. The recommended mail server is postfix and you can install it with: +**Note:** In order to receive mail notifications, make sure to install a mail server. By default, Debian is shipped with exim4 but this [has problems](https://github.com/gitlabhq/gitlabhq/issues/4866#issuecomment-32726573) while Ubuntu does not ship with one. The recommended mail server is postfix and you can install it with: sudo apt-get install -y postfix @@ -141,12 +141,12 @@ We recommend using a PostgreSQL database. For MySQL check [MySQL setup guide](da ### Clone the Source # Clone GitLab repository - sudo -u git -H git clone https://gitlab.com/gitlab-org/gitlab-ce.git -b 7-0-stable gitlab + sudo -u git -H git clone https://gitlab.com/gitlab-org/gitlab-ce.git -b 7-1-stable gitlab # Go to gitlab dir cd /home/git/gitlab -**Note:** You can change `7-0-stable` to `master` if you want the *bleeding edge* version, but never install master on a production server! +**Note:** You can change `7-1-stable` to `master` if you want the *bleeding edge* version, but never install master on a production server! ### Configure it @@ -331,6 +331,8 @@ To make sure you didn't miss anything run a more thorough check with: If all items are green, then congratulations on successfully installing GitLab! +NOTE: Supply `SANITIZE=true` environment variable to `gitlab:check` to omit project names from the output of the check command. + ### Initial Login Visit YOUR_SERVER in your web browser for your first GitLab login. The setup has created an admin account for you. You can use it to log in: diff --git a/doc/install/requirements.md b/doc/install/requirements.md index 86ad3211b46..46a98397aa3 100644 --- a/doc/install/requirements.md +++ b/doc/install/requirements.md @@ -2,9 +2,7 @@ ## Operating Systems -GitLab is developed for the Linux operating system. For the installations options and instructions please see [the installation section of the readme](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/README.md#installation). - -### Supported Linux distributions +### Supported Unix distributions - Ubuntu - Debian @@ -13,43 +11,36 @@ GitLab is developed for the Linux operating system. For the installations option - Scientific Linux - Oracle Linux -### Unsupported Linux distributions +For the installations options please see [the installation page on the GitLab website](https://about.gitlab.com/installation/). + +### Unsupported Unix distributions +- OS X - Arch Linux - Fedora - Gentoo +- FreeBSD -But on the above unsupported distributions is still possible to install GitLab yourself with the [manual installation guide](https://github.com/gitlabhq/gitlabhq/blob/master/doc/install/installation.md). - -### Unsupported Unix operating systems +On the above unsupported distributions is still possible to install GitLab yourself. +Please see the [manual installation guide](https://github.com/gitlabhq/gitlabhq/blob/master/doc/install/installation.md) and the [unofficial installation guides](https://github.com/gitlabhq/gitlab-public-wiki/wiki/Unofficial-Installation-Guides) on the public wiki for more information. -There is nothing that prevents GitLab from running on other Unix operating systems. - -This means you may get it to work on systems running FreeBSD or OS X. - -If you want to do this, please be aware it could be a lot of work. - -Please consider using a virtual machine to run GitLab. - -### Other operating systems such as Windows +### Non Unix operating systems such as Windows +GitLab is developed for Unix operating systems. GitLab does **not** run on Windows and we have no plans of supporting it in the near future. - Please consider using a virtual machine to run GitLab. ## Ruby versions GitLab requires Ruby (MRI) 2.0 or 2.1 - You will have to use the standard MRI implementation of Ruby. - We love [JRuby](http://jruby.org/) and [Rubinius](http://rubini.us/)) but GitLab needs several Gems that have native extensions. ## Hardware requirements ### CPU -- 1 core works supports up to 100 users but the application will not be responsive +- 1 core works supports up to 100 users but the application can be a bit slower due to having all workers and background jobs running on the same core - **2 cores** is the **recommended** number of cores and supports up to 500 users - 4 cores supports up to 2,000 users - 8 cores supports up to 5,000 users diff --git a/doc/integration/README.md b/doc/integration/README.md index 00c73afd872..357ed038314 100644 --- a/doc/integration/README.md +++ b/doc/integration/README.md @@ -10,3 +10,12 @@ See the documentation below for details on how to configure these services. - [Slack](slack.md) Integrate with the Slack chat service Jenkins support is [available in GitLab EE](http://doc.gitlab.com/ee/integration/jenkins.html). + +## Project services + +Integration with services such as Campfire, Flowdock, Gemnasium, HipChat, PivotalTracker and Slack are available in the from of a Project Service. +You can find these within GitLab in the Services page under Project Settings if you are at least a master on the project. +Project Services are a bit like plugins in that they allow a lot of freedom in adding functionality to GitLab, for example there is also a service that can send an email every time someone pushes new commits. +Because GitLab is open source we can ship with the code and tests for all plugins. +This allows the community to keep the plugins up to date so that they always work in newer GitLab versions. +For an overview of what projects services are available without logging in please see the [project_services directory](https://gitlab.com/gitlab-org/gitlab-ce/tree/master/app/models/project_services). diff --git a/doc/markdown/markdown.md b/doc/markdown/markdown.md index 64f571b4351..2565acb8eff 100644 --- a/doc/markdown/markdown.md +++ b/doc/markdown/markdown.md @@ -4,39 +4,25 @@ **[GitLab Flavored Markdown](#gitlab-flavored-markdown-gfm)** -[Newlines](#newlines) - -[Multiple underscores in words](#multiple-underscores-in-words) - -[URL autolinking](#url-autolinking) - -[Code and Syntax Highlighting](#code-and-syntax-highlighting) - -[Emoji](#emoji) - -[Special GitLab references](#special-gitlab-references) +* [Newlines](#newlines) +* [Multiple underscores in words](#multiple-underscores-in-words) +* [URL autolinking](#url-autolinking) +* [Code and Syntax Highlighting](#code-and-syntax-highlighting) +* [Emoji](#emoji) +* [Special GitLab references](#special-gitlab-references) **[Standard Markdown](#standard-markdown)** -[Headers](#headers) - -[Emphasis](#emphasis) - -[Lists](#lists) - -[Links](#links) - -[Images](#images) - -[Blockquotes](#blockquotes) - -[Inline HTML](#inline-html) - -[Horizontal Rule](#horizontal-rule) - -[Line Breaks](#line-breaks) - -[Tables](#tables) +* [Headers](#headers) +* [Emphasis](#emphasis) +* [Lists](#lists) +* [Links](#links) +* [Images](#images) +* [Blockquotes](#blockquotes) +* [Inline HTML](#inline-html) +* [Horizontal Rule](#horizontal-rule) +* [Line Breaks](#line-breaks) +* [Tables](#tables) **[References](#references)** diff --git a/doc/permissions/permissions.md b/doc/permissions/permissions.md index d1da1496520..29fe521b4d1 100644 --- a/doc/permissions/permissions.md +++ b/doc/permissions/permissions.md @@ -16,7 +16,6 @@ If a user is a GitLab administrator they receive all permissions. | Pull project code | | ✓ | ✓ | ✓ | ✓ | | Download project | | ✓ | ✓ | ✓ | ✓ | | Create code snippets | | ✓ | ✓ | ✓ | ✓ | -| Create new milestones | | | ✓ | ✓ | ✓ | | Create new merge request | | | ✓ | ✓ | ✓ | | Create new branches | | | ✓ | ✓ | ✓ | | Push to non-protected branches | | | ✓ | ✓ | ✓ | @@ -24,6 +23,7 @@ If a user is a GitLab administrator they receive all permissions. | Add tags | | | ✓ | ✓ | ✓ | | Write a wiki | | | ✓ | ✓ | ✓ | | Manage issue tracker | | | ✓ | ✓ | ✓ | +| Create new milestones | | | | ✓ | ✓ | | Add new team members | | | | ✓ | ✓ | | Push to protected branches | | | | ✓ | ✓ | | Enable/Disable branch protection | | | | ✓ | ✓ | diff --git a/doc/public_access/public_access.md b/doc/public_access/public_access.md index 493e59af225..9b117319eec 100644 --- a/doc/public_access/public_access.md +++ b/doc/public_access/public_access.md @@ -12,7 +12,7 @@ Public projects can be cloned **without any** authentication. It will also be listed on the [public access directory](/public). -**Any logged in user** will have [Guest](/help/permissions) permissions on the repository. +**Any logged in user** will have [Guest](../permissions/permissions) permissions on the repository. ## Internal projects @@ -20,7 +20,7 @@ Internal projects can be cloned by any logged in user. It will also be listed on the [public access directory](/public) for logged in users. -Any logged in user will have [Guest](/help/permissions) permissions on the repository. +Any logged in user will have [Guest](../permissions/permissions) permissions on the repository. ## How to change project visibility diff --git a/doc/raketasks/backup_hrz.png b/doc/raketasks/backup_hrz.png Binary files differnew file mode 100644 index 00000000000..03e50df1d76 --- /dev/null +++ b/doc/raketasks/backup_hrz.png diff --git a/doc/raketasks/backup_restore.md b/doc/raketasks/backup_restore.md index 00ce6ed27c2..a0e38067094 100644 --- a/doc/raketasks/backup_restore.md +++ b/doc/raketasks/backup_restore.md @@ -1,8 +1,11 @@ # Backup restore + + ## Create a backup of the GitLab system -Creates a backup archive of the database and all repositories. This archive will be saved in backup_path (see `config/gitlab.yml`). +A backup creates an archive file that contains the database, all repositories and all attachments. +This archive will be saved in backup_path (see `config/gitlab.yml`). The filename will be `[TIMESTAMP]_gitlab_backup.tar`. This timestamp can be used to restore an specific backup. @@ -43,6 +46,13 @@ Deleting tmp directories...[DONE] Deleting old backups... [SKIPPING] ``` +## Storing configuration files + +Please be informed that a backup does not store your configuration files. +If you use Omnibus-GitLab please see the [instructions in the readme to backup your configuration](https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md#backup-and-restore-omnibus-gitlab-configuration). +If you have a cookbook installation there should be a copy of your configuration in Chef. +If you have a manual installation please consider backing up your gitlab.yml file and any ssl keys and certificates. + ## Restore a previously created backup ``` diff --git a/doc/raketasks/features.md b/doc/raketasks/features.md index eaa9af5f962..99b3d5525b0 100644 --- a/doc/raketasks/features.md +++ b/doc/raketasks/features.md @@ -18,21 +18,3 @@ New path: `git@example.org:username/myrepo.git` or `git@example.org:groupname/my ``` bundle exec rake gitlab:enable_namespaces RAILS_ENV=production ``` - -## Rebuild project satellites - -This command will build missing satellites for projects. After this you will be able to **merge a merge request** via GitLab and use the **online editor**. - -``` -bundle exec rake gitlab:satellites:create RAILS_ENV=production -``` - -Example output: - -``` -Creating satellite for abcd.git -[git clone output] -Creating satellite for abcd2.git -[git clone output] -done -``` diff --git a/doc/raketasks/maintenance.md b/doc/raketasks/maintenance.md index 3339dfb03ac..9f5d21527c3 100644 --- a/doc/raketasks/maintenance.md +++ b/doc/raketasks/maintenance.md @@ -63,6 +63,8 @@ sudo gitlab-rake gitlab:check bundle exec rake gitlab:check RAILS_ENV=production ``` +NOTE: Use SANITIZE=true for gitlab:check if you want to omit project names from the output. + Example output: ``` diff --git a/doc/release/monthly.md b/doc/release/monthly.md index 22824016f26..b455fc7d73c 100644 --- a/doc/release/monthly.md +++ b/doc/release/monthly.md @@ -14,22 +14,62 @@ A release manager is selected that coordinates the entire release of this versio Any changes not yet added to the changelog are added by lead developer and in that merge request the complete team is asked if there is anything missing. -# **18th - Releasing RC1** +### **4. Create an overall issue** -The RC1 release comes with the task to update the installation and upgrade docs. Be mindful that there might already be merge requests for this on GitLab or GitHub. +``` +15th: + +* Update the changelog (#LINK) +* Triage the omnibus-gitlab milestone + +16th: + +* Merge CE in to EE (#LINK) +* Close the omnibus-gitlab milestone + +17th: + +* Create x.x.0.rc1 (#LINK) + +18th: + +* Update GitLab.com with rc1 (#LINK) +* Regression issue and tweet about rc1 (#LINK) +* Start blog post (#LINK) + +21th: + +* Do QA and fix anything coming out of it (#LINK) + +22nd: + +* Release CE and EE (#LINK) + +23th: + +* Prepare package for GitLab.com release (#LINK) + +24th: + +* Deploy to GitLab.com (#LINK) +``` + +# **16th - Merge the CE into EE** -### **1. Create an issue for RC1 release** +Do this via a merge request. -Consider naming the issue "Release x.x.x.rc1" to make it easier for later searches. +# **17th - Create RC1** -### **2. Update the installation guide** +The RC1 release comes with the task to update the installation and upgrade docs. Be mindful that there might already be merge requests for this on GitLab or GitHub. + +### **1. Update the installation guide** 1. Check if it references the correct branch `x-x-stable` (doesn't exist yet, but that is okay) 1. Check the [GitLab Shell version](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/lib/tasks/gitlab/check.rake#L782) 1. Check the [Git version](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/lib/tasks/gitlab/check.rake#L794) 1. There might be other changes. Ask around. -### **3. Create an update guides** +### **2. Create an update guides** 1. Create: CE update guide from previous version. Like `from-6-8-to-6.9` 1. Create: CE to EE update guide in EE repository for latest version. @@ -81,7 +121,7 @@ Check if the `init.d/gitlab` script changed since last release: <https://gitlab. #### 10. Check application status -### **4. Code quality indicators** +### **3. Code quality indicators** Make sure the code quality indicators are green / good. @@ -95,11 +135,11 @@ Make sure the code quality indicators are green / good. - [](https://coveralls.io/r/gitlabhq/gitlabhq) -### **5. Set VERSION** +### **4. Set VERSION** Change version in VERSION to `x.x.0.rc1`. -### **6. Tag** +### **5. Tag** Create an annotated tag that points to the version change commit: @@ -107,20 +147,27 @@ Create an annotated tag that points to the version change commit: git tag -a vx.x.0.rc1 -m 'Version x.x.0.rc1' ``` -### **7. Tweet** +# **18th - Release RC1** -Tweet about the RC release: +### **1. Update GitLab.com** -> GitLab x.x.x.rc1 is out. This is a release candidate intended for testing only. Please let us know if you find regressions. - -n -### **8. Update GitLab.com** +Merge the RC1 EE code into GitLab.com. +Once the build is green, create a package. +Try to deploy in the morning. +It is important to do this as soon as possible, so we can catch any errors before we release the full version. -Merge the RC1 code into GitLab.com. Once the build is green, deploy in the morning. +### **2. Prepare the blog post** -It is important to do this as soon as possible, so we can catch any errors before we release the full version. +- Start with a complete copy of the [release blog template](https://gitlab.com/gitlab-com/www-gitlab-com/blob/master/doc/release_blog_template.md) and fill it out. +- Check the changelog of CE and EE for important changes. +- Create a WIP MR for the blog post +- Ask Dmitriy to add screenshots to the WIP MR. +- Decide with team who will be the MVP user. +- Add a note if there are security fixes: This release fixes an important security issue and we advise everyone to upgrade as soon as possible. +- Assign to one reviewer who will fix spelling issues by editing the branch (can use the online editor) +- After the reviewer is finished the whole team will be mentioned to give their suggestions via line comments -### **9. Create a regressions issue** +### **3. Create a regressions issue** On [the GitLab CE issue tracker on GitLab.com](https://gitlab.com/gitlab-org/gitlab-ce/issues/) create an issue titled "GitLab X.X regressions" add the following text: @@ -131,17 +178,19 @@ The release manager will comment here about the plans for patch releases. Assign the issue to the release manager and /cc all the core-team members active on the issue tracker. If there are any known bugs in the release add them immediately. -# **21st - Preparation ** +### **4. Tweet** -### **1. Prepare the blog post** +Tweet about the RC release: -- Check the changelog of CE and EE for important changes. Based on [release blog template](https://gitlab.com/gitlab-com/www-gitlab-com/blob/master/doc/release_blog_template.md) fill in the important information. -- Create a WIP MR for the blog post and cc the team so everyone can give feedback. -- Ask Dmitriy to add screenshots to the WIP MR. -- Decide with team who will be the MVP user. -- Add a note if there are security fixes: This release fixes an important security issue and we advise everyone to upgrade as soon as possible. +> GitLab x.x.0.rc1 is out. This release candidate is only suitable for testing. Please link regressions issues from LINK_TO_REGRESSION_ISSUE + +# **21st - Preparation** + +### **1. Pre QA merge** -### **2. Q&A** +Merge CE into EE before doing the QA. + +### **2. QA** Create issue on dev.gitlab.org `gitlab` repository, named "GitLab X.X release" in order to keep track of the progress. @@ -161,6 +210,8 @@ For GitLab EE, append `-ee` to the branches and tags. `v.x.x.0-ee` +Merge CE into EE if needed. + ### **1. Create x-x-stable branch and push to the repositories** ``` @@ -172,7 +223,8 @@ git push <remote> x-x-stable ### **2. Build the Omnibus packages** -[Follow this guide](https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/doc/release.md) +Follow the [release doc in the Omnibus repository](https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/doc/release.md). +This can happen before tagging because Omnibus uses tags in its own repo and SHA1's to refer to the GitLab codebase. ### **3. Set VERSION to x.x.x and push** @@ -216,19 +268,19 @@ Merge the [blog merge request](#1-prepare-the-blog-post) in `www-gitlab-com` rep ### **8. Tweet to blog** -Send out a tweet to share the good news with the world. List the features in short and link to the blog post. - -Proposed tweet for CE "GitLab X.X.X CE is released! It brings *** <link-to-blogpost>" - -Proposed tweet for EE "GitLab X.X.X EE is released! It brings *** <link-to-blogpost>" +Send out a tweet to share the good news with the world. +List the most important features and link to the blog post. -### **9. Send out newsletter** +Proposed tweet for CE "GitLab X.X is released! It brings *** <link-to-blogpost>" -In MailChimp replicate the former release newsletters to customers / newsletter subscribers (these are two separate things) and modify them accordingly. +### **9. Send out the newsletter** +Send out an email to the 'GitLab Newsletter' mailing list on MailChimp. +Replicate the former release newsletter and modify it accordingly. Include a link to the blog post and keep it short. -Proposed email for CE: "We have released a new version of GitLab Community Edition and its packages. See our blog post(<link>) for more information." +Proposed email text: +"We have released a new version of GitLab. See our blog post(<link>) for more information." # **23rd - Optional Patch Release** diff --git a/doc/release/patch.md b/doc/release/patch.md index 7762c9f0e11..bcc14568fc8 100644 --- a/doc/release/patch.md +++ b/doc/release/patch.md @@ -27,4 +27,5 @@ Otherwise include it in the monthly release and note there was a regression fix 1. [Build new packages with the latest version](https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/doc/release.md) 1. Cherry-pick the changelog update back into master 1. Send tweets about the release from `@gitlabhq`, tweet should include the most important feature that the release is addressing as well as the link to the changelog -1. Note in the 'GitLab X.X regressions' issue that the patch was published(CE only) +1. Note in the 'GitLab X.X regressions' issue that the patch was published (CE only) +1. Send out an email to the 'GitLab Newsletter' mailing list on MailChimp (or the 'Subscribers' list if the patch is EE only) diff --git a/doc/release/security.md b/doc/release/security.md index 5265ca82eba..f20d7e16222 100644 --- a/doc/release/security.md +++ b/doc/release/security.md @@ -18,9 +18,8 @@ Please report suspected security vulnerabilities in private to <support@gitlab.c 1. Create feature branches for the blog post on GitLab.com and link them from the code branch 1. Merge and publish the blog posts 1. Send tweets about the release from `@gitlabhq` -1. Send out an email to the subscribers mailing list on MailChimp +1. Send out an email to the 'GitLab Newsletter' mailing list on MailChimp (or the 'Subscribers' list if the security fix is for EE only) 1. Send out an email to [the community google mailing list](https://groups.google.com/forum/#!forum/gitlabhq) -1. Send out an email to [the GitLab newsletter list](http://gitlab.us5.list-manage.com/subscribe?u=498dccd07cf3e9482bee33ba4&id=98a9a4992c) 1. Post a signed copy of our complete announcement to [oss-security](http://www.openwall.com/lists/oss-security/) and request a CVE number 1. Add the security researcher to the [Security Researcher Acknowledgments list](http://www.gitlab.com/vulnerability-acknowledgements/) 1. Thank the security researcher in an email for their cooperation diff --git a/doc/update/5.1-to-6.0.md b/doc/update/5.1-to-6.0.md index 11afc75f0f3..d8484b2c650 100644 --- a/doc/update/5.1-to-6.0.md +++ b/doc/update/5.1-to-6.0.md @@ -95,15 +95,15 @@ sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production Note: We switched from Puma in GitLab 5.x to unicorn in GitLab 6.0. -- Make `/home/git/gitlab/config/gitlab.yml` the same as https://gitlab.com/gitlab-org/gitlab-ce/blob/masterconfig/gitlab.yml.example but with your settings. -- Make `/home/git/gitlab/config/unicorn.rb` the same as https://gitlab.com/gitlab-org/gitlab-ce/blob/masterconfig/unicorn.rb.example but with your settings. +- Make `/home/git/gitlab/config/gitlab.yml` the same as https://gitlab.com/gitlab-org/gitlab-ce/blob/6-0-stable/config/gitlab.yml.example but with your settings. +- Make `/home/git/gitlab/config/unicorn.rb` the same as https://gitlab.com/gitlab-org/gitlab-ce/blob/6-0-stable/config/unicorn.rb.example but with your settings. ## 7. Update Init script ```bash cd /home/git/gitlab sudo rm /etc/init.d/gitlab -sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab +sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab sudo chmod +x /etc/init.d/gitlab ``` diff --git a/doc/update/6.0-to-7.0.md b/doc/update/6.0-to-7.1.md index b73adc8cfb3..e328114a673 100644 --- a/doc/update/6.0-to-7.0.md +++ b/doc/update/6.0-to-7.1.md @@ -1,8 +1,8 @@ -# From 6.0 to 7.0 +# From 6.0 to 7.1 ## Deprecations -The 'Wall' feature has been removed in GitLab 7.0. Existing wall comments will remain stored in the database after the upgrade. +The 'Wall' feature has been removed in GitLab 7.1. Existing wall comments will remain stored in the database after the upgrade. ## Global issue numbers @@ -32,7 +32,7 @@ sudo -u git -H git fetch --all For GitLab Community Edition: ```bash -sudo -u git -H git checkout 7-0-stable +sudo -u git -H git checkout 7-1-stable ``` OR @@ -40,7 +40,7 @@ OR For GitLab Enterprise Edition: ```bash -sudo -u git -H git checkout 7-0-stable-ee +sudo -u git -H git checkout 7-1-stable-ee ``` @@ -56,7 +56,7 @@ sudo apt-get install logrotate ```bash cd /home/git/gitlab-shell sudo -u git -H git fetch -sudo -u git -H git checkout v1.9.3 # Addresses multiple critical security vulnerabilities +sudo -u git -H git checkout v1.9.6 # Addresses multiple critical security vulnerabilities ``` ## 5. Install libs, migrations, etc. @@ -89,12 +89,12 @@ sudo chmod u+rwx,g+rx,o-rwx /home/git/gitlab-satellites TIP: to see what changed in gitlab.yml.example in this release use next command: ``` -git diff 6-0-stable:config/gitlab.yml.example 7-0-stable:config/gitlab.yml.example +git diff 6-0-stable:config/gitlab.yml.example 7-1-stable:config/gitlab.yml.example ``` -* Make `/home/git/gitlab/config/gitlab.yml` the same as https://gitlab.com/gitlab-org/gitlab-ce/blob/7-0-stable/config/gitlab.yml.example but with your settings. -* Make `/home/git/gitlab/config/unicorn.rb` the same as https://gitlab.com/gitlab-org/gitlab-ce/blob/7-0-stable/config/unicorn.rb.example but with your settings. -* Make `/etc/nginx/sites-available/nginx` the same as https://gitlab.com/gitlab-org/gitlab-ce/blob/7-0-stable/lib/support/nginx/gitlab but with your settings. +* Make `/home/git/gitlab/config/gitlab.yml` the same as https://gitlab.com/gitlab-org/gitlab-ce/blob/7-1-stable/config/gitlab.yml.example but with your settings. +* Make `/home/git/gitlab/config/unicorn.rb` the same as https://gitlab.com/gitlab-org/gitlab-ce/blob/7-1-stable/config/unicorn.rb.example but with your settings. +* Make `/etc/nginx/sites-available/nginx` the same as https://gitlab.com/gitlab-org/gitlab-ce/blob/7-1-stable/lib/support/nginx/gitlab but with your settings. * Copy rack attack middleware config ```bash diff --git a/doc/update/7.0-to-7.1.md b/doc/update/7.0-to-7.1.md new file mode 100644 index 00000000000..6864101f8c6 --- /dev/null +++ b/doc/update/7.0-to-7.1.md @@ -0,0 +1,138 @@ +# From 7.0 to 7.1 + +### 0. Backup + +```bash +cd /home/git/gitlab +sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production +``` + +### 1. Stop server + +```bash +sudo service gitlab stop +``` + +### 2. Update Ruby + +If you are still using Ruby 1.9.3 or below, you will need to update Ruby. +You can check which version you are running with `ruby -v`. + +If you are you running Ruby 2.0.x, you do not need to upgrade ruby, but can consider doing so for performance reasons. + +If you are running Ruby 2.1.1 consider upgrading to 2.1.2, because of the high memory usage of Ruby 2.1.1. + +Install, update dependencies: + +```bash +sudo apt-get install build-essential zlib1g-dev libyaml-dev libssl-dev libgdbm-dev libreadline-dev libncurses5-dev libffi-dev curl +``` + +Download and compile Ruby: + +```bash +mkdir /tmp/ruby && cd /tmp/ruby +curl --progress ftp://ftp.ruby-lang.org/pub/ruby/2.1/ruby-2.1.2.tar.gz | tar xz +cd ruby-2.1.2 +./configure --disable-install-rdoc +make +sudo make install +``` + +Install Bundler: + +```bash +sudo gem install bundler --no-ri --no-rdoc +``` + +### 3. Get latest code + +```bash +cd /home/git/gitlab +sudo -u git -H git fetch --all +``` + +For Gitlab Community Edition: + +```bash +sudo -u git -H git checkout 7-1-stable +``` + +OR + +For GitLab Enterprise Edition: + +```bash +sudo -u git -H git checkout 7-1-stable-ee +``` + +### 4. Update gitlab-shell (and its config) + +```bash +cd /home/git/gitlab-shell +sudo -u git -H git fetch +sudo -u git -H git checkout v1.9.6 +``` + +### 5. Install libs, migrations, etc. + +```bash +cd /home/git/gitlab + +# MySQL installations (note: the line below states '--without ... postgres') +sudo -u git -H bundle install --without development test postgres --deployment + +# PostgreSQL installations (note: the line below states '--without ... mysql') +sudo -u git -H bundle install --without development test mysql --deployment + +# Run database migrations +sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production + +# Clean up assets and cache +sudo -u git -H bundle exec rake assets:clean assets:precompile cache:clear RAILS_ENV=production + +# Update init.d script +sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab +sudo chmod +x /etc/init.d/gitlab +``` + +### 6. Update config files + +#### New configuration options for gitlab.yml + +There are new configuration options available for gitlab.yml. View them with the command below and apply them to your current gitlab.yml if desired. + +``` +git diff 7-0-stable:config/gitlab.yml.example 7-1-stable:config/gitlab.yml.example +``` + +### 7. Start application + + sudo service gitlab start + sudo service nginx restart + +### 8. Check application status + +Check if GitLab and its environment are configured correctly: + + sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production + +To make sure you didn't miss anything run a more thorough check with: + + sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production + +If all items are green, then congratulations upgrade is complete! + +## Things went south? Revert to previous version (7.0) + +### 1. Revert the code to the previous version +Follow the [`upgrade guide from 6.9 to 7.0`](6.9-to-7.0.md), except for the database migration +(The backup is already migrated to the previous version) + +### 2. Restore from the backup: + +```bash +cd /home/git/gitlab +sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production +``` +If you have more than one backup *.tar file(s) please add `BACKUP=timestamp_of_backup` to the command above. diff --git a/doc/update/mysql_to_postgresql.md b/doc/update/mysql_to_postgresql.md index 05c95679673..91689890640 100644 --- a/doc/update/mysql_to_postgresql.md +++ b/doc/update/mysql_to_postgresql.md @@ -91,7 +91,7 @@ cd tmp/backups/postgresql sudo -u git -H mysqldump --compatible=postgresql --default-character-set=utf8 -r gitlabhq_production.mysql -u root gitlabhq_production # Clone the database converter -sudo -u git -H git clone https://github.com/lanyrd/mysql-postgresql-converter.git +sudo -u git -H git clone https://github.com/gitlabhq/mysql-postgresql-converter.git # Convert gitlabhq_production.mysql sudo -u git -H mkdir db diff --git a/doc/workflow/README.md b/doc/workflow/README.md index c715f6e5943..00d4bed1cc7 100644 --- a/doc/workflow/README.md +++ b/doc/workflow/README.md @@ -1,3 +1,4 @@ - [Workflow](workflow.md) - [Project Features](project_features.md) - [Authorization for merge requests](authorization_for_merge_requests.md) +- [Groups](groups.md) diff --git a/doc/workflow/groups.md b/doc/workflow/groups.md new file mode 100644 index 00000000000..611f871cf77 --- /dev/null +++ b/doc/workflow/groups.md @@ -0,0 +1,71 @@ +# GitLab Groups + +GitLab groups allow you to group projects into directories and give users to several projects at once. + +When you create a new project in GitLab, the default namespace for the project is the personal namespace associated with your GitLab user. +In this document we will see how to create groups, put projects in groups and manage who can access the projects in a group. + +## Creating groups + +You can create a group by going to the 'Groups' tab of the GitLab dashboard and clicking the 'New group' button. + + + +Next, enter the name (required) and the optional description and group avatar. + + + +When your group has been created you are presented with the group dashboard feed, which will be empty. + + + +You can use the 'New project' button to add a project to the new group. + +## Transfering an existing project into a group + +You can transfer an existing project into a group you own from the project settings page. +First scroll down to the 'Dangerous settings' and click 'Show them to me'. +Now you can pick any of the groups you manage as the new namespace for the group. + + + +GitLab administrators can use the admin interface to move any project to any namespace if needed. + +## Adding users to a group + +One of the benefits of putting multiple projects in one group is that you can give a user to access to all projects in the group with one action. + +Suppose we have a group with two projects. + + + +On the 'Group Members' page we can now add a new user Barry to the group. + + + +Now because Barry is a 'Developer' member of the 'Open Source' group, he automatically gets 'Developer' access to all projects in the 'Open Source' group. + + + +If necessary, you can increase the access level of an individual user for a specific project, by adding them as a Member to the project. + + + +## Managing group memberships via LDAP + +In GitLab Enterprise Edition it is possible to manage GitLab group memberships using LDAP groups. +See [the GitLab Enterprise Edition documentation](http://doc.gitlab.com/ee/integration/ldap.html) for more information. + +## Allowing only admins to create groups + +By default, any GitLab user can create new groups. +This ability can be disabled for individual users from the admin panel. +It is also possible to configure GitLab so that new users default to not being able to create groups: + +``` +# For omnibus-gitlab, put the following in /etc/gitlab/gitlab.rb +gitlab_rails['gitlab_default_can_create_group'] = false + +# For installations from source, uncomment the 'default_can_create_group' +# line in /home/git/gitlab/config/gitlab.yml +``` diff --git a/doc/workflow/groups/add_member_to_group.png b/doc/workflow/groups/add_member_to_group.png Binary files differnew file mode 100644 index 00000000000..fa340ce572f --- /dev/null +++ b/doc/workflow/groups/add_member_to_group.png diff --git a/doc/workflow/groups/group_dashboard.png b/doc/workflow/groups/group_dashboard.png Binary files differnew file mode 100644 index 00000000000..7fc9048d74d --- /dev/null +++ b/doc/workflow/groups/group_dashboard.png diff --git a/doc/workflow/groups/group_with_two_projects.png b/doc/workflow/groups/group_with_two_projects.png Binary files differnew file mode 100644 index 00000000000..87242781e4f --- /dev/null +++ b/doc/workflow/groups/group_with_two_projects.png diff --git a/doc/workflow/groups/new_group_button.png b/doc/workflow/groups/new_group_button.png Binary files differnew file mode 100644 index 00000000000..51e82798658 --- /dev/null +++ b/doc/workflow/groups/new_group_button.png diff --git a/doc/workflow/groups/new_group_form.png b/doc/workflow/groups/new_group_form.png Binary files differnew file mode 100644 index 00000000000..bf992c40bc2 --- /dev/null +++ b/doc/workflow/groups/new_group_form.png diff --git a/doc/workflow/groups/override_access_level.png b/doc/workflow/groups/override_access_level.png Binary files differnew file mode 100644 index 00000000000..f4225a63679 --- /dev/null +++ b/doc/workflow/groups/override_access_level.png diff --git a/doc/workflow/groups/project_members_via_group.png b/doc/workflow/groups/project_members_via_group.png Binary files differnew file mode 100644 index 00000000000..b13cb1cfd95 --- /dev/null +++ b/doc/workflow/groups/project_members_via_group.png diff --git a/doc/workflow/groups/transfer_project.png b/doc/workflow/groups/transfer_project.png Binary files differnew file mode 100644 index 00000000000..044fe10d073 --- /dev/null +++ b/doc/workflow/groups/transfer_project.png diff --git a/features/public/projects.feature b/features/explore/projects.feature index c7bb3b4f8ce..9827ebe3e57 100644 --- a/features/public/projects.feature +++ b/features/explore/projects.feature @@ -1,5 +1,5 @@ @public -Feature: Public Projects Feature +Feature: Explore Projects Feature Background: Given public project "Community" And internal project "Internal" @@ -100,3 +100,17 @@ Feature: Public Projects Feature And I visit "Internal" merge requests page And project "Internal" has "Feature implemented" open merge request Then I should see list of merge requests for "Internal" project + + Scenario: Trending page + Given I sign in as a user + And project "Community" has comments + When I visit the explore trending projects + Then I should see project "Community" + And I should not see project "Internal" + And I should not see project "Enterprise" + + Scenario: Most starred page + Given I sign in as a user + When I visit the explore starred projects + Then I should see project "Community" + And I should see project "Internal" diff --git a/features/public/public_groups.feature b/features/explore/public_groups.feature index 8bbda8cb6d4..825e3da934e 100644 --- a/features/public/public_groups.feature +++ b/features/explore/public_groups.feature @@ -1,5 +1,5 @@ @public -Feature: Public Projects Feature +Feature: Explore Groups Feature Background: Given group "TestGroup" has private project "Enterprise" @@ -117,3 +117,35 @@ Feature: Public Projects Feature And I visit group "TestGroup" members page Then I should see group member "John Doe" And I should not see member roles + + Scenario: I should see group with public project in public groups area + Given group "TestGroup" has public project "Community" + When I visit the public groups area + Then I should see group "TestGroup" + + Scenario: I should not see group with internal project in public groups area + Given group "TestGroup" has internal project "Internal" + When I visit the public groups area + Then I should not see group "TestGroup" + + Scenario: I should not see group with private project in public groups area + When I visit the public groups area + Then I should not see group "TestGroup" + + Scenario: I should see group with public project in public groups area as user + Given group "TestGroup" has public project "Community" + When I sign in as a user + And I visit the public groups area + Then I should see group "TestGroup" + + Scenario: I should see group with internal project in public groups area as user + Given group "TestGroup" has internal project "Internal" + When I sign in as a user + And I visit the public groups area + Then I should see group "TestGroup" + + Scenario: I should not see group with private project in public groups area as user + When I sign in as a user + And I visit the public groups area + Then I should not see group "TestGroup" + diff --git a/features/group.feature b/features/group.feature index 71c28c07a3c..b5ff03db844 100644 --- a/features/group.feature +++ b/features/group.feature @@ -120,3 +120,24 @@ Feature: Groups When I search for 'Mary' member Then I should see user "Mary Jane" in team list Then I should not see user "John Doe" in team list + + # Group milestones + + Scenario: I should see group "Owned" milestone index page with no milestones + When I visit group "Owned" page + And I click on group milestones + Then I should see group milestones index page has no milestones + + Scenario: I should see group "Owned" milestone index page with milestones + Given Group has projects with milestones + When I visit group "Owned" page + And I click on group milestones + Then I should see group milestones index page with milestones + + Scenario: I should see group "Owned" milestone show page + Given Group has projects with milestones + When I visit group "Owned" page + And I click on group milestones + And I click on one group milestone + Then I should see group milestone with descriptions and expiry date + And I should see group milestone with all issues and MRs assigned to that milestone diff --git a/features/project/commits/user_lookup.feature b/features/project/commits/user_lookup.feature index f3864c0ab38..aa347e24fe4 100644 --- a/features/project/commits/user_lookup.feature +++ b/features/project/commits/user_lookup.feature @@ -11,4 +11,4 @@ Feature: Project Browse Commits User Lookup Scenario: I browse another commit from list Given I click on another commit link - Then I see other commit info
\ No newline at end of file + Then I see other commit info diff --git a/features/project/edit_issuetracker.feature b/features/project/edit_issuetracker.feature index b5477d3c7ab..cc0de07ca69 100644 --- a/features/project/edit_issuetracker.feature +++ b/features/project/edit_issuetracker.feature @@ -15,4 +15,4 @@ Feature: Project Issue Tracker When I visit edit project "Shop" page And change the issue tracker to "Redmine" And I save project - Then I the project should have "Redmine" as issue tracker
\ No newline at end of file + Then I the project should have "Redmine" as issue tracker diff --git a/features/project/hooks.feature b/features/project/hooks.feature index b158e07ad33..52e02a890dd 100644 --- a/features/project/hooks.feature +++ b/features/project/hooks.feature @@ -19,3 +19,8 @@ Feature: Project Hooks When I click test hook button Then hook should be triggered + Scenario: I test a hook on empty project + Given I own empty project with hook + And I visit project hooks page + When I click test hook button + Then I should see hook error message diff --git a/features/project/issues/filter_labels.feature b/features/project/issues/filter_labels.feature index 8df7a119e84..f4a0a7977cc 100644 --- a/features/project/issues/filter_labels.feature +++ b/features/project/issues/filter_labels.feature @@ -2,9 +2,10 @@ Feature: Project Filter Labels Background: Given I sign in as a user And I own project "Shop" - And project "Shop" has issue "Bugfix1" with tags: "bug", "feature" - And project "Shop" has issue "Bugfix2" with tags: "bug", "enhancement" - And project "Shop" has issue "Feature1" with tags: "feature" + And project "Shop" has labels: "bug", "feature", "enhancement" + And project "Shop" has issue "Bugfix1" with labels: "bug", "feature" + And project "Shop" has issue "Bugfix2" with labels: "bug", "enhancement" + And project "Shop" has issue "Feature1" with labels: "feature" Given I visit project "Shop" issues page Scenario: I should see project issues @@ -18,9 +19,12 @@ Feature: Project Filter Labels And I should see "Bugfix2" in issues list And I should not see "Feature1" in issues list - Scenario: I filter by two labels - Given I click link "bug" - And I click link "feature" - Then I should see "Bugfix1" in issues list - And I should not see "Bugfix2" in issues list - And I should not see "Feature1" in issues list + # TODO: make labels filter works according to this scanario + # right now it looks for label 1 OR label 2. Old behaviour (this test) was + # all issues that have both label 1 AND label 2 + #Scenario: I filter by two labels + #Given I click link "bug" + #And I click link "feature" + #Then I should see "Bugfix1" in issues list + #And I should not see "Bugfix2" in issues list + #And I should not see "Feature1" in issues list diff --git a/features/project/issues/issues.feature b/features/project/issues/issues.feature index 191e8dcbe7f..b2e6f1f9324 100644 --- a/features/project/issues/issues.feature +++ b/features/project/issues/issues.feature @@ -30,6 +30,13 @@ Feature: Project Issues And I submit new issue "500 error on profile" Then I should see issue "500 error on profile" + Scenario: I submit new unassigned issue with labels + Given project "Shop" has labels: "bug", "feature", "enhancement" + And I click link "New Issue" + And I submit new issue "500 error on profile" with label 'bug' + Then I should see issue "500 error on profile" + And I should see label 'bug' with issue + @javascript Scenario: I comment issue Given I visit issue page "Release 0.4" diff --git a/features/project/issues/labels.feature b/features/project/issues/labels.feature index e601a41bfc4..4a37b6dc9fa 100644 --- a/features/project/issues/labels.feature +++ b/features/project/issues/labels.feature @@ -2,9 +2,24 @@ Feature: Project Labels Background: Given I sign in as a user And I own project "Shop" - And project "Shop" have issues tags: "bug", "feature" + And project "Shop" has labels: "bug", "feature", "enhancement" Given I visit project "Shop" labels page - Scenario: I should see active milestones + Scenario: I should see labels list Then I should see label "bug" And I should see label "feature" + + Scenario: I create new label + Given I visit new label page + When I submit new label 'support' + Then I should see label 'support' + + Scenario: I edit label + Given I visit 'bug' label edit page + When I change label 'bug' to 'fix' + Then I should not see label 'bug' + Then I should see label 'fix' + + Scenario: I remove label + When I remove label 'bug' + Then I should not see label 'bug' diff --git a/features/project/project.feature b/features/project/project.feature index d561c6e440e..c1f192f123e 100644 --- a/features/project/project.feature +++ b/features/project/project.feature @@ -29,3 +29,9 @@ Feature: Project Feature When I visit project "Shop" page Then I should see project "Shop" README link And I should see project "Shop" version + + Scenario: I should change project default branch + When I visit edit project "Shop" page + And change project default branch + And I save project + Then I should see project default branch changed diff --git a/features/project/public.feature b/features/project/public.feature deleted file mode 100644 index c5a9da14c54..00000000000 --- a/features/project/public.feature +++ /dev/null @@ -1,8 +0,0 @@ -Feature: Public Projects - Background: - Given I sign in as a user - - Scenario: I should see the list of public projects - When I visit the public projects area - Then I should see the list of public projects - diff --git a/features/project/redirects.feature b/features/project/redirects.feature index 776ab83a876..a2e77e7bf30 100644 --- a/features/project/redirects.feature +++ b/features/project/redirects.feature @@ -31,3 +31,8 @@ Feature: Project Redirects And I click on "Sign In" And Authenticate Then I should be redirected to "Community" page + + Scenario: I visit private project page without signing in + When I visit project "Enterprise" page + And I get redirected to signin page where I sign in + Then I should be redirected to "Enterprise" page diff --git a/features/project/source/browse_files.feature b/features/project/source/browse_files.feature index a204c3e10c7..4af2cc83581 100644 --- a/features/project/source/browse_files.feature +++ b/features/project/source/browse_files.feature @@ -38,4 +38,16 @@ Feature: Project Browse files And I click link "Diff" Then I see diff - + Scenario: I can browse directory with Browse Dir + Given I click on app directory + And I click on history link + Then I see Browse dir link + + Scenario: I can browse file with Browse File + Given I click on readme file + And I click on history link + Then I see Browse file link + + Scenario: I can browse code with Browse Code + Given I click on history link + Then I see Browse code link diff --git a/features/project/star.feature b/features/project/star.feature new file mode 100644 index 00000000000..3322f891805 --- /dev/null +++ b/features/project/star.feature @@ -0,0 +1,38 @@ +Feature: Project Star + Scenario: New projects have 0 stars + Given public project "Community" + When I visit project "Community" page + Then The project has no stars + + Scenario: Empty projects show star count + Given public empty project "Empty Public Project" + When I visit empty project page + Then The project has no stars + + Scenario: Signed off users can't star projects + Given public project "Community" + And I visit project "Community" page + When I click on the star toggle button + Then The project has 0 stars + + @javascript + Scenario: Signed in users can toggle star + Given I sign in as "John Doe" + And public project "Community" + And I visit project "Community" page + When I click on the star toggle button + Then The project has 1 star + When I click on the star toggle button + Then The project has 0 stars + + @javascript + Scenario: Star count sums stars + Given I sign in as "John Doe" + And public project "Community" + And I visit project "Community" page + And I click on the star toggle button + And I logout + And I sign in as "Mary Jane" + And I visit project "Community" page + When I click on the star toggle button + Then The project has 2 stars diff --git a/features/steps/admin/active_tab.rb b/features/steps/admin/active_tab.rb index ccafe09c18f..8f09e51ccef 100644 --- a/features/steps/admin/active_tab.rb +++ b/features/steps/admin/active_tab.rb @@ -4,7 +4,7 @@ class AdminActiveTab < Spinach::FeatureSteps include SharedActiveTab Then 'the active main tab should be Home' do - ensure_active_main_tab('Home') + ensure_active_main_tab('Overview') end Then 'the active main tab should be Projects' do diff --git a/features/steps/dashboard/active_tab.rb b/features/steps/dashboard/active_tab.rb index 8f5f0eed816..68d32ed971a 100644 --- a/features/steps/dashboard/active_tab.rb +++ b/features/steps/dashboard/active_tab.rb @@ -4,7 +4,7 @@ class DashboardActiveTab < Spinach::FeatureSteps include SharedActiveTab Then 'the active main tab should be Home' do - ensure_active_main_tab('Home') + ensure_active_main_tab('Activity') end Then 'the active main tab should be Issues' do diff --git a/features/steps/public/groups_feature.rb b/features/steps/explore/groups_feature.rb index 015deca5427..48486a83424 100644 --- a/features/steps/public/groups_feature.rb +++ b/features/steps/explore/groups_feature.rb @@ -1,4 +1,4 @@ -class Spinach::Features::PublicProjectsFeature < Spinach::FeatureSteps +class Spinach::Features::ExploreGroupsFeature < Spinach::FeatureSteps include SharedAuthentication include SharedPaths include SharedGroup @@ -15,7 +15,7 @@ class Spinach::Features::PublicProjectsFeature < Spinach::FeatureSteps step 'group "TestGroup" has public project "Community"' do group_has_project("TestGroup", "Community", Gitlab::VisibilityLevel::PUBLIC) end - + step '"John Doe" is owner of group "TestGroup"' do group = Group.find_by(name: "TestGroup") || create(:group, name: "TestGroup") user = create(:user, name: "John Doe") @@ -37,31 +37,31 @@ class Spinach::Features::PublicProjectsFeature < Spinach::FeatureSteps step 'I visit group "TestGroup" members page' do visit members_group_path(Group.find_by(name: "TestGroup")) end - + step 'I should not see project "Enterprise" items' do page.should_not have_content "Enterprise" end - + step 'I should see project "Internal" items' do page.should have_content "Internal" end - + step 'I should not see project "Internal" items' do page.should_not have_content "Internal" end - + step 'I should see project "Community" items' do page.should have_content "Community" end - + step 'I change filter to Everyone\'s' do click_link "Everyone's" end - + step 'I should see group member "John Doe"' do page.should have_content "John Doe" end - + step 'I should not see member roles' do page.body.should_not match(%r{owner|developer|reporter|guest}i) end diff --git a/features/steps/public/projects.rb b/features/steps/explore/projects.rb index 7c7311bb91c..dfd51060738 100644 --- a/features/steps/public/projects.rb +++ b/features/steps/explore/projects.rb @@ -1,12 +1,8 @@ -class Spinach::Features::PublicProjectsFeature < Spinach::FeatureSteps +class Spinach::Features::ExploreProjectsFeature < Spinach::FeatureSteps include SharedAuthentication include SharedPaths include SharedProject - step 'public empty project "Empty Public Project"' do - create :empty_project, :public, name: 'Empty Public Project' - end - step 'I should see project "Empty Public Project"' do page.should have_content "Empty Public Project" end @@ -20,16 +16,6 @@ class Spinach::Features::PublicProjectsFeature < Spinach::FeatureSteps page.should have_content 'README.md' end - step 'I visit empty project page' do - project = Project.find_by(name: 'Empty Public Project') - visit project_path(project) - end - - step 'I visit project "Community" page' do - project = Project.find_by(name: 'Community') - visit project_path(project) - end - step 'I should see empty public project details' do page.should have_content 'Git global setup' end @@ -48,22 +34,12 @@ class Spinach::Features::PublicProjectsFeature < Spinach::FeatureSteps end end - step 'I visit project "Enterprise" page' do - project = Project.find_by(name: 'Enterprise') - visit project_path(project) - end - step 'I should see project "Community" home page' do within '.project-home-title' do page.should have_content 'Community' end end - step 'I visit project "Internal" page' do - project = Project.find_by(name: 'Internal') - visit project_path(project) - end - step 'I should see project "Internal" home page' do within '.project-home-title' do page.should have_content 'Internal' diff --git a/features/steps/group/group.rb b/features/steps/group/group.rb index f321428592f..288524f92b2 100644 --- a/features/steps/group/group.rb +++ b/features/steps/group/group.rb @@ -164,6 +164,41 @@ class Groups < Spinach::FeatureSteps end end + step 'I click on group milestones' do + click_link 'Milestones' + end + + step 'I should see group milestones index page has no milestones' do + page.should have_content('No milestones to show') + end + + step 'Group has projects with milestones' do + group_milestone + end + + step 'I should see group milestones index page with milestones' do + page.should have_content('Version 7.2') + page.should have_content('GL-113') + page.should have_link('2 Issues', href: group_milestone_path("owned", "version-7-2", title: "Version 7.2")) + page.should have_link('3 Merge Requests', href: group_milestone_path("owned", "gl-113", title: "GL-113")) + end + + step 'I click on one group milestone' do + click_link 'GL-113' + end + + step 'I should see group milestone with descriptions and expiry date' do + page.should have_content('Lorem Ipsum is simply dummy text of the printing and typesetting industry') + page.should have_content('expires at Aug 20, 2014') + end + + step 'I should see group milestone with all issues and MRs assigned to that milestone' do + page.should have_content('Milestone GL-113') + page.should have_content('Progress: 0 closed – 4 open') + page.should have_link(@issue1.title, href: project_issue_path(@project1, @issue1)) + page.should have_link(@mr3.title, href: project_merge_request_path(@project3, @mr3)) + end + protected def assigned_to_me key @@ -173,4 +208,70 @@ class Groups < Spinach::FeatureSteps def project Group.find_by(name: "Owned").projects.first end + + def group_milestone + group = Group.find_by(name: "Owned") + + @project1 = create :project, + group: group + project2 = create :project, + path: 'gitlab-ci', + group: group + @project3 = create :project, + path: 'cookbook-gitlab', + group: group + milestone1_project1 = create :milestone, + title: "Version 7.2", + project: @project1 + milestone1_project2 = create :milestone, + title: "Version 7.2", + project: project2 + milestone1_project3 = create :milestone, + title: "Version 7.2", + project: @project3 + milestone2_project1 = create :milestone, + title: "GL-113", + project: @project1 + milestone2_project2 = create :milestone, + title: "GL-113", + project: project2 + milestone2_project3 = create :milestone, + title: "GL-113", + project: @project3, + due_date: '2014-08-20', + description: 'Lorem Ipsum is simply dummy text of the printing and typesetting industry' + @issue1 = create :issue, + project: @project1, + assignee: current_user, + author: current_user, + milestone: milestone2_project1 + issue2 = create :issue, + project: project2, + assignee: current_user, + author: current_user, + milestone: milestone1_project2 + issue3 = create :issue, + project: @project3, + assignee: current_user, + author: current_user, + milestone: milestone1_project1 + mr1 = create :merge_request, + source_project: @project1, + target_project: @project1, + assignee: current_user, + author: current_user, + milestone: milestone2_project1 + mr2 = create :merge_request, + source_project: project2, + target_project: project2, + assignee: current_user, + author: current_user, + milestone: milestone2_project2 + @mr3 = create :merge_request, + source_project: @project3, + target_project: @project3, + assignee: current_user, + author: current_user, + milestone: milestone2_project3 + end end diff --git a/features/steps/profile/active_tab.rb b/features/steps/profile/active_tab.rb index ee9f5f201cf..1924a6fa785 100644 --- a/features/steps/profile/active_tab.rb +++ b/features/steps/profile/active_tab.rb @@ -4,7 +4,7 @@ class ProfileActiveTab < Spinach::FeatureSteps include SharedActiveTab Then 'the active main tab should be Home' do - ensure_active_main_tab('Home') + ensure_active_main_tab('Profile') end Then 'the active main tab should be Account' do diff --git a/features/steps/profile/profile.rb b/features/steps/profile/profile.rb index 879bcf41b40..5a7ac207314 100644 --- a/features/steps/profile/profile.rb +++ b/features/steps/profile/profile.rb @@ -145,6 +145,7 @@ class Profile < Spinach::FeatureSteps end step 'I submit new password' do + fill_in :user_current_password, with: '12345678' fill_in :user_password, with: '12345678' fill_in :user_password_confirmation, with: '12345678' click_button "Set new password" @@ -179,7 +180,7 @@ class Profile < Spinach::FeatureSteps @group.add_owner(current_user) @project = create(:project, namespace: @group) @event = create(:closed_issue_event, project: @project) - + @project.team << [current_user, :master] end diff --git a/features/steps/project/active_tab.rb b/features/steps/project/active_tab.rb index dcc252f4765..dfafbc6fc0e 100644 --- a/features/steps/project/active_tab.rb +++ b/features/steps/project/active_tab.rb @@ -7,7 +7,7 @@ class ProjectActiveTab < Spinach::FeatureSteps # Main Tabs Then 'the active main tab should be Home' do - ensure_active_main_tab('Home') + ensure_active_main_tab('Activity') end Then 'the active main tab should be Settings' do diff --git a/features/steps/project/archived.rb b/features/steps/project/archived.rb index dfbe762c438..8b490d2ffc0 100644 --- a/features/steps/project/archived.rb +++ b/features/steps/project/archived.rb @@ -34,4 +34,4 @@ class ProjectArchived < Spinach::FeatureSteps click_link "Unarchive" end -end
\ No newline at end of file +end diff --git a/features/steps/project/browse_commits.rb b/features/steps/project/browse_commits.rb index bd944dee610..fe47a731915 100644 --- a/features/steps/project/browse_commits.rb +++ b/features/steps/project/browse_commits.rb @@ -61,8 +61,7 @@ class ProjectBrowseCommits < Spinach::FeatureSteps Then 'I see big commit warning' do page.should have_content BigCommits::BIG_COMMIT_MESSAGE - page.should have_content "Warning! This is a large diff" - page.should have_content "If you still want to see the diff" + page.should have_content "Too many changes" end Given 'I visit huge commit page' do @@ -71,8 +70,6 @@ class ProjectBrowseCommits < Spinach::FeatureSteps Then 'I see huge commit message' do page.should have_content BigCommits::HUGE_COMMIT_MESSAGE - page.should have_content "Warning! This is a large diff" - page.should_not have_content "If you still want to see the diff" end Given 'I visit a commit with an image that changed' do diff --git a/features/steps/project/browse_files.rb b/features/steps/project/browse_files.rb index 7cdd1101ac5..7134050da69 100644 --- a/features/steps/project/browse_files.rb +++ b/features/steps/project/browse_files.rb @@ -62,4 +62,32 @@ class ProjectBrowseFiles < Spinach::FeatureSteps page.should have_content "File name" page.should have_content "Commit message" end + + step 'I click on app directory' do + click_link 'app' + end + + step 'I click on history link' do + click_link 'history' + end + + step 'I see Browse dir link' do + page.should have_link 'Browse Dir »' + page.should_not have_link 'Browse Code »' + end + + step 'I click on readme file' do + click_link 'README.md' + end + + step 'I see Browse file link' do + page.should have_link 'Browse File »' + page.should_not have_link 'Browse Code »' + end + + step 'I see Browse code link' do + page.should have_link 'Browse Code »' + page.should_not have_link 'Browse File »' + page.should_not have_link 'Browse Dir »' + end end diff --git a/features/steps/project/filter_labels.rb b/features/steps/project/filter_labels.rb index 5926d69d6c7..9b31a6d9da2 100644 --- a/features/steps/project/filter_labels.rb +++ b/features/steps/project/filter_labels.rb @@ -3,68 +3,77 @@ class ProjectFilterLabels < Spinach::FeatureSteps include SharedProject include SharedPaths - Then 'I should see "bug" in labels filter' do + step 'I should see "bug" in labels filter' do within ".labels-filter" do page.should have_content "bug" end end - And 'I should see "feature" in labels filter' do + step 'I should see "feature" in labels filter' do within ".labels-filter" do page.should have_content "feature" end end - And 'I should see "enhancement" in labels filter' do + step 'I should see "enhancement" in labels filter' do within ".labels-filter" do page.should have_content "enhancement" end end - Then 'I should see "Bugfix1" in issues list' do + step 'I should see "Bugfix1" in issues list' do within ".issues-list" do page.should have_content "Bugfix1" end end - And 'I should see "Bugfix2" in issues list' do + step 'I should see "Bugfix2" in issues list' do within ".issues-list" do page.should have_content "Bugfix2" end end - And 'I should not see "Bugfix2" in issues list' do + step 'I should not see "Bugfix2" in issues list' do within ".issues-list" do page.should_not have_content "Bugfix2" end end - And 'I should not see "Feature1" in issues list' do + step 'I should not see "Feature1" in issues list' do within ".issues-list" do page.should_not have_content "Feature1" end end - Given 'I click link "bug"' do - click_link "bug" + step 'I click link "bug"' do + within ".labels-filter" do + click_link "bug" + end end - Given 'I click link "feature"' do - click_link "feature" + step 'I click link "feature"' do + within ".labels-filter" do + click_link "feature" + end end - And 'project "Shop" has issue "Bugfix1" with tags: "bug", "feature"' do + step 'project "Shop" has issue "Bugfix1" with labels: "bug", "feature"' do project = Project.find_by(name: "Shop") - create(:issue, title: "Bugfix1", project: project, label_list: ['bug', 'feature']) + issue = create(:issue, title: "Bugfix1", project: project) + issue.labels << project.labels.find_by(title: 'bug') + issue.labels << project.labels.find_by(title: 'feature') end - And 'project "Shop" has issue "Bugfix2" with tags: "bug", "enhancement"' do + step 'project "Shop" has issue "Bugfix2" with labels: "bug", "enhancement"' do project = Project.find_by(name: "Shop") - create(:issue, title: "Bugfix2", project: project, label_list: ['bug', 'enhancement']) + issue = create(:issue, title: "Bugfix2", project: project) + issue.labels << project.labels.find_by(title: 'bug') + issue.labels << project.labels.find_by(title: 'enhancement') end - And 'project "Shop" has issue "Feature1" with tags: "feature"' do + step 'project "Shop" has issue "Feature1" with labels: "feature"' do project = Project.find_by(name: "Shop") - create(:issue, title: "Feature1", project: project, label_list: 'feature') + issue = create(:issue, title: "Feature1", project: project) + issue.labels << project.labels.find_by(title: 'feature') end end diff --git a/features/steps/project/hooks.rb b/features/steps/project/hooks.rb index 19ff3244543..30da589260d 100644 --- a/features/steps/project/hooks.rb +++ b/features/steps/project/hooks.rb @@ -8,31 +8,45 @@ class ProjectHooks < Spinach::FeatureSteps include RSpec::Mocks::ExampleMethods include WebMock::API - Given 'project has hook' do + step 'project has hook' do @hook = create(:project_hook, project: current_project) end - Then 'I should see project hook' do + step 'I own empty project with hook' do + @project = create(:empty_project, + name: 'Empty Project', namespace: @user.namespace) + @hook = create(:project_hook, project: current_project) + end + + step 'I should see project hook' do page.should have_content @hook.url end - When 'I submit new hook' do + step 'I submit new hook' do @url = Faker::Internet.uri("http") fill_in "hook_url", with: @url expect { click_button "Add Web Hook" }.to change(ProjectHook, :count).by(1) end - Then 'I should see newly created hook' do + step 'I should see newly created hook' do page.current_path.should == project_hooks_path(current_project) page.should have_content(@url) end - When 'I click test hook button' do + step 'I click test hook button' do stub_request(:post, @hook.url).to_return(status: 200) click_link 'Test Hook' end - Then 'hook should be triggered' do + step 'hook should be triggered' do page.current_path.should == project_hooks_path(current_project) + page.should have_selector '.flash-notice', + text: 'Hook successfully executed.' + end + + step 'I should see hook error message' do + page.should have_selector '.flash-alert', + text: 'Hook execution failed. '\ + 'Ensure the project has commits.' end end diff --git a/features/steps/project/issues.rb b/features/steps/project/issues.rb index d0b4aa6e080..557ea2fdca8 100644 --- a/features/steps/project/issues.rb +++ b/features/steps/project/issues.rb @@ -50,10 +50,22 @@ class ProjectIssues < Spinach::FeatureSteps click_button "Submit new issue" end + step 'I submit new issue "500 error on profile" with label \'bug\'' do + fill_in "issue_title", with: "500 error on profile" + select 'bug', from: "Labels" + click_button "Submit new issue" + end + Given 'I click link "500 error on profile"' do click_link "500 error on profile" end + step 'I should see label \'bug\' with issue' do + within '.issue-show-labels' do + page.should have_content 'bug' + end + end + Then 'I should see issue "500 error on profile"' do issue = Issue.find_by(title: "500 error on profile") page.should have_content issue.title diff --git a/features/steps/project/labels.rb b/features/steps/project/labels.rb index 0907cdb526f..3d9aa29299c 100644 --- a/features/steps/project/labels.rb +++ b/features/steps/project/labels.rb @@ -3,22 +3,59 @@ class ProjectLabels < Spinach::FeatureSteps include SharedProject include SharedPaths - Then 'I should see label "bug"' do - within ".labels-table" do + step 'I should see label "bug"' do + within ".manage-labels-list" do page.should have_content "bug" end end - And 'I should see label "feature"' do - within ".labels-table" do + step 'I should see label "feature"' do + within ".manage-labels-list" do page.should have_content "feature" end end - And 'project "Shop" have issues tags: "bug", "feature"' do - project = Project.find_by(name: "Shop") - ['bug', 'feature'].each do |label| - create(:issue, project: project, label_list: label) + step 'I visit \'bug\' label edit page' do + visit edit_project_label_path(project, bug_label) + end + + step 'I remove label \'bug\'' do + within "#label_#{bug_label.id}" do + click_link 'Remove' end end + + step 'I submit new label \'support\'' do + fill_in 'Title', with: 'support' + fill_in 'Background Color', with: '#F95610' + click_button 'Save' + end + + step 'I should not see label \'bug\'' do + within '.manage-labels-list' do + page.should_not have_content 'bug' + end + end + + step 'I should see label \'support\'' do + within '.manage-labels-list' do + page.should have_content 'support' + end + end + + step 'I change label \'bug\' to \'fix\'' do + fill_in 'Title', with: 'fix' + fill_in 'Background Color', with: '#F15610' + click_button 'Save' + end + + step 'I should see label \'fix\'' do + within '.manage-labels-list' do + page.should have_content 'fix' + end + end + + def bug_label + project.labels.find_or_create_by(title: 'bug') + end end diff --git a/features/steps/project/multiselect_blob.rb b/features/steps/project/multiselect_blob.rb index 3d330e837c1..28df7bc9312 100644 --- a/features/steps/project/multiselect_blob.rb +++ b/features/steps/project/multiselect_blob.rb @@ -55,4 +55,4 @@ class ProjectMultiselectBlob < Spinach::FeatureSteps step 'I click on "Gemfile.lock" file in repo' do click_link "Gemfile.lock" end -end
\ No newline at end of file +end diff --git a/features/steps/project/project.rb b/features/steps/project/project.rb index 7c0b2509416..b6968152aaf 100644 --- a/features/steps/project/project.rb +++ b/features/steps/project/project.rb @@ -36,4 +36,15 @@ class ProjectFeature < Spinach::FeatureSteps page.should have_content "Version: 2.2.0" end end + + step 'change project default branch' do + select 'stable', from: 'project_default_branch' + end + + step 'I should see project default branch changed' do + # TODO: Uncomment this when we can do real gitlab-shell calls + # from spinach tests. Right now gitlab-shell calls are stubbed so this test + # will not pass + # find(:css, 'select#project_default_branch').value.should == 'stable' + end end diff --git a/features/steps/project/public.rb b/features/steps/project/public.rb deleted file mode 100644 index 7063e7d56ae..00000000000 --- a/features/steps/project/public.rb +++ /dev/null @@ -1,9 +0,0 @@ -class PublicProjects < Spinach::FeatureSteps - include SharedAuthentication - include SharedProject - include SharedPaths - - Then 'I should see the list of public projects' do - page.should have_content "Public Projects" - end -end diff --git a/features/steps/project/redirects.rb b/features/steps/project/redirects.rb index 5a4342dba30..7e01735af95 100644 --- a/features/steps/project/redirects.rb +++ b/features/steps/project/redirects.rb @@ -17,6 +17,7 @@ class Spinach::Features::ProjectRedirects < Spinach::FeatureSteps end step 'I should see project "Community" home page' do + Gitlab.config.gitlab.stub(:host).and_return("www.example.com") within '.project-home-title' do page.should have_content 'Community' end @@ -41,7 +42,6 @@ class Spinach::Features::ProjectRedirects < Spinach::FeatureSteps step 'Authenticate' do admin = create(:admin) project = Project.find_by(name: 'Community') - find(:xpath, "//input[@id='return_to']").set "/#{project.path_with_namespace}" fill_in "user_login", with: admin.email fill_in "user_password", with: admin.password click_button "Sign in" @@ -53,5 +53,19 @@ class Spinach::Features::ProjectRedirects < Spinach::FeatureSteps page.current_path.should == "/#{project.path_with_namespace}" page.status_code.should == 200 end -end + step 'I get redirected to signin page where I sign in' do + admin = create(:admin) + project = Project.find_by(name: 'Enterprise') + fill_in "user_login", with: admin.email + fill_in "user_password", with: admin.password + click_button "Sign in" + Thread.current[:current_user] = admin + end + + step 'I should be redirected to "Enterprise" page' do + project = Project.find_by(name: 'Enterprise') + page.current_path.should == "/#{project.path_with_namespace}" + page.status_code.should == 200 + end +end diff --git a/features/steps/project/star.rb b/features/steps/project/star.rb new file mode 100644 index 00000000000..562df04e340 --- /dev/null +++ b/features/steps/project/star.rb @@ -0,0 +1,33 @@ +class Spinach::Features::ProjectStar < Spinach::FeatureSteps + include SharedAuthentication + include SharedProject + include SharedPaths + include SharedUser + + step "The project has no stars" do + page.should_not have_content '.star-buttons' + end + + step "The project has 0 stars" do + has_n_stars(0) + end + + step "The project has 1 star" do + has_n_stars(1) + end + + step "The project has 2 stars" do + has_n_stars(2) + end + + # Requires @javascript + step "I click on the star toggle button" do + page.find(".star .toggle", visible: true).click + end + + protected + + def has_n_stars(n) + expect(page).to have_css(".star .count", text: /^#{n}$/, visible: true) + end +end diff --git a/features/steps/shared/active_tab.rb b/features/steps/shared/active_tab.rb index d504fda3327..e3cd5fcfe85 100644 --- a/features/steps/shared/active_tab.rb +++ b/features/steps/shared/active_tab.rb @@ -2,11 +2,7 @@ module SharedActiveTab include Spinach::DSL def ensure_active_main_tab(content) - if content == "Home" - page.find('.main-nav li.active').should have_css('i.icon-home') - else - page.find('.main-nav li.active').should have_content(content) - end + page.find('.main-nav li.active').should have_content(content) end def ensure_active_sub_tab(content) diff --git a/features/steps/shared/authentication.rb b/features/steps/shared/authentication.rb index b8c11ce0a23..b48021dc146 100644 --- a/features/steps/shared/authentication.rb +++ b/features/steps/shared/authentication.rb @@ -24,6 +24,10 @@ module SharedAuthentication current_path.should == new_user_session_path end + step "I logout" do + logout + end + def current_user @user || User.first end diff --git a/features/steps/shared/group.rb b/features/steps/shared/group.rb index 6b4c47312a7..1b225dd61a6 100644 --- a/features/steps/shared/group.rb +++ b/features/steps/shared/group.rb @@ -21,6 +21,14 @@ module SharedGroup is_member_of("Mary Jane", "Guest", Gitlab::Access::GUEST) end + step 'I should see group "TestGroup"' do + page.should have_content "TestGroup" + end + + step 'I should not see group "TestGroup"' do + page.should_not have_content "TestGroup" + end + protected def is_member_of(username, groupname, role) diff --git a/features/steps/shared/paths.rb b/features/steps/shared/paths.rb index 2090b642059..21cc8da6d7c 100644 --- a/features/steps/shared/paths.rb +++ b/features/steps/shared/paths.rb @@ -289,6 +289,10 @@ module SharedPaths visit project_labels_path(project) end + step 'I visit new label page' do + visit new_project_label_path(project) + end + step 'I visit merge request page "Bug NS-04"' do mr = MergeRequest.find_by(title: "Bug NS-04") visit project_merge_request_path(mr.target_project, mr) @@ -320,15 +324,51 @@ module SharedPaths end # ---------------------------------------- + # Visibility Projects + # ---------------------------------------- + + step 'I visit project "Community" page' do + project = Project.find_by(name: "Community") + visit project_path(project) + end + + step 'I visit project "Internal" page' do + project = Project.find_by(name: "Internal") + visit project_path(project) + end + + step 'I visit project "Enterprise" page' do + project = Project.find_by(name: "Enterprise") + visit project_path(project) + end + + # ---------------------------------------- + # Empty Projects + # ---------------------------------------- + + step "I visit empty project page" do + project = Project.find_by(name: "Empty Public Project") + visit project_path(project) + end + + # ---------------------------------------- # Public Projects # ---------------------------------------- step 'I visit the public projects area' do - visit public_root_path + visit explore_projects_path end - step 'I visit public page for "Community" project' do - visit public_project_path(Project.find_by(name: "Community")) + step 'I visit the explore trending projects' do + visit trending_explore_projects_path + end + + step 'I visit the explore starred projects' do + visit starred_explore_projects_path + end + + step 'I visit the public groups area' do + visit explore_groups_path end # ---------------------------------------- diff --git a/features/steps/shared/project.rb b/features/steps/shared/project.rb index 40362fee0bc..e31d349a45f 100644 --- a/features/steps/shared/project.rb +++ b/features/steps/shared/project.rb @@ -10,7 +10,7 @@ module SharedProject # Create a specific project called "Shop" And 'I own project "Shop"' do @project = Project.find_by(name: "Shop") - @project ||= create(:project, name: "Shop", namespace: @user.namespace) + @project ||= create(:project, name: "Shop", namespace: @user.namespace, snippets_enabled: true) @project.team << [@user, :master] end @@ -122,4 +122,20 @@ module SharedProject project ||= create :empty_project, :public, name: 'Community', namespace: user.namespace project.team << [user, :master] end + + step 'public empty project "Empty Public Project"' do + create :empty_project, :public, name: "Empty Public Project" + end + + step 'project "Community" has comments' do + project = Project.find_by(name: "Community") + 2.times { create(:note_on_issue, project: project) } + end + + step 'project "Shop" has labels: "bug", "feature", "enhancement"' do + project = Project.find_by(name: "Shop") + create(:label, project: project, title: 'bug') + create(:label, project: project, title: 'feature') + create(:label, project: project, title: 'enhancement') + end end diff --git a/lib/api/entities.rb b/lib/api/entities.rb index b190646a1e3..42715d2be3b 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -126,7 +126,7 @@ module API end class Issue < ProjectEntity - expose :label_list, as: :labels + expose :label_names, as: :labels expose :milestone, using: Entities::Milestone expose :assignee, :author, using: Entities::UserBasic end @@ -135,7 +135,7 @@ module API expose :target_branch, :source_branch, :upvotes, :downvotes expose :author, :assignee, using: Entities::UserBasic expose :source_project_id, :target_project_id - expose :label_list, as: :labels + expose :label_names, as: :labels end class SSHKey < Grape::Entity @@ -201,13 +201,13 @@ module API class Compare < Grape::Entity expose :commit, using: Entities::RepoCommit do |compare, options| - if compare.commit - Commit.new compare.commit - end + Commit.decorate(compare.commits).last end + expose :commits, using: Entities::RepoCommit do |compare, options| - Commit.decorate compare.commits + Commit.decorate(compare.commits) end + expose :diffs, using: Entities::RepoDiff do |compare, options| compare.diffs end @@ -218,5 +218,9 @@ module API expose :same, as: :compare_same_ref end + + class Contributor < Grape::Entity + expose :name, :email, :commits, :additions, :deletions + end end end diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb index b6a5806d646..d7d209e16f7 100644 --- a/lib/api/helpers.rb +++ b/lib/api/helpers.rb @@ -98,10 +98,14 @@ module API def attributes_for_keys(keys) attrs = {} + keys.each do |key| - attrs[key] = params[key] if params[key].present? or (params.has_key?(key) and params[key] == false) + if params[key].present? or (params.has_key?(key) and params[key] == false) + attrs[key] = params[key] + end end - attrs + + ActionController::Parameters.new(attrs).permit! end # error helpers diff --git a/lib/api/issues.rb b/lib/api/issues.rb index f50be3a815d..b29118b2fd8 100644 --- a/lib/api/issues.rb +++ b/lib/api/issues.rb @@ -50,10 +50,15 @@ module API post ":id/issues" do required_attributes! [:title] attrs = attributes_for_keys [:title, :description, :assignee_id, :milestone_id] - attrs[:label_list] = params[:labels] if params[:labels].present? + issue = ::Issues::CreateService.new(user_project, current_user, attrs).execute if issue.valid? + # Find or create labels and attach to issue + if params[:labels].present? + issue.add_labels_by_names(params[:labels].split(",")) + end + present issue, with: Entities::Issue else not_found! @@ -76,13 +81,16 @@ module API put ":id/issues/:issue_id" do issue = user_project.issues.find(params[:issue_id]) authorize! :modify_issue, issue - attrs = attributes_for_keys [:title, :description, :assignee_id, :milestone_id, :state_event] - attrs[:label_list] = params[:labels] if params[:labels].present? issue = ::Issues::UpdateService.new(user_project, current_user, attrs).execute(issue) if issue.valid? + # Find or create labels and attach to issue + if params[:labels].present? + issue.add_labels_by_names(params[:labels].split(",")) + end + present issue, with: Entities::Issue else not_found! diff --git a/lib/api/merge_requests.rb b/lib/api/merge_requests.rb index fc1f1254a9e..acca7cb6bad 100644 --- a/lib/api/merge_requests.rb +++ b/lib/api/merge_requests.rb @@ -76,10 +76,14 @@ module API authorize! :write_merge_request, user_project required_attributes! [:source_branch, :target_branch, :title] attrs = attributes_for_keys [:source_branch, :target_branch, :assignee_id, :title, :target_project_id, :description] - attrs[:label_list] = params[:labels] if params[:labels].present? merge_request = ::MergeRequests::CreateService.new(user_project, current_user, attrs).execute if merge_request.valid? + # Find or create labels and attach to issue + if params[:labels].present? + merge_request.add_labels_by_names(params[:labels].split(",")) + end + present merge_request, with: Entities::MergeRequest else handle_merge_request_errors! merge_request.errors @@ -103,12 +107,16 @@ module API # put ":id/merge_request/:merge_request_id" do attrs = attributes_for_keys [:source_branch, :target_branch, :assignee_id, :title, :state_event, :description] - attrs[:label_list] = params[:labels] if params[:labels].present? merge_request = user_project.merge_requests.find(params[:merge_request_id]) authorize! :modify_merge_request, merge_request merge_request = ::MergeRequests::UpdateService.new(user_project, current_user, attrs).execute(merge_request) if merge_request.valid? + # Find or create labels and attach to issue + if params[:labels].present? + merge_request.add_labels_by_names(params[:labels].split(",")) + end + present merge_request, with: Entities::MergeRequest else handle_merge_request_errors! merge_request.errors diff --git a/lib/api/projects.rb b/lib/api/projects.rb index 732c969d7ef..88c73bff32d 100644 --- a/lib/api/projects.rb +++ b/lib/api/projects.rb @@ -77,6 +77,7 @@ module API # namespace_id (optional) - defaults to user namespace # public (optional) - if true same as setting visibility_level = 20 # visibility_level (optional) - 0 by default + # import_url (optional) # Example Request # POST /projects post do @@ -117,6 +118,7 @@ module API # snippets_enabled (optional) # public (optional) - if true same as setting visibility_level = 20 # visibility_level (optional) + # import_url (optional) # Example Request # POST /projects/user/:user_id post "user/:user_id" do @@ -130,7 +132,8 @@ module API :wiki_enabled, :snippets_enabled, :public, - :visibility_level] + :visibility_level, + :import_url] attrs = map_public_to_visibility_level(attrs) @project = ::Projects::CreateService.new(user, attrs).execute if @project.saved? @@ -219,7 +222,7 @@ module API # Example Request: # GET /projects/:id/labels get ':id/labels' do - @labels = user_project.issues_labels + @labels = user_project.labels present @labels, with: Entities::Label end end diff --git a/lib/api/repositories.rb b/lib/api/repositories.rb index 03806d9343b..461ce4e59cf 100644 --- a/lib/api/repositories.rb +++ b/lib/api/repositories.rb @@ -147,9 +147,21 @@ module API get ':id/repository/compare' do authorize! :download_code, user_project required_attributes! [:from, :to] - compare = Gitlab::Git::Compare.new(user_project.repository.raw_repository, params[:from], params[:to], MergeRequestDiff::COMMITS_SAFE_SIZE) + compare = Gitlab::Git::Compare.new(user_project.repository.raw_repository, params[:from], params[:to]) present compare, with: Entities::Compare end + + # Get repository contributors + # + # Parameters: + # id (required) - The ID of a project + # Example Request: + # GET /projects/:id/repository/contributors + get ':id/repository/contributors' do + authorize! :download_code, user_project + + present user_project.repository.contributors, with: Entities::Contributor + end end end end diff --git a/lib/api/users.rb b/lib/api/users.rb index 92dbe97f0a4..69553f16397 100644 --- a/lib/api/users.rb +++ b/lib/api/users.rb @@ -59,7 +59,7 @@ module API authenticated_as_admin! required_attributes! [:email, :password, :name, :username] attrs = attributes_for_keys [:email, :name, :password, :skype, :linkedin, :twitter, :projects_limit, :username, :extern_uid, :provider, :bio, :can_create_group, :admin] - user = User.build_user(attrs, as: :admin) + user = User.build_user(attrs) admin = attrs.delete(:admin) user.admin = admin unless admin.nil? if user.save @@ -96,7 +96,7 @@ module API admin = attrs.delete(:admin) user.admin = admin unless admin.nil? - if user.update_attributes(attrs, as: :admin) + if user.update_attributes(attrs) present user, with: Entities::UserFull else not_found! diff --git a/lib/gitlab/compare_result.rb b/lib/gitlab/compare_result.rb new file mode 100644 index 00000000000..d72391dade5 --- /dev/null +++ b/lib/gitlab/compare_result.rb @@ -0,0 +1,9 @@ +module Gitlab + class CompareResult + attr_reader :commits, :diffs + + def initialize(compare) + @commits, @diffs = compare.commits, compare.diffs + end + end +end diff --git a/lib/gitlab/config_helper.rb b/lib/gitlab/config_helper.rb new file mode 100644 index 00000000000..41880069e4c --- /dev/null +++ b/lib/gitlab/config_helper.rb @@ -0,0 +1,9 @@ +module Gitlab::ConfigHelper + def gitlab_config_features + Gitlab.config.gitlab.default_projects_features + end + + def gitlab_config + Gitlab.config.gitlab + end +end diff --git a/lib/gitlab/contributors.rb b/lib/gitlab/contributors.rb new file mode 100644 index 00000000000..c41e92b620f --- /dev/null +++ b/lib/gitlab/contributors.rb @@ -0,0 +1,9 @@ +module Gitlab + class Contributor + attr_accessor :email, :name, :commits, :additions, :deletions + + def initialize + @commits, @additions, @deletions = 0, 0, 0 + end + end +end diff --git a/lib/gitlab/issues_labels.rb b/lib/gitlab/issues_labels.rb index bc49d27b521..0d34976736f 100644 --- a/lib/gitlab/issues_labels.rb +++ b/lib/gitlab/issues_labels.rb @@ -1,27 +1,27 @@ module Gitlab class IssuesLabels class << self - def important_labels - %w(bug critical confirmed) - end - - def warning_labels - %w(documentation support) - end - - def neutral_labels - %w(discussion suggestion) - end - - def positive_labels - %w(feature enhancement) - end - def generate(project) - labels = important_labels + warning_labels + neutral_labels + positive_labels + red = '#d9534f' + yellow = '#f0ad4e' + blue = '#428bca' + green = '#5cb85c' + + labels = [ + { title: "bug", color: red }, + { title: "critical", color: red }, + { title: "confirmed", color: red }, + { title: "documentation", color: yellow }, + { title: "support", color: yellow }, + { title: "discussion", color: blue }, + { title: "suggestion", color: blue }, + { title: "feature", color: green }, + { title: "enhancement", color: green } + ] - project.issues_default_label_list = labels - project.save + labels.each do |label| + project.labels.create(label) + end end end end diff --git a/lib/gitlab/ldap/adapter.rb b/lib/gitlab/ldap/adapter.rb index e36616f0e66..ca239bea884 100644 --- a/lib/gitlab/ldap/adapter.rb +++ b/lib/gitlab/ldap/adapter.rb @@ -14,7 +14,15 @@ module Gitlab end def self.adapter_options - encryption = config['method'].to_s == 'ssl' ? :simple_tls : nil + encryption = + case config['method'].to_s + when 'ssl' + :simple_tls + when 'tls' + :start_tls + else + nil + end options = { host: config['host'], diff --git a/lib/gitlab/oauth/user.rb b/lib/gitlab/oauth/user.rb index 38e33c0eee5..0056eb3a28b 100644 --- a/lib/gitlab/oauth/user.rb +++ b/lib/gitlab/oauth/user.rb @@ -27,7 +27,7 @@ module Gitlab password_confirmation: password, } - user = model.build_user(opts, as: :admin) + user = model.build_user(opts) user.skip_confirmation! # Services like twitter and github does not return email via oauth @@ -67,7 +67,9 @@ module Gitlab end def uid - auth.info.uid || auth.uid + uid = auth.info.uid || auth.uid + uid = uid.to_s unless uid.nil? + uid end def email diff --git a/lib/gitlab/regex.rb b/lib/gitlab/regex.rb index e932b64f4f0..4b8038843b0 100644 --- a/lib/gitlab/regex.rb +++ b/lib/gitlab/regex.rb @@ -6,18 +6,35 @@ module Gitlab default_regex end + def username_regex_message + default_regex_message + end + def project_name_regex /\A[a-zA-Z0-9_][a-zA-Z0-9_\-\. ]*\z/ end + def project_regex_message + "can contain only letters, digits, '_', '-' and '.' and space. " \ + "It must start with letter, digit or '_'." + end + def name_regex /\A[a-zA-Z0-9_\-\. ]*\z/ end + def name_regex_message + "can contain only letters, digits, '_', '-' and '.' and space." + end + def path_regex default_regex end + def path_regex_message + default_regex_message + end + def archive_formats_regex #|zip|tar| tar.gz | tar.bz2 | /(zip|tar|tar\.gz|tgz|gz|tar\.bz2|tbz|tbz2|tb2|bz2)/ @@ -48,8 +65,14 @@ module Gitlab protected + def default_regex_message + "can contain only letters, digits, '_', '-' and '.'. " \ + "It must start with letter, digit or '_', optionally preceeded by '.'. " \ + "It must not end in '.git'." + end + def default_regex - /\A[.?]?[a-zA-Z0-9_][a-zA-Z0-9_\-\.]*(?<!\.git)\z/ + /\A[a-zA-Z0-9_.][a-zA-Z0-9_\-\.]*(?<!\.git)\z/ end end end diff --git a/lib/gitlab/satellite/action.rb b/lib/gitlab/satellite/action.rb index 5ea6f956765..be45cb5c98e 100644 --- a/lib/gitlab/satellite/action.rb +++ b/lib/gitlab/satellite/action.rb @@ -1,7 +1,7 @@ module Gitlab module Satellite class Action - DEFAULT_OPTIONS = { git_timeout: 30.seconds } + DEFAULT_OPTIONS = { git_timeout: Gitlab.config.satellites.timeout.seconds } attr_accessor :options, :project, :user diff --git a/lib/gitlab/satellite/compare_action.rb b/lib/gitlab/satellite/compare_action.rb index c923bb9c0f0..46c98a8f4ca 100644 --- a/lib/gitlab/satellite/compare_action.rb +++ b/lib/gitlab/satellite/compare_action.rb @@ -1,5 +1,7 @@ module Gitlab module Satellite + class BranchesWithoutParent < StandardError; end + class CompareAction < Action def initialize(user, target_project, target_branch, source_project, source_branch) super user, target_project @@ -8,34 +10,16 @@ module Gitlab @source_project, @source_branch = source_project, source_branch end - # Only show what is new in the source branch compared to the target branch, not the other way around. - # The line below with merge_base is equivalent to diff with three dots (git diff branch1...branch2) - # From the git documentation: "git diff A...B" is equivalent to "git diff $(git-merge-base A B) B" - def diffs + # Compare 2 repositories and return Gitlab::CompareResult object + def result in_locked_and_timed_satellite do |target_repo| prepare_satellite!(target_repo) update_satellite_source_and_target!(target_repo) - common_commit = target_repo.git.native(:merge_base, default_options, ["origin/#{@target_branch}", "source/#{@source_branch}"]).strip - #this method doesn't take default options - diffs = target_repo.diff(common_commit, "source/#{@source_branch}") - diffs = diffs.map { |diff| Gitlab::Git::Diff.new(diff) } - diffs - end - rescue Grit::Git::CommandFailed => ex - handle_exception(ex) - end - # Retrieve an array of commits between the source and the target - def commits - in_locked_and_timed_satellite do |target_repo| - prepare_satellite!(target_repo) - update_satellite_source_and_target!(target_repo) - commits = target_repo.commits_between("origin/#{@target_branch}", "source/#{@source_branch}") - commits = commits.map { |commit| Gitlab::Git::Commit.new(commit, nil) } - commits + Gitlab::CompareResult.new(compare(target_repo)) end rescue Grit::Git::CommandFailed => ex - handle_exception(ex) + raise BranchesWithoutParent end private @@ -44,10 +28,17 @@ module Gitlab def update_satellite_source_and_target!(target_repo) target_repo.remote_add('source', @source_project.repository.path_to_repo) target_repo.remote_fetch('source') - target_repo.git.checkout(default_options({b: true}), @target_branch, "origin/#{@target_branch}") rescue Grit::Git::CommandFailed => ex handle_exception(ex) end + + def compare(repo) + @compare ||= Gitlab::Git::Compare.new( + Gitlab::Git::Repository.new(repo.path), + "origin/#{@target_branch}", + "source/#{@source_branch}" + ) + end end end end diff --git a/lib/gitlab/satellite/merge_action.rb b/lib/gitlab/satellite/merge_action.rb index 5f17aa60b8b..6c32dfb3ad9 100644 --- a/lib/gitlab/satellite/merge_action.rb +++ b/lib/gitlab/satellite/merge_action.rb @@ -31,8 +31,9 @@ module Gitlab # push merge back to bare repo # will raise CommandFailed when push fails merge_repo.git.push(default_options, :origin, merge_request.target_branch) + # remove source branch - if merge_request.should_remove_source_branch && !project.root_ref?(merge_request.source_branch) + if merge_request.should_remove_source_branch && !project.root_ref?(merge_request.source_branch) && !merge_request.for_fork? # will raise CommandFailed when push fails merge_repo.git.push(default_options, :origin, ":#{merge_request.source_branch}") end diff --git a/lib/gitlab/satellite/satellite.rb b/lib/gitlab/satellite/satellite.rb index 05123ad9c41..7c058b58c4c 100644 --- a/lib/gitlab/satellite/satellite.rb +++ b/lib/gitlab/satellite/satellite.rb @@ -53,7 +53,7 @@ module Gitlab File.open(lock_file, "w+") do |f| begin f.flock File::LOCK_EX - Dir.chdir(path) { return yield } + yield ensure f.flock File::LOCK_UN end diff --git a/lib/gitlab/sidekiq_middleware/arguments_logger.rb b/lib/gitlab/sidekiq_middleware/arguments_logger.rb new file mode 100644 index 00000000000..7813091ec7b --- /dev/null +++ b/lib/gitlab/sidekiq_middleware/arguments_logger.rb @@ -0,0 +1,10 @@ +module Gitlab + module SidekiqMiddleware + class ArgumentsLogger + def call(worker, job, queue) + Sidekiq.logger.info "arguments: #{job['args']}" + yield + end + end + end +end diff --git a/lib/gitlab/theme.rb b/lib/gitlab/theme.rb index 44237a062fc..b7c50cb734d 100644 --- a/lib/gitlab/theme.rb +++ b/lib/gitlab/theme.rb @@ -1,10 +1,10 @@ module Gitlab class Theme - BASIC = 1 - MARS = 2 - MODERN = 3 - GRAY = 4 - COLOR = 5 + BASIC = 1 unless const_defined?(:BASIC) + MARS = 2 unless const_defined?(:MARS) + MODERN = 3 unless const_defined?(:MODERN) + GRAY = 4 unless const_defined?(:GRAY) + COLOR = 5 unless const_defined?(:COLOR) def self.css_class_by_id(id) themes = { diff --git a/lib/gitlab/visibility_level.rb b/lib/gitlab/visibility_level.rb index eada9bcddf5..ea1319268f8 100644 --- a/lib/gitlab/visibility_level.rb +++ b/lib/gitlab/visibility_level.rb @@ -5,9 +5,9 @@ # module Gitlab module VisibilityLevel - PRIVATE = 0 - INTERNAL = 10 - PUBLIC = 20 + PRIVATE = 0 unless const_defined?(:PRIVATE) + INTERNAL = 10 unless const_defined?(:INTERNAL) + PUBLIC = 20 unless const_defined?(:PUBLIC) class << self def values @@ -21,7 +21,7 @@ module Gitlab 'Public' => PUBLIC } end - + def allowed_for?(user, level) user.is_admin? || !Gitlab.config.gitlab.restricted_visibility_levels.include?(level) end diff --git a/lib/tasks/gitlab/check.rake b/lib/tasks/gitlab/check.rake index 34116568e99..3f219261abe 100644 --- a/lib/tasks/gitlab/check.rake +++ b/lib/tasks/gitlab/check.rake @@ -27,6 +27,7 @@ namespace :gitlab do check_projects_have_namespace check_satellites_exist check_redis_version + check_ruby_version check_git_version finished_checking "GitLab" @@ -216,7 +217,7 @@ namespace :gitlab do puts "" Project.find_each(batch_size: 100) do |project| - print "#{project.name_with_namespace.yellow} ... " + print sanitized_message(project) if project.satellite.exists? puts "yes".green @@ -525,7 +526,7 @@ namespace :gitlab do puts "" Project.find_each(batch_size: 100) do |project| - print "#{project.name_with_namespace.yellow} ... " + print sanitized_message(project) if project.empty_repo? puts "repository is empty".magenta @@ -588,7 +589,7 @@ namespace :gitlab do puts "" Project.find_each(batch_size: 100) do |project| - print "#{project.name_with_namespace.yellow} ... " + print sanitized_message(project) if project.namespace puts "yes".green @@ -816,6 +817,23 @@ namespace :gitlab do end end + def check_ruby_version + required_version = Gitlab::VersionInfo.new(2, 0, 0) + current_version = Gitlab::VersionInfo.parse(run(%W(ruby --version))) + + print "Ruby version >= #{required_version} ? ... " + + if current_version.valid? && required_version <= current_version + puts "yes (#{current_version})".green + else + puts "no".red + try_fixing_it( + "Update your ruby to a version >= #{required_version} from #{current_version}" + ) + fix_and_rerun + end + end + def check_git_version required_version = Gitlab::VersionInfo.new(1, 7, 10) current_version = Gitlab::VersionInfo.parse(run(%W(#{Gitlab.config.git.bin_path} --version))) @@ -837,4 +855,20 @@ namespace :gitlab do def omnibus_gitlab? Dir.pwd == '/opt/gitlab/embedded/service/gitlab-rails' end + + def sanitized_message(project) + if sanitize + "#{project.namespace_id.to_s.yellow}/#{project.id.to_s.yellow} ... " + else + "#{project.name_with_namespace.yellow} ... " + end + end + + def sanitize + if ENV['SANITIZE'] == "true" + true + else + false + end + end end diff --git a/lib/tasks/gitlab/cleanup.rake b/lib/tasks/gitlab/cleanup.rake index 4aaab11340f..63dcdc52370 100644 --- a/lib/tasks/gitlab/cleanup.rake +++ b/lib/tasks/gitlab/cleanup.rake @@ -84,5 +84,29 @@ namespace :gitlab do puts "To cleanup this directories run this command with REMOVE=true".yellow end end + + desc "GITLAB | Cleanup | Block users that have been removed in LDAP" + task block_removed_ldap_users: :environment do + warn_user_is_not_gitlab + block_flag = ENV['BLOCK'] + + User.ldap.each do |ldap_user| + print "#{ldap_user.name} (#{ldap_user.extern_uid}) ..." + if Gitlab::LDAP::Access.open { |access| access.allowed?(ldap_user) } + puts " [OK]".green + else + if block_flag + ldap_user.block! + puts " [BLOCKED]".red + else + puts " [NOT IN LDAP]".yellow + end + end + end + + unless block_flag + puts "To block these users run this command with BLOCK=true".yellow + end + end end end diff --git a/lib/tasks/gitlab/test.rake b/lib/tasks/gitlab/test.rake index 5b937ce0a28..c01b00bd1c0 100644 --- a/lib/tasks/gitlab/test.rake +++ b/lib/tasks/gitlab/test.rake @@ -11,4 +11,4 @@ namespace :gitlab do system({'RAILS_ENV' => 'test', 'force' => 'yes'}, *cmd) or raise("#{cmd} failed!") end end -end
\ No newline at end of file +end diff --git a/spec/controllers/application_controller_spec.rb b/spec/controllers/application_controller_spec.rb index e1c0269b295..cc32805f5ec 100644 --- a/spec/controllers/application_controller_spec.rb +++ b/spec/controllers/application_controller_spec.rb @@ -30,4 +30,4 @@ describe ApplicationController do controller.send(:check_password_expiration) end end -end
\ No newline at end of file +end diff --git a/spec/controllers/blob_controller_spec.rb b/spec/controllers/blob_controller_spec.rb index cea6922e1c3..929f6d3b46d 100644 --- a/spec/controllers/blob_controller_spec.rb +++ b/spec/controllers/blob_controller_spec.rb @@ -34,4 +34,18 @@ describe Projects::BlobController do it { should respond_with(:not_found) } end end + + describe 'GET show with tree path' do + render_views + + before do + get :show, project_id: project.to_param, id: id + controller.instance_variable_set(:@blob, nil) + end + + context 'redirect to tree' do + let(:id) { 'master/doc' } + it { should redirect_to("/#{project.path_with_namespace}/tree/master/doc") } + end + end end diff --git a/spec/controllers/projects_controller_spec.rb b/spec/controllers/projects_controller_spec.rb index 944df5314bd..71bc49787cc 100644 --- a/spec/controllers/projects_controller_spec.rb +++ b/spec/controllers/projects_controller_spec.rb @@ -2,6 +2,7 @@ require('spec_helper') describe ProjectsController do let(:project) { create(:project) } + let(:public_project) { create(:project, :public) } let(:user) { create(:user) } let(:jpg) { fixture_file_upload(Rails.root + 'spec/fixtures/rails_sample.jpg', 'image/jpg') } let(:txt) { fixture_file_upload(Rails.root + 'spec/fixtures/doc_sample.txt', 'text/plain') } @@ -40,4 +41,22 @@ describe ProjectsController do end end end + + describe "POST #toggle_star" do + it "toggles star if user is signed in" do + sign_in(user) + expect(user.starred?(public_project)).to be_false + post :toggle_star, id: public_project.to_param + expect(user.starred?(public_project)).to be_true + post :toggle_star, id: public_project.to_param + expect(user.starred?(public_project)).to be_false + end + + it "does nothing if user is not signed in" do + post :toggle_star, id: public_project.to_param + expect(user.starred?(public_project)).to be_false + post :toggle_star, id: public_project.to_param + expect(user.starred?(public_project)).to be_false + end + end end diff --git a/spec/controllers/tree_controller_spec.rb b/spec/controllers/tree_controller_spec.rb index 479118a3465..b169c2a678f 100644 --- a/spec/controllers/tree_controller_spec.rb +++ b/spec/controllers/tree_controller_spec.rb @@ -40,4 +40,17 @@ describe Projects::TreeController do it { should respond_with(:not_found) } end end + + describe 'GET show with blob path' do + render_views + + before do + get :show, project_id: project.to_param, id: id + end + + context 'redirect to blob' do + let(:id) { 'master/README.md' } + it { should redirect_to("/#{project.path_with_namespace}/blob/master/README.md") } + end + end end diff --git a/spec/factories.rb b/spec/factories.rb index 41cc99cbcb9..ad4c56986c3 100644 --- a/spec/factories.rb +++ b/spec/factories.rb @@ -32,6 +32,7 @@ FactoryGirl.define do path { name.downcase.gsub(/\s/, '_') } namespace creator + snippets_enabled true trait :public do visibility_level Gitlab::VisibilityLevel::PUBLIC @@ -245,7 +246,7 @@ FactoryGirl.define do end end end - + factory :email do user email do diff --git a/spec/factories/label_links.rb b/spec/factories/label_links.rb new file mode 100644 index 00000000000..d6b6f8581f6 --- /dev/null +++ b/spec/factories/label_links.rb @@ -0,0 +1,8 @@ +# Read about factories at https://github.com/thoughtbot/factory_girl + +FactoryGirl.define do + factory :label_link do + label + target factory: :issue + end +end diff --git a/spec/factories/labels.rb b/spec/factories/labels.rb new file mode 100644 index 00000000000..af9f3efa641 --- /dev/null +++ b/spec/factories/labels.rb @@ -0,0 +1,9 @@ +# Read about factories at https://github.com/thoughtbot/factory_girl + +FactoryGirl.define do + factory :label do + title "Bug" + color "#990000" + project + end +end diff --git a/spec/features/issues_spec.rb b/spec/features/issues_spec.rb index d7f3f3a302c..f0daf081018 100644 --- a/spec/features/issues_spec.rb +++ b/spec/features/issues_spec.rb @@ -226,7 +226,7 @@ describe "Issues", feature: true do issue.save end - it 'shows assignee text' do + it "shows assignee text", js: true do logout login_with guest @@ -262,7 +262,7 @@ describe "Issues", feature: true do issue.save end - it 'shows milestone text' do + it "shows milestone text", js: true do logout login_with guest diff --git a/spec/fixtures/doc_sample.txt b/spec/fixtures/doc_sample.txt index 45dbc1aadde..600477e9421 100644 --- a/spec/fixtures/doc_sample.txt +++ b/spec/fixtures/doc_sample.txt @@ -1,3 +1,3 @@ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. -Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?
\ No newline at end of file +Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur? diff --git a/spec/helpers/gitlab_markdown_helper_spec.rb b/spec/helpers/gitlab_markdown_helper_spec.rb index fc9d1ac90c0..f176a393415 100644 --- a/spec/helpers/gitlab_markdown_helper_spec.rb +++ b/spec/helpers/gitlab_markdown_helper_spec.rb @@ -5,6 +5,7 @@ describe GitlabMarkdownHelper do include IssuesHelper let!(:project) { create(:project) } + let(:empty_project) { create(:empty_project) } let(:user) { create(:user, username: 'gfm') } let(:commit) { project.repository.commit } @@ -506,6 +507,19 @@ describe GitlabMarkdownHelper do end end + describe "markdwon for empty repository" do + before do + @project = empty_project + @repository = empty_project.repository + end + + it "should not touch relative urls" do + actual = "[GitLab API doc][GitLab readme]\n [GitLab readme]: doc/api/README.md\n" + expected = "<p><a href=\"doc/api/README.md\">GitLab API doc</a></p>\n" + markdown(actual).should match(expected) + end + end + describe "#render_wiki_content" do before do @wiki = double('WikiPage') diff --git a/spec/helpers/labels_helper_spec.rb b/spec/helpers/labels_helper_spec.rb index f66a5cc9f5c..1e64a201942 100644 --- a/spec/helpers/labels_helper_spec.rb +++ b/spec/helpers/labels_helper_spec.rb @@ -1,13 +1,6 @@ require 'spec_helper' describe LabelsHelper do - describe '#label_css_class' do - it 'returns label-danger when given Bug as param' do - expect(label_css_class('bug')).to eq('label-danger') - end - - it 'returns label-danger when given Bug as param' do - expect(label_css_class('Bug')).to eq('label-danger') - end - end + it { expect(text_color_for_bg('#EEEEEE')).to eq('#333') } + it { expect(text_color_for_bg('#222E2E')).to eq('#FFF') } end diff --git a/spec/helpers/tree_helper_spec.rb b/spec/helpers/tree_helper_spec.rb index d450b687caf..872dc2ebf31 100644 --- a/spec/helpers/tree_helper_spec.rb +++ b/spec/helpers/tree_helper_spec.rb @@ -2,7 +2,8 @@ require 'spec_helper' describe TreeHelper do describe '#markup?' do - %w(textile rdoc org creole mediawiki rst asciidoc pod).each do |type| + %w(textile rdoc org creole wiki mediawiki + rst adoc asciidoc asc).each do |type| it "returns true for #{type} files" do markup?("README.#{type}").should be_true end diff --git a/spec/javascripts/stat_graph_spec.js b/spec/javascripts/stat_graph_spec.js index b8881769ac1..b589af34610 100644 --- a/spec/javascripts/stat_graph_spec.js +++ b/spec/javascripts/stat_graph_spec.js @@ -14,4 +14,4 @@ describe("StatGraph", function () { }) }) -});
\ No newline at end of file +}); diff --git a/spec/lib/gitlab/regex_spec.rb b/spec/lib/gitlab/regex_spec.rb new file mode 100644 index 00000000000..a3aae7771bd --- /dev/null +++ b/spec/lib/gitlab/regex_spec.rb @@ -0,0 +1,21 @@ +require 'spec_helper' + +describe Gitlab::Regex do + describe 'path regex' do + it { 'gitlab-ce'.should match(Gitlab::Regex.path_regex) } + it { 'gitlab_git'.should match(Gitlab::Regex.path_regex) } + it { '_underscore.js'.should match(Gitlab::Regex.path_regex) } + it { '100px.com'.should match(Gitlab::Regex.path_regex) } + it { '?gitlab'.should_not match(Gitlab::Regex.path_regex) } + it { 'git lab'.should_not match(Gitlab::Regex.path_regex) } + it { 'gitlab.git'.should_not match(Gitlab::Regex.path_regex) } + end + + describe 'project name regex' do + it { 'gitlab-ce'.should match(Gitlab::Regex.project_name_regex) } + it { 'GitLab CE'.should match(Gitlab::Regex.project_name_regex) } + it { '100 lines'.should match(Gitlab::Regex.project_name_regex) } + it { 'gitlab.git'.should match(Gitlab::Regex.project_name_regex) } + it { '?gitlab'.should_not match(Gitlab::Regex.project_name_regex) } + end +end diff --git a/spec/lib/gitlab/satellite/action_spec.rb b/spec/lib/gitlab/satellite/action_spec.rb index d65e7c42b7e..0622caf1e3b 100644 --- a/spec/lib/gitlab/satellite/action_spec.rb +++ b/spec/lib/gitlab/satellite/action_spec.rb @@ -5,6 +5,9 @@ describe 'Gitlab::Satellite::Action' do let(:user) { create(:user) } describe '#prepare_satellite!' do + it 'should be able to fetch timeout from conf' do + Gitlab::Satellite::Action::DEFAULT_OPTIONS[:git_timeout].should == 30.seconds + end it 'create a repository with a parking branch and one remote: origin' do repo = project.satellite.repo @@ -113,4 +116,3 @@ describe 'Gitlab::Satellite::Action' do end end - diff --git a/spec/mailers/notify_spec.rb b/spec/mailers/notify_spec.rb index 224b613b477..314b2691c40 100644 --- a/spec/mailers/notify_spec.rb +++ b/spec/mailers/notify_spec.rb @@ -22,11 +22,28 @@ describe Notify do end end + shared_examples 'an email starting a new thread' do |message_id_prefix| + it 'has a discussion identifier' do + should have_header 'Message-ID', /<#{message_id_prefix}(.*)@#{Gitlab.config.gitlab.host}>/ + end + end + + shared_examples 'an answer to an existing thread' do |thread_id_prefix| + it 'has a subject that begins with Re: ' do + should have_subject /^Re: / + end + + it 'has headers that reference an existing thread' do + should have_header 'References', /<#{thread_id_prefix}(.*)@#{Gitlab.config.gitlab.host}>/ + should have_header 'In-Reply-To', /<#{thread_id_prefix}(.*)@#{Gitlab.config.gitlab.host}>/ + end + end + describe 'for new users, the email' do let(:example_site_path) { root_path } let(:new_user) { create(:user, email: 'newguy@example.com', created_by_id: 1) } - subject { Notify.new_user_email(new_user.id, new_user.password) } + subject { Notify.new_user_email(new_user.id, new_user.password, 'kETLwRaayvigPq_x3SNM') } it_behaves_like 'an email sent from GitLab' @@ -42,8 +59,12 @@ describe Notify do should have_body_text /#{new_user.email}/ end - it 'contains the new user\'s password' do - should have_body_text /password/ + it 'contains the password text' do + should have_body_text /Click here to set your password/ + end + + it 'includes a link for user to set password' do + should have_body_text 'http://localhost/users/password/edit?reset_password_token=kETLwRaayvigPq_x3SNM' end it 'includes a link to the site' do @@ -153,6 +174,7 @@ describe Notify do subject { Notify.new_issue_email(issue.assignee_id, issue.id) } it_behaves_like 'an assignee email' + it_behaves_like 'an email starting a new thread', 'issue' it 'has the correct subject' do should have_subject /#{project.name} \| #{issue.title} \(##{issue.iid}\)/ @@ -161,10 +183,6 @@ describe Notify do it 'contains a link to the new issue' do should have_body_text /#{project_issue_path project, issue}/ end - - it 'has the correct message-id set' do - should have_header 'Message-ID', "<issue_#{issue.id}@#{Gitlab.config.gitlab.host}>" - end end describe 'that are new with a description' do @@ -179,6 +197,7 @@ describe Notify do subject { Notify.reassigned_issue_email(recipient.id, issue.id, previous_assignee.id, current_user) } it_behaves_like 'a multiple recipients email' + it_behaves_like 'an answer to an existing thread', 'issue' it 'is sent as the author' do sender = subject.header[:from].addrs[0] @@ -201,16 +220,14 @@ describe Notify do it 'contains a link to the issue' do should have_body_text /#{project_issue_path project, issue}/ end - - it 'has the correct reference set' do - should have_header 'References', "<issue_#{issue.id}@#{Gitlab.config.gitlab.host}>" - end end describe 'status changed' do let(:status) { 'closed' } subject { Notify.issue_status_changed_email(recipient.id, issue.id, status, current_user) } + it_behaves_like 'an answer to an existing thread', 'issue' + it 'is sent as the author' do sender = subject.header[:from].addrs[0] sender.display_name.should eq(current_user.name) @@ -232,10 +249,6 @@ describe Notify do it 'contains a link to the issue' do should have_body_text /#{project_issue_path project, issue}/ end - - it 'has the correct reference set' do - should have_header 'References', "<issue_#{issue.id}@#{Gitlab.config.gitlab.host}>" - end end end @@ -249,6 +262,7 @@ describe Notify do subject { Notify.new_merge_request_email(merge_request.assignee_id, merge_request.id) } it_behaves_like 'an assignee email' + it_behaves_like 'an email starting a new thread', 'merge_request' it 'has the correct subject' do should have_subject /#{merge_request.title} \(##{merge_request.iid}\)/ @@ -283,6 +297,7 @@ describe Notify do subject { Notify.reassigned_merge_request_email(recipient.id, merge_request.id, previous_assignee.id, current_user.id) } it_behaves_like 'a multiple recipients email' + it_behaves_like 'an answer to an existing thread', 'merge_request' it 'is sent as the author' do sender = subject.header[:from].addrs[0] @@ -311,6 +326,7 @@ describe Notify do subject { Notify.merged_merge_request_email(recipient.id, merge_request.id, merge_author.id) } it_behaves_like 'a multiple recipients email' + it_behaves_like 'an answer to an existing thread', 'merge_request' it 'is sent as the merge author' do sender = subject.header[:from].addrs[0] @@ -329,10 +345,6 @@ describe Notify do it 'contains a link to the merge request' do should have_body_text /#{project_merge_request_path project, merge_request}/ end - - it 'has the correct reference set' do - should have_header 'References', "<merge_request_#{merge_request.id}@#{Gitlab.config.gitlab.host}>" - end end end end @@ -410,6 +422,7 @@ describe Notify do subject { Notify.note_commit_email(recipient.id, note.id) } it_behaves_like 'a note email' + it_behaves_like 'an answer to an existing thread', 'commits' it 'has the correct subject' do should have_subject /#{commit.title} \(#{commit.short_id}\)/ @@ -428,6 +441,7 @@ describe Notify do subject { Notify.note_merge_request_email(recipient.id, note.id) } it_behaves_like 'a note email' + it_behaves_like 'an answer to an existing thread', 'merge_request' it 'has the correct subject' do should have_subject /#{merge_request.title} \(##{merge_request.iid}\)/ @@ -446,6 +460,7 @@ describe Notify do subject { Notify.note_issue_email(recipient.id, note.id) } it_behaves_like 'a note email' + it_behaves_like 'an answer to an existing thread', 'issue' it 'has the correct subject' do should have_subject /#{issue.title} \(##{issue.iid}\)/ diff --git a/spec/models/gitlab_ci_service_spec.rb b/spec/models/gitlab_ci_service_spec.rb index a0708f14236..439a30869bb 100644 --- a/spec/models/gitlab_ci_service_spec.rb +++ b/spec/models/gitlab_ci_service_spec.rb @@ -26,7 +26,6 @@ describe GitlabCiService do end describe "Mass assignment" do - it { should_not allow_mass_assignment_of(:project_id) } end describe 'commits methods' do diff --git a/spec/models/issue_spec.rb b/spec/models/issue_spec.rb index d53c4037c35..8b299cea67c 100644 --- a/spec/models/issue_spec.rb +++ b/spec/models/issue_spec.rb @@ -25,8 +25,6 @@ describe Issue do end describe "Mass assignment" do - it { should_not allow_mass_assignment_of(:author_id) } - it { should_not allow_mass_assignment_of(:project_id) } end describe 'modules' do diff --git a/spec/models/key_spec.rb b/spec/models/key_spec.rb index 474067fe38a..95c0aed0ffe 100644 --- a/spec/models/key_spec.rb +++ b/spec/models/key_spec.rb @@ -20,8 +20,6 @@ describe Key do end describe "Mass assignment" do - it { should_not allow_mass_assignment_of(:project_id) } - it { should_not allow_mass_assignment_of(:user_id) } end describe "Validation" do diff --git a/spec/models/label_link_spec.rb b/spec/models/label_link_spec.rb new file mode 100644 index 00000000000..078e61a7d62 --- /dev/null +++ b/spec/models/label_link_spec.rb @@ -0,0 +1,9 @@ +require 'spec_helper' + +describe LabelLink do + let(:label) { create(:label_link) } + it { label.should be_valid } + + it { should belong_to(:label) } + it { should belong_to(:target) } +end diff --git a/spec/models/label_spec.rb b/spec/models/label_spec.rb new file mode 100644 index 00000000000..5098af84cc3 --- /dev/null +++ b/spec/models/label_spec.rb @@ -0,0 +1,8 @@ +require 'spec_helper' + +describe Label do + let(:label) { create(:label) } + it { label.should be_valid } + + it { should belong_to(:project) } +end diff --git a/spec/models/merge_request_spec.rb b/spec/models/merge_request_spec.rb index 1148df87ab7..ec6d29de82b 100644 --- a/spec/models/merge_request_spec.rb +++ b/spec/models/merge_request_spec.rb @@ -28,8 +28,6 @@ describe MergeRequest do end describe "Mass assignment" do - it { should_not allow_mass_assignment_of(:author_id) } - it { should_not allow_mass_assignment_of(:project_id) } end describe "Respond to" do diff --git a/spec/models/milestone_spec.rb b/spec/models/milestone_spec.rb index 8309ad3a724..a3071c3251a 100644 --- a/spec/models/milestone_spec.rb +++ b/spec/models/milestone_spec.rb @@ -22,7 +22,6 @@ describe Milestone do end describe "Mass assignment" do - it { should_not allow_mass_assignment_of(:project_id) } end describe "Validation" do diff --git a/spec/models/namespace_spec.rb b/spec/models/namespace_spec.rb index d2bf96979f9..3562ebed1ff 100644 --- a/spec/models/namespace_spec.rb +++ b/spec/models/namespace_spec.rb @@ -26,8 +26,6 @@ describe Namespace do it { should validate_presence_of :owner } describe "Mass assignment" do - it { should allow_mass_assignment_of(:name) } - it { should allow_mass_assignment_of(:path) } end describe "Respond to" do diff --git a/spec/models/note_spec.rb b/spec/models/note_spec.rb index 43779e6bbfc..d06dee6ce92 100644 --- a/spec/models/note_spec.rb +++ b/spec/models/note_spec.rb @@ -27,8 +27,6 @@ describe Note do end describe "Mass assignment" do - it { should_not allow_mass_assignment_of(:author) } - it { should_not allow_mass_assignment_of(:author_id) } end describe "Validation" do diff --git a/spec/models/project_snippet_spec.rb b/spec/models/project_snippet_spec.rb index 42147179387..e4df934460b 100644 --- a/spec/models/project_snippet_spec.rb +++ b/spec/models/project_snippet_spec.rb @@ -23,7 +23,6 @@ describe ProjectSnippet do end describe "Mass assignment" do - it { should_not allow_mass_assignment_of(:project_id) } end describe "Validation" do diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index 93eae5a9ebd..bc537b7312b 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -48,8 +48,6 @@ describe Project do end describe "Mass assignment" do - it { should_not allow_mass_assignment_of(:namespace_id) } - it { should_not allow_mass_assignment_of(:creator_id) } end describe "Validation" do @@ -242,4 +240,73 @@ describe Project do it { project.open_branches.map(&:name).should include('bootstrap') } it { project.open_branches.map(&:name).should_not include('master') } end + + describe '#star_count' do + it 'counts stars from multiple users' do + user1 = create :user + user2 = create :user + project = create :project, :public + + expect(project.star_count).to eq(0) + + user1.toggle_star(project) + expect(project.reload.star_count).to eq(1) + + user2.toggle_star(project) + project.reload + expect(project.reload.star_count).to eq(2) + + user1.toggle_star(project) + project.reload + expect(project.reload.star_count).to eq(1) + + user2.toggle_star(project) + project.reload + expect(project.reload.star_count).to eq(0) + end + + it 'counts stars on the right project' do + user = create :user + project1 = create :project, :public + project2 = create :project, :public + + expect(project1.star_count).to eq(0) + expect(project2.star_count).to eq(0) + + user.toggle_star(project1) + project1.reload + project2.reload + expect(project1.star_count).to eq(1) + expect(project2.star_count).to eq(0) + + user.toggle_star(project1) + project1.reload + project2.reload + expect(project1.star_count).to eq(0) + expect(project2.star_count).to eq(0) + + user.toggle_star(project2) + project1.reload + project2.reload + expect(project1.star_count).to eq(0) + expect(project2.star_count).to eq(1) + + user.toggle_star(project2) + project1.reload + project2.reload + expect(project1.star_count).to eq(0) + expect(project2.star_count).to eq(0) + end + + it 'is decremented when an upvoter account is deleted' do + user = create :user + project = create :project, :public + user.toggle_star(project) + project.reload + expect(project.star_count).to eq(1) + user.destroy + project.reload + expect(project.star_count).to eq(0) + end + end end diff --git a/spec/models/project_wiki_spec.rb b/spec/models/project_wiki_spec.rb index 32a82470e4f..f06a5cd4ecc 100644 --- a/spec/models/project_wiki_spec.rb +++ b/spec/models/project_wiki_spec.rb @@ -149,6 +149,40 @@ describe ProjectWiki do end end + describe '#find_file' do + before do + file = Gollum::File.new(subject.wiki) + Gollum::Wiki.any_instance. + stub(:file).with('image.jpg', 'master', true). + and_return(file) + Gollum::File.any_instance. + stub(:mime_type). + and_return('image/jpeg') + Gollum::Wiki.any_instance. + stub(:file).with('non-existant', 'master', true). + and_return(nil) + end + + after do + Gollum::Wiki.any_instance.unstub(:file) + Gollum::File.any_instance.unstub(:mime_type) + end + + it 'returns the latest version of the file if it exists' do + file = subject.find_file('image.jpg') + file.mime_type.should == 'image/jpeg' + end + + it 'returns nil if the page does not exist' do + subject.find_file('non-existant').should == nil + end + + it 'returns a Gollum::File instance' do + file = subject.find_file('image.jpg') + file.should be_a Gollum::File + end + end + describe "#create_page" do after do destroy_page(subject.pages.first.page) diff --git a/spec/models/protected_branch_spec.rb b/spec/models/protected_branch_spec.rb index 35b929c2f3e..af48c2c6d9e 100644 --- a/spec/models/protected_branch_spec.rb +++ b/spec/models/protected_branch_spec.rb @@ -17,7 +17,6 @@ describe ProtectedBranch do end describe "Mass assignment" do - it { should_not allow_mass_assignment_of(:project_id) } end describe 'Validation' do diff --git a/spec/models/service_spec.rb b/spec/models/service_spec.rb index a4bed81c0f6..adeeac115c1 100644 --- a/spec/models/service_spec.rb +++ b/spec/models/service_spec.rb @@ -27,7 +27,6 @@ describe Service do end describe "Mass assignment" do - it { should_not allow_mass_assignment_of(:project_id) } end describe "Test Button" do diff --git a/spec/models/snippet_spec.rb b/spec/models/snippet_spec.rb index a77c594aaf1..d179e9516e2 100644 --- a/spec/models/snippet_spec.rb +++ b/spec/models/snippet_spec.rb @@ -24,7 +24,6 @@ describe Snippet do end describe "Mass assignment" do - it { should_not allow_mass_assignment_of(:author_id) } end describe "Validation" do diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 0a665b7defb..ef6b8a94502 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -65,8 +65,6 @@ describe User do end describe "Mass assignment" do - it { should_not allow_mass_assignment_of(:projects_limit) } - it { should allow_mass_assignment_of(:projects_limit).as(:admin) } end describe 'validations' do @@ -243,59 +241,23 @@ describe User do it { user.first_name.should == 'John' } end - describe 'without defaults' do + describe 'with defaults' do let(:user) { User.new } - it "should not apply defaults to user" do - user.projects_limit.should == 10 - user.can_create_group.should be_true - user.theme_id.should == Gitlab::Theme::BASIC - end - end - context 'as admin' do - describe 'with defaults' do - let(:user) { User.build_user({}, as: :admin) } - - it "should apply defaults to user" do - user.projects_limit.should == Gitlab.config.gitlab.default_projects_limit - user.can_create_group.should == Gitlab.config.gitlab.default_can_create_group - user.theme_id.should == Gitlab.config.gitlab.default_theme - end - end - - describe 'with default overrides' do - let(:user) { User.build_user({projects_limit: 123, can_create_group: true, can_create_team: true, theme_id: Gitlab::Theme::BASIC}, as: :admin) } - - it "should apply defaults to user" do - Gitlab.config.gitlab.default_projects_limit.should_not == 123 - Gitlab.config.gitlab.default_can_create_group.should_not be_true - Gitlab.config.gitlab.default_theme.should_not == Gitlab::Theme::BASIC - user.projects_limit.should == 123 - user.can_create_group.should be_true - user.theme_id.should == Gitlab::Theme::BASIC - end + it "should apply defaults to user" do + user.projects_limit.should == Gitlab.config.gitlab.default_projects_limit + user.can_create_group.should == Gitlab.config.gitlab.default_can_create_group + user.theme_id.should == Gitlab.config.gitlab.default_theme end end - context 'as user' do - describe 'with defaults' do - let(:user) { User.build_user } - - it "should apply defaults to user" do - user.projects_limit.should == Gitlab.config.gitlab.default_projects_limit - user.can_create_group.should == Gitlab.config.gitlab.default_can_create_group - user.theme_id.should == Gitlab.config.gitlab.default_theme - end - end - - describe 'with default overrides' do - let(:user) { User.build_user(projects_limit: 123, can_create_group: true, theme_id: Gitlab::Theme::BASIC) } + describe 'with default overrides' do + let(:user) { User.new(projects_limit: 123, can_create_group: false, can_create_team: true, theme_id: Gitlab::Theme::BASIC) } - it "should apply defaults to user" do - user.projects_limit.should == Gitlab.config.gitlab.default_projects_limit - user.can_create_group.should == Gitlab.config.gitlab.default_can_create_group - user.theme_id.should == Gitlab.config.gitlab.default_theme - end + it "should apply defaults to user" do + user.projects_limit.should == 123 + user.can_create_group.should be_false + user.theme_id.should == Gitlab::Theme::BASIC end end end @@ -393,4 +355,44 @@ describe User do expect(user.short_website_url).to eq 'test.com' end end + + describe "#starred?" do + it "determines if user starred a project" do + user = create :user + project1 = create :project, :public + project2 = create :project, :public + + expect(user.starred?(project1)).to be_false + expect(user.starred?(project2)).to be_false + + star1 = UsersStarProject.create!(project: project1, user: user) + expect(user.starred?(project1)).to be_true + expect(user.starred?(project2)).to be_false + + star2 = UsersStarProject.create!(project: project2, user: user) + expect(user.starred?(project1)).to be_true + expect(user.starred?(project2)).to be_true + + star1.destroy + expect(user.starred?(project1)).to be_false + expect(user.starred?(project2)).to be_true + + star2.destroy + expect(user.starred?(project1)).to be_false + expect(user.starred?(project2)).to be_false + end + end + + describe "#toggle_star" do + it "toggles stars" do + user = create :user + project = create :project, :public + + expect(user.starred?(project)).to be_false + user.toggle_star(project) + expect(user.starred?(project)).to be_true + user.toggle_star(project) + expect(user.starred?(project)).to be_false + end + end end diff --git a/spec/models/users_group_spec.rb b/spec/models/users_group_spec.rb index 05dd97d92d4..0b6f7a08198 100644 --- a/spec/models/users_group_spec.rb +++ b/spec/models/users_group_spec.rb @@ -20,7 +20,6 @@ describe UsersGroup do end describe "Mass assignment" do - it { should_not allow_mass_assignment_of(:group_id) } end describe "Validation" do diff --git a/spec/models/users_project_spec.rb b/spec/models/users_project_spec.rb index aa4b8cb449b..3f38164e964 100644 --- a/spec/models/users_project_spec.rb +++ b/spec/models/users_project_spec.rb @@ -20,7 +20,6 @@ describe UsersProject do end describe "Mass assignment" do - it { should_not allow_mass_assignment_of(:project_id) } end describe "Validation" do diff --git a/spec/models/web_hook_spec.rb b/spec/models/web_hook_spec.rb index 20ee1416125..e9c04ee89cb 100644 --- a/spec/models/web_hook_spec.rb +++ b/spec/models/web_hook_spec.rb @@ -23,7 +23,6 @@ describe ProjectHook do end describe "Mass assignment" do - it { should_not allow_mass_assignment_of(:project_id) } end describe "Validations" do diff --git a/spec/requests/api/labels_spec.rb b/spec/requests/api/labels_spec.rb new file mode 100644 index 00000000000..d40c2c21cec --- /dev/null +++ b/spec/requests/api/labels_spec.rb @@ -0,0 +1,24 @@ +require 'spec_helper' + +describe API::API, api: true do + include ApiHelpers + + let(:user) { create(:user) } + let(:project) { create(:project, creator_id: user.id, namespace: user.namespace) } + let!(:label1) { create(:label, title: 'label1', project: project) } + + before do + project.team << [user, :master] + end + + + describe 'GET /projects/:id/labels' do + it 'should return project labels' do + get api("/projects/#{project.id}/labels", user) + response.status.should == 200 + json_response.should be_an Array + json_response.size.should == 1 + json_response.first['name'].should == label1.name + end + end +end diff --git a/spec/requests/api/projects_spec.rb b/spec/requests/api/projects_spec.rb index 41841e855fd..12a3a07ff76 100644 --- a/spec/requests/api/projects_spec.rb +++ b/spec/requests/api/projects_spec.rb @@ -10,13 +10,6 @@ describe API::API, api: true do let(:snippet) { create(:project_snippet, author: user, project: project, title: 'example') } let(:users_project) { create(:users_project, user: user, project: project, project_access: UsersProject::MASTER) } let(:users_project2) { create(:users_project, user: user3, project: project, project_access: UsersProject::DEVELOPER) } - let(:issue_with_labels) { create(:issue, author: user, assignee: user, project: project, :label_list => "label1, label2") } - let(:merge_request_with_labels) do - create(:merge_request, :simple, author: user, assignee: user, - source_project: project, target_project: project, title: 'Test', - label_list: 'label3, label4') - end - describe "GET /projects" do before { project } @@ -634,46 +627,4 @@ describe API::API, api: true do end end end - - describe 'GET /projects/:id/labels' do - context 'with an issue' do - before { issue_with_labels } - - it 'should return project labels' do - get api("/projects/#{project.id}/labels", user) - response.status.should == 200 - json_response.should be_an Array - json_response.first['name'].should == issue_with_labels.labels.first.name - json_response.last['name'].should == issue_with_labels.labels.last.name - end - end - - context 'with a merge request' do - before { merge_request_with_labels } - - it 'should return project labels' do - get api("/projects/#{project.id}/labels", user) - response.status.should == 200 - json_response.should be_an Array - json_response.first['name'].should == merge_request_with_labels.labels.first.name - json_response.last['name'].should == merge_request_with_labels.labels.last.name - end - end - - context 'with an issue and a merge request' do - before do - issue_with_labels - merge_request_with_labels - end - - it 'should return project labels from both' do - get api("/projects/#{project.id}/labels", user) - response.status.should == 200 - json_response.should be_an Array - all_labels = issue_with_labels.labels.map(&:name).to_a - .concat(merge_request_with_labels.labels.map(&:name).to_a) - json_response.map { |e| e['name'] }.should =~ all_labels - end - end - end end diff --git a/spec/requests/api/repositories_spec.rb b/spec/requests/api/repositories_spec.rb index 94850d0f1ae..a02231a5bba 100644 --- a/spec/requests/api/repositories_spec.rb +++ b/spec/requests/api/repositories_spec.rb @@ -128,7 +128,7 @@ describe API::API, api: true do end end - describe 'GET /GET /projects/:id/repository/compare' do + describe 'GET /projects/:id/repository/compare' do it "should compare branches" do get api("/projects/#{project.id}/repository/compare", user), from: 'master', to: 'simple_merge_request' response.status.should == 200 @@ -166,4 +166,18 @@ describe API::API, api: true do json_response['compare_same_ref'].should be_true end end + + describe 'GET /projects/:id/repository/contributors' do + it 'should return valid data' do + get api("/projects/#{project.id}/repository/contributors", user) + response.status.should == 200 + json_response.should be_an Array + contributor = json_response.first + contributor['email'].should == 'dmitriy.zaporozhets@gmail.com' + contributor['name'].should == 'Dmitriy Zaporozhets' + contributor['commits'].should == 185 + contributor['additions'].should == 66072 + contributor['deletions'].should == 63013 + end + end end diff --git a/spec/requests/api/users_spec.rb b/spec/requests/api/users_spec.rb index c3eec56d133..8bbe9b5b736 100644 --- a/spec/requests/api/users_spec.rb +++ b/spec/requests/api/users_spec.rb @@ -97,19 +97,6 @@ describe API::API, api: true do response.status.should == 201 end - it "creating a user should respect default project limit" do - limit = 123456 - Gitlab.config.gitlab.stub(:default_projects_limit).and_return(limit) - attr = attributes_for(:user ) - expect { - post api("/users", admin), attr - }.to change { User.count }.by(1) - user = User.find_by(username: attr[:username]) - user.projects_limit.should == limit - user.theme_id.should == Gitlab::Theme::MARS - Gitlab.config.gitlab.unstub(:default_projects_limit) - end - it "should not create user with invalid email" do post api("/users", admin), { email: "invalid email", password: 'password' } response.status.should == 400 diff --git a/spec/services/milestones/group_service_spec.rb b/spec/services/milestones/group_service_spec.rb new file mode 100644 index 00000000000..74eb0f99e0f --- /dev/null +++ b/spec/services/milestones/group_service_spec.rb @@ -0,0 +1,70 @@ +require 'spec_helper' + +describe Milestones::GroupService do + let(:user) { create(:user) } + let(:user2) { create(:user) } + let(:group) { create(:group) } + let(:project1) { create(:project, group: group) } + let(:project2) { create(:project, path: 'gitlab-ci', group: group) } + let(:project3) { create(:project, path: 'cookbook-gitlab', group: group) } + let(:milestone1_project1) { create(:milestone, title: "Milestone v1.2", project: project1) } + let(:milestone1_project2) { create(:milestone, title: "Milestone v1.2", project: project2) } + let(:milestone1_project3) { create(:milestone, title: "Milestone v1.2", project: project3) } + let(:milestone2_project1) { create(:milestone, title: "VD-123", project: project1) } + let(:milestone2_project2) { create(:milestone, title: "VD-123", project: project2) } + let(:milestone2_project3) { create(:milestone, title: "VD-123", project: project3) } + + describe 'execute' do + context 'with valid projects' do + before do + milestones = + [ + milestone1_project1, + milestone1_project2, + milestone1_project3, + milestone2_project1, + milestone2_project2, + milestone2_project3 + ] + @group_milestones = Milestones::GroupService.new(milestones).execute + end + + it 'should have all project milestones' do + expect(@group_milestones.count).to eq(2) + end + + it 'should have all project milestones titles' do + expect(@group_milestones.map { |group_milestone| group_milestone.title }).to match_array(['Milestone v1.2', 'VD-123']) + end + + it 'should have all project milestones' do + expect(@group_milestones.map { |group_milestone| group_milestone.milestones.count }.sum).to eq(6) + end + end + end + + describe 'milestone' do + context 'with valid title' do + before do + milestones = + [ + milestone1_project1, + milestone1_project2, + milestone1_project3, + milestone2_project1, + milestone2_project2, + milestone2_project3 + ] + @group_milestones = Milestones::GroupService.new(milestones).milestone('Milestone v1.2') + end + + it 'should have exactly one group milestone' do + expect(@group_milestones.title).to eq('Milestone v1.2') + end + + it 'should have all project milestones with the same title' do + expect(@group_milestones.milestones.count).to eq(3) + end + end + end +end diff --git a/spec/services/notes/create_service_spec.rb b/spec/services/notes/create_service_spec.rb index 106c14bc015..f59786efcf9 100644 --- a/spec/services/notes/create_service_spec.rb +++ b/spec/services/notes/create_service_spec.rb @@ -11,7 +11,6 @@ describe Notes::CreateService do project.team << [user, :master] opts = { note: 'Awesome comment', - description: 'please fix', noteable_type: 'Issue', noteable_id: issue.id } diff --git a/spec/services/notification_service_spec.rb b/spec/services/notification_service_spec.rb index f82a14d482c..df355f6f07a 100644 --- a/spec/services/notification_service_spec.rb +++ b/spec/services/notification_service_spec.rb @@ -215,7 +215,7 @@ describe NotificationService do end def should_email(user_id) - Notify.should_receive(:reassigned_issue_email).with(user_id, issue.id, issue.assignee_id, @u_disabled.id) + Notify.should_receive(:reassigned_issue_email).with(user_id, issue.id, nil, @u_disabled.id) end def should_not_email(user_id) @@ -242,6 +242,26 @@ describe NotificationService do Notify.should_not_receive(:closed_issue_email).with(user_id, issue.id, @u_disabled.id) end end + + describe :reopen_issue do + it 'should send email to issue assignee and issue author' do + should_email(issue.assignee_id) + should_email(issue.author_id) + should_email(@u_watcher.id) + should_not_email(@u_participating.id) + should_not_email(@u_disabled.id) + + notification.reopen_issue(issue, @u_disabled) + end + + def should_email(user_id) + Notify.should_receive(:issue_status_changed_email).with(user_id, issue.id, 'reopened', @u_disabled.id) + end + + def should_not_email(user_id) + Notify.should_not_receive(:issue_status_changed_email).with(user_id, issue.id, 'reopened', @u_disabled.id) + end + end end describe 'Merge Requests' do @@ -279,7 +299,7 @@ describe NotificationService do end def should_email(user_id) - Notify.should_receive(:reassigned_merge_request_email).with(user_id, merge_request.id, merge_request.assignee_id, merge_request.author_id) + Notify.should_receive(:reassigned_merge_request_email).with(user_id, merge_request.id, nil, merge_request.author_id) end def should_not_email(user_id) @@ -322,6 +342,24 @@ describe NotificationService do Notify.should_not_receive(:merged_merge_request_email).with(user_id, merge_request.id, @u_disabled.id) end end + + describe :reopen_merge_request do + it do + should_email(merge_request.assignee_id) + should_email(@u_watcher.id) + should_not_email(@u_participating.id) + should_not_email(@u_disabled.id) + notification.reopen_mr(merge_request, @u_disabled) + end + + def should_email(user_id) + Notify.should_receive(:merge_request_status_email).with(user_id, merge_request.id, 'reopened', @u_disabled.id) + end + + def should_not_email(user_id) + Notify.should_not_receive(:merge_request_status_email).with(user_id, merge_request.id, 'reopened', @u_disabled.id) + end + end end describe 'Projects' do diff --git a/spec/services/projects/create_service_spec.rb b/spec/services/projects/create_service_spec.rb index 74c23418a28..9c97dad2ff0 100644 --- a/spec/services/projects/create_service_spec.rb +++ b/spec/services/projects/create_service_spec.rb @@ -55,95 +55,6 @@ describe Projects::CreateService do it { File.exists?(@path).should be_false } end end - - context 'respect configured visibility setting' do - before(:each) do - @settings = double("settings") - @settings.stub(:issues) { true } - @settings.stub(:merge_requests) { true } - @settings.stub(:wiki) { true } - @settings.stub(:snippets) { true } - Gitlab.config.gitlab.stub(restricted_visibility_levels: []) - Gitlab.config.gitlab.stub(:default_projects_features).and_return(@settings) - end - - context 'should be public when setting is public' do - before do - @settings.stub(:visibility_level) { Gitlab::VisibilityLevel::PUBLIC } - @project = create_project(@user, @opts) - end - - it { @project.public?.should be_true } - end - - context 'should be private when setting is private' do - before do - @settings.stub(:visibility_level) { Gitlab::VisibilityLevel::PRIVATE } - @project = create_project(@user, @opts) - end - - it { @project.private?.should be_true } - end - - context 'should be internal when setting is internal' do - before do - @settings.stub(:visibility_level) { Gitlab::VisibilityLevel::INTERNAL } - @project = create_project(@user, @opts) - end - - it { @project.internal?.should be_true } - end - end - - context 'respect configured visibility restrictions setting' do - before(:each) do - @settings = double("settings") - @settings.stub(:issues) { true } - @settings.stub(:merge_requests) { true } - @settings.stub(:wiki) { true } - @settings.stub(:snippets) { true } - @settings.stub(:visibility_level) { Gitlab::VisibilityLevel::PRIVATE } - @restrictions = [ Gitlab::VisibilityLevel::PUBLIC ] - Gitlab.config.gitlab.stub(restricted_visibility_levels: @restrictions) - Gitlab.config.gitlab.stub(:default_projects_features).and_return(@settings) - end - - context 'should be private when option is public' do - before do - @opts.merge!(visibility_level: Gitlab::VisibilityLevel::PUBLIC) - @project = create_project(@user, @opts) - end - - it { @project.private?.should be_true } - end - - context 'should be public when option is public for admin' do - before do - @opts.merge!(visibility_level: Gitlab::VisibilityLevel::PUBLIC) - @project = create_project(@admin, @opts) - end - - it { @project.public?.should be_true } - end - - context 'should be private when option is private' do - before do - @opts.merge!(visibility_level: Gitlab::VisibilityLevel::PRIVATE) - @project = create_project(@user, @opts) - end - - it { @project.private?.should be_true } - end - - context 'should be internal when option is internal' do - before do - @opts.merge!(visibility_level: Gitlab::VisibilityLevel::INTERNAL) - @project = create_project(@user, @opts) - end - - it { @project.internal?.should be_true } - end - end end def create_project(user, opts) diff --git a/spec/services/projects/update_service_spec.rb b/spec/services/projects/update_service_spec.rb index bb0470e3771..62357787521 100644 --- a/spec/services/projects/update_service_spec.rb +++ b/spec/services/projects/update_service_spec.rb @@ -6,14 +6,14 @@ describe Projects::UpdateService do @user = create :user @admin = create :user, admin: true @project = create :project, creator_id: @user.id, namespace: @user.namespace - @opts = { project: {} } + @opts = {} end context 'should be private when updated to private' do before do @created_private = @project.private? - @opts[:project].merge!(visibility_level: Gitlab::VisibilityLevel::PRIVATE) + @opts.merge!(visibility_level: Gitlab::VisibilityLevel::PRIVATE) update_project(@project, @user, @opts) end @@ -25,7 +25,7 @@ describe Projects::UpdateService do before do @created_private = @project.private? - @opts[:project].merge!(visibility_level: Gitlab::VisibilityLevel::INTERNAL) + @opts.merge!(visibility_level: Gitlab::VisibilityLevel::INTERNAL) update_project(@project, @user, @opts) end @@ -37,7 +37,7 @@ describe Projects::UpdateService do before do @created_private = @project.private? - @opts[:project].merge!(visibility_level: Gitlab::VisibilityLevel::PUBLIC) + @opts.merge!(visibility_level: Gitlab::VisibilityLevel::PUBLIC) update_project(@project, @user, @opts) end @@ -56,7 +56,7 @@ describe Projects::UpdateService do before do @created_private = @project.private? - @opts[:project].merge!(visibility_level: Gitlab::VisibilityLevel::PRIVATE) + @opts.merge!(visibility_level: Gitlab::VisibilityLevel::PRIVATE) update_project(@project, @user, @opts) end @@ -68,7 +68,7 @@ describe Projects::UpdateService do before do @created_private = @project.private? - @opts[:project].merge!(visibility_level: Gitlab::VisibilityLevel::INTERNAL) + @opts.merge!(visibility_level: Gitlab::VisibilityLevel::INTERNAL) update_project(@project, @user, @opts) end @@ -80,7 +80,7 @@ describe Projects::UpdateService do before do @created_private = @project.private? - @opts[:project].merge!(visibility_level: Gitlab::VisibilityLevel::PUBLIC) + @opts.merge!(visibility_level: Gitlab::VisibilityLevel::PUBLIC) update_project(@project, @user, @opts) end @@ -92,7 +92,7 @@ describe Projects::UpdateService do before do @created_private = @project.private? - @opts[:project].merge!(visibility_level: Gitlab::VisibilityLevel::PUBLIC) + @opts.merge!(visibility_level: Gitlab::VisibilityLevel::PUBLIC) update_project(@project, @admin, @opts) end diff --git a/spec/support/login_helpers.rb b/spec/support/login_helpers.rb index 7713e9f17d7..238ac7c6611 100644 --- a/spec/support/login_helpers.rb +++ b/spec/support/login_helpers.rb @@ -19,7 +19,8 @@ module LoginHelpers Thread.current[:current_user] = user end + # Requires Javascript driver. def logout - click_link "Logout" rescue nil + page.find(:css, ".icon-signout").click end end diff --git a/spec/support/mentionable_shared_examples.rb b/spec/support/mentionable_shared_examples.rb index 3802e94ecf0..0d67e7ee4e6 100644 --- a/spec/support/mentionable_shared_examples.rb +++ b/spec/support/mentionable_shared_examples.rb @@ -11,7 +11,7 @@ def common_mentionable_setup let(:mentioned_issue) { create :issue, project: mproject } let(:other_issue) { create :issue, project: mproject } - let(:mentioned_mr) { create :merge_request, source_project: mproject, source_branch: 'different' } + let(:mentioned_mr) { create :merge_request, :simple, source_project: mproject } let(:mentioned_commit) { double('commit', sha: '1234567890abcdef').as_null_object } # Override to add known commits to the repository stub. @@ -29,11 +29,7 @@ def common_mentionable_setup # unrecognized commits. commitmap = { '123456' => mentioned_commit } extra_commits.each { |c| commitmap[c.sha[0..5]] = c } - - repo = double('repository') - repo.stub(:commit) { |sha| commitmap[sha] } - mproject.stub(repository: repo) - + mproject.repository.stub(:commit) { |sha| commitmap[sha] } set_mentionable_text.call(ref_string) end end diff --git a/spec/support/valid_commit_with_alt_email.rb b/spec/support/valid_commit_with_alt_email.rb index d6e364c41f1..75854c63a59 100644 --- a/spec/support/valid_commit_with_alt_email.rb +++ b/spec/support/valid_commit_with_alt_email.rb @@ -3,4 +3,4 @@ module ValidCommitWithAltEmail MESSAGE = "fixed notes logic" AUTHOR_FULL_NAME = "Dmitriy Zaporozhets" AUTHOR_EMAIL = "dzaporozhets@sphereconsultinginc.com" -end
\ No newline at end of file +end diff --git a/vendor/assets/javascripts/highlight.pack.js b/vendor/assets/javascripts/highlight.pack.js new file mode 100644 index 00000000000..17b457bf743 --- /dev/null +++ b/vendor/assets/javascripts/highlight.pack.js @@ -0,0 +1 @@ +var hljs=new function(){function j(v){return v.replace(/&/gm,"&").replace(/</gm,"<").replace(/>/gm,">")}function t(v){return v.nodeName.toLowerCase()}function h(w,x){var v=w&&w.exec(x);return v&&v.index==0}function r(w){var v=(w.className+" "+(w.parentNode?w.parentNode.className:"")).split(/\s+/);v=v.map(function(x){return x.replace(/^lang(uage)?-/,"")});return v.filter(function(x){return i(x)||x=="no-highlight"})[0]}function o(x,y){var v={};for(var w in x){v[w]=x[w]}if(y){for(var w in y){v[w]=y[w]}}return v}function u(x){var v=[];(function w(y,z){for(var A=y.firstChild;A;A=A.nextSibling){if(A.nodeType==3){z+=A.nodeValue.length}else{if(t(A)=="br"){z+=1}else{if(A.nodeType==1){v.push({event:"start",offset:z,node:A});z=w(A,z);v.push({event:"stop",offset:z,node:A})}}}}return z})(x,0);return v}function q(w,y,C){var x=0;var F="";var z=[];function B(){if(!w.length||!y.length){return w.length?w:y}if(w[0].offset!=y[0].offset){return(w[0].offset<y[0].offset)?w:y}return y[0].event=="start"?w:y}function A(H){function G(I){return" "+I.nodeName+'="'+j(I.value)+'"'}F+="<"+t(H)+Array.prototype.map.call(H.attributes,G).join("")+">"}function E(G){F+="</"+t(G)+">"}function v(G){(G.event=="start"?A:E)(G.node)}while(w.length||y.length){var D=B();F+=j(C.substr(x,D[0].offset-x));x=D[0].offset;if(D==w){z.reverse().forEach(E);do{v(D.splice(0,1)[0]);D=B()}while(D==w&&D.length&&D[0].offset==x);z.reverse().forEach(A)}else{if(D[0].event=="start"){z.push(D[0].node)}else{z.pop()}v(D.splice(0,1)[0])}}return F+j(C.substr(x))}function m(y){function v(z){return(z&&z.source)||z}function w(A,z){return RegExp(v(A),"m"+(y.cI?"i":"")+(z?"g":""))}function x(D,C){if(D.compiled){return}D.compiled=true;D.k=D.k||D.bK;if(D.k){var z={};var E=function(G,F){if(y.cI){F=F.toLowerCase()}F.split(" ").forEach(function(H){var I=H.split("|");z[I[0]]=[G,I[1]?Number(I[1]):1]})};if(typeof D.k=="string"){E("keyword",D.k)}else{Object.keys(D.k).forEach(function(F){E(F,D.k[F])})}D.k=z}D.lR=w(D.l||/\b[A-Za-z0-9_]+\b/,true);if(C){if(D.bK){D.b="\\b("+D.bK.split(" ").join("|")+")\\b"}if(!D.b){D.b=/\B|\b/}D.bR=w(D.b);if(!D.e&&!D.eW){D.e=/\B|\b/}if(D.e){D.eR=w(D.e)}D.tE=v(D.e)||"";if(D.eW&&C.tE){D.tE+=(D.e?"|":"")+C.tE}}if(D.i){D.iR=w(D.i)}if(D.r===undefined){D.r=1}if(!D.c){D.c=[]}var B=[];D.c.forEach(function(F){if(F.v){F.v.forEach(function(G){B.push(o(F,G))})}else{B.push(F=="self"?D:F)}});D.c=B;D.c.forEach(function(F){x(F,D)});if(D.starts){x(D.starts,C)}var A=D.c.map(function(F){return F.bK?"\\.?("+F.b+")\\.?":F.b}).concat([D.tE,D.i]).map(v).filter(Boolean);D.t=A.length?w(A.join("|"),true):{exec:function(F){return null}};D.continuation={}}x(y)}function c(S,L,J,R){function v(U,V){for(var T=0;T<V.c.length;T++){if(h(V.c[T].bR,U)){return V.c[T]}}}function z(U,T){if(h(U.eR,T)){return U}if(U.eW){return z(U.parent,T)}}function A(T,U){return !J&&h(U.iR,T)}function E(V,T){var U=M.cI?T[0].toLowerCase():T[0];return V.k.hasOwnProperty(U)&&V.k[U]}function w(Z,X,W,V){var T=V?"":b.classPrefix,U='<span class="'+T,Y=W?"":"</span>";U+=Z+'">';return U+X+Y}function N(){if(!I.k){return j(C)}var T="";var W=0;I.lR.lastIndex=0;var U=I.lR.exec(C);while(U){T+=j(C.substr(W,U.index-W));var V=E(I,U);if(V){H+=V[1];T+=w(V[0],j(U[0]))}else{T+=j(U[0])}W=I.lR.lastIndex;U=I.lR.exec(C)}return T+j(C.substr(W))}function F(){if(I.sL&&!f[I.sL]){return j(C)}var T=I.sL?c(I.sL,C,true,I.continuation.top):e(C);if(I.r>0){H+=T.r}if(I.subLanguageMode=="continuous"){I.continuation.top=T.top}return w(T.language,T.value,false,true)}function Q(){return I.sL!==undefined?F():N()}function P(V,U){var T=V.cN?w(V.cN,"",true):"";if(V.rB){D+=T;C=""}else{if(V.eB){D+=j(U)+T;C=""}else{D+=T;C=U}}I=Object.create(V,{parent:{value:I}})}function G(T,X){C+=T;if(X===undefined){D+=Q();return 0}var V=v(X,I);if(V){D+=Q();P(V,X);return V.rB?0:X.length}var W=z(I,X);if(W){var U=I;if(!(U.rE||U.eE)){C+=X}D+=Q();do{if(I.cN){D+="</span>"}H+=I.r;I=I.parent}while(I!=W.parent);if(U.eE){D+=j(X)}C="";if(W.starts){P(W.starts,"")}return U.rE?0:X.length}if(A(X,I)){throw new Error('Illegal lexeme "'+X+'" for mode "'+(I.cN||"<unnamed>")+'"')}C+=X;return X.length||1}var M=i(S);if(!M){throw new Error('Unknown language: "'+S+'"')}m(M);var I=R||M;var D="";for(var K=I;K!=M;K=K.parent){if(K.cN){D+=w(K.cN,D,true)}}var C="";var H=0;try{var B,y,x=0;while(true){I.t.lastIndex=x;B=I.t.exec(L);if(!B){break}y=G(L.substr(x,B.index-x),B[0]);x=B.index+y}G(L.substr(x));for(var K=I;K.parent;K=K.parent){if(K.cN){D+="</span>"}}return{r:H,value:D,language:S,top:I}}catch(O){if(O.message.indexOf("Illegal")!=-1){return{r:0,value:j(L)}}else{throw O}}}function e(y,x){x=x||b.languages||Object.keys(f);var v={r:0,value:j(y)};var w=v;x.forEach(function(z){if(!i(z)){return}var A=c(z,y,false);A.language=z;if(A.r>w.r){w=A}if(A.r>v.r){w=v;v=A}});if(w.language){v.second_best=w}return v}function g(v){if(b.tabReplace){v=v.replace(/^((<[^>]+>|\t)+)/gm,function(w,z,y,x){return z.replace(/\t/g,b.tabReplace)})}if(b.useBR){v=v.replace(/\n/g,"<br>")}return v}function p(z){var y=b.useBR?z.innerHTML.replace(/\n/g,"").replace(/<br>|<br [^>]*>/g,"\n").replace(/<[^>]*>/g,""):z.textContent;var A=r(z);if(A=="no-highlight"){return}var v=A?c(A,y,true):e(y);var w=u(z);if(w.length){var x=document.createElementNS("http://www.w3.org/1999/xhtml","pre");x.innerHTML=v.value;v.value=q(w,u(x),y)}v.value=g(v.value);z.innerHTML=v.value;z.className+=" hljs "+(!A&&v.language||"");z.result={language:v.language,re:v.r};if(v.second_best){z.second_best={language:v.second_best.language,re:v.second_best.r}}}var b={classPrefix:"hljs-",tabReplace:null,useBR:false,languages:undefined};function s(v){b=o(b,v)}function l(){if(l.called){return}l.called=true;var v=document.querySelectorAll("pre code");Array.prototype.forEach.call(v,p)}function a(){addEventListener("DOMContentLoaded",l,false);addEventListener("load",l,false)}var f={};var n={};function d(v,x){var w=f[v]=x(this);if(w.aliases){w.aliases.forEach(function(y){n[y]=v})}}function k(){return Object.keys(f)}function i(v){return f[v]||f[n[v]]}this.highlight=c;this.highlightAuto=e;this.fixMarkup=g;this.highlightBlock=p;this.configure=s;this.initHighlighting=l;this.initHighlightingOnLoad=a;this.registerLanguage=d;this.listLanguages=k;this.getLanguage=i;this.inherit=o;this.IR="[a-zA-Z][a-zA-Z0-9_]*";this.UIR="[a-zA-Z_][a-zA-Z0-9_]*";this.NR="\\b\\d+(\\.\\d+)?";this.CNR="(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)";this.BNR="\\b(0b[01]+)";this.RSR="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~";this.BE={b:"\\\\[\\s\\S]",r:0};this.ASM={cN:"string",b:"'",e:"'",i:"\\n",c:[this.BE]};this.QSM={cN:"string",b:'"',e:'"',i:"\\n",c:[this.BE]};this.PWM={b:/\b(a|an|the|are|I|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such)\b/};this.CLCM={cN:"comment",b:"//",e:"$",c:[this.PWM]};this.CBCM={cN:"comment",b:"/\\*",e:"\\*/",c:[this.PWM]};this.HCM={cN:"comment",b:"#",e:"$",c:[this.PWM]};this.NM={cN:"number",b:this.NR,r:0};this.CNM={cN:"number",b:this.CNR,r:0};this.BNM={cN:"number",b:this.BNR,r:0};this.CSSNM={cN:"number",b:this.NR+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",r:0};this.RM={cN:"regexp",b:/\//,e:/\/[gim]*/,i:/\n/,c:[this.BE,{b:/\[/,e:/\]/,r:0,c:[this.BE]}]};this.TM={cN:"title",b:this.IR,r:0};this.UTM={cN:"title",b:this.UIR,r:0}}();hljs.registerLanguage("bash",function(b){var a={cN:"variable",v:[{b:/\$[\w\d#@][\w\d_]*/},{b:/\$\{(.*?)\}/}]};var d={cN:"string",b:/"/,e:/"/,c:[b.BE,a,{cN:"variable",b:/\$\(/,e:/\)/,c:[b.BE]}]};var c={cN:"string",b:/'/,e:/'/};return{aliases:["sh","zsh"],l:/-?[a-z\.]+/,k:{keyword:"if then else elif fi for break continue while in do done exit return set declare case esac export exec",literal:"true false",built_in:"printf echo read cd pwd pushd popd dirs let eval unset typeset readonly getopts source shopt caller type hash bind help sudo",operator:"-ne -eq -lt -gt -f -d -e -s -l -a"},c:[{cN:"shebang",b:/^#![^\n]+sh\s*$/,r:10},{cN:"function",b:/\w[\w\d_]*\s*\(\s*\)\s*\{/,rB:true,c:[b.inherit(b.TM,{b:/\w[\w\d_]*/})],r:0},b.HCM,b.NM,d,c,a]}});hljs.registerLanguage("fix",function(a){return{c:[{b:/[^\u2401\u0001]+/,e:/[\u2401\u0001]/,eE:true,rB:true,rE:false,c:[{b:/([^\u2401\u0001=]+)/,e:/=([^\u2401\u0001=]+)/,rE:true,rB:false,cN:"attribute"},{b:/=/,e:/([\u2401\u0001])/,eE:true,eB:true,cN:"string"}]}],cI:true}});hljs.registerLanguage("nsis",function(a){var c={cN:"symbol",b:"\\$(ADMINTOOLS|APPDATA|CDBURN_AREA|CMDLINE|COMMONFILES32|COMMONFILES64|COMMONFILES|COOKIES|DESKTOP|DOCUMENTS|EXEDIR|EXEFILE|EXEPATH|FAVORITES|FONTS|HISTORY|HWNDPARENT|INSTDIR|INTERNET_CACHE|LANGUAGE|LOCALAPPDATA|MUSIC|NETHOOD|OUTDIR|PICTURES|PLUGINSDIR|PRINTHOOD|PROFILE|PROGRAMFILES32|PROGRAMFILES64|PROGRAMFILES|QUICKLAUNCH|RECENT|RESOURCES_LOCALIZED|RESOURCES|SENDTO|SMPROGRAMS|SMSTARTUP|STARTMENU|SYSDIR|TEMP|TEMPLATES|VIDEOS|WINDIR)"};var b={cN:"constant",b:"\\$+{[a-zA-Z0-9_]+}"};var f={cN:"variable",b:"\\$+[a-zA-Z0-9_]+",i:"\\(\\){}"};var e={cN:"constant",b:"\\$+\\([a-zA-Z0-9_]+\\)"};var g={cN:"params",b:"(ARCHIVE|FILE_ATTRIBUTE_ARCHIVE|FILE_ATTRIBUTE_NORMAL|FILE_ATTRIBUTE_OFFLINE|FILE_ATTRIBUTE_READONLY|FILE_ATTRIBUTE_SYSTEM|FILE_ATTRIBUTE_TEMPORARY|HKCR|HKCU|HKDD|HKEY_CLASSES_ROOT|HKEY_CURRENT_CONFIG|HKEY_CURRENT_USER|HKEY_DYN_DATA|HKEY_LOCAL_MACHINE|HKEY_PERFORMANCE_DATA|HKEY_USERS|HKLM|HKPD|HKU|IDABORT|IDCANCEL|IDIGNORE|IDNO|IDOK|IDRETRY|IDYES|MB_ABORTRETRYIGNORE|MB_DEFBUTTON1|MB_DEFBUTTON2|MB_DEFBUTTON3|MB_DEFBUTTON4|MB_ICONEXCLAMATION|MB_ICONINFORMATION|MB_ICONQUESTION|MB_ICONSTOP|MB_OK|MB_OKCANCEL|MB_RETRYCANCEL|MB_RIGHT|MB_RTLREADING|MB_SETFOREGROUND|MB_TOPMOST|MB_USERICON|MB_YESNO|NORMAL|OFFLINE|READONLY|SHCTX|SHELL_CONTEXT|SYSTEM|TEMPORARY)"};var d={cN:"constant",b:"\\!(addincludedir|addplugindir|appendfile|cd|define|delfile|echo|else|endif|error|execute|finalize|getdllversionsystem|ifdef|ifmacrodef|ifmacrondef|ifndef|if|include|insertmacro|macroend|macro|packhdr|searchparse|searchreplace|tempfile|undef|verbose|warning)"};return{cI:false,k:{keyword:"Abort AddBrandingImage AddSize AllowRootDirInstall AllowSkipFiles AutoCloseWindow BGFont BGGradient BrandingText BringToFront Call CallInstDLL Caption ChangeUI CheckBitmap ClearErrors CompletedText ComponentText CopyFiles CRCCheck CreateDirectory CreateFont CreateShortCut Delete DeleteINISec DeleteINIStr DeleteRegKey DeleteRegValue DetailPrint DetailsButtonText DirText DirVar DirVerify EnableWindow EnumRegKey EnumRegValue Exch Exec ExecShell ExecWait ExpandEnvStrings File FileBufSize FileClose FileErrorText FileOpen FileRead FileReadByte FileReadUTF16LE FileReadWord FileSeek FileWrite FileWriteByte FileWriteUTF16LE FileWriteWord FindClose FindFirst FindNext FindWindow FlushINI FunctionEnd GetCurInstType GetCurrentAddress GetDlgItem GetDLLVersion GetDLLVersionLocal GetErrorLevel GetFileTime GetFileTimeLocal GetFullPathName GetFunctionAddress GetInstDirError GetLabelAddress GetTempFileName Goto HideWindow Icon IfAbort IfErrors IfFileExists IfRebootFlag IfSilent InitPluginsDir InstallButtonText InstallColors InstallDir InstallDirRegKey InstProgressFlags InstType InstTypeGetText InstTypeSetText IntCmp IntCmpU IntFmt IntOp IsWindow LangString LicenseBkColor LicenseData LicenseForceSelection LicenseLangString LicenseText LoadLanguageFile LockWindow LogSet LogText ManifestDPIAware ManifestSupportedOS MessageBox MiscButtonText Name Nop OutFile Page PageCallbacks PageExEnd Pop Push Quit ReadEnvStr ReadINIStr ReadRegDWORD ReadRegStr Reboot RegDLL Rename RequestExecutionLevel ReserveFile Return RMDir SearchPath SectionEnd SectionGetFlags SectionGetInstTypes SectionGetSize SectionGetText SectionGroupEnd SectionIn SectionSetFlags SectionSetInstTypes SectionSetSize SectionSetText SendMessage SetAutoClose SetBrandingImage SetCompress SetCompressor SetCompressorDictSize SetCtlColors SetCurInstType SetDatablockOptimize SetDateSave SetDetailsPrint SetDetailsView SetErrorLevel SetErrors SetFileAttributes SetFont SetOutPath SetOverwrite SetPluginUnload SetRebootFlag SetRegView SetShellVarContext SetSilent ShowInstDetails ShowUninstDetails ShowWindow SilentInstall SilentUnInstall Sleep SpaceTexts StrCmp StrCmpS StrCpy StrLen SubCaption SubSectionEnd Unicode UninstallButtonText UninstallCaption UninstallIcon UninstallSubCaption UninstallText UninstPage UnRegDLL Var VIAddVersionKey VIFileVersion VIProductVersion WindowIcon WriteINIStr WriteRegBin WriteRegDWORD WriteRegExpandStr WriteRegStr WriteUninstaller XPStyle",literal:"admin all auto both colored current false force hide highest lastused leave listonly none normal notset off on open print show silent silentlog smooth textonly true user "},c:[a.HCM,a.CBCM,{cN:"string",b:'"',e:'"',i:"\\n",c:[{cN:"symbol",b:"\\$(\\\\(n|r|t)|\\$)"},c,b,f,e]},{cN:"comment",b:";",e:"$",r:0},{cN:"function",bK:"Function PageEx Section SectionGroup SubSection",e:"$"},d,b,f,e,g,a.NM,{cN:"literal",b:a.IR+"::"+a.IR}]}});hljs.registerLanguage("haxe",function(a){var c="[a-zA-Z_$][a-zA-Z0-9_$]*";var b="([*]|[a-zA-Z_$][a-zA-Z0-9_$]*)";return{aliases:["hx"],k:{keyword:"break callback case cast catch class continue default do dynamic else enum extends extern for function here if implements import in inline interface never new override package private public return static super switch this throw trace try typedef untyped using var while",literal:"true false null"},c:[a.ASM,a.QSM,a.CLCM,a.CBCM,a.CNM,{cN:"class",bK:"class interface",e:"{",eE:true,c:[{bK:"extends implements"},a.TM]},{cN:"preprocessor",b:"#",e:"$",k:"if else elseif end error"},{cN:"function",bK:"function",e:"[{;]",eE:true,i:"\\S",c:[a.TM,{cN:"params",b:"\\(",e:"\\)",c:[a.ASM,a.QSM,a.CLCM,a.CBCM]},{cN:"type",b:":",e:b,r:10}]}]}});hljs.registerLanguage("erlang",function(i){var c="[a-z'][a-zA-Z0-9_']*";var o="("+c+":"+c+"|"+c+")";var f={keyword:"after and andalso|10 band begin bnot bor bsl bzr bxor case catch cond div end fun let not of orelse|10 query receive rem try when xor",literal:"false true"};var l={cN:"comment",b:"%",e:"$"};var e={cN:"number",b:"\\b(\\d+#[a-fA-F0-9]+|\\d+(\\.\\d+)?([eE][-+]?\\d+)?)",r:0};var g={b:"fun\\s+"+c+"/\\d+"};var n={b:o+"\\(",e:"\\)",rB:true,r:0,c:[{cN:"function_name",b:o,r:0},{b:"\\(",e:"\\)",eW:true,rE:true,r:0}]};var h={cN:"tuple",b:"{",e:"}",r:0};var a={cN:"variable",b:"\\b_([A-Z][A-Za-z0-9_]*)?",r:0};var m={cN:"variable",b:"[A-Z][a-zA-Z0-9_]*",r:0};var b={b:"#"+i.UIR,r:0,rB:true,c:[{cN:"record_name",b:"#"+i.UIR,r:0},{b:"{",e:"}",r:0}]};var k={bK:"fun receive if try case",e:"end",k:f};k.c=[l,g,i.inherit(i.ASM,{cN:""}),k,n,i.QSM,e,h,a,m,b];var j=[l,g,k,n,i.QSM,e,h,a,m,b];n.c[1].c=j;h.c=j;b.c[1].c=j;var d={cN:"params",b:"\\(",e:"\\)",c:j};return{aliases:["erl"],k:f,i:"(</|\\*=|\\+=|-=|/\\*|\\*/|\\(\\*|\\*\\))",c:[{cN:"function",b:"^"+c+"\\s*\\(",e:"->",rB:true,i:"\\(|#|//|/\\*|\\\\|:|;",c:[d,i.inherit(i.TM,{b:c})],starts:{e:";|\\.",k:f,c:j}},l,{cN:"pp",b:"^-",e:"\\.",r:0,eE:true,rB:true,l:"-"+i.IR,k:"-module -record -undef -export -ifdef -ifndef -author -copyright -doc -vsn -import -include -include_lib -compile -define -else -endif -file -behaviour -behavior -spec",c:[d]},e,i.QSM,b,a,m,h,{b:/\.$/}]}});hljs.registerLanguage("cs",function(b){var a="abstract as base bool break byte case catch char checked const continue decimal default delegate do double else enum event explicit extern false finally fixed float for foreach goto if implicit in int interface internal is lock long new null object operator out override params private protected public readonly ref return sbyte sealed short sizeof stackalloc static string struct switch this throw true try typeof uint ulong unchecked unsafe ushort using virtual volatile void while async await ascending descending from get group into join let orderby partial select set value var where yield";return{aliases:["csharp"],k:a,i:/::/,c:[{cN:"comment",b:"///",e:"$",rB:true,c:[{cN:"xmlDocTag",v:[{b:"///",r:0},{b:"<!--|-->"},{b:"</?",e:">"}]}]},b.CLCM,b.CBCM,{cN:"preprocessor",b:"#",e:"$",k:"if else elif endif define undef warning error line region endregion pragma checksum"},{cN:"string",b:'@"',e:'"',c:[{b:'""'}]},b.ASM,b.QSM,b.CNM,{bK:"protected public private internal",e:/[{;=]/,k:a,c:[{bK:"class namespace interface",starts:{c:[b.TM]}},{b:b.IR+"\\s*\\(",rB:true,c:[b.TM]}]}]}});hljs.registerLanguage("protobuf",function(a){return{k:{keyword:"package import option optional required repeated group",built_in:"double float int32 int64 uint32 uint64 sint32 sint64 fixed32 fixed64 sfixed32 sfixed64 bool string bytes",literal:"true false"},c:[a.QSM,a.NM,a.CLCM,{cN:"class",bK:"message enum service",e:/\{/,i:/\n/,c:[a.inherit(a.TM,{starts:{eW:true,eE:true}})]},{cN:"function",bK:"rpc",e:/;/,eE:true,k:"rpc returns"},{cN:"constant",b:/^\s*[A-Z_]+/,e:/\s*=/,eE:true}]}});hljs.registerLanguage("vim",function(a){return{l:/[!#@\w]+/,k:{keyword:"N|0 P|0 X|0 a|0 ab abc abo al am an|0 ar arga argd arge argdo argg argl argu as au aug aun b|0 bN ba bad bd be bel bf bl bm bn bo bp br brea breaka breakd breakl bro bufdo buffers bun bw c|0 cN cNf ca cabc caddb cad caddf cal cat cb cc ccl cd ce cex cf cfir cgetb cgete cg changes chd che checkt cl cla clo cm cmapc cme cn cnew cnf cno cnorea cnoreme co col colo com comc comp con conf cope cp cpf cq cr cs cst cu cuna cunme cw d|0 delm deb debugg delc delf dif diffg diffo diffp diffpu diffs diffthis dig di dl dell dj dli do doautoa dp dr ds dsp e|0 ea ec echoe echoh echom echon el elsei em en endfo endf endt endw ene ex exe exi exu f|0 files filet fin fina fini fir fix fo foldc foldd folddoc foldo for fu g|0 go gr grepa gu gv ha h|0 helpf helpg helpt hi hid his i|0 ia iabc if ij il im imapc ime ino inorea inoreme int is isp iu iuna iunme j|0 ju k|0 keepa kee keepj lN lNf l|0 lad laddb laddf la lan lat lb lc lch lcl lcs le lefta let lex lf lfir lgetb lgete lg lgr lgrepa lh ll lla lli lmak lm lmapc lne lnew lnf ln loadk lo loc lockv lol lope lp lpf lr ls lt lu lua luad luaf lv lvimgrepa lw m|0 ma mak map mapc marks mat me menut mes mk mks mksp mkv mkvie mod mz mzf nbc nb nbs n|0 new nm nmapc nme nn nnoreme noa no noh norea noreme norm nu nun nunme ol o|0 om omapc ome on ono onoreme opt ou ounme ow p|0 profd prof pro promptr pc ped pe perld po popu pp pre prev ps pt ptN ptf ptj ptl ptn ptp ptr pts pu pw py3 python3 py3d py3f py pyd pyf q|0 quita qa r|0 rec red redi redr redraws reg res ret retu rew ri rightb rub rubyd rubyf rund ru rv s|0 sN san sa sal sav sb sbN sba sbf sbl sbm sbn sbp sbr scrip scripte scs se setf setg setl sf sfir sh sim sig sil sl sla sm smap smapc sme sn sni sno snor snoreme sor so spelld spe spelli spellr spellu spellw sp spr sre st sta startg startr star stopi stj sts sun sunm sunme sus sv sw sy synti sync t|0 tN tabN tabc tabdo tabe tabf tabfir tabl tabm tabnew tabn tabo tabp tabr tabs tab ta tags tc tcld tclf te tf th tj tl tm tn to tp tr try ts tu u|0 undoj undol una unh unl unlo unm unme uns up v|0 ve verb vert vim vimgrepa vi viu vie vm vmapc vme vne vn vnoreme vs vu vunme windo w|0 wN wa wh wi winc winp wn wp wq wqa ws wu wv x|0 xa xmapc xm xme xn xnoreme xu xunme y|0 z|0 ~ Next Print append abbreviate abclear aboveleft all amenu anoremenu args argadd argdelete argedit argglobal arglocal argument ascii autocmd augroup aunmenu buffer bNext ball badd bdelete behave belowright bfirst blast bmodified bnext botright bprevious brewind break breakadd breakdel breaklist browse bunload bwipeout change cNext cNfile cabbrev cabclear caddbuffer caddexpr caddfile call catch cbuffer cclose center cexpr cfile cfirst cgetbuffer cgetexpr cgetfile chdir checkpath checktime clist clast close cmap cmapclear cmenu cnext cnewer cnfile cnoremap cnoreabbrev cnoremenu copy colder colorscheme command comclear compiler continue confirm copen cprevious cpfile cquit crewind cscope cstag cunmap cunabbrev cunmenu cwindow delete delmarks debug debuggreedy delcommand delfunction diffupdate diffget diffoff diffpatch diffput diffsplit digraphs display deletel djump dlist doautocmd doautoall deletep drop dsearch dsplit edit earlier echo echoerr echohl echomsg else elseif emenu endif endfor endfunction endtry endwhile enew execute exit exusage file filetype find finally finish first fixdel fold foldclose folddoopen folddoclosed foldopen function global goto grep grepadd gui gvim hardcopy help helpfind helpgrep helptags highlight hide history insert iabbrev iabclear ijump ilist imap imapclear imenu inoremap inoreabbrev inoremenu intro isearch isplit iunmap iunabbrev iunmenu join jumps keepalt keepmarks keepjumps lNext lNfile list laddexpr laddbuffer laddfile last language later lbuffer lcd lchdir lclose lcscope left leftabove lexpr lfile lfirst lgetbuffer lgetexpr lgetfile lgrep lgrepadd lhelpgrep llast llist lmake lmap lmapclear lnext lnewer lnfile lnoremap loadkeymap loadview lockmarks lockvar lolder lopen lprevious lpfile lrewind ltag lunmap luado luafile lvimgrep lvimgrepadd lwindow move mark make mapclear match menu menutranslate messages mkexrc mksession mkspell mkvimrc mkview mode mzscheme mzfile nbclose nbkey nbsart next nmap nmapclear nmenu nnoremap nnoremenu noautocmd noremap nohlsearch noreabbrev noremenu normal number nunmap nunmenu oldfiles open omap omapclear omenu only onoremap onoremenu options ounmap ounmenu ownsyntax print profdel profile promptfind promptrepl pclose pedit perl perldo pop popup ppop preserve previous psearch ptag ptNext ptfirst ptjump ptlast ptnext ptprevious ptrewind ptselect put pwd py3do py3file python pydo pyfile quit quitall qall read recover redo redir redraw redrawstatus registers resize retab return rewind right rightbelow ruby rubydo rubyfile rundo runtime rviminfo substitute sNext sandbox sargument sall saveas sbuffer sbNext sball sbfirst sblast sbmodified sbnext sbprevious sbrewind scriptnames scriptencoding scscope set setfiletype setglobal setlocal sfind sfirst shell simalt sign silent sleep slast smagic smapclear smenu snext sniff snomagic snoremap snoremenu sort source spelldump spellgood spellinfo spellrepall spellundo spellwrong split sprevious srewind stop stag startgreplace startreplace startinsert stopinsert stjump stselect sunhide sunmap sunmenu suspend sview swapname syntax syntime syncbind tNext tabNext tabclose tabedit tabfind tabfirst tablast tabmove tabnext tabonly tabprevious tabrewind tag tcl tcldo tclfile tearoff tfirst throw tjump tlast tmenu tnext topleft tprevious trewind tselect tunmenu undo undojoin undolist unabbreviate unhide unlet unlockvar unmap unmenu unsilent update vglobal version verbose vertical vimgrep vimgrepadd visual viusage view vmap vmapclear vmenu vnew vnoremap vnoremenu vsplit vunmap vunmenu write wNext wall while winsize wincmd winpos wnext wprevious wqall wsverb wundo wviminfo xit xall xmapclear xmap xmenu xnoremap xnoremenu xunmap xunmenu yank",built_in:"abs acos add and append argc argidx argv asin atan atan2 browse browsedir bufexists buflisted bufloaded bufname bufnr bufwinnr byte2line byteidx call ceil changenr char2nr cindent clearmatches col complete complete_add complete_check confirm copy cos cosh count cscope_connection cursor deepcopy delete did_filetype diff_filler diff_hlID empty escape eval eventhandler executable exists exp expand extend feedkeys filereadable filewritable filter finddir findfile float2nr floor fmod fnameescape fnamemodify foldclosed foldclosedend foldlevel foldtext foldtextresult foreground function garbagecollect get getbufline getbufvar getchar getcharmod getcmdline getcmdpos getcmdtype getcwd getfontname getfperm getfsize getftime getftype getline getloclist getmatches getpid getpos getqflist getreg getregtype gettabvar gettabwinvar getwinposx getwinposy getwinvar glob globpath has has_key haslocaldir hasmapto histadd histdel histget histnr hlexists hlID hostname iconv indent index input inputdialog inputlist inputrestore inputsave inputsecret insert invert isdirectory islocked items join keys len libcall libcallnr line line2byte lispindent localtime log log10 luaeval map maparg mapcheck match matchadd matcharg matchdelete matchend matchlist matchstr max min mkdir mode mzeval nextnonblank nr2char or pathshorten pow prevnonblank printf pumvisible py3eval pyeval range readfile reltime reltimestr remote_expr remote_foreground remote_peek remote_read remote_send remove rename repeat resolve reverse round screenattr screenchar screencol screenrow search searchdecl searchpair searchpairpos searchpos server2client serverlist setbufvar setcmdpos setline setloclist setmatches setpos setqflist setreg settabvar settabwinvar setwinvar sha256 shellescape shiftwidth simplify sin sinh sort soundfold spellbadword spellsuggest split sqrt str2float str2nr strchars strdisplaywidth strftime stridx string strlen strpart strridx strtrans strwidth submatch substitute synconcealed synID synIDattr synIDtrans synstack system tabpagebuflist tabpagenr tabpagewinnr tagfiles taglist tan tanh tempname tolower toupper tr trunc type undofile undotree values virtcol visualmode wildmenumode winbufnr wincol winheight winline winnr winrestcmd winrestview winsaveview winwidth writefile xor"},i:/[{:]/,c:[a.NM,a.ASM,{cN:"string",b:/"((\\")|[^"\n])*("|\n)/},{cN:"variable",b:/[bwtglsav]:[\w\d_]*/},{cN:"function",bK:"function function!",e:"$",r:0,c:[a.TM,{cN:"params",b:"\\(",e:"\\)"}]}]}});hljs.registerLanguage("brainfuck",function(b){var a={cN:"literal",b:"[\\+\\-]",r:0};return{aliases:["bf"],c:[{cN:"comment",b:"[^\\[\\]\\.,\\+\\-<> \r\n]",rE:true,e:"[\\[\\]\\.,\\+\\-<> \r\n]",r:0},{cN:"title",b:"[\\[\\]]",r:0},{cN:"string",b:"[\\.,]",r:0},{b:/\+\+|\-\-/,rB:true,c:[a]},a]}});hljs.registerLanguage("ruby",function(f){var j="[a-zA-Z_]\\w*[!?=]?|[-+~]\\@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?";var i="and false then defined module in return redo if BEGIN retry end for true self when next until do begin unless END rescue nil else break undef not super class case require yield alias while ensure elsif or include attr_reader attr_writer attr_accessor";var b={cN:"yardoctag",b:"@[A-Za-z]+"};var c={cN:"value",b:"#<",e:">"};var k={cN:"comment",v:[{b:"#",e:"$",c:[b]},{b:"^\\=begin",e:"^\\=end",c:[b],r:10},{b:"^__END__",e:"\\n$"}]};var d={cN:"subst",b:"#\\{",e:"}",k:i};var e={cN:"string",c:[f.BE,d],v:[{b:/'/,e:/'/},{b:/"/,e:/"/},{b:"%[qw]?\\(",e:"\\)"},{b:"%[qw]?\\[",e:"\\]"},{b:"%[qw]?{",e:"}"},{b:"%[qw]?<",e:">"},{b:"%[qw]?/",e:"/"},{b:"%[qw]?%",e:"%"},{b:"%[qw]?-",e:"-"},{b:"%[qw]?\\|",e:"\\|"},{b:/\B\?(\\\d{1,3}|\\x[A-Fa-f0-9]{1,2}|\\u[A-Fa-f0-9]{4}|\\?\S)\b/}]};var a={cN:"params",b:"\\(",e:"\\)",k:i};var h=[e,c,k,{cN:"class",bK:"class module",e:"$|;",i:/=/,c:[f.inherit(f.TM,{b:"[A-Za-z_]\\w*(::\\w+)*(\\?|\\!)?"}),{cN:"inheritance",b:"<\\s*",c:[{cN:"parent",b:"("+f.IR+"::)?"+f.IR}]},k]},{cN:"function",bK:"def",e:" |$|;",r:0,c:[f.inherit(f.TM,{b:j}),a,k]},{cN:"constant",b:"(::)?(\\b[A-Z]\\w*(::)?)+",r:0},{cN:"symbol",b:":",c:[e,{b:j}],r:0},{cN:"symbol",b:f.UIR+"(\\!|\\?)?:",r:0},{cN:"number",b:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",r:0},{cN:"variable",b:"(\\$\\W)|((\\$|\\@\\@?)(\\w+))"},{b:"("+f.RSR+")\\s*",c:[c,k,{cN:"regexp",c:[f.BE,d],i:/\n/,v:[{b:"/",e:"/[a-z]*"},{b:"%r{",e:"}[a-z]*"},{b:"%r\\(",e:"\\)[a-z]*"},{b:"%r!",e:"![a-z]*"},{b:"%r\\[",e:"\\][a-z]*"}]}],r:0}];d.c=h;a.c=h;var g=[{r:1,cN:"output",b:"^\\s*=> ",e:"$",rB:true,c:[{cN:"status",b:"^\\s*=>"},{b:" ",e:"$",c:h}]},{r:1,cN:"input",b:"^[^ ][^=>]*>+ ",e:"$",rB:true,c:[{cN:"prompt",b:"^[^ ][^=>]*>+"},{b:" ",e:"$",c:h}]}];return{aliases:["rb","gemspec","podspec","thor","irb"],k:i,c:g.concat(h)}});hljs.registerLanguage("nimrod",function(a){return{k:{keyword:"addr and as asm bind block break|0 case|0 cast const|0 continue|0 converter discard distinct|10 div do elif else|0 end|0 enum|0 except export finally for from generic if|0 import|0 in include|0 interface is isnot|10 iterator|10 let|0 macro method|10 mixin mod nil not notin|10 object|0 of or out proc|10 ptr raise ref|10 return shl shr static template|10 try|0 tuple type|0 using|0 var|0 when while|0 with without xor yield",literal:"shared guarded stdin stdout stderr result|10 true false"},c:[{cN:"decorator",b:/{\./,e:/\.}/,r:10},{cN:"string",b:/[a-zA-Z]\w*"/,e:/"/,c:[{b:/""/}]},{cN:"string",b:/([a-zA-Z]\w*)?"""/,e:/"""/},{cN:"string",b:/"/,e:/"/,i:/\n/,c:[{b:/\\./}]},{cN:"type",b:/\b[A-Z]\w+\b/,r:0},{cN:"type",b:/\b(int|int8|int16|int32|int64|uint|uint8|uint16|uint32|uint64|float|float32|float64|bool|char|string|cstring|pointer|expr|stmt|void|auto|any|range|array|openarray|varargs|seq|set|clong|culong|cchar|cschar|cshort|cint|csize|clonglong|cfloat|cdouble|clongdouble|cuchar|cushort|cuint|culonglong|cstringarray|semistatic)\b/},{cN:"number",b:/\b(0[xX][0-9a-fA-F][_0-9a-fA-F]*)('?[iIuU](8|16|32|64))?/,r:0},{cN:"number",b:/\b(0o[0-7][_0-7]*)('?[iIuUfF](8|16|32|64))?/,r:0},{cN:"number",b:/\b(0(b|B)[01][_01]*)('?[iIuUfF](8|16|32|64))?/,r:0},{cN:"number",b:/\b(\d[_\d]*)('?[iIuUfF](8|16|32|64))?/,r:0},a.HCM]}});hljs.registerLanguage("rust",function(a){return{aliases:["rs"],k:"alignof as be box break const continue crate do else enum extern false fn for if impl in let loop match mod mut offsetof once priv proc pub pure ref return self sizeof static struct super trait true type typeof unsafe unsized use virtual while yield int i8 i16 i32 i64 uint u8 u32 u64 float f32 f64 str char bool",i:"</",c:[a.CLCM,a.CBCM,a.inherit(a.QSM,{i:null}),{cN:"string",b:/r(#*)".*?"\1(?!#)/},{cN:"string",b:/'\\?(x\w{2}|u\w{4}|U\w{8}|.)'/},{b:/'[a-zA-Z_][a-zA-Z0-9_]*/},{cN:"number",b:"\\b(0[xb][A-Za-z0-9_]+|[0-9_]+(\\.[0-9_]+)?([uif](8|16|32|64)?)?)",r:0},{cN:"function",bK:"fn",e:"(\\(|<)",eE:true,c:[a.UTM]},{cN:"preprocessor",b:"#\\[",e:"\\]"},{bK:"type",e:"(=|<)",c:[a.UTM],i:"\\S"},{bK:"trait enum",e:"({|<)",c:[a.UTM],i:"\\S"},{b:a.IR+"::"},{b:"->"}]}});hljs.registerLanguage("ruleslanguage",function(a){return{k:{keyword:"BILL_PERIOD BILL_START BILL_STOP RS_EFFECTIVE_START RS_EFFECTIVE_STOP RS_JURIS_CODE RS_OPCO_CODE INTDADDATTRIBUTE|5 INTDADDVMSG|5 INTDBLOCKOP|5 INTDBLOCKOPNA|5 INTDCLOSE|5 INTDCOUNT|5 INTDCOUNTSTATUSCODE|5 INTDCREATEMASK|5 INTDCREATEDAYMASK|5 INTDCREATEFACTORMASK|5 INTDCREATEHANDLE|5 INTDCREATEOVERRIDEDAYMASK|5 INTDCREATEOVERRIDEMASK|5 INTDCREATESTATUSCODEMASK|5 INTDCREATETOUPERIOD|5 INTDDELETE|5 INTDDIPTEST|5 INTDEXPORT|5 INTDGETERRORCODE|5 INTDGETERRORMESSAGE|5 INTDISEQUAL|5 INTDJOIN|5 INTDLOAD|5 INTDLOADACTUALCUT|5 INTDLOADDATES|5 INTDLOADHIST|5 INTDLOADLIST|5 INTDLOADLISTDATES|5 INTDLOADLISTENERGY|5 INTDLOADLISTHIST|5 INTDLOADRELATEDCHANNEL|5 INTDLOADSP|5 INTDLOADSTAGING|5 INTDLOADUOM|5 INTDLOADUOMDATES|5 INTDLOADUOMHIST|5 INTDLOADVERSION|5 INTDOPEN|5 INTDREADFIRST|5 INTDREADNEXT|5 INTDRECCOUNT|5 INTDRELEASE|5 INTDREPLACE|5 INTDROLLAVG|5 INTDROLLPEAK|5 INTDSCALAROP|5 INTDSCALE|5 INTDSETATTRIBUTE|5 INTDSETDSTPARTICIPANT|5 INTDSETSTRING|5 INTDSETVALUE|5 INTDSETVALUESTATUS|5 INTDSHIFTSTARTTIME|5 INTDSMOOTH|5 INTDSORT|5 INTDSPIKETEST|5 INTDSUBSET|5 INTDTOU|5 INTDTOURELEASE|5 INTDTOUVALUE|5 INTDUPDATESTATS|5 INTDVALUE|5 STDEV INTDDELETEEX|5 INTDLOADEXACTUAL|5 INTDLOADEXCUT|5 INTDLOADEXDATES|5 INTDLOADEX|5 INTDLOADEXRELATEDCHANNEL|5 INTDSAVEEX|5 MVLOAD|5 MVLOADACCT|5 MVLOADACCTDATES|5 MVLOADACCTHIST|5 MVLOADDATES|5 MVLOADHIST|5 MVLOADLIST|5 MVLOADLISTDATES|5 MVLOADLISTHIST|5 IF FOR NEXT DONE SELECT END CALL ABORT CLEAR CHANNEL FACTOR LIST NUMBER OVERRIDE SET WEEK DISTRIBUTIONNODE ELSE WHEN THEN OTHERWISE IENUM CSV INCLUDE LEAVE RIDER SAVE DELETE NOVALUE SECTION WARN SAVE_UPDATE DETERMINANT LABEL REPORT REVENUE EACH IN FROM TOTAL CHARGE BLOCK AND OR CSV_FILE RATE_CODE AUXILIARY_DEMAND UIDACCOUNT RS BILL_PERIOD_SELECT HOURS_PER_MONTH INTD_ERROR_STOP SEASON_SCHEDULE_NAME ACCOUNTFACTOR ARRAYUPPERBOUND CALLSTOREDPROC GETADOCONNECTION GETCONNECT GETDATASOURCE GETQUALIFIER GETUSERID HASVALUE LISTCOUNT LISTOP LISTUPDATE LISTVALUE PRORATEFACTOR RSPRORATE SETBINPATH SETDBMONITOR WQ_OPEN BILLINGHOURS DATE DATEFROMFLOAT DATETIMEFROMSTRING DATETIMETOSTRING DATETOFLOAT DAY DAYDIFF DAYNAME DBDATETIME HOUR MINUTE MONTH MONTHDIFF MONTHHOURS MONTHNAME ROUNDDATE SAMEWEEKDAYLASTYEAR SECOND WEEKDAY WEEKDIFF YEAR YEARDAY YEARSTR COMPSUM HISTCOUNT HISTMAX HISTMIN HISTMINNZ HISTVALUE MAXNRANGE MAXRANGE MINRANGE COMPIKVA COMPKVA COMPKVARFROMKQKW COMPLF IDATTR FLAG LF2KW LF2KWH MAXKW POWERFACTOR READING2USAGE AVGSEASON MAXSEASON MONTHLYMERGE SEASONVALUE SUMSEASON ACCTREADDATES ACCTTABLELOAD CONFIGADD CONFIGGET CREATEOBJECT CREATEREPORT EMAILCLIENT EXPBLKMDMUSAGE EXPMDMUSAGE EXPORT_USAGE FACTORINEFFECT GETUSERSPECIFIEDSTOP INEFFECT ISHOLIDAY RUNRATE SAVE_PROFILE SETREPORTTITLE USEREXIT WATFORRUNRATE TO TABLE ACOS ASIN ATAN ATAN2 BITAND CEIL COS COSECANT COSH COTANGENT DIVQUOT DIVREM EXP FABS FLOOR FMOD FREPM FREXPN LOG LOG10 MAX MAXN MIN MINNZ MODF POW ROUND ROUND2VALUE ROUNDINT SECANT SIN SINH SQROOT TAN TANH FLOAT2STRING FLOAT2STRINGNC INSTR LEFT LEN LTRIM MID RIGHT RTRIM STRING STRINGNC TOLOWER TOUPPER TRIM NUMDAYS READ_DATE STAGING",built_in:"IDENTIFIER OPTIONS XML_ELEMENT XML_OP XML_ELEMENT_OF DOMDOCCREATE DOMDOCLOADFILE DOMDOCLOADXML DOMDOCSAVEFILE DOMDOCGETROOT DOMDOCADDPI DOMNODEGETNAME DOMNODEGETTYPE DOMNODEGETVALUE DOMNODEGETCHILDCT DOMNODEGETFIRSTCHILD DOMNODEGETSIBLING DOMNODECREATECHILDELEMENT DOMNODESETATTRIBUTE DOMNODEGETCHILDELEMENTCT DOMNODEGETFIRSTCHILDELEMENT DOMNODEGETSIBLINGELEMENT DOMNODEGETATTRIBUTECT DOMNODEGETATTRIBUTEI DOMNODEGETATTRIBUTEBYNAME DOMNODEGETBYNAME"},c:[a.CLCM,a.CBCM,a.ASM,a.QSM,a.CNM,{cN:"array",b:"#[a-zA-Z .]+"}]}});hljs.registerLanguage("rib",function(a){return{k:"ArchiveRecord AreaLightSource Atmosphere Attribute AttributeBegin AttributeEnd Basis Begin Blobby Bound Clipping ClippingPlane Color ColorSamples ConcatTransform Cone CoordinateSystem CoordSysTransform CropWindow Curves Cylinder DepthOfField Detail DetailRange Disk Displacement Display End ErrorHandler Exposure Exterior Format FrameAspectRatio FrameBegin FrameEnd GeneralPolygon GeometricApproximation Geometry Hider Hyperboloid Identity Illuminate Imager Interior LightSource MakeCubeFaceEnvironment MakeLatLongEnvironment MakeShadow MakeTexture Matte MotionBegin MotionEnd NuPatch ObjectBegin ObjectEnd ObjectInstance Opacity Option Orientation Paraboloid Patch PatchMesh Perspective PixelFilter PixelSamples PixelVariance Points PointsGeneralPolygons PointsPolygons Polygon Procedural Projection Quantize ReadArchive RelativeDetail ReverseOrientation Rotate Scale ScreenWindow ShadingInterpolation ShadingRate Shutter Sides Skew SolidBegin SolidEnd Sphere SubdivisionMesh Surface TextureCoordinates Torus Transform TransformBegin TransformEnd TransformPoints Translate TrimCurve WorldBegin WorldEnd",i:"</",c:[a.HCM,a.CNM,a.ASM,a.QSM]}});hljs.registerLanguage("diff",function(a){return{aliases:["patch"],c:[{cN:"chunk",r:10,v:[{b:/^\@\@ +\-\d+,\d+ +\+\d+,\d+ +\@\@$/},{b:/^\*\*\* +\d+,\d+ +\*\*\*\*$/},{b:/^\-\-\- +\d+,\d+ +\-\-\-\-$/}]},{cN:"header",v:[{b:/Index: /,e:/$/},{b:/=====/,e:/=====$/},{b:/^\-\-\-/,e:/$/},{b:/^\*{3} /,e:/$/},{b:/^\+\+\+/,e:/$/},{b:/\*{5}/,e:/\*{5}$/}]},{cN:"addition",b:"^\\+",e:"$"},{cN:"deletion",b:"^\\-",e:"$"},{cN:"change",b:"^\\!",e:"$"}]}});hljs.registerLanguage("haml",function(a){return{cI:true,c:[{cN:"doctype",b:"^!!!( (5|1\\.1|Strict|Frameset|Basic|Mobile|RDFa|XML\\b.*))?$",r:10},{cN:"comment",b:"^\\s*(!=#|=#|-#|/).*$",r:0},{b:"^\\s*(-|=|!=)(?!#)",starts:{e:"\\n",sL:"ruby"}},{cN:"tag",b:"^\\s*%",c:[{cN:"title",b:"\\w+"},{cN:"value",b:"[#\\.]\\w+"},{b:"{\\s*",e:"\\s*}",eE:true,c:[{b:":\\w+\\s*=>",e:",\\s+",rB:true,eW:true,c:[{cN:"symbol",b:":\\w+"},{cN:"string",b:'"',e:'"'},{cN:"string",b:"'",e:"'"},{b:"\\w+",r:0}]}]},{b:"\\(\\s*",e:"\\s*\\)",eE:true,c:[{b:"\\w+\\s*=",e:"\\s+",rB:true,eW:true,c:[{cN:"attribute",b:"\\w+",r:0},{cN:"string",b:'"',e:'"'},{cN:"string",b:"'",e:"'"},{b:"\\w+",r:0}]}]}]},{cN:"bullet",b:"^\\s*[=~]\\s*",r:0},{b:"#{",starts:{e:"}",sL:"ruby"}}]}});hljs.registerLanguage("javascript",function(a){return{aliases:["js"],k:{keyword:"in if for while finally var new function do return void else break catch instanceof with throw case default try this switch continue typeof delete let yield const class",literal:"true false null undefined NaN Infinity",built_in:"eval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Error EvalError InternalError RangeError ReferenceError StopIteration SyntaxError TypeError URIError Number Math Date String RegExp Array Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray ArrayBuffer DataView JSON Intl arguments require module console window document"},c:[{cN:"pi",b:/^\s*('|")use strict('|")/,r:10},a.ASM,a.QSM,a.CLCM,a.CBCM,a.CNM,{b:"("+a.RSR+"|\\b(case|return|throw)\\b)\\s*",k:"return throw case",c:[a.CLCM,a.CBCM,a.RM,{b:/</,e:/>;/,r:0,sL:"xml"}],r:0},{cN:"function",bK:"function",e:/\{/,eE:true,c:[a.inherit(a.TM,{b:/[A-Za-z$_][0-9A-Za-z$_]*/}),{cN:"params",b:/\(/,e:/\)/,c:[a.CLCM,a.CBCM],i:/["'\(]/}],i:/\[|%/},{b:/\$[(.]/},{b:"\\."+a.IR,r:0}]}});hljs.registerLanguage("glsl",function(a){return{k:{keyword:"atomic_uint attribute bool break bvec2 bvec3 bvec4 case centroid coherent const continue default discard dmat2 dmat2x2 dmat2x3 dmat2x4 dmat3 dmat3x2 dmat3x3 dmat3x4 dmat4 dmat4x2 dmat4x3 dmat4x4 do double dvec2 dvec3 dvec4 else flat float for highp if iimage1D iimage1DArray iimage2D iimage2DArray iimage2DMS iimage2DMSArray iimage2DRect iimage3D iimageBuffer iimageCube iimageCubeArray image1D image1DArray image2D image2DArray image2DMS image2DMSArray image2DRect image3D imageBuffer imageCube imageCubeArray in inout int invariant isampler1D isampler1DArray isampler2D isampler2DArray isampler2DMS isampler2DMSArray isampler2DRect isampler3D isamplerBuffer isamplerCube isamplerCubeArray ivec2 ivec3 ivec4 layout lowp mat2 mat2x2 mat2x3 mat2x4 mat3 mat3x2 mat3x3 mat3x4 mat4 mat4x2 mat4x3 mat4x4 mediump noperspective out patch precision readonly restrict return sample sampler1D sampler1DArray sampler1DArrayShadow sampler1DShadow sampler2D sampler2DArray sampler2DArrayShadow sampler2DMS sampler2DMSArray sampler2DRect sampler2DRectShadow sampler2DShadow sampler3D samplerBuffer samplerCube samplerCubeArray samplerCubeArrayShadow samplerCubeShadow smooth struct subroutine switch uimage1D uimage1DArray uimage2D uimage2DArray uimage2DMS uimage2DMSArray uimage2DRect uimage3D uimageBuffer uimageCube uimageCubeArray uint uniform usampler1D usampler1DArray usampler2D usampler2DArray usampler2DMS usampler2DMSArray usampler2DRect usampler3D usamplerBuffer usamplerCube usamplerCubeArray uvec2 uvec3 uvec4 varying vec2 vec3 vec4 void volatile while writeonly",built_in:"gl_BackColor gl_BackLightModelProduct gl_BackLightProduct gl_BackMaterial gl_BackSecondaryColor gl_ClipDistance gl_ClipPlane gl_ClipVertex gl_Color gl_DepthRange gl_EyePlaneQ gl_EyePlaneR gl_EyePlaneS gl_EyePlaneT gl_Fog gl_FogCoord gl_FogFragCoord gl_FragColor gl_FragCoord gl_FragData gl_FragDepth gl_FrontColor gl_FrontFacing gl_FrontLightModelProduct gl_FrontLightProduct gl_FrontMaterial gl_FrontSecondaryColor gl_InstanceID gl_InvocationID gl_Layer gl_LightModel gl_LightSource gl_MaxAtomicCounterBindings gl_MaxAtomicCounterBufferSize gl_MaxClipDistances gl_MaxClipPlanes gl_MaxCombinedAtomicCounterBuffers gl_MaxCombinedAtomicCounters gl_MaxCombinedImageUniforms gl_MaxCombinedImageUnitsAndFragmentOutputs gl_MaxCombinedTextureImageUnits gl_MaxDrawBuffers gl_MaxFragmentAtomicCounterBuffers gl_MaxFragmentAtomicCounters gl_MaxFragmentImageUniforms gl_MaxFragmentInputComponents gl_MaxFragmentUniformComponents gl_MaxFragmentUniformVectors gl_MaxGeometryAtomicCounterBuffers gl_MaxGeometryAtomicCounters gl_MaxGeometryImageUniforms gl_MaxGeometryInputComponents gl_MaxGeometryOutputComponents gl_MaxGeometryOutputVertices gl_MaxGeometryTextureImageUnits gl_MaxGeometryTotalOutputComponents gl_MaxGeometryUniformComponents gl_MaxGeometryVaryingComponents gl_MaxImageSamples gl_MaxImageUnits gl_MaxLights gl_MaxPatchVertices gl_MaxProgramTexelOffset gl_MaxTessControlAtomicCounterBuffers gl_MaxTessControlAtomicCounters gl_MaxTessControlImageUniforms gl_MaxTessControlInputComponents gl_MaxTessControlOutputComponents gl_MaxTessControlTextureImageUnits gl_MaxTessControlTotalOutputComponents gl_MaxTessControlUniformComponents gl_MaxTessEvaluationAtomicCounterBuffers gl_MaxTessEvaluationAtomicCounters gl_MaxTessEvaluationImageUniforms gl_MaxTessEvaluationInputComponents gl_MaxTessEvaluationOutputComponents gl_MaxTessEvaluationTextureImageUnits gl_MaxTessEvaluationUniformComponents gl_MaxTessGenLevel gl_MaxTessPatchComponents gl_MaxTextureCoords gl_MaxTextureImageUnits gl_MaxTextureUnits gl_MaxVaryingComponents gl_MaxVaryingFloats gl_MaxVaryingVectors gl_MaxVertexAtomicCounterBuffers gl_MaxVertexAtomicCounters gl_MaxVertexAttribs gl_MaxVertexImageUniforms gl_MaxVertexOutputComponents gl_MaxVertexTextureImageUnits gl_MaxVertexUniformComponents gl_MaxVertexUniformVectors gl_MaxViewports gl_MinProgramTexelOffsetgl_ModelViewMatrix gl_ModelViewMatrixInverse gl_ModelViewMatrixInverseTranspose gl_ModelViewMatrixTranspose gl_ModelViewProjectionMatrix gl_ModelViewProjectionMatrixInverse gl_ModelViewProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixTranspose gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_Normal gl_NormalMatrix gl_NormalScale gl_ObjectPlaneQ gl_ObjectPlaneR gl_ObjectPlaneS gl_ObjectPlaneT gl_PatchVerticesIn gl_PerVertex gl_Point gl_PointCoord gl_PointSize gl_Position gl_PrimitiveID gl_PrimitiveIDIn gl_ProjectionMatrix gl_ProjectionMatrixInverse gl_ProjectionMatrixInverseTranspose gl_ProjectionMatrixTranspose gl_SampleID gl_SampleMask gl_SampleMaskIn gl_SamplePosition gl_SecondaryColor gl_TessCoord gl_TessLevelInner gl_TessLevelOuter gl_TexCoord gl_TextureEnvColor gl_TextureMatrixInverseTranspose gl_TextureMatrixTranspose gl_Vertex gl_VertexID gl_ViewportIndex gl_in gl_out EmitStreamVertex EmitVertex EndPrimitive EndStreamPrimitive abs acos acosh all any asin asinh atan atanh atomicCounter atomicCounterDecrement atomicCounterIncrement barrier bitCount bitfieldExtract bitfieldInsert bitfieldReverse ceil clamp cos cosh cross dFdx dFdy degrees determinant distance dot equal exp exp2 faceforward findLSB findMSB floatBitsToInt floatBitsToUint floor fma fract frexp ftransform fwidth greaterThan greaterThanEqual imageAtomicAdd imageAtomicAnd imageAtomicCompSwap imageAtomicExchange imageAtomicMax imageAtomicMin imageAtomicOr imageAtomicXor imageLoad imageStore imulExtended intBitsToFloat interpolateAtCentroid interpolateAtOffset interpolateAtSample inverse inversesqrt isinf isnan ldexp length lessThan lessThanEqual log log2 matrixCompMult max memoryBarrier min mix mod modf noise1 noise2 noise3 noise4 normalize not notEqual outerProduct packDouble2x32 packHalf2x16 packSnorm2x16 packSnorm4x8 packUnorm2x16 packUnorm4x8 pow radians reflect refract round roundEven shadow1D shadow1DLod shadow1DProj shadow1DProjLod shadow2D shadow2DLod shadow2DProj shadow2DProjLod sign sin sinh smoothstep sqrt step tan tanh texelFetch texelFetchOffset texture texture1D texture1DLod texture1DProj texture1DProjLod texture2D texture2DLod texture2DProj texture2DProjLod texture3D texture3DLod texture3DProj texture3DProjLod textureCube textureCubeLod textureGather textureGatherOffset textureGatherOffsets textureGrad textureGradOffset textureLod textureLodOffset textureOffset textureProj textureProjGrad textureProjGradOffset textureProjLod textureProjLodOffset textureProjOffset textureQueryLod textureSize transpose trunc uaddCarry uintBitsToFloat umulExtended unpackDouble2x32 unpackHalf2x16 unpackSnorm2x16 unpackSnorm4x8 unpackUnorm2x16 unpackUnorm4x8 usubBorrow gl_TextureMatrix gl_TextureMatrixInverse",literal:"true false"},i:'"',c:[a.CLCM,a.CBCM,a.CNM,{cN:"preprocessor",b:"#",e:"$"}]}});hljs.registerLanguage("rsl",function(a){return{k:{keyword:"float color point normal vector matrix while for if do return else break extern continue",built_in:"abs acos ambient area asin atan atmosphere attribute calculatenormal ceil cellnoise clamp comp concat cos degrees depth Deriv diffuse distance Du Dv environment exp faceforward filterstep floor format fresnel incident length lightsource log match max min mod noise normalize ntransform opposite option phong pnoise pow printf ptlined radians random reflect refract renderinfo round setcomp setxcomp setycomp setzcomp shadow sign sin smoothstep specular specularbrdf spline sqrt step tan texture textureinfo trace transform vtransform xcomp ycomp zcomp"},i:"</",c:[a.CLCM,a.CBCM,a.QSM,a.ASM,a.CNM,{cN:"preprocessor",b:"#",e:"$"},{cN:"shader",bK:"surface displacement light volume imager",e:"\\("},{cN:"shading",bK:"illuminate illuminance gather",e:"\\("}]}});hljs.registerLanguage("lua",function(b){var a="\\[=*\\[";var e="\\]=*\\]";var c={b:a,e:e,c:["self"]};var d=[{cN:"comment",b:"--(?!"+a+")",e:"$"},{cN:"comment",b:"--"+a,e:e,c:[c],r:10}];return{l:b.UIR,k:{keyword:"and break do else elseif end false for if in local nil not or repeat return then true until while",built_in:"_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 debug io math os package string table"},c:d.concat([{cN:"function",bK:"function",e:"\\)",c:[b.inherit(b.TM,{b:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{cN:"params",b:"\\(",eW:true,c:d}].concat(d)},b.CNM,b.ASM,b.QSM,{cN:"string",b:a,e:e,c:[c],r:5}])}});hljs.registerLanguage("xml",function(a){var c="[A-Za-z0-9\\._:-]+";var d={b:/<\?(php)?(?!\w)/,e:/\?>/,sL:"php",subLanguageMode:"continuous"};var b={eW:true,i:/</,r:0,c:[d,{cN:"attribute",b:c,r:0},{b:"=",r:0,c:[{cN:"value",v:[{b:/"/,e:/"/},{b:/'/,e:/'/},{b:/[^\s\/>]+/}]}]}]};return{aliases:["html","xhtml","rss","atom","xsl","plist"],cI:true,c:[{cN:"doctype",b:"<!DOCTYPE",e:">",r:10,c:[{b:"\\[",e:"\\]"}]},{cN:"comment",b:"<!--",e:"-->",r:10},{cN:"cdata",b:"<\\!\\[CDATA\\[",e:"\\]\\]>",r:10},{cN:"tag",b:"<style(?=\\s|>|$)",e:">",k:{title:"style"},c:[b],starts:{e:"</style>",rE:true,sL:"css"}},{cN:"tag",b:"<script(?=\\s|>|$)",e:">",k:{title:"script"},c:[b],starts:{e:"<\/script>",rE:true,sL:"javascript"}},{b:"<%",e:"%>",sL:"vbscript"},d,{cN:"pi",b:/<\?\w+/,e:/\?>/,r:10},{cN:"tag",b:"</?",e:"/?>",c:[{cN:"title",b:"[^ /><]+",r:0},b]}]}});hljs.registerLanguage("markdown",function(a){return{aliases:["md","mkdown","mkd"],c:[{cN:"header",v:[{b:"^#{1,6}",e:"$"},{b:"^.+?\\n[=-]{2,}$"}]},{b:"<",e:">",sL:"xml",r:0},{cN:"bullet",b:"^([*+-]|(\\d+\\.))\\s+"},{cN:"strong",b:"[*_]{2}.+?[*_]{2}"},{cN:"emphasis",v:[{b:"\\*.+?\\*"},{b:"_.+?_",r:0}]},{cN:"blockquote",b:"^>\\s+",e:"$"},{cN:"code",v:[{b:"`.+?`"},{b:"^( {4}|\t)",e:"$",r:0}]},{cN:"horizontal_rule",b:"^[-\\*]{3,}",e:"$"},{b:"\\[.+?\\][\\(\\[].+?[\\)\\]]",rB:true,c:[{cN:"link_label",b:"\\[",e:"\\]",eB:true,rE:true,r:0},{cN:"link_url",b:"\\]\\(",e:"\\)",eB:true,eE:true},{cN:"link_reference",b:"\\]\\[",e:"\\]",eB:true,eE:true}],r:10},{b:"^\\[.+\\]:",e:"$",rB:true,c:[{cN:"link_reference",b:"\\[",e:"\\]",eB:true,eE:true},{cN:"link_url",b:"\\s",e:"$"}]}]}});hljs.registerLanguage("css",function(a){var b="[a-zA-Z-][a-zA-Z0-9_-]*";var c={cN:"function",b:b+"\\(",rB:true,eE:true,e:"\\("};return{cI:true,i:"[=/|']",c:[a.CBCM,{cN:"id",b:"\\#[A-Za-z0-9_-]+"},{cN:"class",b:"\\.[A-Za-z0-9_-]+",r:0},{cN:"attr_selector",b:"\\[",e:"\\]",i:"$"},{cN:"pseudo",b:":(:)?[a-zA-Z0-9\\_\\-\\+\\(\\)\\\"\\']+"},{cN:"at_rule",b:"@(font-face|page)",l:"[a-z-]+",k:"font-face page"},{cN:"at_rule",b:"@",e:"[{;]",c:[{cN:"keyword",b:/\S+/},{b:/\s/,eW:true,eE:true,r:0,c:[c,a.ASM,a.QSM,a.CSSNM]}]},{cN:"tag",b:b,r:0},{cN:"rules",b:"{",e:"}",i:"[^\\s]",r:0,c:[a.CBCM,{cN:"rule",b:"[^\\s]",rB:true,e:";",eW:true,c:[{cN:"attribute",b:"[A-Z\\_\\.\\-]+",e:":",eE:true,i:"[^\\s]",starts:{cN:"value",eW:true,eE:true,c:[c,a.CSSNM,a.QSM,a.ASM,a.CBCM,{cN:"hexcolor",b:"#[0-9A-Fa-f]+"},{cN:"important",b:"!important"}]}}]}]}]}});hljs.registerLanguage("capnproto",function(a){return{aliases:["capnp"],k:{keyword:"struct enum interface union group import using const annotation extends in of on as with from fixed",built_in:"Void Bool Int8 Int16 Int32 Int64 UInt8 UInt16 UInt32 UInt64 Float32 Float64 Text Data AnyPointer AnyStruct Capability List",literal:"true false"},c:[a.QSM,a.NM,a.HCM,{cN:"shebang",b:/@0x[\w\d]{16};/,i:/\n/},{cN:"number",b:/@\d+\b/},{cN:"class",bK:"struct enum",e:/\{/,i:/\n/,c:[a.inherit(a.TM,{starts:{eW:true,eE:true}})]},{cN:"class",bK:"interface",e:/\{/,i:/\n/,c:[a.inherit(a.TM,{starts:{eW:true,eE:true}})]}]}});hljs.registerLanguage("lisp",function(i){var l="[a-zA-Z_\\-\\+\\*\\/\\<\\=\\>\\&\\#][a-zA-Z0-9_\\-\\+\\*\\/\\<\\=\\>\\&\\#!]*";var m="(\\-|\\+)?\\d+(\\.\\d+|\\/\\d+)?((d|e|f|l|s)(\\+|\\-)?\\d+)?";var k={cN:"shebang",b:"^#!",e:"$"};var b={cN:"literal",b:"\\b(t{1}|nil)\\b"};var e={cN:"number",v:[{b:m,r:0},{b:"#b[0-1]+(/[0-1]+)?"},{b:"#o[0-7]+(/[0-7]+)?"},{b:"#x[0-9a-f]+(/[0-9a-f]+)?"},{b:"#c\\("+m+" +"+m,e:"\\)"}]};var h=i.inherit(i.QSM,{i:null});var n={cN:"comment",b:";",e:"$"};var g={cN:"variable",b:"\\*",e:"\\*"};var o={cN:"keyword",b:"[:&]"+l};var d={b:"\\(",e:"\\)",c:["self",b,h,e]};var a={cN:"quoted",c:[e,h,g,o,d],v:[{b:"['`]\\(",e:"\\)"},{b:"\\(quote ",e:"\\)",k:{title:"quote"}}]};var c={cN:"quoted",b:"'"+l};var j={cN:"list",b:"\\(",e:"\\)"};var f={eW:true,r:0};j.c=[{cN:"title",b:l},f];f.c=[a,c,j,b,e,h,n,g,o];return{i:/\S/,c:[e,k,b,h,n,a,c,j]}});hljs.registerLanguage("profile",function(a){return{c:[a.CNM,{cN:"built_in",b:"{",e:"}$",eB:true,eE:true,c:[a.ASM,a.QSM],r:0},{cN:"filename",b:"[a-zA-Z_][\\da-zA-Z_]+\\.[\\da-zA-Z_]{1,3}",e:":",eE:true},{cN:"header",b:"(ncalls|tottime|cumtime)",e:"$",k:"ncalls tottime|10 cumtime|10 filename",r:10},{cN:"summary",b:"function calls",e:"$",c:[a.CNM],r:10},a.ASM,a.QSM,{cN:"function",b:"\\(",e:"\\)$",c:[a.UTM],r:0}]}});hljs.registerLanguage("http",function(a){return{i:"\\S",c:[{cN:"status",b:"^HTTP/[0-9\\.]+",e:"$",c:[{cN:"number",b:"\\b\\d{3}\\b"}]},{cN:"request",b:"^[A-Z]+ (.*?) HTTP/[0-9\\.]+$",rB:true,e:"$",c:[{cN:"string",b:" ",e:" ",eB:true,eE:true}]},{cN:"attribute",b:"^\\w",e:": ",eE:true,i:"\\n|\\s|=",starts:{cN:"string",e:"$"}},{b:"\\n\\n",starts:{sL:"",eW:true}}]}});hljs.registerLanguage("java",function(b){var a="false synchronized int abstract float private char boolean static null if const for true while long throw strictfp finally protected import native final return void enum else break transient new catch instanceof byte super volatile case assert short package default double public try this switch continue throws";return{aliases:["jsp"],k:a,i:/<\//,c:[{cN:"javadoc",b:"/\\*\\*",e:"\\*/",c:[{cN:"javadoctag",b:"(^|\\s)@[A-Za-z]+"}],r:10},b.CLCM,b.CBCM,b.ASM,b.QSM,{bK:"protected public private",e:/[{;=]/,k:a,c:[{cN:"class",bK:"class interface",eW:true,eE:true,i:/[:"\[\]]/,c:[{bK:"extends implements",r:10},b.UTM]},{b:b.UIR+"\\s*\\(",rB:true,c:[b.UTM]}]},b.CNM,{cN:"annotation",b:"@[A-Za-z]+"}]}});hljs.registerLanguage("gherkin",function(a){return{k:"Feature Background Ability Business Need Scenario Scenarios Scenario Outline Scenario Template Examples Given And Then But When",c:[{cN:"keyword",b:"\\*"},{cN:"comment",b:"@[^@\r\n\t ]+",e:"$"},{cN:"string",b:"\\|",e:"\\$"},{cN:"variable",b:"<",e:">",},a.HCM,{cN:"string",b:'"""',e:'"""'},a.QSM]}});hljs.registerLanguage("fsharp",function(a){return{aliases:["fs"],k:"abstract and as assert base begin class default delegate do done downcast downto elif else end exception extern false finally for fun function global if in inherit inline interface internal lazy let match member module mutable namespace new null of open or override private public rec return sig static struct then to true try type upcast use val void when while with yield",c:[{cN:"string",b:'@"',e:'"',c:[{b:'""'}]},{cN:"string",b:'"""',e:'"""'},{cN:"comment",b:"\\(\\*",e:"\\*\\)"},{cN:"class",bK:"type",e:"\\(|=|$",eE:true,c:[a.UTM]},{cN:"annotation",b:"\\[<",e:">\\]"},{cN:"attribute",b:"\\B('[A-Za-z])\\b",c:[a.BE]},a.CLCM,a.inherit(a.QSM,{i:null}),a.CNM]}});hljs.registerLanguage("mathematica",function(a){return{aliases:["mma"],l:"(\\$|\\b)"+a.IR+"\\b",k:"AbelianGroup Abort AbortKernels AbortProtect Above Abs Absolute AbsoluteCorrelation AbsoluteCorrelationFunction AbsoluteCurrentValue AbsoluteDashing AbsoluteFileName AbsoluteOptions AbsolutePointSize AbsoluteThickness AbsoluteTime AbsoluteTiming AccountingForm Accumulate Accuracy AccuracyGoal ActionDelay ActionMenu ActionMenuBox ActionMenuBoxOptions Active ActiveItem ActiveStyle AcyclicGraphQ AddOnHelpPath AddTo AdjacencyGraph AdjacencyList AdjacencyMatrix AdjustmentBox AdjustmentBoxOptions AdjustTimeSeriesForecast AffineTransform After AiryAi AiryAiPrime AiryAiZero AiryBi AiryBiPrime AiryBiZero AlgebraicIntegerQ AlgebraicNumber AlgebraicNumberDenominator AlgebraicNumberNorm AlgebraicNumberPolynomial AlgebraicNumberTrace AlgebraicRules AlgebraicRulesData Algebraics AlgebraicUnitQ Alignment AlignmentMarker AlignmentPoint All AllowedDimensions AllowGroupClose AllowInlineCells AllowKernelInitialization AllowReverseGroupClose AllowScriptLevelChange AlphaChannel AlternatingGroup AlternativeHypothesis Alternatives AmbientLight Analytic AnchoredSearch And AndersonDarlingTest AngerJ AngleBracket AngularGauge Animate AnimationCycleOffset AnimationCycleRepetitions AnimationDirection AnimationDisplayTime AnimationRate AnimationRepetitions AnimationRunning Animator AnimatorBox AnimatorBoxOptions AnimatorElements Annotation Annuity AnnuityDue Antialiasing Antisymmetric Apart ApartSquareFree Appearance AppearanceElements AppellF1 Append AppendTo Apply ArcCos ArcCosh ArcCot ArcCoth ArcCsc ArcCsch ArcSec ArcSech ArcSin ArcSinDistribution ArcSinh ArcTan ArcTanh Arg ArgMax ArgMin ArgumentCountQ ARIMAProcess ArithmeticGeometricMean ARMAProcess ARProcess Array ArrayComponents ArrayDepth ArrayFlatten ArrayPad ArrayPlot ArrayQ ArrayReshape ArrayRules Arrays Arrow Arrow3DBox ArrowBox Arrowheads AspectRatio AspectRatioFixed Assert Assuming Assumptions AstronomicalData Asynchronous AsynchronousTaskObject AsynchronousTasks AtomQ Attributes AugmentedSymmetricPolynomial AutoAction AutoDelete AutoEvaluateEvents AutoGeneratedPackage AutoIndent AutoIndentSpacings AutoItalicWords AutoloadPath AutoMatch Automatic AutomaticImageSize AutoMultiplicationSymbol AutoNumberFormatting AutoOpenNotebooks AutoOpenPalettes AutorunSequencing AutoScaling AutoScroll AutoSpacing AutoStyleOptions AutoStyleWords Axes AxesEdge AxesLabel AxesOrigin AxesStyle Axis BabyMonsterGroupB Back Background BackgroundTasksSettings Backslash Backsubstitution Backward Band BandpassFilter BandstopFilter BarabasiAlbertGraphDistribution BarChart BarChart3D BarLegend BarlowProschanImportance BarnesG BarOrigin BarSpacing BartlettHannWindow BartlettWindow BaseForm Baseline BaselinePosition BaseStyle BatesDistribution BattleLemarieWavelet Because BeckmannDistribution Beep Before Begin BeginDialogPacket BeginFrontEndInteractionPacket BeginPackage BellB BellY Below BenfordDistribution BeniniDistribution BenktanderGibratDistribution BenktanderWeibullDistribution BernoulliB BernoulliDistribution BernoulliGraphDistribution BernoulliProcess BernsteinBasis BesselFilterModel BesselI BesselJ BesselJZero BesselK BesselY BesselYZero Beta BetaBinomialDistribution BetaDistribution BetaNegativeBinomialDistribution BetaPrimeDistribution BetaRegularized BetweennessCentrality BezierCurve BezierCurve3DBox BezierCurve3DBoxOptions BezierCurveBox BezierCurveBoxOptions BezierFunction BilateralFilter Binarize BinaryFormat BinaryImageQ BinaryRead BinaryReadList BinaryWrite BinCounts BinLists Binomial BinomialDistribution BinomialProcess BinormalDistribution BiorthogonalSplineWavelet BipartiteGraphQ BirnbaumImportance BirnbaumSaundersDistribution BitAnd BitClear BitGet BitLength BitNot BitOr BitSet BitShiftLeft BitShiftRight BitXor Black BlackmanHarrisWindow BlackmanNuttallWindow BlackmanWindow Blank BlankForm BlankNullSequence BlankSequence Blend Block BlockRandom BlomqvistBeta BlomqvistBetaTest Blue Blur BodePlot BohmanWindow Bold Bookmarks Boole BooleanConsecutiveFunction BooleanConvert BooleanCountingFunction BooleanFunction BooleanGraph BooleanMaxterms BooleanMinimize BooleanMinterms Booleans BooleanTable BooleanVariables BorderDimensions BorelTannerDistribution Bottom BottomHatTransform BoundaryStyle Bounds Box BoxBaselineShift BoxData BoxDimensions Boxed Boxes BoxForm BoxFormFormatTypes BoxFrame BoxID BoxMargins BoxMatrix BoxRatios BoxRotation BoxRotationPoint BoxStyle BoxWhiskerChart Bra BracketingBar BraKet BrayCurtisDistance BreadthFirstScan Break Brown BrownForsytheTest BrownianBridgeProcess BrowserCategory BSplineBasis BSplineCurve BSplineCurve3DBox BSplineCurveBox BSplineCurveBoxOptions BSplineFunction BSplineSurface BSplineSurface3DBox BubbleChart BubbleChart3D BubbleScale BubbleSizes BulletGauge BusinessDayQ ButterflyGraph ButterworthFilterModel Button ButtonBar ButtonBox ButtonBoxOptions ButtonCell ButtonContents ButtonData ButtonEvaluator ButtonExpandable ButtonFrame ButtonFunction ButtonMargins ButtonMinHeight ButtonNote ButtonNotebook ButtonSource ButtonStyle ButtonStyleMenuListing Byte ByteCount ByteOrdering C CachedValue CacheGraphics CalendarData CalendarType CallPacket CanberraDistance Cancel CancelButton CandlestickChart Cap CapForm CapitalDifferentialD CardinalBSplineBasis CarmichaelLambda Cases Cashflow Casoratian Catalan CatalanNumber Catch CauchyDistribution CauchyWindow CayleyGraph CDF CDFDeploy CDFInformation CDFWavelet Ceiling Cell CellAutoOverwrite CellBaseline CellBoundingBox CellBracketOptions CellChangeTimes CellContents CellContext CellDingbat CellDynamicExpression CellEditDuplicate CellElementsBoundingBox CellElementSpacings CellEpilog CellEvaluationDuplicate CellEvaluationFunction CellEventActions CellFrame CellFrameColor CellFrameLabelMargins CellFrameLabels CellFrameMargins CellGroup CellGroupData CellGrouping CellGroupingRules CellHorizontalScrolling CellID CellLabel CellLabelAutoDelete CellLabelMargins CellLabelPositioning CellMargins CellObject CellOpen CellPrint CellProlog Cells CellSize CellStyle CellTags CellularAutomaton CensoredDistribution Censoring Center CenterDot CentralMoment CentralMomentGeneratingFunction CForm ChampernowneNumber ChanVeseBinarize Character CharacterEncoding CharacterEncodingsPath CharacteristicFunction CharacteristicPolynomial CharacterRange Characters ChartBaseStyle ChartElementData ChartElementDataFunction ChartElementFunction ChartElements ChartLabels ChartLayout ChartLegends ChartStyle Chebyshev1FilterModel Chebyshev2FilterModel ChebyshevDistance ChebyshevT ChebyshevU Check CheckAbort CheckAll Checkbox CheckboxBar CheckboxBox CheckboxBoxOptions ChemicalData ChessboardDistance ChiDistribution ChineseRemainder ChiSquareDistribution ChoiceButtons ChoiceDialog CholeskyDecomposition Chop Circle CircleBox CircleDot CircleMinus CirclePlus CircleTimes CirculantGraph CityData Clear ClearAll ClearAttributes ClearSystemCache ClebschGordan ClickPane Clip ClipboardNotebook ClipFill ClippingStyle ClipPlanes ClipRange Clock ClockGauge ClockwiseContourIntegral Close Closed CloseKernels ClosenessCentrality Closing ClosingAutoSave ClosingEvent ClusteringComponents CMYKColor Coarse Coefficient CoefficientArrays CoefficientDomain CoefficientList CoefficientRules CoifletWavelet Collect Colon ColonForm ColorCombine ColorConvert ColorData ColorDataFunction ColorFunction ColorFunctionScaling Colorize ColorNegate ColorOutput ColorProfileData ColorQuantize ColorReplace ColorRules ColorSelectorSettings ColorSeparate ColorSetter ColorSetterBox ColorSetterBoxOptions ColorSlider ColorSpace Column ColumnAlignments ColumnBackgrounds ColumnForm ColumnLines ColumnsEqual ColumnSpacings ColumnWidths CommonDefaultFormatTypes Commonest CommonestFilter CommonUnits CommunityBoundaryStyle CommunityGraphPlot CommunityLabels CommunityRegionStyle CompatibleUnitQ CompilationOptions CompilationTarget Compile Compiled CompiledFunction Complement CompleteGraph CompleteGraphQ CompleteKaryTree CompletionsListPacket Complex Complexes ComplexExpand ComplexInfinity ComplexityFunction ComponentMeasurements ComponentwiseContextMenu Compose ComposeList ComposeSeries Composition CompoundExpression CompoundPoissonDistribution CompoundPoissonProcess CompoundRenewalProcess Compress CompressedData Condition ConditionalExpression Conditioned Cone ConeBox ConfidenceLevel ConfidenceRange ConfidenceTransform ConfigurationPath Congruent Conjugate ConjugateTranspose Conjunction Connect ConnectedComponents ConnectedGraphQ ConnesWindow ConoverTest ConsoleMessage ConsoleMessagePacket ConsolePrint Constant ConstantArray Constants ConstrainedMax ConstrainedMin ContentPadding ContentsBoundingBox ContentSelectable ContentSize Context ContextMenu Contexts ContextToFilename ContextToFileName Continuation Continue ContinuedFraction ContinuedFractionK ContinuousAction ContinuousMarkovProcess ContinuousTimeModelQ ContinuousWaveletData ContinuousWaveletTransform ContourDetect ContourGraphics ContourIntegral ContourLabels ContourLines ContourPlot ContourPlot3D Contours ContourShading ContourSmoothing ContourStyle ContraharmonicMean Control ControlActive ControlAlignment ControllabilityGramian ControllabilityMatrix ControllableDecomposition ControllableModelQ ControllerDuration ControllerInformation ControllerInformationData ControllerLinking ControllerManipulate ControllerMethod ControllerPath ControllerState ControlPlacement ControlsRendering ControlType Convergents ConversionOptions ConversionRules ConvertToBitmapPacket ConvertToPostScript ConvertToPostScriptPacket Convolve ConwayGroupCo1 ConwayGroupCo2 ConwayGroupCo3 CoordinateChartData CoordinatesToolOptions CoordinateTransform CoordinateTransformData CoprimeQ Coproduct CopulaDistribution Copyable CopyDirectory CopyFile CopyTag CopyToClipboard CornerFilter CornerNeighbors Correlation CorrelationDistance CorrelationFunction CorrelationTest Cos Cosh CoshIntegral CosineDistance CosineWindow CosIntegral Cot Coth Count CounterAssignments CounterBox CounterBoxOptions CounterClockwiseContourIntegral CounterEvaluator CounterFunction CounterIncrements CounterStyle CounterStyleMenuListing CountRoots CountryData Covariance CovarianceEstimatorFunction CovarianceFunction CoxianDistribution CoxIngersollRossProcess CoxModel CoxModelFit CramerVonMisesTest CreateArchive CreateDialog CreateDirectory CreateDocument CreateIntermediateDirectories CreatePalette CreatePalettePacket CreateScheduledTask CreateTemporary CreateWindow CriticalityFailureImportance CriticalitySuccessImportance CriticalSection Cross CrossingDetect CrossMatrix Csc Csch CubeRoot Cubics Cuboid CuboidBox Cumulant CumulantGeneratingFunction Cup CupCap Curl CurlyDoubleQuote CurlyQuote CurrentImage CurrentlySpeakingPacket CurrentValue CurvatureFlowFilter CurveClosed Cyan CycleGraph CycleIndexPolynomial Cycles CyclicGroup Cyclotomic Cylinder CylinderBox CylindricalDecomposition D DagumDistribution DamerauLevenshteinDistance DampingFactor Darker Dashed Dashing DataCompression DataDistribution DataRange DataReversed Date DateDelimiters DateDifference DateFunction DateList DateListLogPlot DateListPlot DatePattern DatePlus DateRange DateString DateTicksFormat DaubechiesWavelet DavisDistribution DawsonF DayCount DayCountConvention DayMatchQ DayName DayPlus DayRange DayRound DeBruijnGraph Debug DebugTag Decimal DeclareKnownSymbols DeclarePackage Decompose Decrement DedekindEta Default DefaultAxesStyle DefaultBaseStyle DefaultBoxStyle DefaultButton DefaultColor DefaultControlPlacement DefaultDuplicateCellStyle DefaultDuration DefaultElement DefaultFaceGridsStyle DefaultFieldHintStyle DefaultFont DefaultFontProperties DefaultFormatType DefaultFormatTypeForStyle DefaultFrameStyle DefaultFrameTicksStyle DefaultGridLinesStyle DefaultInlineFormatType DefaultInputFormatType DefaultLabelStyle DefaultMenuStyle DefaultNaturalLanguage DefaultNewCellStyle DefaultNewInlineCellStyle DefaultNotebook DefaultOptions DefaultOutputFormatType DefaultStyle DefaultStyleDefinitions DefaultTextFormatType DefaultTextInlineFormatType DefaultTicksStyle DefaultTooltipStyle DefaultValues Defer DefineExternal DefineInputStreamMethod DefineOutputStreamMethod Definition Degree DegreeCentrality DegreeGraphDistribution DegreeLexicographic DegreeReverseLexicographic Deinitialization Del Deletable Delete DeleteBorderComponents DeleteCases DeleteContents DeleteDirectory DeleteDuplicates DeleteFile DeleteSmallComponents DeleteWithContents DeletionWarning Delimiter DelimiterFlashTime DelimiterMatching Delimiters Denominator DensityGraphics DensityHistogram DensityPlot DependentVariables Deploy Deployed Depth DepthFirstScan Derivative DerivativeFilter DescriptorStateSpace DesignMatrix Det DGaussianWavelet DiacriticalPositioning Diagonal DiagonalMatrix Dialog DialogIndent DialogInput DialogLevel DialogNotebook DialogProlog DialogReturn DialogSymbols Diamond DiamondMatrix DiceDissimilarity DictionaryLookup DifferenceDelta DifferenceOrder DifferenceRoot DifferenceRootReduce Differences DifferentialD DifferentialRoot DifferentialRootReduce DifferentiatorFilter DigitBlock DigitBlockMinimum DigitCharacter DigitCount DigitQ DihedralGroup Dilation Dimensions DiracComb DiracDelta DirectedEdge DirectedEdges DirectedGraph DirectedGraphQ DirectedInfinity Direction Directive Directory DirectoryName DirectoryQ DirectoryStack DirichletCharacter DirichletConvolve DirichletDistribution DirichletL DirichletTransform DirichletWindow DisableConsolePrintPacket DiscreteChirpZTransform DiscreteConvolve DiscreteDelta DiscreteHadamardTransform DiscreteIndicator DiscreteLQEstimatorGains DiscreteLQRegulatorGains DiscreteLyapunovSolve DiscreteMarkovProcess DiscretePlot DiscretePlot3D DiscreteRatio DiscreteRiccatiSolve DiscreteShift DiscreteTimeModelQ DiscreteUniformDistribution DiscreteVariables DiscreteWaveletData DiscreteWaveletPacketTransform DiscreteWaveletTransform Discriminant Disjunction Disk DiskBox DiskMatrix Dispatch DispersionEstimatorFunction Display DisplayAllSteps DisplayEndPacket DisplayFlushImagePacket DisplayForm DisplayFunction DisplayPacket DisplayRules DisplaySetSizePacket DisplayString DisplayTemporary DisplayWith DisplayWithRef DisplayWithVariable DistanceFunction DistanceTransform Distribute Distributed DistributedContexts DistributeDefinitions DistributionChart DistributionDomain DistributionFitTest DistributionParameterAssumptions DistributionParameterQ Dithering Div Divergence Divide DivideBy Dividers Divisible Divisors DivisorSigma DivisorSum DMSList DMSString Do DockedCells DocumentNotebook DominantColors DOSTextFormat Dot DotDashed DotEqual Dotted DoubleBracketingBar DoubleContourIntegral DoubleDownArrow DoubleLeftArrow DoubleLeftRightArrow DoubleLeftTee DoubleLongLeftArrow DoubleLongLeftRightArrow DoubleLongRightArrow DoubleRightArrow DoubleRightTee DoubleUpArrow DoubleUpDownArrow DoubleVerticalBar DoublyInfinite Down DownArrow DownArrowBar DownArrowUpArrow DownLeftRightVector DownLeftTeeVector DownLeftVector DownLeftVectorBar DownRightTeeVector DownRightVector DownRightVectorBar Downsample DownTee DownTeeArrow DownValues DragAndDrop DrawEdges DrawFrontFaces DrawHighlighted Drop DSolve Dt DualLinearProgramming DualSystemsModel DumpGet DumpSave DuplicateFreeQ Dynamic DynamicBox DynamicBoxOptions DynamicEvaluationTimeout DynamicLocation DynamicModule DynamicModuleBox DynamicModuleBoxOptions DynamicModuleParent DynamicModuleValues DynamicName DynamicNamespace DynamicReference DynamicSetting DynamicUpdating DynamicWrapper DynamicWrapperBox DynamicWrapperBoxOptions E EccentricityCentrality EdgeAdd EdgeBetweennessCentrality EdgeCapacity EdgeCapForm EdgeColor EdgeConnectivity EdgeCost EdgeCount EdgeCoverQ EdgeDashing EdgeDelete EdgeDetect EdgeForm EdgeIndex EdgeJoinForm EdgeLabeling EdgeLabels EdgeLabelStyle EdgeList EdgeOpacity EdgeQ EdgeRenderingFunction EdgeRules EdgeShapeFunction EdgeStyle EdgeThickness EdgeWeight Editable EditButtonSettings EditCellTagsSettings EditDistance EffectiveInterest Eigensystem Eigenvalues EigenvectorCentrality Eigenvectors Element ElementData Eliminate EliminationOrder EllipticE EllipticExp EllipticExpPrime EllipticF EllipticFilterModel EllipticK EllipticLog EllipticNomeQ EllipticPi EllipticReducedHalfPeriods EllipticTheta EllipticThetaPrime EmitSound EmphasizeSyntaxErrors EmpiricalDistribution Empty EmptyGraphQ EnableConsolePrintPacket Enabled Encode End EndAdd EndDialogPacket EndFrontEndInteractionPacket EndOfFile EndOfLine EndOfString EndPackage EngineeringForm Enter EnterExpressionPacket EnterTextPacket Entropy EntropyFilter Environment Epilog Equal EqualColumns EqualRows EqualTilde EquatedTo Equilibrium EquirippleFilterKernel Equivalent Erf Erfc Erfi ErlangB ErlangC ErlangDistribution Erosion ErrorBox ErrorBoxOptions ErrorNorm ErrorPacket ErrorsDialogSettings EstimatedDistribution EstimatedProcess EstimatorGains EstimatorRegulator EuclideanDistance EulerE EulerGamma EulerianGraphQ EulerPhi Evaluatable Evaluate Evaluated EvaluatePacket EvaluationCell EvaluationCompletionAction EvaluationElements EvaluationMode EvaluationMonitor EvaluationNotebook EvaluationObject EvaluationOrder Evaluator EvaluatorNames EvenQ EventData EventEvaluator EventHandler EventHandlerTag EventLabels ExactBlackmanWindow ExactNumberQ ExactRootIsolation ExampleData Except ExcludedForms ExcludePods Exclusions ExclusionsStyle Exists Exit ExitDialog Exp Expand ExpandAll ExpandDenominator ExpandFileName ExpandNumerator Expectation ExpectationE ExpectedValue ExpGammaDistribution ExpIntegralE ExpIntegralEi Exponent ExponentFunction ExponentialDistribution ExponentialFamily ExponentialGeneratingFunction ExponentialMovingAverage ExponentialPowerDistribution ExponentPosition ExponentStep Export ExportAutoReplacements ExportPacket ExportString Expression ExpressionCell ExpressionPacket ExpToTrig ExtendedGCD Extension ExtentElementFunction ExtentMarkers ExtentSize ExternalCall ExternalDataCharacterEncoding Extract ExtractArchive ExtremeValueDistribution FaceForm FaceGrids FaceGridsStyle Factor FactorComplete Factorial Factorial2 FactorialMoment FactorialMomentGeneratingFunction FactorialPower FactorInteger FactorList FactorSquareFree FactorSquareFreeList FactorTerms FactorTermsList Fail FailureDistribution False FARIMAProcess FEDisableConsolePrintPacket FeedbackSector FeedbackSectorStyle FeedbackType FEEnableConsolePrintPacket Fibonacci FieldHint FieldHintStyle FieldMasked FieldSize File FileBaseName FileByteCount FileDate FileExistsQ FileExtension FileFormat FileHash FileInformation FileName FileNameDepth FileNameDialogSettings FileNameDrop FileNameJoin FileNames FileNameSetter FileNameSplit FileNameTake FilePrint FileType FilledCurve FilledCurveBox Filling FillingStyle FillingTransform FilterRules FinancialBond FinancialData FinancialDerivative FinancialIndicator Find FindArgMax FindArgMin FindClique FindClusters FindCurvePath FindDistributionParameters FindDivisions FindEdgeCover FindEdgeCut FindEulerianCycle FindFaces FindFile FindFit FindGeneratingFunction FindGeoLocation FindGeometricTransform FindGraphCommunities FindGraphIsomorphism FindGraphPartition FindHamiltonianCycle FindIndependentEdgeSet FindIndependentVertexSet FindInstance FindIntegerNullVector FindKClan FindKClique FindKClub FindKPlex FindLibrary FindLinearRecurrence FindList FindMaximum FindMaximumFlow FindMaxValue FindMinimum FindMinimumCostFlow FindMinimumCut FindMinValue FindPermutation FindPostmanTour FindProcessParameters FindRoot FindSequenceFunction FindSettings FindShortestPath FindShortestTour FindThreshold FindVertexCover FindVertexCut Fine FinishDynamic FiniteAbelianGroupCount FiniteGroupCount FiniteGroupData First FirstPassageTimeDistribution FischerGroupFi22 FischerGroupFi23 FischerGroupFi24Prime FisherHypergeometricDistribution FisherRatioTest FisherZDistribution Fit FitAll FittedModel FixedPoint FixedPointList FlashSelection Flat Flatten FlattenAt FlatTopWindow FlipView Floor FlushPrintOutputPacket Fold FoldList Font FontColor FontFamily FontForm FontName FontOpacity FontPostScriptName FontProperties FontReencoding FontSize FontSlant FontSubstitutions FontTracking FontVariations FontWeight For ForAll Format FormatRules FormatType FormatTypeAutoConvert FormatValues FormBox FormBoxOptions FortranForm Forward ForwardBackward Fourier FourierCoefficient FourierCosCoefficient FourierCosSeries FourierCosTransform FourierDCT FourierDCTFilter FourierDCTMatrix FourierDST FourierDSTMatrix FourierMatrix FourierParameters FourierSequenceTransform FourierSeries FourierSinCoefficient FourierSinSeries FourierSinTransform FourierTransform FourierTrigSeries FractionalBrownianMotionProcess FractionalPart FractionBox FractionBoxOptions FractionLine Frame FrameBox FrameBoxOptions Framed FrameInset FrameLabel Frameless FrameMargins FrameStyle FrameTicks FrameTicksStyle FRatioDistribution FrechetDistribution FreeQ FrequencySamplingFilterKernel FresnelC FresnelS Friday FrobeniusNumber FrobeniusSolve FromCharacterCode FromCoefficientRules FromContinuedFraction FromDate FromDigits FromDMS Front FrontEndDynamicExpression FrontEndEventActions FrontEndExecute FrontEndObject FrontEndResource FrontEndResourceString FrontEndStackSize FrontEndToken FrontEndTokenExecute FrontEndValueCache FrontEndVersion FrontFaceColor FrontFaceOpacity Full FullAxes FullDefinition FullForm FullGraphics FullOptions FullSimplify Function FunctionExpand FunctionInterpolation FunctionSpace FussellVeselyImportance GaborFilter GaborMatrix GaborWavelet GainMargins GainPhaseMargins Gamma GammaDistribution GammaRegularized GapPenalty Gather GatherBy GaugeFaceElementFunction GaugeFaceStyle GaugeFrameElementFunction GaugeFrameSize GaugeFrameStyle GaugeLabels GaugeMarkers GaugeStyle GaussianFilter GaussianIntegers GaussianMatrix GaussianWindow GCD GegenbauerC General GeneralizedLinearModelFit GenerateConditions GeneratedCell GeneratedParameters GeneratingFunction Generic GenericCylindricalDecomposition GenomeData GenomeLookup GeodesicClosing GeodesicDilation GeodesicErosion GeodesicOpening GeoDestination GeodesyData GeoDirection GeoDistance GeoGridPosition GeometricBrownianMotionProcess GeometricDistribution GeometricMean GeometricMeanFilter GeometricTransformation GeometricTransformation3DBox GeometricTransformation3DBoxOptions GeometricTransformationBox GeometricTransformationBoxOptions GeoPosition GeoPositionENU GeoPositionXYZ GeoProjectionData GestureHandler GestureHandlerTag Get GetBoundingBoxSizePacket GetContext GetEnvironment GetFileName GetFrontEndOptionsDataPacket GetLinebreakInformationPacket GetMenusPacket GetPageBreakInformationPacket Glaisher GlobalClusteringCoefficient GlobalPreferences GlobalSession Glow GoldenRatio GompertzMakehamDistribution GoodmanKruskalGamma GoodmanKruskalGammaTest Goto Grad Gradient GradientFilter GradientOrientationFilter Graph GraphAssortativity GraphCenter GraphComplement GraphData GraphDensity GraphDiameter GraphDifference GraphDisjointUnion GraphDistance GraphDistanceMatrix GraphElementData GraphEmbedding GraphHighlight GraphHighlightStyle GraphHub Graphics Graphics3D Graphics3DBox Graphics3DBoxOptions GraphicsArray GraphicsBaseline GraphicsBox GraphicsBoxOptions GraphicsColor GraphicsColumn GraphicsComplex GraphicsComplex3DBox GraphicsComplex3DBoxOptions GraphicsComplexBox GraphicsComplexBoxOptions GraphicsContents GraphicsData GraphicsGrid GraphicsGridBox GraphicsGroup GraphicsGroup3DBox GraphicsGroup3DBoxOptions GraphicsGroupBox GraphicsGroupBoxOptions GraphicsGrouping GraphicsHighlightColor GraphicsRow GraphicsSpacing GraphicsStyle GraphIntersection GraphLayout GraphLinkEfficiency GraphPeriphery GraphPlot GraphPlot3D GraphPower GraphPropertyDistribution GraphQ GraphRadius GraphReciprocity GraphRoot GraphStyle GraphUnion Gray GrayLevel GreatCircleDistance Greater GreaterEqual GreaterEqualLess GreaterFullEqual GreaterGreater GreaterLess GreaterSlantEqual GreaterTilde Green Grid GridBaseline GridBox GridBoxAlignment GridBoxBackground GridBoxDividers GridBoxFrame GridBoxItemSize GridBoxItemStyle GridBoxOptions GridBoxSpacings GridCreationSettings GridDefaultElement GridElementStyleOptions GridFrame GridFrameMargins GridGraph GridLines GridLinesStyle GroebnerBasis GroupActionBase GroupCentralizer GroupElementFromWord GroupElementPosition GroupElementQ GroupElements GroupElementToWord GroupGenerators GroupMultiplicationTable GroupOrbits GroupOrder GroupPageBreakWithin GroupSetwiseStabilizer GroupStabilizer GroupStabilizerChain Gudermannian GumbelDistribution HaarWavelet HadamardMatrix HalfNormalDistribution HamiltonianGraphQ HammingDistance HammingWindow HankelH1 HankelH2 HankelMatrix HannPoissonWindow HannWindow HaradaNortonGroupHN HararyGraph HarmonicMean HarmonicMeanFilter HarmonicNumber Hash HashTable Haversine HazardFunction Head HeadCompose Heads HeavisideLambda HeavisidePi HeavisideTheta HeldGroupHe HeldPart HelpBrowserLookup HelpBrowserNotebook HelpBrowserSettings HermiteDecomposition HermiteH HermitianMatrixQ HessenbergDecomposition Hessian HexadecimalCharacter Hexahedron HexahedronBox HexahedronBoxOptions HiddenSurface HighlightGraph HighlightImage HighpassFilter HigmanSimsGroupHS HilbertFilter HilbertMatrix Histogram Histogram3D HistogramDistribution HistogramList HistogramTransform HistogramTransformInterpolation HitMissTransform HITSCentrality HodgeDual HoeffdingD HoeffdingDTest Hold HoldAll HoldAllComplete HoldComplete HoldFirst HoldForm HoldPattern HoldRest HolidayCalendar HomeDirectory HomePage Horizontal HorizontalForm HorizontalGauge HorizontalScrollPosition HornerForm HotellingTSquareDistribution HoytDistribution HTMLSave Hue HumpDownHump HumpEqual HurwitzLerchPhi HurwitzZeta HyperbolicDistribution HypercubeGraph HyperexponentialDistribution Hyperfactorial Hypergeometric0F1 Hypergeometric0F1Regularized Hypergeometric1F1 Hypergeometric1F1Regularized Hypergeometric2F1 Hypergeometric2F1Regularized HypergeometricDistribution HypergeometricPFQ HypergeometricPFQRegularized HypergeometricU Hyperlink HyperlinkCreationSettings Hyphenation HyphenationOptions HypoexponentialDistribution HypothesisTestData I Identity IdentityMatrix If IgnoreCase Im Image Image3D Image3DSlices ImageAccumulate ImageAdd ImageAdjust ImageAlign ImageApply ImageAspectRatio ImageAssemble ImageCache ImageCacheValid ImageCapture ImageChannels ImageClip ImageColorSpace ImageCompose ImageConvolve ImageCooccurrence ImageCorners ImageCorrelate ImageCorrespondingPoints ImageCrop ImageData ImageDataPacket ImageDeconvolve ImageDemosaic ImageDifference ImageDimensions ImageDistance ImageEffect ImageFeatureTrack ImageFileApply ImageFileFilter ImageFileScan ImageFilter ImageForestingComponents ImageForwardTransformation ImageHistogram ImageKeypoints ImageLevels ImageLines ImageMargins ImageMarkers ImageMeasurements ImageMultiply ImageOffset ImagePad ImagePadding ImagePartition ImagePeriodogram ImagePerspectiveTransformation ImageQ ImageRangeCache ImageReflect ImageRegion ImageResize ImageResolution ImageRotate ImageRotated ImageScaled ImageScan ImageSize ImageSizeAction ImageSizeCache ImageSizeMultipliers ImageSizeRaw ImageSubtract ImageTake ImageTransformation ImageTrim ImageType ImageValue ImageValuePositions Implies Import ImportAutoReplacements ImportString ImprovementImportance In IncidenceGraph IncidenceList IncidenceMatrix IncludeConstantBasis IncludeFileExtension IncludePods IncludeSingularTerm Increment Indent IndentingNewlineSpacings IndentMaxFraction IndependenceTest IndependentEdgeSetQ IndependentUnit IndependentVertexSetQ Indeterminate IndexCreationOptions Indexed IndexGraph IndexTag Inequality InexactNumberQ InexactNumbers Infinity Infix Information Inherited InheritScope Initialization InitializationCell InitializationCellEvaluation InitializationCellWarning InlineCounterAssignments InlineCounterIncrements InlineRules Inner Inpaint Input InputAliases InputAssumptions InputAutoReplacements InputField InputFieldBox InputFieldBoxOptions InputForm InputGrouping InputNamePacket InputNotebook InputPacket InputSettings InputStream InputString InputStringPacket InputToBoxFormPacket Insert InsertionPointObject InsertResults Inset Inset3DBox Inset3DBoxOptions InsetBox InsetBoxOptions Install InstallService InString Integer IntegerDigits IntegerExponent IntegerLength IntegerPart IntegerPartitions IntegerQ Integers IntegerString Integral Integrate Interactive InteractiveTradingChart Interlaced Interleaving InternallyBalancedDecomposition InterpolatingFunction InterpolatingPolynomial Interpolation InterpolationOrder InterpolationPoints InterpolationPrecision Interpretation InterpretationBox InterpretationBoxOptions InterpretationFunction InterpretTemplate InterquartileRange Interrupt InterruptSettings Intersection Interval IntervalIntersection IntervalMemberQ IntervalUnion Inverse InverseBetaRegularized InverseCDF InverseChiSquareDistribution InverseContinuousWaveletTransform InverseDistanceTransform InverseEllipticNomeQ InverseErf InverseErfc InverseFourier InverseFourierCosTransform InverseFourierSequenceTransform InverseFourierSinTransform InverseFourierTransform InverseFunction InverseFunctions InverseGammaDistribution InverseGammaRegularized InverseGaussianDistribution InverseGudermannian InverseHaversine InverseJacobiCD InverseJacobiCN InverseJacobiCS InverseJacobiDC InverseJacobiDN InverseJacobiDS InverseJacobiNC InverseJacobiND InverseJacobiNS InverseJacobiSC InverseJacobiSD InverseJacobiSN InverseLaplaceTransform InversePermutation InverseRadon InverseSeries InverseSurvivalFunction InverseWaveletTransform InverseWeierstrassP InverseZTransform Invisible InvisibleApplication InvisibleTimes IrreduciblePolynomialQ IsolatingInterval IsomorphicGraphQ IsotopeData Italic Item ItemBox ItemBoxOptions ItemSize ItemStyle ItoProcess JaccardDissimilarity JacobiAmplitude Jacobian JacobiCD JacobiCN JacobiCS JacobiDC JacobiDN JacobiDS JacobiNC JacobiND JacobiNS JacobiP JacobiSC JacobiSD JacobiSN JacobiSymbol JacobiZeta JankoGroupJ1 JankoGroupJ2 JankoGroupJ3 JankoGroupJ4 JarqueBeraALMTest JohnsonDistribution Join Joined JoinedCurve JoinedCurveBox JoinForm JordanDecomposition JordanModelDecomposition K KagiChart KaiserBesselWindow KaiserWindow KalmanEstimator KalmanFilter KarhunenLoeveDecomposition KaryTree KatzCentrality KCoreComponents KDistribution KelvinBei KelvinBer KelvinKei KelvinKer KendallTau KendallTauTest KernelExecute KernelMixtureDistribution KernelObject Kernels Ket Khinchin KirchhoffGraph KirchhoffMatrix KleinInvariantJ KnightTourGraph KnotData KnownUnitQ KolmogorovSmirnovTest KroneckerDelta KroneckerModelDecomposition KroneckerProduct KroneckerSymbol KuiperTest KumaraswamyDistribution Kurtosis KuwaharaFilter Label Labeled LabeledSlider LabelingFunction LabelStyle LaguerreL LambdaComponents LambertW LanczosWindow LandauDistribution Language LanguageCategory LaplaceDistribution LaplaceTransform Laplacian LaplacianFilter LaplacianGaussianFilter Large Larger Last Latitude LatitudeLongitude LatticeData LatticeReduce Launch LaunchKernels LayeredGraphPlot LayerSizeFunction LayoutInformation LCM LeafCount LeapYearQ LeastSquares LeastSquaresFilterKernel Left LeftArrow LeftArrowBar LeftArrowRightArrow LeftDownTeeVector LeftDownVector LeftDownVectorBar LeftRightArrow LeftRightVector LeftTee LeftTeeArrow LeftTeeVector LeftTriangle LeftTriangleBar LeftTriangleEqual LeftUpDownVector LeftUpTeeVector LeftUpVector LeftUpVectorBar LeftVector LeftVectorBar LegendAppearance Legended LegendFunction LegendLabel LegendLayout LegendMargins LegendMarkers LegendMarkerSize LegendreP LegendreQ LegendreType Length LengthWhile LerchPhi Less LessEqual LessEqualGreater LessFullEqual LessGreater LessLess LessSlantEqual LessTilde LetterCharacter LetterQ Level LeveneTest LeviCivitaTensor LevyDistribution Lexicographic LibraryFunction LibraryFunctionError LibraryFunctionInformation LibraryFunctionLoad LibraryFunctionUnload LibraryLoad LibraryUnload LicenseID LiftingFilterData LiftingWaveletTransform LightBlue LightBrown LightCyan Lighter LightGray LightGreen Lighting LightingAngle LightMagenta LightOrange LightPink LightPurple LightRed LightSources LightYellow Likelihood Limit LimitsPositioning LimitsPositioningTokens LindleyDistribution Line Line3DBox LinearFilter LinearFractionalTransform LinearModelFit LinearOffsetFunction LinearProgramming LinearRecurrence LinearSolve LinearSolveFunction LineBox LineBreak LinebreakAdjustments LineBreakChart LineBreakWithin LineColor LineForm LineGraph LineIndent LineIndentMaxFraction LineIntegralConvolutionPlot LineIntegralConvolutionScale LineLegend LineOpacity LineSpacing LineWrapParts LinkActivate LinkClose LinkConnect LinkConnectedQ LinkCreate LinkError LinkFlush LinkFunction LinkHost LinkInterrupt LinkLaunch LinkMode LinkObject LinkOpen LinkOptions LinkPatterns LinkProtocol LinkRead LinkReadHeld LinkReadyQ Links LinkWrite LinkWriteHeld LiouvilleLambda List Listable ListAnimate ListContourPlot ListContourPlot3D ListConvolve ListCorrelate ListCurvePathPlot ListDeconvolve ListDensityPlot Listen ListFourierSequenceTransform ListInterpolation ListLineIntegralConvolutionPlot ListLinePlot ListLogLinearPlot ListLogLogPlot ListLogPlot ListPicker ListPickerBox ListPickerBoxBackground ListPickerBoxOptions ListPlay ListPlot ListPlot3D ListPointPlot3D ListPolarPlot ListQ ListStreamDensityPlot ListStreamPlot ListSurfacePlot3D ListVectorDensityPlot ListVectorPlot ListVectorPlot3D ListZTransform Literal LiteralSearch LocalClusteringCoefficient LocalizeVariables LocationEquivalenceTest LocationTest Locator LocatorAutoCreate LocatorBox LocatorBoxOptions LocatorCentering LocatorPane LocatorPaneBox LocatorPaneBoxOptions LocatorRegion Locked Log Log10 Log2 LogBarnesG LogGamma LogGammaDistribution LogicalExpand LogIntegral LogisticDistribution LogitModelFit LogLikelihood LogLinearPlot LogLogisticDistribution LogLogPlot LogMultinormalDistribution LogNormalDistribution LogPlot LogRankTest LogSeriesDistribution LongEqual Longest LongestAscendingSequence LongestCommonSequence LongestCommonSequencePositions LongestCommonSubsequence LongestCommonSubsequencePositions LongestMatch LongForm Longitude LongLeftArrow LongLeftRightArrow LongRightArrow Loopback LoopFreeGraphQ LowerCaseQ LowerLeftArrow LowerRightArrow LowerTriangularize LowpassFilter LQEstimatorGains LQGRegulator LQOutputRegulatorGains LQRegulatorGains LUBackSubstitution LucasL LuccioSamiComponents LUDecomposition LyapunovSolve LyonsGroupLy MachineID MachineName MachineNumberQ MachinePrecision MacintoshSystemPageSetup Magenta Magnification Magnify MainSolve MaintainDynamicCaches Majority MakeBoxes MakeExpression MakeRules MangoldtLambda ManhattanDistance Manipulate Manipulator MannWhitneyTest MantissaExponent Manual Map MapAll MapAt MapIndexed MAProcess MapThread MarcumQ MardiaCombinedTest MardiaKurtosisTest MardiaSkewnessTest MarginalDistribution MarkovProcessProperties Masking MatchingDissimilarity MatchLocalNameQ MatchLocalNames MatchQ Material MathematicaNotation MathieuC MathieuCharacteristicA MathieuCharacteristicB MathieuCharacteristicExponent MathieuCPrime MathieuGroupM11 MathieuGroupM12 MathieuGroupM22 MathieuGroupM23 MathieuGroupM24 MathieuS MathieuSPrime MathMLForm MathMLText Matrices MatrixExp MatrixForm MatrixFunction MatrixLog MatrixPlot MatrixPower MatrixQ MatrixRank Max MaxBend MaxDetect MaxExtraBandwidths MaxExtraConditions MaxFeatures MaxFilter Maximize MaxIterations MaxMemoryUsed MaxMixtureKernels MaxPlotPoints MaxPoints MaxRecursion MaxStableDistribution MaxStepFraction MaxSteps MaxStepSize MaxValue MaxwellDistribution McLaughlinGroupMcL Mean MeanClusteringCoefficient MeanDegreeConnectivity MeanDeviation MeanFilter MeanGraphDistance MeanNeighborDegree MeanShift MeanShiftFilter Median MedianDeviation MedianFilter Medium MeijerG MeixnerDistribution MemberQ MemoryConstrained MemoryInUse Menu MenuAppearance MenuCommandKey MenuEvaluator MenuItem MenuPacket MenuSortingValue MenuStyle MenuView MergeDifferences Mesh MeshFunctions MeshRange MeshShading MeshStyle Message MessageDialog MessageList MessageName MessageOptions MessagePacket Messages MessagesNotebook MetaCharacters MetaInformation Method MethodOptions MexicanHatWavelet MeyerWavelet Min MinDetect MinFilter MinimalPolynomial MinimalStateSpaceModel Minimize Minors MinRecursion MinSize MinStableDistribution Minus MinusPlus MinValue Missing MissingDataMethod MittagLefflerE MixedRadix MixedRadixQuantity MixtureDistribution Mod Modal Mode Modular ModularLambda Module Modulus MoebiusMu Moment Momentary MomentConvert MomentEvaluate MomentGeneratingFunction Monday Monitor MonomialList MonomialOrder MonsterGroupM MorletWavelet MorphologicalBinarize MorphologicalBranchPoints MorphologicalComponents MorphologicalEulerNumber MorphologicalGraph MorphologicalPerimeter MorphologicalTransform Most MouseAnnotation MouseAppearance MouseAppearanceTag MouseButtons Mouseover MousePointerNote MousePosition MovingAverage MovingMedian MoyalDistribution MultiedgeStyle MultilaunchWarning MultiLetterItalics MultiLetterStyle MultilineFunction Multinomial MultinomialDistribution MultinormalDistribution MultiplicativeOrder Multiplicity Multiselection MultivariateHypergeometricDistribution MultivariatePoissonDistribution MultivariateTDistribution N NakagamiDistribution NameQ Names NamespaceBox Nand NArgMax NArgMin NBernoulliB NCache NDSolve NDSolveValue Nearest NearestFunction NeedCurrentFrontEndPackagePacket NeedCurrentFrontEndSymbolsPacket NeedlemanWunschSimilarity Needs Negative NegativeBinomialDistribution NegativeMultinomialDistribution NeighborhoodGraph Nest NestedGreaterGreater NestedLessLess NestedScriptRules NestList NestWhile NestWhileList NevilleThetaC NevilleThetaD NevilleThetaN NevilleThetaS NewPrimitiveStyle NExpectation Next NextPrime NHoldAll NHoldFirst NHoldRest NicholsGridLines NicholsPlot NIntegrate NMaximize NMaxValue NMinimize NMinValue NominalVariables NonAssociative NoncentralBetaDistribution NoncentralChiSquareDistribution NoncentralFRatioDistribution NoncentralStudentTDistribution NonCommutativeMultiply NonConstants None NonlinearModelFit NonlocalMeansFilter NonNegative NonPositive Nor NorlundB Norm Normal NormalDistribution NormalGrouping Normalize NormalizedSquaredEuclideanDistance NormalsFunction NormFunction Not NotCongruent NotCupCap NotDoubleVerticalBar Notebook NotebookApply NotebookAutoSave NotebookClose NotebookConvertSettings NotebookCreate NotebookCreateReturnObject NotebookDefault NotebookDelete NotebookDirectory NotebookDynamicExpression NotebookEvaluate NotebookEventActions NotebookFileName NotebookFind NotebookFindReturnObject NotebookGet NotebookGetLayoutInformationPacket NotebookGetMisspellingsPacket NotebookInformation NotebookInterfaceObject NotebookLocate NotebookObject NotebookOpen NotebookOpenReturnObject NotebookPath NotebookPrint NotebookPut NotebookPutReturnObject NotebookRead NotebookResetGeneratedCells Notebooks NotebookSave NotebookSaveAs NotebookSelection NotebookSetupLayoutInformationPacket NotebooksMenu NotebookWrite NotElement NotEqualTilde NotExists NotGreater NotGreaterEqual NotGreaterFullEqual NotGreaterGreater NotGreaterLess NotGreaterSlantEqual NotGreaterTilde NotHumpDownHump NotHumpEqual NotLeftTriangle NotLeftTriangleBar NotLeftTriangleEqual NotLess NotLessEqual NotLessFullEqual NotLessGreater NotLessLess NotLessSlantEqual NotLessTilde NotNestedGreaterGreater NotNestedLessLess NotPrecedes NotPrecedesEqual NotPrecedesSlantEqual NotPrecedesTilde NotReverseElement NotRightTriangle NotRightTriangleBar NotRightTriangleEqual NotSquareSubset NotSquareSubsetEqual NotSquareSuperset NotSquareSupersetEqual NotSubset NotSubsetEqual NotSucceeds NotSucceedsEqual NotSucceedsSlantEqual NotSucceedsTilde NotSuperset NotSupersetEqual NotTilde NotTildeEqual NotTildeFullEqual NotTildeTilde NotVerticalBar NProbability NProduct NProductFactors NRoots NSolve NSum NSumTerms Null NullRecords NullSpace NullWords Number NumberFieldClassNumber NumberFieldDiscriminant NumberFieldFundamentalUnits NumberFieldIntegralBasis NumberFieldNormRepresentatives NumberFieldRegulator NumberFieldRootsOfUnity NumberFieldSignature NumberForm NumberFormat NumberMarks NumberMultiplier NumberPadding NumberPoint NumberQ NumberSeparator NumberSigns NumberString Numerator NumericFunction NumericQ NuttallWindow NValues NyquistGridLines NyquistPlot O ObservabilityGramian ObservabilityMatrix ObservableDecomposition ObservableModelQ OddQ Off Offset OLEData On ONanGroupON OneIdentity Opacity Open OpenAppend Opener OpenerBox OpenerBoxOptions OpenerView OpenFunctionInspectorPacket Opening OpenRead OpenSpecialOptions OpenTemporary OpenWrite Operate OperatingSystem OptimumFlowData Optional OptionInspectorSettings OptionQ Options OptionsPacket OptionsPattern OptionValue OptionValueBox OptionValueBoxOptions Or Orange Order OrderDistribution OrderedQ Ordering Orderless OrnsteinUhlenbeckProcess Orthogonalize Out Outer OutputAutoOverwrite OutputControllabilityMatrix OutputControllableModelQ OutputForm OutputFormData OutputGrouping OutputMathEditExpression OutputNamePacket OutputResponse OutputSizeLimit OutputStream Over OverBar OverDot Overflow OverHat Overlaps Overlay OverlayBox OverlayBoxOptions Overscript OverscriptBox OverscriptBoxOptions OverTilde OverVector OwenT OwnValues PackingMethod PaddedForm Padding PadeApproximant PadLeft PadRight PageBreakAbove PageBreakBelow PageBreakWithin PageFooterLines PageFooters PageHeaderLines PageHeaders PageHeight PageRankCentrality PageWidth PairedBarChart PairedHistogram PairedSmoothHistogram PairedTTest PairedZTest PaletteNotebook PalettePath Pane PaneBox PaneBoxOptions Panel PanelBox PanelBoxOptions Paneled PaneSelector PaneSelectorBox PaneSelectorBoxOptions PaperWidth ParabolicCylinderD ParagraphIndent ParagraphSpacing ParallelArray ParallelCombine ParallelDo ParallelEvaluate Parallelization Parallelize ParallelMap ParallelNeeds ParallelProduct ParallelSubmit ParallelSum ParallelTable ParallelTry Parameter ParameterEstimator ParameterMixtureDistribution ParameterVariables ParametricFunction ParametricNDSolve ParametricNDSolveValue ParametricPlot ParametricPlot3D ParentConnect ParentDirectory ParentForm Parenthesize ParentList ParetoDistribution Part PartialCorrelationFunction PartialD ParticleData Partition PartitionsP PartitionsQ ParzenWindow PascalDistribution PassEventsDown PassEventsUp Paste PasteBoxFormInlineCells PasteButton Path PathGraph PathGraphQ Pattern PatternSequence PatternTest PauliMatrix PaulWavelet Pause PausedTime PDF PearsonChiSquareTest PearsonCorrelationTest PearsonDistribution PerformanceGoal PeriodicInterpolation Periodogram PeriodogramArray PermutationCycles PermutationCyclesQ PermutationGroup PermutationLength PermutationList PermutationListQ PermutationMax PermutationMin PermutationOrder PermutationPower PermutationProduct PermutationReplace Permutations PermutationSupport Permute PeronaMalikFilter Perpendicular PERTDistribution PetersenGraph PhaseMargins Pi Pick PIDData PIDDerivativeFilter PIDFeedforward PIDTune Piecewise PiecewiseExpand PieChart PieChart3D PillaiTrace PillaiTraceTest Pink Pivoting PixelConstrained PixelValue PixelValuePositions Placed Placeholder PlaceholderReplace Plain PlanarGraphQ Play PlayRange Plot Plot3D Plot3Matrix PlotDivision PlotJoined PlotLabel PlotLayout PlotLegends PlotMarkers PlotPoints PlotRange PlotRangeClipping PlotRangePadding PlotRegion PlotStyle Plus PlusMinus Pochhammer PodStates PodWidth Point Point3DBox PointBox PointFigureChart PointForm PointLegend PointSize PoissonConsulDistribution PoissonDistribution PoissonProcess PoissonWindow PolarAxes PolarAxesOrigin PolarGridLines PolarPlot PolarTicks PoleZeroMarkers PolyaAeppliDistribution PolyGamma Polygon Polygon3DBox Polygon3DBoxOptions PolygonBox PolygonBoxOptions PolygonHoleScale PolygonIntersections PolygonScale PolyhedronData PolyLog PolynomialExtendedGCD PolynomialForm PolynomialGCD PolynomialLCM PolynomialMod PolynomialQ PolynomialQuotient PolynomialQuotientRemainder PolynomialReduce PolynomialRemainder Polynomials PopupMenu PopupMenuBox PopupMenuBoxOptions PopupView PopupWindow Position Positive PositiveDefiniteMatrixQ PossibleZeroQ Postfix PostScript Power PowerDistribution PowerExpand PowerMod PowerModList PowerSpectralDensity PowersRepresentations PowerSymmetricPolynomial Precedence PrecedenceForm Precedes PrecedesEqual PrecedesSlantEqual PrecedesTilde Precision PrecisionGoal PreDecrement PredictionRoot PreemptProtect PreferencesPath Prefix PreIncrement Prepend PrependTo PreserveImageOptions Previous PriceGraphDistribution PrimaryPlaceholder Prime PrimeNu PrimeOmega PrimePi PrimePowerQ PrimeQ Primes PrimeZetaP PrimitiveRoot PrincipalComponents PrincipalValue Print PrintAction PrintForm PrintingCopies PrintingOptions PrintingPageRange PrintingStartingPageNumber PrintingStyleEnvironment PrintPrecision PrintTemporary Prism PrismBox PrismBoxOptions PrivateCellOptions PrivateEvaluationOptions PrivateFontOptions PrivateFrontEndOptions PrivateNotebookOptions PrivatePaths Probability ProbabilityDistribution ProbabilityPlot ProbabilityPr ProbabilityScalePlot ProbitModelFit ProcessEstimator ProcessParameterAssumptions ProcessParameterQ ProcessStateDomain ProcessTimeDomain Product ProductDistribution ProductLog ProgressIndicator ProgressIndicatorBox ProgressIndicatorBoxOptions Projection Prolog PromptForm Properties Property PropertyList PropertyValue Proportion Proportional Protect Protected ProteinData Pruning PseudoInverse Purple Put PutAppend Pyramid PyramidBox PyramidBoxOptions QBinomial QFactorial QGamma QHypergeometricPFQ QPochhammer QPolyGamma QRDecomposition QuadraticIrrationalQ Quantile QuantilePlot Quantity QuantityForm QuantityMagnitude QuantityQ QuantityUnit Quartics QuartileDeviation Quartiles QuartileSkewness QueueingNetworkProcess QueueingProcess QueueProperties Quiet Quit Quotient QuotientRemainder RadialityCentrality RadicalBox RadicalBoxOptions RadioButton RadioButtonBar RadioButtonBox RadioButtonBoxOptions Radon RamanujanTau RamanujanTauL RamanujanTauTheta RamanujanTauZ Random RandomChoice RandomComplex RandomFunction RandomGraph RandomImage RandomInteger RandomPermutation RandomPrime RandomReal RandomSample RandomSeed RandomVariate RandomWalkProcess Range RangeFilter RangeSpecification RankedMax RankedMin Raster Raster3D Raster3DBox Raster3DBoxOptions RasterArray RasterBox RasterBoxOptions Rasterize RasterSize Rational RationalFunctions Rationalize Rationals Ratios Raw RawArray RawBoxes RawData RawMedium RayleighDistribution Re Read ReadList ReadProtected Real RealBlockDiagonalForm RealDigits RealExponent Reals Reap Record RecordLists RecordSeparators Rectangle RectangleBox RectangleBoxOptions RectangleChart RectangleChart3D RecurrenceFilter RecurrenceTable RecurringDigitsForm Red Reduce RefBox ReferenceLineStyle ReferenceMarkers ReferenceMarkerStyle Refine ReflectionMatrix ReflectionTransform Refresh RefreshRate RegionBinarize RegionFunction RegionPlot RegionPlot3D RegularExpression Regularization Reinstall Release ReleaseHold ReliabilityDistribution ReliefImage ReliefPlot Remove RemoveAlphaChannel RemoveAsynchronousTask Removed RemoveInputStreamMethod RemoveOutputStreamMethod RemoveProperty RemoveScheduledTask RenameDirectory RenameFile RenderAll RenderingOptions RenewalProcess RenkoChart Repeated RepeatedNull RepeatedString Replace ReplaceAll ReplaceHeldPart ReplaceImageValue ReplaceList ReplacePart ReplacePixelValue ReplaceRepeated Resampling Rescale RescalingTransform ResetDirectory ResetMenusPacket ResetScheduledTask Residue Resolve Rest Resultant ResumePacket Return ReturnExpressionPacket ReturnInputFormPacket ReturnPacket ReturnTextPacket Reverse ReverseBiorthogonalSplineWavelet ReverseElement ReverseEquilibrium ReverseGraph ReverseUpEquilibrium RevolutionAxis RevolutionPlot3D RGBColor RiccatiSolve RiceDistribution RidgeFilter RiemannR RiemannSiegelTheta RiemannSiegelZ Riffle Right RightArrow RightArrowBar RightArrowLeftArrow RightCosetRepresentative RightDownTeeVector RightDownVector RightDownVectorBar RightTee RightTeeArrow RightTeeVector RightTriangle RightTriangleBar RightTriangleEqual RightUpDownVector RightUpTeeVector RightUpVector RightUpVectorBar RightVector RightVectorBar RiskAchievementImportance RiskReductionImportance RogersTanimotoDissimilarity Root RootApproximant RootIntervals RootLocusPlot RootMeanSquare RootOfUnityQ RootReduce Roots RootSum Rotate RotateLabel RotateLeft RotateRight RotationAction RotationBox RotationBoxOptions RotationMatrix RotationTransform Round RoundImplies RoundingRadius Row RowAlignments RowBackgrounds RowBox RowHeights RowLines RowMinHeight RowReduce RowsEqual RowSpacings RSolve RudvalisGroupRu Rule RuleCondition RuleDelayed RuleForm RulerUnits Run RunScheduledTask RunThrough RuntimeAttributes RuntimeOptions RussellRaoDissimilarity SameQ SameTest SampleDepth SampledSoundFunction SampledSoundList SampleRate SamplingPeriod SARIMAProcess SARMAProcess SatisfiabilityCount SatisfiabilityInstances SatisfiableQ Saturday Save Saveable SaveAutoDelete SaveDefinitions SawtoothWave Scale Scaled ScaleDivisions ScaledMousePosition ScaleOrigin ScalePadding ScaleRanges ScaleRangeStyle ScalingFunctions ScalingMatrix ScalingTransform Scan ScheduledTaskActiveQ ScheduledTaskData ScheduledTaskObject ScheduledTasks SchurDecomposition ScientificForm ScreenRectangle ScreenStyleEnvironment ScriptBaselineShifts ScriptLevel ScriptMinSize ScriptRules ScriptSizeMultipliers Scrollbars ScrollingOptions ScrollPosition Sec Sech SechDistribution SectionGrouping SectorChart SectorChart3D SectorOrigin SectorSpacing SeedRandom Select Selectable SelectComponents SelectedCells SelectedNotebook Selection SelectionAnimate SelectionCell SelectionCellCreateCell SelectionCellDefaultStyle SelectionCellParentStyle SelectionCreateCell SelectionDebuggerTag SelectionDuplicateCell SelectionEvaluate SelectionEvaluateCreateCell SelectionMove SelectionPlaceholder SelectionSetStyle SelectWithContents SelfLoops SelfLoopStyle SemialgebraicComponentInstances SendMail Sequence SequenceAlignment SequenceForm SequenceHold SequenceLimit Series SeriesCoefficient SeriesData SessionTime Set SetAccuracy SetAlphaChannel SetAttributes Setbacks SetBoxFormNamesPacket SetDelayed SetDirectory SetEnvironment SetEvaluationNotebook SetFileDate SetFileLoadingContext SetNotebookStatusLine SetOptions SetOptionsPacket SetPrecision SetProperty SetSelectedNotebook SetSharedFunction SetSharedVariable SetSpeechParametersPacket SetStreamPosition SetSystemOptions Setter SetterBar SetterBox SetterBoxOptions Setting SetValue Shading Shallow ShannonWavelet ShapiroWilkTest Share Sharpen ShearingMatrix ShearingTransform ShenCastanMatrix Short ShortDownArrow Shortest ShortestMatch ShortestPathFunction ShortLeftArrow ShortRightArrow ShortUpArrow Show ShowAutoStyles ShowCellBracket ShowCellLabel ShowCellTags ShowClosedCellArea ShowContents ShowControls ShowCursorTracker ShowGroupOpenCloseIcon ShowGroupOpener ShowInvisibleCharacters ShowPageBreaks ShowPredictiveInterface ShowSelection ShowShortBoxForm ShowSpecialCharacters ShowStringCharacters ShowSyntaxStyles ShrinkingDelay ShrinkWrapBoundingBox SiegelTheta SiegelTukeyTest Sign Signature SignedRankTest SignificanceLevel SignPadding SignTest SimilarityRules SimpleGraph SimpleGraphQ Simplify Sin Sinc SinghMaddalaDistribution SingleEvaluation SingleLetterItalics SingleLetterStyle SingularValueDecomposition SingularValueList SingularValuePlot SingularValues Sinh SinhIntegral SinIntegral SixJSymbol Skeleton SkeletonTransform SkellamDistribution Skewness SkewNormalDistribution Skip SliceDistribution Slider Slider2D Slider2DBox Slider2DBoxOptions SliderBox SliderBoxOptions SlideView Slot SlotSequence Small SmallCircle Smaller SmithDelayCompensator SmithWatermanSimilarity SmoothDensityHistogram SmoothHistogram SmoothHistogram3D SmoothKernelDistribution SocialMediaData Socket SokalSneathDissimilarity Solve SolveAlways SolveDelayed Sort SortBy Sound SoundAndGraphics SoundNote SoundVolume Sow Space SpaceForm Spacer Spacings Span SpanAdjustments SpanCharacterRounding SpanFromAbove SpanFromBoth SpanFromLeft SpanLineThickness SpanMaxSize SpanMinSize SpanningCharacters SpanSymmetric SparseArray SpatialGraphDistribution Speak SpeakTextPacket SpearmanRankTest SpearmanRho Spectrogram SpectrogramArray Specularity SpellingCorrection SpellingDictionaries SpellingDictionariesPath SpellingOptions SpellingSuggestionsPacket Sphere SphereBox SphericalBesselJ SphericalBesselY SphericalHankelH1 SphericalHankelH2 SphericalHarmonicY SphericalPlot3D SphericalRegion SpheroidalEigenvalue SpheroidalJoiningFactor SpheroidalPS SpheroidalPSPrime SpheroidalQS SpheroidalQSPrime SpheroidalRadialFactor SpheroidalS1 SpheroidalS1Prime SpheroidalS2 SpheroidalS2Prime Splice SplicedDistribution SplineClosed SplineDegree SplineKnots SplineWeights Split SplitBy SpokenString Sqrt SqrtBox SqrtBoxOptions Square SquaredEuclideanDistance SquareFreeQ SquareIntersection SquaresR SquareSubset SquareSubsetEqual SquareSuperset SquareSupersetEqual SquareUnion SquareWave StabilityMargins StabilityMarginsStyle StableDistribution Stack StackBegin StackComplete StackInhibit StandardDeviation StandardDeviationFilter StandardForm Standardize StandbyDistribution Star StarGraph StartAsynchronousTask StartingStepSize StartOfLine StartOfString StartScheduledTask StartupSound StateDimensions StateFeedbackGains StateOutputEstimator StateResponse StateSpaceModel StateSpaceRealization StateSpaceTransform StationaryDistribution StationaryWaveletPacketTransform StationaryWaveletTransform StatusArea StatusCentrality StepMonitor StieltjesGamma StirlingS1 StirlingS2 StopAsynchronousTask StopScheduledTask StrataVariables StratonovichProcess StreamColorFunction StreamColorFunctionScaling StreamDensityPlot StreamPlot StreamPoints StreamPosition Streams StreamScale StreamStyle String StringBreak StringByteCount StringCases StringCount StringDrop StringExpression StringForm StringFormat StringFreeQ StringInsert StringJoin StringLength StringMatchQ StringPosition StringQ StringReplace StringReplaceList StringReplacePart StringReverse StringRotateLeft StringRotateRight StringSkeleton StringSplit StringTake StringToStream StringTrim StripBoxes StripOnInput StripWrapperBoxes StrokeForm StructuralImportance StructuredArray StructuredSelection StruveH StruveL Stub StudentTDistribution Style StyleBox StyleBoxAutoDelete StyleBoxOptions StyleData StyleDefinitions StyleForm StyleKeyMapping StyleMenuListing StyleNameDialogSettings StyleNames StylePrint StyleSheetPath Subfactorial Subgraph SubMinus SubPlus SubresultantPolynomialRemainders SubresultantPolynomials Subresultants Subscript SubscriptBox SubscriptBoxOptions Subscripted Subset SubsetEqual Subsets SubStar Subsuperscript SubsuperscriptBox SubsuperscriptBoxOptions Subtract SubtractFrom SubValues Succeeds SucceedsEqual SucceedsSlantEqual SucceedsTilde SuchThat Sum SumConvergence Sunday SuperDagger SuperMinus SuperPlus Superscript SuperscriptBox SuperscriptBoxOptions Superset SupersetEqual SuperStar Surd SurdForm SurfaceColor SurfaceGraphics SurvivalDistribution SurvivalFunction SurvivalModel SurvivalModelFit SuspendPacket SuzukiDistribution SuzukiGroupSuz SwatchLegend Switch Symbol SymbolName SymletWavelet Symmetric SymmetricGroup SymmetricMatrixQ SymmetricPolynomial SymmetricReduction Symmetrize SymmetrizedArray SymmetrizedArrayRules SymmetrizedDependentComponents SymmetrizedIndependentComponents SymmetrizedReplacePart SynchronousInitialization SynchronousUpdating Syntax SyntaxForm SyntaxInformation SyntaxLength SyntaxPacket SyntaxQ SystemDialogInput SystemException SystemHelpPath SystemInformation SystemInformationData SystemOpen SystemOptions SystemsModelDelay SystemsModelDelayApproximate SystemsModelDelete SystemsModelDimensions SystemsModelExtract SystemsModelFeedbackConnect SystemsModelLabels SystemsModelOrder SystemsModelParallelConnect SystemsModelSeriesConnect SystemsModelStateFeedbackConnect SystemStub Tab TabFilling Table TableAlignments TableDepth TableDirections TableForm TableHeadings TableSpacing TableView TableViewBox TabSpacings TabView TabViewBox TabViewBoxOptions TagBox TagBoxNote TagBoxOptions TaggingRules TagSet TagSetDelayed TagStyle TagUnset Take TakeWhile Tally Tan Tanh TargetFunctions TargetUnits TautologyQ TelegraphProcess TemplateBox TemplateBoxOptions TemplateSlotSequence TemporalData Temporary TemporaryVariable TensorContract TensorDimensions TensorExpand TensorProduct TensorQ TensorRank TensorReduce TensorSymmetry TensorTranspose TensorWedge Tetrahedron TetrahedronBox TetrahedronBoxOptions TeXForm TeXSave Text Text3DBox Text3DBoxOptions TextAlignment TextBand TextBoundingBox TextBox TextCell TextClipboardType TextData TextForm TextJustification TextLine TextPacket TextParagraph TextRecognize TextRendering TextStyle Texture TextureCoordinateFunction TextureCoordinateScaling Therefore ThermometerGauge Thick Thickness Thin Thinning ThisLink ThompsonGroupTh Thread ThreeJSymbol Threshold Through Throw Thumbnail Thursday Ticks TicksStyle Tilde TildeEqual TildeFullEqual TildeTilde TimeConstrained TimeConstraint Times TimesBy TimeSeriesForecast TimeSeriesInvertibility TimeUsed TimeValue TimeZone Timing Tiny TitleGrouping TitsGroupT ToBoxes ToCharacterCode ToColor ToContinuousTimeModel ToDate ToDiscreteTimeModel ToeplitzMatrix ToExpression ToFileName Together Toggle ToggleFalse Toggler TogglerBar TogglerBox TogglerBoxOptions ToHeldExpression ToInvertibleTimeSeries TokenWords Tolerance ToLowerCase ToNumberField TooBig Tooltip TooltipBox TooltipBoxOptions TooltipDelay TooltipStyle Top TopHatTransform TopologicalSort ToRadicals ToRules ToString Total TotalHeight TotalVariationFilter TotalWidth TouchscreenAutoZoom TouchscreenControlPlacement ToUpperCase Tr Trace TraceAbove TraceAction TraceBackward TraceDepth TraceDialog TraceForward TraceInternal TraceLevel TraceOff TraceOn TraceOriginal TracePrint TraceScan TrackedSymbols TradingChart TraditionalForm TraditionalFunctionNotation TraditionalNotation TraditionalOrder TransferFunctionCancel TransferFunctionExpand TransferFunctionFactor TransferFunctionModel TransferFunctionPoles TransferFunctionTransform TransferFunctionZeros TransformationFunction TransformationFunctions TransformationMatrix TransformedDistribution TransformedField Translate TranslationTransform TransparentColor Transpose TreeForm TreeGraph TreeGraphQ TreePlot TrendStyle TriangleWave TriangularDistribution Trig TrigExpand TrigFactor TrigFactorList Trigger TrigReduce TrigToExp TrimmedMean True TrueQ TruncatedDistribution TsallisQExponentialDistribution TsallisQGaussianDistribution TTest Tube TubeBezierCurveBox TubeBezierCurveBoxOptions TubeBox TubeBSplineCurveBox TubeBSplineCurveBoxOptions Tuesday TukeyLambdaDistribution TukeyWindow Tuples TuranGraph TuringMachine Transparent UnateQ Uncompress Undefined UnderBar Underflow Underlined Underoverscript UnderoverscriptBox UnderoverscriptBoxOptions Underscript UnderscriptBox UnderscriptBoxOptions UndirectedEdge UndirectedGraph UndirectedGraphQ UndocumentedTestFEParserPacket UndocumentedTestGetSelectionPacket Unequal Unevaluated UniformDistribution UniformGraphDistribution UniformSumDistribution Uninstall Union UnionPlus Unique UnitBox UnitConvert UnitDimensions Unitize UnitRootTest UnitSimplify UnitStep UnitTriangle UnitVector Unprotect UnsameQ UnsavedVariables Unset UnsetShared UntrackedVariables Up UpArrow UpArrowBar UpArrowDownArrow Update UpdateDynamicObjects UpdateDynamicObjectsSynchronous UpdateInterval UpDownArrow UpEquilibrium UpperCaseQ UpperLeftArrow UpperRightArrow UpperTriangularize Upsample UpSet UpSetDelayed UpTee UpTeeArrow UpValues URL URLFetch URLFetchAsynchronous URLSave URLSaveAsynchronous UseGraphicsRange Using UsingFrontEnd V2Get ValidationLength Value ValueBox ValueBoxOptions ValueForm ValueQ ValuesData Variables Variance VarianceEquivalenceTest VarianceEstimatorFunction VarianceGammaDistribution VarianceTest VectorAngle VectorColorFunction VectorColorFunctionScaling VectorDensityPlot VectorGlyphData VectorPlot VectorPlot3D VectorPoints VectorQ Vectors VectorScale VectorStyle Vee Verbatim Verbose VerboseConvertToPostScriptPacket VerifyConvergence VerifySolutions VerifyTestAssumptions Version VersionNumber VertexAdd VertexCapacity VertexColors VertexComponent VertexConnectivity VertexCoordinateRules VertexCoordinates VertexCorrelationSimilarity VertexCosineSimilarity VertexCount VertexCoverQ VertexDataCoordinates VertexDegree VertexDelete VertexDiceSimilarity VertexEccentricity VertexInComponent VertexInDegree VertexIndex VertexJaccardSimilarity VertexLabeling VertexLabels VertexLabelStyle VertexList VertexNormals VertexOutComponent VertexOutDegree VertexQ VertexRenderingFunction VertexReplace VertexShape VertexShapeFunction VertexSize VertexStyle VertexTextureCoordinates VertexWeight Vertical VerticalBar VerticalForm VerticalGauge VerticalSeparator VerticalSlider VerticalTilde ViewAngle ViewCenter ViewMatrix ViewPoint ViewPointSelectorSettings ViewPort ViewRange ViewVector ViewVertical VirtualGroupData Visible VisibleCell VoigtDistribution VonMisesDistribution WaitAll WaitAsynchronousTask WaitNext WaitUntil WakebyDistribution WalleniusHypergeometricDistribution WaringYuleDistribution WatershedComponents WatsonUSquareTest WattsStrogatzGraphDistribution WaveletBestBasis WaveletFilterCoefficients WaveletImagePlot WaveletListPlot WaveletMapIndexed WaveletMatrixPlot WaveletPhi WaveletPsi WaveletScale WaveletScalogram WaveletThreshold WeaklyConnectedComponents WeaklyConnectedGraphQ WeakStationarity WeatherData WeberE Wedge Wednesday WeibullDistribution WeierstrassHalfPeriods WeierstrassInvariants WeierstrassP WeierstrassPPrime WeierstrassSigma WeierstrassZeta WeightedAdjacencyGraph WeightedAdjacencyMatrix WeightedData WeightedGraphQ Weights WelchWindow WheelGraph WhenEvent Which While White Whitespace WhitespaceCharacter WhittakerM WhittakerW WienerFilter WienerProcess WignerD WignerSemicircleDistribution WilksW WilksWTest WindowClickSelect WindowElements WindowFloating WindowFrame WindowFrameElements WindowMargins WindowMovable WindowOpacity WindowSelected WindowSize WindowStatusArea WindowTitle WindowToolbars WindowWidth With WolframAlpha WolframAlphaDate WolframAlphaQuantity WolframAlphaResult Word WordBoundary WordCharacter WordData WordSearch WordSeparators WorkingPrecision Write WriteString Wronskian XMLElement XMLObject Xnor Xor Yellow YuleDissimilarity ZernikeR ZeroSymmetric ZeroTest ZeroWidthTimes Zeta ZetaZero ZipfDistribution ZTest ZTransform $Aborted $ActivationGroupID $ActivationKey $ActivationUserRegistered $AddOnsDirectory $AssertFunction $Assumptions $AsynchronousTask $BaseDirectory $BatchInput $BatchOutput $BoxForms $ByteOrdering $Canceled $CharacterEncoding $CharacterEncodings $CommandLine $CompilationTarget $ConditionHold $ConfiguredKernels $Context $ContextPath $ControlActiveSetting $CreationDate $CurrentLink $DateStringFormat $DefaultFont $DefaultFrontEnd $DefaultImagingDevice $DefaultPath $Display $DisplayFunction $DistributedContexts $DynamicEvaluation $Echo $Epilog $ExportFormats $Failed $FinancialDataSource $FormatType $FrontEnd $FrontEndSession $GeoLocation $HistoryLength $HomeDirectory $HTTPCookies $IgnoreEOF $ImagingDevices $ImportFormats $InitialDirectory $Input $InputFileName $InputStreamMethods $Inspector $InstallationDate $InstallationDirectory $InterfaceEnvironment $IterationLimit $KernelCount $KernelID $Language $LaunchDirectory $LibraryPath $LicenseExpirationDate $LicenseID $LicenseProcesses $LicenseServer $LicenseSubprocesses $LicenseType $Line $Linked $LinkSupported $LoadedFiles $MachineAddresses $MachineDomain $MachineDomains $MachineEpsilon $MachineID $MachineName $MachinePrecision $MachineType $MaxExtraPrecision $MaxLicenseProcesses $MaxLicenseSubprocesses $MaxMachineNumber $MaxNumber $MaxPiecewiseCases $MaxPrecision $MaxRootDegree $MessageGroups $MessageList $MessagePrePrint $Messages $MinMachineNumber $MinNumber $MinorReleaseNumber $MinPrecision $ModuleNumber $NetworkLicense $NewMessage $NewSymbol $Notebooks $NumberMarks $Off $OperatingSystem $Output $OutputForms $OutputSizeLimit $OutputStreamMethods $Packages $ParentLink $ParentProcessID $PasswordFile $PatchLevelID $Path $PathnameSeparator $PerformanceGoal $PipeSupported $Post $Pre $PreferencesDirectory $PrePrint $PreRead $PrintForms $PrintLiteral $ProcessID $ProcessorCount $ProcessorType $ProductInformation $ProgramName $RandomState $RecursionLimit $ReleaseNumber $RootDirectory $ScheduledTask $ScriptCommandLine $SessionID $SetParentLink $SharedFunctions $SharedVariables $SoundDisplay $SoundDisplayFunction $SuppressInputFormHeads $SynchronousEvaluation $SyntaxHandler $System $SystemCharacterEncoding $SystemID $SystemWordLength $TemporaryDirectory $TemporaryPrefix $TextStyle $TimedOut $TimeUnit $TimeZone $TopDirectory $TraceOff $TraceOn $TracePattern $TracePostAction $TracePreAction $Urgent $UserAddOnsDirectory $UserBaseDirectory $UserDocumentsDirectory $UserName $Version $VersionNumber",c:[{cN:"comment",b:/\(\*/,e:/\*\)/},a.ASM,a.QSM,a.CNM,{cN:"list",b:/\{/,e:/\}/,i:/:/}]}});hljs.registerLanguage("swift",function(a){var e={keyword:"class deinit enum extension func import init let protocol static struct subscript typealias var break case continue default do else fallthrough if in for return switch where while as dynamicType is new super self Self Type __COLUMN__ __FILE__ __FUNCTION__ __LINE__ associativity didSet get infix inout left mutating none nonmutating operator override postfix precedence prefix right set unowned unowned safe unsafe weak willSet",literal:"true false nil",built_in:"abs advance alignof alignofValue assert bridgeFromObjectiveC bridgeFromObjectiveCUnconditional bridgeToObjectiveC bridgeToObjectiveCUnconditional c contains count countElements countLeadingZeros debugPrint debugPrintln distance dropFirst dropLast dump encodeBitsAsWords enumerate equal false filter find getBridgedObjectiveCType getVaList indices insertionSort isBridgedToObjectiveC isBridgedVerbatimToObjectiveC isUniquelyReferenced join lexicographicalCompare map max maxElement min minElement nil numericCast partition posix print println quickSort reduce reflect reinterpretCast reverse roundUpToAlignment sizeof sizeofValue sort split startsWith strideof strideofValue swap swift toString transcode true underestimateCount unsafeReflect withExtendedLifetime withObjectAtPlusZero withUnsafePointer withUnsafePointerToObject withUnsafePointers withVaList"};var g={cN:"type",b:"\\b[A-Z][\\w']*",r:0};var b={cN:"comment",b:"/\\*",e:"\\*/",c:[a.PWM,"self"]};var c={cN:"subst",b:/\\\(/,e:"\\)",k:e,c:[]};var f={cN:"number",b:"\\b([\\d_]+(\\.[\\deE_]+)?|0x[a-fA-F0-9_]+(\\.[a-fA-F0-9p_]+)?|0b[01_]+|0o[0-7_]+)\\b",r:0};var d=a.inherit(a.QSM,{c:[c,a.BE]});c.c=[f];return{k:e,c:[d,a.CLCM,b,g,f,{cN:"func",bK:"func",eE:true,c:[a.inherit(a.TM,{b:/[A-Za-z$_][0-9A-Za-z$_]*/,i:/\(/}),{cN:"generics",b:/\</,e:/\>/,i:/\>/},{cN:"params",b:/\(/,e:/\)/,c:[a.CLCM,a.CBCM],i:/["']/}],i:/\[|%/},{cN:"class",k:"struct protocol class extension enum",b:"(struct|protocol|class(?! (func|var))|extension|enum)",e:"\\{",eE:true,c:[a.inherit(a.TM,{b:/[A-Za-z$_][0-9A-Za-z$_]*/})]},{cN:"preprocessor",b:"(@assignment|@class_protocol|@exported|@final|@lazy|@noreturn|@NSCopying|@NSManaged|@objc|@optional|@required|@auto_closure|@noreturn|@IBAction|@IBDesignable|@IBInspectable|@IBOutlet|@infix|@prefix|@postfix)"},]}});hljs.registerLanguage("php",function(b){var e={cN:"variable",b:"(\\$|->)+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*"};var a={cN:"preprocessor",b:/<\?(php)?|\?>/};var c={cN:"string",c:[b.BE,a],v:[{b:'b"',e:'"'},{b:"b'",e:"'"},b.inherit(b.ASM,{i:null}),b.inherit(b.QSM,{i:null})]};var d={v:[b.BNM,b.CNM]};return{aliases:["php3","php4","php5","php6"],cI:true,k:"and include_once list abstract global private echo interface as static endswitch array null if endwhile or const for endforeach self var while isset public protected exit foreach throw elseif include __FILE__ empty require_once do xor return parent clone use __CLASS__ __LINE__ else break print eval new catch __METHOD__ case exception default die require __FUNCTION__ enddeclare final try switch continue endfor endif declare unset true false trait goto instanceof insteadof __DIR__ __NAMESPACE__ yield finally",c:[b.CLCM,b.HCM,{cN:"comment",b:"/\\*",e:"\\*/",c:[{cN:"phpdoc",b:"\\s@[A-Za-z]+"},a]},{cN:"comment",b:"__halt_compiler.+?;",eW:true,k:"__halt_compiler",l:b.UIR},{cN:"string",b:"<<<['\"]?\\w+['\"]?$",e:"^\\w+;",c:[b.BE]},a,e,{cN:"function",bK:"function",e:/[;{]/,eE:true,i:"\\$|\\[|%",c:[b.UTM,{cN:"params",b:"\\(",e:"\\)",c:["self",e,b.CBCM,c,d]}]},{cN:"class",bK:"class interface",e:"{",eE:true,i:/[:\(\$"]/,c:[{bK:"extends implements",r:10},b.UTM]},{bK:"namespace",e:";",i:/[\.']/,c:[b.UTM]},{bK:"use",e:";",c:[b.UTM]},{b:"=>"},c,d]}});hljs.registerLanguage("haskell",function(f){var g={cN:"comment",v:[{b:"--",e:"$"},{b:"{-",e:"-}",c:["self"]}]};var e={cN:"pragma",b:"{-#",e:"#-}"};var b={cN:"preprocessor",b:"^#",e:"$"};var d={cN:"type",b:"\\b[A-Z][\\w']*",r:0};var c={cN:"container",b:"\\(",e:"\\)",i:'"',c:[e,g,b,{cN:"type",b:"\\b[A-Z][\\w]*(\\((\\.\\.|,|\\w+)\\))?"},f.inherit(f.TM,{b:"[_a-z][\\w']*"})]};var a={cN:"container",b:"{",e:"}",c:c.c};return{aliases:["hs"],k:"let in if then else case of where do module import hiding qualified type data newtype deriving class instance as default infix infixl infixr foreign export ccall stdcall cplusplus jvm dotnet safe unsafe family forall mdo proc rec",c:[{cN:"module",b:"\\bmodule\\b",e:"where",k:"module where",c:[c,g],i:"\\W\\.|;"},{cN:"import",b:"\\bimport\\b",e:"$",k:"import|0 qualified as hiding",c:[c,g],i:"\\W\\.|;"},{cN:"class",b:"^(\\s*)?(class|instance)\\b",e:"where",k:"class family instance where",c:[d,c,g]},{cN:"typedef",b:"\\b(data|(new)?type)\\b",e:"$",k:"data family type newtype deriving",c:[e,g,d,c,a]},{cN:"default",bK:"default",e:"$",c:[d,c,g]},{cN:"infix",bK:"infix infixl infixr",e:"$",c:[f.CNM,g]},{cN:"foreign",b:"\\bforeign\\b",e:"$",k:"foreign import export ccall stdcall cplusplus jvm dotnet safe unsafe",c:[d,f.QSM,g]},{cN:"shebang",b:"#!\\/usr\\/bin\\/env runhaskell",e:"$"},e,g,b,f.QSM,f.CNM,d,f.inherit(f.TM,{b:"^[_a-z][\\w']*"}),{b:"->|<-"}]}});hljs.registerLanguage("1c",function(b){var f="[a-zA-Zа-яА-Я][a-zA-Z0-9_а-яА-Я]*";var c="возврат дата для если и или иначе иначеесли исключение конецесли конецпопытки конецпроцедуры конецфункции конеццикла константа не перейти перем перечисление по пока попытка прервать продолжить процедура строка тогда фс функция цикл число экспорт";var e="ansitooem oemtoansi ввестивидсубконто ввестидату ввестизначение ввестиперечисление ввестипериод ввестиплансчетов ввестистроку ввестичисло вопрос восстановитьзначение врег выбранныйплансчетов вызватьисключение датагод датамесяц датачисло добавитьмесяц завершитьработусистемы заголовоксистемы записьжурналарегистрации запуститьприложение зафиксироватьтранзакцию значениевстроку значениевстрокувнутр значениевфайл значениеизстроки значениеизстрокивнутр значениеизфайла имякомпьютера имяпользователя каталогвременныхфайлов каталогиб каталогпользователя каталогпрограммы кодсимв командасистемы конгода конецпериодаби конецрассчитанногопериодаби конецстандартногоинтервала конквартала конмесяца коннедели лев лог лог10 макс максимальноеколичествосубконто мин монопольныйрежим названиеинтерфейса названиенабораправ назначитьвид назначитьсчет найти найтипомеченныенаудаление найтиссылки началопериодаби началостандартногоинтервала начатьтранзакцию начгода начквартала начмесяца начнедели номерднягода номерднянедели номернеделигода нрег обработкаожидания окр описаниеошибки основнойжурналрасчетов основнойплансчетов основнойязык открытьформу открытьформумодально отменитьтранзакцию очиститьокносообщений периодстр полноеимяпользователя получитьвремята получитьдатута получитьдокументта получитьзначенияотбора получитьпозициюта получитьпустоезначение получитьта прав праводоступа предупреждение префиксавтонумерации пустаястрока пустоезначение рабочаядаттьпустоезначение рабочаядата разделительстраниц разделительстрок разм разобратьпозициюдокумента рассчитатьрегистрына рассчитатьрегистрыпо сигнал симв символтабуляции создатьобъект сокрл сокрлп сокрп сообщить состояние сохранитьзначение сред статусвозврата стрдлина стрзаменить стрколичествострок стрполучитьстроку стрчисловхождений сформироватьпозициюдокумента счетпокоду текущаядата текущеевремя типзначения типзначениястр удалитьобъекты установитьтана установитьтапо фиксшаблон формат цел шаблон";var a={cN:"dquote",b:'""'};var d={cN:"string",b:'"',e:'"|$',c:[a]};var g={cN:"string",b:"\\|",e:'"|$',c:[a]};return{cI:true,l:f,k:{keyword:c,built_in:e},c:[b.CLCM,b.NM,d,g,{cN:"function",b:"(процедура|функция)",e:"$",l:f,k:"процедура функция",c:[b.inherit(b.TM,{b:f}),{cN:"tail",eW:true,c:[{cN:"params",b:"\\(",e:"\\)",l:f,k:"знач",c:[d,g]},{cN:"export",b:"экспорт",eW:true,l:f,k:"экспорт",c:[b.CLCM]}]},b.CLCM]},{cN:"preprocessor",b:"#",e:"$"},{cN:"date",b:"'\\d{2}\\.\\d{2}\\.(\\d{2}|\\d{4})'"}]}});hljs.registerLanguage("x86asm",function(a){return{cI:true,l:"\\.?"+a.IR,k:{keyword:"lock rep repe repz repne repnz xaquire xrelease bnd nobnd aaa aad aam aas adc add and arpl bb0_reset bb1_reset bound bsf bsr bswap bt btc btr bts call cbw cdq cdqe clc cld cli clts cmc cmp cmpsb cmpsd cmpsq cmpsw cmpxchg cmpxchg486 cmpxchg8b cmpxchg16b cpuid cpu_read cpu_write cqo cwd cwde daa das dec div dmint emms enter equ f2xm1 fabs fadd faddp fbld fbstp fchs fclex fcmovb fcmovbe fcmove fcmovnb fcmovnbe fcmovne fcmovnu fcmovu fcom fcomi fcomip fcomp fcompp fcos fdecstp fdisi fdiv fdivp fdivr fdivrp femms feni ffree ffreep fiadd ficom ficomp fidiv fidivr fild fimul fincstp finit fist fistp fisttp fisub fisubr fld fld1 fldcw fldenv fldl2e fldl2t fldlg2 fldln2 fldpi fldz fmul fmulp fnclex fndisi fneni fninit fnop fnsave fnstcw fnstenv fnstsw fpatan fprem fprem1 fptan frndint frstor fsave fscale fsetpm fsin fsincos fsqrt fst fstcw fstenv fstp fstsw fsub fsubp fsubr fsubrp ftst fucom fucomi fucomip fucomp fucompp fxam fxch fxtract fyl2x fyl2xp1 hlt ibts icebp idiv imul in inc incbin insb insd insw int int01 int1 int03 int3 into invd invpcid invlpg invlpga iret iretd iretq iretw jcxz jecxz jrcxz jmp jmpe lahf lar lds lea leave les lfence lfs lgdt lgs lidt lldt lmsw loadall loadall286 lodsb lodsd lodsq lodsw loop loope loopne loopnz loopz lsl lss ltr mfence monitor mov movd movq movsb movsd movsq movsw movsx movsxd movzx mul mwait neg nop not or out outsb outsd outsw packssdw packsswb packuswb paddb paddd paddsb paddsiw paddsw paddusb paddusw paddw pand pandn pause paveb pavgusb pcmpeqb pcmpeqd pcmpeqw pcmpgtb pcmpgtd pcmpgtw pdistib pf2id pfacc pfadd pfcmpeq pfcmpge pfcmpgt pfmax pfmin pfmul pfrcp pfrcpit1 pfrcpit2 pfrsqit1 pfrsqrt pfsub pfsubr pi2fd pmachriw pmaddwd pmagw pmulhriw pmulhrwa pmulhrwc pmulhw pmullw pmvgezb pmvlzb pmvnzb pmvzb pop popa popad popaw popf popfd popfq popfw por prefetch prefetchw pslld psllq psllw psrad psraw psrld psrlq psrlw psubb psubd psubsb psubsiw psubsw psubusb psubusw psubw punpckhbw punpckhdq punpckhwd punpcklbw punpckldq punpcklwd push pusha pushad pushaw pushf pushfd pushfq pushfw pxor rcl rcr rdshr rdmsr rdpmc rdtsc rdtscp ret retf retn rol ror rdm rsdc rsldt rsm rsts sahf sal salc sar sbb scasb scasd scasq scasw sfence sgdt shl shld shr shrd sidt sldt skinit smi smint smintold smsw stc std sti stosb stosd stosq stosw str sub svdc svldt svts swapgs syscall sysenter sysexit sysret test ud0 ud1 ud2b ud2 ud2a umov verr verw fwait wbinvd wrshr wrmsr xadd xbts xchg xlatb xlat xor cmove cmovz cmovne cmovnz cmova cmovnbe cmovae cmovnb cmovb cmovnae cmovbe cmovna cmovg cmovnle cmovge cmovnl cmovl cmovnge cmovle cmovng cmovc cmovnc cmovo cmovno cmovs cmovns cmovp cmovpe cmovnp cmovpo je jz jne jnz ja jnbe jae jnb jb jnae jbe jna jg jnle jge jnl jl jnge jle jng jc jnc jo jno js jns jpo jnp jpe jp sete setz setne setnz seta setnbe setae setnb setnc setb setnae setcset setbe setna setg setnle setge setnl setl setnge setle setng sets setns seto setno setpe setp setpo setnp addps addss andnps andps cmpeqps cmpeqss cmpleps cmpless cmpltps cmpltss cmpneqps cmpneqss cmpnleps cmpnless cmpnltps cmpnltss cmpordps cmpordss cmpunordps cmpunordss cmpps cmpss comiss cvtpi2ps cvtps2pi cvtsi2ss cvtss2si cvttps2pi cvttss2si divps divss ldmxcsr maxps maxss minps minss movaps movhps movlhps movlps movhlps movmskps movntps movss movups mulps mulss orps rcpps rcpss rsqrtps rsqrtss shufps sqrtps sqrtss stmxcsr subps subss ucomiss unpckhps unpcklps xorps fxrstor fxrstor64 fxsave fxsave64 xgetbv xsetbv xsave xsave64 xsaveopt xsaveopt64 xrstor xrstor64 prefetchnta prefetcht0 prefetcht1 prefetcht2 maskmovq movntq pavgb pavgw pextrw pinsrw pmaxsw pmaxub pminsw pminub pmovmskb pmulhuw psadbw pshufw pf2iw pfnacc pfpnacc pi2fw pswapd maskmovdqu clflush movntdq movnti movntpd movdqa movdqu movdq2q movq2dq paddq pmuludq pshufd pshufhw pshuflw pslldq psrldq psubq punpckhqdq punpcklqdq addpd addsd andnpd andpd cmpeqpd cmpeqsd cmplepd cmplesd cmpltpd cmpltsd cmpneqpd cmpneqsd cmpnlepd cmpnlesd cmpnltpd cmpnltsd cmpordpd cmpordsd cmpunordpd cmpunordsd cmppd comisd cvtdq2pd cvtdq2ps cvtpd2dq cvtpd2pi cvtpd2ps cvtpi2pd cvtps2dq cvtps2pd cvtsd2si cvtsd2ss cvtsi2sd cvtss2sd cvttpd2pi cvttpd2dq cvttps2dq cvttsd2si divpd divsd maxpd maxsd minpd minsd movapd movhpd movlpd movmskpd movupd mulpd mulsd orpd shufpd sqrtpd sqrtsd subpd subsd ucomisd unpckhpd unpcklpd xorpd addsubpd addsubps haddpd haddps hsubpd hsubps lddqu movddup movshdup movsldup clgi stgi vmcall vmclear vmfunc vmlaunch vmload vmmcall vmptrld vmptrst vmread vmresume vmrun vmsave vmwrite vmxoff vmxon invept invvpid pabsb pabsw pabsd palignr phaddw phaddd phaddsw phsubw phsubd phsubsw pmaddubsw pmulhrsw pshufb psignb psignw psignd extrq insertq movntsd movntss lzcnt blendpd blendps blendvpd blendvps dppd dpps extractps insertps movntdqa mpsadbw packusdw pblendvb pblendw pcmpeqq pextrb pextrd pextrq phminposuw pinsrb pinsrd pinsrq pmaxsb pmaxsd pmaxud pmaxuw pminsb pminsd pminud pminuw pmovsxbw pmovsxbd pmovsxbq pmovsxwd pmovsxwq pmovsxdq pmovzxbw pmovzxbd pmovzxbq pmovzxwd pmovzxwq pmovzxdq pmuldq pmulld ptest roundpd roundps roundsd roundss crc32 pcmpestri pcmpestrm pcmpistri pcmpistrm pcmpgtq popcnt getsec pfrcpv pfrsqrtv movbe aesenc aesenclast aesdec aesdeclast aesimc aeskeygenassist vaesenc vaesenclast vaesdec vaesdeclast vaesimc vaeskeygenassist vaddpd vaddps vaddsd vaddss vaddsubpd vaddsubps vandpd vandps vandnpd vandnps vblendpd vblendps vblendvpd vblendvps vbroadcastss vbroadcastsd vbroadcastf128 vcmpeq_ospd vcmpeqpd vcmplt_ospd vcmpltpd vcmple_ospd vcmplepd vcmpunord_qpd vcmpunordpd vcmpneq_uqpd vcmpneqpd vcmpnlt_uspd vcmpnltpd vcmpnle_uspd vcmpnlepd vcmpord_qpd vcmpordpd vcmpeq_uqpd vcmpnge_uspd vcmpngepd vcmpngt_uspd vcmpngtpd vcmpfalse_oqpd vcmpfalsepd vcmpneq_oqpd vcmpge_ospd vcmpgepd vcmpgt_ospd vcmpgtpd vcmptrue_uqpd vcmptruepd vcmplt_oqpd vcmple_oqpd vcmpunord_spd vcmpneq_uspd vcmpnlt_uqpd vcmpnle_uqpd vcmpord_spd vcmpeq_uspd vcmpnge_uqpd vcmpngt_uqpd vcmpfalse_ospd vcmpneq_ospd vcmpge_oqpd vcmpgt_oqpd vcmptrue_uspd vcmppd vcmpeq_osps vcmpeqps vcmplt_osps vcmpltps vcmple_osps vcmpleps vcmpunord_qps vcmpunordps vcmpneq_uqps vcmpneqps vcmpnlt_usps vcmpnltps vcmpnle_usps vcmpnleps vcmpord_qps vcmpordps vcmpeq_uqps vcmpnge_usps vcmpngeps vcmpngt_usps vcmpngtps vcmpfalse_oqps vcmpfalseps vcmpneq_oqps vcmpge_osps vcmpgeps vcmpgt_osps vcmpgtps vcmptrue_uqps vcmptrueps vcmplt_oqps vcmple_oqps vcmpunord_sps vcmpneq_usps vcmpnlt_uqps vcmpnle_uqps vcmpord_sps vcmpeq_usps vcmpnge_uqps vcmpngt_uqps vcmpfalse_osps vcmpneq_osps vcmpge_oqps vcmpgt_oqps vcmptrue_usps vcmpps vcmpeq_ossd vcmpeqsd vcmplt_ossd vcmpltsd vcmple_ossd vcmplesd vcmpunord_qsd vcmpunordsd vcmpneq_uqsd vcmpneqsd vcmpnlt_ussd vcmpnltsd vcmpnle_ussd vcmpnlesd vcmpord_qsd vcmpordsd vcmpeq_uqsd vcmpnge_ussd vcmpngesd vcmpngt_ussd vcmpngtsd vcmpfalse_oqsd vcmpfalsesd vcmpneq_oqsd vcmpge_ossd vcmpgesd vcmpgt_ossd vcmpgtsd vcmptrue_uqsd vcmptruesd vcmplt_oqsd vcmple_oqsd vcmpunord_ssd vcmpneq_ussd vcmpnlt_uqsd vcmpnle_uqsd vcmpord_ssd vcmpeq_ussd vcmpnge_uqsd vcmpngt_uqsd vcmpfalse_ossd vcmpneq_ossd vcmpge_oqsd vcmpgt_oqsd vcmptrue_ussd vcmpsd vcmpeq_osss vcmpeqss vcmplt_osss vcmpltss vcmple_osss vcmpless vcmpunord_qss vcmpunordss vcmpneq_uqss vcmpneqss vcmpnlt_usss vcmpnltss vcmpnle_usss vcmpnless vcmpord_qss vcmpordss vcmpeq_uqss vcmpnge_usss vcmpngess vcmpngt_usss vcmpngtss vcmpfalse_oqss vcmpfalsess vcmpneq_oqss vcmpge_osss vcmpgess vcmpgt_osss vcmpgtss vcmptrue_uqss vcmptruess vcmplt_oqss vcmple_oqss vcmpunord_sss vcmpneq_usss vcmpnlt_uqss vcmpnle_uqss vcmpord_sss vcmpeq_usss vcmpnge_uqss vcmpngt_uqss vcmpfalse_osss vcmpneq_osss vcmpge_oqss vcmpgt_oqss vcmptrue_usss vcmpss vcomisd vcomiss vcvtdq2pd vcvtdq2ps vcvtpd2dq vcvtpd2ps vcvtps2dq vcvtps2pd vcvtsd2si vcvtsd2ss vcvtsi2sd vcvtsi2ss vcvtss2sd vcvtss2si vcvttpd2dq vcvttps2dq vcvttsd2si vcvttss2si vdivpd vdivps vdivsd vdivss vdppd vdpps vextractf128 vextractps vhaddpd vhaddps vhsubpd vhsubps vinsertf128 vinsertps vlddqu vldqqu vldmxcsr vmaskmovdqu vmaskmovps vmaskmovpd vmaxpd vmaxps vmaxsd vmaxss vminpd vminps vminsd vminss vmovapd vmovaps vmovd vmovq vmovddup vmovdqa vmovqqa vmovdqu vmovqqu vmovhlps vmovhpd vmovhps vmovlhps vmovlpd vmovlps vmovmskpd vmovmskps vmovntdq vmovntqq vmovntdqa vmovntpd vmovntps vmovsd vmovshdup vmovsldup vmovss vmovupd vmovups vmpsadbw vmulpd vmulps vmulsd vmulss vorpd vorps vpabsb vpabsw vpabsd vpacksswb vpackssdw vpackuswb vpackusdw vpaddb vpaddw vpaddd vpaddq vpaddsb vpaddsw vpaddusb vpaddusw vpalignr vpand vpandn vpavgb vpavgw vpblendvb vpblendw vpcmpestri vpcmpestrm vpcmpistri vpcmpistrm vpcmpeqb vpcmpeqw vpcmpeqd vpcmpeqq vpcmpgtb vpcmpgtw vpcmpgtd vpcmpgtq vpermilpd vpermilps vperm2f128 vpextrb vpextrw vpextrd vpextrq vphaddw vphaddd vphaddsw vphminposuw vphsubw vphsubd vphsubsw vpinsrb vpinsrw vpinsrd vpinsrq vpmaddwd vpmaddubsw vpmaxsb vpmaxsw vpmaxsd vpmaxub vpmaxuw vpmaxud vpminsb vpminsw vpminsd vpminub vpminuw vpminud vpmovmskb vpmovsxbw vpmovsxbd vpmovsxbq vpmovsxwd vpmovsxwq vpmovsxdq vpmovzxbw vpmovzxbd vpmovzxbq vpmovzxwd vpmovzxwq vpmovzxdq vpmulhuw vpmulhrsw vpmulhw vpmullw vpmulld vpmuludq vpmuldq vpor vpsadbw vpshufb vpshufd vpshufhw vpshuflw vpsignb vpsignw vpsignd vpslldq vpsrldq vpsllw vpslld vpsllq vpsraw vpsrad vpsrlw vpsrld vpsrlq vptest vpsubb vpsubw vpsubd vpsubq vpsubsb vpsubsw vpsubusb vpsubusw vpunpckhbw vpunpckhwd vpunpckhdq vpunpckhqdq vpunpcklbw vpunpcklwd vpunpckldq vpunpcklqdq vpxor vrcpps vrcpss vrsqrtps vrsqrtss vroundpd vroundps vroundsd vroundss vshufpd vshufps vsqrtpd vsqrtps vsqrtsd vsqrtss vstmxcsr vsubpd vsubps vsubsd vsubss vtestps vtestpd vucomisd vucomiss vunpckhpd vunpckhps vunpcklpd vunpcklps vxorpd vxorps vzeroall vzeroupper pclmullqlqdq pclmulhqlqdq pclmullqhqdq pclmulhqhqdq pclmulqdq vpclmullqlqdq vpclmulhqlqdq vpclmullqhqdq vpclmulhqhqdq vpclmulqdq vfmadd132ps vfmadd132pd vfmadd312ps vfmadd312pd vfmadd213ps vfmadd213pd vfmadd123ps vfmadd123pd vfmadd231ps vfmadd231pd vfmadd321ps vfmadd321pd vfmaddsub132ps vfmaddsub132pd vfmaddsub312ps vfmaddsub312pd vfmaddsub213ps vfmaddsub213pd vfmaddsub123ps vfmaddsub123pd vfmaddsub231ps vfmaddsub231pd vfmaddsub321ps vfmaddsub321pd vfmsub132ps vfmsub132pd vfmsub312ps vfmsub312pd vfmsub213ps vfmsub213pd vfmsub123ps vfmsub123pd vfmsub231ps vfmsub231pd vfmsub321ps vfmsub321pd vfmsubadd132ps vfmsubadd132pd vfmsubadd312ps vfmsubadd312pd vfmsubadd213ps vfmsubadd213pd vfmsubadd123ps vfmsubadd123pd vfmsubadd231ps vfmsubadd231pd vfmsubadd321ps vfmsubadd321pd vfnmadd132ps vfnmadd132pd vfnmadd312ps vfnmadd312pd vfnmadd213ps vfnmadd213pd vfnmadd123ps vfnmadd123pd vfnmadd231ps vfnmadd231pd vfnmadd321ps vfnmadd321pd vfnmsub132ps vfnmsub132pd vfnmsub312ps vfnmsub312pd vfnmsub213ps vfnmsub213pd vfnmsub123ps vfnmsub123pd vfnmsub231ps vfnmsub231pd vfnmsub321ps vfnmsub321pd vfmadd132ss vfmadd132sd vfmadd312ss vfmadd312sd vfmadd213ss vfmadd213sd vfmadd123ss vfmadd123sd vfmadd231ss vfmadd231sd vfmadd321ss vfmadd321sd vfmsub132ss vfmsub132sd vfmsub312ss vfmsub312sd vfmsub213ss vfmsub213sd vfmsub123ss vfmsub123sd vfmsub231ss vfmsub231sd vfmsub321ss vfmsub321sd vfnmadd132ss vfnmadd132sd vfnmadd312ss vfnmadd312sd vfnmadd213ss vfnmadd213sd vfnmadd123ss vfnmadd123sd vfnmadd231ss vfnmadd231sd vfnmadd321ss vfnmadd321sd vfnmsub132ss vfnmsub132sd vfnmsub312ss vfnmsub312sd vfnmsub213ss vfnmsub213sd vfnmsub123ss vfnmsub123sd vfnmsub231ss vfnmsub231sd vfnmsub321ss vfnmsub321sd rdfsbase rdgsbase rdrand wrfsbase wrgsbase vcvtph2ps vcvtps2ph adcx adox rdseed clac stac xstore xcryptecb xcryptcbc xcryptctr xcryptcfb xcryptofb montmul xsha1 xsha256 llwpcb slwpcb lwpval lwpins vfmaddpd vfmaddps vfmaddsd vfmaddss vfmaddsubpd vfmaddsubps vfmsubaddpd vfmsubaddps vfmsubpd vfmsubps vfmsubsd vfmsubss vfnmaddpd vfnmaddps vfnmaddsd vfnmaddss vfnmsubpd vfnmsubps vfnmsubsd vfnmsubss vfrczpd vfrczps vfrczsd vfrczss vpcmov vpcomb vpcomd vpcomq vpcomub vpcomud vpcomuq vpcomuw vpcomw vphaddbd vphaddbq vphaddbw vphadddq vphaddubd vphaddubq vphaddubw vphaddudq vphadduwd vphadduwq vphaddwd vphaddwq vphsubbw vphsubdq vphsubwd vpmacsdd vpmacsdqh vpmacsdql vpmacssdd vpmacssdqh vpmacssdql vpmacsswd vpmacssww vpmacswd vpmacsww vpmadcsswd vpmadcswd vpperm vprotb vprotd vprotq vprotw vpshab vpshad vpshaq vpshaw vpshlb vpshld vpshlq vpshlw vbroadcasti128 vpblendd vpbroadcastb vpbroadcastw vpbroadcastd vpbroadcastq vpermd vpermpd vpermps vpermq vperm2i128 vextracti128 vinserti128 vpmaskmovd vpmaskmovq vpsllvd vpsllvq vpsravd vpsrlvd vpsrlvq vgatherdpd vgatherqpd vgatherdps vgatherqps vpgatherdd vpgatherqd vpgatherdq vpgatherqq xabort xbegin xend xtest andn bextr blci blcic blsi blsic blcfill blsfill blcmsk blsmsk blsr blcs bzhi mulx pdep pext rorx sarx shlx shrx tzcnt tzmsk t1mskc valignd valignq vblendmpd vblendmps vbroadcastf32x4 vbroadcastf64x4 vbroadcasti32x4 vbroadcasti64x4 vcompresspd vcompressps vcvtpd2udq vcvtps2udq vcvtsd2usi vcvtss2usi vcvttpd2udq vcvttps2udq vcvttsd2usi vcvttss2usi vcvtudq2pd vcvtudq2ps vcvtusi2sd vcvtusi2ss vexpandpd vexpandps vextractf32x4 vextractf64x4 vextracti32x4 vextracti64x4 vfixupimmpd vfixupimmps vfixupimmsd vfixupimmss vgetexppd vgetexpps vgetexpsd vgetexpss vgetmantpd vgetmantps vgetmantsd vgetmantss vinsertf32x4 vinsertf64x4 vinserti32x4 vinserti64x4 vmovdqa32 vmovdqa64 vmovdqu32 vmovdqu64 vpabsq vpandd vpandnd vpandnq vpandq vpblendmd vpblendmq vpcmpltd vpcmpled vpcmpneqd vpcmpnltd vpcmpnled vpcmpd vpcmpltq vpcmpleq vpcmpneqq vpcmpnltq vpcmpnleq vpcmpq vpcmpequd vpcmpltud vpcmpleud vpcmpnequd vpcmpnltud vpcmpnleud vpcmpud vpcmpequq vpcmpltuq vpcmpleuq vpcmpnequq vpcmpnltuq vpcmpnleuq vpcmpuq vpcompressd vpcompressq vpermi2d vpermi2pd vpermi2ps vpermi2q vpermt2d vpermt2pd vpermt2ps vpermt2q vpexpandd vpexpandq vpmaxsq vpmaxuq vpminsq vpminuq vpmovdb vpmovdw vpmovqb vpmovqd vpmovqw vpmovsdb vpmovsdw vpmovsqb vpmovsqd vpmovsqw vpmovusdb vpmovusdw vpmovusqb vpmovusqd vpmovusqw vpord vporq vprold vprolq vprolvd vprolvq vprord vprorq vprorvd vprorvq vpscatterdd vpscatterdq vpscatterqd vpscatterqq vpsraq vpsravq vpternlogd vpternlogq vptestmd vptestmq vptestnmd vptestnmq vpxord vpxorq vrcp14pd vrcp14ps vrcp14sd vrcp14ss vrndscalepd vrndscaleps vrndscalesd vrndscaless vrsqrt14pd vrsqrt14ps vrsqrt14sd vrsqrt14ss vscalefpd vscalefps vscalefsd vscalefss vscatterdpd vscatterdps vscatterqpd vscatterqps vshuff32x4 vshuff64x2 vshufi32x4 vshufi64x2 kandnw kandw kmovw knotw kortestw korw kshiftlw kshiftrw kunpckbw kxnorw kxorw vpbroadcastmb2q vpbroadcastmw2d vpconflictd vpconflictq vplzcntd vplzcntq vexp2pd vexp2ps vrcp28pd vrcp28ps vrcp28sd vrcp28ss vrsqrt28pd vrsqrt28ps vrsqrt28sd vrsqrt28ss vgatherpf0dpd vgatherpf0dps vgatherpf0qpd vgatherpf0qps vgatherpf1dpd vgatherpf1dps vgatherpf1qpd vgatherpf1qps vscatterpf0dpd vscatterpf0dps vscatterpf0qpd vscatterpf0qps vscatterpf1dpd vscatterpf1dps vscatterpf1qpd vscatterpf1qps prefetchwt1 bndmk bndcl bndcu bndcn bndmov bndldx bndstx sha1rnds4 sha1nexte sha1msg1 sha1msg2 sha256rnds2 sha256msg1 sha256msg2 hint_nop0 hint_nop1 hint_nop2 hint_nop3 hint_nop4 hint_nop5 hint_nop6 hint_nop7 hint_nop8 hint_nop9 hint_nop10 hint_nop11 hint_nop12 hint_nop13 hint_nop14 hint_nop15 hint_nop16 hint_nop17 hint_nop18 hint_nop19 hint_nop20 hint_nop21 hint_nop22 hint_nop23 hint_nop24 hint_nop25 hint_nop26 hint_nop27 hint_nop28 hint_nop29 hint_nop30 hint_nop31 hint_nop32 hint_nop33 hint_nop34 hint_nop35 hint_nop36 hint_nop37 hint_nop38 hint_nop39 hint_nop40 hint_nop41 hint_nop42 hint_nop43 hint_nop44 hint_nop45 hint_nop46 hint_nop47 hint_nop48 hint_nop49 hint_nop50 hint_nop51 hint_nop52 hint_nop53 hint_nop54 hint_nop55 hint_nop56 hint_nop57 hint_nop58 hint_nop59 hint_nop60 hint_nop61 hint_nop62 hint_nop63",literal:"ip eip rip al ah bl bh cl ch dl dh sil dil bpl spl r8b r9b r10b r11b r12b r13b r14b r15b ax bx cx dx si di bp sp r8w r9w r10w r11w r12w r13w r14w r15w eax ebx ecx edx esi edi ebp esp eip r8d r9d r10d r11d r12d r13d r14d r15d rax rbx rcx rdx rsi rdi rbp rsp r8 r9 r10 r11 r12 r13 r14 r15 cs ds es fs gs ss st st0 st1 st2 st3 st4 st5 st6 st7 mm0 mm1 mm2 mm3 mm4 mm5 mm6 mm7 xmm0 xmm1 xmm2 xmm3 xmm4 xmm5 xmm6 xmm7 xmm8 xmm9 xmm10 xmm11 xmm12 xmm13 xmm14 xmm15 xmm16 xmm17 xmm18 xmm19 xmm20 xmm21 xmm22 xmm23 xmm24 xmm25 xmm26 xmm27 xmm28 xmm29 xmm30 xmm31 ymm0 ymm1 ymm2 ymm3 ymm4 ymm5 ymm6 ymm7 ymm8 ymm9 ymm10 ymm11 ymm12 ymm13 ymm14 ymm15 ymm16 ymm17 ymm18 ymm19 ymm20 ymm21 ymm22 ymm23 ymm24 ymm25 ymm26 ymm27 ymm28 ymm29 ymm30 ymm31 zmm0 zmm1 zmm2 zmm3 zmm4 zmm5 zmm6 zmm7 zmm8 zmm9 zmm10 zmm11 zmm12 zmm13 zmm14 zmm15 zmm16 zmm17 zmm18 zmm19 zmm20 zmm21 zmm22 zmm23 zmm24 zmm25 zmm26 zmm27 zmm28 zmm29 zmm30 zmm31 k0 k1 k2 k3 k4 k5 k6 k7 bnd0 bnd1 bnd2 bnd3 cr0 cr1 cr2 cr3 cr4 cr8 dr0 dr1 dr2 dr3 dr8 tr3 tr4 tr5 tr6 tr7 r0 r1 r2 r3 r4 r5 r6 r7 r0b r1b r2b r3b r4b r5b r6b r7b r0w r1w r2w r3w r4w r5w r6w r7w r0d r1d r2d r3d r4d r5d r6d r7d r0h r1h r2h r3h r0l r1l r2l r3l r4l r5l r6l r7l r8l r9l r10l r11l r12l r13l r14l r15l",pseudo:"db dw dd dq dt ddq do dy dz resb resw resd resq rest resdq reso resy resz incbin equ times",preprocessor:"%define %xdefine %+ %undef %defstr %deftok %assign %strcat %strlen %substr %rotate %elif %else %endif %ifmacro %ifctx %ifidn %ifidni %ifid %ifnum %ifstr %iftoken %ifempty %ifenv %error %warning %fatal %rep %endrep %include %push %pop %repl %pathsearch %depend %use %arg %stacksize %local %line %comment %endcomment .nolist byte word dword qword nosplit rel abs seg wrt strict near far a32 ptr __FILE__ __LINE__ __SECT__ __BITS__ __OUTPUT_FORMAT__ __DATE__ __TIME__ __DATE_NUM__ __TIME_NUM__ __UTC_DATE__ __UTC_TIME__ __UTC_DATE_NUM__ __UTC_TIME_NUM__ __PASS__ struc endstruc istruc at iend align alignb sectalign daz nodaz up down zero default option assume public ",built_in:"bits use16 use32 use64 default section segment absolute extern global common cpu float __utf16__ __utf16le__ __utf16be__ __utf32__ __utf32le__ __utf32be__ __float8__ __float16__ __float32__ __float64__ __float80m__ __float80e__ __float128l__ __float128h__ __Infinity__ __QNaN__ __SNaN__ Inf NaN QNaN SNaN float8 float16 float32 float64 float80m float80e float128l float128h __FLOAT_DAZ__ __FLOAT_ROUND__ __FLOAT__"},c:[{cN:"comment",b:";",e:"$",r:0},{cN:"number",b:"\\b(?:([0-9][0-9_]*)?\\.[0-9_]*(?:[eE][+-]?[0-9_]+)?|(0[Xx])?[0-9][0-9_]*\\.?[0-9_]*(?:[pP](?:[+-]?[0-9_]+)?)?)\\b",r:0},{cN:"number",b:"\\$[0-9][0-9A-Fa-f]*",r:0},{cN:"number",b:"\\b(?:[0-9A-Fa-f][0-9A-Fa-f_]*[HhXx]|[0-9][0-9_]*[DdTt]?|[0-7][0-7_]*[QqOo]|[0-1][0-1_]*[BbYy])\\b"},{cN:"number",b:"\\b(?:0[HhXx][0-9A-Fa-f_]+|0[DdTt][0-9_]+|0[QqOo][0-7_]+|0[BbYy][0-1_]+)\\b"},a.QSM,{cN:"string",b:"'",e:"[^\\\\]'",r:0},{cN:"string",b:"`",e:"[^\\\\]`",r:0},{cN:"string",b:"\\.[A-Za-z0-9]+",r:0},{cN:"label",b:"^\\s*[A-Za-z._?][A-Za-z0-9_$#@~.?]*(:|\\s+label)",r:0},{cN:"label",b:"^\\s*%%[A-Za-z0-9_$#@~.?]*:",r:0},{cN:"argument",b:"%[0-9]+",r:0},{cN:"built_in",b:"%!S+",r:0}]}});hljs.registerLanguage("python",function(a){var f={cN:"prompt",b:/^(>>>|\.\.\.) /};var b={cN:"string",c:[a.BE],v:[{b:/(u|b)?r?'''/,e:/'''/,c:[f],r:10},{b:/(u|b)?r?"""/,e:/"""/,c:[f],r:10},{b:/(u|r|ur)'/,e:/'/,r:10},{b:/(u|r|ur)"/,e:/"/,r:10},{b:/(b|br)'/,e:/'/},{b:/(b|br)"/,e:/"/},a.ASM,a.QSM]};var d={cN:"number",r:0,v:[{b:a.BNR+"[lLjJ]?"},{b:"\\b(0o[0-7]+)[lLjJ]?"},{b:a.CNR+"[lLjJ]?"}]};var e={cN:"params",b:/\(/,e:/\)/,c:["self",f,d,b]};var c={e:/:/,i:/[${=;\n]/,c:[a.UTM,e]};return{aliases:["py","gyp"],k:{keyword:"and elif is global as in if from raise for except finally print import pass return exec else break not with class assert yield try while continue del or def lambda nonlocal|10 None True False",built_in:"Ellipsis NotImplemented"},i:/(<\/|->|\?)/,c:[f,d,b,a.HCM,a.inherit(c,{cN:"function",bK:"def",r:10}),a.inherit(c,{cN:"class",bK:"class"}),{cN:"decorator",b:/@/,e:/$/},{b:/\b(print|exec)\(/}]}});hljs.registerLanguage("smalltalk",function(a){var b="[a-z][a-zA-Z0-9_]*";var d={cN:"char",b:"\\$.{1}"};var c={cN:"symbol",b:"#"+a.UIR};return{aliases:["st"],k:"self super nil true false thisContext",c:[{cN:"comment",b:'"',e:'"'},a.ASM,{cN:"class",b:"\\b[A-Z][A-Za-z0-9_]*",r:0},{cN:"method",b:b+":",r:0},a.CNM,c,d,{cN:"localvars",b:"\\|[ ]*"+b+"([ ]+"+b+")*[ ]*\\|",rB:true,e:/\|/,i:/\S/,c:[{b:"(\\|[ ]*)?"+b}]},{cN:"array",b:"\\#\\(",e:"\\)",c:[a.ASM,d,a.CNM,c]}]}});hljs.registerLanguage("tex",function(a){var d={cN:"command",b:"\\\\[a-zA-Zа-яА-я]+[\\*]?"};var c={cN:"command",b:"\\\\[^a-zA-Zа-яА-я0-9]"};var b={cN:"special",b:"[{}\\[\\]\\&#~]",r:0};return{c:[{b:"\\\\[a-zA-Zа-яА-я]+[\\*]? *= *-?\\d*\\.?\\d+(pt|pc|mm|cm|in|dd|cc|ex|em)?",rB:true,c:[d,c,{cN:"number",b:" *=",e:"-?\\d*\\.?\\d+(pt|pc|mm|cm|in|dd|cc|ex|em)?",eB:true}],r:10},d,c,b,{cN:"formula",b:"\\$\\$",e:"\\$\\$",c:[d,c,b],r:0},{cN:"formula",b:"\\$",e:"\\$",c:[d,c,b],r:0},{cN:"comment",b:"%",e:"$",r:0}]}});hljs.registerLanguage("actionscript",function(a){var c="[a-zA-Z_$][a-zA-Z0-9_$]*";var b="([*]|[a-zA-Z_$][a-zA-Z0-9_$]*)";var d={cN:"rest_arg",b:"[.]{3}",e:c,r:10};return{aliases:["as"],k:{keyword:"as break case catch class const continue default delete do dynamic each else extends final finally for function get if implements import in include instanceof interface internal is namespace native new override package private protected public return set static super switch this throw try typeof use var void while with",literal:"true false null undefined"},c:[a.ASM,a.QSM,a.CLCM,a.CBCM,a.CNM,{cN:"package",bK:"package",e:"{",c:[a.TM]},{cN:"class",bK:"class interface",e:"{",eE:true,c:[{bK:"extends implements"},a.TM]},{cN:"preprocessor",bK:"import include",e:";"},{cN:"function",bK:"function",e:"[{;]",eE:true,i:"\\S",c:[a.TM,{cN:"params",b:"\\(",e:"\\)",c:[a.ASM,a.QSM,a.CLCM,a.CBCM,d]},{cN:"type",b:":",e:b,r:10}]}]}});hljs.registerLanguage("sql",function(a){var b={cN:"comment",b:"--",e:"$"};return{cI:true,i:/[<>]/,c:[{cN:"operator",bK:"begin end start commit rollback savepoint lock alter create drop rename call delete do handler insert load replace select truncate update set show pragma grant merge describe use explain help declare prepare execute deallocate savepoint release unlock purge reset change stop analyze cache flush optimize repair kill install uninstall checksum restore check backup",e:/;/,eW:true,k:{keyword:"abs absolute acos action add adddate addtime aes_decrypt aes_encrypt after aggregate all allocate alter analyze and any are as asc ascii asin assertion at atan atan2 atn2 authorization authors avg backup before begin benchmark between bin binlog bit_and bit_count bit_length bit_or bit_xor both by cache call cascade cascaded case cast catalog ceil ceiling chain change changed char_length character_length charindex charset check checksum checksum_agg choose close coalesce coercibility collate collation collationproperty column columns columns_updated commit compress concat concat_ws concurrent connect connection connection_id consistent constraint constraints continue contributors conv convert convert_tz corresponding cos cot count count_big crc32 create cross cume_dist curdate current current_date current_time current_timestamp current_user cursor curtime data database databases datalength date_add date_format date_sub dateadd datediff datefromparts datename datepart datetime2fromparts datetimeoffsetfromparts day dayname dayofmonth dayofweek dayofyear deallocate declare decode default deferrable deferred degrees delayed delete des_decrypt des_encrypt des_key_file desc describe descriptor diagnostics difference disconnect distinct distinctrow div do domain double drop dumpfile each else elt enclosed encode encrypt end end-exec engine engines eomonth errors escape escaped event eventdata events except exception exec execute exists exp explain export_set extended external extract fast fetch field fields find_in_set first first_value floor flush for force foreign format found found_rows from from_base64 from_days from_unixtime full function get get_format get_lock getdate getutcdate global go goto grant grants greatest group group_concat grouping grouping_id gtid_subset gtid_subtract handler having help hex high_priority hosts hour ident_current ident_incr ident_seed identified identity if ifnull ignore iif ilike immediate in index indicator inet6_aton inet6_ntoa inet_aton inet_ntoa infile initially inner innodb input insert install instr intersect into is is_free_lock is_ipv4 is_ipv4_compat is_ipv4_mapped is_not is_not_null is_used_lock isdate isnull isolation join key kill language last last_day last_insert_id last_value lcase lead leading least leaves left len lenght level like limit lines ln load load_file local localtime localtimestamp locate lock log log10 log2 logfile logs low_priority lower lpad ltrim make_set makedate maketime master master_pos_wait match matched max md5 medium merge microsecond mid min minute mod mode module month monthname mutex name_const names national natural nchar next no no_write_to_binlog not now nullif nvarchar oct octet_length of old_password on only open optimize option optionally or ord order outer outfile output pad parse partial partition password patindex percent_rank percentile_cont percentile_disc period_add period_diff pi plugin position pow power pragma precision prepare preserve primary prior privileges procedure procedure_analyze processlist profile profiles public publishingservername purge quarter query quick quote quotename radians rand read references regexp relative relaylog release release_lock rename repair repeat replace replicate reset restore restrict return returns reverse revoke right rlike rollback rollup round row row_count rows rpad rtrim savepoint schema scroll sec_to_time second section select serializable server session session_user set sha sha1 sha2 share show sign sin size slave sleep smalldatetimefromparts snapshot some soname soundex sounds_like space sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sql_variant_property sqlstate sqrt square start starting status std stddev stddev_pop stddev_samp stdev stdevp stop str str_to_date straight_join strcmp string stuff subdate substr substring subtime subtring_index sum switchoffset sysdate sysdatetime sysdatetimeoffset system_user sysutcdatetime table tables tablespace tan temporary terminated tertiary_weights then time time_format time_to_sec timediff timefromparts timestamp timestampadd timestampdiff timezone_hour timezone_minute to to_base64 to_days to_seconds todatetimeoffset trailing transaction translation trigger trigger_nestlevel triggers trim truncate try_cast try_convert try_parse ucase uncompress uncompressed_length unhex unicode uninstall union unique unix_timestamp unknown unlock update upgrade upped upper usage use user user_resources using utc_date utc_time utc_timestamp uuid uuid_short validate_password_strength value values var var_pop var_samp variables variance varp version view warnings week weekday weekofyear weight_string when whenever where with work write xml xor year yearweek zon",literal:"true false null",built_in:"array bigint binary bit blob boolean char character date dec decimal float int integer interval number numeric real serial smallint varchar varying int8 serial8 text"},c:[{cN:"string",b:"'",e:"'",c:[a.BE,{b:"''"}]},{cN:"string",b:'"',e:'"',c:[a.BE,{b:'""'}]},{cN:"string",b:"`",e:"`",c:[a.BE]},a.CNM,a.CBCM,b]},a.CBCM,b]}});hljs.registerLanguage("nix",function(b){var a={keyword:"rec with let in inherit assert if else then",constant:"true false or and null",built_in:"import abort baseNameOf dirOf isNull builtins map removeAttrs throw toString derivation"};var g={cN:"subst",b:/\$\{/,e:/\}/,k:a};var d={cN:"variable",b:/[a-zA-Z0-9-_]+(\s*=)/};var e={cN:"string",b:"''",e:"''",c:[g]};var f={cN:"string",b:'"',e:'"',c:[g]};var c=[b.NM,b.HCM,b.CBCM,e,f,d];g.c=c;return{aliases:["nixos"],k:a,c:c}});hljs.registerLanguage("handlebars",function(b){var a="each in with if else unless bindattr action collection debugger log outlet template unbound view yield";return{aliases:["hbs","html.hbs","html.handlebars"],cI:true,sL:"xml",subLanguageMode:"continuous",c:[{cN:"expression",b:"{{",e:"}}",c:[{cN:"begin-block",b:"#[a-zA-Z- .]+",k:a},{cN:"string",b:'"',e:'"'},{cN:"end-block",b:"\\/[a-zA-Z- .]+",k:a},{cN:"variable",b:"[a-zA-Z-.]+",k:a}]}]}});hljs.registerLanguage("thrift",function(a){var b="bool byte i16 i32 i64 double string binary";return{k:{keyword:"namespace const typedef struct enum service exception void oneway set list map required optional",built_in:b,literal:"true false"},c:[a.QSM,a.NM,a.CLCM,a.CBCM,{cN:"class",bK:"struct enum service exception",e:/\{/,i:/\n/,c:[a.inherit(a.TM,{starts:{eW:true,eE:true}})]},{cN:"stl_container",b:"\\b(set|list|map)\\s*<",e:">",k:b,c:["self"]}]}});hljs.registerLanguage("vala",function(a){return{k:{keyword:"char uchar unichar int uint long ulong short ushort int8 int16 int32 int64 uint8 uint16 uint32 uint64 float double bool struct enum string void weak unowned owned async signal static abstract interface override while do for foreach else switch case break default return try catch public private protected internal using new this get set const stdout stdin stderr var",built_in:"DBus GLib CCode Gee Object",literal:"false true null"},c:[{cN:"class",bK:"class interface delegate namespace",e:"{",eE:true,i:"[^,:\\n\\s\\.]",c:[a.UTM]},a.CLCM,a.CBCM,{cN:"string",b:'"""',e:'"""',r:5},a.ASM,a.QSM,a.CNM,{cN:"preprocessor",b:"^#",e:"$",r:2},{cN:"constant",b:" [A-Z_]+ ",r:0}]}});hljs.registerLanguage("gradle",function(a){return{cI:true,k:{keyword:"task project allprojects subprojects artifacts buildscript configurations dependencies repositories sourceSets description delete from into include exclude source classpath destinationDir includes options sourceCompatibility targetCompatibility group flatDir doLast doFirst flatten todir fromdir ant def abstract break case catch continue default do else extends final finally for if implements instanceof native new private protected public return static switch synchronized throw throws transient try volatile while strictfp package import false null super this true antlrtask checkstyle codenarc copy boolean byte char class double float int interface long short void compile runTime file fileTree abs any append asList asWritable call collect compareTo count div dump each eachByte eachFile eachLine every find findAll flatten getAt getErr getIn getOut getText grep immutable inject inspect intersect invokeMethods isCase join leftShift minus multiply newInputStream newOutputStream newPrintWriter newReader newWriter next plus pop power previous print println push putAt read readBytes readLines reverse reverseEach round size sort splitEachLine step subMap times toInteger toList tokenize upto waitForOrKill withPrintWriter withReader withStream withWriter withWriterAppend write writeLine"},c:[a.CLCM,a.CBCM,a.ASM,a.QSM,a.NM,a.RM]}});hljs.registerLanguage("ini",function(a){return{cI:true,i:/\S/,c:[{cN:"comment",b:";",e:"$"},{cN:"title",b:"^\\[",e:"\\]"},{cN:"setting",b:"^[a-z0-9\\[\\]_-]+[ \\t]*=[ \\t]*",e:"$",c:[{cN:"value",eW:true,k:"on off true false yes no",c:[a.QSM,a.NM],r:0}]}]}});hljs.registerLanguage("livecodeserver",function(a){var e={cN:"variable",b:"\\b[gtps][A-Z]+[A-Za-z0-9_\\-]*\\b|\\$_[A-Z]+",r:0};var b={cN:"comment",e:"$",v:[a.CBCM,a.HCM,{b:"--"},{b:"[^:]//"}]};var d=a.inherit(a.TM,{v:[{b:"\\b_*rig[A-Z]+[A-Za-z0-9_\\-]*"},{b:"\\b_[a-z0-9\\-]+"}]});var c=a.inherit(a.TM,{b:"\\b([A-Za-z0-9_\\-]+)\\b"});return{cI:false,k:{keyword:"after byte bytes english the until http forever descending using line real8 with seventh for stdout finally element word fourth before black ninth sixth characters chars stderr uInt1 uInt1s uInt2 uInt2s stdin string lines relative rel any fifth items from middle mid at else of catch then third it file milliseconds seconds second secs sec int1 int1s int4 int4s internet int2 int2s normal text item last long detailed effective uInt4 uInt4s repeat end repeat URL in try into switch to words https token binfile each tenth as ticks tick system real4 by dateItems without char character ascending eighth whole dateTime numeric short first ftp integer abbreviated abbr abbrev private case while if",constant:"SIX TEN FORMFEED NINE ZERO NONE SPACE FOUR FALSE COLON CRLF PI COMMA ENDOFFILE EOF EIGHT FIVE QUOTE EMPTY ONE TRUE RETURN CR LINEFEED RIGHT BACKSLASH NULL SEVEN TAB THREE TWO six ten formfeed nine zero none space four false colon crlf pi comma endoffile eof eight five quote empty one true return cr linefeed right backslash null seven tab three two RIVERSION RISTATE FILE_READ_MODE FILE_WRITE_MODE FILE_WRITE_MODE DIR_WRITE_MODE FILE_READ_UMASK FILE_WRITE_UMASK DIR_READ_UMASK DIR_WRITE_UMASK",operator:"div mod wrap and or bitAnd bitNot bitOr bitXor among not in a an within contains ends with begins the keys of keys",built_in:"put abs acos aliasReference annuity arrayDecode arrayEncode asin atan atan2 average avg base64Decode base64Encode baseConvert binaryDecode binaryEncode byteToNum cachedURL cachedURLs charToNum cipherNames commandNames compound compress constantNames cos date dateFormat decompress directories diskSpace DNSServers exp exp1 exp2 exp10 extents files flushEvents folders format functionNames global globals hasMemory hostAddress hostAddressToName hostName hostNameToAddress isNumber ISOToMac itemOffset keys len length libURLErrorData libUrlFormData libURLftpCommand libURLLastHTTPHeaders libURLLastRHHeaders libUrlMultipartFormAddPart libUrlMultipartFormData libURLVersion lineOffset ln ln1 localNames log log2 log10 longFilePath lower macToISO matchChunk matchText matrixMultiply max md5Digest median merge millisec millisecs millisecond milliseconds min monthNames num number numToByte numToChar offset open openfiles openProcesses openProcessIDs openSockets paramCount param params peerAddress pendingMessages platform processID random randomBytes replaceText result revCreateXMLTree revCreateXMLTreeFromFile revCurrentRecord revCurrentRecordIsFirst revCurrentRecordIsLast revDatabaseColumnCount revDatabaseColumnIsNull revDatabaseColumnLengths revDatabaseColumnNames revDatabaseColumnNamed revDatabaseColumnNumbered revDatabaseColumnTypes revDatabaseConnectResult revDatabaseCursors revDatabaseID revDatabaseTableNames revDatabaseType revDataFromQuery revdb_closeCursor revdb_columnbynumber revdb_columncount revdb_columnisnull revdb_columnlengths revdb_columnnames revdb_columntypes revdb_commit revdb_connect revdb_connections revdb_connectionerr revdb_currentrecord revdb_cursorconnection revdb_cursorerr revdb_cursors revdb_dbtype revdb_disconnect revdb_execute revdb_iseof revdb_isbof revdb_movefirst revdb_movelast revdb_movenext revdb_moveprev revdb_query revdb_querylist revdb_recordcount revdb_rollback revdb_tablenames revGetDatabaseDriverPath revNumberOfRecords revOpenDatabase revOpenDatabases revQueryDatabase revQueryDatabaseBlob revQueryResult revQueryIsAtStart revQueryIsAtEnd revUnixFromMacPath revXMLAttribute revXMLAttributes revXMLAttributeValues revXMLChildContents revXMLChildNames revXMLFirstChild revXMLMatchingNode revXMLNextSibling revXMLNodeContents revXMLNumberOfChildren revXMLParent revXMLPreviousSibling revXMLRootNode revXMLRPC_CreateRequest revXMLRPC_Documents revXMLRPC_Error revXMLRPC_Execute revXMLRPC_GetHost revXMLRPC_GetMethod revXMLRPC_GetParam revXMLText revXMLRPC_GetParamCount revXMLRPC_GetParamNode revXMLRPC_GetParamType revXMLRPC_GetPath revXMLRPC_GetPort revXMLRPC_GetProtocol revXMLRPC_GetRequest revXMLRPC_GetResponse revXMLRPC_GetSocket revXMLTree revXMLTrees revXMLValidateDTD revZipDescribeItem revZipEnumerateItems revZipOpenArchives round sec secs seconds sha1Digest shell shortFilePath sin specialFolderPath sqrt standardDeviation statRound stdDev sum sysError systemVersion tan tempName tick ticks time to toLower toUpper transpose trunc uniDecode uniEncode upper URLDecode URLEncode URLStatus value variableNames version waitDepth weekdayNames wordOffset add breakpoint cancel clear local variable file word line folder directory URL close socket process combine constant convert create new alias folder directory decrypt delete variable word line folder directory URL dispatch divide do encrypt filter get include intersect kill libURLDownloadToFile libURLFollowHttpRedirects libURLftpUpload libURLftpUploadFile libURLresetAll libUrlSetAuthCallback libURLSetCustomHTTPHeaders libUrlSetExpect100 libURLSetFTPListCommand libURLSetFTPMode libURLSetFTPStopTime libURLSetStatusCallback load multiply socket process post seek rel relative read from process rename replace require resetAll revAddXMLNode revAppendXML revCloseCursor revCloseDatabase revCommitDatabase revCopyFile revCopyFolder revCopyXMLNode revDeleteFolder revDeleteXMLNode revDeleteAllXMLTrees revDeleteXMLTree revExecuteSQL revGoURL revInsertXMLNode revMoveFolder revMoveToFirstRecord revMoveToLastRecord revMoveToNextRecord revMoveToPreviousRecord revMoveToRecord revMoveXMLNode revPutIntoXMLNode revRollBackDatabase revSetDatabaseDriverPath revSetXMLAttribute revXMLRPC_AddParam revXMLRPC_DeleteAllDocuments revXMLAddDTD revXMLRPC_Free revXMLRPC_FreeAll revXMLRPC_DeleteDocument revXMLRPC_DeleteParam revXMLRPC_SetHost revXMLRPC_SetMethod revXMLRPC_SetPort revXMLRPC_SetProtocol revXMLRPC_SetSocket revZipAddItemWithData revZipAddItemWithFile revZipAddUncompressedItemWithData revZipAddUncompressedItemWithFile revZipCancel revZipCloseArchive revZipDeleteItem revZipExtractItemToFile revZipExtractItemToVariable revZipSetProgressCallback revZipRenameItem revZipReplaceItemWithData revZipReplaceItemWithFile revZipOpenArchive send set sort split subtract union unload wait write"},c:[e,{cN:"keyword",b:"\\bend\\sif\\b"},{cN:"function",bK:"function",e:"$",c:[e,c,a.ASM,a.QSM,a.BNM,a.CNM,d]},{cN:"function",bK:"end",e:"$",c:[c,d]},{cN:"command",bK:"command on",e:"$",c:[e,c,a.ASM,a.QSM,a.BNM,a.CNM,d]},{cN:"command",bK:"end",e:"$",c:[c,d]},{cN:"preprocessor",b:"<\\?rev|<\\?lc|<\\?livecode",r:10},{cN:"preprocessor",b:"<\\?"},{cN:"preprocessor",b:"\\?>"},b,a.ASM,a.QSM,a.BNM,a.CNM,d],i:";$|^\\[|^="}});hljs.registerLanguage("d",function(x){var b={keyword:"abstract alias align asm assert auto body break byte case cast catch class const continue debug default delete deprecated do else enum export extern final finally for foreach foreach_reverse|10 goto if immutable import in inout int interface invariant is lazy macro mixin module new nothrow out override package pragma private protected public pure ref return scope shared static struct super switch synchronized template this throw try typedef typeid typeof union unittest version void volatile while with __FILE__ __LINE__ __gshared|10 __thread __traits __DATE__ __EOF__ __TIME__ __TIMESTAMP__ __VENDOR__ __VERSION__",built_in:"bool cdouble cent cfloat char creal dchar delegate double dstring float function idouble ifloat ireal long real short string ubyte ucent uint ulong ushort wchar wstring",literal:"false null true"};var c="(0|[1-9][\\d_]*)",q="(0|[1-9][\\d_]*|\\d[\\d_]*|[\\d_]+?\\d)",h="0[bB][01_]+",v="([\\da-fA-F][\\da-fA-F_]*|_[\\da-fA-F][\\da-fA-F_]*)",y="0[xX]"+v,p="([eE][+-]?"+q+")",o="("+q+"(\\.\\d*|"+p+")|\\d+\\."+q+q+"|\\."+c+p+"?)",k="(0[xX]("+v+"\\."+v+"|\\.?"+v+")[pP][+-]?"+q+")",l="("+c+"|"+h+"|"+y+")",n="("+k+"|"+o+")";var z="\\\\(['\"\\?\\\\abfnrtv]|u[\\dA-Fa-f]{4}|[0-7]{1,3}|x[\\dA-Fa-f]{2}|U[\\dA-Fa-f]{8})|&[a-zA-Z\\d]{2,};";var m={cN:"number",b:"\\b"+l+"(L|u|U|Lu|LU|uL|UL)?",r:0};var j={cN:"number",b:"\\b("+n+"([fF]|L|i|[fF]i|Li)?|"+l+"(i|[fF]i|Li))",r:0};var s={cN:"string",b:"'("+z+"|.)",e:"'",i:"."};var r={b:z,r:0};var w={cN:"string",b:'"',c:[r],e:'"[cwd]?'};var f={cN:"string",b:'[rq]"',e:'"[cwd]?',r:5};var u={cN:"string",b:"`",e:"`[cwd]?"};var i={cN:"string",b:'x"[\\da-fA-F\\s\\n\\r]*"[cwd]?',r:10};var t={cN:"string",b:'q"\\{',e:'\\}"'};var e={cN:"shebang",b:"^#!",e:"$",r:5};var g={cN:"preprocessor",b:"#(line)",e:"$",r:5};var d={cN:"keyword",b:"@[a-zA-Z_][a-zA-Z_\\d]*"};var a={cN:"comment",b:"\\/\\+",c:["self"],e:"\\+\\/",r:10};return{l:x.UIR,k:b,c:[x.CLCM,x.CBCM,a,i,w,f,u,t,j,m,s,e,g,d]}});hljs.registerLanguage("vbnet",function(a){return{aliases:["vb"],cI:true,k:{keyword:"addhandler addressof alias and andalso aggregate ansi as assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into is isfalse isnot istrue join key let lib like loop me mid mod module mustinherit mustoverride mybase myclass namespace narrowing new next not notinheritable notoverridable of off on operator option optional or order orelse overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim rem removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly xor",built_in:"boolean byte cbool cbyte cchar cdate cdec cdbl char cint clng cobj csbyte cshort csng cstr ctype date decimal directcast double gettype getxmlnamespace iif integer long object sbyte short single string trycast typeof uinteger ulong ushort",literal:"true false nothing"},i:"//|{|}|endif|gosub|variant|wend",c:[a.inherit(a.QSM,{c:[{b:'""'}]}),{cN:"comment",b:"'",e:"$",rB:true,c:[{cN:"xmlDocTag",b:"'''|<!--|-->"},{cN:"xmlDocTag",b:"</?",e:">"}]},a.CNM,{cN:"preprocessor",b:"#",e:"$",k:"if else elseif end region externalsource"}]}});hljs.registerLanguage("axapta",function(a){return{k:"false int abstract private char boolean static null if for true while long throw finally protected final return void enum else break new catch byte super case short default double public try this switch continue reverse firstfast firstonly forupdate nofetch sum avg minof maxof count order group by asc desc index hint like dispaly edit client server ttsbegin ttscommit str real date container anytype common div mod",c:[a.CLCM,a.CBCM,a.ASM,a.QSM,a.CNM,{cN:"preprocessor",b:"#",e:"$"},{cN:"class",bK:"class interface",e:"{",eE:true,i:":",c:[{cN:"inheritance",bK:"extends implements",r:10},a.UTM]}]}});hljs.registerLanguage("perl",function(c){var d="getpwent getservent quotemeta msgrcv scalar kill dbmclose undef lc ma syswrite tr send umask sysopen shmwrite vec qx utime local oct semctl localtime readpipe do return format read sprintf dbmopen pop getpgrp not getpwnam rewinddir qqfileno qw endprotoent wait sethostent bless s|0 opendir continue each sleep endgrent shutdown dump chomp connect getsockname die socketpair close flock exists index shmgetsub for endpwent redo lstat msgctl setpgrp abs exit select print ref gethostbyaddr unshift fcntl syscall goto getnetbyaddr join gmtime symlink semget splice x|0 getpeername recv log setsockopt cos last reverse gethostbyname getgrnam study formline endhostent times chop length gethostent getnetent pack getprotoent getservbyname rand mkdir pos chmod y|0 substr endnetent printf next open msgsnd readdir use unlink getsockopt getpriority rindex wantarray hex system getservbyport endservent int chr untie rmdir prototype tell listen fork shmread ucfirst setprotoent else sysseek link getgrgid shmctl waitpid unpack getnetbyname reset chdir grep split require caller lcfirst until warn while values shift telldir getpwuid my getprotobynumber delete and sort uc defined srand accept package seekdir getprotobyname semop our rename seek if q|0 chroot sysread setpwent no crypt getc chown sqrt write setnetent setpriority foreach tie sin msgget map stat getlogin unless elsif truncate exec keys glob tied closedirioctl socket readlink eval xor readline binmode setservent eof ord bind alarm pipe atan2 getgrent exp time push setgrent gt lt or ne m|0 break given say state when";var f={cN:"subst",b:"[$@]\\{",e:"\\}",k:d};var g={b:"->{",e:"}"};var a={cN:"variable",v:[{b:/\$\d/},{b:/[\$\%\@](\^\w\b|#\w+(\:\:\w+)*|{\w+}|\w+(\:\:\w*)*)/},{b:/[\$\%\@][^\s\w{]/,r:0}]};var e={cN:"comment",b:"^(__END__|__DATA__)",e:"\\n$",r:5};var h=[c.BE,f,a];var b=[a,c.HCM,e,{cN:"comment",b:"^\\=\\w",e:"\\=cut",eW:true},g,{cN:"string",c:h,v:[{b:"q[qwxr]?\\s*\\(",e:"\\)",r:5},{b:"q[qwxr]?\\s*\\[",e:"\\]",r:5},{b:"q[qwxr]?\\s*\\{",e:"\\}",r:5},{b:"q[qwxr]?\\s*\\|",e:"\\|",r:5},{b:"q[qwxr]?\\s*\\<",e:"\\>",r:5},{b:"qw\\s+q",e:"q",r:5},{b:"'",e:"'",c:[c.BE]},{b:'"',e:'"'},{b:"`",e:"`",c:[c.BE]},{b:"{\\w+}",c:[],r:0},{b:"-?\\w+\\s*\\=\\>",c:[],r:0}]},{cN:"number",b:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",r:0},{b:"(\\/\\/|"+c.RSR+"|\\b(split|return|print|reverse|grep)\\b)\\s*",k:"split return print reverse grep",r:0,c:[c.HCM,e,{cN:"regexp",b:"(s|tr|y)/(\\\\.|[^/])*/(\\\\.|[^/])*/[a-z]*",r:10},{cN:"regexp",b:"(m|qr)?/",e:"/[a-z]*",c:[c.BE],r:0}]},{cN:"sub",bK:"sub",e:"(\\s*\\(.*?\\))?[;{]",r:5},{cN:"operator",b:"-\\w\\b",r:0}];f.c=b;g.c=b;return{aliases:["pl"],k:d,c:b}});hljs.registerLanguage("scala",function(a){var c={cN:"annotation",b:"@[A-Za-z]+"};var b={cN:"string",b:'u?r?"""',e:'"""',r:10};var d={cN:"symbol",b:"'\\w[\\w\\d_]*(?!')"};return{k:"type yield lazy override def with val var false true sealed abstract private trait object null if for while throw finally protected extends import final return else break new catch super class case package default try this match continue throws",c:[{cN:"javadoc",b:"/\\*\\*",e:"\\*/",c:[{cN:"javadoctag",b:"@[A-Za-z]+"}],r:10},a.CLCM,a.CBCM,b,a.QSM,d,{cN:"class",b:"((case )?class |object |trait )",e:"({|$)",eE:true,i:":",k:"case class trait object",c:[{bK:"extends with",r:10},a.UTM,{cN:"params",b:"\\(",e:"\\)",c:[a.QSM,b,c]}]},a.CNM,c]}});hljs.registerLanguage("cmake",function(a){return{aliases:["cmake.in"],cI:true,k:{keyword:"add_custom_command add_custom_target add_definitions add_dependencies add_executable add_library add_subdirectory add_test aux_source_directory break build_command cmake_minimum_required cmake_policy configure_file create_test_sourcelist define_property else elseif enable_language enable_testing endforeach endfunction endif endmacro endwhile execute_process export find_file find_library find_package find_path find_program fltk_wrap_ui foreach function get_cmake_property get_directory_property get_filename_component get_property get_source_file_property get_target_property get_test_property if include include_directories include_external_msproject include_regular_expression install link_directories load_cache load_command macro mark_as_advanced message option output_required_files project qt_wrap_cpp qt_wrap_ui remove_definitions return separate_arguments set set_directory_properties set_property set_source_files_properties set_target_properties set_tests_properties site_name source_group string target_link_libraries try_compile try_run unset variable_watch while build_name exec_program export_library_dependencies install_files install_programs install_targets link_libraries make_directory remove subdir_depends subdirs use_mangled_mesa utility_source variable_requires write_file qt5_use_modules qt5_use_package qt5_wrap_cpp on off true false and or",operator:"equal less greater strless strgreater strequal matches"},c:[{cN:"envvar",b:"\\${",e:"}"},a.HCM,a.QSM,a.NM]}});hljs.registerLanguage("ocaml",function(a){return{aliases:["ml"],k:{keyword:"and as assert asr begin class constraint do done downto else end exception external false for fun function functor if in include inherit initializer land lazy let lor lsl lsr lxor match method mod module mutable new object of open or private rec ref sig struct then to true try type val virtual when while with parser value",built_in:"bool char float int list unit array exn option int32 int64 nativeint format4 format6 lazy_t in_channel out_channel string"},i:/\/\//,c:[{cN:"string",b:'"""',e:'"""'},{cN:"comment",b:"\\(\\*",e:"\\*\\)",c:["self"]},{cN:"class",bK:"type",e:"\\(|=|$",eE:true,c:[a.UTM]},{cN:"annotation",b:"\\[<",e:">\\]"},a.CBCM,a.inherit(a.ASM,{i:null}),a.inherit(a.QSM,{i:null}),a.CNM]}});hljs.registerLanguage("autohotkey",function(b){var d={cN:"escape",b:"`[\\s\\S]"};var c={cN:"comment",b:";",e:"$",r:0};var a=[{cN:"built_in",b:"A_[a-zA-Z0-9]+"},{cN:"built_in",bK:"ComSpec Clipboard ClipboardAll ErrorLevel"}];return{cI:true,k:{keyword:"Break Continue Else Gosub If Loop Return While",literal:"A true false NOT AND OR"},c:a.concat([d,b.inherit(b.QSM,{c:[d]}),c,{cN:"number",b:b.NR,r:0},{cN:"var_expand",b:"%",e:"%",i:"\\n",c:[d]},{cN:"label",c:[d],v:[{b:'^[^\\n";]+::(?!=)'},{b:'^[^\\n";]+:(?!=)',r:0}]},{b:",\\s*,",r:10}])}});hljs.registerLanguage("objectivec",function(a){var d={keyword:"int float while char export sizeof typedef const struct for union unsigned long volatile static bool mutable if do return goto void enum else break extern asm case short default double register explicit signed typename this switch continue wchar_t inline readonly assign readwrite self @synchronized id typeof nonatomic super unichar IBOutlet IBAction strong weak copy in out inout bycopy byref oneway __strong __weak __block __autoreleasing @private @protected @public @try @property @end @throw @catch @finally @autoreleasepool @synthesize @dynamic @selector @optional @required",literal:"false true FALSE TRUE nil YES NO NULL",built_in:"NSString NSDictionary CGRect CGPoint UIButton UILabel UITextView UIWebView MKMapView NSView NSViewController NSWindow NSWindowController NSSet NSUUID NSIndexSet UISegmentedControl NSObject UITableViewDelegate UITableViewDataSource NSThread UIActivityIndicator UITabbar UIToolBar UIBarButtonItem UIImageView NSAutoreleasePool UITableView BOOL NSInteger CGFloat NSException NSLog NSMutableString NSMutableArray NSMutableDictionary NSURL NSIndexPath CGSize UITableViewCell UIView UIViewController UINavigationBar UINavigationController UITabBarController UIPopoverController UIPopoverControllerDelegate UIImage NSNumber UISearchBar NSFetchedResultsController NSFetchedResultsChangeType UIScrollView UIScrollViewDelegate UIEdgeInsets UIColor UIFont UIApplication NSNotFound NSNotificationCenter NSNotification UILocalNotification NSBundle NSFileManager NSTimeInterval NSDate NSCalendar NSUserDefaults UIWindow NSRange NSArray NSError NSURLRequest NSURLConnection UIInterfaceOrientation MPMoviePlayerController dispatch_once_t dispatch_queue_t dispatch_sync dispatch_async dispatch_once"};var c=/[a-zA-Z@][a-zA-Z0-9_]*/;var b="@interface @class @protocol @implementation";return{aliases:["m","mm","objc","obj-c"],k:d,l:c,i:"</",c:[a.CLCM,a.CBCM,a.CNM,a.QSM,{cN:"string",v:[{b:'@"',e:'"',i:"\\n",c:[a.BE]},{b:"'",e:"[^\\\\]'",i:"[^\\\\][^']"}]},{cN:"preprocessor",b:"#",e:"$",c:[{cN:"title",v:[{b:'"',e:'"'},{b:"<",e:">"}]}]},{cN:"class",b:"("+b.split(" ").join("|")+")\\b",e:"({|$)",eE:true,k:b,l:c,c:[a.UTM]},{cN:"variable",b:"\\."+a.UIR,r:0}]}});hljs.registerLanguage("avrasm",function(a){return{cI:true,l:"\\.?"+a.IR,k:{keyword:"adc add adiw and andi asr bclr bld brbc brbs brcc brcs break breq brge brhc brhs brid brie brlo brlt brmi brne brpl brsh brtc brts brvc brvs bset bst call cbi cbr clc clh cli cln clr cls clt clv clz com cp cpc cpi cpse dec eicall eijmp elpm eor fmul fmuls fmulsu icall ijmp in inc jmp ld ldd ldi lds lpm lsl lsr mov movw mul muls mulsu neg nop or ori out pop push rcall ret reti rjmp rol ror sbc sbr sbrc sbrs sec seh sbi sbci sbic sbis sbiw sei sen ser ses set sev sez sleep spm st std sts sub subi swap tst wdr",built_in:"r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15 r16 r17 r18 r19 r20 r21 r22 r23 r24 r25 r26 r27 r28 r29 r30 r31 x|0 xh xl y|0 yh yl z|0 zh zl ucsr1c udr1 ucsr1a ucsr1b ubrr1l ubrr1h ucsr0c ubrr0h tccr3c tccr3a tccr3b tcnt3h tcnt3l ocr3ah ocr3al ocr3bh ocr3bl ocr3ch ocr3cl icr3h icr3l etimsk etifr tccr1c ocr1ch ocr1cl twcr twdr twar twsr twbr osccal xmcra xmcrb eicra spmcsr spmcr portg ddrg ping portf ddrf sreg sph spl xdiv rampz eicrb eimsk gimsk gicr eifr gifr timsk tifr mcucr mcucsr tccr0 tcnt0 ocr0 assr tccr1a tccr1b tcnt1h tcnt1l ocr1ah ocr1al ocr1bh ocr1bl icr1h icr1l tccr2 tcnt2 ocr2 ocdr wdtcr sfior eearh eearl eedr eecr porta ddra pina portb ddrb pinb portc ddrc pinc portd ddrd pind spdr spsr spcr udr0 ucsr0a ucsr0b ubrr0l acsr admux adcsr adch adcl porte ddre pine pinf",preprocessor:".byte .cseg .db .def .device .dseg .dw .endmacro .equ .eseg .exit .include .list .listmac .macro .nolist .org .set"},c:[a.CBCM,{cN:"comment",b:";",e:"$",r:0},a.CNM,a.BNM,{cN:"number",b:"\\b(\\$[a-zA-Z0-9]+|0o[0-7]+)"},a.QSM,{cN:"string",b:"'",e:"[^\\\\]'",i:"[^\\\\][^']"},{cN:"label",b:"^[A-Za-z0-9_.$]+:"},{cN:"preprocessor",b:"#",e:"$"},{cN:"localvars",b:"@[0-9]+"}]}});hljs.registerLanguage("vhdl",function(a){return{cI:true,k:{keyword:"abs access after alias all and architecture array assert attribute begin block body buffer bus case component configuration constant context cover disconnect downto default else elsif end entity exit fairness file for force function generate generic group guarded if impure in inertial inout is label library linkage literal loop map mod nand new next nor not null of on open or others out package port postponed procedure process property protected pure range record register reject release rem report restrict restrict_guarantee return rol ror select sequence severity shared signal sla sll sra srl strong subtype then to transport type unaffected units until use variable vmode vprop vunit wait when while with xnor xor",typename:"boolean bit character severity_level integer time delay_length natural positive string bit_vector file_open_kind file_open_status std_ulogic std_ulogic_vector std_logic std_logic_vector unsigned signed boolean_vector integer_vector real_vector time_vector"},i:"{",c:[a.CBCM,{cN:"comment",b:"--",e:"$"},a.QSM,a.CNM,{cN:"literal",b:"'(U|X|0|1|Z|W|L|H|-)'",c:[a.BE]},{cN:"attribute",b:"'[A-Za-z](_?[A-Za-z0-9])*",c:[a.BE]}]}});hljs.registerLanguage("coffeescript",function(c){var b={keyword:"in if for while finally new do return else break catch instanceof throw try this switch continue typeof delete debugger super then unless until loop of by when and or is isnt not",literal:"true false null undefined yes no on off",reserved:"case default function var void with const let enum export import native __hasProp __extends __slice __bind __indexOf",built_in:"npm require console print module global window document"};var a="[A-Za-z$_][0-9A-Za-z$_]*";var f=c.inherit(c.TM,{b:a});var e={cN:"subst",b:/#\{/,e:/}/,k:b};var d=[c.BNM,c.inherit(c.CNM,{starts:{e:"(\\s*/)?",r:0}}),{cN:"string",v:[{b:/'''/,e:/'''/,c:[c.BE]},{b:/'/,e:/'/,c:[c.BE]},{b:/"""/,e:/"""/,c:[c.BE,e]},{b:/"/,e:/"/,c:[c.BE,e]}]},{cN:"regexp",v:[{b:"///",e:"///",c:[e,c.HCM]},{b:"//[gim]*",r:0},{b:"/\\S(\\\\.|[^\\n])*?/[gim]*(?=\\s|\\W|$)"}]},{cN:"property",b:"@"+a},{b:"`",e:"`",eB:true,eE:true,sL:"javascript"}];e.c=d;return{aliases:["coffee","cson","iced"],k:b,c:d.concat([{cN:"comment",b:"###",e:"###"},c.HCM,{cN:"function",b:"("+a+"\\s*=\\s*)?(\\(.*\\))?\\s*\\B[-=]>",e:"[-=]>",rB:true,c:[f,{cN:"params",b:"\\(",rB:true,c:[{b:/\(/,e:/\)/,k:b,c:["self"].concat(d)}]}]},{cN:"class",bK:"class",e:"$",i:/[:="\[\]]/,c:[{bK:"extends",eW:true,i:/[:="\[\]]/,c:[f]},f]},{cN:"attribute",b:a+":",e:":",rB:true,eE:true,r:0}])}});hljs.registerLanguage("mizar",function(a){return{k:["environ vocabularies notations constructors definitions registrations theorems schemes requirements","begin end definition registration cluster existence pred func defpred deffunc theorem proof","let take assume then thus hence ex for st holds consider reconsider such that and in provided of as from","be being by means equals implies iff redefine define now not or attr is mode suppose per cases set","thesis contradiction scheme reserve struct","correctness compatibility coherence symmetry assymetry reflexivity irreflexivity","connectedness uniqueness commutativity idempotence involutiveness projectivity"].join(" "),c:[{cN:"comment",b:"::",e:"$"}]}});hljs.registerLanguage("nginx",function(c){var b={cN:"variable",v:[{b:/\$\d+/},{b:/\$\{/,e:/}/},{b:"[\\$\\@]"+c.UIR}]};var a={eW:true,l:"[a-z/_]+",k:{built_in:"on off yes no true false none blocked debug info notice warn error crit select break last permanent redirect kqueue rtsig epoll poll /dev/poll"},r:0,i:"=>",c:[c.HCM,{cN:"string",c:[c.BE,b],v:[{b:/"/,e:/"/},{b:/'/,e:/'/}]},{cN:"url",b:"([a-z]+):/",e:"\\s",eW:true,eE:true},{cN:"regexp",c:[c.BE,b],v:[{b:"\\s\\^",e:"\\s|{|;",rE:true},{b:"~\\*?\\s+",e:"\\s|{|;",rE:true},{b:"\\*(\\.[a-z\\-]+)+"},{b:"([a-z\\-]+\\.)+\\*"}]},{cN:"number",b:"\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}(:\\d{1,5})?\\b"},{cN:"number",b:"\\b\\d+[kKmMgGdshdwy]*\\b",r:0},b]};return{aliases:["nginxconf"],c:[c.HCM,{b:c.UIR+"\\s",e:";|{",rB:true,c:[{cN:"title",b:c.UIR,starts:a}],r:0}],i:"[^\\s\\}]"}});hljs.registerLanguage("erlang-repl",function(a){return{k:{special_functions:"spawn spawn_link self",reserved:"after and andalso|10 band begin bnot bor bsl bsr bxor case catch cond div end fun if let not of or orelse|10 query receive rem try when xor"},c:[{cN:"prompt",b:"^[0-9]+> ",r:10},{cN:"comment",b:"%",e:"$"},{cN:"number",b:"\\b(\\d+#[a-fA-F0-9]+|\\d+(\\.\\d+)?([eE][-+]?\\d+)?)",r:0},a.ASM,a.QSM,{cN:"constant",b:"\\?(::)?([A-Z]\\w*(::)?)+"},{cN:"arrow",b:"->"},{cN:"ok",b:"ok"},{cN:"exclamation_mark",b:"!"},{cN:"function_or_atom",b:"(\\b[a-z'][a-zA-Z0-9_']*:[a-z'][a-zA-Z0-9_']*)|(\\b[a-z'][a-zA-Z0-9_']*)",r:0},{cN:"variable",b:"[A-Z][a-zA-Z0-9_']*",r:0}]}});hljs.registerLanguage("r",function(a){var b="([a-zA-Z]|\\.[a-zA-Z.])[a-zA-Z0-9._]*";return{c:[a.HCM,{b:b,l:b,k:{keyword:"function if in break next repeat else for return switch while try tryCatch|10 stop warning require library attach detach source setMethod setGeneric setGroupGeneric setClass ...|10",literal:"NULL NA TRUE FALSE T F Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10"},r:0},{cN:"number",b:"0[xX][0-9a-fA-F]+[Li]?\\b",r:0},{cN:"number",b:"\\d+(?:[eE][+\\-]?\\d*)?L\\b",r:0},{cN:"number",b:"\\d+\\.(?!\\d)(?:i\\b)?",r:0},{cN:"number",b:"\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d*)?i?\\b",r:0},{cN:"number",b:"\\.\\d+(?:[eE][+\\-]?\\d*)?i?\\b",r:0},{b:"`",e:"`",r:0},{cN:"string",c:[a.BE],v:[{b:'"',e:'"'},{b:"'",e:"'"}]}]}});hljs.registerLanguage("json",function(a){var e={literal:"true false null"};var d=[a.QSM,a.CNM];var c={cN:"value",e:",",eW:true,eE:true,c:d,k:e};var b={b:"{",e:"}",c:[{cN:"attribute",b:'\\s*"',e:'"\\s*:\\s*',eB:true,eE:true,c:[a.BE],i:"\\n",starts:c}],i:"\\S"};var f={b:"\\[",e:"\\]",c:[a.inherit(c,{cN:null})],i:"\\S"};d.splice(d.length,0,b,f);return{c:d,k:e,i:"\\S"}});hljs.registerLanguage("django",function(a){var b={cN:"filter",b:/\|[A-Za-z]+\:?/,k:"truncatewords removetags linebreaksbr yesno get_digit timesince random striptags filesizeformat escape linebreaks length_is ljust rjust cut urlize fix_ampersands title floatformat capfirst pprint divisibleby add make_list unordered_list urlencode timeuntil urlizetrunc wordcount stringformat linenumbers slice date dictsort dictsortreversed default_if_none pluralize lower join center default truncatewords_html upper length phone2numeric wordwrap time addslashes slugify first escapejs force_escape iriencode last safe safeseq truncatechars localize unlocalize localtime utc timezone",c:[{cN:"argument",b:/"/,e:/"/},{cN:"argument",b:/'/,e:/'/}]};return{aliases:["jinja"],cI:true,sL:"xml",subLanguageMode:"continuous",c:[{cN:"template_comment",b:/\{%\s*comment\s*%}/,e:/\{%\s*endcomment\s*%}/},{cN:"template_comment",b:/\{#/,e:/#}/},{cN:"template_tag",b:/\{%/,e:/%}/,k:"comment endcomment load templatetag ifchanged endifchanged if endif firstof for endfor in ifnotequal endifnotequal widthratio extends include spaceless endspaceless regroup by as ifequal endifequal ssi now with cycle url filter endfilter debug block endblock else autoescape endautoescape csrf_token empty elif endwith static trans blocktrans endblocktrans get_static_prefix get_media_prefix plural get_current_language language get_available_languages get_current_language_bidi get_language_info get_language_info_list localize endlocalize localtime endlocaltime timezone endtimezone get_current_timezone verbatim",c:[b]},{cN:"variable",b:/\{\{/,e:/}}/,c:[b]}]}});hljs.registerLanguage("delphi",function(b){var a="exports register file shl array record property for mod while set ally label uses raise not stored class safecall var interface or private static exit index inherited to else stdcall override shr asm far resourcestring finalization packed virtual out and protected library do xorwrite goto near function end div overload object unit begin string on inline repeat until destructor write message program with read initialization except default nil if case cdecl in downto threadvar of try pascal const external constructor type public then implementation finally published procedure";var e={cN:"comment",v:[{b:/\{/,e:/\}/,r:0},{b:/\(\*/,e:/\*\)/,r:10}]};var c={cN:"string",b:/'/,e:/'/,c:[{b:/''/}]};var d={cN:"string",b:/(#\d+)+/};var f={b:b.IR+"\\s*=\\s*class\\s*\\(",rB:true,c:[b.TM]};var g={cN:"function",bK:"function constructor destructor procedure",e:/[:;]/,k:"function constructor|10 destructor|10 procedure|10",c:[b.TM,{cN:"params",b:/\(/,e:/\)/,k:a,c:[c,d]},e]};return{cI:true,k:a,i:/("|\$[G-Zg-z]|\/\*|<\/)/,c:[e,b.CLCM,c,d,b.NM,f,g]}});hljs.registerLanguage("vbscript",function(a){return{aliases:["vbs"],cI:true,k:{keyword:"call class const dim do loop erase execute executeglobal exit for each next function if then else on error option explicit new private property let get public randomize redim rem select case set stop sub while wend with end to elseif is or xor and not class_initialize class_terminate default preserve in me byval byref step resume goto",built_in:"lcase month vartype instrrev ubound setlocale getobject rgb getref string weekdayname rnd dateadd monthname now day minute isarray cbool round formatcurrency conversions csng timevalue second year space abs clng timeserial fixs len asc isempty maths dateserial atn timer isobject filter weekday datevalue ccur isdate instr datediff formatdatetime replace isnull right sgn array snumeric log cdbl hex chr lbound msgbox ucase getlocale cos cdate cbyte rtrim join hour oct typename trim strcomp int createobject loadpicture tan formatnumber mid scriptenginebuildversion scriptengine split scriptengineminorversion cint sin datepart ltrim sqr scriptenginemajorversion time derived eval date formatpercent exp inputbox left ascw chrw regexp server response request cstr err",literal:"true false null nothing empty"},i:"//",c:[a.inherit(a.QSM,{c:[{b:'""'}]}),{cN:"comment",b:/'/,e:/$/,r:0},a.CNM]}});hljs.registerLanguage("oxygene",function(b){var g="abstract add and array as asc aspect assembly async begin break block by case class concat const copy constructor continue create default delegate desc distinct div do downto dynamic each else empty end ensure enum equals event except exit extension external false final finalize finalizer finally flags for forward from function future global group has if implementation implements implies in index inherited inline interface into invariants is iterator join locked locking loop matching method mod module namespace nested new nil not notify nullable of old on operator or order out override parallel params partial pinned private procedure property protected public queryable raise read readonly record reintroduce remove repeat require result reverse sealed select self sequence set shl shr skip static step soft take then to true try tuple type union unit unsafe until uses using var virtual raises volatile where while with write xor yield await mapped deprecated stdcall cdecl pascal register safecall overload library platform reference packed strict published autoreleasepool selector strong weak unretained";var a={cN:"comment",b:"{",e:"}",r:0};var e={cN:"comment",b:"\\(\\*",e:"\\*\\)",r:10};var c={cN:"string",b:"'",e:"'",c:[{b:"''"}]};var d={cN:"string",b:"(#\\d+)+"};var f={cN:"function",bK:"function constructor destructor procedure method",e:"[:;]",k:"function constructor|10 destructor|10 procedure|10 method|10",c:[b.TM,{cN:"params",b:"\\(",e:"\\)",k:g,c:[c,d]},a,e]};return{cI:true,k:g,i:'("|\\$[G-Zg-z]|\\/\\*|</)',c:[a,e,b.CLCM,c,d,b.NM,f,{cN:"class",b:"=\\bclass\\b",e:"end;",k:g,c:[c,d,a,e,b.CLCM,f]}]}});hljs.registerLanguage("mel",function(a){return{k:"int float string vector matrix if else switch case default while do for in break continue global proc return about abs addAttr addAttributeEditorNodeHelp addDynamic addNewShelfTab addPP addPanelCategory addPrefixToName advanceToNextDrivenKey affectedNet affects aimConstraint air alias aliasAttr align alignCtx alignCurve alignSurface allViewFit ambientLight angle angleBetween animCone animCurveEditor animDisplay animView annotate appendStringArray applicationName applyAttrPreset applyTake arcLenDimContext arcLengthDimension arclen arrayMapper art3dPaintCtx artAttrCtx artAttrPaintVertexCtx artAttrSkinPaintCtx artAttrTool artBuildPaintMenu artFluidAttrCtx artPuttyCtx artSelectCtx artSetPaintCtx artUserPaintCtx assignCommand assignInputDevice assignViewportFactories attachCurve attachDeviceAttr attachSurface attrColorSliderGrp attrCompatibility attrControlGrp attrEnumOptionMenu attrEnumOptionMenuGrp attrFieldGrp attrFieldSliderGrp attrNavigationControlGrp attrPresetEditWin attributeExists attributeInfo attributeMenu attributeQuery autoKeyframe autoPlace bakeClip bakeFluidShading bakePartialHistory bakeResults bakeSimulation basename basenameEx batchRender bessel bevel bevelPlus binMembership bindSkin blend2 blendShape blendShapeEditor blendShapePanel blendTwoAttr blindDataType boneLattice boundary boxDollyCtx boxZoomCtx bufferCurve buildBookmarkMenu buildKeyframeMenu button buttonManip CBG cacheFile cacheFileCombine cacheFileMerge cacheFileTrack camera cameraView canCreateManip canvas capitalizeString catch catchQuiet ceil changeSubdivComponentDisplayLevel changeSubdivRegion channelBox character characterMap characterOutlineEditor characterize chdir checkBox checkBoxGrp checkDefaultRenderGlobals choice circle circularFillet clamp clear clearCache clip clipEditor clipEditorCurrentTimeCtx clipSchedule clipSchedulerOutliner clipTrimBefore closeCurve closeSurface cluster cmdFileOutput cmdScrollFieldExecuter cmdScrollFieldReporter cmdShell coarsenSubdivSelectionList collision color colorAtPoint colorEditor colorIndex colorIndexSliderGrp colorSliderButtonGrp colorSliderGrp columnLayout commandEcho commandLine commandPort compactHairSystem componentEditor compositingInterop computePolysetVolume condition cone confirmDialog connectAttr connectControl connectDynamic connectJoint connectionInfo constrain constrainValue constructionHistory container containsMultibyte contextInfo control convertFromOldLayers convertIffToPsd convertLightmap convertSolidTx convertTessellation convertUnit copyArray copyFlexor copyKey copySkinWeights cos cpButton cpCache cpClothSet cpCollision cpConstraint cpConvClothToMesh cpForces cpGetSolverAttr cpPanel cpProperty cpRigidCollisionFilter cpSeam cpSetEdit cpSetSolverAttr cpSolver cpSolverTypes cpTool cpUpdateClothUVs createDisplayLayer createDrawCtx createEditor createLayeredPsdFile createMotionField createNewShelf createNode createRenderLayer createSubdivRegion cross crossProduct ctxAbort ctxCompletion ctxEditMode ctxTraverse currentCtx currentTime currentTimeCtx currentUnit curve curveAddPtCtx curveCVCtx curveEPCtx curveEditorCtx curveIntersect curveMoveEPCtx curveOnSurface curveSketchCtx cutKey cycleCheck cylinder dagPose date defaultLightListCheckBox defaultNavigation defineDataServer defineVirtualDevice deformer deg_to_rad delete deleteAttr deleteShadingGroupsAndMaterials deleteShelfTab deleteUI deleteUnusedBrushes delrandstr detachCurve detachDeviceAttr detachSurface deviceEditor devicePanel dgInfo dgdirty dgeval dgtimer dimWhen directKeyCtx directionalLight dirmap dirname disable disconnectAttr disconnectJoint diskCache displacementToPoly displayAffected displayColor displayCull displayLevelOfDetail displayPref displayRGBColor displaySmoothness displayStats displayString displaySurface distanceDimContext distanceDimension doBlur dolly dollyCtx dopeSheetEditor dot dotProduct doubleProfileBirailSurface drag dragAttrContext draggerContext dropoffLocator duplicate duplicateCurve duplicateSurface dynCache dynControl dynExport dynExpression dynGlobals dynPaintEditor dynParticleCtx dynPref dynRelEdPanel dynRelEditor dynamicLoad editAttrLimits editDisplayLayerGlobals editDisplayLayerMembers editRenderLayerAdjustment editRenderLayerGlobals editRenderLayerMembers editor editorTemplate effector emit emitter enableDevice encodeString endString endsWith env equivalent equivalentTol erf error eval evalDeferred evalEcho event exactWorldBoundingBox exclusiveLightCheckBox exec executeForEachObject exists exp expression expressionEditorListen extendCurve extendSurface extrude fcheck fclose feof fflush fgetline fgetword file fileBrowserDialog fileDialog fileExtension fileInfo filetest filletCurve filter filterCurve filterExpand filterStudioImport findAllIntersections findAnimCurves findKeyframe findMenuItem findRelatedSkinCluster finder firstParentOf fitBspline flexor floatEq floatField floatFieldGrp floatScrollBar floatSlider floatSlider2 floatSliderButtonGrp floatSliderGrp floor flow fluidCacheInfo fluidEmitter fluidVoxelInfo flushUndo fmod fontDialog fopen formLayout format fprint frameLayout fread freeFormFillet frewind fromNativePath fwrite gamma gauss geometryConstraint getApplicationVersionAsFloat getAttr getClassification getDefaultBrush getFileList getFluidAttr getInputDeviceRange getMayaPanelTypes getModifiers getPanel getParticleAttr getPluginResource getenv getpid glRender glRenderEditor globalStitch gmatch goal gotoBindPose grabColor gradientControl gradientControlNoAttr graphDollyCtx graphSelectContext graphTrackCtx gravity grid gridLayout group groupObjectsByName HfAddAttractorToAS HfAssignAS HfBuildEqualMap HfBuildFurFiles HfBuildFurImages HfCancelAFR HfConnectASToHF HfCreateAttractor HfDeleteAS HfEditAS HfPerformCreateAS HfRemoveAttractorFromAS HfSelectAttached HfSelectAttractors HfUnAssignAS hardenPointCurve hardware hardwareRenderPanel headsUpDisplay headsUpMessage help helpLine hermite hide hilite hitTest hotBox hotkey hotkeyCheck hsv_to_rgb hudButton hudSlider hudSliderButton hwReflectionMap hwRender hwRenderLoad hyperGraph hyperPanel hyperShade hypot iconTextButton iconTextCheckBox iconTextRadioButton iconTextRadioCollection iconTextScrollList iconTextStaticLabel ikHandle ikHandleCtx ikHandleDisplayScale ikSolver ikSplineHandleCtx ikSystem ikSystemInfo ikfkDisplayMethod illustratorCurves image imfPlugins inheritTransform insertJoint insertJointCtx insertKeyCtx insertKnotCurve insertKnotSurface instance instanceable instancer intField intFieldGrp intScrollBar intSlider intSliderGrp interToUI internalVar intersect iprEngine isAnimCurve isConnected isDirty isParentOf isSameObject isTrue isValidObjectName isValidString isValidUiName isolateSelect itemFilter itemFilterAttr itemFilterRender itemFilterType joint jointCluster jointCtx jointDisplayScale jointLattice keyTangent keyframe keyframeOutliner keyframeRegionCurrentTimeCtx keyframeRegionDirectKeyCtx keyframeRegionDollyCtx keyframeRegionInsertKeyCtx keyframeRegionMoveKeyCtx keyframeRegionScaleKeyCtx keyframeRegionSelectKeyCtx keyframeRegionSetKeyCtx keyframeRegionTrackCtx keyframeStats lassoContext lattice latticeDeformKeyCtx launch launchImageEditor layerButton layeredShaderPort layeredTexturePort layout layoutDialog lightList lightListEditor lightListPanel lightlink lineIntersection linearPrecision linstep listAnimatable listAttr listCameras listConnections listDeviceAttachments listHistory listInputDeviceAxes listInputDeviceButtons listInputDevices listMenuAnnotation listNodeTypes listPanelCategories listRelatives listSets listTransforms listUnselected listerEditor loadFluid loadNewShelf loadPlugin loadPluginLanguageResources loadPrefObjects localizedPanelLabel lockNode loft log longNameOf lookThru ls lsThroughFilter lsType lsUI Mayatomr mag makeIdentity makeLive makePaintable makeRoll makeSingleSurface makeTubeOn makebot manipMoveContext manipMoveLimitsCtx manipOptions manipRotateContext manipRotateLimitsCtx manipScaleContext manipScaleLimitsCtx marker match max memory menu menuBarLayout menuEditor menuItem menuItemToShelf menuSet menuSetPref messageLine min minimizeApp mirrorJoint modelCurrentTimeCtx modelEditor modelPanel mouse movIn movOut move moveIKtoFK moveKeyCtx moveVertexAlongDirection multiProfileBirailSurface mute nParticle nameCommand nameField namespace namespaceInfo newPanelItems newton nodeCast nodeIconButton nodeOutliner nodePreset nodeType noise nonLinear normalConstraint normalize nurbsBoolean nurbsCopyUVSet nurbsCube nurbsEditUV nurbsPlane nurbsSelect nurbsSquare nurbsToPoly nurbsToPolygonsPref nurbsToSubdiv nurbsToSubdivPref nurbsUVSet nurbsViewDirectionVector objExists objectCenter objectLayer objectType objectTypeUI obsoleteProc oceanNurbsPreviewPlane offsetCurve offsetCurveOnSurface offsetSurface openGLExtension openMayaPref optionMenu optionMenuGrp optionVar orbit orbitCtx orientConstraint outlinerEditor outlinerPanel overrideModifier paintEffectsDisplay pairBlend palettePort paneLayout panel panelConfiguration panelHistory paramDimContext paramDimension paramLocator parent parentConstraint particle particleExists particleInstancer particleRenderInfo partition pasteKey pathAnimation pause pclose percent performanceOptions pfxstrokes pickWalk picture pixelMove planarSrf plane play playbackOptions playblast plugAttr plugNode pluginInfo pluginResourceUtil pointConstraint pointCurveConstraint pointLight pointMatrixMult pointOnCurve pointOnSurface pointPosition poleVectorConstraint polyAppend polyAppendFacetCtx polyAppendVertex polyAutoProjection polyAverageNormal polyAverageVertex polyBevel polyBlendColor polyBlindData polyBoolOp polyBridgeEdge polyCacheMonitor polyCheck polyChipOff polyClipboard polyCloseBorder polyCollapseEdge polyCollapseFacet polyColorBlindData polyColorDel polyColorPerVertex polyColorSet polyCompare polyCone polyCopyUV polyCrease polyCreaseCtx polyCreateFacet polyCreateFacetCtx polyCube polyCut polyCutCtx polyCylinder polyCylindricalProjection polyDelEdge polyDelFacet polyDelVertex polyDuplicateAndConnect polyDuplicateEdge polyEditUV polyEditUVShell polyEvaluate polyExtrudeEdge polyExtrudeFacet polyExtrudeVertex polyFlipEdge polyFlipUV polyForceUV polyGeoSampler polyHelix polyInfo polyInstallAction polyLayoutUV polyListComponentConversion polyMapCut polyMapDel polyMapSew polyMapSewMove polyMergeEdge polyMergeEdgeCtx polyMergeFacet polyMergeFacetCtx polyMergeUV polyMergeVertex polyMirrorFace polyMoveEdge polyMoveFacet polyMoveFacetUV polyMoveUV polyMoveVertex polyNormal polyNormalPerVertex polyNormalizeUV polyOptUvs polyOptions polyOutput polyPipe polyPlanarProjection polyPlane polyPlatonicSolid polyPoke polyPrimitive polyPrism polyProjection polyPyramid polyQuad polyQueryBlindData polyReduce polySelect polySelectConstraint polySelectConstraintMonitor polySelectCtx polySelectEditCtx polySeparate polySetToFaceNormal polySewEdge polyShortestPathCtx polySmooth polySoftEdge polySphere polySphericalProjection polySplit polySplitCtx polySplitEdge polySplitRing polySplitVertex polyStraightenUVBorder polySubdivideEdge polySubdivideFacet polyToSubdiv polyTorus polyTransfer polyTriangulate polyUVSet polyUnite polyWedgeFace popen popupMenu pose pow preloadRefEd print progressBar progressWindow projFileViewer projectCurve projectTangent projectionContext projectionManip promptDialog propModCtx propMove psdChannelOutliner psdEditTextureFile psdExport psdTextureFile putenv pwd python querySubdiv quit rad_to_deg radial radioButton radioButtonGrp radioCollection radioMenuItemCollection rampColorPort rand randomizeFollicles randstate rangeControl readTake rebuildCurve rebuildSurface recordAttr recordDevice redo reference referenceEdit referenceQuery refineSubdivSelectionList refresh refreshAE registerPluginResource rehash reloadImage removeJoint removeMultiInstance removePanelCategory rename renameAttr renameSelectionList renameUI render renderGlobalsNode renderInfo renderLayerButton renderLayerParent renderLayerPostProcess renderLayerUnparent renderManip renderPartition renderQualityNode renderSettings renderThumbnailUpdate renderWindowEditor renderWindowSelectContext renderer reorder reorderDeformers requires reroot resampleFluid resetAE resetPfxToPolyCamera resetTool resolutionNode retarget reverseCurve reverseSurface revolve rgb_to_hsv rigidBody rigidSolver roll rollCtx rootOf rot rotate rotationInterpolation roundConstantRadius rowColumnLayout rowLayout runTimeCommand runup sampleImage saveAllShelves saveAttrPreset saveFluid saveImage saveInitialState saveMenu savePrefObjects savePrefs saveShelf saveToolSettings scale scaleBrushBrightness scaleComponents scaleConstraint scaleKey scaleKeyCtx sceneEditor sceneUIReplacement scmh scriptCtx scriptEditorInfo scriptJob scriptNode scriptTable scriptToShelf scriptedPanel scriptedPanelType scrollField scrollLayout sculpt searchPathArray seed selLoadSettings select selectContext selectCurveCV selectKey selectKeyCtx selectKeyframeRegionCtx selectMode selectPref selectPriority selectType selectedNodes selectionConnection separator setAttr setAttrEnumResource setAttrMapping setAttrNiceNameResource setConstraintRestPosition setDefaultShadingGroup setDrivenKeyframe setDynamic setEditCtx setEditor setFluidAttr setFocus setInfinity setInputDeviceMapping setKeyCtx setKeyPath setKeyframe setKeyframeBlendshapeTargetWts setMenuMode setNodeNiceNameResource setNodeTypeFlag setParent setParticleAttr setPfxToPolyCamera setPluginResource setProject setStampDensity setStartupMessage setState setToolTo setUITemplate setXformManip sets shadingConnection shadingGeometryRelCtx shadingLightRelCtx shadingNetworkCompare shadingNode shapeCompare shelfButton shelfLayout shelfTabLayout shellField shortNameOf showHelp showHidden showManipCtx showSelectionInTitle showShadingGroupAttrEditor showWindow sign simplify sin singleProfileBirailSurface size sizeBytes skinCluster skinPercent smoothCurve smoothTangentSurface smoothstep snap2to2 snapKey snapMode snapTogetherCtx snapshot soft softMod softModCtx sort sound soundControl source spaceLocator sphere sphrand spotLight spotLightPreviewPort spreadSheetEditor spring sqrt squareSurface srtContext stackTrace startString startsWith stitchAndExplodeShell stitchSurface stitchSurfacePoints strcmp stringArrayCatenate stringArrayContains stringArrayCount stringArrayInsertAtIndex stringArrayIntersector stringArrayRemove stringArrayRemoveAtIndex stringArrayRemoveDuplicates stringArrayRemoveExact stringArrayToString stringToStringArray strip stripPrefixFromName stroke subdAutoProjection subdCleanTopology subdCollapse subdDuplicateAndConnect subdEditUV subdListComponentConversion subdMapCut subdMapSewMove subdMatchTopology subdMirror subdToBlind subdToPoly subdTransferUVsToCache subdiv subdivCrease subdivDisplaySmoothness substitute substituteAllString substituteGeometry substring surface surfaceSampler surfaceShaderList swatchDisplayPort switchTable symbolButton symbolCheckBox sysFile system tabLayout tan tangentConstraint texLatticeDeformContext texManipContext texMoveContext texMoveUVShellContext texRotateContext texScaleContext texSelectContext texSelectShortestPathCtx texSmudgeUVContext texWinToolCtx text textCurves textField textFieldButtonGrp textFieldGrp textManip textScrollList textToShelf textureDisplacePlane textureHairColor texturePlacementContext textureWindow threadCount threePointArcCtx timeControl timePort timerX toNativePath toggle toggleAxis toggleWindowVisibility tokenize tokenizeList tolerance tolower toolButton toolCollection toolDropped toolHasOptions toolPropertyWindow torus toupper trace track trackCtx transferAttributes transformCompare transformLimits translator trim trunc truncateFluidCache truncateHairCache tumble tumbleCtx turbulence twoPointArcCtx uiRes uiTemplate unassignInputDevice undo undoInfo ungroup uniform unit unloadPlugin untangleUV untitledFileName untrim upAxis updateAE userCtx uvLink uvSnapshot validateShelfName vectorize view2dToolCtx viewCamera viewClipPlane viewFit viewHeadOn viewLookAt viewManip viewPlace viewSet visor volumeAxis vortex waitCursor warning webBrowser webBrowserPrefs whatIs window windowPref wire wireContext workspace wrinkle wrinkleContext writeTake xbmLangPathList xform",i:"</",c:[a.CNM,a.ASM,a.QSM,{cN:"string",b:"`",e:"`",c:[a.BE]},{cN:"variable",v:[{b:"\\$\\d"},{b:"[\\$\\%\\@](\\^\\w\\b|#\\w+|[^\\s\\w{]|{\\w+}|\\w+)"},{b:"\\*(\\^\\w\\b|#\\w+|[^\\s\\w{]|{\\w+}|\\w+)",r:0}]},a.CLCM,a.CBCM]}});hljs.registerLanguage("dos",function(a){return{aliases:["bat","cmd"],cI:true,k:{flow:"if else goto for in do call exit not exist errorlevel defined equ neq lss leq gtr geq",keyword:"shift cd dir echo setlocal endlocal set pause copy",stream:"prn nul lpt3 lpt2 lpt1 con com4 com3 com2 com1 aux",winutils:"ping net ipconfig taskkill xcopy ren del"},c:[{cN:"envvar",b:"%%[^ ]"},{cN:"envvar",b:"%[^ ]+?%"},{cN:"envvar",b:"![^ ]+?!"},{cN:"number",b:"\\b\\d+",r:0},{cN:"comment",b:"@?rem",e:"$"}]}});hljs.registerLanguage("apache",function(a){var b={cN:"number",b:"[\\$%]\\d+"};return{aliases:["apacheconf"],cI:true,c:[a.HCM,{cN:"tag",b:"</?",e:">"},{cN:"keyword",b:/\w+/,r:0,k:{common:"order deny allow setenv rewriterule rewriteengine rewritecond documentroot sethandler errordocument loadmodule options header listen serverroot servername"},starts:{e:/$/,r:0,k:{literal:"on off all"},c:[{cN:"sqbracket",b:"\\s\\[",e:"\\]$"},{cN:"cbracket",b:"[\\$%]\\{",e:"\\}",c:["self",b]},b,a.QSM]}}],i:/\S/}});hljs.registerLanguage("scss",function(a){var c="[a-zA-Z-][a-zA-Z0-9_-]*";var f={cN:"variable",b:"(\\$"+c+")\\b"};var d={cN:"function",b:c+"\\(",rB:true,eE:true,e:"\\("};var b={cN:"hexcolor",b:"#[0-9A-Fa-f]+"};var e={cN:"attribute",b:"[A-Z\\_\\.\\-]+",e:":",eE:true,i:"[^\\s]",starts:{cN:"value",eW:true,eE:true,c:[d,b,a.CSSNM,a.QSM,a.ASM,a.CBCM,{cN:"important",b:"!important"}]}};return{cI:true,i:"[=/|']",c:[a.CLCM,a.CBCM,d,{cN:"id",b:"\\#[A-Za-z0-9_-]+",r:0},{cN:"class",b:"\\.[A-Za-z0-9_-]+",r:0},{cN:"attr_selector",b:"\\[",e:"\\]",i:"$"},{cN:"tag",b:"\\b(a|abbr|acronym|address|area|article|aside|audio|b|base|big|blockquote|body|br|button|canvas|caption|cite|code|col|colgroup|command|datalist|dd|del|details|dfn|div|dl|dt|em|embed|fieldset|figcaption|figure|footer|form|frame|frameset|(h[1-6])|head|header|hgroup|hr|html|i|iframe|img|input|ins|kbd|keygen|label|legend|li|link|map|mark|meta|meter|nav|noframes|noscript|object|ol|optgroup|option|output|p|param|pre|progress|q|rp|rt|ruby|samp|script|section|select|small|span|strike|strong|style|sub|sup|table|tbody|td|textarea|tfoot|th|thead|time|title|tr|tt|ul|var|video)\\b",r:0},{cN:"pseudo",b:":(visited|valid|root|right|required|read-write|read-only|out-range|optional|only-of-type|only-child|nth-of-type|nth-last-of-type|nth-last-child|nth-child|not|link|left|last-of-type|last-child|lang|invalid|indeterminate|in-range|hover|focus|first-of-type|first-line|first-letter|first-child|first|enabled|empty|disabled|default|checked|before|after|active)"},{cN:"pseudo",b:"::(after|before|choices|first-letter|first-line|repeat-index|repeat-item|selection|value)"},f,{cN:"attribute",b:"\\b(z-index|word-wrap|word-spacing|word-break|width|widows|white-space|visibility|vertical-align|unicode-bidi|transition-timing-function|transition-property|transition-duration|transition-delay|transition|transform-style|transform-origin|transform|top|text-underline-position|text-transform|text-shadow|text-rendering|text-overflow|text-indent|text-decoration-style|text-decoration-line|text-decoration-color|text-decoration|text-align-last|text-align|tab-size|table-layout|right|resize|quotes|position|pointer-events|perspective-origin|perspective|page-break-inside|page-break-before|page-break-after|padding-top|padding-right|padding-left|padding-bottom|padding|overflow-y|overflow-x|overflow-wrap|overflow|outline-width|outline-style|outline-offset|outline-color|outline|orphans|order|opacity|object-position|object-fit|normal|none|nav-up|nav-right|nav-left|nav-index|nav-down|min-width|min-height|max-width|max-height|mask|marks|margin-top|margin-right|margin-left|margin-bottom|margin|list-style-type|list-style-position|list-style-image|list-style|line-height|letter-spacing|left|justify-content|initial|inherit|ime-mode|image-orientation|image-resolution|image-rendering|icon|hyphens|height|font-weight|font-variant-ligatures|font-variant|font-style|font-stretch|font-size-adjust|font-size|font-language-override|font-kerning|font-feature-settings|font-family|font|float|flex-wrap|flex-shrink|flex-grow|flex-flow|flex-direction|flex-basis|flex|filter|empty-cells|display|direction|cursor|counter-reset|counter-increment|content|column-width|column-span|column-rule-width|column-rule-style|column-rule-color|column-rule|column-gap|column-fill|column-count|columns|color|clip-path|clip|clear|caption-side|break-inside|break-before|break-after|box-sizing|box-shadow|box-decoration-break|bottom|border-width|border-top-width|border-top-style|border-top-right-radius|border-top-left-radius|border-top-color|border-top|border-style|border-spacing|border-right-width|border-right-style|border-right-color|border-right|border-radius|border-left-width|border-left-style|border-left-color|border-left|border-image-width|border-image-source|border-image-slice|border-image-repeat|border-image-outset|border-image|border-color|border-collapse|border-bottom-width|border-bottom-style|border-bottom-right-radius|border-bottom-left-radius|border-bottom-color|border-bottom|border|background-size|background-repeat|background-position|background-origin|background-image|background-color|background-clip|background-attachment|background|backface-visibility|auto|animation-timing-function|animation-play-state|animation-name|animation-iteration-count|animation-fill-mode|animation-duration|animation-direction|animation-delay|animation|align-self|align-items|align-content)\\b",i:"[^\\s]"},{cN:"value",b:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{cN:"value",b:":",e:";",c:[d,f,b,a.CSSNM,a.QSM,a.ASM,{cN:"important",b:"!important"}]},{cN:"at_rule",b:"@",e:"[{;]",k:"mixin include extend for if else each while charset import debug media page content font-face namespace warn",c:[d,f,a.QSM,a.ASM,b,a.CSSNM,{cN:"preprocessor",b:"\\s[A-Za-z0-9_.-]+",r:0}]}]}});hljs.registerLanguage("monkey",function(a){var b={v:[{cN:"number",b:"[$][a-fA-F0-9]+"},a.NM]};return{cI:true,k:{keyword:"public private property continue exit extern new try catch eachin not abstract final select case default const local global field end if then else elseif endif while wend repeat until forever for to step next return module inline throw",built_in:"DebugLog DebugStop Error Print ACos ACosr ASin ASinr ATan ATan2 ATan2r ATanr Abs Abs Ceil Clamp Clamp Cos Cosr Exp Floor Log Max Max Min Min Pow Sgn Sgn Sin Sinr Sqrt Tan Tanr Seed PI HALFPI TWOPI",literal:"true false null and or shl shr mod"},c:[{cN:"comment",b:"#rem",e:"#end"},{cN:"comment",b:"'",e:"$",r:0},{cN:"function",bK:"function method",e:"[(=:]|$",i:/\n/,c:[a.UTM,]},{cN:"class",bK:"class interface",e:"$",c:[{bK:"extends implements"},a.UTM]},{cN:"variable",b:"\\b(self|super)\\b"},{cN:"preprocessor",bK:"import",e:"$"},{cN:"preprocessor",b:"\\s*#",e:"$",k:"if else elseif endif end then"},{cN:"pi",b:"^\\s*strict\\b"},{bK:"alias",e:"=",c:[a.UTM]},a.QSM,b]}});hljs.registerLanguage("applescript",function(a){var b=a.inherit(a.QSM,{i:""});var d={cN:"params",b:"\\(",e:"\\)",c:["self",a.CNM,b]};var c=[{cN:"comment",b:"--",e:"$"},{cN:"comment",b:"\\(\\*",e:"\\*\\)",c:["self",{b:"--",e:"$"}]},a.HCM];return{aliases:["osascript"],k:{keyword:"about above after against and around as at back before beginning behind below beneath beside between but by considering contain contains continue copy div does eighth else end equal equals error every exit fifth first for fourth from front get given global if ignoring in into is it its last local me middle mod my ninth not of on onto or over prop property put ref reference repeat returning script second set seventh since sixth some tell tenth that the|0 then third through thru timeout times to transaction try until where while whose with without",constant:"AppleScript false linefeed return pi quote result space tab true",type:"alias application boolean class constant date file integer list number real record string text",command:"activate beep count delay launch log offset read round run say summarize write",property:"character characters contents day frontmost id item length month name paragraph paragraphs rest reverse running time version weekday word words year"},c:[b,a.CNM,{cN:"type",b:"\\bPOSIX file\\b"},{cN:"command",b:"\\b(clipboard info|the clipboard|info for|list (disks|folder)|mount volume|path to|(close|open for) access|(get|set) eof|current date|do shell script|get volume settings|random number|set volume|system attribute|system info|time to GMT|(load|run|store) script|scripting components|ASCII (character|number)|localized string|choose (application|color|file|file name|folder|from list|remote application|URL)|display (alert|dialog))\\b|^\\s*return\\b"},{cN:"constant",b:"\\b(text item delimiters|current application|missing value)\\b"},{cN:"keyword",b:"\\b(apart from|aside from|instead of|out of|greater than|isn't|(doesn't|does not) (equal|come before|come after|contain)|(greater|less) than( or equal)?|(starts?|ends|begins?) with|contained by|comes (before|after)|a (ref|reference))\\b"},{cN:"property",b:"\\b(POSIX path|(date|time) string|quoted form)\\b"},{cN:"function_start",bK:"on",i:"[${=;\\n]",c:[a.UTM,d]}].concat(c),i:"//"}});hljs.registerLanguage("lasso",function(d){var b="[a-zA-Z_][a-zA-Z0-9_.]*";var i="<\\?(lasso(script)?|=)";var c="\\]|\\?>";var g={literal:"true false none minimal full all void and or not bw nbw ew new cn ncn lt lte gt gte eq neq rx nrx ft",built_in:"array date decimal duration integer map pair string tag xml null bytes list queue set stack staticarray tie local var variable global data self inherited",keyword:"error_code error_msg error_pop error_push error_reset cache database_names database_schemanames database_tablenames define_tag define_type email_batch encode_set html_comment handle handle_error header if inline iterate ljax_target link link_currentaction link_currentgroup link_currentrecord link_detail link_firstgroup link_firstrecord link_lastgroup link_lastrecord link_nextgroup link_nextrecord link_prevgroup link_prevrecord log loop namespace_using output_none portal private protect records referer referrer repeating resultset rows search_args search_arguments select sort_args sort_arguments thread_atomic value_list while abort case else if_empty if_false if_null if_true loop_abort loop_continue loop_count params params_up return return_value run_children soap_definetag soap_lastrequest soap_lastresponse tag_name ascending average by define descending do equals frozen group handle_failure import in into join let match max min on order parent protected provide public require returnhome skip split_thread sum take thread to trait type where with yield yieldhome"};var a={cN:"comment",b:"<!--",e:"-->",r:0};var j={cN:"preprocessor",b:"\\[noprocess\\]",starts:{cN:"markup",e:"\\[/noprocess\\]",rE:true,c:[a]}};var e={cN:"preprocessor",b:"\\[/noprocess|"+i};var h={cN:"variable",b:"'"+b+"'"};var f=[d.CLCM,{cN:"javadoc",b:"/\\*\\*!",e:"\\*/",c:[d.PWM]},d.CBCM,d.inherit(d.CNM,{b:d.CNR+"|-?(infinity|nan)\\b"}),d.inherit(d.ASM,{i:null}),d.inherit(d.QSM,{i:null}),{cN:"string",b:"`",e:"`"},{cN:"variable",v:[{b:"[#$]"+b},{b:"#",e:"\\d+",i:"\\W"}]},{cN:"tag",b:"::\\s*",e:b,i:"\\W"},{cN:"attribute",v:[{b:"-"+d.UIR,r:0},{b:"(\\.\\.\\.)"}]},{cN:"subst",v:[{b:"->\\s*",c:[h]},{b:":=|/(?!\\w)=?|[-+*%=<>&|!?\\\\]+",r:0}]},{cN:"built_in",b:"\\.\\.?",r:0,c:[h]},{cN:"class",bK:"define",rE:true,e:"\\(|=>",c:[d.inherit(d.TM,{b:d.UIR+"(=(?!>))?"})]}];return{aliases:["ls","lassoscript"],cI:true,l:b+"|&[lg]t;",k:g,c:[{cN:"preprocessor",b:c,r:0,starts:{cN:"markup",e:"\\[|"+i,rE:true,r:0,c:[a]}},j,e,{cN:"preprocessor",b:"\\[no_square_brackets",starts:{e:"\\[/no_square_brackets\\]",l:b+"|&[lg]t;",k:g,c:[{cN:"preprocessor",b:c,r:0,starts:{cN:"markup",e:i,rE:true,c:[a]}},j,e].concat(f)}},{cN:"preprocessor",b:"\\[",r:0},{cN:"shebang",b:"^#!.+lasso9\\b",r:10}].concat(f)}});hljs.registerLanguage("cpp",function(a){var b={keyword:"false int float while private char catch export virtual operator sizeof dynamic_cast|10 typedef const_cast|10 const struct for static_cast|10 union namespace unsigned long throw volatile static protected bool template mutable if public friend do return goto auto void enum else break new extern using true class asm case typeid short reinterpret_cast|10 default double register explicit signed typename try this switch continue wchar_t inline delete alignof char16_t char32_t constexpr decltype noexcept nullptr static_assert thread_local restrict _Bool complex _Complex _Imaginary",built_in:"std string cin cout cerr clog stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap array shared_ptr abort abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf"};return{aliases:["c","h","c++","h++"],k:b,i:"</",c:[a.CLCM,a.CBCM,a.QSM,{cN:"string",b:"'\\\\?.",e:"'",i:"."},{cN:"number",b:"\\b(\\d+(\\.\\d*)?|\\.\\d+)(u|U|l|L|ul|UL|f|F)"},a.CNM,{cN:"preprocessor",b:"#",e:"$",k:"if else elif endif define undef warning error line pragma",c:[{b:'include\\s*[<"]',e:'[>"]',k:"include",i:"\\n"},a.CLCM]},{cN:"stl_container",b:"\\b(deque|list|queue|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array)\\s*<",e:">",k:b,c:["self"]},{b:a.IR+"::"}]}});hljs.registerLanguage("matlab",function(a){var b=[a.CNM,{cN:"string",b:"'",e:"'",c:[a.BE,{b:"''"}]}];return{k:{keyword:"break case catch classdef continue else elseif end enumerated events for function global if methods otherwise parfor persistent properties return spmd switch try while",built_in:"sin sind sinh asin asind asinh cos cosd cosh acos acosd acosh tan tand tanh atan atand atan2 atanh sec secd sech asec asecd asech csc cscd csch acsc acscd acsch cot cotd coth acot acotd acoth hypot exp expm1 log log1p log10 log2 pow2 realpow reallog realsqrt sqrt nthroot nextpow2 abs angle complex conj imag real unwrap isreal cplxpair fix floor ceil round mod rem sign airy besselj bessely besselh besseli besselk beta betainc betaln ellipj ellipke erf erfc erfcx erfinv expint gamma gammainc gammaln psi legendre cross dot factor isprime primes gcd lcm rat rats perms nchoosek factorial cart2sph cart2pol pol2cart sph2cart hsv2rgb rgb2hsv zeros ones eye repmat rand randn linspace logspace freqspace meshgrid accumarray size length ndims numel disp isempty isequal isequalwithequalnans cat reshape diag blkdiag tril triu fliplr flipud flipdim rot90 find sub2ind ind2sub bsxfun ndgrid permute ipermute shiftdim circshift squeeze isscalar isvector ans eps realmax realmin pi i inf nan isnan isinf isfinite j why compan gallery hadamard hankel hilb invhilb magic pascal rosser toeplitz vander wilkinson"},i:'(//|"|#|/\\*|\\s+/\\w+)',c:[{cN:"function",bK:"function",e:"$",c:[a.UTM,{cN:"params",b:"\\(",e:"\\)"},{cN:"params",b:"\\[",e:"\\]"}]},{cN:"transposed_variable",b:"[a-zA-Z_][a-zA-Z_0-9]*('+[\\.']*|[\\.']+)",e:"",r:0},{cN:"matrix",b:"\\[",e:"\\]'*[\\.']*",c:b,r:0},{cN:"cell",b:"\\{",c:b,i:/:/,v:[{e:/\}'[\.']*/},{e:/\}/,r:0}]},{cN:"comment",b:"\\%",e:"$"}].concat(b)}});hljs.registerLanguage("scilab",function(a){var b=[a.CNM,{cN:"string",b:"'|\"",e:"'|\"",c:[a.BE,{b:"''"}]}];return{aliases:["sci"],k:{keyword:"abort break case clear catch continue do elseif else endfunction end for functionglobal if pause return resume select try then while%f %F %t %T %pi %eps %inf %nan %e %i %z %s",built_in:"abs and acos asin atan ceil cd chdir clearglobal cosh cos cumprod deff disp errorexec execstr exists exp eye gettext floor fprintf fread fsolve imag isdef isemptyisinfisnan isvector lasterror length load linspace list listfiles log10 log2 logmax min msprintf mclose mopen ones or pathconvert poly printf prod pwd rand realround sinh sin size gsort sprintf sqrt strcat strcmps tring sum system tanh tantype typename warning zeros matrix"},i:'("|#|/\\*|\\s+/\\w+)',c:[{cN:"function",bK:"function endfunction",e:"$",k:"function endfunction|10",c:[a.UTM,{cN:"params",b:"\\(",e:"\\)"}]},{cN:"transposed_variable",b:"[a-zA-Z_][a-zA-Z_0-9]*('+[\\.']*|[\\.']+)",e:"",r:0},{cN:"matrix",b:"\\[",e:"\\]'*[\\.']*",r:0,c:b},{cN:"comment",b:"//",e:"$"}].concat(b)}});hljs.registerLanguage("makefile",function(a){var b={cN:"variable",b:/\$\(/,e:/\)/,c:[a.BE]};return{aliases:["mk","mak"],c:[a.HCM,{b:/^\w+\s*\W*=/,rB:true,r:0,starts:{cN:"constant",e:/\s*\W*=/,eE:true,starts:{e:/$/,r:0,c:[b]}}},{cN:"title",b:/^[\w]+:\s*$/},{cN:"phony",b:/^\.PHONY:/,e:/$/,k:".PHONY",l:/[\.\w]+/},{b:/^\t+/,e:/$/,c:[a.QSM,b]}]}});hljs.registerLanguage("asciidoc",function(a){return{c:[{cN:"comment",b:"^/{4,}\\n",e:"\\n/{4,}$",r:10},{cN:"comment",b:"^//",e:"$",r:0},{cN:"title",b:"^\\.\\w.*$"},{b:"^[=\\*]{4,}\\n",e:"\\n^[=\\*]{4,}$",r:10},{cN:"header",b:"^(={1,5}) .+?( \\1)?$",r:10},{cN:"header",b:"^[^\\[\\]\\n]+?\\n[=\\-~\\^\\+]{2,}$",r:10},{cN:"attribute",b:"^:.+?:",e:"\\s",eE:true,r:10},{cN:"attribute",b:"^\\[.+?\\]$",r:0},{cN:"blockquote",b:"^_{4,}\\n",e:"\\n_{4,}$",r:10},{cN:"code",b:"^[\\-\\.]{4,}\\n",e:"\\n[\\-\\.]{4,}$",r:10},{b:"^\\+{4,}\\n",e:"\\n\\+{4,}$",c:[{b:"<",e:">",sL:"xml",r:0}],r:10},{cN:"bullet",b:"^(\\*+|\\-+|\\.+|[^\\n]+?::)\\s+"},{cN:"label",b:"^(NOTE|TIP|IMPORTANT|WARNING|CAUTION):\\s+",r:10},{cN:"strong",b:"\\B\\*(?![\\*\\s])",e:"(\\n{2}|\\*)",c:[{b:"\\\\*\\w",r:0}]},{cN:"emphasis",b:"\\B'(?!['\\s])",e:"(\\n{2}|')",c:[{b:"\\\\'\\w",r:0}],r:0},{cN:"emphasis",b:"_(?![_\\s])",e:"(\\n{2}|_)",r:0},{cN:"smartquote",b:"``.+?''",r:10},{cN:"smartquote",b:"`.+?'",r:10},{cN:"code",b:"(`.+?`|\\+.+?\\+)",r:0},{cN:"code",b:"^[ \\t]",e:"$",r:0},{cN:"horizontal_rule",b:"^'{3,}[ \\t]*$",r:10},{b:"(link:)?(http|https|ftp|file|irc|image:?):\\S+\\[.*?\\]",rB:true,c:[{b:"(link|image:?):",r:0},{cN:"link_url",b:"\\w",e:"[^\\[]+",r:0},{cN:"link_label",b:"\\[",e:"\\]",eB:true,eE:true,r:0}],r:10}]}});hljs.registerLanguage("parser3",function(a){return{sL:"xml",r:0,c:[{cN:"comment",b:"^#",e:"$"},{cN:"comment",b:"\\^rem{",e:"}",r:10,c:[{b:"{",e:"}",c:["self"]}]},{cN:"preprocessor",b:"^@(?:BASE|USE|CLASS|OPTIONS)$",r:10},{cN:"title",b:"@[\\w\\-]+\\[[\\w^;\\-]*\\](?:\\[[\\w^;\\-]*\\])?(?:.*)$"},{cN:"variable",b:"\\$\\{?[\\w\\-\\.\\:]+\\}?"},{cN:"keyword",b:"\\^[\\w\\-\\.\\:]+"},{cN:"number",b:"\\^#[0-9a-fA-F]+"},a.CNM]}});hljs.registerLanguage("clojure",function(l){var e={built_in:"def cond apply if-not if-let if not not= = < < > <= <= >= == + / * - rem quot neg? pos? delay? symbol? keyword? true? false? integer? empty? coll? list? set? ifn? fn? associative? sequential? sorted? counted? reversible? number? decimal? class? distinct? isa? float? rational? reduced? ratio? odd? even? char? seq? vector? string? map? nil? contains? zero? instance? not-every? not-any? libspec? -> ->> .. . inc compare do dotimes mapcat take remove take-while drop letfn drop-last take-last drop-while while intern condp case reduced cycle split-at split-with repeat replicate iterate range merge zipmap declare line-seq sort comparator sort-by dorun doall nthnext nthrest partition eval doseq await await-for let agent atom send send-off release-pending-sends add-watch mapv filterv remove-watch agent-error restart-agent set-error-handler error-handler set-error-mode! error-mode shutdown-agents quote var fn loop recur throw try monitor-enter monitor-exit defmacro defn defn- macroexpand macroexpand-1 for dosync and or when when-not when-let comp juxt partial sequence memoize constantly complement identity assert peek pop doto proxy defstruct first rest cons defprotocol cast coll deftype defrecord last butlast sigs reify second ffirst fnext nfirst nnext defmulti defmethod meta with-meta ns in-ns create-ns import refer keys select-keys vals key val rseq name namespace promise into transient persistent! conj! assoc! dissoc! pop! disj! use class type num float double short byte boolean bigint biginteger bigdec print-method print-dup throw-if printf format load compile get-in update-in pr pr-on newline flush read slurp read-line subvec with-open memfn time re-find re-groups rand-int rand mod locking assert-valid-fdecl alias resolve ref deref refset swap! reset! set-validator! compare-and-set! alter-meta! reset-meta! commute get-validator alter ref-set ref-history-count ref-min-history ref-max-history ensure sync io! new next conj set! to-array future future-call into-array aset gen-class reduce map filter find empty hash-map hash-set sorted-map sorted-map-by sorted-set sorted-set-by vec vector seq flatten reverse assoc dissoc list disj get union difference intersection extend extend-type extend-protocol int nth delay count concat chunk chunk-buffer chunk-append chunk-first chunk-rest max min dec unchecked-inc-int unchecked-inc unchecked-dec-inc unchecked-dec unchecked-negate unchecked-add-int unchecked-add unchecked-subtract-int unchecked-subtract chunk-next chunk-cons chunked-seq? prn vary-meta lazy-seq spread list* str find-keyword keyword symbol gensym force rationalize"};var f="[a-zA-Z_0-9\\!\\.\\?\\-\\+\\*\\/\\<\\=\\>\\&\\#\\$';]+";var a="[\\s:\\(\\{]+\\d+(\\.\\d+)?";var d={cN:"number",b:a,r:0};var j=l.inherit(l.QSM,{i:null});var o={cN:"comment",b:";",e:"$",r:0};var n={cN:"collection",b:"[\\[\\{]",e:"[\\]\\}]"};var c={cN:"comment",b:"\\^"+f};var b={cN:"comment",b:"\\^\\{",e:"\\}"};var h={cN:"attribute",b:"[:]"+f};var m={cN:"list",b:"\\(",e:"\\)"};var g={eW:true,k:{literal:"true false nil"},r:0};var i={k:e,l:f,cN:"title",b:f,starts:g};m.c=[{cN:"comment",b:"comment"},i,g];g.c=[m,j,c,b,o,h,n,d];n.c=[m,j,c,o,h,n,d];return{aliases:["clj"],i:/\S/,c:[o,m,{cN:"prompt",b:/^=> /,starts:{e:/\n\n|\Z/}}]}});hljs.registerLanguage("elixir",function(e){var f="[a-zA-Z_][a-zA-Z0-9_]*(\\!|\\?)?";var g="[a-zA-Z_]\\w*[!?=]?|[-+~]\\@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?";var i="and false then defined module in return redo retry end for true self when next until do begin unless nil break not case cond alias while ensure or include use alias fn quote";var c={cN:"subst",b:"#\\{",e:"}",l:f,k:i};var d={cN:"string",c:[e.BE,c],v:[{b:/'/,e:/'/},{b:/"/,e:/"/}]};var b={eW:true,rE:true,l:f,k:i,r:0};var h={cN:"function",bK:"def defmacro",e:/\bdo\b/,c:[e.inherit(e.TM,{b:g,starts:b})]};var j=e.inherit(h,{cN:"class",bK:"defmodule defrecord",e:/\bdo\b|$|;/});var a=[d,e.HCM,j,h,{cN:"constant",b:"(\\b[A-Z_]\\w*(.)?)+",r:0},{cN:"symbol",b:":",c:[d,{b:g}],r:0},{cN:"symbol",b:f+":",r:0},{cN:"number",b:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",r:0},{cN:"variable",b:"(\\$\\W)|((\\$|\\@\\@?)(\\w+))"},{b:"->"},{b:"("+e.RSR+")\\s*",c:[e.HCM,{cN:"regexp",i:"\\n",c:[e.BE,c],v:[{b:"/",e:"/[a-z]*"},{b:"%r\\[",e:"\\][a-z]*"}]}],r:0}];c.c=a;b.c=a;return{l:f,k:i,c:a}});hljs.registerLanguage("typescript",function(a){return{aliases:["ts"],k:{keyword:"in if for while finally var new function|0 do return void else break catch instanceof with throw case default try this switch continue typeof delete let yield const class public private get set super interface extendsstatic constructor implements enum export import declare",literal:"true false null undefined NaN Infinity",built_in:"eval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Error EvalError InternalError RangeError ReferenceError StopIteration SyntaxError TypeError URIError Number Math Date String RegExp Array Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray ArrayBuffer DataView JSON Intl arguments require module console window document any number boolean string void",},c:[{cN:"pi",b:/^\s*('|")use strict('|")/,r:0},a.ASM,a.QSM,a.CLCM,a.CBCM,a.CNM,{b:"("+a.RSR+"|\\b(case|return|throw)\\b)\\s*",k:"return throw case",c:[a.CLCM,a.CBCM,a.RM,{b:/</,e:/>;/,r:0,sL:"xml"}],r:0},{cN:"function",bK:"function",e:/\{/,eE:true,c:[a.inherit(a.TM,{b:/[A-Za-z$_][0-9A-Za-z$_]*/}),{cN:"params",b:/\(/,e:/\)/,c:[a.CLCM,a.CBCM],i:/["'\(]/}],i:/\[|%/,r:0},{cN:"constructor",bK:"constructor",e:/\{/,eE:true,r:10},{cN:"module",bK:"module",e:/\{/,eE:true,},{cN:"interface",bK:"interface",e:/\{/,eE:true,},{b:/\$[(.]/},{b:"\\."+a.IR,r:0}]}});hljs.registerLanguage("go",function(a){var b={keyword:"break default func interface select case map struct chan else goto package switch const fallthrough if range type continue for import return var go defer",constant:"true false iota nil",typename:"bool byte complex64 complex128 float32 float64 int8 int16 int32 int64 string uint8 uint16 uint32 uint64 int uint uintptr rune",built_in:"append cap close complex copy imag len make new panic print println real recover delete"};return{aliases:["golang"],k:b,i:"</",c:[a.CLCM,a.CBCM,a.QSM,{cN:"string",b:"'",e:"[^\\\\]'"},{cN:"string",b:"`",e:"`"},{cN:"number",b:"[^a-zA-Z_0-9](\\-|\\+)?\\d+(\\.\\d+|\\/\\d+)?((d|e|f|l|s)(\\+|\\-)?\\d+)?",r:0},a.CNM]}});
\ No newline at end of file diff --git a/vendor/assets/javascripts/highlightjs.min.js b/vendor/assets/javascripts/highlightjs.min.js deleted file mode 100644 index d8acc5c5320..00000000000 --- a/vendor/assets/javascripts/highlightjs.min.js +++ /dev/null @@ -1 +0,0 @@ -var hljs=new function(){function k(v){return v.replace(/&/gm,"&").replace(/</gm,"<").replace(/>/gm,">")}function t(v){return v.nodeName.toLowerCase()}function i(w,x){var v=w&&w.exec(x);return v&&v.index==0}function d(v){return Array.prototype.map.call(v.childNodes,function(w){if(w.nodeType==3){return b.useBR?w.nodeValue.replace(/\n/g,""):w.nodeValue}if(t(w)=="br"){return"\n"}return d(w)}).join("")}function r(w){var v=(w.className+" "+(w.parentNode?w.parentNode.className:"")).split(/\s+/);v=v.map(function(x){return x.replace(/^language-/,"")});return v.filter(function(x){return j(x)||x=="no-highlight"})[0]}function o(x,y){var v={};for(var w in x){v[w]=x[w]}if(y){for(var w in y){v[w]=y[w]}}return v}function u(x){var v=[];(function w(y,z){for(var A=y.firstChild;A;A=A.nextSibling){if(A.nodeType==3){z+=A.nodeValue.length}else{if(t(A)=="br"){z+=1}else{if(A.nodeType==1){v.push({event:"start",offset:z,node:A});z=w(A,z);v.push({event:"stop",offset:z,node:A})}}}}return z})(x,0);return v}function q(w,y,C){var x=0;var F="";var z=[];function B(){if(!w.length||!y.length){return w.length?w:y}if(w[0].offset!=y[0].offset){return(w[0].offset<y[0].offset)?w:y}return y[0].event=="start"?w:y}function A(H){function G(I){return" "+I.nodeName+'="'+k(I.value)+'"'}F+="<"+t(H)+Array.prototype.map.call(H.attributes,G).join("")+">"}function E(G){F+="</"+t(G)+">"}function v(G){(G.event=="start"?A:E)(G.node)}while(w.length||y.length){var D=B();F+=k(C.substr(x,D[0].offset-x));x=D[0].offset;if(D==w){z.reverse().forEach(E);do{v(D.splice(0,1)[0]);D=B()}while(D==w&&D.length&&D[0].offset==x);z.reverse().forEach(A)}else{if(D[0].event=="start"){z.push(D[0].node)}else{z.pop()}v(D.splice(0,1)[0])}}return F+k(C.substr(x))}function m(y){function v(z){return(z&&z.source)||z}function w(A,z){return RegExp(v(A),"m"+(y.cI?"i":"")+(z?"g":""))}function x(D,C){if(D.compiled){return}D.compiled=true;D.k=D.k||D.bK;if(D.k){var z={};function E(G,F){if(y.cI){F=F.toLowerCase()}F.split(" ").forEach(function(H){var I=H.split("|");z[I[0]]=[G,I[1]?Number(I[1]):1]})}if(typeof D.k=="string"){E("keyword",D.k)}else{Object.keys(D.k).forEach(function(F){E(F,D.k[F])})}D.k=z}D.lR=w(D.l||/\b[A-Za-z0-9_]+\b/,true);if(C){if(D.bK){D.b=D.bK.split(" ").join("|")}if(!D.b){D.b=/\B|\b/}D.bR=w(D.b);if(!D.e&&!D.eW){D.e=/\B|\b/}if(D.e){D.eR=w(D.e)}D.tE=v(D.e)||"";if(D.eW&&C.tE){D.tE+=(D.e?"|":"")+C.tE}}if(D.i){D.iR=w(D.i)}if(D.r===undefined){D.r=1}if(!D.c){D.c=[]}var B=[];D.c.forEach(function(F){if(F.v){F.v.forEach(function(G){B.push(o(F,G))})}else{B.push(F=="self"?D:F)}});D.c=B;D.c.forEach(function(F){x(F,D)});if(D.starts){x(D.starts,C)}var A=D.c.map(function(F){return F.bK?"\\.?\\b("+F.b+")\\b\\.?":F.b}).concat([D.tE]).concat([D.i]).map(v).filter(Boolean);D.t=A.length?w(A.join("|"),true):{exec:function(F){return null}};D.continuation={}}x(y)}function c(S,L,J,R){function v(U,V){for(var T=0;T<V.c.length;T++){if(i(V.c[T].bR,U)){return V.c[T]}}}function z(U,T){if(i(U.eR,T)){return U}if(U.eW){return z(U.parent,T)}}function A(T,U){return !J&&i(U.iR,T)}function E(V,T){var U=M.cI?T[0].toLowerCase():T[0];return V.k.hasOwnProperty(U)&&V.k[U]}function w(Z,X,W,V){var T=V?"":b.classPrefix,U='<span class="'+T,Y=W?"":"</span>";U+=Z+'">';return U+X+Y}function N(){var U=k(C);if(!I.k){return U}var T="";var X=0;I.lR.lastIndex=0;var V=I.lR.exec(U);while(V){T+=U.substr(X,V.index-X);var W=E(I,V);if(W){H+=W[1];T+=w(W[0],V[0])}else{T+=V[0]}X=I.lR.lastIndex;V=I.lR.exec(U)}return T+U.substr(X)}function F(){if(I.sL&&!f[I.sL]){return k(C)}var T=I.sL?c(I.sL,C,true,I.continuation.top):g(C);if(I.r>0){H+=T.r}if(I.subLanguageMode=="continuous"){I.continuation.top=T.top}return w(T.language,T.value,false,true)}function Q(){return I.sL!==undefined?F():N()}function P(V,U){var T=V.cN?w(V.cN,"",true):"";if(V.rB){D+=T;C=""}else{if(V.eB){D+=k(U)+T;C=""}else{D+=T;C=U}}I=Object.create(V,{parent:{value:I}})}function G(T,X){C+=T;if(X===undefined){D+=Q();return 0}var V=v(X,I);if(V){D+=Q();P(V,X);return V.rB?0:X.length}var W=z(I,X);if(W){var U=I;if(!(U.rE||U.eE)){C+=X}D+=Q();do{if(I.cN){D+="</span>"}H+=I.r;I=I.parent}while(I!=W.parent);if(U.eE){D+=k(X)}C="";if(W.starts){P(W.starts,"")}return U.rE?0:X.length}if(A(X,I)){throw new Error('Illegal lexeme "'+X+'" for mode "'+(I.cN||"<unnamed>")+'"')}C+=X;return X.length||1}var M=j(S);if(!M){throw new Error('Unknown language: "'+S+'"')}m(M);var I=R||M;var D="";for(var K=I;K!=M;K=K.parent){if(K.cN){D=w(K.cN,D,true)}}var C="";var H=0;try{var B,y,x=0;while(true){I.t.lastIndex=x;B=I.t.exec(L);if(!B){break}y=G(L.substr(x,B.index-x),B[0]);x=B.index+y}G(L.substr(x));for(var K=I;K.parent;K=K.parent){if(K.cN){D+="</span>"}}return{r:H,value:D,language:S,top:I}}catch(O){if(O.message.indexOf("Illegal")!=-1){return{r:0,value:k(L)}}else{throw O}}}function g(y,x){x=x||b.languages||Object.keys(f);var v={r:0,value:k(y)};var w=v;x.forEach(function(z){if(!j(z)){return}var A=c(z,y,false);A.language=z;if(A.r>w.r){w=A}if(A.r>v.r){w=v;v=A}});if(w.language){v.second_best=w}return v}function h(v){if(b.tabReplace){v=v.replace(/^((<[^>]+>|\t)+)/gm,function(w,z,y,x){return z.replace(/\t/g,b.tabReplace)})}if(b.useBR){v=v.replace(/\n/g,"<br>")}return v}function p(z){var y=d(z);var A=r(z);if(A=="no-highlight"){return}var v=A?c(A,y,true):g(y);var w=u(z);if(w.length){var x=document.createElementNS("http://www.w3.org/1999/xhtml","pre");x.innerHTML=v.value;v.value=q(w,u(x),y)}v.value=h(v.value);z.innerHTML=v.value;z.className+=" hljs "+(!A&&v.language||"");z.result={language:v.language,re:v.r};if(v.second_best){z.second_best={language:v.second_best.language,re:v.second_best.r}}}var b={classPrefix:"hljs-",tabReplace:null,useBR:false,languages:undefined};function s(v){b=o(b,v)}function l(){if(l.called){return}l.called=true;var v=document.querySelectorAll("pre code");Array.prototype.forEach.call(v,p)}function a(){addEventListener("DOMContentLoaded",l,false);addEventListener("load",l,false)}var f={};var n={};function e(v,x){var w=f[v]=x(this);if(w.aliases){w.aliases.forEach(function(y){n[y]=v})}}function j(v){return f[v]||f[n[v]]}this.highlight=c;this.highlightAuto=g;this.fixMarkup=h;this.highlightBlock=p;this.configure=s;this.initHighlighting=l;this.initHighlightingOnLoad=a;this.registerLanguage=e;this.getLanguage=j;this.inherit=o;this.IR="[a-zA-Z][a-zA-Z0-9_]*";this.UIR="[a-zA-Z_][a-zA-Z0-9_]*";this.NR="\\b\\d+(\\.\\d+)?";this.CNR="(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)";this.BNR="\\b(0b[01]+)";this.RSR="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~";this.BE={b:"\\\\[\\s\\S]",r:0};this.ASM={cN:"string",b:"'",e:"'",i:"\\n",c:[this.BE]};this.QSM={cN:"string",b:'"',e:'"',i:"\\n",c:[this.BE]};this.CLCM={cN:"comment",b:"//",e:"$"};this.CBLCLM={cN:"comment",b:"/\\*",e:"\\*/"};this.HCM={cN:"comment",b:"#",e:"$"};this.NM={cN:"number",b:this.NR,r:0};this.CNM={cN:"number",b:this.CNR,r:0};this.BNM={cN:"number",b:this.BNR,r:0};this.REGEXP_MODE={cN:"regexp",b:/\//,e:/\/[gim]*/,i:/\n/,c:[this.BE,{b:/\[/,e:/\]/,r:0,c:[this.BE]}]};this.TM={cN:"title",b:this.IR,r:0};this.UTM={cN:"title",b:this.UIR,r:0}}();hljs.registerLanguage("bash",function(b){var a={cN:"variable",v:[{b:/\$[\w\d#@][\w\d_]*/},{b:/\$\{(.*?)\}/}]};var d={cN:"string",b:/"/,e:/"/,c:[b.BE,a,{cN:"variable",b:/\$\(/,e:/\)/,c:[b.BE]}]};var c={cN:"string",b:/'/,e:/'/};return{l:/-?[a-z\.]+/,k:{keyword:"if then else elif fi for break continue while in do done exit return set declare case esac export exec",literal:"true false",built_in:"printf echo read cd pwd pushd popd dirs let eval unset typeset readonly getopts source shopt caller type hash bind help sudo",operator:"-ne -eq -lt -gt -f -d -e -s -l -a"},c:[{cN:"shebang",b:/^#![^\n]+sh\s*$/,r:10},{cN:"function",b:/\w[\w\d_]*\s*\(\s*\)\s*\{/,rB:true,c:[b.inherit(b.TM,{b:/\w[\w\d_]*/})],r:0},b.HCM,b.NM,d,c,a]}});hljs.registerLanguage("cs",function(b){var a="abstract as base bool break byte case catch char checked const continue decimal default delegate do double else enum event explicit extern false finally fixed float for foreach goto if implicit in int interface internal is lock long new null object operator out override params private protected public readonly ref return sbyte sealed short sizeof stackalloc static string struct switch this throw true try typeof uint ulong unchecked unsafe ushort using virtual volatile void while async await ascending descending from get group into join let orderby partial select set value var where yield";return{k:a,c:[{cN:"comment",b:"///",e:"$",rB:true,c:[{cN:"xmlDocTag",b:"///|<!--|-->"},{cN:"xmlDocTag",b:"</?",e:">"}]},b.CLCM,b.CBLCLM,{cN:"preprocessor",b:"#",e:"$",k:"if else elif endif define undef warning error line region endregion pragma checksum"},{cN:"string",b:'@"',e:'"',c:[{b:'""'}]},b.ASM,b.QSM,b.CNM,{bK:"protected public private internal",e:/[{;=]/,k:a,c:[{bK:"class namespace interface",starts:{c:[b.TM]}},{b:b.IR+"\\s*\\(",rB:true,c:[b.TM]}]}]}});hljs.registerLanguage("ruby",function(e){var h="[a-zA-Z_]\\w*[!?=]?|[-+~]\\@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?";var g="and false then defined module in return redo if BEGIN retry end for true self when next until do begin unless END rescue nil else break undef not super class case require yield alias while ensure elsif or include attr_reader attr_writer attr_accessor";var a={cN:"yardoctag",b:"@[A-Za-z]+"};var i={cN:"comment",v:[{b:"#",e:"$",c:[a]},{b:"^\\=begin",e:"^\\=end",c:[a],r:10},{b:"^__END__",e:"\\n$"}]};var c={cN:"subst",b:"#\\{",e:"}",k:g};var d={cN:"string",c:[e.BE,c],v:[{b:/'/,e:/'/},{b:/"/,e:/"/},{b:"%[qw]?\\(",e:"\\)"},{b:"%[qw]?\\[",e:"\\]"},{b:"%[qw]?{",e:"}"},{b:"%[qw]?<",e:">",r:10},{b:"%[qw]?/",e:"/",r:10},{b:"%[qw]?%",e:"%",r:10},{b:"%[qw]?-",e:"-",r:10},{b:"%[qw]?\\|",e:"\\|",r:10},{b:/\B\?(\\\d{1,3}|\\x[A-Fa-f0-9]{1,2}|\\u[A-Fa-f0-9]{4}|\\?\S)\b/}]};var b={cN:"params",b:"\\(",e:"\\)",k:g};var f=[d,i,{cN:"class",bK:"class module",e:"$|;",i:/=/,c:[e.inherit(e.TM,{b:"[A-Za-z_]\\w*(::\\w+)*(\\?|\\!)?"}),{cN:"inheritance",b:"<\\s*",c:[{cN:"parent",b:"("+e.IR+"::)?"+e.IR}]},i]},{cN:"function",bK:"def",e:" |$|;",r:0,c:[e.inherit(e.TM,{b:h}),b,i]},{cN:"constant",b:"(::)?(\\b[A-Z]\\w*(::)?)+",r:0},{cN:"symbol",b:":",c:[d,{b:h}],r:0},{cN:"symbol",b:e.UIR+"(\\!|\\?)?:",r:0},{cN:"number",b:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",r:0},{cN:"variable",b:"(\\$\\W)|((\\$|\\@\\@?)(\\w+))"},{b:"("+e.RSR+")\\s*",c:[i,{cN:"regexp",c:[e.BE,c],i:/\n/,v:[{b:"/",e:"/[a-z]*"},{b:"%r{",e:"}[a-z]*"},{b:"%r\\(",e:"\\)[a-z]*"},{b:"%r!",e:"![a-z]*"},{b:"%r\\[",e:"\\][a-z]*"}]}],r:0}];c.c=f;b.c=f;return{k:g,c:f}});hljs.registerLanguage("diff",function(a){return{c:[{cN:"chunk",r:10,v:[{b:/^\@\@ +\-\d+,\d+ +\+\d+,\d+ +\@\@$/},{b:/^\*\*\* +\d+,\d+ +\*\*\*\*$/},{b:/^\-\-\- +\d+,\d+ +\-\-\-\-$/}]},{cN:"header",v:[{b:/Index: /,e:/$/},{b:/=====/,e:/=====$/},{b:/^\-\-\-/,e:/$/},{b:/^\*{3} /,e:/$/},{b:/^\+\+\+/,e:/$/},{b:/\*{5}/,e:/\*{5}$/}]},{cN:"addition",b:"^\\+",e:"$"},{cN:"deletion",b:"^\\-",e:"$"},{cN:"change",b:"^\\!",e:"$"}]}});hljs.registerLanguage("javascript",function(a){return{aliases:["js"],k:{keyword:"in if for while finally var new function do return void else break catch instanceof with throw case default try this switch continue typeof delete let yield const class",literal:"true false null undefined NaN Infinity",built_in:"eval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Error EvalError InternalError RangeError ReferenceError StopIteration SyntaxError TypeError URIError Number Math Date String RegExp Array Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray ArrayBuffer DataView JSON Intl arguments require"},c:[{cN:"pi",b:/^\s*('|")use strict('|")/,r:10},a.ASM,a.QSM,a.CLCM,a.CBLCLM,a.CNM,{b:"("+a.RSR+"|\\b(case|return|throw)\\b)\\s*",k:"return throw case",c:[a.CLCM,a.CBLCLM,a.REGEXP_MODE,{b:/</,e:/>;/,r:0,sL:"xml"}],r:0},{cN:"function",bK:"function",e:/\{/,c:[a.inherit(a.TM,{b:/[A-Za-z$_][0-9A-Za-z$_]*/}),{cN:"params",b:/\(/,e:/\)/,c:[a.CLCM,a.CBLCLM],i:/["'\(]/}],i:/\[|%/},{b:/\$[(.]/},{b:"\\."+a.IR,r:0}]}});hljs.registerLanguage("xml",function(a){var c="[A-Za-z0-9\\._:-]+";var d={b:/<\?(php)?(?!\w)/,e:/\?>/,sL:"php",subLanguageMode:"continuous"};var b={eW:true,i:/</,r:0,c:[d,{cN:"attribute",b:c,r:0},{b:"=",r:0,c:[{cN:"value",v:[{b:/"/,e:/"/},{b:/'/,e:/'/},{b:/[^\s\/>]+/}]}]}]};return{aliases:["html"],cI:true,c:[{cN:"doctype",b:"<!DOCTYPE",e:">",r:10,c:[{b:"\\[",e:"\\]"}]},{cN:"comment",b:"<!--",e:"-->",r:10},{cN:"cdata",b:"<\\!\\[CDATA\\[",e:"\\]\\]>",r:10},{cN:"tag",b:"<style(?=\\s|>|$)",e:">",k:{title:"style"},c:[b],starts:{e:"</style>",rE:true,sL:"css"}},{cN:"tag",b:"<script(?=\\s|>|$)",e:">",k:{title:"script"},c:[b],starts:{e:"<\/script>",rE:true,sL:"javascript"}},{b:"<%",e:"%>",sL:"vbscript"},d,{cN:"pi",b:/<\?\w+/,e:/\?>/,r:10},{cN:"tag",b:"</?",e:"/?>",c:[{cN:"title",b:"[^ /><]+",r:0},b]}]}});hljs.registerLanguage("markdown",function(a){return{c:[{cN:"header",v:[{b:"^#{1,6}",e:"$"},{b:"^.+?\\n[=-]{2,}$"}]},{b:"<",e:">",sL:"xml",r:0},{cN:"bullet",b:"^([*+-]|(\\d+\\.))\\s+"},{cN:"strong",b:"[*_]{2}.+?[*_]{2}"},{cN:"emphasis",v:[{b:"\\*.+?\\*"},{b:"_.+?_",r:0}]},{cN:"blockquote",b:"^>\\s+",e:"$"},{cN:"code",v:[{b:"`.+?`"},{b:"^( {4}|\t)",e:"$",r:0}]},{cN:"horizontal_rule",b:"^[-\\*]{3,}",e:"$"},{b:"\\[.+?\\][\\(\\[].+?[\\)\\]]",rB:true,c:[{cN:"link_label",b:"\\[",e:"\\]",eB:true,rE:true,r:0},{cN:"link_url",b:"\\]\\(",e:"\\)",eB:true,eE:true},{cN:"link_reference",b:"\\]\\[",e:"\\]",eB:true,eE:true,}],r:10},{b:"^\\[.+\\]:",e:"$",rB:true,c:[{cN:"link_reference",b:"\\[",e:"\\]",eB:true,eE:true},{cN:"link_url",b:"\\s",e:"$"}]}]}});hljs.registerLanguage("css",function(a){var b="[a-zA-Z-][a-zA-Z0-9_-]*";var c={cN:"function",b:b+"\\(",e:"\\)",c:["self",a.NM,a.ASM,a.QSM]};return{cI:true,i:"[=/|']",c:[a.CBLCLM,{cN:"id",b:"\\#[A-Za-z0-9_-]+"},{cN:"class",b:"\\.[A-Za-z0-9_-]+",r:0},{cN:"attr_selector",b:"\\[",e:"\\]",i:"$"},{cN:"pseudo",b:":(:)?[a-zA-Z0-9\\_\\-\\+\\(\\)\\\"\\']+"},{cN:"at_rule",b:"@(font-face|page)",l:"[a-z-]+",k:"font-face page"},{cN:"at_rule",b:"@",e:"[{;]",c:[{cN:"keyword",b:/\S+/},{b:/\s/,eW:true,eE:true,r:0,c:[c,a.ASM,a.QSM,a.NM]}]},{cN:"tag",b:b,r:0},{cN:"rules",b:"{",e:"}",i:"[^\\s]",r:0,c:[a.CBLCLM,{cN:"rule",b:"[^\\s]",rB:true,e:";",eW:true,c:[{cN:"attribute",b:"[A-Z\\_\\.\\-]+",e:":",eE:true,i:"[^\\s]",starts:{cN:"value",eW:true,eE:true,c:[c,a.NM,a.QSM,a.ASM,a.CBLCLM,{cN:"hexcolor",b:"#[0-9A-Fa-f]+"},{cN:"important",b:"!important"}]}}]}]}]}});hljs.registerLanguage("http",function(a){return{i:"\\S",c:[{cN:"status",b:"^HTTP/[0-9\\.]+",e:"$",c:[{cN:"number",b:"\\b\\d{3}\\b"}]},{cN:"request",b:"^[A-Z]+ (.*?) HTTP/[0-9\\.]+$",rB:true,e:"$",c:[{cN:"string",b:" ",e:" ",eB:true,eE:true}]},{cN:"attribute",b:"^\\w",e:": ",eE:true,i:"\\n|\\s|=",starts:{cN:"string",e:"$"}},{b:"\\n\\n",starts:{sL:"",eW:true}}]}});hljs.registerLanguage("java",function(b){var a="false synchronized int abstract float private char boolean static null if const for true while long throw strictfp finally protected import native final return void enum else break transient new catch instanceof byte super volatile case assert short package default double public try this switch continue throws";return{k:a,i:/<\//,c:[{cN:"javadoc",b:"/\\*\\*",e:"\\*/",c:[{cN:"javadoctag",b:"(^|\\s)@[A-Za-z]+"}],r:10},b.CLCM,b.CBLCLM,b.ASM,b.QSM,{bK:"protected public private",e:/[{;=]/,k:a,c:[{cN:"class",bK:"class interface",eW:true,i:/[:"<>]/,c:[{bK:"extends implements",r:10},b.UTM]},{b:b.UIR+"\\s*\\(",rB:true,c:[b.UTM]}]},b.CNM,{cN:"annotation",b:"@[A-Za-z]+"}]}});hljs.registerLanguage("php",function(b){var e={cN:"variable",b:"\\$+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*"};var a={cN:"preprocessor",b:/<\?(php)?|\?>/};var c={cN:"string",c:[b.BE,a],v:[{b:'b"',e:'"'},{b:"b'",e:"'"},b.inherit(b.ASM,{i:null}),b.inherit(b.QSM,{i:null})]};var d={v:[b.BNM,b.CNM]};return{cI:true,k:"and include_once list abstract global private echo interface as static endswitch array null if endwhile or const for endforeach self var while isset public protected exit foreach throw elseif include __FILE__ empty require_once do xor return parent clone use __CLASS__ __LINE__ else break print eval new catch __METHOD__ case exception default die require __FUNCTION__ enddeclare final try switch continue endfor endif declare unset true false trait goto instanceof insteadof __DIR__ __NAMESPACE__ yield finally",c:[b.CLCM,b.HCM,{cN:"comment",b:"/\\*",e:"\\*/",c:[{cN:"phpdoc",b:"\\s@[A-Za-z]+"},a]},{cN:"comment",b:"__halt_compiler.+?;",eW:true,k:"__halt_compiler",l:b.UIR},{cN:"string",b:"<<<['\"]?\\w+['\"]?$",e:"^\\w+;",c:[b.BE]},a,e,{cN:"function",bK:"function",e:/[;{]/,i:"\\$|\\[|%",c:[b.UTM,{cN:"params",b:"\\(",e:"\\)",c:["self",e,b.CBLCLM,c,d]}]},{cN:"class",bK:"class interface",e:"{",i:/[:\(\$"]/,c:[{bK:"extends implements",r:10},b.UTM]},{bK:"namespace",e:";",i:/[\.']/,c:[b.UTM]},{bK:"use",e:";",c:[b.UTM]},{b:"=>"},c,d]}});hljs.registerLanguage("python",function(a){var f={cN:"prompt",b:/^(>>>|\.\.\.) /};var b={cN:"string",c:[a.BE],v:[{b:/(u|b)?r?'''/,e:/'''/,c:[f],r:10},{b:/(u|b)?r?"""/,e:/"""/,c:[f],r:10},{b:/(u|r|ur)'/,e:/'/,r:10},{b:/(u|r|ur)"/,e:/"/,r:10},{b:/(b|br)'/,e:/'/,},{b:/(b|br)"/,e:/"/,},a.ASM,a.QSM]};var d={cN:"number",r:0,v:[{b:a.BNR+"[lLjJ]?"},{b:"\\b(0o[0-7]+)[lLjJ]?"},{b:a.CNR+"[lLjJ]?"}]};var e={cN:"params",b:/\(/,e:/\)/,c:["self",f,d,b]};var c={e:/:/,i:/[${=;\n]/,c:[a.UTM,e]};return{k:{keyword:"and elif is global as in if from raise for except finally print import pass return exec else break not with class assert yield try while continue del or def lambda nonlocal|10 None True False",built_in:"Ellipsis NotImplemented"},i:/(<\/|->|\?)/,c:[f,d,b,a.HCM,a.inherit(c,{cN:"function",bK:"def",r:10}),a.inherit(c,{cN:"class",bK:"class"}),{cN:"decorator",b:/@/,e:/$/},{b:/\b(print|exec)\(/}]}});hljs.registerLanguage("sql",function(a){return{cI:true,i:/[<>]/,c:[{cN:"operator",b:"\\b(begin|end|start|commit|rollback|savepoint|lock|alter|create|drop|rename|call|delete|do|handler|insert|load|replace|select|truncate|update|set|show|pragma|grant|merge)\\b(?!:)",e:";",eW:true,k:{keyword:"all partial global month current_timestamp using go revoke smallint indicator end-exec disconnect zone with character assertion to add current_user usage input local alter match collate real then rollback get read timestamp session_user not integer bit unique day minute desc insert execute like ilike|2 level decimal drop continue isolation found where constraints domain right national some module transaction relative second connect escape close system_user for deferred section cast current sqlstate allocate intersect deallocate numeric public preserve full goto initially asc no key output collation group by union session both last language constraint column of space foreign deferrable prior connection unknown action commit view or first into float year primary cascaded except restrict set references names table outer open select size are rows from prepare distinct leading create only next inner authorization schema corresponding option declare precision immediate else timezone_minute external varying translation true case exception join hour default double scroll value cursor descriptor values dec fetch procedure delete and false int is describe char as at in varchar null trailing any absolute current_time end grant privileges when cross check write current_date pad begin temporary exec time update catalog user sql date on identity timezone_hour natural whenever interval work order cascade diagnostics nchar having left call do handler load replace truncate start lock show pragma exists number trigger if before after each row merge matched database",aggregate:"count sum min max avg"},c:[{cN:"string",b:"'",e:"'",c:[a.BE,{b:"''"}]},{cN:"string",b:'"',e:'"',c:[a.BE,{b:'""'}]},{cN:"string",b:"`",e:"`",c:[a.BE]},a.CNM]},a.CBLCLM,{cN:"comment",b:"--",e:"$"}]}});hljs.registerLanguage("ini",function(a){return{cI:true,i:/\S/,c:[{cN:"comment",b:";",e:"$"},{cN:"title",b:"^\\[",e:"\\]"},{cN:"setting",b:"^[a-z0-9\\[\\]_-]+[ \\t]*=[ \\t]*",e:"$",c:[{cN:"value",eW:true,k:"on off true false yes no",c:[a.QSM,a.NM],r:0}]}]}});hljs.registerLanguage("perl",function(c){var d="getpwent getservent quotemeta msgrcv scalar kill dbmclose undef lc ma syswrite tr send umask sysopen shmwrite vec qx utime local oct semctl localtime readpipe do return format read sprintf dbmopen pop getpgrp not getpwnam rewinddir qqfileno qw endprotoent wait sethostent bless s|0 opendir continue each sleep endgrent shutdown dump chomp connect getsockname die socketpair close flock exists index shmgetsub for endpwent redo lstat msgctl setpgrp abs exit select print ref gethostbyaddr unshift fcntl syscall goto getnetbyaddr join gmtime symlink semget splice x|0 getpeername recv log setsockopt cos last reverse gethostbyname getgrnam study formline endhostent times chop length gethostent getnetent pack getprotoent getservbyname rand mkdir pos chmod y|0 substr endnetent printf next open msgsnd readdir use unlink getsockopt getpriority rindex wantarray hex system getservbyport endservent int chr untie rmdir prototype tell listen fork shmread ucfirst setprotoent else sysseek link getgrgid shmctl waitpid unpack getnetbyname reset chdir grep split require caller lcfirst until warn while values shift telldir getpwuid my getprotobynumber delete and sort uc defined srand accept package seekdir getprotobyname semop our rename seek if q|0 chroot sysread setpwent no crypt getc chown sqrt write setnetent setpriority foreach tie sin msgget map stat getlogin unless elsif truncate exec keys glob tied closedirioctl socket readlink eval xor readline binmode setservent eof ord bind alarm pipe atan2 getgrent exp time push setgrent gt lt or ne m|0 break given say state when";var f={cN:"subst",b:"[$@]\\{",e:"\\}",k:d};var g={b:"->{",e:"}"};var a={cN:"variable",v:[{b:/\$\d/},{b:/[\$\%\@\*](\^\w\b|#\w+(\:\:\w+)*|{\w+}|\w+(\:\:\w*)*)/},{b:/[\$\%\@\*][^\s\w{]/,r:0}]};var e={cN:"comment",b:"^(__END__|__DATA__)",e:"\\n$",r:5};var h=[c.BE,f,a];var b=[a,c.HCM,e,{cN:"comment",b:"^\\=\\w",e:"\\=cut",eW:true},g,{cN:"string",c:h,v:[{b:"q[qwxr]?\\s*\\(",e:"\\)",r:5},{b:"q[qwxr]?\\s*\\[",e:"\\]",r:5},{b:"q[qwxr]?\\s*\\{",e:"\\}",r:5},{b:"q[qwxr]?\\s*\\|",e:"\\|",r:5},{b:"q[qwxr]?\\s*\\<",e:"\\>",r:5},{b:"qw\\s+q",e:"q",r:5},{b:"'",e:"'",c:[c.BE]},{b:'"',e:'"'},{b:"`",e:"`",c:[c.BE]},{b:"{\\w+}",c:[],r:0},{b:"-?\\w+\\s*\\=\\>",c:[],r:0}]},{cN:"number",b:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",r:0},{b:"(\\/\\/|"+c.RSR+"|\\b(split|return|print|reverse|grep)\\b)\\s*",k:"split return print reverse grep",r:0,c:[c.HCM,e,{cN:"regexp",b:"(s|tr|y)/(\\\\.|[^/])*/(\\\\.|[^/])*/[a-z]*",r:10},{cN:"regexp",b:"(m|qr)?/",e:"/[a-z]*",c:[c.BE],r:0}]},{cN:"sub",bK:"sub",e:"(\\s*\\(.*?\\))?[;{]",r:5},{cN:"operator",b:"-\\w\\b",r:0}];f.c=b;g.c=b;return{k:d,c:b}});hljs.registerLanguage("objectivec",function(a){var d={keyword:"int float while char export sizeof typedef const struct for union unsigned long volatile static bool mutable if do return goto void enum else break extern asm case short default double register explicit signed typename this switch continue wchar_t inline readonly assign self synchronized id nonatomic super unichar IBOutlet IBAction strong weak @private @protected @public @try @property @end @throw @catch @finally @synthesize @dynamic @selector @optional @required",literal:"false true FALSE TRUE nil YES NO NULL",built_in:"NSString NSDictionary CGRect CGPoint UIButton UILabel UITextView UIWebView MKMapView UISegmentedControl NSObject UITableViewDelegate UITableViewDataSource NSThread UIActivityIndicator UITabbar UIToolBar UIBarButtonItem UIImageView NSAutoreleasePool UITableView BOOL NSInteger CGFloat NSException NSLog NSMutableString NSMutableArray NSMutableDictionary NSURL NSIndexPath CGSize UITableViewCell UIView UIViewController UINavigationBar UINavigationController UITabBarController UIPopoverController UIPopoverControllerDelegate UIImage NSNumber UISearchBar NSFetchedResultsController NSFetchedResultsChangeType UIScrollView UIScrollViewDelegate UIEdgeInsets UIColor UIFont UIApplication NSNotFound NSNotificationCenter NSNotification UILocalNotification NSBundle NSFileManager NSTimeInterval NSDate NSCalendar NSUserDefaults UIWindow NSRange NSArray NSError NSURLRequest NSURLConnection UIInterfaceOrientation MPMoviePlayerController dispatch_once_t dispatch_queue_t dispatch_sync dispatch_async dispatch_once"};var c=/[a-zA-Z@][a-zA-Z0-9_]*/;var b="@interface @class @protocol @implementation";return{k:d,l:c,i:"</",c:[a.CLCM,a.CBLCLM,a.CNM,a.QSM,{cN:"string",b:"'",e:"[^\\\\]'",i:"[^\\\\][^']"},{cN:"preprocessor",b:"#import",e:"$",c:[{cN:"title",b:'"',e:'"'},{cN:"title",b:"<",e:">"}]},{cN:"preprocessor",b:"#",e:"$"},{cN:"class",b:"("+b.split(" ").join("|")+")\\b",e:"({|$)",k:b,l:c,c:[a.UTM]},{cN:"variable",b:"\\."+a.UIR,r:0}]}});hljs.registerLanguage("coffeescript",function(c){var b={keyword:"in if for while finally new do return else break catch instanceof throw try this switch continue typeof delete debugger super then unless until loop of by when and or is isnt not",literal:"true false null undefined yes no on off",reserved:"case default function var void with const let enum export import native __hasProp __extends __slice __bind __indexOf",built_in:"npm require console print module exports global window document"};var a="[A-Za-z$_][0-9A-Za-z$_]*";var f=c.inherit(c.TM,{b:a});var e={cN:"subst",b:/#\{/,e:/}/,k:b};var d=[c.BNM,c.inherit(c.CNM,{starts:{e:"(\\s*/)?",r:0}}),{cN:"string",v:[{b:/'''/,e:/'''/,c:[c.BE]},{b:/'/,e:/'/,c:[c.BE]},{b:/"""/,e:/"""/,c:[c.BE,e]},{b:/"/,e:/"/,c:[c.BE,e]}]},{cN:"regexp",v:[{b:"///",e:"///",c:[e,c.HCM]},{b:"//[gim]*",r:0},{b:"/\\S(\\\\.|[^\\n])*?/[gim]*(?=\\s|\\W|$)"}]},{cN:"property",b:"@"+a},{b:"`",e:"`",eB:true,eE:true,sL:"javascript"}];e.c=d;return{k:b,c:d.concat([{cN:"comment",b:"###",e:"###"},c.HCM,{cN:"function",b:"("+a+"\\s*=\\s*)?(\\(.*\\))?\\s*\\B[-=]>",e:"[-=]>",rB:true,c:[f,{cN:"params",b:"\\(",rB:true,c:[{b:/\(/,e:/\)/,k:b,c:["self"].concat(d)}]}]},{cN:"class",bK:"class",e:"$",i:/[:="\[\]]/,c:[{bK:"extends",eW:true,i:/[:="\[\]]/,c:[f]},f]},{cN:"attribute",b:a+":",e:":",rB:true,eE:true,r:0}])}});hljs.registerLanguage("nginx",function(c){var b={cN:"variable",v:[{b:/\$\d+/},{b:/\$\{/,e:/}/},{b:"[\\$\\@]"+c.UIR}]};var a={eW:true,l:"[a-z/_]+",k:{built_in:"on off yes no true false none blocked debug info notice warn error crit select break last permanent redirect kqueue rtsig epoll poll /dev/poll"},r:0,i:"=>",c:[c.HCM,{cN:"string",c:[c.BE,b],v:[{b:/"/,e:/"/},{b:/'/,e:/'/}]},{cN:"url",b:"([a-z]+):/",e:"\\s",eW:true,eE:true},{cN:"regexp",c:[c.BE,b],v:[{b:"\\s\\^",e:"\\s|{|;",rE:true},{b:"~\\*?\\s+",e:"\\s|{|;",rE:true},{b:"\\*(\\.[a-z\\-]+)+"},{b:"([a-z\\-]+\\.)+\\*"}]},{cN:"number",b:"\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}(:\\d{1,5})?\\b"},{cN:"number",b:"\\b\\d+[kKmMgGdshdwy]*\\b",r:0},b]};return{c:[c.HCM,{b:c.UIR+"\\s",e:";|{",rB:true,c:[c.inherit(c.UTM,{starts:a})],r:0}],i:"[^\\s\\}]"}});hljs.registerLanguage("json",function(a){var e={literal:"true false null"};var d=[a.QSM,a.CNM];var c={cN:"value",e:",",eW:true,eE:true,c:d,k:e};var b={b:"{",e:"}",c:[{cN:"attribute",b:'\\s*"',e:'"\\s*:\\s*',eB:true,eE:true,c:[a.BE],i:"\\n",starts:c}],i:"\\S"};var f={b:"\\[",e:"\\]",c:[a.inherit(c,{cN:null})],i:"\\S"};d.splice(d.length,0,b,f);return{c:d,k:e,i:"\\S"}});hljs.registerLanguage("apache",function(a){var b={cN:"number",b:"[\\$%]\\d+"};return{cI:true,c:[a.HCM,{cN:"tag",b:"</?",e:">"},{cN:"keyword",b:/\w+/,r:0,k:{common:"order deny allow setenv rewriterule rewriteengine rewritecond documentroot sethandler errordocument loadmodule options header listen serverroot servername"},starts:{e:/$/,r:0,k:{literal:"on off all"},c:[{cN:"sqbracket",b:"\\s\\[",e:"\\]$"},{cN:"cbracket",b:"[\\$%]\\{",e:"\\}",c:["self",b]},b,a.QSM]}}],i:/\S/}});hljs.registerLanguage("cpp",function(a){var b={keyword:"false int float while private char catch export virtual operator sizeof dynamic_cast|10 typedef const_cast|10 const struct for static_cast|10 union namespace unsigned long throw volatile static protected bool template mutable if public friend do return goto auto void enum else break new extern using true class asm case typeid short reinterpret_cast|10 default double register explicit signed typename try this switch continue wchar_t inline delete alignof char16_t char32_t constexpr decltype noexcept nullptr static_assert thread_local restrict _Bool complex _Complex _Imaginary",built_in:"std string cin cout cerr clog stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap array shared_ptr abort abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf"};return{aliases:["c"],k:b,i:"</",c:[a.CLCM,a.CBLCLM,a.QSM,{cN:"string",b:"'\\\\?.",e:"'",i:"."},{cN:"number",b:"\\b(\\d+(\\.\\d*)?|\\.\\d+)(u|U|l|L|ul|UL|f|F)"},a.CNM,{cN:"preprocessor",b:"#",e:"$",c:[{b:"include\\s*<",e:">",i:"\\n"},a.CLCM]},{cN:"stl_container",b:"\\b(deque|list|queue|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array)\\s*<",e:">",k:b,r:10,c:["self"]}]}});hljs.registerLanguage("makefile",function(a){var b={cN:"variable",b:/\$\(/,e:/\)/,c:[a.BE]};return{c:[a.HCM,{b:/^\w+\s*\W*=/,rB:true,r:0,starts:{cN:"constant",e:/\s*\W*=/,eE:true,starts:{e:/$/,r:0,c:[b],}}},{cN:"title",b:/^[\w]+:\s*$/},{cN:"phony",b:/^\.PHONY:/,e:/$/,k:".PHONY",l:/[\.\w]+/},{b:/^\t+/,e:/$/,c:[a.QSM,b]}]}});
\ No newline at end of file |