summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSytse Sijbrandij <sytses@gmail.com>2014-09-29 15:21:34 +0200
committerSytse Sijbrandij <sytses@gmail.com>2014-09-29 15:21:34 +0200
commit4df15fe33ebe7a351dbb609562ac3f674d9fb910 (patch)
treec9b05600b86c7659ac848bb43277e0f73ad271f2
parent6f61cbd162582c78a2c3e197f34a63e4543c9b1b (diff)
parent2ebd2d41a52dd6401d86cb57a5f64372da968c41 (diff)
downloadgitlab-ce-4df15fe33ebe7a351dbb609562ac3f674d9fb910.tar.gz
Merge branch 'master' into gitlab-flow
Conflicts: CONTRIBUTING.md
-rw-r--r--.gitignore1
-rw-r--r--.pkgr.yml6
-rw-r--r--.travis.yml36
-rw-r--r--CHANGELOG51
-rw-r--r--CONTRIBUTING.md13
-rw-r--r--GITLAB_SHELL_VERSION2
-rw-r--r--Gemfile14
-rw-r--r--Gemfile.lock36
-rw-r--r--Guardfile4
-rw-r--r--PROCESS.md2
-rw-r--r--README.md33
-rw-r--r--VERSION2
-rw-r--r--app/assets/javascripts/admin.js.coffee4
-rw-r--r--app/assets/javascripts/application.js.coffee33
-rw-r--r--app/assets/javascripts/behaviors/toggle_diff_line_wrap_behavior.coffee14
-rw-r--r--app/assets/javascripts/branch-graph.js.coffee47
-rw-r--r--app/assets/javascripts/chart.js.coffee21
-rw-r--r--app/assets/javascripts/dispatcher.js.coffee46
-rw-r--r--app/assets/javascripts/flash.js.coffee1
-rw-r--r--app/assets/javascripts/groups.js.coffee2
-rw-r--r--app/assets/javascripts/issues.js.coffee40
-rw-r--r--app/assets/javascripts/markdown_area.js.coffee2
-rw-r--r--app/assets/javascripts/network.js.coffee6
-rw-r--r--app/assets/javascripts/notes.js.coffee65
-rw-r--r--app/assets/javascripts/project.js.coffee2
-rw-r--r--app/assets/javascripts/shortcuts.js.coffee25
-rw-r--r--app/assets/javascripts/shortcuts_dashboard_navigation.js.coffee14
-rw-r--r--app/assets/javascripts/shortcuts_issueable.coffee19
-rw-r--r--app/assets/javascripts/shortcuts_navigation.coffee20
-rw-r--r--app/assets/javascripts/shortcuts_network.js.coffee12
-rw-r--r--app/assets/javascripts/stat_graph_contributors.js.coffee15
-rw-r--r--app/assets/javascripts/stat_graph_contributors_util.js.coffee2
-rw-r--r--app/assets/javascripts/zen_mode.js.coffee57
-rw-r--r--app/assets/stylesheets/generic/common.scss2
-rw-r--r--app/assets/stylesheets/generic/files.scss1
-rw-r--r--app/assets/stylesheets/generic/flash.scss16
-rw-r--r--app/assets/stylesheets/generic/forms.scss141
-rw-r--r--app/assets/stylesheets/generic/issuable.scss9
-rw-r--r--app/assets/stylesheets/generic/issue_box.scss41
-rw-r--r--app/assets/stylesheets/generic/lists.scss2
-rw-r--r--app/assets/stylesheets/generic/timeline.scss77
-rw-r--r--app/assets/stylesheets/generic/typography.scss4
-rw-r--r--app/assets/stylesheets/highlight/white.scss20
-rw-r--r--app/assets/stylesheets/main/layout.scss1
-rw-r--r--app/assets/stylesheets/main/variables.scss4
-rw-r--r--app/assets/stylesheets/sections/commits.scss1
-rw-r--r--app/assets/stylesheets/sections/dashboard.scss10
-rw-r--r--app/assets/stylesheets/sections/diff.scss11
-rw-r--r--app/assets/stylesheets/sections/help.scss53
-rw-r--r--app/assets/stylesheets/sections/nav.scss25
-rw-r--r--app/assets/stylesheets/sections/notes.scss46
-rw-r--r--app/assets/stylesheets/sections/projects.scss73
-rw-r--r--app/assets/stylesheets/sections/search.scss7
-rw-r--r--app/controllers/admin/groups_controller.rb4
-rw-r--r--app/controllers/admin/projects_controller.rb4
-rw-r--r--app/controllers/groups/group_members_controller.rb (renamed from app/controllers/users_groups_controller.rb)10
-rw-r--r--app/controllers/groups_controller.rb6
-rw-r--r--app/controllers/profiles/groups_controller.rb4
-rw-r--r--app/controllers/profiles/notifications_controller.rb12
-rw-r--r--app/controllers/projects/branches_controller.rb14
-rw-r--r--app/controllers/projects/commit_controller.rb8
-rw-r--r--app/controllers/projects/edit_tree_controller.rb5
-rw-r--r--app/controllers/projects/graphs_controller.rb25
-rw-r--r--app/controllers/projects/issues_controller.rb4
-rw-r--r--app/controllers/projects/labels_controller.rb2
-rw-r--r--app/controllers/projects/new_tree_controller.rb2
-rw-r--r--app/controllers/projects/notes_controller.rb12
-rw-r--r--app/controllers/projects/raw_controller.rb6
-rw-r--r--app/controllers/projects/repositories_controller.rb5
-rw-r--r--app/controllers/projects/tags_controller.rb15
-rw-r--r--app/controllers/projects/team_members_controller.rb14
-rw-r--r--app/controllers/projects_controller.rb10
-rw-r--r--app/controllers/search_controller.rb31
-rw-r--r--app/finders/issuable_finder.rb (renamed from app/finders/base_finder.rb)6
-rw-r--r--app/finders/issues_finder.rb2
-rw-r--r--app/finders/merge_requests_finder.rb2
-rw-r--r--app/finders/projects_finder.rb8
-rw-r--r--app/helpers/application_helper.rb9
-rw-r--r--app/helpers/commits_helper.rb124
-rw-r--r--app/helpers/diff_helper.rb108
-rw-r--r--app/helpers/events_helper.rb8
-rw-r--r--app/helpers/gitlab_markdown_helper.rb15
-rw-r--r--app/helpers/notes_helper.rb15
-rw-r--r--app/helpers/projects_helper.rb18
-rw-r--r--app/helpers/search_helper.rb20
-rw-r--r--app/mailers/emails/groups.rb2
-rw-r--r--app/mailers/emails/projects.rb6
-rw-r--r--app/models/ability.rb2
-rw-r--r--app/models/commit.rb4
-rw-r--r--app/models/concerns/issuable.rb4
-rw-r--r--app/models/concerns/notifiable.rb2
-rw-r--r--app/models/group.rb20
-rw-r--r--app/models/hooks/project_hook.rb (renamed from app/models/project_hook.rb)0
-rw-r--r--app/models/hooks/service_hook.rb (renamed from app/models/service_hook.rb)0
-rw-r--r--app/models/hooks/system_hook.rb (renamed from app/models/system_hook.rb)0
-rw-r--r--app/models/hooks/web_hook.rb (renamed from app/models/web_hook.rb)2
-rw-r--r--app/models/key.rb10
-rw-r--r--app/models/member.rb20
-rw-r--r--app/models/members/group_member.rb43
-rw-r--r--app/models/members/project_member.rb137
-rw-r--r--app/models/merge_request.rb9
-rw-r--r--app/models/network/graph.rb6
-rw-r--r--app/models/note.rb78
-rw-r--r--app/models/project.rb48
-rw-r--r--app/models/project_services/assembla_service.rb8
-rw-r--r--app/models/project_services/campfire_service.rb8
-rw-r--r--app/models/project_services/ci_service.rb7
-rw-r--r--app/models/project_services/emails_on_push_service.rb8
-rw-r--r--app/models/project_services/flowdock_service.rb8
-rw-r--r--app/models/project_services/gemnasium_service.rb8
-rw-r--r--app/models/project_services/gitlab_ci_service.rb8
-rw-r--r--app/models/project_services/hipchat_service.rb8
-rw-r--r--app/models/project_services/pivotaltracker_service.rb8
-rw-r--r--app/models/project_services/slack_service.rb8
-rw-r--r--app/models/project_team.rb24
-rw-r--r--app/models/project_wiki.rb12
-rw-r--r--app/models/repository.rb14
-rw-r--r--app/models/service.rb32
-rw-r--r--app/models/snippet.rb14
-rw-r--r--app/models/user.rb26
-rw-r--r--app/models/users_group.rb61
-rw-r--r--app/models/users_project.rb152
-rw-r--r--app/models/wiki_page.rb4
-rw-r--r--app/services/base_service.rb17
-rw-r--r--app/services/compare_service.rb4
-rw-r--r--app/services/create_branch_service.rb25
-rw-r--r--app/services/create_tag_service.rb31
-rw-r--r--app/services/delete_branch_service.rb30
-rw-r--r--app/services/files/base_service.rb14
-rw-r--r--app/services/git_push_service.rb57
-rw-r--r--app/services/notification_service.rb28
-rw-r--r--app/services/projects/create_service.rb5
-rw-r--r--app/services/projects/fork_service.rb2
-rw-r--r--app/services/search/global_service.rb20
-rw-r--r--app/services/search/project_service.rb36
-rw-r--r--app/services/search/snippet_service.rb14
-rw-r--r--app/services/system_hooks_service.rb18
-rw-r--r--app/views/admin/groups/show.html.haml6
-rw-r--r--app/views/admin/projects/show.html.haml14
-rw-r--r--app/views/admin/users/index.html.haml2
-rw-r--r--app/views/admin/users/show.html.haml16
-rw-r--r--app/views/dashboard/_groups.html.haml7
-rw-r--r--app/views/dashboard/_projects.html.haml7
-rw-r--r--app/views/devise/sessions/_oauth_providers.html.haml2
-rw-r--r--app/views/events/_event_issue.atom.haml5
-rw-r--r--app/views/events/_event_merge_request.atom.haml3
-rw-r--r--app/views/events/_event_note.atom.haml4
-rw-r--r--app/views/explore/projects/_project.html.haml17
-rw-r--r--app/views/groups/_new_group_member.html.haml6
-rw-r--r--app/views/groups/group_members/_group_member.html.haml (renamed from app/views/users_groups/_users_group.html.haml)4
-rw-r--r--app/views/groups/group_members/update.js.haml (renamed from app/views/users_groups/update.js.haml)0
-rw-r--r--app/views/groups/members.html.haml2
-rw-r--r--app/views/help/_shortcuts.html.haml229
-rw-r--r--app/views/help/index.html.haml4
-rw-r--r--app/views/layouts/_search.html.haml9
-rw-r--r--app/views/layouts/admin.html.haml6
-rw-r--r--app/views/layouts/application.html.haml6
-rw-r--r--app/views/layouts/devise.html.haml2
-rw-r--r--app/views/layouts/errors.html.haml2
-rw-r--r--app/views/layouts/group.html.haml6
-rw-r--r--app/views/layouts/nav/_dashboard.html.haml8
-rw-r--r--app/views/layouts/nav/_project.html.haml23
-rw-r--r--app/views/layouts/navless.html.haml3
-rw-r--r--app/views/layouts/profile.html.haml6
-rw-r--r--app/views/layouts/project_settings.html.haml4
-rw-r--r--app/views/layouts/projects.html.haml7
-rw-r--r--app/views/layouts/search.html.haml3
-rw-r--r--app/views/layouts/user_team.html.haml12
-rw-r--r--app/views/notify/_reassigned_issuable_email.html.haml10
-rw-r--r--app/views/notify/_reassigned_issuable_email.text.erb6
-rw-r--r--app/views/notify/project_access_granted_email.html.haml2
-rw-r--r--app/views/notify/project_access_granted_email.text.erb2
-rw-r--r--app/views/notify/project_was_moved_email.html.haml2
-rw-r--r--app/views/notify/reassigned_issue_email.html.haml12
-rw-r--r--app/views/notify/reassigned_issue_email.text.erb6
-rw-r--r--app/views/notify/reassigned_merge_request_email.html.haml8
-rw-r--r--app/views/notify/reassigned_merge_request_email.text.erb8
-rw-r--r--app/views/profiles/keys/index.html.haml2
-rw-r--r--app/views/profiles/notifications/_settings.html.haml2
-rw-r--r--app/views/profiles/notifications/show.html.haml8
-rw-r--r--app/views/profiles/show.html.haml2
-rw-r--r--app/views/projects/_home_panel.html.haml70
-rw-r--r--app/views/projects/_issuable_form.html.haml46
-rw-r--r--app/views/projects/_zen.html.haml7
-rw-r--r--app/views/projects/blame/show.html.haml25
-rw-r--r--app/views/projects/blob/_actions.html.haml3
-rw-r--r--app/views/projects/blob/_remove.html.haml5
-rw-r--r--app/views/projects/blob/diff.html.haml4
-rw-r--r--app/views/projects/branches/_branch.html.haml2
-rw-r--r--app/views/projects/branches/destroy.js.haml4
-rw-r--r--app/views/projects/branches/new.html.haml8
-rw-r--r--app/views/projects/commit/show.html.haml2
-rw-r--r--app/views/projects/commits/_commit_list.html.haml11
-rw-r--r--app/views/projects/commits/_diff_file.html.haml44
-rw-r--r--app/views/projects/commits/_diffs.html.haml23
-rw-r--r--app/views/projects/commits/_head.html.haml6
-rw-r--r--app/views/projects/commits/_parallel_view.html.haml38
-rw-r--r--app/views/projects/compare/show.html.haml16
-rw-r--r--app/views/projects/diffs/_diffs.html.haml27
-rw-r--r--app/views/projects/diffs/_file.html.haml48
-rw-r--r--app/views/projects/diffs/_image.html.haml (renamed from app/views/projects/commits/_image.html.haml)1
-rw-r--r--app/views/projects/diffs/_match_line.html.haml (renamed from app/views/projects/commits/diffs/_match_line.html.haml)0
-rw-r--r--app/views/projects/diffs/_match_line_parallel.html.haml4
-rw-r--r--app/views/projects/diffs/_parallel_view.html.haml41
-rw-r--r--app/views/projects/diffs/_stats.html.haml (renamed from app/views/projects/commits/_diff_stats.html.haml)2
-rw-r--r--app/views/projects/diffs/_text_file.html.haml (renamed from app/views/projects/commits/_text_file.html.haml)25
-rw-r--r--app/views/projects/diffs/_warning.html.haml (renamed from app/views/projects/commits/_diff_warning.html.haml)2
-rw-r--r--app/views/projects/edit_tree/_diff.html.haml13
-rw-r--r--app/views/projects/edit_tree/preview.html.haml15
-rw-r--r--app/views/projects/edit_tree/show.html.haml1
-rw-r--r--app/views/projects/empty.html.haml12
-rw-r--r--app/views/projects/graphs/_head.html.haml5
-rw-r--r--app/views/projects/graphs/commits.html.haml85
-rw-r--r--app/views/projects/graphs/show.html.haml30
-rw-r--r--app/views/projects/graphs/show.js.haml19
-rw-r--r--app/views/projects/import.html.haml4
-rw-r--r--app/views/projects/issues/_form.html.haml39
-rw-r--r--app/views/projects/issues/_head.html.haml2
-rw-r--r--app/views/projects/issues/_issue.html.haml5
-rw-r--r--app/views/projects/issues/_issue_context.html.haml4
-rw-r--r--app/views/projects/issues/show.html.haml7
-rw-r--r--app/views/projects/labels/destroy.js.haml2
-rw-r--r--app/views/projects/labels/index.html.haml16
-rw-r--r--app/views/projects/merge_requests/_form.html.haml47
-rw-r--r--app/views/projects/merge_requests/_merge_request.html.haml5
-rw-r--r--app/views/projects/merge_requests/_new_submit.html.haml19
-rw-r--r--app/views/projects/merge_requests/_show.html.haml4
-rw-r--r--app/views/projects/merge_requests/show/_context.html.haml4
-rw-r--r--app/views/projects/merge_requests/show/_diffs.html.haml2
-rw-r--r--app/views/projects/merge_requests/show/_participants.html.haml3
-rw-r--r--app/views/projects/merge_requests/show/_state_widget.html.haml2
-rw-r--r--app/views/projects/milestones/show.html.haml2
-rw-r--r--app/views/projects/network/show.html.haml9
-rw-r--r--app/views/projects/new.html.haml4
-rw-r--r--app/views/projects/new_tree/show.html.haml6
-rw-r--r--app/views/projects/notes/_diff_note_link.html.haml10
-rw-r--r--app/views/projects/notes/_diff_notes_with_reply.html.haml2
-rw-r--r--app/views/projects/notes/_diff_notes_with_reply_parallel.html.haml11
-rw-r--r--app/views/projects/notes/_discussion.html.haml19
-rw-r--r--app/views/projects/notes/_form.html.haml4
-rw-r--r--app/views/projects/notes/_note.html.haml117
-rw-r--r--app/views/projects/notes/_notes_with_form.html.haml2
-rw-r--r--app/views/projects/notes/discussions/_active.html.haml1
-rw-r--r--app/views/projects/notes/discussions/_commit.html.haml1
-rw-r--r--app/views/projects/notes/discussions/_diff.html.haml13
-rw-r--r--app/views/projects/notes/discussions/_outdated.html.haml1
-rw-r--r--app/views/projects/protected_branches/index.html.haml12
-rw-r--r--app/views/projects/repositories/stats.html.haml33
-rw-r--r--app/views/projects/show.html.haml37
-rw-r--r--app/views/projects/tags/destroy.js.haml3
-rw-r--r--app/views/projects/tags/index.html.haml25
-rw-r--r--app/views/projects/tags/new.html.haml13
-rw-r--r--app/views/projects/team_members/_form.html.haml8
-rw-r--r--app/views/projects/team_members/_group_members.html.haml6
-rw-r--r--app/views/projects/team_members/_team_member.html.haml4
-rw-r--r--app/views/projects/team_members/import.html.haml2
-rw-r--r--app/views/projects/team_members/index.html.haml2
-rw-r--r--app/views/projects/tree/_readme.html.haml7
-rw-r--r--app/views/projects/wikis/history.html.haml6
-rw-r--r--app/views/projects/wikis/pages.html.haml2
-rw-r--r--app/views/projects/wikis/show.html.haml2
-rw-r--r--app/views/search/_filter.html.haml10
-rw-r--r--app/views/search/_global_filter.html.haml16
-rw-r--r--app/views/search/_global_results.html.haml5
-rw-r--r--app/views/search/_project_filter.html.haml31
-rw-r--r--app/views/search/_project_results.html.haml24
-rw-r--r--app/views/search/_results.html.haml33
-rw-r--r--app/views/search/_snippet_filter.html.haml13
-rw-r--r--app/views/search/results/_issue.html.haml21
-rw-r--r--app/views/search/results/_merge_request.html.haml30
-rw-r--r--app/views/search/results/_note.html.haml35
-rw-r--r--app/views/search/results/_project.html.haml9
-rw-r--r--app/views/search/results/_snippet_blob.html.haml65
-rw-r--r--app/views/search/results/_snippet_title.html.haml23
-rw-r--r--app/views/search/results/_wiki_blob.html.haml9
-rw-r--r--app/views/search/show.html.haml8
-rw-r--r--app/views/shared/_clone_panel.html.haml5
-rw-r--r--app/views/shared/_file_hljs.html.haml15
-rw-r--r--app/views/shared/_promo.html.haml1
-rw-r--r--app/workers/post_receive.rb27
-rwxr-xr-xbin/background_jobs18
-rwxr-xr-xbin/web12
-rw-r--r--config/application.rb26
-rw-r--r--config/database.yml.mysql3
-rw-r--r--config/environments/production.rb10
-rw-r--r--config/gitlab.yml.example26
-rw-r--r--config/initializers/1_settings.rb1
-rw-r--r--config/initializers/session_store.rb3
-rw-r--r--config/newrelic.yml16
-rw-r--r--config/resque.yml.example2
-rw-r--r--config/routes.rb10
-rw-r--r--config/unicorn.rb.example9
-rw-r--r--config/unicorn.rb.example.development2
-rw-r--r--db/fixtures/development/04_project.rb8
-rw-r--r--db/fixtures/development/05_users.rb16
-rw-r--r--db/fixtures/development/06_teams.rb4
-rw-r--r--db/fixtures/production/001_admin.rb12
-rw-r--r--db/migrate/20140729152420_migrate_taggable_labels.rb6
-rw-r--r--db/migrate/20140903115954_migrate_to_new_shell.rb10
-rw-r--r--db/migrate/20140907220153_serialize_service_properties.rb36
-rw-r--r--db/migrate/20140914113604_add_members_table.rb19
-rw-r--r--db/migrate/20140914145549_migrate_to_new_members_model.rb11
-rw-r--r--db/migrate/20140914173417_remove_old_member_tables.rb26
-rw-r--r--db/schema.rb53
-rw-r--r--doc/README.md1
-rw-r--r--doc/api/README.md50
-rw-r--r--doc/api/branches.md5
-rw-r--r--doc/api/issues.md17
-rw-r--r--doc/api/merge_requests.md2
-rw-r--r--doc/api/projects.md1
-rw-r--r--doc/api/repositories.md4
-rw-r--r--doc/customization/welcome_message.md34
-rw-r--r--doc/development/README.md1
-rw-r--r--doc/development/ci_setup.md41
-rw-r--r--doc/install/database_mysql.md16
-rw-r--r--doc/install/installation.md141
-rw-r--r--doc/install/requirements.md8
-rw-r--r--doc/install/structure.md4
-rw-r--r--doc/integration/external-issue-tracker.md2
-rw-r--r--doc/integration/ldap.md25
-rw-r--r--doc/integration/omniauth.md46
-rw-r--r--doc/integration/shibboleth.md78
-rw-r--r--doc/permissions/permissions.md6
-rw-r--r--doc/raketasks/backup_restore.md19
-rw-r--r--doc/raketasks/maintenance.md6
-rw-r--r--doc/raketasks/user_management.md8
-rw-r--r--doc/release/monthly.md109
-rw-r--r--doc/security/README.md1
-rw-r--r--doc/security/information_exclusivity.md9
-rw-r--r--doc/system_hooks/system_hooks.md26
-rw-r--r--doc/update/4.2-to-5.0.md45
-rw-r--r--doc/update/5.1-to-6.0.md96
-rw-r--r--doc/update/6.0-to-6.1.md1
-rw-r--r--doc/update/6.0-to-7.3.md (renamed from doc/update/6.0-to-7.2.md)67
-rw-r--r--doc/update/6.1-to-6.2.md1
-rw-r--r--doc/update/6.2-to-6.3.md1
-rw-r--r--doc/update/6.7-to-6.8.md1
-rw-r--r--doc/update/6.9-to-7.0.md4
-rw-r--r--doc/update/7.0-to-7.1.md1
-rw-r--r--doc/update/7.1-to-7.2.md18
-rw-r--r--doc/update/7.2-to-7.3.md143
-rw-r--r--doc/update/mysql_to_postgresql.md3
-rw-r--r--doc/update/upgrader.md6
-rw-r--r--doc/web_hooks/web_hooks.md6
-rw-r--r--features/dashboard/search.feature10
-rw-r--r--features/dashboard/shortcuts.feature21
-rw-r--r--features/project/commits/branches.feature26
-rw-r--r--features/project/commits/commits.feature7
-rw-r--r--features/project/commits/tags.feature30
-rw-r--r--features/project/graph.feature7
-rw-r--r--features/project/issues/issues.feature37
-rw-r--r--features/project/issues/labels.feature10
-rw-r--r--features/project/merge_requests.feature10
-rw-r--r--features/project/shortcuts.feature52
-rw-r--r--features/project/source/browse_files.feature14
-rw-r--r--features/search.feature46
-rw-r--r--features/snippet_search.feature20
-rw-r--r--features/steps/admin/active_tab.rb18
-rw-r--r--features/steps/admin/groups.rb14
-rw-r--r--features/steps/admin/logs.rb4
-rw-r--r--features/steps/admin/projects.rb8
-rw-r--r--features/steps/admin/users.rb14
-rw-r--r--features/steps/dashboard/active_tab.rb16
-rw-r--r--features/steps/dashboard/dashboard.rb32
-rw-r--r--features/steps/dashboard/event_filters.rb22
-rw-r--r--features/steps/dashboard/issues.rb2
-rw-r--r--features/steps/dashboard/merge_requests.rb2
-rw-r--r--features/steps/dashboard/projects.rb4
-rw-r--r--features/steps/dashboard/search.rb19
-rw-r--r--features/steps/dashboard/shortcuts.rb6
-rw-r--r--features/steps/dashboard/with_archived_projects.rb8
-rw-r--r--features/steps/explore/groups_feature.rb2
-rw-r--r--features/steps/explore/projects.rb8
-rw-r--r--features/steps/group/group.rb36
-rw-r--r--features/steps/profile/active_tab.rb12
-rw-r--r--features/steps/profile/emails.rb18
-rw-r--r--features/steps/profile/group.rb2
-rw-r--r--features/steps/profile/notifications.rb2
-rw-r--r--features/steps/profile/profile.rb2
-rw-r--r--features/steps/profile/ssh_keys.rb20
-rw-r--r--features/steps/project/active_tab.rb85
-rw-r--r--features/steps/project/archived.rb6
-rw-r--r--features/steps/project/browse_branches.rb45
-rw-r--r--features/steps/project/browse_commits.rb44
-rw-r--r--features/steps/project/browse_commits_user_lookup.rb6
-rw-r--r--features/steps/project/browse_files.rb29
-rw-r--r--features/steps/project/browse_git_repo.rb8
-rw-r--r--features/steps/project/browse_tags.rb76
-rw-r--r--features/steps/project/comments_on_commit_diffs.rb2
-rw-r--r--features/steps/project/comments_on_commits.rb2
-rw-r--r--features/steps/project/create.rb18
-rw-r--r--features/steps/project/filter_labels.rb2
-rw-r--r--features/steps/project/fork.rb2
-rw-r--r--features/steps/project/forked_merge_requests.rb2
-rw-r--r--features/steps/project/graph.rb14
-rw-r--r--features/steps/project/hooks.rb6
-rw-r--r--features/steps/project/issue_tracker.rb4
-rw-r--r--features/steps/project/issues.rb139
-rw-r--r--features/steps/project/labels.rb36
-rw-r--r--features/steps/project/markdown_render.rb107
-rw-r--r--features/steps/project/merge_requests.rb17
-rw-r--r--features/steps/project/milestones.rb18
-rw-r--r--features/steps/project/multiselect_blob.rb8
-rw-r--r--features/steps/project/network_graph.rb26
-rw-r--r--features/steps/project/project.rb2
-rw-r--r--features/steps/project/project_shortcuts.rb36
-rw-r--r--features/steps/project/redirects.rb14
-rw-r--r--features/steps/project/search_code.rb5
-rw-r--r--features/steps/project/services.rb2
-rw-r--r--features/steps/project/snippets.rb34
-rw-r--r--features/steps/project/star.rb2
-rw-r--r--features/steps/project/team_management.rb40
-rw-r--r--features/steps/project/wiki.rb60
-rw-r--r--features/steps/search.rb73
-rw-r--r--features/steps/shared/active_tab.rb32
-rw-r--r--features/steps/shared/admin.rb4
-rw-r--r--features/steps/shared/authentication.rb4
-rw-r--r--features/steps/shared/diff_note.rb54
-rw-r--r--features/steps/shared/markdown.rb4
-rw-r--r--features/steps/shared/note.rb34
-rw-r--r--features/steps/shared/paths.rb16
-rw-r--r--features/steps/shared/project.rb14
-rw-r--r--features/steps/shared/project_tab.rb46
-rw-r--r--features/steps/shared/search.rb11
-rw-r--r--features/steps/shared/shortcuts.rb18
-rw-r--r--features/steps/shared/snippet.rb27
-rw-r--r--features/steps/snippet_search.rb56
-rw-r--r--features/steps/snippets/discover.rb6
-rw-r--r--features/steps/snippets/snippets.rb24
-rw-r--r--features/steps/snippets/user.rb16
-rw-r--r--features/steps/user.rb2
-rw-r--r--features/support/env.rb10
-rw-r--r--lib/api/branches.rb23
-rw-r--r--lib/api/deploy_keys.rb2
-rw-r--r--lib/api/entities.rb16
-rw-r--r--lib/api/groups.rb8
-rw-r--r--lib/api/helpers.rb12
-rw-r--r--lib/api/internal.rb9
-rw-r--r--lib/api/issues.rb54
-rw-r--r--lib/api/labels.rb31
-rw-r--r--lib/api/merge_requests.rb23
-rw-r--r--lib/api/project_members.rb14
-rw-r--r--lib/api/project_snippets.rb5
-rw-r--r--lib/api/projects.rb4
-rw-r--r--lib/api/repositories.rb16
-rw-r--r--lib/api/users.rb58
-rw-r--r--lib/backup/repository.rb2
-rw-r--r--lib/gitlab/access.rb4
-rw-r--r--lib/gitlab/backend/shell.rb9
-rw-r--r--lib/gitlab/blacklist.rb2
-rw-r--r--lib/gitlab/diff/file.rb49
-rw-r--r--lib/gitlab/diff/line.rb12
-rw-r--r--lib/gitlab/diff/line_code.rb9
-rw-r--r--lib/gitlab/diff/parser.rb81
-rw-r--r--lib/gitlab/diff_parser.rb83
-rw-r--r--lib/gitlab/git_access.rb61
-rw-r--r--lib/gitlab/git_ref_validator.rb11
-rw-r--r--lib/gitlab/graphs/commits.rb49
-rw-r--r--lib/gitlab/ldap/access.rb2
-rw-r--r--lib/gitlab/ldap/adapter.rb3
-rw-r--r--lib/gitlab/ldap/person.rb2
-rw-r--r--lib/gitlab/ldap/user.rb91
-rw-r--r--lib/gitlab/markdown.rb16
-rw-r--r--lib/gitlab/oauth/auth_hash.rb54
-rw-r--r--lib/gitlab/oauth/user.rb134
-rw-r--r--lib/gitlab/project_search_results.rb77
-rw-r--r--lib/gitlab/satellite/merge_action.rb22
-rw-r--r--lib/gitlab/search_results.rb69
-rw-r--r--lib/gitlab/snippet_search_results.rb131
-rw-r--r--lib/gitlab/upgrader.rb2
-rw-r--r--lib/gitlab/visibility_level.rb16
-rw-r--r--lib/support/nginx/gitlab2
-rw-r--r--lib/support/nginx/gitlab-ssl36
-rw-r--r--lib/tasks/gitlab/bulk_add_permission.rake12
-rw-r--r--lib/tasks/gitlab/check.rake97
-rw-r--r--lib/tasks/gitlab/shell.rake20
-rw-r--r--lib/tasks/gitlab/sidekiq.rake47
-rw-r--r--spec/factories.rb5
-rw-r--r--spec/factories/group_members.rb (renamed from spec/factories/users_groups.rb)6
-rw-r--r--spec/features/admin/admin_hooks_spec.rb4
-rw-r--r--spec/features/atom/dashboard_issues_spec.rb12
-rw-r--r--spec/features/atom/dashboard_spec.rb31
-rw-r--r--spec/features/atom/issues_spec.rb16
-rw-r--r--spec/features/issues_spec.rb12
-rw-r--r--spec/features/notes_on_merge_requests_spec.rb15
-rw-r--r--spec/features/security/project/internal_access_spec.rb2
-rw-r--r--spec/features/security/project/private_access_spec.rb2
-rw-r--r--spec/features/security/project/public_access_spec.rb2
-rw-r--r--spec/helpers/diff_helper_spec.rb99
-rw-r--r--spec/helpers/gitlab_markdown_helper_spec.rb2
-rw-r--r--spec/lib/auth_spec.rb28
-rw-r--r--spec/lib/git_ref_validator_spec.rb20
-rw-r--r--spec/lib/gitlab/auth_spec.rb47
-rw-r--r--spec/lib/gitlab/diff/file_spec.rb21
-rw-r--r--spec/lib/gitlab/diff/parser_spec.rb93
-rw-r--r--spec/lib/gitlab/git_access_spec.rb127
-rw-r--r--spec/lib/gitlab/ldap/access_spec.rb (renamed from spec/lib/gitlab/ldap/ldap_access_spec.rb)8
-rw-r--r--spec/lib/gitlab/ldap/adapter_spec.rb (renamed from spec/lib/gitlab/ldap/ldap_adapter_spec.rb)0
-rw-r--r--spec/lib/gitlab/ldap/ldap_user_auth_spec.rb58
-rw-r--r--spec/lib/gitlab/ldap/user_spec.rb54
-rw-r--r--spec/lib/gitlab/oauth/user_spec.rb83
-rw-r--r--spec/lib/gitlab/satellite/action_spec.rb2
-rw-r--r--spec/lib/oauth_spec.rb45
-rw-r--r--spec/mailers/notify_spec.rb8
-rw-r--r--spec/models/assembla_service_spec.rb7
-rw-r--r--spec/models/flowdock_service_spec.rb7
-rw-r--r--spec/models/gemnasium_service_spec.rb7
-rw-r--r--spec/models/gitlab_ci_service_spec.rb7
-rw-r--r--spec/models/group_member_spec.rb (renamed from spec/models/users_group_spec.rb)37
-rw-r--r--spec/models/group_spec.rb18
-rw-r--r--spec/models/members_spec.rb20
-rw-r--r--spec/models/note_spec.rb14
-rw-r--r--spec/models/project_member_spec.rb (renamed from spec/models/users_project_spec.rb)33
-rw-r--r--spec/models/project_security_spec.rb16
-rw-r--r--spec/models/project_spec.rb58
-rw-r--r--spec/models/service_spec.rb7
-rw-r--r--spec/models/slack_service_spec.rb7
-rw-r--r--spec/models/system_hook_spec.rb2
-rw-r--r--spec/models/user_spec.rb4
-rw-r--r--spec/models/wiki_page_spec.rb2
-rw-r--r--spec/requests/api/branches_spec.rb51
-rw-r--r--spec/requests/api/commits_spec.rb4
-rw-r--r--spec/requests/api/groups_spec.rb36
-rw-r--r--spec/requests/api/internal_spec.rb9
-rw-r--r--spec/requests/api/issues_spec.rb109
-rw-r--r--spec/requests/api/labels_spec.rb17
-rw-r--r--spec/requests/api/merge_requests_spec.rb113
-rw-r--r--spec/requests/api/project_members_spec.rb46
-rw-r--r--spec/requests/api/projects_spec.rb54
-rw-r--r--spec/requests/api/repositories_spec.rb67
-rw-r--r--spec/requests/api/users_spec.rb158
-rw-r--r--spec/services/git_push_service_spec.rb26
-rw-r--r--spec/services/notification_service_spec.rb6
-rw-r--r--spec/services/projects/update_service_spec.rb2
-rw-r--r--spec/services/search_service_spec.rb8
-rw-r--r--spec/services/system_hooks_service_spec.rb15
-rw-r--r--spec/spec_helper.rb14
-rw-r--r--spec/support/login_helpers.rb2
-rw-r--r--spec/support/matchers.rb6
-rw-r--r--spec/support/select2_helper.rb4
-rw-r--r--spec/support/test_env.rb10
-rw-r--r--spec/workers/post_receive_spec.rb11
-rwxr-xr-xvendor/assets/javascripts/chart-lib.min.js11
-rw-r--r--vendor/assets/javascripts/highlight.pack.js2
544 files changed, 7760 insertions, 3729 deletions
diff --git a/.gitignore b/.gitignore
index 92ca729dc11..4f778371512 100644
--- a/.gitignore
+++ b/.gitignore
@@ -38,3 +38,4 @@ public/uploads.*
public/assets/
.envrc
dump.rdb
+tags
diff --git a/.pkgr.yml b/.pkgr.yml
index 97d78b6ef69..cf96e7916d8 100644
--- a/.pkgr.yml
+++ b/.pkgr.yml
@@ -5,6 +5,8 @@ targets:
debian-7: &wheezy
build_dependencies:
- libicu-dev
+ - cmake
+ - pkg-config
dependencies:
- libicu48
- libpcre3
@@ -13,6 +15,8 @@ targets:
ubuntu-14.04:
build_dependencies:
- libicu-dev
+ - cmake
+ - pkg-config
dependencies:
- libicu52
- libpcre3
@@ -20,6 +24,8 @@ targets:
centos-6:
build_dependencies:
- libicu-devel
+ - cmake
+ - pkgconfig
dependencies:
- libicu
- pcre
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 9b7b2cb3c09..00000000000
--- a/.travis.yml
+++ /dev/null
@@ -1,36 +0,0 @@
-language: ruby
-env:
- global:
- - TRAVIS=true
- matrix:
- - TASK=spinach_project DB=mysql
- - TASK=spinach_other DB=mysql
- - TASK=spec:api DB=mysql
- - TASK=spec:feature DB=mysql
- - TASK=spec:other DB=mysql
- - TASK=jasmine:ci DB=mysql
- - TASK=spinach_project DB=postgresql
- - TASK=spinach_other DB=postgresql
- - TASK=spec:api DB=postgresql
- - TASK=spec:feature DB=postgresql
- - TASK=spec:other DB=postgresql
- - TASK=jasmine:ci DB=postgresql
-before_install:
- - sudo apt-get install libicu-dev -y
-install:
- - "travis_retry bundle install --deployment --without production --retry 5"
-branches:
- only:
- - 'master'
-rvm:
- - 2.0.0
-services:
- - redis-server
-before_script:
- - "cp config/database.yml.$DB config/database.yml"
- - "cp config/gitlab.yml.example config/gitlab.yml"
- - "bundle exec rake db:setup"
- - "bundle exec rake db:seed_fu"
-script: "bundle exec rake $TASK --trace"
-notifications:
- email: false
diff --git a/CHANGELOG b/CHANGELOG
index b35e02268ec..3006ff4049d 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,5 +1,56 @@
+v 7.4.0
+ - Refactored membership logic
+ - Fix creating new files with web editor
+ - Improve error reporting on users API (Julien Bianchi)
+ - Refactor test coverage tools usage. Use SIMPLECOV=true to generate it locally
+ - Increase unicorn timeout to 60 seconds
+ - Sort search autocomplete projects by stars count so most popular go first
+
+v 7.3.1
+ - Fix ref parsing in Gitlab::GitAccess
+ - Fix error 500 when viewing diff on a file with changed permissions
+ - Fix adding comments to MR when source branch is master
+ - Fix error 500 when searching description contains relative link
+
v 7.3.0
- Always set the 'origin' remote in satellite actions
+ - Write authorized_keys in tmp/ during tests
+ - Use sockets to connect to Redis
+ - Add dormant New Relic gem (can be enabled via environment variables)
+ - Expire Rack sessions after 1 week
+ - Cleaner signin/signup pages
+ - Improved comments UI
+ - Better search with filtering, pagination etc
+ - Added a checkbox to toggle line wrapping in diff (Yuriy Glukhov)
+ - Prevent project stars duplication when fork project
+ - Use the default Unicorn socket backlog value of 1024
+ - Support Unix domain sockets for Redis
+ - Store session Redis keys in 'session:gitlab:' namespace
+ - Deprecate LDAP account takeover based on partial LDAP email / GitLab username match
+ - Use /bin/sh instead of Bash in bin/web, bin/background_jobs (Pavel Novitskiy)
+ - Keyboard shortcuts for productivity (Robert Schilling)
+ - API: filter issues by state (Julien Bianchi)
+ - API: filter issues by labels (Julien Bianchi)
+ - Add system hook for ssh key changes
+ - Add blob permalink link (Ciro Santilli)
+ - Create annotated tags through UI and API (Sean Edge)
+ - Snippets search (Charles Bushong)
+ - Comment new push to existing MR
+ - Add 'ci' to the blacklist of forbidden names
+ - Improve text filtering on issues page
+ - Comment & Close button
+ - Process git push --all much faster
+ - Don't allow edit of system notes
+ - Project wiki search (Ralf Seidler)
+ - Enabled Shibboleth authentication support (Matus Banas)
+ - Zen mode (fullscreen) for issues/MR/notes (Robert Schilling)
+ - Add ability to configure webhook timeout via gitlab.yml (Wes Gurney)
+ - Sort project merge requests in asc or desc order for updated_at or created_at field (sponsored by O'Reilly Media)
+ - Add Redis socket support to 'rake gitlab:shell:install'
+
+v 7.2.1
+ - Delete orphaned labels during label migration (James Brooks)
+ - Security: prevent XSS with stricter MIME types for raw repo files
v 7.2.0
- Explore page
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index beb5a3903d6..3d1e8270f46 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -44,7 +44,7 @@ Please send a merge request with a tested solution or a merge request with a fai
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 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)
+ * Add the last commit SHA-1 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`)
1. **Possible fixes**: If you can, link to the line of code that might be responsible for the problem
@@ -62,6 +62,7 @@ If you can, please submit a merge request with the fix or improvements including
1. Create a feature branch
1. Write [tests](README.md#run-the-tests) and code
1. Add your changes to the [CHANGELOG](CHANGELOG) insert your line at a [random point](doc/workflow/gitlab_flow.md#do-not-order-commits-with-rebase) in the current version
+1. If you are changing the README, some documentation or other things which have no effect on the tests, add `[ci skip]` somewhere in the commit message
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
@@ -75,7 +76,7 @@ If you can, please submit a merge request with the fix or improvements including
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? 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.
+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 minimal 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.
@@ -85,19 +86,19 @@ For examples of feedback on merge requests please look at already [closed merge
1. Are there points in the code the reviewer needs to double check?
1. Why was this MR needed?
1. What are the relevant issue numbers / [Feature requests](http://feedback.gitlab.com/)?
-1. Screenshots (If appropiate)
+1. Screenshots (If appropriate)
## Contribution acceptance criteria
1. The change is as small as possible (see the above paragraph for details)
1. Include proper tests and make all tests pass (unless it contains a test exposing a bug in existing code)
-1. Can merge without problems (if not please use: `git rebase master`)
+1. Initially contains a single commit (please use `git rebase -i` to squash commits)
+1. Can merge without problems (if not please merge `master`, never rebase commits pushed to the remote server)
1. Does not break any existing functionality
1. Fixes one specific issue or implements one specific feature (do not combine things, send separate merge requests if needed)
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. 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
@@ -114,4 +115,4 @@ For examples of feedback on merge requests please look at already [closed merge
1. [Shell commands](doc/development/shell_commands.md) created by GitLab contributors to enhance security
1. [Markdown](http://www.cirosantilli.com/markdown-styleguide)
-This is also the style used by linting tools such as [Rubocop](https://github.com/bbatsov/rubocop), [PullReview](https://www.pullreview.com/) and [Hound CI](https://houndci.com).
+This is also the style used by linting tools such as [RuboCop](https://github.com/bbatsov/rubocop), [PullReview](https://www.pullreview.com/) and [Hound CI](https://houndci.com).
diff --git a/GITLAB_SHELL_VERSION b/GITLAB_SHELL_VERSION
index fee0a2788b2..227cea21564 100644
--- a/GITLAB_SHELL_VERSION
+++ b/GITLAB_SHELL_VERSION
@@ -1 +1 @@
-1.9.7
+2.0.0
diff --git a/Gemfile b/Gemfile
index e28ffcfc2d7..9686bf9610f 100644
--- a/Gemfile
+++ b/Gemfile
@@ -27,16 +27,17 @@ gem 'omniauth', "~> 1.1.3"
gem 'omniauth-google-oauth2'
gem 'omniauth-twitter'
gem 'omniauth-github'
+gem 'omniauth-shibboleth'
# Extracting information from a git repository
# Provide access to Gitlab::Git library
-gem "gitlab_git", '~> 6.0'
+gem "gitlab_git", '7.0.0.rc3'
# Ruby/Rack Git Smart-HTTP Server Handler
gem 'gitlab-grack', '~> 2.0.0.pre', require: 'grack'
# LDAP Auth
-gem 'gitlab_omniauth-ldap', '1.0.4', require: "omniauth-ldap"
+gem 'gitlab_omniauth-ldap', '1.1.0', require: "omniauth-ldap"
# Git Wiki
gem 'gollum-lib', '~> 3.0.0'
@@ -82,7 +83,7 @@ gem "seed-fu"
gem "github-markup"
# Required markup gems by github-markdown
-gem 'redcarpet', '~> 2.2.2'
+gem 'redcarpet', '~> 3.1.2'
gem 'RedCloth'
gem 'rdoc', '~>3.6'
gem 'org-ruby'
@@ -156,6 +157,9 @@ gem "rack-attack"
# Ace editor
gem 'ace-rails-ap'
+# Keyboard shortcuts
+gem 'mousetrap-rails'
+
# Semantic UI Sass for Sidebar
gem 'semantic-ui-sass', '~> 0.16.1.0'
@@ -231,7 +235,7 @@ group :development, :test do
gem 'jasmine', '2.0.2'
- gem "spring", '1.1.1'
+ gem "spring", '1.1.3'
gem "spring-commands-rspec", '1.0.1'
gem "spring-commands-spinach", '1.0.0'
end
@@ -247,3 +251,5 @@ end
group :production do
gem "gitlab_meta", '7.0'
end
+
+gem "newrelic_rpm"
diff --git a/Gemfile.lock b/Gemfile.lock
index 205599e898c..d59543e9ab7 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -106,7 +106,7 @@ GEM
devise (~> 3.2)
diff-lcs (1.2.5)
diffy (3.0.3)
- docile (1.1.1)
+ docile (1.1.5)
dotenv (0.9.0)
dropzonejs-rails (0.4.14)
rails (> 3.1)
@@ -168,7 +168,7 @@ GEM
multi_json
gitlab-grack (2.0.0.pre)
rack (~> 1.5.1)
- gitlab-grit (2.6.10)
+ gitlab-grit (2.6.11)
charlock_holmes (~> 0.6)
diff-lcs (~> 1.1)
mime-types (~> 1.15)
@@ -179,15 +179,15 @@ GEM
mime-types (~> 1.19)
gitlab_emoji (0.0.1.1)
emoji (~> 1.0.1)
- gitlab_git (6.2.1)
+ gitlab_git (7.0.0.rc3)
activesupport (~> 4.0)
charlock_holmes (~> 0.6)
- gitlab-grit (~> 2.6)
gitlab-linguist (~> 3.0)
+ rubyzip (~> 1.1)
rugged (~> 0.21.0)
gitlab_meta (7.0)
- gitlab_omniauth-ldap (1.0.4)
- net-ldap (~> 0.3.1)
+ gitlab_omniauth-ldap (1.1.0)
+ net-ldap (~> 0.7.0)
omniauth (~> 1.0)
pyu-ruby-sasl (~> 0.0.3.1)
rubyntlm (~> 0.1.1)
@@ -287,14 +287,16 @@ GEM
mime-types (1.25.1)
mini_portile (0.6.0)
minitest (5.3.5)
+ mousetrap-rails (1.4.6)
multi_json (1.10.1)
multi_xml (0.5.5)
multipart-post (1.2.0)
mysql2 (0.3.16)
- net-ldap (0.3.1)
+ net-ldap (0.7.0)
net-scp (1.1.2)
net-ssh (>= 2.6.5)
net-ssh (2.8.0)
+ newrelic_rpm (3.9.4.245)
nokogiri (1.6.2.1)
mini_portile (= 0.6.0)
nprogress-rails (0.1.2.3)
@@ -320,6 +322,8 @@ GEM
omniauth-oauth2 (1.1.1)
oauth2 (~> 0.8.0)
omniauth (~> 1.0)
+ omniauth-shibboleth (1.1.1)
+ omniauth (>= 1.0.0)
omniauth-twitter (1.0.1)
multi_json (~> 1.3)
omniauth-oauth (~> 1.0)
@@ -391,7 +395,7 @@ GEM
ffi (>= 0.5.0)
rdoc (3.12.2)
json (~> 1.4)
- redcarpet (2.2.2)
+ redcarpet (3.1.2)
redis (3.0.6)
redis-actionpack (4.0.0)
actionpack (~> 4)
@@ -436,6 +440,7 @@ GEM
ruby-progressbar (1.2.0)
rubyntlm (0.1.1)
rubypants (0.2.0)
+ rubyzip (1.1.6)
rugged (0.21.0)
safe_yaml (0.9.7)
sanitize (2.1.0)
@@ -467,7 +472,7 @@ GEM
redis (>= 3.0.4)
redis-namespace (>= 1.3.1)
simple_oauth (0.1.9)
- simplecov (0.8.2)
+ simplecov (0.9.0)
docile (~> 1.1.0)
multi_json
simplecov-html (~> 0.8.0)
@@ -489,7 +494,7 @@ GEM
capybara (>= 2.0.0)
railties (>= 3)
spinach (>= 0.4)
- spring (1.1.1)
+ spring (1.1.3)
spring-commands-rspec (1.0.1)
spring (>= 0.9.1)
spring-commands-spinach (1.0.0)
@@ -613,9 +618,9 @@ DEPENDENCIES
gitlab-grack (~> 2.0.0.pre)
gitlab-linguist (~> 3.0.0)
gitlab_emoji (~> 0.0.1.1)
- gitlab_git (~> 6.0)
+ gitlab_git (= 7.0.0.rc3)
gitlab_meta (= 7.0)
- gitlab_omniauth-ldap (= 1.0.4)
+ gitlab_omniauth-ldap (= 1.1.0)
gollum-lib (~> 3.0.0)
gon (~> 5.0.0)
grape (~> 0.6.1)
@@ -636,11 +641,14 @@ DEPENDENCIES
launchy
letter_opener
minitest (~> 5.3.0)
+ mousetrap-rails
mysql2
+ newrelic_rpm
nprogress-rails
omniauth (~> 1.1.3)
omniauth-github
omniauth-google-oauth2
+ omniauth-shibboleth
omniauth-twitter
org-ruby
pg
@@ -657,7 +665,7 @@ DEPENDENCIES
rb-fsevent
rb-inotify
rdoc (~> 3.6)
- redcarpet (~> 2.2.2)
+ redcarpet (~> 3.1.2)
redis-rails
request_store
rspec-rails
@@ -676,7 +684,7 @@ DEPENDENCIES
slack-notifier (~> 0.3.2)
slim
spinach-rails
- spring (= 1.1.1)
+ spring (= 1.1.3)
spring-commands-rspec (= 1.0.1)
spring-commands-spinach (= 1.0.0)
stamp
diff --git a/Guardfile b/Guardfile
index e19a312377d..68ac3232b09 100644
--- a/Guardfile
+++ b/Guardfile
@@ -1,7 +1,7 @@
# A sample Guardfile
# More info at https://github.com/guard/guard#readme
-guard 'rspec', cmd: "spring rspec", version: 2, all_on_start: false, all_after_pass: false do
+guard 'rspec', cmd: "spring rspec", all_on_start: false, all_after_pass: false do
watch(%r{^spec/.+_spec\.rb$})
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
watch(%r{^lib/api/(.+)\.rb$}) { |m| "spec/requests/api/#{m[1]}_spec.rb" }
@@ -19,7 +19,7 @@ guard 'rspec', cmd: "spring rspec", version: 2, all_on_start: false, all_after_p
watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| "spec/requests/#{m[1]}_spec.rb" }
end
-guard 'spinach' do
+guard 'spinach', command_prefix: 'spring' do
watch(%r|^features/(.*)\.feature|)
watch(%r|^features/steps/(.*)([^/]+)\.rb|) do |m|
"features/#{m[1]}#{m[2]}.feature"
diff --git a/PROCESS.md b/PROCESS.md
index c986013e2f2..c3a787662f7 100644
--- a/PROCESS.md
+++ b/PROCESS.md
@@ -87,7 +87,7 @@ Please use ``` to format console output, logs, and code as it's very hard to rea
### Issue fixed in newer version
-Thanks for the issue report. This issue has already been fixed in newer versions of GitLab. Due to the size of this project and our limited resources we are only able to support the latest stable release as outlined in our \[contributing guidelines\]\(https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#issue-tracker). In order to get this bug fix and enjoy many new features please \[upgrade\]\(https://github.com/gitlabhq/gitlabhq/tree/master/doc/update). If you still experience issues at that time please open a new issue following our issue tracker guidelines found in the \[contributing guidelines\]\(https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#issue-tracker-guidelines).
+Thanks for the issue report. This issue has already been fixed in newer versions of GitLab. Due to the size of this project and our limited resources we are only able to support the latest stable release as outlined in our \[contributing guidelines\]\(https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#issue-tracker). In order to get this bug fix and enjoy many new features please \[upgrade\]\(https://gitlab.com/gitlab-org/gitlab-ce/tree/master/doc/update). If you still experience issues at that time please open a new issue following our issue tracker guidelines found in the \[contributing guidelines\]\(https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#issue-tracker-guidelines).
### Improperly formatted merge request
diff --git a/README.md b/README.md
index f5f7a8aad49..fbcde347be6 100644
--- a/README.md
+++ b/README.md
@@ -1,10 +1,8 @@
-# GitLab
+# ![logo](https://about.gitlab.com/images/gitlab_logo.png) GitLab
## Open source software to collaborate on code
-![logo](https://gitlab.com/gitlab-org/gitlab-ce/raw/master/public/gitlab_logo.png)
-
-![animated-screenshots](https://gist.github.com/fnkr/2f9badd56bfe0ed04ee7/raw/4f48806fbae97f556c2f78d8c2d299c04500cb0d/compiled.gif)
+![Animated screenshots](https://about.gitlab.com/images/animated/compiled.gif)
- Manage Git repositories with fine grained access controls that keep your code secure
- Perform code reviews and enhance collaboration with merge requests
@@ -21,7 +19,9 @@
- [![build status](https://ci.gitlab.org/projects/1/status.png?ref=master)](https://ci.gitlab.org/projects/1?ref=master) on ci.gitlab.org (master branch)
-- [![Code Climate](https://codeclimate.com/github/gitlabhq/gitlabhq.png)](https://codeclimate.com/github/gitlabhq/gitlabhq)
+- [![Build Status](https://semaphoreapp.com/api/v1/projects/2f1a5809-418b-4cc2-a1f4-819607579fe7/243338/badge.png)](https://semaphoreapp.com/gitlabhq/gitlabhq)
+
+- [![Code Climate](https://codeclimate.com/github/gitlabhq/gitlabhq.svg)](https://codeclimate.com/github/gitlabhq/gitlabhq)
- [![Coverage Status](https://coveralls.io/repos/gitlabhq/gitlabhq/badge.png?branch=master)](https://coveralls.io/r/gitlabhq/gitlabhq)
@@ -29,14 +29,14 @@
## Website
-On [www.gitlab.com](https://www.gitlab.com/) you can find more information about:
+On [about.gitlab.com](https://about.gitlab.com/) you can find more information about:
-- [Subscriptions](https://www.gitlab.com/subscription/)
-- [Consultancy](https://www.gitlab.com/consultancy/)
-- [Community](https://www.gitlab.com/community/)
-- [Hosted GitLab.com](https://www.gitlab.com/gitlab-com/) use GitLab as a free service
-- [GitLab Enterprise Edition](https://www.gitlab.com/gitlab-ee/) with additional features aimed at larger organizations.
-- [GitLab CI](https://www.gitlab.com/gitlab-ci/) a continuous integration (CI) server that is easy to integrate with GitLab.
+- [Subscriptions](https://about.gitlab.com/subscription/)
+- [Consultancy](https://about.gitlab.com/consultancy/)
+- [Community](https://about.gitlab.com/community/)
+- [Hosted GitLab.com](https://about.gitlab.com/gitlab-com/) use GitLab as a free service
+- [GitLab Enterprise Edition](https://about.gitlab.com/gitlab-ee/) with additional features aimed at larger organizations.
+- [GitLab CI](https://about.gitlab.com/gitlab-ci/) a continuous integration (CI) server that is easy to integrate with GitLab.
## Third-party applications
@@ -61,11 +61,11 @@ These applications are maintained by contributors, GitLab B.V. does not offer su
## Installation
-Please see [the installation page on the GitLab website](https://www.gitlab.com/installation/).
+Please see [the installation page on the GitLab website](https://about.gitlab.com/installation/).
### New versions
-Since 2011 a minor or major version of GitLab is released on the 22nd of every month. Patch and security releases come out when needed. New features are detailed on the [blog](https://www.gitlab.com/blog/) and in the [changelog](CHANGELOG). For more information about the release process see the release [documentation](https://gitlab.com/gitlab-org/gitlab-ce/tree/master/doc/release). Features that will likely be in the next releases can be found on the [feature request forum](http://feedback.gitlab.com/forums/176466-general) with the status [started](http://feedback.gitlab.com/forums/176466-general/status/796456) and [completed](http://feedback.gitlab.com/forums/176466-general/status/796457).
+Since 2011 a minor or major version of GitLab is released on the 22nd of every month. Patch and security releases come out when needed. New features are detailed on the [blog](https://about.gitlab.com/blog/) and in the [changelog](CHANGELOG). For more information about the release process see the release [documentation](https://gitlab.com/gitlab-org/gitlab-ce/tree/master/doc/release). Features that will likely be in the next releases can be found on the [feature request forum](http://feedback.gitlab.com/forums/176466-general) with the status [started](http://feedback.gitlab.com/forums/176466-general/status/796456) and [completed](http://feedback.gitlab.com/forums/176466-general/status/796457).
### Upgrading
@@ -85,7 +85,8 @@ Please login with `root` / `5iveL!fe`
## Install a development environment
-We recommend setting up your development environment with [the cookbook](https://gitlab.com/gitlab-org/cookbook-gitlab/blob/master/README.md#installation). If you do not use the cookbook you might need to copy the example development unicorn configuration file
+We recommend setting up your development environment with [the GitLab Development Kit](https://gitlab.com/gitlab-org/gitlab-development-kit).
+If you do not use the development kit you might need to copy the example development unicorn configuration file
cp config/unicorn.rb.example.development config/unicorn.rb
@@ -126,7 +127,7 @@ 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.
+Please see [Getting help for GitLab](https://about.gitlab.com/getting-help/) on our website for the many options to get help.
## Is it any good?
diff --git a/VERSION b/VERSION
index ab8884ed9bc..8b258729874 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-7.3.0.pre
+7.4.0-pre
diff --git a/app/assets/javascripts/admin.js.coffee b/app/assets/javascripts/admin.js.coffee
index 6634bb6cc34..a333eed87f2 100644
--- a/app/assets/javascripts/admin.js.coffee
+++ b/app/assets/javascripts/admin.js.coffee
@@ -46,10 +46,10 @@ class Admin
modal.hide()
$('.change-owner-link').show()
- $('li.users_project').bind 'ajax:success', ->
+ $('li.project_member').bind 'ajax:success', ->
Turbolinks.visit(location.href)
- $('li.users_group').bind 'ajax:success', ->
+ $('li.group_member').bind 'ajax:success', ->
Turbolinks.visit(location.href)
@Admin = Admin
diff --git a/app/assets/javascripts/application.js.coffee b/app/assets/javascripts/application.js.coffee
index 1960479321c..8d377057d16 100644
--- a/app/assets/javascripts/application.js.coffee
+++ b/app/assets/javascripts/application.js.coffee
@@ -15,22 +15,31 @@
#= require jquery.atwho
#= require jquery.scrollTo
#= require jquery.blockUI
-#= require turbolinks
#= require jquery.turbolinks
+#= require turbolinks
#= require bootstrap
#= require select2
#= require raphael
#= require g.raphael-min
#= require g.bar-min
+#= require chart-lib.min
#= require branch-graph
#= require highlight.pack
#= require ace/ace
+#= require ace/ext-searchbox
#= require d3
#= require underscore
#= require nprogress
#= require nprogress-turbolinks
#= require dropzone
#= require semantic-ui/sidebar
+#= require mousetrap
+#= require mousetrap/pause
+#= require shortcuts
+#= require shortcuts_navigation
+#= require shortcuts_dashboard_navigation
+#= require shortcuts_issueable
+#= require shortcuts_network
#= require_tree .
window.slugify = (text) ->
@@ -117,6 +126,13 @@ $ ->
# Initialize select2 selects
$('select.select2').select2(width: 'resolve', dropdownAutoWidth: true)
+ # Close select2 on escape
+ $('.js-select2').bind 'select2-close', ->
+ setTimeout ( ->
+ $('.select2-container-active').removeClass('select2-container-active')
+ $(':focus').blur()
+ ), 1
+
# Initialize tooltips
$('.has_tooltip').tooltip()
@@ -134,7 +150,6 @@ $ ->
if (flash = $(".flash-container")).length > 0
flash.click -> $(@).fadeOut()
flash.show()
- setTimeout (-> flash.fadeOut()), 5000
# Disable form buttons while a form is submitting
$('body').on 'ajax:complete, ajax:beforeSend, submit', 'form', (e) ->
@@ -149,20 +164,6 @@ $ ->
# Show/Hide the profile menu when hovering the account box
$('.account-box').hover -> $(@).toggleClass('hover')
- # Focus search field by pressing 's' key
- $(document).keypress (e) ->
- # Don't do anything if typing in an input
- return if $(e.target).is(":input")
-
- switch e.which
- when 115
- $("#search").focus()
- e.preventDefault()
- when 63
- new Shortcuts()
- e.preventDefault()
-
-
# Commit show suppressed diff
$(".diff-content").on "click", ".supp_diff_link", ->
$(@).next('table').show()
diff --git a/app/assets/javascripts/behaviors/toggle_diff_line_wrap_behavior.coffee b/app/assets/javascripts/behaviors/toggle_diff_line_wrap_behavior.coffee
new file mode 100644
index 00000000000..691ed4f98ae
--- /dev/null
+++ b/app/assets/javascripts/behaviors/toggle_diff_line_wrap_behavior.coffee
@@ -0,0 +1,14 @@
+$ ->
+ # Toggle line wrapping in diff.
+ #
+ # %div.diff-file
+ # %input.js-toggle-diff-line-wrap
+ # %td.line_content
+ #
+ $("body").on "click", ".js-toggle-diff-line-wrap", (e) ->
+ diffFile = $(@).closest(".diff-file")
+ if $(@).is(":checked")
+ diffFile.addClass("diff-wrap-lines")
+ else
+ diffFile.removeClass("diff-wrap-lines")
+
diff --git a/app/assets/javascripts/branch-graph.js.coffee b/app/assets/javascripts/branch-graph.js.coffee
index f6d57bd55bb..010a2b0e42b 100644
--- a/app/assets/javascripts/branch-graph.js.coffee
+++ b/app/assets/javascripts/branch-graph.js.coffee
@@ -1,4 +1,4 @@
-class BranchGraph
+class @BranchGraph
constructor: (@element, @options) ->
@preparedCommits = {}
@mtime = 0
@@ -90,11 +90,15 @@ class BranchGraph
renderPartialGraph: ->
start = Math.floor((@element.scrollTop() - @offsetY) / @unitTime) - 10
- start = 0 if start < 0
+ if start < 0
+ isGraphEdge = true
+ start = 0
end = start + 40
- end = @commits.length if @commits.length < end
+ if @commits.length < end
+ isGraphEdge = true
+ end = @commits.length
- if @prev_start == -1 or Math.abs(@prev_start - start) > 10
+ if @prev_start == -1 or Math.abs(@prev_start - start) > 10 or isGraphEdge
i = start
@prev_start = start
@@ -120,23 +124,32 @@ class BranchGraph
@top.toFront()
bindEvents: ->
- drag = {}
element = @element
$(element).scroll (event) =>
@renderPartialGraph()
- $(window).on
- keydown: (event) =>
- # left
- element.scrollLeft element.scrollLeft() - 50 if event.keyCode is 37
- # top
- element.scrollTop element.scrollTop() - 50 if event.keyCode is 38
- # right
- element.scrollLeft element.scrollLeft() + 50 if event.keyCode is 39
- # bottom
- element.scrollTop element.scrollTop() + 50 if event.keyCode is 40
- @renderPartialGraph()
+ scrollDown: =>
+ @element.scrollTop @element.scrollTop() + 50
+ @renderPartialGraph()
+
+ scrollUp: =>
+ @element.scrollTop @element.scrollTop() - 50
+ @renderPartialGraph()
+
+ scrollLeft: =>
+ @element.scrollLeft @element.scrollLeft() - 50
+ @renderPartialGraph()
+
+ scrollRight: =>
+ @element.scrollLeft @element.scrollLeft() + 50
+ @renderPartialGraph()
+
+ scrollBottom: =>
+ @element.scrollTop @element.find('svg').height()
+
+ scrollTop: =>
+ @element.scrollTop 0
appendLabel: (x, y, commit) ->
return unless commit.refs
@@ -325,5 +338,3 @@ Raphael::textWrap = (t, width) ->
b = t.getBBox()
h = Math.abs(b.y2) - Math.abs(b.y) + 1
t.attr y: b.y + h
-
-@BranchGraph = BranchGraph
diff --git a/app/assets/javascripts/chart.js.coffee b/app/assets/javascripts/chart.js.coffee
deleted file mode 100644
index 989f48e5e75..00000000000
--- a/app/assets/javascripts/chart.js.coffee
+++ /dev/null
@@ -1,21 +0,0 @@
-@Chart =
- labels: []
- values: []
-
- init: (labels, values, title) ->
- r = Raphael('activity-chart')
-
- fin = ->
- @flag = r.popup(@bar.x, @bar.y, @bar.value or "0").insertBefore(this)
-
- fout = ->
- @flag.animate
- opacity: 0, 300, -> @remove()
-
- r.text(160, 10, title).attr font: "13px sans-serif"
- r.barchart(
- 10, 20, 560, 200,
- [values],
- {colors:["#456"]}
- ).label(labels, true)
- .hover(fin, fout)
diff --git a/app/assets/javascripts/dispatcher.js.coffee b/app/assets/javascripts/dispatcher.js.coffee
index e5e62c87e40..086c09f196e 100644
--- a/app/assets/javascripts/dispatcher.js.coffee
+++ b/app/assets/javascripts/dispatcher.js.coffee
@@ -15,49 +15,87 @@ class Dispatcher
return false
path = page.split(':')
+ shortcut_handler = null
switch page
when 'projects:issues:index'
Issues.init()
+ shortcut_handler = new ShortcutsNavigation()
when 'projects:issues:show'
new Issue()
+ shortcut_handler = new ShortcutsIssueable()
+ new ZenMode()
when 'projects:milestones:show'
new Milestone()
- when 'projects:issues:new'
+ when 'projects:issues:new','projects:issues:edit'
GitLab.GfmAutoComplete.setup()
- when 'projects:merge_requests:new'
+ shortcut_handler = new ShortcutsNavigation()
+ new ZenMode()
+ when 'projects:merge_requests:new', 'projects:merge_requests:edit'
GitLab.GfmAutoComplete.setup()
new Diff()
+ shortcut_handler = new ShortcutsNavigation()
+ new ZenMode()
when 'projects:merge_requests:show'
new Diff()
+ shortcut_handler = new ShortcutsIssueable()
+ new ZenMode()
when "projects:merge_requests:diffs"
new Diff()
+ when 'projects:merge_requests:index'
+ shortcut_handler = new ShortcutsNavigation()
when 'dashboard:show'
new Dashboard()
new Activities()
when 'projects:commit:show'
new Commit()
new Diff()
+ shortcut_handler = new ShortcutsNavigation()
+ when 'projects:commits:show'
+ shortcut_handler = new ShortcutsNavigation()
when 'groups:show', 'projects:show'
new Activities()
- when 'projects:new', 'projects:edit'
+ shortcut_handler = new ShortcutsNavigation()
+ when 'projects:new'
new Project()
+ when 'projects:edit'
+ new Project()
+ shortcut_handler = new ShortcutsNavigation()
when 'projects:teams:members:index'
new TeamMembers()
when 'groups:members'
new GroupMembers()
when 'projects:tree:show'
new TreeView()
+ shortcut_handler = new ShortcutsNavigation()
when 'projects:blob:show'
new BlobView()
+ shortcut_handler = new ShortcutsNavigation()
when 'projects:labels:new', 'projects:labels:edit'
new Labels()
+ when 'projects:network:show'
+ # Ensure we don't create a particular shortcut handler here. This is
+ # already created, where the network graph is created.
+ shortcut_handler = true
switch path.first()
when 'admin' then new Admin()
+ when 'dashboard'
+ shortcut_handler = new ShortcutsDashboardNavigation()
when 'projects'
- new Wikis() if path[1] == 'wikis'
+ switch path[1]
+ when 'wikis'
+ new Wikis()
+ shortcut_handler = new ShortcutsNavigation()
+ when 'snippets', 'labels', 'graphs'
+ shortcut_handler = new ShortcutsNavigation()
+ when 'team_members', 'deploy_keys', 'hooks', 'services', 'protected_branches'
+ shortcut_handler = new ShortcutsNavigation()
+
+ # If we haven't installed a custom shortcut handler, install the default one
+ if not shortcut_handler
+ new Shortcuts()
initSearch: ->
opts = $('.search-autocomplete-opts')
diff --git a/app/assets/javascripts/flash.js.coffee b/app/assets/javascripts/flash.js.coffee
index f8b7789884f..cf1a37eae3e 100644
--- a/app/assets/javascripts/flash.js.coffee
+++ b/app/assets/javascripts/flash.js.coffee
@@ -10,6 +10,5 @@ class Flash
flash.click -> $(@).fadeOut()
flash.show()
- setTimeout (-> flash.fadeOut()), 5000
@Flash = Flash
diff --git a/app/assets/javascripts/groups.js.coffee b/app/assets/javascripts/groups.js.coffee
index 49d6605980b..4b1000f9a6a 100644
--- a/app/assets/javascripts/groups.js.coffee
+++ b/app/assets/javascripts/groups.js.coffee
@@ -1,6 +1,6 @@
class GroupMembers
constructor: ->
- $('li.users_group').bind 'ajax:success', ->
+ $('li.group_member').bind 'ajax:success', ->
$(this).fadeOut()
@GroupMembers = GroupMembers
diff --git a/app/assets/javascripts/issues.js.coffee b/app/assets/javascripts/issues.js.coffee
index 54de93a4e04..2499ad5ad80 100644
--- a/app/assets/javascripts/issues.js.coffee
+++ b/app/assets/javascripts/issues.js.coffee
@@ -43,25 +43,31 @@
$(".selected_issue").bind "change", Issues.checkChanged
-
+ # Make sure we trigger ajax request only after user stop typing
initSearch: ->
- form = $("#issue_search_form")
- last_terms = ""
+ @timer = null
$("#issue_search").keyup ->
- terms = $(this).val()
- unless terms is last_terms
- last_terms = terms
- if terms.length >= 2 or terms.length is 0
- $.ajax
- type: "GET"
- url: location.href
- data: "issue_search=" + terms
- complete: ->
- $(".loading").hide()
- success: (data) ->
- $('.issues-holder').html(data.html)
- Issues.reload()
- dataType: "json"
+ clearTimeout(@timer);
+ @timer = setTimeout(Issues.filterResults, 500)
+
+ filterResults: =>
+ form = $("#issue_search_form")
+ search = $("#issue_search").val()
+ $('.issues-holder').css("opacity", '0.5')
+ issues_url = form.attr('action') + '? '+ form.serialize()
+
+ $.ajax
+ type: "GET"
+ url: form.attr('action')
+ data: form.serialize()
+ complete: ->
+ $('.issues-holder').css("opacity", '1.0')
+ success: (data) ->
+ $('.issues-holder').html(data.html)
+ # Change url so if user reload a page - search results are saved
+ History.replaceState {page: issues_url}, document.title, issues_url
+ Issues.reload()
+ dataType: "json"
checkChanged: ->
checked_issues = $(".selected_issue:checked")
diff --git a/app/assets/javascripts/markdown_area.js.coffee b/app/assets/javascripts/markdown_area.js.coffee
index bee2785562d..a971e5dbf1d 100644
--- a/app/assets/javascripts/markdown_area.js.coffee
+++ b/app/assets/javascripts/markdown_area.js.coffee
@@ -27,7 +27,7 @@ $(document).ready ->
dropzone = $(".div-dropzone").dropzone(
url: project_image_path_upload
dictDefaultMessage: ""
- clickable: true
+ clickable: false
paramName: "markdown_img"
maxFilesize: 10
uploadMultiple: false
diff --git a/app/assets/javascripts/network.js.coffee b/app/assets/javascripts/network.js.coffee
index cea5986f45a..f4ef07a50a7 100644
--- a/app/assets/javascripts/network.js.coffee
+++ b/app/assets/javascripts/network.js.coffee
@@ -1,11 +1,9 @@
-class Network
+class @Network
constructor: (opts) ->
$("#filter_ref").click ->
$(this).closest('form').submit()
- branch_graph = new BranchGraph($(".network-graph"), opts)
+ @branch_graph = new BranchGraph($(".network-graph"), opts)
vph = $(window).height() - 250
$('.network-graph').css 'height': (vph + 'px')
-
-@Network = Network
diff --git a/app/assets/javascripts/notes.js.coffee b/app/assets/javascripts/notes.js.coffee
index 83b1bae0ea1..597d6d26b69 100644
--- a/app/assets/javascripts/notes.js.coffee
+++ b/app/assets/javascripts/notes.js.coffee
@@ -16,13 +16,19 @@ class Notes
$(document).on "ajax:success", ".js-main-target-form", @addNote
$(document).on "ajax:success", ".js-discussion-note-form", @addDiscussionNote
- # change note in UI after update
+ # change note in UI after update
$(document).on "ajax:success", "form.edit_note", @updateNote
# Edit note link
$(document).on "click", ".js-note-edit", @showEditForm
$(document).on "click", ".note-edit-cancel", @cancelEdit
+ # Reopen and close actions for Issue/MR combined with note form submit
+ $(document).on "click", ".js-note-target-reopen", @targetReopen
+ $(document).on "click", ".js-note-target-close", @targetClose
+ $(document).on "click", ".js-comment-button", @updateCloseButton
+ $(document).on "keyup", ".js-note-text", @updateTargetButtons
+
# remove a note (in general)
$(document).on "click", ".js-note-delete", @removeNote
@@ -78,7 +84,9 @@ class Notes
$(document).off "click", ".js-add-diff-note-button"
$(document).off "visibilitychange"
$(document).off "keypress", @notes_forms
-
+ $(document).off "keyup", ".js-note-text"
+ $(document).off "click", ".js-note-target-reopen"
+ $(document).off "click", ".js-note-target-close"
initRefresh: ->
clearInterval(Notes.interval)
@@ -407,30 +415,6 @@ class Notes
form.addClass "js-discussion-note-form"
###
- General note form setup.
-
- deactivates the submit button when text is empty
- hides the preview button when text is empty
- setup GFM auto complete
- show the form
- ###
- setupNoteForm: (form) =>
- disableButtonIfEmptyField form.find(".js-note-text"), form.find(".js-comment-button")
- form.removeClass "js-new-note-form"
- form.removeClass "js-new-note-form"
- GitLab.GfmAutoComplete.setup()
-
- # setup preview buttons
- previewButton = form.find(".js-note-preview-button")
- form.find(".js-note-text").on "input", ->
- if $(this).val().trim() isnt ""
- previewButton.removeClass("turn-off").addClass "turn-on"
- else
- previewButton.removeClass("turn-on").addClass "turn-off"
-
- form.show()
-
- ###
Called when clicking on the "add a comment" button on the side of a diff line.
Inserts a temporary row for the form below the line.
@@ -502,4 +486,33 @@ class Notes
visibilityChange: =>
@refresh()
+ targetReopen: (e) =>
+ @submitNoteForm($(e.target).parents('form'))
+
+ targetClose: (e) =>
+ @submitNoteForm($(e.target).parents('form'))
+
+ submitNoteForm: (form) =>
+ noteText = form.find(".js-note-text").val()
+ if noteText.trim().length > 0
+ form.submit()
+
+ updateCloseButton: (e) =>
+ textarea = $(e.target)
+ form = textarea.parents('form')
+ form.find('.js-note-target-close').text('Close')
+
+ updateTargetButtons: (e) =>
+ textarea = $(e.target)
+ form = textarea.parents('form')
+
+ if textarea.val().trim().length > 0
+ form.find('.js-note-target-reopen').text('Comment & reopen')
+ form.find('.js-note-target-close').text('Comment & close')
+ else
+ form.find('.js-note-target-reopen').text('Reopen')
+ form.find('.js-note-target-close').text('Close')
+
+
+
@Notes = Notes
diff --git a/app/assets/javascripts/project.js.coffee b/app/assets/javascripts/project.js.coffee
index f7c64b4b816..d81cc087df9 100644
--- a/app/assets/javascripts/project.js.coffee
+++ b/app/assets/javascripts/project.js.coffee
@@ -47,7 +47,7 @@ $ ->
$(@).parents('.no-ssh-key-message').hide()
e.preventDefault()
- $('.project-side .star').on 'ajax:success', (e, data, status, xhr) ->
+ $('.project-home-panel .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/javascripts/shortcuts.js.coffee b/app/assets/javascripts/shortcuts.js.coffee
index e7e40a066ec..e9aeb1e9525 100644
--- a/app/assets/javascripts/shortcuts.js.coffee
+++ b/app/assets/javascripts/shortcuts.js.coffee
@@ -1,11 +1,30 @@
-class Shortcuts
+class @Shortcuts
constructor: ->
+ @enabledHelp = []
+ Mousetrap.reset()
+ Mousetrap.bind('?', @selectiveHelp)
+ Mousetrap.bind('s', Shortcuts.focusSearch)
+
+ selectiveHelp: (e) =>
+ Shortcuts.showHelp(e, @enabledHelp)
+
+ @showHelp: (e, location) ->
if $('#modal-shortcuts').length > 0
$('#modal-shortcuts').modal('show')
else
$.ajax(
url: '/help/shortcuts',
- dataType: "script"
+ dataType: 'script',
+ success: (e) ->
+ if location and location.length > 0
+ for l in location
+ $(l).show()
+ else
+ $('.hidden-shortcut').show()
+ $('.js-more-help-button').remove()
)
+ e.preventDefault()
-@Shortcuts = Shortcuts
+ @focusSearch: (e) ->
+ $('#search').focus()
+ e.preventDefault()
diff --git a/app/assets/javascripts/shortcuts_dashboard_navigation.js.coffee b/app/assets/javascripts/shortcuts_dashboard_navigation.js.coffee
new file mode 100644
index 00000000000..d522d9f3b90
--- /dev/null
+++ b/app/assets/javascripts/shortcuts_dashboard_navigation.js.coffee
@@ -0,0 +1,14 @@
+#= require shortcuts
+
+class @ShortcutsDashboardNavigation extends Shortcuts
+ constructor: ->
+ super()
+ Mousetrap.bind('g a', -> ShortcutsDashboardNavigation.findAndollowLink('.shortcuts-activity'))
+ Mousetrap.bind('g p', -> ShortcutsDashboardNavigation.findAndollowLink('.shortcuts-projects'))
+ Mousetrap.bind('g i', -> ShortcutsDashboardNavigation.findAndollowLink('.shortcuts-issues'))
+ Mousetrap.bind('g m', -> ShortcutsDashboardNavigation.findAndollowLink('.shortcuts-merge_requests'))
+
+ @findAndollowLink: (selector) ->
+ link = $(selector).attr('href')
+ if link
+ window.location = link
diff --git a/app/assets/javascripts/shortcuts_issueable.coffee b/app/assets/javascripts/shortcuts_issueable.coffee
new file mode 100644
index 00000000000..b8dae71e037
--- /dev/null
+++ b/app/assets/javascripts/shortcuts_issueable.coffee
@@ -0,0 +1,19 @@
+#= require shortcuts_navigation
+
+class @ShortcutsIssueable extends ShortcutsNavigation
+ constructor: (isMergeRequest) ->
+ super()
+ Mousetrap.bind('a', ->
+ $('.js-assignee').select2('open')
+ return false
+ )
+ Mousetrap.bind('m', ->
+ $('.js-milestone').select2('open')
+ return false
+ )
+
+ if isMergeRequest
+ @enabledHelp.push('.hidden-shortcut.merge_reuests')
+ else
+ @enabledHelp.push('.hidden-shortcut.issues')
+
diff --git a/app/assets/javascripts/shortcuts_navigation.coffee b/app/assets/javascripts/shortcuts_navigation.coffee
new file mode 100644
index 00000000000..e592b700e7c
--- /dev/null
+++ b/app/assets/javascripts/shortcuts_navigation.coffee
@@ -0,0 +1,20 @@
+#= require shortcuts
+
+class @ShortcutsNavigation extends Shortcuts
+ constructor: ->
+ super()
+ Mousetrap.bind('g p', -> ShortcutsNavigation.findAndollowLink('.shortcuts-project'))
+ Mousetrap.bind('g f', -> ShortcutsNavigation.findAndollowLink('.shortcuts-tree'))
+ Mousetrap.bind('g c', -> ShortcutsNavigation.findAndollowLink('.shortcuts-commits'))
+ Mousetrap.bind('g n', -> ShortcutsNavigation.findAndollowLink('.shortcuts-network'))
+ Mousetrap.bind('g g', -> ShortcutsNavigation.findAndollowLink('.shortcuts-graphs'))
+ Mousetrap.bind('g i', -> ShortcutsNavigation.findAndollowLink('.shortcuts-issues'))
+ Mousetrap.bind('g m', -> ShortcutsNavigation.findAndollowLink('.shortcuts-merge_requests'))
+ Mousetrap.bind('g w', -> ShortcutsNavigation.findAndollowLink('.shortcuts-wiki'))
+ Mousetrap.bind('g s', -> ShortcutsNavigation.findAndollowLink('.shortcuts-snippets'))
+ @enabledHelp.push('.hidden-shortcut.project')
+
+ @findAndollowLink: (selector) ->
+ link = $(selector).attr('href')
+ if link
+ window.location = link
diff --git a/app/assets/javascripts/shortcuts_network.js.coffee b/app/assets/javascripts/shortcuts_network.js.coffee
new file mode 100644
index 00000000000..cc95ad7ebfe
--- /dev/null
+++ b/app/assets/javascripts/shortcuts_network.js.coffee
@@ -0,0 +1,12 @@
+#= require shortcuts_navigation
+
+class @ShortcutsNetwork extends ShortcutsNavigation
+ constructor: (@graph) ->
+ super()
+ Mousetrap.bind(['left', 'h'], @graph.scrollLeft)
+ Mousetrap.bind(['right', 'l'], @graph.scrollRight)
+ Mousetrap.bind(['up', 'k'], @graph.scrollUp)
+ Mousetrap.bind(['down', 'j'], @graph.scrollDown)
+ Mousetrap.bind(['shift+up', 'shift+k'], @graph.scrollTop)
+ Mousetrap.bind(['shift+down', 'shift+j'], @graph.scrollBottom)
+ @enabledHelp.push('.hidden-shortcut.network')
diff --git a/app/assets/javascripts/stat_graph_contributors.js.coffee b/app/assets/javascripts/stat_graph_contributors.js.coffee
index 168b7337041..ab785a54543 100644
--- a/app/assets/javascripts/stat_graph_contributors.js.coffee
+++ b/app/assets/javascripts/stat_graph_contributors.js.coffee
@@ -24,22 +24,7 @@ class window.ContributorsStatGraph
class: 'graph-author-commits-count'
})
commits.text(author.commits + " commits")
-
- additions = $('<span/>', {
- class: 'graph-additions'
- })
- additions.text(author.additions + " ++")
-
- deletions = $('<span/>', {
- class: 'graph-deletions'
- })
- deletions.text(author.deletions + " --")
-
$('<span/>').append(commits)
- .append(" / ")
- .append(additions)
- .append(" / ")
- .append(deletions)
create_author_header: (author) ->
list_item = $('<li/>', {
diff --git a/app/assets/javascripts/stat_graph_contributors_util.js.coffee b/app/assets/javascripts/stat_graph_contributors_util.js.coffee
index 364cab18377..1670f5c7bc1 100644
--- a/app/assets/javascripts/stat_graph_contributors_util.js.coffee
+++ b/app/assets/javascripts/stat_graph_contributors_util.js.coffee
@@ -90,4 +90,4 @@ window.ContributorsStatGraphUtil =
true
else
false
-
+
diff --git a/app/assets/javascripts/zen_mode.js.coffee b/app/assets/javascripts/zen_mode.js.coffee
new file mode 100644
index 00000000000..21ac212df0e
--- /dev/null
+++ b/app/assets/javascripts/zen_mode.js.coffee
@@ -0,0 +1,57 @@
+class @ZenMode
+ @fullscreen_prefix = 'fullscreen_'
+
+ constructor: ->
+ @active_zen_area = null
+ @active_checkbox = null
+ @scroll_position = 0
+
+ $(window).scroll =>
+ if not @active_checkbox
+ @scroll_position = window.pageYOffset
+
+ $('body').on 'change', '.zennable input[type=checkbox]', (e) =>
+ checkbox = e.currentTarget
+ if checkbox.checked
+ # Disable other keyboard shortcuts in ZEN mode
+ Mousetrap.pause()
+ @udpateActiveZenArea(checkbox)
+ else
+ @exitZenMode()
+
+ $(document).on 'keydown', (e) =>
+ if e.keyCode is $.ui.keyCode.ESCAPE
+ @exitZenMode()
+ e.preventDefault()
+
+ $(window).on 'hashchange', @updateZenModeFromLocationHash
+
+ udpateActiveZenArea: (checkbox) =>
+ @active_checkbox = $(checkbox)
+ @active_checkbox.prop('checked', true)
+ @active_zen_area = @active_checkbox.parent().find('textarea')
+ @active_zen_area.focus()
+ window.location.hash = ZenMode.fullscreen_prefix + @active_checkbox.prop('id')
+
+ exitZenMode: =>
+ if @active_zen_area isnt null
+ Mousetrap.unpause()
+ @active_checkbox.prop('checked', false)
+ @active_zen_area = null
+ @active_checkbox = null
+ window.location.hash = ''
+ window.scrollTo(window.pageXOffset, @scroll_position)
+
+ checkboxFromLocationHash: (e) ->
+ id = $.trim(window.location.hash.replace('#' + ZenMode.fullscreen_prefix, ''))
+ if id
+ return $('.zennable input[type=checkbox]#' + id)[0]
+ else
+ return null
+
+ updateZenModeFromLocationHash: (e) =>
+ checkbox = @checkboxFromLocationHash()
+ if checkbox
+ @udpateActiveZenArea(checkbox)
+ else
+ @exitZenMode()
diff --git a/app/assets/stylesheets/generic/common.scss b/app/assets/stylesheets/generic/common.scss
index 9d3c9f372a9..803219a2e86 100644
--- a/app/assets/stylesheets/generic/common.scss
+++ b/app/assets/stylesheets/generic/common.scss
@@ -128,7 +128,7 @@ p.time {
}
.highlight_word {
- border-bottom: 2px solid #F90;
+ background: #fafe3d;
}
.thin_area{
diff --git a/app/assets/stylesheets/generic/files.scss b/app/assets/stylesheets/generic/files.scss
index 1412277ffb6..e2b0ef0c5ea 100644
--- a/app/assets/stylesheets/generic/files.scss
+++ b/app/assets/stylesheets/generic/files.scss
@@ -60,7 +60,6 @@
.highlight {
margin-bottom: 9px;
- @include border-radius(4px);
> pre {
margin: 0;
diff --git a/app/assets/stylesheets/generic/flash.scss b/app/assets/stylesheets/generic/flash.scss
index 95d28aaef6c..82eb50ad4be 100644
--- a/app/assets/stylesheets/generic/flash.scss
+++ b/app/assets/stylesheets/generic/flash.scss
@@ -1,25 +1,17 @@
.flash-container {
- display: none;
cursor: pointer;
margin: 0;
- text-align: center;
- color: #fff;
font-size: 14px;
- position: fixed;
- bottom: 0;
width: 100%;
- opacity: 0.8;
z-index: 100;
.flash-notice {
- background: #49C;
- padding: 10px;
- text-shadow: 0 1px 1px #178;
+ @extend .alert;
+ @extend .alert-info;
}
.flash-alert {
- background: #C67;
- text-shadow: 0 1px 1px #945;
- padding: 10px;
+ @extend .alert;
+ @extend .alert-danger;
}
}
diff --git a/app/assets/stylesheets/generic/forms.scss b/app/assets/stylesheets/generic/forms.scss
index 2a31cae5dfb..e8b23090b0f 100644
--- a/app/assets/stylesheets/generic/forms.scss
+++ b/app/assets/stylesheets/generic/forms.scss
@@ -1,3 +1,7 @@
+textarea {
+ resize: vertical;
+}
+
input[type='search'].search-text-input {
background-image: image-url("icon-search.png");
background-repeat: no-repeat;
@@ -83,3 +87,140 @@ label {
.form-control {
@include box-shadow(none);
}
+
+.issuable-description {
+ margin-top: 35px;
+}
+
+.zennable {
+ position: relative;
+
+ input {
+ display: none;
+ }
+
+ .collapse {
+ display: none;
+ opacity: 0.5;
+
+ &:before {
+ content: '\f066';
+ font-family: FontAwesome;
+ color: #000;
+ font-size: 28px;
+ position: relative;
+ padding: 30px 40px 0 0;
+ }
+
+ &:hover {
+ opacity: 0.8;
+ }
+ }
+
+ .expand {
+ opacity: 0.5;
+
+ &:before {
+ content: '\f065';
+ font-family: FontAwesome;
+ color: #000;
+ font-size: 14px;
+ line-height: 14px;
+ padding-right: 20px;
+ position: relative;
+ vertical-align: middle;
+ }
+
+ &:hover {
+ opacity: 0.8;
+ }
+ }
+
+ input:checked ~ .zen-backdrop .expand {
+ display: none;
+ }
+
+ input:checked ~ .zen-backdrop .collapse {
+ display: block;
+ position: absolute;
+ top: 0;
+ }
+
+ label {
+ position: absolute;
+ top: -26px;
+ right: 0;
+ font-variant: small-caps;
+ text-transform: uppercase;
+ font-size: 10px;
+ padding: 4px;
+ font-weight: 500;
+ letter-spacing: 1px;
+
+ &:before {
+ display: inline-block;
+ width: 10px;
+ height: 14px;
+ }
+ }
+
+ input:checked ~ .zen-backdrop {
+ background-color: white;
+ position: fixed;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ z-index: 1031;
+
+ textarea {
+ border: none;
+ box-shadow: none;
+ border-radius: 0;
+ color: #000;
+ font-size: 20px;
+ line-height: 26px;
+ padding: 30px;
+ display: block;
+ outline: none;
+ resize: none;
+ height: 100vh;
+ max-width: 900px;
+ margin: 0 auto;
+ }
+ }
+
+ .zen-backdrop textarea::-webkit-input-placeholder {
+ color: white;
+ }
+
+ .zen-backdrop textarea:-moz-placeholder {
+ color: white;
+ }
+
+ .zen-backdrop textarea::-moz-placeholder {
+ color: white;
+ }
+
+ .zen-backdrop textarea:-ms-input-placeholder {
+ color: white;
+ }
+
+ input:checked ~ .zen-backdrop textarea::-webkit-input-placeholder {
+ color: #999;
+ }
+
+ input:checked ~ .zen-backdrop textarea:-moz-placeholder {
+ color: #999;
+ opacity: 1;
+ }
+
+ input:checked ~ .zen-backdrop textarea::-moz-placeholder {
+ color: #999;
+ opacity: 1;
+ }
+
+ input:checked ~ .zen-backdrop textarea:-ms-input-placeholder {
+ color: #999;
+ }
+}
diff --git a/app/assets/stylesheets/generic/issuable.scss b/app/assets/stylesheets/generic/issuable.scss
new file mode 100644
index 00000000000..f456b3ace1a
--- /dev/null
+++ b/app/assets/stylesheets/generic/issuable.scss
@@ -0,0 +1,9 @@
+/**
+ * Styles that apply to both issues and merge requests.
+ */
+
+.issue-form, .merge-request-form {
+ .description {
+ height: 20em;
+ }
+}
diff --git a/app/assets/stylesheets/generic/issue_box.scss b/app/assets/stylesheets/generic/issue_box.scss
index c468980f64d..0486955d6e1 100644
--- a/app/assets/stylesheets/generic/issue_box.scss
+++ b/app/assets/stylesheets/generic/issue_box.scss
@@ -8,43 +8,51 @@
*/
.issue-box {
- color: #666;
+ color: #555;
margin:20px 0;
- background: #FFF;
- border: 1px solid #EEE;
- @include box-shadow(0 1px 1px rgba(0, 0, 0, 0.05));
+ background: #f9f9f9;
+ border-top-left-radius: 5px;
+ @include box-shadow(0 1px 1px rgba(0, 0, 0, 0.09));
&.issue-box-closed {
- border-color: $border_danger;
.state {
+ background-color: #F3CECE;
+ border-color: $border_danger;
+ }
+ .state-label {
background-color: $bg_danger;
color: #FFF;
- border-color: $border_danger;
}
}
&.issue-box-merged {
- border-color: $border_primary;
.state {
+ background-color: #B7CEE7;
+ border-color: $border_primary;
+ }
+ .state-label {
background-color: $bg_primary;
color: #FFF;
- border-color: $border_primary;
}
}
&.issue-box-open {
- border-color: $border_success;
.state {
- border-color: $border_success;
+ background-color: #D6F1D7;
+ border-color: $bg_success;
+ }
+ .state-label {
background-color: $bg_success;
color: #FFF;
}
}
&.issue-box-expired {
- border-color: #cea61b;
.state {
+ background-color: #EEE9B3;
border-color: #faebcc;
+ }
+ .state-label {
background: #cea61b;
color: #FFF;
}
@@ -55,8 +63,7 @@
}
.state {
- border-bottom: 1px solid #DDD;
- padding: 10px 15px;
+ background-color: #f9f9f9;
}
.title {
@@ -88,6 +95,10 @@
.description {
padding: 0 15px 10px 15px;
+
+ code {
+ white-space: pre-wrap;
+ }
}
.title, .context, .description {
@@ -100,12 +111,14 @@
font-size: 14px;
float: left;
font-weight: bold;
+ padding: 10px 15px;
+ border-top-left-radius: 5px;
}
.creator {
float: right;
+ padding: 10px 15px;
a {
- color: #FFF;
text-decoration: underline;
}
}
diff --git a/app/assets/stylesheets/generic/lists.scss b/app/assets/stylesheets/generic/lists.scss
index 0cab6c44c91..d347ab2c2e4 100644
--- a/app/assets/stylesheets/generic/lists.scss
+++ b/app/assets/stylesheets/generic/lists.scss
@@ -39,7 +39,7 @@
&:hover {
background: $hover;
- border-bottom: 1px solid #ADF;
+ border-bottom: 1px solid darken($hover, 10%);
}
&:last-child {
diff --git a/app/assets/stylesheets/generic/timeline.scss b/app/assets/stylesheets/generic/timeline.scss
new file mode 100644
index 00000000000..f29cf25fa4c
--- /dev/null
+++ b/app/assets/stylesheets/generic/timeline.scss
@@ -0,0 +1,77 @@
+.timeline {
+ list-style: none;
+ padding: 20px 0 20px;
+ position: relative;
+
+ &:before {
+ top: 0;
+ bottom: 0;
+ position: absolute;
+ content: " ";
+ width: 3px;
+ background-color: #eeeeee;
+ margin-left: 29px;
+ }
+
+ .timeline-entry {
+ position: relative;
+ margin-top: 5px;
+ margin-left: 30px;
+ margin-bottom: 10px;
+ clear: both;
+
+
+ &:target {
+ .timeline-entry-inner .timeline-content {
+ -webkit-animation:target-note 2s linear;
+ background: $hover;
+ }
+ }
+
+ .timeline-entry-inner {
+ position: relative;
+ margin-left: -20px;
+
+ &:before, &:after {
+ content: " ";
+ display: table;
+ }
+
+ .timeline-icon {
+ margin-top: 2px;
+ background: #fff;
+ color: #737881;
+ float: left;
+ @include border-radius(40px);
+ @include box-shadow(0 0 0 3px #EEE);
+ overflow: hidden;
+
+ .avatar {
+ margin: 0;
+ padding: 0;
+ }
+ }
+
+ .timeline-content {
+ position: relative;
+ background: #f5f5f6;
+ padding: 10px 15px;
+ margin-left: 60px;
+
+ &:after {
+ content: '';
+ display: block;
+ position: absolute;
+ width: 0;
+ height: 0;
+ border-style: solid;
+ border-width: 9px 9px 9px 0;
+ border-color: transparent #f5f5f6 transparent transparent;
+ left: 0;
+ top: 10px;
+ margin-left: -9px;
+ }
+ }
+ }
+ }
+}
diff --git a/app/assets/stylesheets/generic/typography.scss b/app/assets/stylesheets/generic/typography.scss
index 9aa819d40fc..385a627b4be 100644
--- a/app/assets/stylesheets/generic/typography.scss
+++ b/app/assets/stylesheets/generic/typography.scss
@@ -40,7 +40,7 @@ a {
outline: none;
color: $link_color;
&:hover {
- text-decoration: none;
+ text-decoration: underline;
color: $link_hover_color;
}
@@ -89,6 +89,8 @@ a:focus {
.wiki {
@include md-typography;
+ word-wrap: break-word;
+
/* Link to current header. */
h1, h2, h3, h4, h5, h6 {
position: relative;
diff --git a/app/assets/stylesheets/highlight/white.scss b/app/assets/stylesheets/highlight/white.scss
index c06bed3c21e..815cf367ae8 100644
--- a/app/assets/stylesheets/highlight/white.scss
+++ b/app/assets/stylesheets/highlight/white.scss
@@ -1,14 +1,8 @@
.white {
- background-color: #fff;
-
.line.hll {
background: #FFA;
}
- .highlight{
- border-left: 1px solid #eee;
- }
-
pre {
background-color: #fff;
color: #333;
@@ -179,8 +173,16 @@
@include box-shadow(0 5px 15px #000);
}
-.wiki, .note-body {
- .highlight {
- border: 1px solid #DDD;
+.file-content {
+ &.code .white {
+ .highlight {
+ border-left: 1px solid #eee;
+ }
+ }
+
+ &.wiki .white {
+ .highlight, pre, .hljs {
+ background: #F9F9F9;
+ }
}
}
diff --git a/app/assets/stylesheets/main/layout.scss b/app/assets/stylesheets/main/layout.scss
index e28da65c01f..2800feb81f2 100644
--- a/app/assets/stylesheets/main/layout.scss
+++ b/app/assets/stylesheets/main/layout.scss
@@ -16,3 +16,4 @@ body {
.container .content {
margin: 0 0;
}
+
diff --git a/app/assets/stylesheets/main/variables.scss b/app/assets/stylesheets/main/variables.scss
index 02ce2c8338f..72d84226fe7 100644
--- a/app/assets/stylesheets/main/variables.scss
+++ b/app/assets/stylesheets/main/variables.scss
@@ -2,13 +2,13 @@
* General Colors
*/
$style_color: #474D57;
-$hover: #D9EDF7;
+$hover: #FFECDB;
/*
* Link colors
*/
$link_color: #446e9b;
-$link_hover_color: #2FA0BB;
+$link_hover_color: darken($link-color, 10%);
$btn-border: 1px solid #ccc;
diff --git a/app/assets/stylesheets/sections/commits.scss b/app/assets/stylesheets/sections/commits.scss
index 0083d01c460..684e8377a7b 100644
--- a/app/assets/stylesheets/sections/commits.scss
+++ b/app/assets/stylesheets/sections/commits.scss
@@ -244,7 +244,6 @@ li.commit {
font-family: inherit;
padding-left: $left;
position: relative;
- resize: vertical;
z-index: 2;
}
}
diff --git a/app/assets/stylesheets/sections/dashboard.scss b/app/assets/stylesheets/sections/dashboard.scss
index 2be24e9b131..d181d83e857 100644
--- a/app/assets/stylesheets/sections/dashboard.scss
+++ b/app/assets/stylesheets/sections/dashboard.scss
@@ -60,12 +60,13 @@
}
.project-row, .group-row {
- padding: 8px 15px !important;
+ padding: 0 !important;
font-size: 14px;
line-height: 24px;
a {
display: block;
+ padding: 8px 15px;
}
.project-name, .group-name {
@@ -99,14 +100,9 @@
margin-right: 15px;
font-size: 20px;
margin-bottom: 15px;
- border: 1px solid #EEE;
- padding: 8px 12px;
- border-radius: 50px;
- background: #f5f5f5;
- text-align: center;
i {
- color: #BBB;
+ color: #888;
}
}
diff --git a/app/assets/stylesheets/sections/diff.scss b/app/assets/stylesheets/sections/diff.scss
index 488d06919b0..758f15c8013 100644
--- a/app/assets/stylesheets/sections/diff.scss
+++ b/app/assets/stylesheets/sections/diff.scss
@@ -125,8 +125,6 @@
}
.line_content {
display: block;
- white-space: pre;
- height: 18px;
margin: 0px;
padding: 0px 0.5em;
border: none;
@@ -341,3 +339,12 @@
margin: 0;
border: none;
}
+
+.diff-file .line_content {
+ white-space: pre;
+}
+
+.diff-wrap-lines .line_content {
+ white-space: pre-wrap;
+}
+
diff --git a/app/assets/stylesheets/sections/help.scss b/app/assets/stylesheets/sections/help.scss
index 90ed98ba25f..07c62f98c36 100644
--- a/app/assets/stylesheets/sections/help.scss
+++ b/app/assets/stylesheets/sections/help.scss
@@ -17,3 +17,56 @@
}
}
}
+
+
+.shortcut-mappings {
+ font-size: 12px;
+ color: #555;
+
+ tbody:first-child tr:first-child {
+ padding-top: 0
+ }
+
+ th {
+ padding-top: 15px;
+ font-size: 14px;
+ line-height: 1.5;
+ color: #333;
+ text-align: left
+ }
+
+ td {
+ padding-top: 3px;
+ padding-bottom: 3px;
+ vertical-align: top;
+ line-height: 20px
+ }
+
+ .shortcut {
+ padding-right: 10px;
+ color: #999;
+ text-align: right;
+ white-space: nowrap
+ }
+
+ .key {
+ @extend .label;
+ @extend .label-inverse;
+ font: 11px Consolas, "Liberation Mono", Menlo, Courier, monospace;
+ padding: 3px 5px;
+ }
+}
+
+.modal-body {
+ position: relative;
+ overflow-y: auto;
+ padding: 15px;
+}
+
+body.modal-open {
+ overflow: hidden;
+}
+
+.modal .modal-dialog {
+ width: 860px;
+}
diff --git a/app/assets/stylesheets/sections/nav.scss b/app/assets/stylesheets/sections/nav.scss
index f5d09c2df10..778953984d6 100644
--- a/app/assets/stylesheets/sections/nav.scss
+++ b/app/assets/stylesheets/sections/nav.scss
@@ -35,39 +35,31 @@
width: 1%;
&.active {
a {
- color: #333;
+ color: $link_color;
font-weight: bold;
&:after {
content: '';
display: block;
position: relative;
- bottom: 8px;
- left: 50%;
- width: 0;
- height: 0;
- border-color: transparent transparent #333 transparent;
+ bottom: -1px;
+ border-color: $link_color;
border-style: solid;
- border-width: 6px;
- margin-left: -6px;
+ border-width: 2px;
}
}
}
&:hover {
a {
- color: $link_color;
+ color: $link_hover_color;
&:after {
content: '';
display: block;
position: relative;
- bottom: 8px;
- left: 50%;
- width: 0;
- height: 0;
- border-color: transparent transparent $link_color transparent;
+ bottom: -1px;
+ border-color: $link_hover_color;
border-style: solid;
- border-width: 6px;
- margin-left: -6px;
+ border-width: 2px;
}
}
}
@@ -90,7 +82,6 @@
line-height: 34px;
color: #777;
text-shadow: 0 1px 1px white;
- padding: 0 10px;
text-decoration: none;
padding-top: 2px;
}
diff --git a/app/assets/stylesheets/sections/notes.scss b/app/assets/stylesheets/sections/notes.scss
index 18db7abc64e..d1bdc9aa179 100644
--- a/app/assets/stylesheets/sections/notes.scss
+++ b/app/assets/stylesheets/sections/notes.scss
@@ -17,9 +17,12 @@ ul.notes {
.discussion-header,
.note-header {
@extend .cgray;
- padding-top: 5px;
padding-bottom: 15px;
+ a:hover {
+ text-decoration: none;
+ }
+
.avatar {
float: left;
margin-right: 10px;
@@ -43,34 +46,19 @@ ul.notes {
}
.discussion {
- padding: 10px 0;
overflow: hidden;
display: block;
position:relative;
- border-bottom: 1px solid #EEE;
-
- .discussion-body {
- margin-left: 50px;
- }
}
.note {
- padding: 8px 0;
- overflow: hidden;
display: block;
position:relative;
- border-bottom: 1px solid #eee;
- p { color: $style_color; }
-
- .avatar {
- margin-top: 3px;
- }
.attachment {
font-size: 14px;
}
.note-body {
@include md-typography;
- margin-left: 43px;
}
.note-header {
padding-bottom: 3px;
@@ -80,11 +68,6 @@ ul.notes {
border-bottom: none;
}
}
-
- .note:target {
- -webkit-animation:target-note 2s linear;
- background: #fffff0;
- }
}
.diff-file .notes_holder {
@@ -99,7 +82,7 @@ ul.notes {
&.notes_line {
text-align: center;
padding: 10px 0;
- background: #eee;
+ background: #FFF;
}
&.notes_line2 {
text-align: center;
@@ -111,6 +94,9 @@ ul.notes {
border-width: 1px 0;
padding-top: 0;
vertical-align: top;
+ &.parallel{
+ border-width: 1px;
+ }
}
}
}
@@ -161,8 +147,14 @@ ul.notes {
*/
.diff-file tr.line_holder {
+ @mixin show-add-diff-note {
+ filter: alpha(opacity=100);
+ opacity: 1.0;
+ }
+
.add-diff-note {
background: image-url("diff_note_add.png") no-repeat left 0;
+ border: none;
height: 22px;
margin-left: -65px;
position: absolute;
@@ -174,8 +166,7 @@ ul.notes {
filter: alpha(opacity=0);
&:hover {
- opacity: 1.0;
- filter: alpha(opacity=100);
+ @include show-add-diff-note;
}
}
@@ -184,8 +175,7 @@ ul.notes {
background: $hover !important;
.add-diff-note {
- opacity: 1.0;
- filter: alpha(opacity=100);
+ @include show-add-diff-note;
}
}
}
@@ -362,3 +352,7 @@ ul.notes {
border-top: 1px solid #DDD;
}
}
+
+.discussion-notes-count {
+ font-size: 16px;
+}
diff --git a/app/assets/stylesheets/sections/projects.scss b/app/assets/stylesheets/sections/projects.scss
index 6e34f736ac9..b4ee5ccc8d7 100644
--- a/app/assets/stylesheets/sections/projects.scss
+++ b/app/assets/stylesheets/sections/projects.scss
@@ -15,62 +15,68 @@
}
.project-home-panel {
- border-bottom: 1px solid #DDD;
- padding-bottom: 15px;
- margin-bottom: 30px;
+ margin-bottom: 15px;
&.empty-project {
- border-bottom: 0px;
- padding-bottom: 15px;
- margin-bottom: 0px;
+ border-bottom: 0px;
+ padding-bottom: 15px;
+ margin-bottom: 0px;
}
- .project-home-title {
- font-size: 18px;
- color: #444;
- margin: 0;
- line-height: 32px;
- }
.project-home-dropdown {
margin-left: 10px;
float: right;
}
- .project-home-extra {
- margin-top: 15px;
+
+ .project-home-row {
+ @extend .clearfix;
+ margin-bottom: 15px;
.project-home-desc {
float: left;
- color: #777;
- margin-bottom: 10px;
+ color: #666;
+ font-size: 16px;
}
- .project-home-links {
+ .star-fork-buttons {
float: right;
- a {
- margin-left: 10px;
- font-weight: 500;
+ min-width: 200px;
+ font-size: 14px;
+ font-weight: bold;
+
+ .star-buttons, .fork-buttons {
+ float: right;
+ margin-left: 20px;
+
+ a:hover {
+ text-decoration: none;
+ }
+
+ .count {
+ margin-left: 5px;
+ }
}
}
}
.visibility-level-label {
- font-size: 17px;
- background: #f1f1f1;
- border-radius: 4px;
- color: #444;
- position: absolute;
- margin-left: -55px;
- text-shadow: 0 1px 1px #FFF;
- width: 40px;
- text-align: center;
- padding: 6px;
-
+ color: #555;
+ font-weight: bold;
i {
color: inherit;
}
}
}
+.project-home-links {
+ padding: 10px 0px;
+ float: right;
+ a {
+ margin-left: 10px;
+ font-weight: 500;
+ }
+}
+
.git-clone-holder {
.project-home-dropdown + & {
margin-right: 45px;
@@ -159,6 +165,7 @@ ul.nav.nav-projects-tabs {
li {
.project-info {
margin-bottom: 10px;
+ overflow: hidden;
}
.access-icon {
@@ -195,8 +202,8 @@ ul.nav.nav-projects-tabs {
white-space: normal;
text-align: left;
padding: 10px 15px;
- background-color: #F1f1f1;
- border-color: #EEE;
+ background-color: #F9F9F9;
+ border-color: #DDD;
&:hover {
background-color: #eee;
diff --git a/app/assets/stylesheets/sections/search.scss b/app/assets/stylesheets/sections/search.scss
new file mode 100644
index 00000000000..bdaa17ac339
--- /dev/null
+++ b/app/assets/stylesheets/sections/search.scss
@@ -0,0 +1,7 @@
+.search-results {
+ .search-result-row {
+ border-bottom: 1px solid #EEE;
+ padding-bottom: 10px;
+ margin-bottom: 10px;
+ }
+}
diff --git a/app/controllers/admin/groups_controller.rb b/app/controllers/admin/groups_controller.rb
index 0388997ec69..e6d0c9323c1 100644
--- a/app/controllers/admin/groups_controller.rb
+++ b/app/controllers/admin/groups_controller.rb
@@ -8,7 +8,7 @@ class Admin::GroupsController < Admin::ApplicationController
end
def show
- @members = @group.members.order("group_access DESC").page(params[:members_page]).per(30)
+ @members = @group.members.order("access_level DESC").page(params[:members_page]).per(30)
@projects = @group.projects.page(params[:projects_page]).per(30)
end
@@ -40,7 +40,7 @@ class Admin::GroupsController < Admin::ApplicationController
end
def project_teams_update
- @group.add_users(params[:user_ids].split(','), params[:group_access])
+ @group.add_users(params[:user_ids].split(','), params[:access_level])
redirect_to [:admin, @group], notice: 'Users were successfully added.'
end
diff --git a/app/controllers/admin/projects_controller.rb b/app/controllers/admin/projects_controller.rb
index 1c7c09d0cd4..2f0d344802f 100644
--- a/app/controllers/admin/projects_controller.rb
+++ b/app/controllers/admin/projects_controller.rb
@@ -16,10 +16,10 @@ class Admin::ProjectsController < Admin::ApplicationController
def show
if @group
- @group_members = @group.members.order("group_access DESC").page(params[:group_members_page]).per(30)
+ @group_members = @group.members.order("access_level DESC").page(params[:group_members_page]).per(30)
end
- @project_members = @project.users_projects.page(params[:project_members_page]).per(30)
+ @project_members = @project.project_members.page(params[:project_members_page]).per(30)
end
def transfer
diff --git a/app/controllers/users_groups_controller.rb b/app/controllers/groups/group_members_controller.rb
index a35a12a866b..63c05d4f33b 100644
--- a/app/controllers/users_groups_controller.rb
+++ b/app/controllers/groups/group_members_controller.rb
@@ -1,4 +1,4 @@
-class UsersGroupsController < ApplicationController
+class Groups::GroupMembersController < ApplicationController
before_filter :group
# Authorize
@@ -7,18 +7,18 @@ class UsersGroupsController < ApplicationController
layout 'group'
def create
- @group.add_users(params[:user_ids].split(','), params[:group_access])
+ @group.add_users(params[:user_ids].split(','), params[:access_level])
redirect_to members_group_path(@group), notice: 'Users were successfully added.'
end
def update
- @member = @group.users_groups.find(params[:id])
+ @member = @group.group_members.find(params[:id])
@member.update_attributes(member_params)
end
def destroy
- @users_group = @group.users_groups.find(params[:id])
+ @users_group = @group.group_members.find(params[:id])
if can?(current_user, :destroy, @users_group) # May fail if last owner.
@users_group.destroy
respond_to do |format|
@@ -43,6 +43,6 @@ class UsersGroupsController < ApplicationController
end
def member_params
- params.require(:users_group).permit(:group_access, :user_id)
+ params.require(:group_member).permit(:access_level, :user_id)
end
end
diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rb
index ddde90d3ee0..36222758eb2 100644
--- a/app/controllers/groups_controller.rb
+++ b/app/controllers/groups_controller.rb
@@ -65,15 +65,15 @@ class GroupsController < ApplicationController
def members
@project = group.projects.find(params[:project_id]) if params[:project_id]
- @members = group.users_groups
+ @members = group.group_members
if params[:search].present?
users = group.users.search(params[:search]).to_a
@members = @members.where(user_id: users)
end
- @members = @members.order('group_access DESC').page(params[:page]).per(50)
- @users_group = UsersGroup.new
+ @members = @members.order('access_level DESC').page(params[:page]).per(50)
+ @users_group = GroupMember.new
end
def edit
diff --git a/app/controllers/profiles/groups_controller.rb b/app/controllers/profiles/groups_controller.rb
index 9a4d088651e..ce9dd50df67 100644
--- a/app/controllers/profiles/groups_controller.rb
+++ b/app/controllers/profiles/groups_controller.rb
@@ -2,11 +2,11 @@ class Profiles::GroupsController < ApplicationController
layout "profile"
def index
- @user_groups = current_user.users_groups.page(params[:page]).per(20)
+ @user_groups = current_user.group_members.page(params[:page]).per(20)
end
def leave
- @users_group = group.users_groups.where(user_id: current_user.id).first
+ @users_group = group.group_members.where(user_id: current_user.id).first
if can?(current_user, :destroy, @users_group)
@users_group.destroy
redirect_to(profile_groups_path, info: "You left #{group.name} group.")
diff --git a/app/controllers/profiles/notifications_controller.rb b/app/controllers/profiles/notifications_controller.rb
index 5c492aeb49d..638d1f9789b 100644
--- a/app/controllers/profiles/notifications_controller.rb
+++ b/app/controllers/profiles/notifications_controller.rb
@@ -3,8 +3,8 @@ class Profiles::NotificationsController < ApplicationController
def show
@notification = current_user.notification
- @users_projects = current_user.users_projects
- @users_groups = current_user.users_groups
+ @project_members = current_user.project_members
+ @group_members = current_user.group_members
end
def update
@@ -14,13 +14,13 @@ class Profiles::NotificationsController < ApplicationController
current_user.notification_level = params[:notification_level]
current_user.save
elsif type == 'group'
- users_group = current_user.users_groups.find(params[:notification_id])
+ users_group = current_user.group_members.find(params[:notification_id])
users_group.notification_level = params[:notification_level]
users_group.save
else
- users_project = current_user.users_projects.find(params[:notification_id])
- users_project.notification_level = params[:notification_level]
- users_project.save
+ project_member = current_user.project_members.find(params[:notification_id])
+ project_member.notification_level = params[:notification_level]
+ project_member.save
end
end
end
diff --git a/app/controllers/projects/branches_controller.rb b/app/controllers/projects/branches_controller.rb
index 3c8e7ec73f6..faa0ce67ca8 100644
--- a/app/controllers/projects/branches_controller.rb
+++ b/app/controllers/projects/branches_controller.rb
@@ -17,13 +17,19 @@ class Projects::BranchesController < Projects::ApplicationController
end
def create
- @branch = CreateBranchService.new.execute(project, params[:branch_name], params[:ref], current_user)
-
- redirect_to project_tree_path(@project, @branch.name)
+ result = CreateBranchService.new(project, current_user).
+ execute(params[:branch_name], params[:ref])
+ if result[:status] == :success
+ @branch = result[:branch]
+ redirect_to project_tree_path(@project, @branch.name)
+ else
+ @error = result[:message]
+ render action: 'new'
+ end
end
def destroy
- DeleteBranchService.new.execute(project, params[:id], current_user)
+ DeleteBranchService.new(project, current_user).execute(params[:id])
@branch_name = params[:id]
respond_to do |format|
diff --git a/app/controllers/projects/commit_controller.rb b/app/controllers/projects/commit_controller.rb
index c344297ba8a..34bd682bd90 100644
--- a/app/controllers/projects/commit_controller.rb
+++ b/app/controllers/projects/commit_controller.rb
@@ -19,13 +19,7 @@ class Projects::CommitController < Projects::ApplicationController
[]
end
- begin
- @diffs = @commit.diffs
- rescue Grit::Git::GitTimeout
- @diffs = []
- @diff_timeout = true
- end
-
+ @diffs = @commit.diffs
@note = project.build_commit_note(commit)
@notes_count = project.notes.for_commit_id(commit.id).count
@notes = project.notes.for_commit_id(@commit.id).not_inline.fresh
diff --git a/app/controllers/projects/edit_tree_controller.rb b/app/controllers/projects/edit_tree_controller.rb
index ca83b21f429..8976d7c7be8 100644
--- a/app/controllers/projects/edit_tree_controller.rb
+++ b/app/controllers/projects/edit_tree_controller.rb
@@ -10,7 +10,8 @@ class Projects::EditTreeController < Projects::BaseTreeController
end
def update
- result = Files::UpdateService.new(@project, current_user, params, @ref, @path).execute
+ result = Files::UpdateService.
+ new(@project, current_user, params, @ref, @path).execute
if result[:status] == :success
flash[:notice] = "Your changes have been successfully committed"
@@ -31,7 +32,7 @@ class Projects::EditTreeController < Projects::BaseTreeController
diffy = Diffy::Diff.new(@blob.data, @content, diff: '-U 3',
include_diff_info: true)
- @diff = Gitlab::DiffParser.new(diffy.diff.scan(/.*\n/))
+ @diff_lines = Gitlab::Diff::Parser.new.parse(diffy.diff.scan(/.*\n/))
render layout: false
end
diff --git a/app/controllers/projects/graphs_controller.rb b/app/controllers/projects/graphs_controller.rb
index 252d47d939e..610b4967fea 100644
--- a/app/controllers/projects/graphs_controller.rb
+++ b/app/controllers/projects/graphs_controller.rb
@@ -7,19 +7,34 @@ class Projects::GraphsController < Projects::ApplicationController
def show
respond_to do |format|
format.html
- format.js do
+ format.json do
fetch_graph
end
end
end
+ def commits
+ @commits = @project.repository.commits(nil, nil, 2000, 0, true)
+ @commits_graph = Gitlab::Graphs::Commits.new(@commits)
+ @commits_per_week_days = @commits_graph.commits_per_week_days
+ @commits_per_time = @commits_graph.commits_per_time
+ @commits_per_month = @commits_graph.commits_per_month
+ end
+
private
def fetch_graph
- @log = @project.repository.graph_log.to_json
- @success = true
- rescue => ex
+ @commits = @project.repository.commits(nil, nil, 6000, 0, true)
@log = []
- @success = false
+
+ @commits.each do |commit|
+ @log << {
+ author_name: commit.author_name.force_encoding('UTF-8'),
+ author_email: commit.author_email.force_encoding('UTF-8'),
+ date: commit.committed_date.strftime("%Y-%m-%d")
+ }
+ end
+
+ render json: @log.to_json
end
end
diff --git a/app/controllers/projects/issues_controller.rb b/app/controllers/projects/issues_controller.rb
index bde90466ea1..9e7a55b23fd 100644
--- a/app/controllers/projects/issues_controller.rb
+++ b/app/controllers/projects/issues_controller.rb
@@ -20,7 +20,7 @@ class Projects::IssuesController < Projects::ApplicationController
terms = params['issue_search']
@issues = issues_filtered
- @issues = @issues.where("title LIKE ? OR description LIKE ?", "%#{terms}%", "%#{terms}%") if terms.present?
+ @issues = @issues.full_search(terms) if terms.present?
@issues = @issues.page(params[:page]).per(20)
assignee_id, milestone_id = params[:assignee_id], params[:milestone_id]
@@ -28,7 +28,7 @@ class Projects::IssuesController < Projects::ApplicationController
@milestone = @project.milestones.find(milestone_id) if milestone_id.present? && !milestone_id.to_i.zero?
sort_param = params[:sort] || 'newest'
@sort = sort_param.humanize unless sort_param.empty?
- @assignees = User.where(id: @project.issues.pluck(:assignee_id))
+ @assignees = User.where(id: @project.issues.pluck(:assignee_id)).active
respond_to do |format|
format.html
diff --git a/app/controllers/projects/labels_controller.rb b/app/controllers/projects/labels_controller.rb
index 87d1c942034..6c7bde9c5d5 100644
--- a/app/controllers/projects/labels_controller.rb
+++ b/app/controllers/projects/labels_controller.rb
@@ -52,7 +52,7 @@ class Projects::LabelsController < Projects::ApplicationController
respond_to do |format|
format.html { redirect_to project_labels_path(@project), notice: 'Label was removed' }
- format.js { render nothing: true }
+ format.js
end
end
diff --git a/app/controllers/projects/new_tree_controller.rb b/app/controllers/projects/new_tree_controller.rb
index 3a51a78ef6f..71a5c6499ec 100644
--- a/app/controllers/projects/new_tree_controller.rb
+++ b/app/controllers/projects/new_tree_controller.rb
@@ -13,7 +13,7 @@ class Projects::NewTreeController < Projects::BaseTreeController
flash[:notice] = "Your changes have been successfully committed"
redirect_to project_blob_path(@project, File.join(@ref, file_path))
else
- flash[:alert] = result[:error]
+ flash[:alert] = result[:message]
render :show
end
end
diff --git a/app/controllers/projects/notes_controller.rb b/app/controllers/projects/notes_controller.rb
index 2154b6ed2eb..7b08b79d236 100644
--- a/app/controllers/projects/notes_controller.rb
+++ b/app/controllers/projects/notes_controller.rb
@@ -30,8 +30,10 @@ class Projects::NotesController < Projects::ApplicationController
end
def update
- note.update_attributes(note_params)
- note.reset_events_cache
+ if note.editable?
+ note.update_attributes(note_params)
+ note.reset_events_cache
+ end
respond_to do |format|
format.json { render_note_json(note) }
@@ -40,8 +42,10 @@ class Projects::NotesController < Projects::ApplicationController
end
def destroy
- note.destroy
- note.reset_events_cache
+ if note.editable?
+ note.destroy
+ note.reset_events_cache
+ end
respond_to do |format|
format.js { render nothing: true }
diff --git a/app/controllers/projects/raw_controller.rb b/app/controllers/projects/raw_controller.rb
index a6b7ae3f127..5ec9c576a66 100644
--- a/app/controllers/projects/raw_controller.rb
+++ b/app/controllers/projects/raw_controller.rb
@@ -29,12 +29,10 @@ class Projects::RawController < Projects::ApplicationController
private
def get_blob_type
- if @blob.mime_type =~ /html|javascript/
+ if @blob.text?
'text/plain; charset=utf-8'
- elsif @blob.name =~ /(?:msi|exe|rar|r0\d|7z|7zip|zip)$/
- 'application/octet-stream'
else
- @blob.mime_type
+ 'application/octet-stream'
end
end
end
diff --git a/app/controllers/projects/repositories_controller.rb b/app/controllers/projects/repositories_controller.rb
index f30eaadd928..4e0f190ed1c 100644
--- a/app/controllers/projects/repositories_controller.rb
+++ b/app/controllers/projects/repositories_controller.rb
@@ -4,11 +4,6 @@ class Projects::RepositoriesController < Projects::ApplicationController
before_filter :authorize_code_access!
before_filter :require_non_empty_project
- def stats
- @stats = Gitlab::Git::Stats.new(@repository.raw, @repository.root_ref)
- @graph = @stats.graph
- end
-
def archive
unless can?(current_user, :download_code, @project)
render_404 and return
diff --git a/app/controllers/projects/tags_controller.rb b/app/controllers/projects/tags_controller.rb
index e03a9f4d66d..537c94bda20 100644
--- a/app/controllers/projects/tags_controller.rb
+++ b/app/controllers/projects/tags_controller.rb
@@ -13,10 +13,15 @@ class Projects::TagsController < Projects::ApplicationController
end
def create
- @tag = CreateTagService.new.execute(@project, params[:tag_name],
- params[:ref], current_user)
-
- redirect_to project_tags_path(@project)
+ result = CreateTagService.new(@project, current_user).
+ execute(params[:tag_name], params[:ref], params[:message])
+ if result[:status] == :success
+ @tag = result[:tag]
+ redirect_to project_tags_path(@project)
+ else
+ @error = result[:message]
+ render action: 'new'
+ end
end
def destroy
@@ -28,7 +33,7 @@ class Projects::TagsController < Projects::ApplicationController
respond_to do |format|
format.html { redirect_to project_tags_path }
- format.js { render nothing: true }
+ format.js
end
end
end
diff --git a/app/controllers/projects/team_members_controller.rb b/app/controllers/projects/team_members_controller.rb
index 1de5bac9ee8..7bb799eba64 100644
--- a/app/controllers/projects/team_members_controller.rb
+++ b/app/controllers/projects/team_members_controller.rb
@@ -6,17 +6,17 @@ class Projects::TeamMembersController < Projects::ApplicationController
def index
@group = @project.group
- @users_projects = @project.users_projects.order('project_access DESC')
+ @project_members = @project.project_members.order('access_level DESC')
end
def new
- @user_project_relation = project.users_projects.new
+ @user_project_relation = project.project_members.new
end
def create
users = User.where(id: params[:user_ids].split(','))
- @project.team << [users, params[:project_access]]
+ @project.team << [users, params[:access_level]]
if params[:redirect_to]
redirect_to params[:redirect_to]
@@ -26,7 +26,7 @@ class Projects::TeamMembersController < Projects::ApplicationController
end
def update
- @user_project_relation = project.users_projects.find_by(user_id: member)
+ @user_project_relation = project.project_members.find_by(user_id: member)
@user_project_relation.update_attributes(member_params)
unless @user_project_relation.valid?
@@ -36,7 +36,7 @@ class Projects::TeamMembersController < Projects::ApplicationController
end
def destroy
- @user_project_relation = project.users_projects.find_by(user_id: member)
+ @user_project_relation = project.project_members.find_by(user_id: member)
@user_project_relation.destroy
respond_to do |format|
@@ -46,7 +46,7 @@ class Projects::TeamMembersController < Projects::ApplicationController
end
def leave
- project.users_projects.find_by(user_id: current_user).destroy
+ project.project_members.find_by(user_id: current_user).destroy
respond_to do |format|
format.html { redirect_to :back }
@@ -69,6 +69,6 @@ class Projects::TeamMembersController < Projects::ApplicationController
end
def member_params
- params.require(:team_member).permit(:user_id, :project_access)
+ params.require(:project_member).permit(:user_id, :access_level)
end
end
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index f23afaf28fa..b3380a6ff23 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -103,7 +103,15 @@ class ProjectsController < ApplicationController
::Projects::DestroyService.new(@project, current_user, {}).execute
respond_to do |format|
- format.html { redirect_to root_path }
+ format.html do
+ flash[:alert] = "Project deleted."
+
+ if request.referer.include?("/admin")
+ redirect_to admin_projects_path
+ else
+ redirect_to projects_dashboard_path
+ end
+ end
end
end
diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb
index 8df84e9884a..55926a1ed22 100644
--- a/app/controllers/search_controller.rb
+++ b/app/controllers/search_controller.rb
@@ -4,14 +4,33 @@ class SearchController < ApplicationController
def show
@project = Project.find_by(id: params[:project_id]) if params[:project_id].present?
@group = Group.find_by(id: params[:group_id]) if params[:group_id].present?
+ @scope = params[:scope]
+ @show_snippets = params[:snippets].eql? 'true'
- if @project
- return access_denied! unless can?(current_user, :download_code, @project)
+ @search_results = if @project
+ return access_denied! unless can?(current_user, :download_code, @project)
- @search_results = Search::ProjectService.new(@project, current_user, params).execute
- else
- @search_results = Search::GlobalService.new(current_user, params).execute
- end
+ unless %w(blobs notes issues merge_requests wiki_blobs).
+ include?(@scope)
+ @scope = 'blobs'
+ end
+
+ Search::ProjectService.new(@project, current_user, params).execute
+ elsif @show_snippets
+ unless %w(snippet_blobs snippet_titles).include?(@scope)
+ @scope = 'snippet_blobs'
+ end
+
+ Search::SnippetService.new(current_user, params).execute
+ else
+ unless %w(projects issues merge_requests).include?(@scope)
+ @scope = 'projects'
+ end
+
+ Search::GlobalService.new(current_user, params).execute
+ end
+
+ @objects = @search_results.objects(@scope, params[:page])
end
def autocomplete
diff --git a/app/finders/base_finder.rb b/app/finders/issuable_finder.rb
index ec5f5919d7e..56c4f22120d 100644
--- a/app/finders/base_finder.rb
+++ b/app/finders/issuable_finder.rb
@@ -1,4 +1,4 @@
-# BaseFinder
+# IssuableFinder
#
# Used to filter Issues and MergeRequests collections by set of params
#
@@ -16,7 +16,9 @@
# label_name: string
# sort: string
#
-class BaseFinder
+require_relative 'projects_finder'
+
+class IssuableFinder
attr_accessor :current_user, :params
def execute(current_user, params)
diff --git a/app/finders/issues_finder.rb b/app/finders/issues_finder.rb
index 8e0c606249e..20a2b0ce8f0 100644
--- a/app/finders/issues_finder.rb
+++ b/app/finders/issues_finder.rb
@@ -15,7 +15,7 @@
# label_name: string
# sort: string
#
-class IssuesFinder < BaseFinder
+class IssuesFinder < IssuableFinder
def klass
Issue
end
diff --git a/app/finders/merge_requests_finder.rb b/app/finders/merge_requests_finder.rb
index 3727149c8fb..b258216d0d4 100644
--- a/app/finders/merge_requests_finder.rb
+++ b/app/finders/merge_requests_finder.rb
@@ -15,7 +15,7 @@
# label_name: string
# sort: string
#
-class MergeRequestsFinder < BaseFinder
+class MergeRequestsFinder < IssuableFinder
def klass
MergeRequest
end
diff --git a/app/finders/projects_finder.rb b/app/finders/projects_finder.rb
index 26898bad493..c81bb51583a 100644
--- a/app/finders/projects_finder.rb
+++ b/app/finders/projects_finder.rb
@@ -19,10 +19,8 @@ class ProjectsFinder
# Return ALL group projects
group.projects
else
- projects_members = UsersProject.where(
- project_id: group.projects,
- user_id: current_user
- )
+ projects_members = ProjectMember.in_projects(group.projects).
+ with_user(current_user)
if projects_members.any?
# User is a project member
@@ -34,7 +32,7 @@ class ProjectsFinder
#
group.projects.where(
"projects.id IN (?) OR projects.visibility_level IN (?)",
- projects_members.pluck(:project_id),
+ projects_members.pluck(:source_id),
Project.public_and_internal_levels
)
else
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index e6d50bea4d1..07938b8065d 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -178,6 +178,8 @@ module ApplicationHelper
def search_placeholder
if @project && @project.persisted?
"Search in this project"
+ elsif @snippet || @snippets || @show_snippets
+ 'Search snippets'
elsif @group && @group.persisted?
"Search in this group"
else
@@ -185,13 +187,6 @@ module ApplicationHelper
end
end
- def first_line(str)
- lines = str.split("\n")
- line = lines.first
- line += "..." if lines.size > 1
- line
- end
-
def broadcast_message
BroadcastMessage.current
end
diff --git a/app/helpers/commits_helper.rb b/app/helpers/commits_helper.rb
index f61aa259154..cab2984a4c4 100644
--- a/app/helpers/commits_helper.rb
+++ b/app/helpers/commits_helper.rb
@@ -16,38 +16,6 @@ module CommitsHelper
commit_person_link(commit, options.merge(source: :committer))
end
- def each_diff_line(diff, index)
- Gitlab::DiffParser.new(diff.diff.lines.to_a, diff.new_path)
- .each do |full_line, type, line_code, line_new, line_old|
- yield(full_line, type, line_code, line_new, line_old)
- end
- end
-
- def each_diff_line_near(diff, index, expected_line_code)
- max_number_of_lines = 16
-
- prev_match_line = nil
- prev_lines = []
-
- each_diff_line(diff, index) do |full_line, type, line_code, line_new, line_old|
- line = [full_line, type, line_code, line_new, line_old]
- if line_code != expected_line_code
- if type == "match"
- prev_lines.clear
- prev_match_line = line
- else
- prev_lines.push(line)
- prev_lines.shift if prev_lines.length >= max_number_of_lines
- end
- else
- yield(prev_match_line) if !prev_match_line.nil?
- prev_lines.each { |ln| yield(ln) }
- yield(line)
- break
- end
- end
- end
-
def image_diff_class(diff)
if diff.deleted_file
"deleted"
@@ -63,14 +31,6 @@ module CommitsHelper
escape_javascript(render "projects/commits/#{template}", commit: commit, project: project) unless commit.nil?
end
- def diff_line_content(line)
- if line.blank?
- " &nbsp;"
- else
- line
- end
- end
-
# Breadcrumb links for a Project and, if applicable, a tree path
def commits_breadcrumbs
return unless @project && @ref
@@ -105,82 +65,6 @@ module CommitsHelper
branches.sort.map { |branch| link_to(branch, project_tree_path(project, branch)) }.join(", ").html_safe
end
- def parallel_diff_lines(project, commit, diff, file)
- old_file = project.repository.blob_at(commit.parent_id, diff.old_path) if commit.parent_id
- deleted_lines = {}
- added_lines = {}
- each_diff_line(diff, 0) do |line, type, line_code, line_new, line_old|
- if type == "old"
- deleted_lines[line_old] = { line_code: line_code, type: type, line: line }
- elsif type == "new"
- added_lines[line_new] = { line_code: line_code, type: type, line: line }
- end
- end
- max_length = old_file ? [old_file.loc, file.loc].max : file.loc
-
- offset1 = 0
- offset2 = 0
- old_lines = []
- new_lines = []
-
- max_length.times do |line_index|
- line_index1 = line_index - offset1
- line_index2 = line_index - offset2
- deleted_line = deleted_lines[line_index1 + 1]
- added_line = added_lines[line_index2 + 1]
- old_line = old_file.lines[line_index1] if old_file
- new_line = file.lines[line_index2]
-
- if deleted_line && added_line
- elsif deleted_line
- new_line = nil
- offset2 += 1
- elsif added_line
- old_line = nil
- offset1 += 1
- end
-
- old_lines[line_index] = DiffLine.new
- new_lines[line_index] = DiffLine.new
-
- # old
- if line_index == 0 && diff.new_file
- old_lines[line_index].type = :file_created
- old_lines[line_index].content = 'File was created'
- elsif deleted_line
- old_lines[line_index].type = :deleted
- old_lines[line_index].content = old_line
- old_lines[line_index].num = line_index1 + 1
- old_lines[line_index].code = deleted_line[:line_code]
- elsif old_line
- old_lines[line_index].type = :no_change
- old_lines[line_index].content = old_line
- old_lines[line_index].num = line_index1 + 1
- else
- old_lines[line_index].type = :added
- end
-
- # new
- if line_index == 0 && diff.deleted_file
- new_lines[line_index].type = :file_deleted
- new_lines[line_index].content = "File was deleted"
- elsif added_line
- new_lines[line_index].type = :added
- new_lines[line_index].num = line_index2 + 1
- new_lines[line_index].content = new_line
- new_lines[line_index].code = added_line[:line_code]
- elsif new_line
- new_lines[line_index].type = :no_change
- new_lines[line_index].num = line_index2 + 1
- new_lines[line_index].content = new_line
- else
- new_lines[line_index].type = :deleted
- end
- end
-
- 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)
@@ -229,14 +113,6 @@ module CommitsHelper
end
end
- def diff_file_mode_changed?(diff)
- diff.a_mode && diff.b_mode && diff.a_mode != diff.b_mode
- end
-
- def unfold_bottom_class(bottom)
- (bottom) ? 'js-unfold-bottom' : ''
- end
-
def view_file_btn(commit_sha, diff, project)
link_to project_blob_path(project, tree_join(commit_sha, diff.new_path)),
class: 'btn btn-small view-file js-view-file' do
diff --git a/app/helpers/diff_helper.rb b/app/helpers/diff_helper.rb
index ee4d4fbdff5..cb50d89cba8 100644
--- a/app/helpers/diff_helper.rb
+++ b/app/helpers/diff_helper.rb
@@ -1,14 +1,20 @@
module DiffHelper
- def safe_diff_files(diffs)
+ def allowed_diff_size
if diff_hard_limit_enabled?
- diffs.first(Commit::DIFF_HARD_LIMIT_FILES)
+ Commit::DIFF_HARD_LIMIT_FILES
else
- diffs.first(Commit::DIFF_SAFE_FILES)
+ Commit::DIFF_SAFE_FILES
+ end
+ end
+
+ def safe_diff_files(diffs)
+ diffs.first(allowed_diff_size).map do |diff|
+ Gitlab::Diff::File.new(diff)
end
end
- def show_diff_size_warninig?(diffs)
- safe_diff_files(diffs).size < diffs.size
+ def show_diff_size_warning?(diffs)
+ diffs.size > allowed_diff_size
end
def diff_hard_limit_enabled?
@@ -19,4 +25,96 @@ module DiffHelper
false
end
end
+
+ def generate_line_code(file_path, line)
+ Gitlab::Diff::LineCode.generate(file_path, line.new_pos, line.old_pos)
+ end
+
+ def parallel_diff(diff_file, index)
+ lines = []
+ skip_next = false
+
+ # Building array of lines
+ #
+ # [
+ # left_type, left_line_number, left_line_content, left_line_code,
+ # right_line_type, right_line_number, right_line_content, right_line_code
+ # ]
+ #
+ diff_file.diff_lines.each do |line|
+
+ full_line = line.text
+ type = line.type
+ line_code = generate_line_code(diff_file.file_path, line)
+ line_new = line.new_pos
+ line_old = line.old_pos
+
+ next_line = diff_file.next_line(line.index)
+
+ if next_line
+ next_line_code = generate_line_code(diff_file.file_path, next_line)
+ next_type = next_line.type
+ next_line = next_line.text
+ end
+
+ if type == 'match' || type.nil?
+ # line in the right panel is the same as in the left one
+ line = [type, line_old, full_line, line_code, type, line_new, full_line, line_code]
+ lines.push(line)
+ elsif type == 'old'
+ if next_type == 'new'
+ # Left side has text removed, right side has text added
+ line = [type, line_old, full_line, line_code, next_type, line_new, next_line, next_line_code]
+ lines.push(line)
+ skip_next = true
+ elsif next_type == 'old' || next_type.nil?
+ # Left side has text removed, right side doesn't have any change
+ # No next line code, no new line number, no new line text
+ line = [type, line_old, full_line, line_code, next_type, nil, "&nbsp;", nil]
+ lines.push(line)
+ end
+ elsif type == 'new'
+ if skip_next
+ # Change has been already included in previous line so no need to do it again
+ skip_next = false
+ next
+ else
+ # Change is only on the right side, left side has no change
+ line = [nil, nil, "&nbsp;", line_code, type, line_new, full_line, line_code]
+ lines.push(line)
+ end
+ end
+ end
+ lines
+ end
+
+ def unfold_bottom_class(bottom)
+ (bottom) ? 'js-unfold-bottom' : ''
+ end
+
+ def diff_line_content(line)
+ if line.blank?
+ " &nbsp;"
+ else
+ line
+ end
+ end
+
+ def line_comments
+ @line_comments ||= @line_notes.group_by(&:line_code)
+ end
+
+ def organize_comments(type_left, type_right, line_code_left, line_code_right)
+ comments_left = comments_right = nil
+
+ unless type_left.nil? && type_right == 'new'
+ comments_left = line_comments[line_code_left]
+ end
+
+ unless type_left.nil? && type_right.nil?
+ comments_right = line_comments[line_code_right]
+ end
+
+ [comments_left, comments_right]
+ end
end
diff --git a/app/helpers/events_helper.rb b/app/helpers/events_helper.rb
index c7e8fdad7a0..6f738764b0e 100644
--- a/app/helpers/events_helper.rb
+++ b/app/helpers/events_helper.rb
@@ -52,6 +52,8 @@ module EventsHelper
"#{event.author_name} #{event.push_action_name} #{event.ref_type} #{event.ref_name} at #{event.project_name}"
elsif event.membership_changed?
"#{event.author_name} #{event.action_name} #{event.project_name}"
+ elsif event.note? && event.note_commit?
+ "#{event.author_name} commented on #{event.note_target_type} #{event.note_short_commit_id} at #{event.project_name}"
elsif event.note?
"#{event.author_name} commented on #{event.note_target_type} ##{truncate event.note_target_iid} at #{event.project_name}"
else
@@ -64,6 +66,8 @@ 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? && event.note_commit?
+ project_commit_url(event.project, event.note_target)
elsif event.note?
if event.note_target
if event.note_commit?
@@ -94,6 +98,8 @@ module EventsHelper
render "events/event_push", event: event
elsif event.merge_request?
render "events/event_merge_request", merge_request: event.merge_request
+ elsif event.push?
+ render "events/event_push", event: event
elsif event.note?
render "events/event_note", note: event.note
end
@@ -130,7 +136,7 @@ module EventsHelper
end
def event_note(text)
- text = first_line(text)
+ text = first_line_in_markdown(text)
text = truncate(text, length: 150)
sanitize(markdown(text), tags: %w(a img b pre p))
end
diff --git a/app/helpers/gitlab_markdown_helper.rb b/app/helpers/gitlab_markdown_helper.rb
index e4aa90154fb..0365681a128 100644
--- a/app/helpers/gitlab_markdown_helper.rb
+++ b/app/helpers/gitlab_markdown_helper.rb
@@ -51,6 +51,14 @@ module GitlabMarkdownHelper
@markdown.render(text).html_safe
end
+ def first_line_in_markdown(text)
+ line = text.split("\n").detect do |i|
+ i.present? && markdown(i).present?
+ end
+ line += '...' unless line.nil?
+ line
+ end
+
def render_wiki_content(wiki_page)
if wiki_page.format == :markdown
markdown(wiki_page.content)
@@ -65,7 +73,12 @@ module GitlabMarkdownHelper
paths.uniq.each do |file_path|
# If project does not have repository
# its nothing to rebuild
- if @repository.exists? && !@repository.empty?
+ #
+ # TODO: pass project variable to markdown helper instead of using
+ # instance variable. Right now it generates invalid path for pages out
+ # of project scope. Example: search results where can be rendered markdown
+ # from different projects
+ if @repository && @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
diff --git a/app/helpers/notes_helper.rb b/app/helpers/notes_helper.rb
index 53ac5febd61..15d4b875c4c 100644
--- a/app/helpers/notes_helper.rb
+++ b/app/helpers/notes_helper.rb
@@ -52,8 +52,8 @@ module NotesHelper
discussion_id: discussion_id
}
- link_to "", "javascript:;", class: "add-diff-note js-add-diff-note-button",
- data: data, title: "Add a comment to this line"
+ button_tag '', class: 'btn add-diff-note js-add-diff-note-button',
+ data: data, title: 'Add a comment to this line'
end
def link_to_reply_diff(note)
@@ -67,11 +67,10 @@ module NotesHelper
discussion_id: note.discussion_id
}
- link_to "javascript:;", class: "btn reply-btn js-discussion-reply-button",
- data: data, title: "Add a reply" do
- link_text = ""
- link_text < content_tag(:i, nil, class: 'icon-comment')
- link_text << "Reply"
- end
+ button_tag class: 'btn reply-btn js-discussion-reply-button',
+ data: data, title: 'Add a reply' do
+ link_text = content_tag(:i, nil, class: 'icon-comment')
+ link_text << ' Reply'
+ end
end
end
diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb
index 8350f5dc072..f7da30bcc4b 100644
--- a/app/helpers/projects_helper.rb
+++ b/app/helpers/projects_helper.rb
@@ -123,7 +123,7 @@ module ProjectsHelper
end
def link_to_toggle_star(title, starred, signed_in)
- cls = 'btn btn-block'
+ cls = 'star-btn'
cls += ' disabled' unless signed_in
toggle_html = content_tag('span', class: 'toggle') do
@@ -151,11 +151,19 @@ module ProjectsHelper
content_tag 'span', class: starred ? 'turn-on' : 'turn-off' do
link_to toggle_star_project_path(@project), link_opts do
- toggle_html + count_html
+ toggle_html + ' ' + count_html
end
end
end
+ def link_to_toggle_fork
+ out = content_tag(:i, '', class: 'icon-code-fork')
+ out << ' Fork'
+ out << content_tag(:span, class: 'count') do
+ @project.forks_count.to_s
+ end
+ end
+
private
def get_project_nav_tabs(project, current_user)
@@ -261,4 +269,10 @@ module ProjectsHelper
project_blob_path(project, tree_join(project.default_branch, project.repository.contribution_guide.name))
end
end
+
+ def hidden_pass_url(original_url)
+ result = URI(original_url)
+ result.password = '*****' if result.password.present?
+ result
+ end
end
diff --git a/app/helpers/search_helper.rb b/app/helpers/search_helper.rb
index ecd8d3994d0..65b9408cfa1 100644
--- a/app/helpers/search_helper.rb
+++ b/app/helpers/search_helper.rb
@@ -80,7 +80,8 @@ module SearchHelper
# Autocomplete results for the current user's projects
def projects_autocomplete(term, limit = 5)
- ProjectsFinder.new.execute(current_user).search_by_title(term).non_archived.limit(limit).map do |p|
+ ProjectsFinder.new.execute(current_user).search_by_title(term).
+ sorted_by_stars.non_archived.limit(limit).map do |p|
{
label: "project: #{search_result_sanitize(p.name_with_namespace)}",
url: project_path(p)
@@ -91,4 +92,21 @@ module SearchHelper
def search_result_sanitize(str)
Sanitize.clean(str)
end
+
+ def search_filter_path(options={})
+ exist_opts = {
+ search: params[:search],
+ project_id: params[:project_id],
+ group_id: params[:group_id],
+ scope: params[:scope]
+ }
+
+ options = exist_opts.merge(options)
+ search_path(options)
+ end
+
+ # Sanitize html generated after parsing markdown from issue description or comment
+ def search_md_sanitize(html)
+ sanitize(html, tags: %w(a p ol ul li pre code))
+ end
end
diff --git a/app/mailers/emails/groups.rb b/app/mailers/emails/groups.rb
index 1654fc55bca..8c09389985e 100644
--- a/app/mailers/emails/groups.rb
+++ b/app/mailers/emails/groups.rb
@@ -1,7 +1,7 @@
module Emails
module Groups
def group_access_granted_email(user_group_id)
- @membership = UsersGroup.find(user_group_id)
+ @membership = GroupMember.find(user_group_id)
@group = @membership.group
@target_url = group_url(@group)
mail(to: @membership.user.email,
diff --git a/app/mailers/emails/projects.rb b/app/mailers/emails/projects.rb
index 6b13a1d746d..d6edfd7059f 100644
--- a/app/mailers/emails/projects.rb
+++ b/app/mailers/emails/projects.rb
@@ -1,10 +1,10 @@
module Emails
module Projects
def project_access_granted_email(user_project_id)
- @users_project = UsersProject.find user_project_id
- @project = @users_project.project
+ @project_member = ProjectMember.find user_project_id
+ @project = @project_member.project
@target_url = project_url(@project)
- mail(to: @users_project.user.email,
+ mail(to: @project_member.user.email,
subject: subject("Access to project was granted"))
end
diff --git a/app/models/ability.rb b/app/models/ability.rb
index f1d57de63bb..716a23a4284 100644
--- a/app/models/ability.rb
+++ b/app/models/ability.rb
@@ -14,7 +14,7 @@ class Ability
when "MergeRequest" then merge_request_abilities(user, subject)
when "Group" then group_abilities(user, subject)
when "Namespace" then namespace_abilities(user, subject)
- when "UsersGroup" then users_group_abilities(user, subject)
+ when "GroupMember" then users_group_abilities(user, subject)
else []
end.concat(global_abilities(user))
end
diff --git a/app/models/commit.rb b/app/models/commit.rb
index ff5392957ce..c8b2e0475ff 100644
--- a/app/models/commit.rb
+++ b/app/models/commit.rb
@@ -108,4 +108,8 @@ class Commit
super
end
+
+ def parents
+ @parents ||= Commit.decorate(super)
+ end
end
diff --git a/app/models/concerns/issuable.rb b/app/models/concerns/issuable.rb
index 5c9b44812be..698b5b8c30a 100644
--- a/app/models/concerns/issuable.rb
+++ b/app/models/concerns/issuable.rb
@@ -49,6 +49,10 @@ module Issuable
where("LOWER(title) like :query", query: "%#{query.downcase}%")
end
+ def full_search(query)
+ where("LOWER(title) like :query OR LOWER(description) like :query", query: "%#{query.downcase}%")
+ end
+
def sort(method)
case method.to_s
when 'newest' then reorder("#{table_name}.created_at DESC")
diff --git a/app/models/concerns/notifiable.rb b/app/models/concerns/notifiable.rb
index 722f375e71d..d7dcd97911d 100644
--- a/app/models/concerns/notifiable.rb
+++ b/app/models/concerns/notifiable.rb
@@ -1,6 +1,6 @@
# == Notifiable concern
#
-# Contains notification functionality shared between UsersProject and UsersGroup
+# Contains notification functionality
#
module Notifiable
extend ActiveSupport::Concern
diff --git a/app/models/group.rb b/app/models/group.rb
index 66239f7fe6f..b8ed3b8ac73 100644
--- a/app/models/group.rb
+++ b/app/models/group.rb
@@ -17,8 +17,8 @@ require 'carrierwave/orm/activerecord'
require 'file_size_validator'
class Group < Namespace
- has_many :users_groups, dependent: :destroy
- has_many :users, through: :users_groups
+ has_many :group_members, dependent: :destroy, as: :source, class_name: 'GroupMember'
+ has_many :users, through: :group_members
validate :avatar_type, if: ->(user) { user.avatar_changed? }
validates :avatar, file_size: { maximum: 100.kilobytes.to_i }
@@ -30,22 +30,22 @@ class Group < Namespace
end
def owners
- @owners ||= users_groups.owners.map(&:user)
+ @owners ||= group_members.owners.map(&:user)
end
- def add_users(user_ids, group_access)
+ def add_users(user_ids, access_level)
user_ids.compact.each do |user_id|
- user = self.users_groups.find_or_initialize_by(user_id: user_id)
- user.update_attributes(group_access: group_access)
+ user = self.group_members.find_or_initialize_by(user_id: user_id)
+ user.update_attributes(access_level: access_level)
end
end
- def add_user(user, group_access)
- self.users_groups.create(user_id: user.id, group_access: group_access)
+ def add_user(user, access_level)
+ self.group_members.create(user_id: user.id, access_level: access_level)
end
def add_owner(user)
- self.add_user(user, UsersGroup::OWNER)
+ self.add_user(user, Gitlab::Access::OWNER)
end
def has_owner?(user)
@@ -61,7 +61,7 @@ class Group < Namespace
end
def members
- users_groups
+ group_members
end
def avatar_type
diff --git a/app/models/project_hook.rb b/app/models/hooks/project_hook.rb
index 21867a9316c..21867a9316c 100644
--- a/app/models/project_hook.rb
+++ b/app/models/hooks/project_hook.rb
diff --git a/app/models/service_hook.rb b/app/models/hooks/service_hook.rb
index 2e11239c40b..2e11239c40b 100644
--- a/app/models/service_hook.rb
+++ b/app/models/hooks/service_hook.rb
diff --git a/app/models/system_hook.rb b/app/models/hooks/system_hook.rb
index ee32b49bc66..ee32b49bc66 100644
--- a/app/models/system_hook.rb
+++ b/app/models/hooks/system_hook.rb
diff --git a/app/models/web_hook.rb b/app/models/hooks/web_hook.rb
index 6cf0c1f683e..752eb8074ac 100644
--- a/app/models/web_hook.rb
+++ b/app/models/hooks/web_hook.rb
@@ -23,7 +23,7 @@ class WebHook < ActiveRecord::Base
default_value_for :merge_requests_events, false
# HTTParty timeout
- default_timeout 10
+ default_timeout Gitlab.config.gitlab.webhook_timeout
validates :url, presence: true,
format: { with: URI::regexp(%w(http https)), message: "should be a valid url" }
diff --git a/app/models/key.rb b/app/models/key.rb
index d59993b1905..095c73d8baf 100644
--- a/app/models/key.rb
+++ b/app/models/key.rb
@@ -29,7 +29,9 @@ class Key < ActiveRecord::Base
after_create :add_to_shell
after_create :notify_user
+ after_create :post_create_hook
after_destroy :remove_from_shell
+ after_destroy :post_destroy_hook
def strip_white_space
self.key = key.strip unless key.blank?
@@ -56,6 +58,10 @@ class Key < ActiveRecord::Base
NotificationService.new.new_key(self)
end
+ def post_create_hook
+ SystemHooksService.new.execute_hooks_for(self, :create)
+ end
+
def remove_from_shell
GitlabShellWorker.perform_async(
:remove_key,
@@ -64,6 +70,10 @@ class Key < ActiveRecord::Base
)
end
+ def post_destroy_hook
+ SystemHooksService.new.execute_hooks_for(self, :destroy)
+ end
+
private
def generate_fingerpint
diff --git a/app/models/member.rb b/app/models/member.rb
new file mode 100644
index 00000000000..7dc13c18bf3
--- /dev/null
+++ b/app/models/member.rb
@@ -0,0 +1,20 @@
+class Member < ActiveRecord::Base
+ include Notifiable
+ include Gitlab::Access
+
+ belongs_to :user
+ belongs_to :source, polymorphic: true
+
+ validates :user, presence: true
+ validates :source, presence: true
+ validates :user_id, uniqueness: { scope: [:source_type, :source_id], message: "already exists in source" }
+ validates :access_level, inclusion: { in: Gitlab::Access.all_values }, presence: true
+
+ scope :guests, -> { where(access_level: GUEST) }
+ scope :reporters, -> { where(access_level: REPORTER) }
+ scope :developers, -> { where(access_level: DEVELOPER) }
+ scope :masters, -> { where(access_level: MASTER) }
+ scope :owners, -> { where(access_level: OWNER) }
+
+ delegate :name, :username, :email, to: :user, prefix: true
+end
diff --git a/app/models/members/group_member.rb b/app/models/members/group_member.rb
new file mode 100644
index 00000000000..e72393c4278
--- /dev/null
+++ b/app/models/members/group_member.rb
@@ -0,0 +1,43 @@
+class GroupMember < Member
+ SOURCE_TYPE = 'Namespace'
+
+ belongs_to :group, class_name: 'Group', foreign_key: 'source_id'
+
+ # Make sure group member points only to group as it source
+ default_value_for :source_type, SOURCE_TYPE
+ default_value_for :notification_level, Notification::N_GLOBAL
+ validates_format_of :source_type, with: /\ANamespace\z/
+ default_scope { where(source_type: SOURCE_TYPE) }
+
+ scope :with_group, ->(group) { where(source_id: group.id) }
+ scope :with_user, ->(user) { where(user_id: user.id) }
+
+ after_create :notify_create
+ after_update :notify_update
+
+ def self.access_level_roles
+ Gitlab::Access.options_with_owner
+ end
+
+ def group
+ source
+ end
+
+ def access_field
+ access_level
+ end
+
+ def notify_create
+ notification_service.new_group_member(self)
+ end
+
+ def notify_update
+ if access_level_changed?
+ notification_service.update_group_member(self)
+ end
+ end
+
+ def notification_service
+ NotificationService.new
+ end
+end
diff --git a/app/models/members/project_member.rb b/app/models/members/project_member.rb
new file mode 100644
index 00000000000..f14900ad3e6
--- /dev/null
+++ b/app/models/members/project_member.rb
@@ -0,0 +1,137 @@
+class ProjectMember < Member
+ SOURCE_TYPE = 'Project'
+
+ include Gitlab::ShellAdapter
+
+ belongs_to :project, class_name: 'Project', foreign_key: 'source_id'
+
+
+ # Make sure project member points only to project as it source
+ default_value_for :source_type, SOURCE_TYPE
+ default_value_for :notification_level, Notification::N_GLOBAL
+ validates_format_of :source_type, with: /\AProject\z/
+ default_scope { where(source_type: SOURCE_TYPE) }
+
+ after_create :post_create_hook
+ after_update :post_update_hook
+ after_destroy :post_destroy_hook
+
+ scope :in_project, ->(project) { where(source_id: project.id) }
+ scope :in_projects, ->(projects) { where(source_id: projects.pluck(:id)) }
+ scope :with_user, ->(user) { where(user_id: user.id) }
+
+ class << self
+
+ # Add users to project teams with passed access option
+ #
+ # access can be an integer representing a access code
+ # or symbol like :master representing role
+ #
+ # Ex.
+ # add_users_into_projects(
+ # project_ids,
+ # user_ids,
+ # ProjectMember::MASTER
+ # )
+ #
+ # add_users_into_projects(
+ # project_ids,
+ # user_ids,
+ # :master
+ # )
+ #
+ def add_users_into_projects(project_ids, user_ids, access)
+ access_level = if roles_hash.has_key?(access)
+ roles_hash[access]
+ elsif roles_hash.values.include?(access.to_i)
+ access
+ else
+ raise "Non valid access"
+ end
+
+ ProjectMember.transaction do
+ project_ids.each do |project_id|
+ user_ids.each do |user_id|
+ member = ProjectMember.new(access_level: access_level, user_id: user_id)
+ member.source_id = project_id
+ member.save
+ end
+ end
+ end
+
+ true
+ rescue
+ false
+ end
+
+ def truncate_teams(project_ids)
+ ProjectMember.transaction do
+ members = ProjectMember.where(source_id: project_ids)
+ members.each do |member|
+ member.destroy
+ end
+ end
+
+ true
+ rescue
+ false
+ end
+
+ def truncate_team project
+ truncate_teams [project.id]
+ end
+
+ def roles_hash
+ Gitlab::Access.sym_options
+ end
+
+ def access_roles
+ Gitlab::Access.options
+ end
+ end
+
+ def access_field
+ access_level
+ end
+
+ def owner?
+ project.owner == user
+ end
+
+ def post_create_hook
+ Event.create(
+ project_id: self.project.id,
+ action: Event::JOINED,
+ author_id: self.user.id
+ )
+
+ notification_service.new_team_member(self) unless owner?
+ system_hook_service.execute_hooks_for(self, :create)
+ end
+
+ def post_update_hook
+ notification_service.update_team_member(self) if self.access_level_changed?
+ end
+
+ def post_destroy_hook
+ Event.create(
+ project_id: self.project.id,
+ action: Event::LEFT,
+ author_id: self.user.id
+ )
+
+ system_hook_service.execute_hooks_for(self, :destroy)
+ end
+
+ def notification_service
+ NotificationService.new
+ end
+
+ def system_hook_service
+ SystemHooksService.new
+ end
+
+ def project
+ source
+ end
+end
diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb
index 10bd76b1c35..4894c617674 100644
--- a/app/models/merge_request.rb
+++ b/app/models/merge_request.rb
@@ -122,9 +122,11 @@ class MergeRequest < ActiveRecord::Base
if opened? || reopened?
similar_mrs = self.target_project.merge_requests.where(source_branch: source_branch, target_branch: target_branch, source_project_id: source_project.id).opened
similar_mrs = similar_mrs.where('id not in (?)', self.id) if self.id
-
if similar_mrs.any?
- errors.add :base, "Cannot Create: This merge request already exists: #{similar_mrs.pluck(:title)}"
+ errors.add :validate_branches,
+ "Cannot Create: This merge request already exists: #{
+ similar_mrs.pluck(:title)
+ }"
end
end
end
@@ -140,7 +142,8 @@ class MergeRequest < ActiveRecord::Base
if source_project.forked_from?(target_project)
true
else
- errors.add :base, "Source project is not a fork of target project"
+ errors.add :validate_fork,
+ 'Source project is not a fork of target project'
end
end
end
diff --git a/app/models/network/graph.rb b/app/models/network/graph.rb
index 424819f3501..9c95470beb1 100644
--- a/app/models/network/graph.rb
+++ b/app/models/network/graph.rb
@@ -178,12 +178,6 @@ module Network
space = find_free_space(time_range, 2, space_base)
leaves.each do |l|
l.spaces << space
- # Also add space to parent
- l.parents(@map).each do |parent|
- if 0 < parent.space && parent.space < space
- parent.spaces << space
- end
- end
end
# and mark it as reserved
diff --git a/app/models/note.rb b/app/models/note.rb
index 7ff6444cc9b..fa5fdea4eb0 100644
--- a/app/models/note.rb
+++ b/app/models/note.rb
@@ -117,6 +117,25 @@ class Note < ActiveRecord::Base
})
end
+ def create_new_commits_note(noteable, project, author, commits)
+ commits_text = ActionController::Base.helpers.pluralize(commits.size, 'new commit')
+ body = "Added #{commits_text}:\n\n"
+
+ commits.each do |commit|
+ message = "* #{commit.short_id} - #{commit.title}"
+ body << message
+ body << "\n"
+ end
+
+ create(
+ noteable: noteable,
+ project: project,
+ author: author,
+ note: body,
+ system: true
+ )
+ end
+
def discussions_from_notes(notes)
discussion_ids = []
discussions = []
@@ -146,6 +165,10 @@ class Note < ActiveRecord::Base
def cross_reference_exists?(noteable, mentioner)
where(noteable_id: noteable.id, system: true, note: "_mentioned in #{mentioner.gfm_reference}_").any?
end
+
+ def search(query)
+ where("note like :query", query: "%#{query}%")
+ end
end
def commit_author
@@ -186,9 +209,10 @@ class Note < ActiveRecord::Base
noteable.diffs.each do |mr_diff|
next unless mr_diff.new_path == self.diff.new_path
- Gitlab::DiffParser.new(mr_diff.diff.lines.to_a, mr_diff.new_path).
- each do |full_line, type, line_code, line_new, line_old|
- if full_line == diff_line
+ lines = Gitlab::Diff::Parser.new.parse(mr_diff.diff.lines.to_a)
+
+ lines.each do |line|
+ if line.text == diff_line
return true
end
end
@@ -209,6 +233,14 @@ class Note < ActiveRecord::Base
diff.new_path if diff
end
+ def file_path
+ if diff.new_path.present?
+ diff.new_path
+ elsif diff.old_path.present?
+ diff.old_path
+ end
+ end
+
def diff_old_line
line_code.split('_')[1].to_i
end
@@ -217,19 +249,49 @@ class Note < ActiveRecord::Base
line_code.split('_')[2].to_i
end
+ def generate_line_code(line)
+ Gitlab::Diff::LineCode.generate(file_path, line.new_pos, line.old_pos)
+ end
+
def diff_line
return @diff_line if @diff_line
if diff
- Gitlab::DiffParser.new(diff.diff.lines.to_a, diff.new_path)
- .each do |full_line, type, line_code, line_new, line_old|
- @diff_line = full_line if line_code == self.line_code
+ diff_lines.each do |line|
+ if generate_line_code(line) == self.line_code
+ @diff_line = line.text
end
+ end
end
@diff_line
end
+ def truncated_diff_lines
+ max_number_of_lines = 16
+ prev_match_line = nil
+ prev_lines = []
+
+ diff_lines.each do |line|
+ if generate_line_code(line) != self.line_code
+ if line.type == "match"
+ prev_lines.clear
+ prev_match_line = line
+ else
+ prev_lines.push(line)
+ prev_lines.shift if prev_lines.length >= max_number_of_lines
+ end
+ else
+ prev_lines << line
+ return prev_lines
+ end
+ end
+ end
+
+ def diff_lines
+ @diff_lines ||= Gitlab::Diff::Parser.new.parse(diff.diff.lines.to_a)
+ end
+
def discussion_id
@discussion_id ||= Note.build_discussion_id(noteable_type, noteable_id || commit_id, line_code)
end
@@ -333,4 +395,8 @@ class Note < ActiveRecord::Base
def set_references
notice_added_references(project, author)
end
+
+ def editable?
+ !system
+ end
end
diff --git a/app/models/project.rb b/app/models/project.rb
index c991bf6467c..f9278f19dad 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -70,7 +70,7 @@ class Project < ActiveRecord::Base
has_many :merge_requests, dependent: :destroy, foreign_key: "target_project_id"
# 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 :issues, -> { order 'issues.state DESC, issues.created_at DESC' }, dependent: :destroy
has_many :labels, dependent: :destroy
has_many :services, dependent: :destroy
has_many :events, dependent: :destroy
@@ -79,8 +79,8 @@ class Project < ActiveRecord::Base
has_many :snippets, dependent: :destroy, class_name: "ProjectSnippet"
has_many :hooks, dependent: :destroy, class_name: "ProjectHook"
has_many :protected_branches, dependent: :destroy
- has_many :users_projects, dependent: :destroy
- has_many :users, through: :users_projects
+ has_many :project_members, dependent: :destroy, as: :source, class_name: 'ProjectMember'
+ has_many :users, through: :project_members
has_many :deploy_keys_projects, dependent: :destroy
has_many :deploy_keys, through: :deploy_keys_projects
has_many :users_star_projects, dependent: :destroy
@@ -122,6 +122,7 @@ class Project < ActiveRecord::Base
scope :in_namespace, ->(namespace) { where(namespace_id: namespace.id) }
scope :in_group_namespace, -> { joins(:group) }
scope :sorted_by_activity, -> { reorder("projects.last_activity_at DESC") }
+ scope :sorted_by_stars, -> { reorder("projects.star_count DESC") }
scope :personal, ->(user) { where(namespace_id: user.namespace_id) }
scope :joined, ->(user) { where("namespace_id != ?", user.namespace_id) }
scope :public_only, -> { where(visibility_level: Project::PUBLIC) }
@@ -177,11 +178,11 @@ class Project < ActiveRecord::Base
joins(:issues, :notes, :merge_requests).order("issues.created_at, notes.created_at, merge_requests.created_at DESC")
end
- def search query
+ def search(query)
joins(:namespace).where("projects.archived = ?", false).where("projects.name LIKE :query OR projects.path LIKE :query OR namespaces.name LIKE :query OR projects.description LIKE :query", query: "%#{query}%")
end
- def search_by_title query
+ def search_by_title(query)
where("projects.archived = ?", false).where("LOWER(projects.name) LIKE :query", query: "%#{query.downcase}%")
end
@@ -353,12 +354,12 @@ class Project < ActiveRecord::Base
def team_member_by_name_or_email(name = nil, email = nil)
user = users.where("name like ? or email like ?", name, email).first
- users_projects.where(user: user) if user
+ project_members.where(user: user) if user
end
# Get Team Member record by user id
def team_member_by_id(user_id)
- users_projects.find_by(user_id: user_id)
+ project_members.find_by(user_id: user_id)
end
def name_with_namespace
@@ -400,22 +401,43 @@ class Project < ActiveRecord::Base
def update_merge_requests(oldrev, newrev, ref, user)
return true unless ref =~ /heads/
branch_name = ref.gsub("refs/heads/", "")
- c_ids = self.repository.commits_between(oldrev, newrev).map(&:id)
+ commits = self.repository.commits_between(oldrev, newrev)
+ c_ids = commits.map(&:id)
# Close merge requests
mrs = self.merge_requests.opened.where(target_branch: branch_name).to_a
mrs = mrs.select(&:last_commit).select { |mr| c_ids.include?(mr.last_commit.id) }
- mrs.each { |merge_request| MergeRequests::MergeService.new.execute(merge_request, user, nil) }
+
+ mrs.uniq.each do |merge_request|
+ MergeRequests::MergeService.new.execute(merge_request, user, nil)
+ end
# Update code for merge requests into project between project branches
mrs = self.merge_requests.opened.by_branch(branch_name).to_a
# Update code for merge requests between project and project fork
mrs += self.fork_merge_requests.opened.by_branch(branch_name).to_a
- mrs.each { |merge_request| merge_request.reload_code; merge_request.mark_as_unchecked }
+
+ mrs.uniq.each do |merge_request|
+ merge_request.reload_code
+ merge_request.mark_as_unchecked
+ end
+
+ # Add comment about pushing new commits to merge requests
+ comment_mr_with_commits(branch_name, commits, user)
true
end
+ def comment_mr_with_commits(branch_name, commits, user)
+ mrs = self.origin_merge_requests.opened.where(source_branch: branch_name).to_a
+ mrs += self.fork_merge_requests.opened.where(source_branch: branch_name).to_a
+
+ mrs.uniq.each do |merge_request|
+ Note.create_new_commits_note(merge_request, merge_request.project,
+ user, commits)
+ end
+ end
+
def valid_repo?
repository.exists?
rescue
@@ -538,7 +560,7 @@ class Project < ActiveRecord::Base
end
def project_member(user)
- users_projects.where(user_id: user).first
+ project_members.where(user_id: user).first
end
def default_branch
@@ -582,4 +604,8 @@ class Project < ActiveRecord::Base
def find_label(name)
labels.find_by(name: name)
end
+
+ def origin_merge_requests
+ merge_requests.where(source_project_id: self.id)
+ end
end
diff --git a/app/models/project_services/assembla_service.rb b/app/models/project_services/assembla_service.rb
index 9a8cbb32ac1..3421a0330aa 100644
--- a/app/models/project_services/assembla_service.rb
+++ b/app/models/project_services/assembla_service.rb
@@ -5,21 +5,17 @@
# id :integer not null, primary key
# type :string(255)
# title :string(255)
-# token :string(255)
# project_id :integer not null
# created_at :datetime
# updated_at :datetime
# active :boolean default(FALSE), not null
-# project_url :string(255)
-# subdomain :string(255)
-# room :string(255)
-# recipients :text
-# api_key :string(255)
+# properties :text
#
class AssemblaService < Service
include HTTParty
+ prop_accessor :token, :subdomain
validates :token, presence: true, if: :activated?
def title
diff --git a/app/models/project_services/campfire_service.rb b/app/models/project_services/campfire_service.rb
index 83e1bac1ef2..2d8950db491 100644
--- a/app/models/project_services/campfire_service.rb
+++ b/app/models/project_services/campfire_service.rb
@@ -5,19 +5,15 @@
# id :integer not null, primary key
# type :string(255)
# title :string(255)
-# token :string(255)
# project_id :integer not null
# created_at :datetime
# updated_at :datetime
# active :boolean default(FALSE), not null
-# project_url :string(255)
-# subdomain :string(255)
-# room :string(255)
-# recipients :text
-# api_key :string(255)
+# properties :text
#
class CampfireService < Service
+ prop_accessor :token, :subdomain, :room
validates :token, presence: true, if: :activated?
def title
diff --git a/app/models/project_services/ci_service.rb b/app/models/project_services/ci_service.rb
index 1a107f92c93..829f495abc6 100644
--- a/app/models/project_services/ci_service.rb
+++ b/app/models/project_services/ci_service.rb
@@ -5,16 +5,11 @@
# id :integer not null, primary key
# type :string(255)
# title :string(255)
-# token :string(255)
# project_id :integer not null
# created_at :datetime
# updated_at :datetime
# active :boolean default(FALSE), not null
-# project_url :string(255)
-# subdomain :string(255)
-# room :string(255)
-# recipients :text
-# api_key :string(255)
+# properties :text
#
# Base class for CI services
diff --git a/app/models/project_services/emails_on_push_service.rb b/app/models/project_services/emails_on_push_service.rb
index be5bab4ec32..5c4537cfca5 100644
--- a/app/models/project_services/emails_on_push_service.rb
+++ b/app/models/project_services/emails_on_push_service.rb
@@ -5,19 +5,15 @@
# id :integer not null, primary key
# type :string(255)
# title :string(255)
-# token :string(255)
# project_id :integer not null
# created_at :datetime
# updated_at :datetime
# active :boolean default(FALSE), not null
-# project_url :string(255)
-# subdomain :string(255)
-# room :string(255)
-# recipients :text
-# api_key :string(255)
+# properties :text
#
class EmailsOnPushService < Service
+ prop_accessor :recipients
validates :recipients, presence: true, if: :activated?
def title
diff --git a/app/models/project_services/flowdock_service.rb b/app/models/project_services/flowdock_service.rb
index 6cdd04a8648..4d11b00c192 100644
--- a/app/models/project_services/flowdock_service.rb
+++ b/app/models/project_services/flowdock_service.rb
@@ -5,21 +5,17 @@
# id :integer not null, primary key
# type :string(255)
# title :string(255)
-# token :string(255)
# project_id :integer not null
# created_at :datetime
# updated_at :datetime
# active :boolean default(FALSE), not null
-# project_url :string(255)
-# subdomain :string(255)
-# room :string(255)
-# recipients :text
-# api_key :string(255)
+# properties :text
#
require "flowdock-git-hook"
class FlowdockService < Service
+ prop_accessor :token
validates :token, presence: true, if: :activated?
def title
diff --git a/app/models/project_services/gemnasium_service.rb b/app/models/project_services/gemnasium_service.rb
index b363d7f57d2..7b6c87e4cec 100644
--- a/app/models/project_services/gemnasium_service.rb
+++ b/app/models/project_services/gemnasium_service.rb
@@ -5,21 +5,17 @@
# id :integer not null, primary key
# type :string(255)
# title :string(255)
-# token :string(255)
# project_id :integer not null
# created_at :datetime
# updated_at :datetime
# active :boolean default(FALSE), not null
-# project_url :string(255)
-# subdomain :string(255)
-# room :string(255)
-# recipients :text
-# api_key :string(255)
+# properties :text
#
require "gemnasium/gitlab_service"
class GemnasiumService < Service
+ prop_accessor :token, :api_key
validates :token, :api_key, 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 58ddce45288..0f327e75289 100644
--- a/app/models/project_services/gitlab_ci_service.rb
+++ b/app/models/project_services/gitlab_ci_service.rb
@@ -5,19 +5,15 @@
# id :integer not null, primary key
# type :string(255)
# title :string(255)
-# token :string(255)
# project_id :integer not null
# created_at :datetime
# updated_at :datetime
# active :boolean default(FALSE), not null
-# project_url :string(255)
-# subdomain :string(255)
-# room :string(255)
-# recipients :text
-# api_key :string(255)
+# property :text
#
class GitlabCiService < CiService
+ prop_accessor :project_url, :token
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 256debffc51..3a1ba168e6a 100644
--- a/app/models/project_services/hipchat_service.rb
+++ b/app/models/project_services/hipchat_service.rb
@@ -5,21 +5,17 @@
# id :integer not null, primary key
# type :string(255)
# title :string(255)
-# token :string(255)
# project_id :integer not null
# created_at :datetime
# updated_at :datetime
# active :boolean default(FALSE), not null
-# project_url :string(255)
-# subdomain :string(255)
-# room :string(255)
-# recipients :text
-# api_key :string(255)
+# properties :text
#
class HipchatService < Service
MAX_COMMITS = 3
+ prop_accessor :token, :room
validates :token, presence: true, if: :activated?
def title
diff --git a/app/models/project_services/pivotaltracker_service.rb b/app/models/project_services/pivotaltracker_service.rb
index aa2bcc5def7..3aa928b92a0 100644
--- a/app/models/project_services/pivotaltracker_service.rb
+++ b/app/models/project_services/pivotaltracker_service.rb
@@ -5,21 +5,17 @@
# id :integer not null, primary key
# type :string(255)
# title :string(255)
-# token :string(255)
# project_id :integer not null
# created_at :datetime
# updated_at :datetime
# active :boolean default(FALSE), not null
-# project_url :string(255)
-# subdomain :string(255)
-# room :string(255)
-# recipients :text
-# api_key :string(255)
+# properties :text
#
class PivotaltrackerService < Service
include HTTParty
+ prop_accessor :token
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 7e54188abf7..4bda93f6006 100644
--- a/app/models/project_services/slack_service.rb
+++ b/app/models/project_services/slack_service.rb
@@ -5,19 +5,15 @@
# id :integer not null, primary key
# type :string(255)
# title :string(255)
-# token :string(255)
# project_id :integer not null
# created_at :datetime
# updated_at :datetime
# active :boolean default(FALSE), not null
-# project_url :string(255)
-# subdomain :string(255)
-# room :string(255)
-# recipients :text
-# api_key :string(255)
+# properties :text
#
class SlackService < Service
+ prop_accessor :room, :subdomain, :token
validates :room, presence: true, if: :activated?
validates :subdomain, presence: true, if: :activated?
validates :token, presence: true, if: :activated?
diff --git a/app/models/project_team.rb b/app/models/project_team.rb
index 0bbbd3d00e8..e2af10c6899 100644
--- a/app/models/project_team.rb
+++ b/app/models/project_team.rb
@@ -32,12 +32,12 @@ class ProjectTeam
end
def find_tm(user_id)
- tm = project.users_projects.find_by(user_id: user_id)
+ tm = project.project_members.find_by(user_id: user_id)
# If user is not in project members
# we should check for group membership
if group && !tm
- tm = group.users_groups.find_by(user_id: user_id)
+ tm = group.group_members.find_by(user_id: user_id)
end
tm
@@ -52,7 +52,7 @@ class ProjectTeam
end
def add_users_ids(user_ids, access)
- UsersProject.add_users_into_projects(
+ ProjectMember.add_users_into_projects(
[project.id],
user_ids,
access
@@ -61,7 +61,7 @@ class ProjectTeam
# Remove all users from project team
def truncate
- UsersProject.truncate_team(project)
+ ProjectMember.truncate_team(project)
end
def users
@@ -91,8 +91,8 @@ class ProjectTeam
def import(source_project)
target_project = project
- source_team = source_project.users_projects.to_a
- target_user_ids = target_project.users_projects.pluck(:user_id)
+ source_team = source_project.project_members.to_a
+ target_user_ids = target_project.project_members.pluck(:user_id)
source_team.reject! do |tm|
# Skip if user already present in team
@@ -102,11 +102,11 @@ class ProjectTeam
source_team.map! do |tm|
new_tm = tm.dup
new_tm.id = nil
- new_tm.project_id = target_project.id
+ new_tm.source = target_project
new_tm
end
- UsersProject.transaction do
+ ProjectMember.transaction do
source_team.each do |tm|
tm.save
end
@@ -135,10 +135,10 @@ class ProjectTeam
def max_tm_access(user_id)
access = []
- access << project.users_projects.find_by(user_id: user_id).try(:access_field)
+ access << project.project_members.find_by(user_id: user_id).try(:access_field)
if group
- access << group.users_groups.find_by(user_id: user_id).try(:access_field)
+ access << group.group_members.find_by(user_id: user_id).try(:access_field)
end
access.compact.max
@@ -147,8 +147,8 @@ class ProjectTeam
private
def fetch_members(level = nil)
- project_members = project.users_projects
- group_members = group ? group.users_groups : []
+ project_members = project.project_members
+ group_members = group ? group.group_members : []
if level
project_members = project_members.send(level)
diff --git a/app/models/project_wiki.rb b/app/models/project_wiki.rb
index a82a300a672..770a26ed894 100644
--- a/app/models/project_wiki.rb
+++ b/app/models/project_wiki.rb
@@ -107,6 +107,18 @@ class ProjectWiki
[title.gsub(/\.[^.]*$/, ""), title_array.join("/")]
end
+ def search_files(query)
+ repository.search_files(query, default_branch)
+ end
+
+ def repository
+ Repository.new(path_with_namespace, default_branch)
+ end
+
+ def default_branch
+ wiki.class.default_ref
+ end
+
private
def create_repo!
diff --git a/app/models/repository.rb b/app/models/repository.rb
index e970c449a73..ea87ea88fdc 100644
--- a/app/models/repository.rb
+++ b/app/models/repository.rb
@@ -25,14 +25,14 @@ class Repository
raw_repository.empty?
end
- def commit(id = nil)
+ def commit(id = 'HEAD')
return nil unless raw_repository
commit = Gitlab::Git::Commit.find(raw_repository, id)
commit = Commit.new(commit) if commit
commit
end
- def commits(ref, path = nil, limit = nil, offset = nil)
+ def commits(ref, path = nil, limit = nil, offset = nil, skip_merges = false)
commits = Gitlab::Git::Commit.where(
repo: raw_repository,
ref: ref,
@@ -64,10 +64,10 @@ class Repository
gitlab_shell.add_branch(path_with_namespace, branch_name, ref)
end
- def add_tag(tag_name, ref)
+ def add_tag(tag_name, ref, message = nil)
Rails.cache.delete(cache_key(:tag_names))
- gitlab_shell.add_tag(path_with_namespace, tag_name, ref)
+ gitlab_shell.add_tag(path_with_namespace, tag_name, ref, message)
end
def rm_branch(branch_name)
@@ -137,7 +137,7 @@ class Repository
def graph_log
Rails.cache.fetch(cache_key(:graph_log)) do
- stats = Gitlab::Git::GitStats.new(raw, root_ref, Gitlab.config.git.timeout)
+ stats = Gitlab::Git::GitStats.new(raw_repository, root_ref, Gitlab.config.git.timeout)
stats.parsed_log
end
end
@@ -223,7 +223,9 @@ class Repository
end
def last_commit_for_path(sha, path)
- commits(sha, path, 1).last
+ args = %W(git rev-list --max-count 1 #{sha} -- #{path})
+ sha = Gitlab::Popen.popen(args, path_to_repo).first.strip
+ commit(sha)
end
# Remove archives older than 2 hours
diff --git a/app/models/service.rb b/app/models/service.rb
index 0dc6d514b46..1f3a6520473 100644
--- a/app/models/service.rb
+++ b/app/models/service.rb
@@ -5,23 +5,21 @@
# id :integer not null, primary key
# type :string(255)
# title :string(255)
-# token :string(255)
# project_id :integer not null
# created_at :datetime
# updated_at :datetime
# active :boolean default(FALSE), not null
-# project_url :string(255)
-# subdomain :string(255)
-# room :string(255)
-# recipients :text
-# api_key :string(255)
-#
+# properties :text
# To add new service you should build a class inherited from Service
# and implement a set of methods
class Service < ActiveRecord::Base
+ serialize :properties, JSON
+
default_value_for :active, false
+ after_initialize :initialize_properties
+
belongs_to :project
has_one :service_hook
@@ -35,6 +33,10 @@ class Service < ActiveRecord::Base
:common
end
+ def initialize_properties
+ self.properties = {} if properties.nil?
+ end
+
def title
# implement inside child
end
@@ -63,4 +65,20 @@ class Service < ActiveRecord::Base
def can_test?
!project.empty_repo?
end
+
+ # Provide convenient accessor methods
+ # for each serialized property.
+ def self.prop_accessor(*args)
+ args.each do |arg|
+ class_eval %{
+ def #{arg}
+ properties['#{arg}']
+ end
+
+ def #{arg}=(value)
+ self.properties['#{arg}'] = value
+ end
+ }
+ end
+ end
end
diff --git a/app/models/snippet.rb b/app/models/snippet.rb
index 2c38e7939bd..80c1af8f337 100644
--- a/app/models/snippet.rb
+++ b/app/models/snippet.rb
@@ -65,4 +65,18 @@ class Snippet < ActiveRecord::Base
def expired?
expires_at && expires_at < Time.current
end
+
+ class << self
+ def search(query)
+ where('(title LIKE :query OR file_name LIKE :query)', query: "%#{query}%")
+ end
+
+ def search_code(query)
+ where('(content LIKE :query)', query: "%#{query}%")
+ end
+
+ def accessible_to(user)
+ where('private = ? OR author_id = ?', false, user)
+ end
+ end
end
diff --git a/app/models/user.rb b/app/models/user.rb
index f1ff76edd15..ed3eba4cdf0 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -81,21 +81,23 @@ class User < ActiveRecord::Base
has_many :emails, dependent: :destroy
# Groups
- has_many :users_groups, dependent: :destroy
- has_many :groups, through: :users_groups
- has_many :owned_groups, -> { where users_groups: { group_access: UsersGroup::OWNER } }, through: :users_groups, source: :group
- has_many :masters_groups, -> { where users_groups: { group_access: UsersGroup::MASTER } }, through: :users_groups, source: :group
+ has_many :members, dependent: :destroy
+ has_many :project_members, source: 'ProjectMember'
+ has_many :group_members, source: 'GroupMember'
+ has_many :groups, through: :group_members
+ has_many :owned_groups, -> { where members: { access_level: Gitlab::Access::OWNER } }, through: :group_members, source: :group
+ has_many :masters_groups, -> { where members: { access_level: Gitlab::Access::MASTER } }, through: :group_members, source: :group
# Projects
has_many :groups_projects, through: :groups, source: :projects
has_many :personal_projects, through: :namespace, source: :projects
- has_many :projects, through: :users_projects
+ has_many :projects, through: :project_members
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
+ has_many :project_members, dependent: :destroy, class_name: 'ProjectMember'
has_many :issues, dependent: :destroy, foreign_key: :author_id
has_many :notes, dependent: :destroy, foreign_key: :author_id
has_many :merge_requests, dependent: :destroy, foreign_key: :author_id
@@ -140,7 +142,7 @@ class User < ActiveRecord::Base
state_machine :state, initial: :active do
after_transition any => :blocked do |user, transition|
# Remove user from all projects and
- user.users_projects.find_each do |membership|
+ user.project_members.find_each do |membership|
# skip owned resources
next if membership.project.owner == user
@@ -148,7 +150,7 @@ class User < ActiveRecord::Base
end
# Remove user from all groups
- user.users_groups.find_each do |membership|
+ user.group_members.find_each do |membership|
# skip owned resources
next if membership.group.last_owner?(user)
@@ -175,7 +177,7 @@ class User < ActiveRecord::Base
scope :in_team, ->(team){ where(id: team.member_ids) }
scope :not_in_team, ->(team){ where('users.id NOT IN (:ids)', ids: team.member_ids) }
scope :not_in_project, ->(project) { project.users.present? ? where("id not in (:ids)", ids: project.users.map(&:id) ) : all }
- scope :without_projects, -> { where('id NOT IN (SELECT DISTINCT(user_id) FROM users_projects)') }
+ scope :without_projects, -> { where('id NOT IN (SELECT DISTINCT(user_id) FROM members)') }
scope :ldap, -> { where(provider: 'ldap') }
scope :potential_team_members, ->(team) { team.members.any? ? active.not_in_team(team) : active }
@@ -295,7 +297,7 @@ class User < ActiveRecord::Base
# Team membership in authorized projects
def tm_in_authorized_projects
- UsersProject.where(project_id: authorized_projects.map(&:id), user_id: self.id)
+ ProjectMember.where(source_id: authorized_projects.map(&:id), user_id: self.id)
end
def is_admin?
@@ -474,10 +476,6 @@ class User < ActiveRecord::Base
email =~ /\Atemp-email-for-oauth/
end
- def generate_tmp_oauth_email
- self.email = "temp-email-for-oauth-#{username}@gitlab.localhost"
- end
-
def public_profile?
authorized_projects.public_only.any?
end
diff --git a/app/models/users_group.rb b/app/models/users_group.rb
deleted file mode 100644
index 270f968ef61..00000000000
--- a/app/models/users_group.rb
+++ /dev/null
@@ -1,61 +0,0 @@
-# == Schema Information
-#
-# Table name: users_groups
-#
-# id :integer not null, primary key
-# group_access :integer not null
-# group_id :integer not null
-# user_id :integer not null
-# created_at :datetime
-# updated_at :datetime
-# notification_level :integer default(3), not null
-#
-
-class UsersGroup < ActiveRecord::Base
- include Notifiable
- include Gitlab::Access
-
- def self.group_access_roles
- Gitlab::Access.options_with_owner
- end
-
- belongs_to :user
- belongs_to :group
-
- scope :guests, -> { where(group_access: GUEST) }
- scope :reporters, -> { where(group_access: REPORTER) }
- scope :developers, -> { where(group_access: DEVELOPER) }
- scope :masters, -> { where(group_access: MASTER) }
- scope :owners, -> { where(group_access: OWNER) }
-
- scope :with_group, ->(group) { where(group_id: group.id) }
- scope :with_user, ->(user) { where(user_id: user.id) }
-
- after_create :notify_create
- after_update :notify_update
-
- validates :group_access, inclusion: { in: UsersGroup.group_access_roles.values }, presence: true
- validates :user_id, presence: true
- validates :group_id, presence: true
- validates :user_id, uniqueness: { scope: [:group_id], message: "already exists in group" }
-
- delegate :name, :username, :email, to: :user, prefix: true
-
- def access_field
- group_access
- end
-
- def notify_create
- notification_service.new_group_member(self)
- end
-
- def notify_update
- if group_access_changed?
- notification_service.update_group_member(self)
- end
- end
-
- def notification_service
- NotificationService.new
- end
-end
diff --git a/app/models/users_project.rb b/app/models/users_project.rb
deleted file mode 100644
index 60bdf7a3cfb..00000000000
--- a/app/models/users_project.rb
+++ /dev/null
@@ -1,152 +0,0 @@
-# == Schema Information
-#
-# Table name: users_projects
-#
-# id :integer not null, primary key
-# user_id :integer not null
-# project_id :integer not null
-# created_at :datetime
-# updated_at :datetime
-# project_access :integer default(0), not null
-# notification_level :integer default(3), not null
-#
-
-class UsersProject < ActiveRecord::Base
- include Gitlab::ShellAdapter
- include Notifiable
- include Gitlab::Access
-
- belongs_to :user
- belongs_to :project
-
- validates :user, presence: true
- validates :user_id, uniqueness: { scope: [:project_id], message: "already exists in project" }
- validates :project_access, inclusion: { in: Gitlab::Access.values }, presence: true
- validates :project, presence: true
-
- delegate :name, :username, :email, to: :user, prefix: true
-
- scope :guests, -> { where(project_access: GUEST) }
- scope :reporters, -> { where(project_access: REPORTER) }
- scope :developers, -> { where(project_access: DEVELOPER) }
- scope :masters, -> { where(project_access: MASTER) }
-
- scope :in_project, ->(project) { where(project_id: project.id) }
- scope :in_projects, ->(projects) { where(project_id: projects.map { |p| p.id }) }
- scope :with_user, ->(user) { where(user_id: user.id) }
-
- after_create :post_create_hook
- after_update :post_update_hook
- after_destroy :post_destroy_hook
-
- class << self
-
- # Add users to project teams with passed access option
- #
- # access can be an integer representing a access code
- # or symbol like :master representing role
- #
- # Ex.
- # add_users_into_projects(
- # project_ids,
- # user_ids,
- # UsersProject::MASTER
- # )
- #
- # add_users_into_projects(
- # project_ids,
- # user_ids,
- # :master
- # )
- #
- def add_users_into_projects(project_ids, user_ids, access)
- project_access = if roles_hash.has_key?(access)
- roles_hash[access]
- elsif roles_hash.values.include?(access.to_i)
- access
- else
- raise "Non valid access"
- end
-
- UsersProject.transaction do
- project_ids.each do |project_id|
- user_ids.each do |user_id|
- users_project = UsersProject.new(project_access: project_access, user_id: user_id)
- users_project.project_id = project_id
- users_project.save
- end
- end
- end
-
- true
- rescue
- false
- end
-
- def truncate_teams(project_ids)
- UsersProject.transaction do
- users_projects = UsersProject.where(project_id: project_ids)
- users_projects.each do |users_project|
- users_project.destroy
- end
- end
-
- true
- rescue
- false
- end
-
- def truncate_team project
- truncate_teams [project.id]
- end
-
- def roles_hash
- Gitlab::Access.sym_options
- end
-
- def access_roles
- Gitlab::Access.options
- end
- end
-
- def access_field
- project_access
- end
-
- def owner?
- project.owner == user
- end
-
- def post_create_hook
- Event.create(
- project_id: self.project.id,
- action: Event::JOINED,
- author_id: self.user.id
- )
-
- notification_service.new_team_member(self) unless owner?
- system_hook_service.execute_hooks_for(self, :create)
- end
-
- def post_update_hook
- notification_service.update_team_member(self) if self.project_access_changed?
- end
-
- def post_destroy_hook
- Event.create(
- project_id: self.project.id,
- action: Event::LEFT,
- author_id: self.user.id
- )
-
- system_hook_service.execute_hooks_for(self, :destroy)
- end
-
- def notification_service
- NotificationService.new
- end
-
- def system_hook_service
- SystemHooksService.new
- end
-end
diff --git a/app/models/wiki_page.rb b/app/models/wiki_page.rb
index b8a0a9eb58b..b9ab6702c53 100644
--- a/app/models/wiki_page.rb
+++ b/app/models/wiki_page.rb
@@ -87,14 +87,14 @@ class WikiPage
def version
return nil unless persisted?
- @version ||= Commit.new(Gitlab::Git::Commit.new(@page.version))
+ @version ||= @page.version
end
# Returns an array of Gitlab Commit instances.
def versions
return [] unless persisted?
- @page.versions.map { |v| Commit.new(Gitlab::Git::Commit.new(v)) }
+ @page.versions
end
def commit
diff --git a/app/services/base_service.rb b/app/services/base_service.rb
index 31b38aca530..051612633cd 100644
--- a/app/services/base_service.rb
+++ b/app/services/base_service.rb
@@ -1,7 +1,7 @@
class BaseService
attr_accessor :project, :current_user, :params
- def initialize(project, user, params)
+ def initialize(project, user, params = {})
@project, @current_user, @params = project, user, params.dup
end
@@ -32,4 +32,19 @@ class BaseService
def system_hook_service
SystemHooksService.new
end
+
+ private
+
+ def error(message)
+ {
+ message: message,
+ status: :error
+ }
+ end
+
+ def success
+ {
+ status: :success
+ }
+ end
end
diff --git a/app/services/compare_service.rb b/app/services/compare_service.rb
index c5e04702914..6aa9df4b194 100644
--- a/app/services/compare_service.rb
+++ b/app/services/compare_service.rb
@@ -4,8 +4,8 @@ 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
+ # Note: Use satellite only when need to compare between two repos
+ # because satellites are slower than operations on bare repo
if target_project == source_project
Gitlab::CompareResult.new(
Gitlab::Git::Compare.new(
diff --git a/app/services/create_branch_service.rb b/app/services/create_branch_service.rb
index 98beeee8354..901f67bafb3 100644
--- a/app/services/create_branch_service.rb
+++ b/app/services/create_branch_service.rb
@@ -1,13 +1,32 @@
-class CreateBranchService
- def execute(project, branch_name, ref, current_user)
+require_relative 'base_service'
+
+class CreateBranchService < BaseService
+ def execute(branch_name, ref)
+ valid_branch = Gitlab::GitRefValidator.validate(branch_name)
+ if valid_branch == false
+ return error('Branch name invalid')
+ end
+
repository = project.repository
+ existing_branch = repository.find_branch(branch_name)
+ if existing_branch
+ return error('Branch already exists')
+ end
+
repository.add_branch(branch_name, ref)
new_branch = repository.find_branch(branch_name)
if new_branch
Event.create_ref_event(project, current_user, new_branch, 'add')
+ return success(new_branch)
+ else
+ return error('Invalid reference name')
end
+ end
- new_branch
+ def success(branch)
+ out = super()
+ out[:branch] = branch
+ out
end
end
diff --git a/app/services/create_tag_service.rb b/app/services/create_tag_service.rb
index 97766677405..9b2a2270233 100644
--- a/app/services/create_tag_service.rb
+++ b/app/services/create_tag_service.rb
@@ -1,13 +1,36 @@
-class CreateTagService
- def execute(project, tag_name, ref, current_user)
+require_relative 'base_service'
+
+class CreateTagService < BaseService
+ def execute(tag_name, ref, message)
+ valid_tag = Gitlab::GitRefValidator.validate(tag_name)
+ if valid_tag == false
+ return error('Tag name invalid')
+ end
+
repository = project.repository
- repository.add_tag(tag_name, ref)
+ existing_tag = repository.find_tag(tag_name)
+ if existing_tag
+ return error('Tag already exists')
+ end
+
+ if message
+ message.gsub!(/^\s+|\s+$/, '')
+ end
+
+ repository.add_tag(tag_name, ref, message)
new_tag = repository.find_tag(tag_name)
if new_tag
Event.create_ref_event(project, current_user, new_tag, 'add', 'refs/tags')
+ return success(new_tag)
+ else
+ return error('Invalid reference name')
end
+ end
- new_tag
+ def success(branch)
+ out = super()
+ out[:tag] = branch
+ out
end
end
diff --git a/app/services/delete_branch_service.rb b/app/services/delete_branch_service.rb
index ce2d8093dff..cae6327fe72 100644
--- a/app/services/delete_branch_service.rb
+++ b/app/services/delete_branch_service.rb
@@ -1,25 +1,27 @@
-class DeleteBranchService
- def execute(project, branch_name, current_user)
+require_relative 'base_service'
+
+class DeleteBranchService < BaseService
+ def execute(branch_name)
repository = project.repository
branch = repository.find_branch(branch_name)
# No such branch
unless branch
- return error('No such branch')
+ return error('No such branch', 404)
end
if branch_name == repository.root_ref
- return error('Cannot remove HEAD branch')
+ return error('Cannot remove HEAD branch', 405)
end
# Dont allow remove of protected branch
if project.protected_branch?(branch_name)
- return error('Protected branch cant be removed')
+ return error('Protected branch cant be removed', 405)
end
# Dont allow user to remove branch if he is not allowed to push
unless current_user.can?(:push_code, project)
- return error('You dont have push access to repo')
+ return error('You dont have push access to repo', 405)
end
if repository.rm_branch(branch_name)
@@ -30,17 +32,15 @@ class DeleteBranchService
end
end
- def error(message)
- {
- message: message,
- state: :error
- }
+ def error(message, return_code = 400)
+ out = super(message)
+ out[:return_code] = return_code
+ out
end
def success(message)
- {
- message: message,
- state: :success
- }
+ out = super()
+ out[:message] = message
+ out
end
end
diff --git a/app/services/files/base_service.rb b/app/services/files/base_service.rb
index f1765d38976..db6f0831f8b 100644
--- a/app/services/files/base_service.rb
+++ b/app/services/files/base_service.rb
@@ -10,18 +10,10 @@ module Files
private
- def error(message)
- {
- error: message,
- status: :error
- }
- end
-
def success
- {
- error: '',
- status: :success
- }
+ out = super()
+ out[:error] = ''
+ out
end
def repository
diff --git a/app/services/git_push_service.rb b/app/services/git_push_service.rb
index 715b5690751..fddfddb92ee 100644
--- a/app/services/git_push_service.rb
+++ b/app/services/git_push_service.rb
@@ -17,39 +17,36 @@ class GitPushService
def execute(project, user, oldrev, newrev, ref)
@project, @user = project, user
- # Collect data for this git push
- @push_commits = project.repository.commits_between(oldrev, newrev)
- @push_data = post_receive_data(oldrev, newrev, ref)
-
- create_push_event
-
project.ensure_satellite_exists
project.repository.expire_cache
project.update_repository_size
- if push_to_existing_branch?(ref, oldrev)
- project.update_merge_requests(oldrev, newrev, ref, @user)
- process_commit_messages(ref)
- end
-
if push_to_branch?(ref)
- project.execute_hooks(@push_data.dup, :push_hooks)
- project.execute_services(@push_data.dup)
- end
-
- if push_to_new_branch?(ref, oldrev)
- # Re-find the pushed commits.
- if is_default_branch?(ref)
- # Initial push to the default branch. Take the full history of that branch as "newly pushed".
- @push_commits = project.repository.commits(newrev)
- else
- # Use the pushed commits that aren't reachable by the default branch
- # as a heuristic. This may include more commits than are actually pushed, but
- # that shouldn't matter because we check for existing cross-references later.
- @push_commits = project.repository.commits_between(project.default_branch, newrev)
+ if push_remove_branch?(ref, newrev)
+ @push_commits = []
+ elsif push_to_new_branch?(ref, oldrev)
+ # Re-find the pushed commits.
+ if is_default_branch?(ref)
+ # Initial push to the default branch. Take the full history of that branch as "newly pushed".
+ @push_commits = project.repository.commits(newrev)
+ else
+ # Use the pushed commits that aren't reachable by the default branch
+ # as a heuristic. This may include more commits than are actually pushed, but
+ # that shouldn't matter because we check for existing cross-references later.
+ @push_commits = project.repository.commits_between(project.default_branch, newrev)
+ end
+ process_commit_messages(ref)
+ elsif push_to_existing_branch?(ref, oldrev)
+ # Collect data for this git push
+ @push_commits = project.repository.commits_between(oldrev, newrev)
+ project.update_merge_requests(oldrev, newrev, ref, @user)
+ process_commit_messages(ref)
end
- process_commit_messages(ref)
+ @push_data = post_receive_data(oldrev, newrev, ref)
+ create_push_event(@push_data)
+ project.execute_hooks(@push_data.dup, :push_hooks)
+ project.execute_services(@push_data.dup)
end
end
@@ -65,7 +62,7 @@ class GitPushService
protected
- def create_push_event
+ def create_push_event(push_data)
Event.create!(
project: project,
action: Event::PUSHED,
@@ -179,6 +176,12 @@ class GitPushService
ref_parts[1] =~ /heads/ && oldrev == "0000000000000000000000000000000000000000"
end
+ def push_remove_branch? ref, newrev
+ ref_parts = ref.split('/')
+
+ ref_parts[1] =~ /heads/ && newrev == "0000000000000000000000000000000000000000"
+ end
+
def push_to_branch? ref
ref =~ /refs\/heads/
end
diff --git a/app/services/notification_service.rb b/app/services/notification_service.rb
index 36d33e0d7ca..fe39f83b400 100644
--- a/app/services/notification_service.rb
+++ b/app/services/notification_service.rb
@@ -157,12 +157,12 @@ class NotificationService
end
end
- def new_team_member(users_project)
- mailer.project_access_granted_email(users_project.id)
+ def new_team_member(project_member)
+ mailer.project_access_granted_email(project_member.id)
end
- def update_team_member(users_project)
- mailer.project_access_granted_email(users_project.id)
+ def update_team_member(project_member)
+ mailer.project_access_granted_email(project_member.id)
end
def new_group_member(users_group)
@@ -186,20 +186,20 @@ class NotificationService
# Get project users with WATCH notification level
def project_watchers(project)
- project_members = users_project_notification(project)
+ project_members = project_member_notification(project)
- users_with_project_level_global = users_project_notification(project, Notification::N_GLOBAL)
+ users_with_project_level_global = project_member_notification(project, Notification::N_GLOBAL)
users_with_group_level_global = users_group_notification(project, Notification::N_GLOBAL)
users = users_with_global_level_watch([users_with_project_level_global, users_with_group_level_global].flatten.uniq)
- users_with_project_setting = select_users_project_setting(project, users_with_project_level_global, users)
+ users_with_project_setting = select_project_member_setting(project, users_with_project_level_global, users)
users_with_group_setting = select_users_group_setting(project, project_members, users_with_group_level_global, users)
User.where(id: users_with_project_setting.concat(users_with_group_setting).uniq).to_a
end
- def users_project_notification(project, notification_level=nil)
- project_members = project.users_projects
+ def project_member_notification(project, notification_level=nil)
+ project_members = project.project_members
if notification_level
project_members.where(notification_level: notification_level).pluck(:user_id)
@@ -210,7 +210,7 @@ class NotificationService
def users_group_notification(project, notification_level)
if project.group
- project.group.users_groups.where(notification_level: notification_level).pluck(:user_id)
+ project.group.group_members.where(notification_level: notification_level).pluck(:user_id)
else
[]
end
@@ -224,8 +224,8 @@ class NotificationService
end
# Build a list of users based on project notifcation settings
- def select_users_project_setting(project, global_setting, users_global_level_watch)
- users = users_project_notification(project, Notification::N_WATCH)
+ def select_project_member_setting(project, global_setting, users_global_level_watch)
+ users = project_member_notification(project, Notification::N_WATCH)
# If project setting is global, add to watch list if global setting is watch
global_setting.each do |user_id|
@@ -267,10 +267,10 @@ class NotificationService
users.reject do |user|
next user.notification.disabled? unless project
- tm = project.users_projects.find_by(user_id: user.id)
+ tm = project.project_members.find_by(user_id: user.id)
if !tm && project.group
- tm = project.group.users_groups.find_by(user_id: user.id)
+ tm = project.group.group_members.find_by(user_id: user.id)
end
# reject users who globally disabled notification and has no membership
diff --git a/app/services/projects/create_service.rb b/app/services/projects/create_service.rb
index 2bfb0f28d95..12386792aab 100644
--- a/app/services/projects/create_service.rb
+++ b/app/services/projects/create_service.rb
@@ -42,10 +42,7 @@ module Projects
system_hook_service.execute_hooks_for(@project, :create)
unless @project.group
- @project.users_projects.create(
- project_access: UsersProject::MASTER,
- user: current_user
- )
+ @project.team << [current_user, :master]
end
@project.update_column(:last_activity_at, @project.created_at)
diff --git a/app/services/projects/fork_service.rb b/app/services/projects/fork_service.rb
index 66f0a02f0af..a59311bf942 100644
--- a/app/services/projects/fork_service.rb
+++ b/app/services/projects/fork_service.rb
@@ -27,7 +27,7 @@ module Projects
#First save the DB entries as they can be rolled back if the repo fork fails
project.build_forked_project_link(forked_to_project_id: project.id, forked_from_project_id: @from_project.id)
if project.save
- project.users_projects.create(project_access: UsersProject::MASTER, user: current_user)
+ project.team << [current_user, :master]
end
#Now fork the repo
unless gitlab_shell.fork_repository(@from_project.path_with_namespace, project.namespace.path)
diff --git a/app/services/search/global_service.rb b/app/services/search/global_service.rb
index d213e1375e0..0bcc50c81a7 100644
--- a/app/services/search/global_service.rb
+++ b/app/services/search/global_service.rb
@@ -7,30 +7,12 @@ module Search
end
def execute
- query = params[:search]
- query = Shellwords.shellescape(query) if query.present?
- return result unless query.present?
-
group = Group.find_by(id: params[:group_id]) if params[:group_id].present?
projects = ProjectsFinder.new.execute(current_user)
projects = projects.where(namespace_id: group.id) if group
project_ids = projects.pluck(:id)
- result[:projects] = projects.search(query).limit(20)
- result[:merge_requests] = MergeRequest.in_projects(project_ids).search(query).order('updated_at DESC').limit(20)
- result[:issues] = Issue.where(project_id: project_ids).search(query).order('updated_at DESC').limit(20)
- result[:total_results] = %w(projects issues merge_requests).sum { |items| result[items.to_sym].size }
- result
- end
-
- def result
- @result ||= {
- projects: [],
- merge_requests: [],
- issues: [],
- notes: [],
- total_results: 0,
- }
+ Gitlab::SearchResults.new(project_ids, params[:search])
end
end
end
diff --git a/app/services/search/project_service.rb b/app/services/search/project_service.rb
index 8aac18840e4..f630c0a3790 100644
--- a/app/services/search/project_service.rb
+++ b/app/services/search/project_service.rb
@@ -7,39 +7,9 @@ module Search
end
def execute
- query = params[:search]
- query = Shellwords.shellescape(query) if query.present?
- return result unless query.present?
-
- if params[:search_code].present?
- if !@project.empty_repo?
- blobs = project.repository.search_files(query,
- params[:repository_ref])
- else
- blobs = Array.new
- end
-
- blobs = Kaminari.paginate_array(blobs).page(params[:page]).per(20)
- result[:blobs] = blobs
- result[:total_results] = blobs.total_count
- else
- result[:merge_requests] = project.merge_requests.search(query).order('updated_at DESC').limit(20)
- result[:issues] = project.issues.where("title like :query OR description like :query ", query: "%#{query}%").order('updated_at DESC').limit(20)
- result[:notes] = Note.where(noteable_type: 'issue').where(project_id: project.id).where("note like :query", query: "%#{query}%").order('updated_at DESC').limit(20)
- result[:total_results] = %w(issues merge_requests notes).sum { |items| result[items.to_sym].size }
- end
-
- result
- end
-
- def result
- @result ||= {
- merge_requests: [],
- issues: [],
- blobs: [],
- notes: [],
- total_results: 0,
- }
+ Gitlab::ProjectSearchResults.new(project.id,
+ params[:search],
+ params[:repository_ref])
end
end
end
diff --git a/app/services/search/snippet_service.rb b/app/services/search/snippet_service.rb
new file mode 100644
index 00000000000..8ca0877321d
--- /dev/null
+++ b/app/services/search/snippet_service.rb
@@ -0,0 +1,14 @@
+module Search
+ class SnippetService
+ attr_accessor :current_user, :params
+
+ def initialize(user, params)
+ @current_user, @params = user, params.dup
+ end
+
+ def execute
+ snippet_ids = Snippet.accessible_to(current_user).pluck(:id)
+ Gitlab::SnippetSearchResults.new(snippet_ids, params[:search])
+ end
+ end
+end
diff --git a/app/services/system_hooks_service.rb b/app/services/system_hooks_service.rb
index 41014f199d5..a6b68749a71 100644
--- a/app/services/system_hooks_service.rb
+++ b/app/services/system_hooks_service.rb
@@ -22,6 +22,16 @@ class SystemHooksService
}
case model
+ when Key
+ data.merge!(
+ key: model.key,
+ id: model.id
+ )
+ if model.user
+ data.merge!(
+ username: model.user.username
+ )
+ end
when Project
owner = model.owner
@@ -40,14 +50,14 @@ class SystemHooksService
email: model.email,
user_id: model.id
})
- when UsersProject
+ when ProjectMember
data.merge!({
project_name: model.project.name,
project_path: model.project.path,
- project_id: model.project_id,
+ project_id: model.project.id,
user_name: model.user.name,
user_email: model.user.email,
- project_access: model.human_access,
+ access_level: model.human_access,
project_visibility: Project.visibility_levels.key(model.project.visibility_level_field).downcase
})
end
@@ -55,7 +65,7 @@ class SystemHooksService
def build_event_name(model, event)
case model
- when UsersProject
+ when ProjectMember
return "user_add_to_team" if event == :create
return "user_remove_from_team" if event == :destroy
else
diff --git a/app/views/admin/groups/show.html.haml b/app/views/admin/groups/show.html.haml
index 8634f46053d..d59d2a23179 100644
--- a/app/views/admin/groups/show.html.haml
+++ b/app/views/admin/groups/show.html.haml
@@ -62,7 +62,7 @@
%div
= users_select_tag(:user_ids, multiple: true)
%div.prepend-top-10
- = select_tag :group_access, options_for_select(UsersGroup.group_access_roles), class: "project-access-select select2"
+ = select_tag :access_level, options_for_select(GroupMember.access_level_roles), class: "project-access-select select2"
%hr
= submit_tag 'Add users into group', class: "btn btn-create"
.panel.panel-default
@@ -70,7 +70,7 @@
%h3.panel-title
Members
%span.badge
- #{@group.users_groups.count}
+ #{@group.group_members.count}
%ul.well-list.group-users-list
- @members.each do |member|
- user = member.user
@@ -80,7 +80,7 @@
= link_to user.name, admin_user_path(user)
%span.pull-right.light
= member.human_access
- = link_to group_users_group_path(@group, member), data: { confirm: remove_user_from_group_message(@group, user) }, method: :delete, remote: true, class: "btn-tiny btn btn-remove", title: 'Remove user from group' do
+ = link_to group_group_members_path(@group, member), data: { confirm: remove_user_from_group_message(@group, user) }, method: :delete, remote: true, class: "btn-tiny btn btn-remove", title: 'Remove user from group' do
%i.icon-minus.icon-white
.panel-footer
= paginate @members, param_name: 'members_page', theme: 'gitlab'
diff --git a/app/views/admin/projects/show.html.haml b/app/views/admin/projects/show.html.haml
index 66a72449f40..8413f0cb7f9 100644
--- a/app/views/admin/projects/show.html.haml
+++ b/app/views/admin/projects/show.html.haml
@@ -95,13 +95,13 @@
.panel.panel-default
.panel-heading
%strong #{@group.name}
- group members (#{@group.users_groups.count})
+ group members (#{@group.group_members.count})
.pull-right
= link_to admin_group_path(@group), class: 'btn btn-small' do
%i.icon-edit
%ul.well-list
- @group_members.each do |member|
- = render 'users_groups/users_group', member: member, show_controls: false
+ = render 'groups/group_members/group_member', member: member, show_controls: false
.panel-footer
= paginate @group_members, param_name: 'group_members_page', theme: 'gitlab'
@@ -115,17 +115,17 @@
%i.icon-edit
Manage Access
%ul.well-list.team_members
- - @project_members.each do |users_project|
- - user = users_project.user
- %li.users_project
+ - @project_members.each do |project_member|
+ - user = project_member.user
+ %li.project_member
.list-item-name
%strong
= link_to user.name, admin_user_path(user)
.pull-right
- - if users_project.owner?
+ - if project_member.owner?
%span.light Owner
- else
- %span.light= users_project.human_access
+ %span.light= project_member.human_access
= link_to project_team_member_path(@project, user), data: { confirm: remove_from_project_team_message(@project, user)}, method: :delete, remote: true, class: "btn btn-small btn-remove" do
%i.icon-remove
.panel-footer
diff --git a/app/views/admin/users/index.html.haml b/app/views/admin/users/index.html.haml
index b8a18224443..f2fa5ea91c1 100644
--- a/app/views/admin/users/index.html.haml
+++ b/app/views/admin/users/index.html.haml
@@ -22,7 +22,7 @@
= form_tag admin_users_path, method: :get, class: 'form-inline' do
.form-group
= search_field_tag :name, params[:name], placeholder: 'Name, email or username', class: 'form-control'
- = button_tag type: 'submit', class: 'btn btn-primary' do
+ = button_tag class: 'btn btn-primary' do
%i.icon-search
%hr
= link_to 'Reset', admin_users_path, class: "btn btn-cancel"
diff --git a/app/views/admin/users/show.html.haml b/app/views/admin/users/show.html.haml
index 3c30ccd78b3..a172d12edb1 100644
--- a/app/views/admin/users/show.html.haml
+++ b/app/views/admin/users/show.html.haml
@@ -71,6 +71,14 @@
No
%li
+ %span.light Current sign-in at:
+ %strong
+ - if @user.current_sign_in_at
+ = @user.current_sign_in_at.stamp("Nov 12, 2031")
+ - else
+ never
+
+ %li
%span.light Last sign-in at:
%strong
- if @user.last_sign_in_at
@@ -151,13 +159,13 @@
= render 'users/profile', user: @user
#groups.tab-pane
- - if @user.users_groups.present?
+ - if @user.group_members.present?
.panel.panel-default
.panel-heading Groups:
%ul.well-list
- - @user.users_groups.each do |user_group|
+ - @user.group_members.each do |user_group|
- group = user_group.group
- %li.users_group
+ %li.group_member
%span{class: ("list-item-name" unless user_group.owner?)}
%strong= link_to group.name, admin_group_path(group)
.pull-right
@@ -189,7 +197,7 @@
%ul.well-list
- @joined_projects.sort_by(&:name_with_namespace).each do |project|
- tm = project.team.find_tm(@user.id)
- %li.users_project
+ %li.project_member
.list-item-name
= link_to admin_project_path(project), class: dom_class(project) do
= project.name_with_namespace
diff --git a/app/views/dashboard/_groups.html.haml b/app/views/dashboard/_groups.html.haml
index cb9c18b7966..9bcc77b8d8e 100644
--- a/app/views/dashboard/_groups.html.haml
+++ b/app/views/dashboard/_groups.html.haml
@@ -2,10 +2,9 @@
.panel-heading.clearfix
= search_field_tag :filter_group, nil, placeholder: 'Filter by name', class: 'dash-filter form-control'
- if current_user.can_create_group?
- %span.pull-right
- = link_to new_group_path, class: "btn btn-new" do
- %i.icon-plus
- New group
+ = link_to new_group_path, class: "btn btn-new pull-right" do
+ %i.icon-plus
+ New group
%ul.well-list.dash-list
- groups.each do |group|
%li.group-row
diff --git a/app/views/dashboard/_projects.html.haml b/app/views/dashboard/_projects.html.haml
index 5a49bf0c6b1..0cc253a8dd1 100644
--- a/app/views/dashboard/_projects.html.haml
+++ b/app/views/dashboard/_projects.html.haml
@@ -2,10 +2,9 @@
.panel-heading.clearfix
= search_field_tag :filter_projects, nil, placeholder: 'Filter by name', class: 'dash-filter form-control'
- if current_user.can_create_project?
- %span.pull-right
- = link_to new_project_path, class: "btn btn-new" do
- %i.icon-plus
- New project
+ = link_to new_project_path, class: "btn btn-new pull-right" do
+ %i.icon-plus
+ New project
%ul.well-list.dash-list
- projects.each do |project|
diff --git a/app/views/devise/sessions/_oauth_providers.html.haml b/app/views/devise/sessions/_oauth_providers.html.haml
index a917484a231..15048a78063 100644
--- a/app/views/devise/sessions/_oauth_providers.html.haml
+++ b/app/views/devise/sessions/_oauth_providers.html.haml
@@ -1,6 +1,6 @@
- providers = (enabled_oauth_providers - [:ldap])
- if providers.present?
- %div.light-well{:'data-no-turbolink' => 'data-no-turbolink'}
+ .bs-callout.bs-callout-info{:'data-no-turbolink' => 'data-no-turbolink'}
%span Sign in with: &nbsp;
- providers.each do |provider|
%span
diff --git a/app/views/events/_event_issue.atom.haml b/app/views/events/_event_issue.atom.haml
index 56801107d05..eba2b63797a 100644
--- a/app/views/events/_event_issue.atom.haml
+++ b/app/views/events/_event_issue.atom.haml
@@ -1,2 +1,3 @@
-%div{:xmlns => "http://www.w3.org/1999/xhtml"}
- %p= markdown issue.description
+%div{xmlns: "http://www.w3.org/1999/xhtml"}
+ - if issue.description.present?
+ = markdown issue.description
diff --git a/app/views/events/_event_merge_request.atom.haml b/app/views/events/_event_merge_request.atom.haml
index dea256bb7f2..0aea2d17d65 100644
--- a/app/views/events/_event_merge_request.atom.haml
+++ b/app/views/events/_event_merge_request.atom.haml
@@ -1,2 +1,3 @@
%div{xmlns: "http://www.w3.org/1999/xhtml"}
- %p= markdown merge_request.description
+ - if merge_request.description.present?
+ = markdown merge_request.description
diff --git a/app/views/events/_event_note.atom.haml b/app/views/events/_event_note.atom.haml
index 96039ad18dc..be0e05481ed 100644
--- a/app/views/events/_event_note.atom.haml
+++ b/app/views/events/_event_note.atom.haml
@@ -1,2 +1,2 @@
-%div{:xmlns => "http://www.w3.org/1999/xhtml"}
- %p= markdown note.note
+%div{xmlns: "http://www.w3.org/1999/xhtml"}
+ = markdown note.note
diff --git a/app/views/explore/projects/_project.html.haml b/app/views/explore/projects/_project.html.haml
index 0b4be2ef5cd..fd5aacbfdb4 100644
--- a/app/views/explore/projects/_project.html.haml
+++ b/app/views/explore/projects/_project.html.haml
@@ -1,15 +1,14 @@
%li
- .project-access-icon
- = visibility_level_icon(project.visibility_level)
+ %h4.project-title
+ .project-access-icon
+ = visibility_level_icon(project.visibility_level)
+ = link_to project.name_with_namespace, project
- .project-description
- %h4.project-title
- = link_to project.name_with_namespace, project
-
- - if current_page?(starred_explore_projects_path)
- %strong.pull-right
- = pluralize project.star_count, 'star'
+ - if current_page?(starred_explore_projects_path)
+ %strong.pull-right
+ = pluralize project.star_count, 'star'
+ .project-info
- if project.description.present?
%p.project-description.str-truncated
= project.description
diff --git a/app/views/groups/_new_group_member.html.haml b/app/views/groups/_new_group_member.html.haml
index 3ab9276c541..e590ddbf931 100644
--- a/app/views/groups/_new_group_member.html.haml
+++ b/app/views/groups/_new_group_member.html.haml
@@ -1,11 +1,11 @@
-= form_for @users_group, url: group_users_groups_path(@group), html: { class: 'form-horizontal users-group-form' } do |f|
+= form_for @users_group, url: group_group_members_path(@group), html: { class: 'form-horizontal users-group-form' } do |f|
.form-group
= f.label :user_ids, "People", class: 'control-label'
.col-sm-10= users_select_tag(:user_ids, multiple: true, class: 'input-large')
.form-group
- = f.label :group_access, "Group Access", class: 'control-label'
- .col-sm-10= select_tag :group_access, options_for_select(UsersGroup.group_access_roles, @users_group.group_access), class: "project-access-select select2"
+ = f.label :access_level, "Group Access", class: 'control-label'
+ .col-sm-10= select_tag :access_level, options_for_select(GroupMember.access_level_roles, @users_group.access_level), class: "project-access-select select2"
.form-actions
= f.submit 'Add users into group', class: "btn btn-create"
diff --git a/app/views/users_groups/_users_group.html.haml b/app/views/groups/group_members/_group_member.html.haml
index ad363eaba23..099e50a384e 100644
--- a/app/views/users_groups/_users_group.html.haml
+++ b/app/views/groups/group_members/_group_member.html.haml
@@ -21,11 +21,11 @@
= link_to leave_profile_group_path(@group), data: { confirm: leave_group_message(@group.name)}, method: :delete, class: "btn-tiny btn btn-remove", title: 'Remove user from group' do
%i.icon-minus.icon-white
- else
- = link_to group_users_group_path(@group, member), data: { confirm: remove_user_from_group_message(@group, user) }, method: :delete, remote: true, class: "btn-tiny btn btn-remove", title: 'Remove user from group' do
+ = link_to group_group_member_path(@group, member), data: { confirm: remove_user_from_group_message(@group, user) }, method: :delete, remote: true, class: "btn-tiny btn btn-remove", title: 'Remove user from group' do
%i.icon-minus.icon-white
.edit-member.hide.js-toggle-content
= form_for [@group, member], remote: true do |f|
.alert.prepend-top-20
- = f.select :group_access, options_for_select(UsersGroup.group_access_roles, member.group_access)
+ = f.select :access_level, options_for_select(GroupMember.access_level_roles, member.access_level)
= f.submit 'Save', class: 'btn btn-save btn-small'
diff --git a/app/views/users_groups/update.js.haml b/app/views/groups/group_members/update.js.haml
index 5bad48abafd..5bad48abafd 100644
--- a/app/views/users_groups/update.js.haml
+++ b/app/views/groups/group_members/update.js.haml
diff --git a/app/views/groups/members.html.haml b/app/views/groups/members.html.haml
index 19819c96124..ebf407d4ef1 100644
--- a/app/views/groups/members.html.haml
+++ b/app/views/groups/members.html.haml
@@ -32,7 +32,7 @@
(#{@members.total_count})
%ul.well-list
- @members.each do |member|
- = render 'users_groups/users_group', member: member, show_roles: show_roles, show_controls: true
+ = render 'groups/group_members/group_member', member: member, show_roles: show_roles, show_controls: true
= paginate @members, theme: 'gitlab'
:coffeescript
diff --git a/app/views/help/_shortcuts.html.haml b/app/views/help/_shortcuts.html.haml
index 500e5dc65e1..467f003b333 100644
--- a/app/views/help/_shortcuts.html.haml
+++ b/app/views/help/_shortcuts.html.haml
@@ -3,30 +3,207 @@
.modal-content
.modal-header
%a.close{href: "#", "data-dismiss" => "modal"} ×
- %h3 Keyboard Shortcuts
- .modal-body
- %h5 Global Shortcuts
- %p
- %span.label.label-inverse s
- &ndash;
- Focus Search
- %p
- %span.label.label-inverse ?
- &ndash;
- Show this dialog
+ %h4
+ Keyboard Shortcuts
+ %small
+ = link_to '(Show all)', '#', class: 'js-more-help-button'
+ .modal-body.shortcuts-cheatsheet
+ .col-lg-4
+ %table.shortcut-mappings
+ %tbody
+ %tr
+ %th
+ %th Global Shortcuts
+ %tr
+ %td.shortcut
+ .key s
+ %td Focus Search
+ %tr
+ %td.shortcut
+ .key ?
+ %td Show this dialog
+ %tbody
+ %tr
+ %th
+ %th Project Files browsing
+ %tr
+ %td.shortcut
+ .key
+ %i.icon-arrow-up
+ %td Move selection up
+ %tr
+ %td.shortcut
+ .key
+ %i.icon-arrow-down
+ %td Move selection down
+ %tr
+ %td.shortcut
+ .key enter
+ %td Open Selection
- %h5 Project Files browsing
- %p
- %span.label.label-inverse
- %i.icon-arrow-up
- &ndash;
- Move selection up
- %p
- %span.label.label-inverse
- %i.icon-arrow-down
- &ndash;
- Move selection down
- %p
- %span.label.label-inverse Enter
- &ndash;
- Open selection
+ .col-lg-4
+ %table.shortcut-mappings
+ %tbody{ class: 'hidden-shortcut project', style: 'display:none' }
+ %tr
+ %th
+ %th Global Dashboard
+ %tr
+ %td.shortcut
+ .key g
+ .key a
+ %td
+ Go to the activity feed
+ %tr
+ %td.shortcut
+ .key g
+ .key p
+ %td
+ Go to projects
+ %tr
+ %td.shortcut
+ .key g
+ .key i
+ %td
+ Go to issues
+ %tr
+ %td.shortcut
+ .key g
+ .key m
+ %td
+ Go to merge requests
+ %tbody
+ %tr
+ %th
+ %th Project
+ %tr
+ %td.shortcut
+ .key g
+ .key p
+ %td
+ Go to the project's activity feed
+ %tr
+ %td.shortcut
+ .key g
+ .key f
+ %td
+ Go to files
+ %tr
+ %td.shortcut
+ .key g
+ .key c
+ %td
+ Go to commits
+ %tr
+ %td.shortcut
+ .key g
+ .key n
+ %td
+ Go to network graph
+ %tr
+ %td.shortcut
+ .key g
+ .key g
+ %td
+ Go to graphs
+ %tr
+ %td.shortcut
+ .key g
+ .key i
+ %td
+ Go to issues
+ %tr
+ %td.shortcut
+ .key g
+ .key m
+ %td
+ Go to merge requests
+ %tr
+ %td.shortcut
+ .key g
+ .key s
+ %td
+ Go to snippets
+ .col-lg-4
+ %table.shortcut-mappings
+ %tbody{ class: 'hidden-shortcut network', style: 'display:none' }
+ %tr
+ %th
+ %th Network Graph
+ %tr
+ %td.shortcut
+ .key
+ %i.icon-arrow-left
+ \/
+ .key h
+ %td Scroll left
+ %tr
+ %td.shortcut
+ .key
+ %i.icon-arrow-right
+ \/
+ .key l
+ %td Scroll right
+ %tr
+ %td.shortcut
+ .key
+ %i.icon-arrow-up
+ \/
+ .key k
+ %td Scroll up
+ %tr
+ %td.shortcut
+ .key
+ %i.icon-arrow-down
+ \/
+ .key j
+ %td Scroll down
+ %tr
+ %td.shortcut
+ .key
+ shift
+ %i.icon-arrow-up
+ \/
+ .key
+ shift k
+ %td Scroll to top
+ %tr
+ %td.shortcut
+ .key
+ shift
+ %i.icon-arrow-down
+ \/
+ .key
+ shift j
+ %td Scroll to bottom
+ %tbody{ class: 'hidden-shortcut issues', style: 'display:none' }
+ %tr
+ %th
+ %th Issues
+ %tr
+ %td.shortcut
+ .key a
+ %td Change assignee
+ %tr
+ %td.shortcut
+ .key m
+ %td Change milestone
+ %tbody{ class: 'hidden-shortcut merge_reuests', style: 'display:none' }
+ %tr
+ %th
+ %th Merge Requests
+ %tr
+ %td.shortcut
+ .key a
+ %td Change assignee
+ %tr
+ %td.shortcut
+ .key m
+ %td Change milestone
+
+
+:javascript
+ $('.js-more-help-button').click(function(e){
+ $(this).remove()
+ $('.hidden-shortcut').show()
+ e.preventDefault()
+ });
diff --git a/app/views/help/index.html.haml b/app/views/help/index.html.haml
index 219693af09f..903e093e5fc 100644
--- a/app/views/help/index.html.haml
+++ b/app/views/help/index.html.haml
@@ -37,8 +37,8 @@
= link_to "getting help", "https://www.gitlab.com/getting-help/"
%li
Use the
- = link_to "search bar", '#', onclick: "$('#search').focus();"
+ = link_to 'search bar', '#', onclick: 'Shortcuts.focusSearch(event)'
on the top of this page
%li
Use
- = link_to "shortcuts", '#', onclick: "new Shortcuts()"
+ = link_to 'shortcuts', '#', onclick: 'Shortcuts.showHelp(event)'
diff --git a/app/views/layouts/_search.html.haml b/app/views/layouts/_search.html.haml
index caf0e39234a..5ab82122ad7 100644
--- a/app/views/layouts/_search.html.haml
+++ b/app/views/layouts/_search.html.haml
@@ -5,6 +5,15 @@
- if @project && @project.persisted?
= hidden_field_tag :project_id, @project.id
= hidden_field_tag :search_code, true
+ - if @snippet || @snippets
+ = hidden_field_tag :snippets, true
= hidden_field_tag :repository_ref, @ref
= submit_tag 'Go' if ENV['RAILS_ENV'] == 'test'
.search-autocomplete-opts.hide{:'data-autocomplete-path' => search_autocomplete_path, :'data-autocomplete-project-id' => @project.try(:id), :'data-autocomplete-project-ref' => @ref }
+
+:javascript
+ $('.search-input').on('keyup', function(e) {
+ if (e.keyCode == 27) {
+ $('.search-input').blur()
+ }
+ })
diff --git a/app/views/layouts/admin.html.haml b/app/views/layouts/admin.html.haml
index 1ea91a1914f..207ab22f4c7 100644
--- a/app/views/layouts/admin.html.haml
+++ b/app/views/layouts/admin.html.haml
@@ -4,10 +4,10 @@
%body{class: "#{app_theme} admin", :'data-page' => body_data_page}
= render "layouts/broadcast"
= render "layouts/head_panel", title: "Admin area"
- = render "layouts/flash"
%nav.main-nav.navbar-collapse.collapse
.container= render 'layouts/nav/admin'
-
.container
- .content= yield
+ .content
+ = render "layouts/flash"
+ = yield
= yield :embedded_scripts
diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml
index 511db389e0f..7d0819aa93e 100644
--- a/app/views/layouts/application.html.haml
+++ b/app/views/layouts/application.html.haml
@@ -4,9 +4,9 @@
%body{class: "#{app_theme} application", :'data-page' => body_data_page }
= render "layouts/broadcast"
= render "layouts/head_panel", title: "Dashboard"
- = render "layouts/flash"
%nav.main-nav.navbar-collapse.collapse
.container= render 'layouts/nav/dashboard'
-
.container
- .content= yield
+ .content
+ = render "layouts/flash"
+ = yield
diff --git a/app/views/layouts/devise.html.haml b/app/views/layouts/devise.html.haml
index ffa48a68b42..06de03eadad 100644
--- a/app/views/layouts/devise.html.haml
+++ b/app/views/layouts/devise.html.haml
@@ -2,7 +2,6 @@
%html{ lang: "en"}
= render "layouts/head"
%body.ui_basic.login-page
- = render "layouts/flash"
.container
.content
.login-title
@@ -10,6 +9,7 @@
%hr
.container
.content
+ = render "layouts/flash"
.row
.col-md-7.brand-holder
- if brand_item
diff --git a/app/views/layouts/errors.html.haml b/app/views/layouts/errors.html.haml
index d0e276d751a..16df9c10fbb 100644
--- a/app/views/layouts/errors.html.haml
+++ b/app/views/layouts/errors.html.haml
@@ -3,7 +3,7 @@
= render "layouts/head", title: "Error"
%body{class: "#{app_theme} application"}
= render "layouts/head_panel", title: "" if current_user
- = render "layouts/flash"
.container.navless-container
+ = render "layouts/flash"
.error-page
= yield
diff --git a/app/views/layouts/group.html.haml b/app/views/layouts/group.html.haml
index fb4a3a3ba95..f22fb236cb5 100644
--- a/app/views/layouts/group.html.haml
+++ b/app/views/layouts/group.html.haml
@@ -4,9 +4,9 @@
%body{class: "#{app_theme} application", :'data-page' => body_data_page}
= render "layouts/broadcast"
= render "layouts/head_panel", title: "group: #{@group.name}"
- = render "layouts/flash"
%nav.main-nav.navbar-collapse.collapse
.container= render 'layouts/nav/group'
-
.container
- .content= yield
+ .content
+ = render "layouts/flash"
+ = yield
diff --git a/app/views/layouts/nav/_dashboard.html.haml b/app/views/layouts/nav/_dashboard.html.haml
index a300bbc1904..a6e9772d93f 100644
--- a/app/views/layouts/nav/_dashboard.html.haml
+++ b/app/views/layouts/nav/_dashboard.html.haml
@@ -1,16 +1,16 @@
%ul
= nav_link(path: 'dashboard#show', html_options: {class: 'home'}) do
- = link_to root_path, title: "Home" do
+ = link_to root_path, title: 'Home', class: 'shortcuts-activity' do
Activity
= nav_link(path: 'dashboard#projects') do
- = link_to projects_dashboard_path do
+ = link_to projects_dashboard_path, class: 'shortcuts-projects' do
Projects
= nav_link(path: 'dashboard#issues') do
- = link_to issues_dashboard_path do
+ = link_to issues_dashboard_path, class: 'shortcuts-issues' do
Issues
%span.count= current_user.assigned_issues.opened.count
= nav_link(path: 'dashboard#merge_requests') do
- = link_to merge_requests_dashboard_path do
+ = link_to merge_requests_dashboard_path, class: 'shortcuts-merge_requests' do
Merge Requests
%span.count= current_user.assigned_merge_requests.opened.count
= nav_link(controller: :help) do
diff --git a/app/views/layouts/nav/_project.html.haml b/app/views/layouts/nav/_project.html.haml
index 69491c2529e..6cb2a82bac8 100644
--- a/app/views/layouts/nav/_project.html.haml
+++ b/app/views/layouts/nav/_project.html.haml
@@ -1,44 +1,43 @@
-%ul
+%ul.project-navigation
= nav_link(path: 'projects#show', html_options: {class: "home"}) do
- = link_to project_path(@project), title: "Project" do
- Activity
-
+ = link_to project_path(@project), title: 'Project', class: 'shortcuts-project' do
+ Project
- if project_nav_tab? :files
= nav_link(controller: %w(tree blob blame edit_tree new_tree)) do
- = link_to 'Files', project_tree_path(@project, @ref || @repository.root_ref)
+ = link_to 'Files', project_tree_path(@project, @ref || @repository.root_ref), class: 'shortcuts-tree'
- if project_nav_tab? :commits
= nav_link(controller: %w(commit commits compare repositories tags branches)) do
- = link_to "Commits", project_commits_path(@project, @ref || @repository.root_ref)
+ = link_to "Commits", project_commits_path(@project, @ref || @repository.root_ref), class: 'shortcuts-commits'
- if project_nav_tab? :network
= nav_link(controller: %w(network)) do
- = link_to "Network", project_network_path(@project, @ref || @repository.root_ref)
+ = link_to "Network", project_network_path(@project, @ref || @repository.root_ref), class: 'shortcuts-network'
- if project_nav_tab? :graphs
= nav_link(controller: %w(graphs)) do
- = link_to "Graphs", project_graph_path(@project, @ref || @repository.root_ref)
+ = link_to "Graphs", project_graph_path(@project, @ref || @repository.root_ref), class: 'shortcuts-graphs'
- if project_nav_tab? :issues
= nav_link(controller: %w(issues milestones labels)) do
- = link_to url_for_project_issues do
+ = link_to url_for_project_issues, class: 'shortcuts-issues' do
Issues
- if @project.used_default_issues_tracker?
%span.count.issue_counter= @project.issues.opened.count
- if project_nav_tab? :merge_requests
= nav_link(controller: :merge_requests) do
- = link_to project_merge_requests_path(@project) do
+ = link_to project_merge_requests_path(@project), class: 'shortcuts-merge_requests' do
Merge Requests
%span.count.merge_counter= @project.merge_requests.opened.count
- if project_nav_tab? :wiki
= nav_link(controller: :wikis) do
- = link_to 'Wiki', project_wiki_path(@project, :home)
+ = link_to 'Wiki', project_wiki_path(@project, :home), class: 'shortcuts-wiki'
- if project_nav_tab? :snippets
= nav_link(controller: :snippets) do
- = link_to 'Snippets', project_snippets_path(@project)
+ = link_to 'Snippets', project_snippets_path(@project), class: 'shortcuts-snippets'
- if project_nav_tab? :settings
= nav_link(html_options: {class: "#{project_tab_class}"}) do
diff --git a/app/views/layouts/navless.html.haml b/app/views/layouts/navless.html.haml
index c43d688a2cb..2c5fffe384f 100644
--- a/app/views/layouts/navless.html.haml
+++ b/app/views/layouts/navless.html.haml
@@ -4,8 +4,7 @@
%body{class: "#{app_theme} application", :'data-page' => body_data_page}
= render "layouts/broadcast"
= render "layouts/head_panel", title: @title
- = render "layouts/flash"
-
.container.navless-container
.content
+ = render "layouts/flash"
= yield
diff --git a/app/views/layouts/profile.html.haml b/app/views/layouts/profile.html.haml
index 2d869a6cdcb..1d0ab84d26f 100644
--- a/app/views/layouts/profile.html.haml
+++ b/app/views/layouts/profile.html.haml
@@ -4,9 +4,9 @@
%body{class: "#{app_theme} profile", :'data-page' => body_data_page}
= render "layouts/broadcast"
= render "layouts/head_panel", title: "Profile"
- = render "layouts/flash"
%nav.main-nav.navbar-collapse.collapse
.container= render 'layouts/nav/profile'
-
.container
- .content= yield
+ .content
+ = render "layouts/flash"
+ = yield
diff --git a/app/views/layouts/project_settings.html.haml b/app/views/layouts/project_settings.html.haml
index 5659cfab31d..c8b8f4ba971 100644
--- a/app/views/layouts/project_settings.html.haml
+++ b/app/views/layouts/project_settings.html.haml
@@ -5,15 +5,13 @@
= render "layouts/broadcast"
= render "layouts/head_panel", title: project_title(@project)
= render "layouts/init_auto_complete"
- = render "layouts/flash"
- if can?(current_user, :download_code, @project)
= render 'shared/no_ssh'
-
%nav.main-nav.navbar-collapse.collapse
.container= render 'layouts/nav/project'
-
.container
.content
+ = render "layouts/flash"
.row
.col-md-2
= render "projects/settings_nav"
diff --git a/app/views/layouts/projects.html.haml b/app/views/layouts/projects.html.haml
index f02eca6bd7c..8ad2f165946 100644
--- a/app/views/layouts/projects.html.haml
+++ b/app/views/layouts/projects.html.haml
@@ -5,13 +5,12 @@
= render "layouts/broadcast"
= render "layouts/head_panel", title: project_title(@project)
= render "layouts/init_auto_complete"
- = render "layouts/flash"
- if can?(current_user, :download_code, @project)
= render 'shared/no_ssh'
-
%nav.main-nav.navbar-collapse.collapse
.container= render 'layouts/nav/project'
-
.container
- .content= yield
+ .content
+ = render "layouts/flash"
+ = yield
= yield :embedded_scripts
diff --git a/app/views/layouts/search.html.haml b/app/views/layouts/search.html.haml
index 97ed8ba12df..084ff7ec830 100644
--- a/app/views/layouts/search.html.haml
+++ b/app/views/layouts/search.html.haml
@@ -4,8 +4,7 @@
%body{class: "#{app_theme} application", :'data-page' => body_data_page}
= render "layouts/broadcast"
= render "layouts/head_panel", title: "Search"
- = render "layouts/flash"
-
.container.navless-container
.content
+ = render "layouts/flash"
= yield
diff --git a/app/views/layouts/user_team.html.haml b/app/views/layouts/user_team.html.haml
deleted file mode 100644
index ce13853ed7f..00000000000
--- a/app/views/layouts/user_team.html.haml
+++ /dev/null
@@ -1,12 +0,0 @@
-!!! 5
-%html{ lang: "en"}
- = render "layouts/head", title: "#{@team.name}"
- %body{class: "#{app_theme} application", :'data-page' => body_data_page}
- = render "layouts/broadcast"
- = render "layouts/head_panel", title: "team: #{@team.name}"
- = render "layouts/flash"
- %nav.main-nav.navbar-collapse.collapse
- .container= render 'layouts/nav/team'
-
- .container
- .content= yield
diff --git a/app/views/notify/_reassigned_issuable_email.html.haml b/app/views/notify/_reassigned_issuable_email.html.haml
new file mode 100644
index 00000000000..56d81b2ed2e
--- /dev/null
+++ b/app/views/notify/_reassigned_issuable_email.html.haml
@@ -0,0 +1,10 @@
+%p
+ Assignee changed
+ - if @previous_assignee
+ from
+ %strong #{@previous_assignee.name}
+ to
+ - if issuable.assignee_id
+ %strong #{issuable.assignee_name}
+ - else
+ %strong Unassigned
diff --git a/app/views/notify/_reassigned_issuable_email.text.erb b/app/views/notify/_reassigned_issuable_email.text.erb
new file mode 100644
index 00000000000..817d030c362
--- /dev/null
+++ b/app/views/notify/_reassigned_issuable_email.text.erb
@@ -0,0 +1,6 @@
+Reassigned <%= issuable.class.model_name.human.titleize %> <%= issuable.iid %>
+
+<%= url_for([issuable.project, issuable, {only_path: false}]) %>
+
+Assignee changed <%= "from #{@previous_assignee.name}" if @previous_assignee -%>
+ to <%= "#{issuable.assignee_id ? issuable.assignee_name : 'Unassigned'}" %>
diff --git a/app/views/notify/project_access_granted_email.html.haml b/app/views/notify/project_access_granted_email.html.haml
index ce34f825358..4596205f39b 100644
--- a/app/views/notify/project_access_granted_email.html.haml
+++ b/app/views/notify/project_access_granted_email.html.haml
@@ -1,5 +1,5 @@
%p
- = "You have been granted #{@users_project.human_access} access to project"
+ = "You have been granted #{@project_member.human_access} access to project"
%p
= link_to project_url(@project) do
= @project.name_with_namespace
diff --git a/app/views/notify/project_access_granted_email.text.erb b/app/views/notify/project_access_granted_email.text.erb
index 66c57def375..de24feb802f 100644
--- a/app/views/notify/project_access_granted_email.text.erb
+++ b/app/views/notify/project_access_granted_email.text.erb
@@ -1,4 +1,4 @@
-You have been granted <%= @users_project.human_access %> access to project <%= @project.name_with_namespace %>
+You have been granted <%= @project_member.human_access %> access to project <%= @project.name_with_namespace %>
<%= url_for(project_url(@project)) %>
diff --git a/app/views/notify/project_was_moved_email.html.haml b/app/views/notify/project_was_moved_email.html.haml
index 1667c59bc07..fe248584e55 100644
--- a/app/views/notify/project_was_moved_email.html.haml
+++ b/app/views/notify/project_was_moved_email.html.haml
@@ -1,5 +1,5 @@
%p
- = "Project was moved to another location"
+ Project was moved to another location
%p
The project is now located under
= link_to project_url(@project) do
diff --git a/app/views/notify/reassigned_issue_email.html.haml b/app/views/notify/reassigned_issue_email.html.haml
index f1458df5c7b..498ba8b8365 100644
--- a/app/views/notify/reassigned_issue_email.html.haml
+++ b/app/views/notify/reassigned_issue_email.html.haml
@@ -1,11 +1 @@
-%p
- Assignee changed
- - if @previous_assignee
- from
- %strong #{@previous_assignee.name}
- to
- - if @issue.assignee_id
- %strong #{@issue.assignee_name}
- - else
- %strong Unassigned
-
+= render 'reassigned_issuable_email', issuable: @issue
diff --git a/app/views/notify/reassigned_issue_email.text.erb b/app/views/notify/reassigned_issue_email.text.erb
index 4becac2749c..710253be984 100644
--- a/app/views/notify/reassigned_issue_email.text.erb
+++ b/app/views/notify/reassigned_issue_email.text.erb
@@ -1,5 +1 @@
-Reassigned Issue <%= @issue.iid %>
-
-<%= url_for(project_issue_url(@issue.project, @issue)) %>
-
-Assignee changed <%= "from #{@previous_assignee.name}" if @previous_assignee %> to <%= "#{@issue.assignee_id ? @issue.assignee_name : 'Unassigned'}" %>
+<%= render 'reassigned_issuable_email', issuable: @issue %>
diff --git a/app/views/notify/reassigned_merge_request_email.html.haml b/app/views/notify/reassigned_merge_request_email.html.haml
index 00aee6bc952..2a650130f59 100644
--- a/app/views/notify/reassigned_merge_request_email.html.haml
+++ b/app/views/notify/reassigned_merge_request_email.html.haml
@@ -1,7 +1 @@
-%p
- Assignee changed
- - if @previous_assignee
- from
- %strong #{@previous_assignee.name}
- to
- %strong #{@merge_request.assignee_name}
+= render 'reassigned_issuable_email', issuable: @merge_request
diff --git a/app/views/notify/reassigned_merge_request_email.text.erb b/app/views/notify/reassigned_merge_request_email.text.erb
index 87a7847e06d..b5b4f1ff99a 100644
--- a/app/views/notify/reassigned_merge_request_email.text.erb
+++ b/app/views/notify/reassigned_merge_request_email.text.erb
@@ -1,7 +1 @@
-Reassigned Merge Request #<%= @merge_request.iid %>
-
-<%= url_for(project_merge_request_url(@merge_request.target_project, @merge_request)) %>
-
-
-Assignee changed <%= "from #{@previous_assignee.name}" if @previous_assignee %> to <%= @merge_request.assignee_name %>
-
+<%= render 'reassigned_issuable_email', issuable: @merge_request %>
diff --git a/app/views/profiles/keys/index.html.haml b/app/views/profiles/keys/index.html.haml
index aabfd57c286..a322f82f236 100644
--- a/app/views/profiles/keys/index.html.haml
+++ b/app/views/profiles/keys/index.html.haml
@@ -6,7 +6,7 @@
SSH keys allow you to establish a secure connection between your computer and GitLab
%br
Before you can add an SSH key you need to
- = link_to "generate it", help_page_path("ssh", "README")
+ = link_to "generate it", help_page_path("ssh", "ssh")
%hr
diff --git a/app/views/profiles/notifications/_settings.html.haml b/app/views/profiles/notifications/_settings.html.haml
index 218d51d31af..940c553d1ba 100644
--- a/app/views/profiles/notifications/_settings.html.haml
+++ b/app/views/profiles/notifications/_settings.html.haml
@@ -6,7 +6,7 @@
= notification_icon(notification)
%span.str-truncated
- - if membership.kind_of? UsersGroup
+ - if membership.kind_of? GroupMember
= link_to membership.group.name, membership.group
- else
= link_to_project(membership.project)
diff --git a/app/views/profiles/notifications/show.html.haml b/app/views/profiles/notifications/show.html.haml
index efe9c032190..f84de4430cc 100644
--- a/app/views/profiles/notifications/show.html.haml
+++ b/app/views/profiles/notifications/show.html.haml
@@ -39,13 +39,13 @@
.col-md-6
%h4 Groups:
%ul.bordered-list
- - @users_groups.each do |users_group|
+ - @group_members.each do |users_group|
- notification = Notification.new(users_group)
= render 'settings', type: 'group', membership: users_group, notification: notification
.col-md-6
%h4 Projects:
%ul.bordered-list
- - @users_projects.each do |users_project|
- - notification = Notification.new(users_project)
- = render 'settings', type: 'project', membership: users_project, notification: notification
+ - @project_members.each do |project_member|
+ - notification = Notification.new(project_member)
+ = render 'settings', type: 'project', membership: project_member, notification: notification
diff --git a/app/views/profiles/show.html.haml b/app/views/profiles/show.html.haml
index e03a43cbf1f..ed19dccf53e 100644
--- a/app/views/profiles/show.html.haml
+++ b/app/views/profiles/show.html.haml
@@ -36,7 +36,7 @@
= f.text_field :email, class: "form-control", required: true
- if @user.unconfirmed_email.present?
%span.help-block
- Please click the link in the confirmation email before continuing, it was send to
+ Please click the link in the confirmation email before continuing, it was sent to
%strong #{@user.unconfirmed_email}
- else
diff --git a/app/views/projects/_home_panel.html.haml b/app/views/projects/_home_panel.html.haml
index 62348f26f0a..2c1ac06fc90 100644
--- a/app/views/projects/_home_panel.html.haml
+++ b/app/views/projects/_home_panel.html.haml
@@ -1,36 +1,42 @@
- empty_repo = @project.empty_repo?
.project-home-panel{:class => ("empty-project" if empty_repo)}
- .visibility-level-label.has_tooltip{'data-title' => "#{visibility_level_label(@project.visibility_level)} project" }
- = visibility_level_icon(@project.visibility_level)
- .row
- .col-sm-6
- %h4.project-home-title
- = @project.name_with_namespace
+ .project-home-row
+ .project-home-desc
+ - if @project.description.present?
+ = auto_link ERB::Util.html_escape(@project.description), link: :urls
+ - if can?(current_user, :admin_project, @project)
+ &ndash;
+ = link_to 'Edit', edit_project_path
+ - elsif !@project.empty_repo? && @repository.readme
+ - readme = @repository.readme
+ &ndash;
+ = link_to project_blob_path(@project, tree_join(@repository.root_ref, readme.name)) do
+ = readme.name
+ .star-fork-buttons
+ - 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)), title: 'Got to my fork' do
+ = link_to_toggle_fork
+ - else
+ = link_to fork_project_path(@project), title: "Fork project", method: "POST" do
+ = link_to_toggle_fork
- .col-sm-6
- - if current_user && !empty_repo
- .project-home-dropdown
- = render "dropdown"
- = render "shared/clone_panel"
+ .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_toggle_star('You must sign in to star a project.', false, false)
- .project-home-extra.row
- .col-md-7
- .project-home-desc
- - if @project.description.present?
- = auto_link ERB::Util.html_escape(@project.description), link: :urls
- - if can?(current_user, :admin_project, @project)
- &ndash;
- %strong= link_to 'Edit', edit_project_path
- - elsif !@project.empty_repo? && @repository.readme
- - readme = @repository.readme
- &ndash;
- = link_to project_blob_path(@project, tree_join(@repository.root_ref, readme.name)) do
- = readme.name
-
- .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)
- %span.light.prepend-left-20= repository_size
+ .project-home-row
+ - if current_user && !empty_repo
+ .project-home-dropdown
+ = render "dropdown"
+ - unless @project.empty_repo?
+ - if can? current_user, :download_code, @project
+ .pull-right.prepend-left-10
+ = render 'projects/repositories/download_archive', split_button: true
+ = render "shared/clone_panel"
diff --git a/app/views/projects/_issuable_form.html.haml b/app/views/projects/_issuable_form.html.haml
new file mode 100644
index 00000000000..3f288814b51
--- /dev/null
+++ b/app/views/projects/_issuable_form.html.haml
@@ -0,0 +1,46 @@
+- if issuable.errors.any?
+ .row
+ .col-sm-10.col-sm-offset-2
+ .alert.alert-danger
+ - issuable.errors.full_messages.each do |msg|
+ %span= msg
+ %br
+.form-group
+ = f.label :title, class: 'control-label' do
+ %strong= 'Title *'
+ .col-sm-10
+ = f.text_field :title, maxlength: 255, autofocus: true,
+ class: 'form-control pad js-gfm-input', required: true
+.form-group.issuable-description
+ = f.label :description, 'Description', class: 'control-label'
+ .col-sm-10
+ = render 'projects/zen', f: f, attr: :description,
+ classes: 'description form-control'
+ .col-sm-12.hint
+ .pull-left
+ Parsed with
+ #{link_to 'GitLab Flavored Markdown', help_page_path('markdown', 'markdown'), target: '_blank'}.
+ .pull-right
+ Attach images (JPG, PNG, GIF) by dragging &amp; dropping
+ or #{link_to 'selecting them', '#', class: 'markdown-selector' }.
+ .clearfix
+ .error-alert
+%hr
+.form-group
+ .issue-assignee
+ = f.label :assignee_id, class: 'control-label' do
+ %i.icon-user
+ Assign to
+ .col-sm-10
+ = project_users_select_tag("#{issuable.class.model_name.param_key}[assignee_id]",
+ placeholder: 'Select a user', class: 'custom-form-control',
+ selected: issuable.assignee_id)
+ &nbsp;
+ = link_to 'Assign to me', '#', class: 'btn assign-to-me-link'
+.form-group
+ .issue-milestone
+ = f.label :milestone_id, class: 'control-label' do
+ %i.icon-time
+ Milestone
+ .col-sm-10= f.select(:milestone_id, milestone_options(issuable),
+ { include_blank: 'Select milestone' }, { class: 'select2' })
diff --git a/app/views/projects/_zen.html.haml b/app/views/projects/_zen.html.haml
new file mode 100644
index 00000000000..2bbc49e8eb5
--- /dev/null
+++ b/app/views/projects/_zen.html.haml
@@ -0,0 +1,7 @@
+.zennable
+ %input#zen-toggle-comment{ tabindex: '-1', type: 'checkbox' }
+ .zen-backdrop
+ - classes << ' js-gfm-input markdown-area'
+ = f.text_area attr, class: classes, placeholder: 'Leave a comment'
+ %label{ for: 'zen-toggle-comment', class: 'expand' } Edit in fullscreen
+ %label{ for: 'zen-toggle-comment', class: 'collapse' }
diff --git a/app/views/projects/blame/show.html.haml b/app/views/projects/blame/show.html.haml
index cdca8b2e634..464e7ca40e1 100644
--- a/app/views/projects/blame/show.html.haml
+++ b/app/views/projects/blame/show.html.haml
@@ -8,10 +8,9 @@
= @path
%small= number_to_human_size @blob.size
%span.options= render "projects/blob/actions"
- .file-content.blame
+ .file-content.blame.highlight
%table
- - current_line = 1
- - @blame.each do |commit, lines|
+ - @blame.each do |commit, lines, since|
- commit = Commit.new(commit)
%tr
%td.blame-commit
@@ -23,17 +22,13 @@
= link_to_gfm truncate(commit.title, length: 20), project_commit_path(@project, commit.id), class: "row_title"
%td.lines.blame-numbers
%pre
- - if lines.empty?
- = current_line
- - current_line += 1
- - else
- - lines.each do |line|
- = current_line
- \
- - current_line += 1
+ - (since...(since + lines.count)).each do |i|
+ = i
+ \
%td.lines
%pre
- :erb
- <% lines.each do |line| %>
- <%= line %>
- <% end %>
+ %code{ class: highlightjs_class(@blob.name) }
+ :erb
+ <% lines.each do |line| %>
+ <%= line %>
+ <% end %>
diff --git a/app/views/projects/blob/_actions.html.haml b/app/views/projects/blob/_actions.html.haml
index cabef3c19fe..8587dc4bc6d 100644
--- a/app/views/projects/blob/_actions.html.haml
+++ b/app/views/projects/blob/_actions.html.haml
@@ -13,6 +13,9 @@
- else
= link_to "blame", project_blame_path(@project, @id), class: "btn btn-small" unless @blob.empty?
= link_to "history", project_commits_path(@project, @id), class: "btn btn-small"
+ - if @ref != @commit.sha
+ = link_to 'permalink', project_blob_path(@project,
+ tree_join(@commit.sha, @path)), class: 'btn btn-small'
- if allowed_tree_edit?
= link_to '#modal-remove-blob', class: "remove-blob btn btn-small btn-remove", "data-toggle" => "modal" do
diff --git a/app/views/projects/blob/_remove.html.haml b/app/views/projects/blob/_remove.html.haml
index 692248dd233..93ffd4463b1 100644
--- a/app/views/projects/blob/_remove.html.haml
+++ b/app/views/projects/blob/_remove.html.haml
@@ -19,5 +19,8 @@
.form-group
.col-sm-2
.col-sm-10
- = submit_tag 'Remove file', class: 'btn btn-remove'
+ = submit_tag 'Remove file', class: 'btn btn-remove btn-remove-file'
= link_to "Cancel", '#', class: "btn btn-cancel", "data-dismiss" => "modal"
+
+:javascript
+ disableButtonIfEmptyField('#commit_message', '.btn-remove-file')
diff --git a/app/views/projects/blob/diff.html.haml b/app/views/projects/blob/diff.html.haml
index cfb91d6568a..5c79d0ef11f 100644
--- a/app/views/projects/blob/diff.html.haml
+++ b/app/views/projects/blob/diff.html.haml
@@ -1,7 +1,7 @@
- if @lines.present?
- if @form.unfold? && @form.since != 1 && !@form.bottom?
%tr.line_holder{ id: @form.since }
- = render "projects/commits/diffs/match_line", {line: @match_line,
+ = render "projects/diffs/match_line", {line: @match_line,
line_old: @form.since, line_new: @form.since, bottom: false}
- @lines.each_with_index do |line, index|
@@ -15,5 +15,5 @@
- if @form.unfold? && @form.bottom? && @form.to < @blob.loc
%tr.line_holder{ id: @form.to }
- = render "projects/commits/diffs/match_line", {line: @match_line,
+ = render "projects/diffs/match_line", {line: @match_line,
line_old: @form.to, line_new: @form.to, bottom: true}
diff --git a/app/views/projects/branches/_branch.html.haml b/app/views/projects/branches/_branch.html.haml
index 54a7b934dd7..08a537e0541 100644
--- a/app/views/projects/branches/_branch.html.haml
+++ b/app/views/projects/branches/_branch.html.haml
@@ -2,7 +2,7 @@
%li(class="js-branch-#{branch.name}")
%h4
= link_to project_tree_path(@project, branch.name) do
- %strong= truncate(branch.name, length: 60)
+ %strong.str-truncated= branch.name
- if branch.name == @repository.root_ref
%span.label.label-info default
- if @project.protected_branch? branch.name
diff --git a/app/views/projects/branches/destroy.js.haml b/app/views/projects/branches/destroy.js.haml
index ec1661c0aaa..882a4d0c5e2 100644
--- a/app/views/projects/branches/destroy.js.haml
+++ b/app/views/projects/branches/destroy.js.haml
@@ -1,3 +1 @@
-:plain
- $(".js-branch-#{@branch_name}").remove();
- $('.js-totalbranch-count').html("#{@repository.branches.size}")
+$('.js-totalbranch-count').html("#{@repository.branches.size}")
diff --git a/app/views/projects/branches/new.html.haml b/app/views/projects/branches/new.html.haml
index 5da2ede2937..3f202f7ea6b 100644
--- a/app/views/projects/branches/new.html.haml
+++ b/app/views/projects/branches/new.html.haml
@@ -1,3 +1,7 @@
+- if @error
+ .alert.alert-danger
+ %button{ type: "button", class: "close", "data-dismiss" => "alert"} &times;
+ = @error
%h3.page-title
%i.icon-code-fork
New branch
@@ -5,11 +9,11 @@
.form-group
= label_tag :branch_name, 'Name for new branch', class: 'control-label'
.col-sm-10
- = text_field_tag :branch_name, nil, placeholder: 'enter new branch name', required: true, tabindex: 1, class: 'form-control'
+ = text_field_tag :branch_name, params[:branch_name], placeholder: 'enter new branch name', required: true, tabindex: 1, class: 'form-control'
.form-group
= label_tag :ref, 'Create from', class: 'control-label'
.col-sm-10
- = text_field_tag :ref, nil, placeholder: 'existing branch name, tag or commit SHA', required: true, tabindex: 2, class: 'form-control'
+ = text_field_tag :ref, params[:ref], placeholder: 'existing branch name, tag or commit SHA', required: true, tabindex: 2, class: 'form-control'
.form-actions
= submit_tag 'Create branch', class: 'btn btn-create', tabindex: 3
= link_to 'Cancel', project_branches_path(@project), class: 'btn btn-cancel'
diff --git a/app/views/projects/commit/show.html.haml b/app/views/projects/commit/show.html.haml
index 0a15aef6cb7..fc721067ed4 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: @diffs, project: @project
+= render "projects/diffs/diffs", diffs: @diffs, project: @project
= render "projects/notes/notes_with_form"
diff --git a/app/views/projects/commits/_commit_list.html.haml b/app/views/projects/commits/_commit_list.html.haml
new file mode 100644
index 00000000000..2ee7d73bd20
--- /dev/null
+++ b/app/views/projects/commits/_commit_list.html.haml
@@ -0,0 +1,11 @@
+%div.panel.panel-default
+ .panel-heading
+ Commits (#{@commits.count})
+ - if @commits.size > MergeRequestDiff::COMMITS_SAFE_SIZE
+ %ul.well-list
+ - Commit.decorate(@commits.first(MergeRequestDiff::COMMITS_SAFE_SIZE)).each do |commit|
+ = render "projects/commits/inline_commit", commit: commit, project: @project
+ %li.warning-row.unstyled
+ other #{@commits.size - MergeRequestDiff::COMMITS_SAFE_SIZE} commits hidden to prevent performance issues.
+ - else
+ %ul.well-list= render Commit.decorate(@commits), project: @project
diff --git a/app/views/projects/commits/_diff_file.html.haml b/app/views/projects/commits/_diff_file.html.haml
deleted file mode 100644
index 6e6107c8849..00000000000
--- a/app/views/projects/commits/_diff_file.html.haml
+++ /dev/null
@@ -1,44 +0,0 @@
-- file = project.repository.blob_for_diff(@commit, diff)
-- return unless file
-- blob_diff_path = diff_project_blob_path(project,
- tree_join(@commit.id, diff.new_path))
-.diff-file{id: "diff-#{i}", data: {blob_diff_path: blob_diff_path }}
- .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?
- = view_file_btn(@commit.parent_id, diff, project)
- - 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
- &nbsp;
-
- - 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
- &nbsp;
-
- = view_file_btn(@commit.id, diff, project)
-
- .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/_diffs.html.haml b/app/views/projects/commits/_diffs.html.haml
deleted file mode 100644
index 64d6a2f09cf..00000000000
--- a/app/views/projects/commits/_diffs.html.haml
+++ /dev/null
@@ -1,23 +0,0 @@
-.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
- - safe_diff_files(diffs).each_with_index do |diff, i|
- = render 'projects/commits/diff_file', diff: diff, i: i, project: project
-
-- 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/_head.html.haml b/app/views/projects/commits/_head.html.haml
index b636e8ffe16..0c9d906481b 100644
--- a/app/views/projects/commits/_head.html.haml
+++ b/app/views/projects/commits/_head.html.haml
@@ -12,8 +12,4 @@
= nav_link(controller: :tags) do
= link_to project_tags_path(@project) do
Tags
- %span.badge= @repository.tags.length
-
- = nav_link(controller: :repositories, action: :stats) do
- = link_to stats_project_repository_path(@project) do
- Stats
+ %span.badge.js-totaltags-count= @repository.tags.length
diff --git a/app/views/projects/commits/_parallel_view.html.haml b/app/views/projects/commits/_parallel_view.html.haml
deleted file mode 100644
index 80f5be98f2f..00000000000
--- a/app/views/projects/commits/_parallel_view.html.haml
+++ /dev/null
@@ -1,38 +0,0 @@
-/ Side-by-side diff view
-- old_lines, new_lines = parallel_diff_lines(project, @commit, diff, file)
-- num_lines = old_lines.length
-
-%div.text-file
- %table
- - num_lines.times do |index|
- - new_line = new_lines[index]
- - old_line = old_lines[index]
- %tr.line_holder.parallel
- -# For old line
- - if old_line.type == :file_created
- %td.old_line= old_line.num
- %td.line_content.parallel= "File was created"
- - elsif old_line.type == :deleted
- %td.old_line.old= old_line.num
- %td.line_content{class: "parallel noteable_line old #{old_line.code}", "line_code" => old_line.code}= old_line.content
- - else old_line.type == :no_change
- %td.old_line= old_line.num
- %td.line_content.parallel= old_line.content
-
- -# For new line
- - if new_line.type == :file_deleted
- %td.new_line= new_line.num
- %td.line_content.parallel= "File was deleted"
- - elsif new_line.type == :added
- %td.new_line.new= new_line.num
- %td.line_content{class: "parallel noteable_line new #{new_line.code}", "line_code" => new_line.code}= new_line.content
- - else new_line.type == :no_change
- %td.new_line= new_line.num
- %td.line_content.parallel= new_line.content
-
- - if @reply_allowed
- - comments1 = @line_notes.select { |n| n.line_code == old_line.code }.sort_by(&:created_at)
- - comments2 = @line_notes.select { |n| n.line_code == new_line.code }.sort_by(&:created_at)
- - unless comments1.empty? and comments2.empty?
- = render "projects/notes/diff_notes_with_reply_parallel", notes1: comments1, notes2: comments2
-
diff --git a/app/views/projects/compare/show.html.haml b/app/views/projects/compare/show.html.haml
index aa79d08509b..214b5bd337b 100644
--- a/app/views/projects/compare/show.html.haml
+++ b/app/views/projects/compare/show.html.haml
@@ -6,20 +6,8 @@
= render "form"
- if @commits.present?
- %div.panel.panel-default
- .panel-heading
- Commits (#{@commits.count})
- - if @commits.size > MergeRequestDiff::COMMITS_SAFE_SIZE
- %ul.well-list
- - Commit.decorate(@commits.first(MergeRequestDiff::COMMITS_SAFE_SIZE)).each do |commit|
- = render "projects/commits/inline_commit", commit: commit, project: @project
- %li.warning-row.unstyled
- other #{@commits.size - MergeRequestDiff::COMMITS_SAFE_SIZE} commits hidden to prevent performance issues.
- - else
- %ul.well-list= render Commit.decorate(@commits), project: @project
-
- = render "projects/commits/diffs", diffs: @diffs, project: @project
-
+ = render "projects/commits/commit_list"
+ = render "projects/diffs/diffs", diffs: @diffs, project: @project
- else
.light-well
.center
diff --git a/app/views/projects/diffs/_diffs.html.haml b/app/views/projects/diffs/_diffs.html.haml
new file mode 100644
index 00000000000..334ea1ba82f
--- /dev/null
+++ b/app/views/projects/diffs/_diffs.html.haml
@@ -0,0 +1,27 @@
+.row
+ .col-md-8
+ = render 'projects/diffs/stats', diffs: diffs
+ .col-md-4
+ %ul.nav.nav-tabs
+ %li.pull-right{class: params[:view] == 'parallel' ? 'active' : ''}
+ - params_copy = params.dup
+ - params_copy[:view] = 'parallel'
+ = link_to "Side-by-side Diff", url_for(params_copy), {id: "commit-diff-viewtype"}
+ %li.pull-right{class: params[:view] != 'parallel' ? 'active' : ''}
+ - params_copy[:view] = 'inline'
+ = link_to "Inline Diff", url_for(params_copy), {id: "commit-diff-viewtype"}
+
+
+- if show_diff_size_warning?(diffs)
+ = render 'projects/diffs/warning', diffs: diffs
+
+.files
+ - safe_diff_files(diffs).each_with_index do |diff_file, index|
+ = render 'projects/diffs/file', diff_file: diff_file, i: index, project: project
+
+- 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 locally
diff --git a/app/views/projects/diffs/_file.html.haml b/app/views/projects/diffs/_file.html.haml
new file mode 100644
index 00000000000..be9389172b7
--- /dev/null
+++ b/app/views/projects/diffs/_file.html.haml
@@ -0,0 +1,48 @@
+- blob = project.repository.blob_for_diff(@commit, diff_file.diff)
+- return unless blob
+- blob_diff_path = diff_project_blob_path(project, tree_join(@commit.id, diff_file.file_path))
+.diff-file{id: "diff-#{i}", data: {blob_diff_path: blob_diff_path }}
+ .diff-header{id: "file-path-#{hexdigest(diff_file.new_path || diff_file.old_path)}"}
+ - if diff_file.deleted_file
+ %span= diff_file.old_path
+
+ .diff-btn-group
+ - if @commit.parent_ids.present?
+ = view_file_btn(@commit.parent_id, diff_file, project)
+ - else
+ %span= diff_file.new_path
+ - if diff_file.mode_changed?
+ %span.file-mode= "#{diff_file.diff.a_mode} → #{diff_file.diff.b_mode}"
+
+ .diff-btn-group
+ - unless params[:view] == 'parallel'
+ %label
+ = check_box_tag nil, 1, false, class: "js-toggle-diff-line-wrap"
+ Wrap text
+ &nbsp;
+ = link_to "#", class: "js-toggle-diff-comments btn btn-small" do
+ %i.icon-chevron-down
+ Diff comments
+ &nbsp;
+
+ - if @merge_request && @merge_request.source_project
+ = link_to project_edit_tree_path(@merge_request.source_project, tree_join(@merge_request.source_branch, diff_file.new_path), from_merge_request_id: @merge_request.id), { class: 'btn btn-small' } do
+ Edit
+ &nbsp;
+
+ = view_file_btn(@commit.id, diff_file, project)
+
+ .diff-content
+ -# Skipp all non non-supported blobs
+ - return unless blob.respond_to?('text?')
+ - if blob.text?
+ - if params[:view] == 'parallel'
+ = render "projects/diffs/parallel_view", diff_file: diff_file, project: project, blob: blob, index: i
+ - else
+ = render "projects/diffs/text_file", diff_file: diff_file, index: i
+ - elsif blob.image?
+ - old_file = project.repository.prev_blob_for_diff(@commit, diff_file)
+ = render "projects/diffs/image", diff_file: diff_file, old_file: old_file, file: blob, index: i
+ - else
+ .nothing-here-block No preview for this file type
+
diff --git a/app/views/projects/commits/_image.html.haml b/app/views/projects/diffs/_image.html.haml
index 6d9ef5964d9..900646dd0a4 100644
--- a/app/views/projects/commits/_image.html.haml
+++ b/app/views/projects/diffs/_image.html.haml
@@ -1,3 +1,4 @@
+- diff = diff_file.diff
- if diff.renamed_file || diff.new_file || diff.deleted_file
.image
%span.wrap
diff --git a/app/views/projects/commits/diffs/_match_line.html.haml b/app/views/projects/diffs/_match_line.html.haml
index 4ebe3379733..4ebe3379733 100644
--- a/app/views/projects/commits/diffs/_match_line.html.haml
+++ b/app/views/projects/diffs/_match_line.html.haml
diff --git a/app/views/projects/diffs/_match_line_parallel.html.haml b/app/views/projects/diffs/_match_line_parallel.html.haml
new file mode 100644
index 00000000000..815df16aa4a
--- /dev/null
+++ b/app/views/projects/diffs/_match_line_parallel.html.haml
@@ -0,0 +1,4 @@
+%td.old_line
+ %td.line_content.parallel.matched= line
+%td.new_line
+ %td.line_content.parallel.matched= line
diff --git a/app/views/projects/diffs/_parallel_view.html.haml b/app/views/projects/diffs/_parallel_view.html.haml
new file mode 100644
index 00000000000..75f3a80f0d7
--- /dev/null
+++ b/app/views/projects/diffs/_parallel_view.html.haml
@@ -0,0 +1,41 @@
+/ Side-by-side diff view
+%div.text-file.diff-wrap-lines
+ %table
+ - parallel_diff(diff_file, index).each do |line|
+ - type_left = line[0]
+ - line_number_left = line[1]
+ - line_content_left = line[2]
+ - line_code_left = line[3]
+ - type_right = line[4]
+ - line_number_right = line[5]
+ - line_content_right = line[6]
+ - line_code_right = line[7]
+
+ %tr.line_holder.parallel
+ - if type_left == 'match'
+ = render "projects/diffs/match_line_parallel", { line: line_content_left,
+ line_old: line_number_left, line_new: line_number_right }
+ - elsif type_left == 'old' || type_left.nil?
+ %td.old_line{id: line_code_left, class: "#{type_left}"}
+ = link_to raw(line_number_left), "##{line_code_left}", id: line_code_left
+ %td.line_content{class: "parallel noteable_line #{type_left} #{line_code_left}", "line_code" => line_code_left }= raw line_content_left
+
+ - if type_right == 'new'
+ - new_line_class = 'new'
+ - new_line_code = line_code_right
+ - else
+ - new_line_class = nil
+ - new_line_code = line_code_left
+
+ %td.new_line{id: new_line_code, class: "#{new_line_class}", data: { linenumber: line_number_right }}
+ = link_to raw(line_number_right), "##{new_line_code}", id: new_line_code
+ %td.line_content.parallel{class: "noteable_line #{new_line_class} #{new_line_code}", "line_code" => new_line_code}= raw line_content_right
+
+ - if @reply_allowed
+ - comments_left, comments_right = organize_comments(type_left, type_right, line_code_left, line_code_right)
+ - if comments_left.present? || comments_right.present?
+ = render "projects/notes/diff_notes_with_reply_parallel", notes1: comments_left, notes2: comments_right
+
+- if diff_file.diff.diff.blank? && diff_file.mode_changed?
+ .file-mode-changed
+ File mode changed
diff --git a/app/views/projects/commits/_diff_stats.html.haml b/app/views/projects/diffs/_stats.html.haml
index 846a1ee10e6..8ef7cc6e086 100644
--- a/app/views/projects/commits/_diff_stats.html.haml
+++ b/app/views/projects/diffs/_stats.html.haml
@@ -26,7 +26,7 @@
%a{href: "#diff-#{i}"}
%i.icon-minus
= diff.old_path
- = "->"
+ \->
= diff.new_path
- elsif diff.new_file
%span.new-file
diff --git a/app/views/projects/commits/_text_file.html.haml b/app/views/projects/diffs/_text_file.html.haml
index 756481c1b21..b1c987563f1 100644
--- a/app/views/projects/commits/_text_file.html.haml
+++ b/app/views/projects/diffs/_text_file.html.haml
@@ -1,33 +1,36 @@
-- too_big = diff.diff.lines.count > Commit::DIFF_SAFE_LINES
+- too_big = diff_file.diff_lines.count > Commit::DIFF_SAFE_LINES
- if too_big
%a.supp_diff_link Changes suppressed. Click to show
%table.text-file{class: "#{'hide' if too_big}"}
- last_line = 0
- - each_diff_line(diff, index) do |line, type, line_code, line_new, line_old, raw_line|
- - last_line = line_new
+ - diff_file.diff_lines.each_with_index do |line, index|
+ - type = line.type
+ - last_line = line.new_pos
+ - line_code = generate_line_code(diff_file.file_path, line)
+ - line_old = line.old_pos
%tr.line_holder{ id: line_code, class: "#{type}" }
- if type == "match"
- = render "projects/commits/diffs/match_line", {line: line,
- line_old: line_old, line_new: line_new, bottom: false}
+ = render "projects/diffs/match_line", {line: line.text,
+ line_old: line_old, line_new: line.new_pos, bottom: false}
- else
%td.old_line
= link_to raw(type == "new" ? "&nbsp;" : line_old), "##{line_code}", id: line_code
- if @comments_allowed
= link_to_new_diff_note(line_code)
- %td.new_line{data: {linenumber: line_new}}
- = link_to raw(type == "old" ? "&nbsp;" : line_new) , "##{line_code}", id: line_code
- %td.line_content{class: "noteable_line #{type} #{line_code}", "line_code" => line_code}= raw diff_line_content(line)
+ %td.new_line{data: {linenumber: line.new_pos}}
+ = link_to raw(type == "old" ? "&nbsp;" : line.new_pos) , "##{line_code}", id: line_code
+ %td.line_content{class: "noteable_line #{type} #{line_code}", "line_code" => line_code}= raw diff_line_content(line.text)
- if @reply_allowed
- comments = @line_notes.select { |n| n.line_code == line_code }.sort_by(&:created_at)
- unless comments.empty?
- = render "projects/notes/diff_notes_with_reply", notes: comments, line: line
+ = render "projects/notes/diff_notes_with_reply", notes: comments, line: line.text
- if last_line > 0
- = render "projects/commits/diffs/match_line", {line: "",
+ = render "projects/diffs/match_line", {line: "",
line_old: last_line, line_new: last_line, bottom: true}
-- if diff.diff.blank? && diff_file_mode_changed?(diff)
+- if diff_file.diff.blank? && diff_file.mode_changed?
.file-mode-changed
File mode changed
diff --git a/app/views/projects/commits/_diff_warning.html.haml b/app/views/projects/diffs/_warning.html.haml
index 05d516efa11..86ed6bbeaa2 100644
--- a/app/views/projects/commits/_diff_warning.html.haml
+++ b/app/views/projects/diffs/_warning.html.haml
@@ -14,6 +14,6 @@
= 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}
+ %strong #{allowed_diff_size} of #{diffs.size}
files displayed.
diff --git a/app/views/projects/edit_tree/_diff.html.haml b/app/views/projects/edit_tree/_diff.html.haml
deleted file mode 100644
index cf044feb9a4..00000000000
--- a/app/views/projects/edit_tree/_diff.html.haml
+++ /dev/null
@@ -1,13 +0,0 @@
-%table.text-file
- - each_diff_line(diff, 1) do |line, type, line_code, line_new, line_old, raw_line|
- %tr.line_holder{ id: line_code, class: "#{type}" }
- - if type == "match"
- %td.old_line= "..."
- %td.new_line= "..."
- %td.line_content.matched= line
- - else
- %td.old_line
- = link_to raw(type == "new" ? "&nbsp;" : line_old), "##{line_code}", id: line_code
- %td.new_line= link_to raw(type == "old" ? "&nbsp;" : line_new) , "##{line_code}", id: line_code
- %td.line_content{class: "noteable_line #{type} #{line_code}", "line_code" => line_code}= raw diff_line_content(line)
-
diff --git a/app/views/projects/edit_tree/preview.html.haml b/app/views/projects/edit_tree/preview.html.haml
index 87ce5dc31d3..e7c3460ad78 100644
--- a/app/views/projects/edit_tree/preview.html.haml
+++ b/app/views/projects/edit_tree/preview.html.haml
@@ -9,18 +9,17 @@
= raw render_markup(@blob.name, @content)
- else
.file-content.code
- - unless @diff.empty?
+ - unless @diff_lines.empty?
%table.text-file
- - @diff.each do |line, type, line_code, line_new, line_old, raw_line|
- %tr.line_holder{ id: line_code, class: "#{type}" }
- - if type == "match"
+ - @diff_lines.each do |line|
+ %tr.line_holder{ class: "#{line.type}" }
+ - if line.type == "match"
%td.old_line= "..."
%td.new_line= "..."
- %td.line_content.matched= line
+ %td.line_content.matched= line.text
- else
%td.old_line
- = link_to raw(type == "new" ? "&nbsp;" : line_old), "##{line_code}", id: line_code
- %td.new_line= link_to raw(type == "old" ? "&nbsp;" : line_new) , "##{line_code}", id: line_code
- %td.line_content{class: "noteable_line #{type} #{line_code}", "line_code" => line_code}= raw diff_line_content(line)
+ %td.new_line
+ %td.line_content{class: "#{line.type}"}= raw diff_line_content(line.text)
- else
.nothing-here-block No changes.
diff --git a/app/views/projects/edit_tree/show.html.haml b/app/views/projects/edit_tree/show.html.haml
index 05050e7df7c..62798b51d82 100644
--- a/app/views/projects/edit_tree/show.html.haml
+++ b/app/views/projects/edit_tree/show.html.haml
@@ -41,6 +41,7 @@
:javascript
ace.config.set("modePath", gon.relative_url_root + "#{Gitlab::Application.config.assets.prefix}/ace")
+ ace.config.loadModule("ace/ext/searchbox");
var ace_mode = "#{@blob.language.try(:ace_mode)}";
var editor = ace.edit("editor");
editor.setValue("#{escape_javascript(@blob.data)}");
diff --git a/app/views/projects/empty.html.haml b/app/views/projects/empty.html.haml
index 97dc73bce14..59f19c8b7a3 100644
--- a/app/views/projects/empty.html.haml
+++ b/app/views/projects/empty.html.haml
@@ -2,27 +2,27 @@
%div.git-empty
%fieldset
- %legend Git global setup:
+ %legend Git global setup
%pre.dark
:preserve
git config --global user.name "#{git_user_name}"
git config --global user.email "#{git_user_email}"
%fieldset
- %legend Create Repository
+ %legend Create a new repository
%pre.dark
:preserve
mkdir #{@project.path}
cd #{@project.path}
git init
- touch README
- git add README
- git commit -m 'first commit'
+ touch README.md
+ git add README.md
+ git commit -m "first commit"
git remote add origin #{ content_tag(:span, default_url_to_repo, class: 'clone')}
git push -u origin master
%fieldset
- %legend Existing Git Repo?
+ %legend Push an existing Git repository
%pre.dark
:preserve
cd existing_git_repo
diff --git a/app/views/projects/graphs/_head.html.haml b/app/views/projects/graphs/_head.html.haml
new file mode 100644
index 00000000000..9f37a760e61
--- /dev/null
+++ b/app/views/projects/graphs/_head.html.haml
@@ -0,0 +1,5 @@
+%ul.nav.nav-tabs
+ = nav_link(action: :show) do
+ = link_to 'Contributors', project_graph_path
+ = nav_link(action: :commits) do
+ = link_to 'Commits', commits_project_graph_path
diff --git a/app/views/projects/graphs/commits.html.haml b/app/views/projects/graphs/commits.html.haml
new file mode 100644
index 00000000000..a189a487135
--- /dev/null
+++ b/app/views/projects/graphs/commits.html.haml
@@ -0,0 +1,85 @@
+= render 'head'
+
+%p.lead
+ Commits statistic for
+ %strong #{@repository.root_ref}
+ #{@commits_graph.start_date.strftime('%b %d')} - #{@commits_graph.end_date.strftime('%b %d')}
+
+.row
+ .col-md-6
+ %ul
+ %li
+ %p.lead
+ %strong #{@commits_graph.commits.size}
+ commits during
+ %strong #{@commits_graph.duration}
+ days
+ %li
+ %p.lead
+ Average
+ %strong #{@commits_graph.commit_per_day}
+ commits per day
+ %li
+ %p.lead
+ Contributed by
+ %strong #{@commits_graph.authors}
+ authors
+ .col-md-6
+ %div
+ %p.slead
+ Commits per day of month
+ %canvas#month-chart{width: 800, height: 400}
+.row
+ .col-md-6
+ %div
+ %p.slead
+ Commits per day hour (UTC)
+ %canvas#hour-chart{width: 800, height: 400}
+ .col-md-6
+ %div
+ %p.slead
+ Commits per weekday
+ %canvas#weekday-chart{width: 800, height: 400}
+
+:coffeescript
+ data = {
+ labels : #{@commits_per_time.keys.to_json},
+ datasets : [{
+ fillColor : "rgba(220,220,220,0.5)",
+ strokeColor : "rgba(220,220,220,1)",
+ pointColor : "rgba(220,220,220,1)",
+ pointStrokeColor : "#EEE",
+ data : #{@commits_per_time.values.to_json}
+ }]
+ }
+
+ ctx = $("#hour-chart").get(0).getContext("2d");
+ new Chart(ctx).Line(data,{"scaleOverlay": true, responsive: true});
+
+ data = {
+ labels : #{@commits_per_week_days.keys.to_json},
+ datasets : [{
+ fillColor : "rgba(220,220,220,0.5)",
+ strokeColor : "rgba(220,220,220,1)",
+ pointColor : "rgba(220,220,220,1)",
+ pointStrokeColor : "#EEE",
+ data : #{@commits_per_week_days.values.to_json}
+ }]
+ }
+
+ ctx = $("#weekday-chart").get(0).getContext("2d");
+ new Chart(ctx).Line(data,{"scaleOverlay": true, responsive: true});
+
+ data = {
+ labels : #{@commits_per_month.keys.to_json},
+ datasets : [{
+ fillColor : "rgba(220,220,220,0.5)",
+ strokeColor : "rgba(220,220,220,1)",
+ pointColor : "rgba(220,220,220,1)",
+ pointStrokeColor : "#EEE",
+ data : #{@commits_per_month.values.to_json}
+ }]
+ }
+
+ ctx = $("#month-chart").get(0).getContext("2d");
+ new Chart(ctx).Line(data,{"scaleOverlay": true, responsive: true});
diff --git a/app/views/projects/graphs/show.html.haml b/app/views/projects/graphs/show.html.haml
index 8e4548f26d0..e0a9f62752a 100644
--- a/app/views/projects/graphs/show.html.haml
+++ b/app/views/projects/graphs/show.html.haml
@@ -1,17 +1,13 @@
+= render 'head'
.loading-graph
.center
%h3.page-title
%i.icon-spinner.icon-spin
Building repository graph.
- %p Please wait a moment, this page will automatically refresh when ready.
+ %p.slead Please wait a moment, this page will automatically refresh when ready.
-.stat-graph
+.stat-graph.hide
.header.clearfix
- .pull-right
- %select
- %option{:value => "commits"} Commits
- %option{:value => "additions"} Additions
- %option{:value => "deletions"} Deletions
%h3#date_header.page-title
%p.light
Commits to #{@project.default_branch}, excluding merge commits. Limited by 6,000 commits
@@ -21,15 +17,21 @@
#contributors.clearfix
%ol.contributors-list.clearfix
-:javascript
- $(".stat-graph").hide();
- $.ajax({
+
+:coffeescript
+ $.ajax
type: "GET",
url: location.href,
- complete: function() {
+ success: (data) ->
+ graph = new ContributorsStatGraph()
+ graph.init(data)
+
+ $("#brush_change").change ->
+ graph.change_date_header()
+ graph.redraw_authors()
+
$(".stat-graph").fadeIn();
$(".loading-graph").hide();
- },
- dataType: "script"
- });
+ dataType: "json"
+
diff --git a/app/views/projects/graphs/show.js.haml b/app/views/projects/graphs/show.js.haml
deleted file mode 100644
index dcf6cacdceb..00000000000
--- a/app/views/projects/graphs/show.js.haml
+++ /dev/null
@@ -1,19 +0,0 @@
-- if @success
- :plain
- controller = new ContributorsStatGraph
- controller.init(#{@log})
-
- $("select").change( function () {
- var field = $(this).val()
- controller.set_current_field(field)
- controller.redraw_master()
- controller.redraw_authors()
- })
-
- $("#brush_change").change( function () {
- controller.change_date_header()
- controller.redraw_authors()
- })
-- else
- :plain
- $('.stat-graph').replaceWith('<div class="alert alert-danger">Failed to load graph</div>')
diff --git a/app/views/projects/import.html.haml b/app/views/projects/import.html.haml
index 9efb1658c25..2b907748486 100644
--- a/app/views/projects/import.html.haml
+++ b/app/views/projects/import.html.haml
@@ -4,7 +4,7 @@
%h2
%i.icon-spinner.icon-spin
Import in progress.
- %p.monospace git clone --bare #{@project.import_url}
+ %p.monospace git clone --bare #{hidden_pass_url(@project.import_url)}
%p Please wait while we import the repository for you. Refresh at will.
:javascript
new ProjectImport();
@@ -23,7 +23,7 @@
.col-sm-10
= f.text_field :import_url, class: 'form-control', placeholder: 'https://github.com/randx/six.git'
.bs-callout.bs-callout-info
- This url must be publicly accessible or you can add a username and password like this: https://username:password@gitlab.com/company/project.git.
+ This URL must be publicly accessible or you can add a username and password like this: https://username:password@gitlab.com/company/project.git.
%br
The import will time out after 4 minutes. For big repositories, use a clone/push combination.
.form-actions
diff --git a/app/views/projects/issues/_form.html.haml b/app/views/projects/issues/_form.html.haml
index b2a8e8e091e..a4a6b0005c7 100644
--- a/app/views/projects/issues/_form.html.haml
+++ b/app/views/projects/issues/_form.html.haml
@@ -9,44 +9,7 @@
= "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?
- .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 *'
- .col-sm-10
- = f.text_field :title, maxlength: 255, class: "form-control js-gfm-input", autofocus: true, required: true
- .form-group
- = f.label :description, 'Description', class: 'control-label'
- .col-sm-10
- = f.text_area :description, class: 'form-control js-gfm-input markdown-area', rows: 14
- .col-sm-12.hint
- .pull-left Issues are parsed with #{link_to "GitLab Flavored Markdown", help_page_path("markdown", "markdown"), target: '_blank'}.
- .pull-right Attach images (JPG, PNG, GIF) by dragging &amp; dropping or #{link_to "selecting them", '#', class: 'markdown-selector' }.
- .clearfix
- .error-alert
- %hr
- .form-group
- .issue-assignee
- = f.label :assignee_id, class: 'control-label' do
- %i.icon-user
- Assign to
- .col-sm-10
- = project_users_select_tag('issue[assignee_id]', placeholder: 'Select a user', class: 'custom-form-control', selected: @issue.assignee_id)
- &nbsp;
- = link_to 'Assign to me', '#', class: 'btn assign-to-me-link'
- .form-group
- .issue-milestone
- = f.label :milestone_id, class: 'control-label' do
- %i.icon-time
- Milestone
- .col-sm-10= f.select(:milestone_id, milestone_options(@issue), { include_blank: "Select milestone" }, {class: 'select2'})
-
+ = render 'projects/issuable_form', f: f, issuable: @issue
.form-group
= f.label :label_ids, class: 'control-label' do
%i.icon-tag
diff --git a/app/views/projects/issues/_head.html.haml b/app/views/projects/issues/_head.html.haml
index dad547d4ebc..82cde14e05d 100644
--- a/app/views/projects/issues/_head.html.haml
+++ b/app/views/projects/issues/_head.html.haml
@@ -24,7 +24,7 @@
%i.icon.icon-list
= form_tag project_issues_path(@project), method: :get, id: "issue_search_form", class: 'pull-left issue-search-form' do
.append-right-10.hidden-xs.hidden-sm
- = search_field_tag :issue_search, nil, { placeholder: 'Filter by title or description', class: 'form-control issue_search search-text-input input-mn-300' }
+ = search_field_tag :issue_search, params[:issue_search], { placeholder: 'Filter by title or description', class: 'form-control issue_search search-text-input input-mn-300' }
= hidden_field_tag :state, params['state']
= hidden_field_tag :scope, params['scope']
= hidden_field_tag :assignee_id, params['assignee_id']
diff --git a/app/views/projects/issues/_issue.html.haml b/app/views/projects/issues/_issue.html.haml
index db28b831182..1dfcd726068 100644
--- a/app/views/projects/issues/_issue.html.haml
+++ b/app/views/projects/issues/_issue.html.haml
@@ -9,7 +9,7 @@
= link_to_gfm issue.title, project_issue_path(issue.project, issue), class: "row_title"
- if issue.closed?
%small.pull-right
- = "CLOSED"
+ CLOSED
.issue-info
- if issue.assignee
@@ -31,7 +31,8 @@
.issue-labels
- issue.labels.each do |label|
- = render_colored_label(label)
+ = link_to project_issues_path(issue.project, label_name: label.name) do
+ = render_colored_label(label)
.issue-actions
- if can? current_user, :modify_issue, issue
diff --git a/app/views/projects/issues/_issue_context.html.haml b/app/views/projects/issues/_issue_context.html.haml
index d7987f43fbb..8c3f0823386 100644
--- a/app/views/projects/issues/_issue_context.html.haml
+++ b/app/views/projects/issues/_issue_context.html.haml
@@ -5,7 +5,7 @@
Assignee:
- if can?(current_user, :modify_issue, @issue)
- = project_users_select_tag('issue[assignee_id]', placeholder: 'Select assignee', class: 'custom-form-control', selected: @issue.assignee_id)
+ = project_users_select_tag('issue[assignee_id]', placeholder: 'Select assignee', class: 'custom-form-control js-select2 js-assignee', selected: @issue.assignee_id)
- elsif issue.assignee
= link_to_member(@project, @issue.assignee)
- else
@@ -15,7 +15,7 @@
%strong.append-right-10
Milestone:
- if can?(current_user, :modify_issue, @issue)
- = f.select(:milestone_id, milestone_options(@issue), { include_blank: "Select milestone" }, {class: 'select2 select2-compact'})
+ = f.select(:milestone_id, milestone_options(@issue), { include_blank: "Select milestone" }, {class: 'select2 select2-compact js-select2 js-milestone'})
= hidden_field_tag :issue_context
= f.submit class: 'btn'
- elsif issue.milestone
diff --git a/app/views/projects/issues/show.html.haml b/app/views/projects/issues/show.html.haml
index bd5f01ff6a7..41532fea741 100644
--- a/app/views/projects/issues/show.html.haml
+++ b/app/views/projects/issues/show.html.haml
@@ -57,9 +57,9 @@
- content_for :note_actions do
- if can?(current_user, :modify_issue, @issue)
- if @issue.closed?
- = link_to 'Reopen Issue', project_issue_path(@project, @issue, issue: {state_event: :reopen }, status_only: true), method: :put, class: "btn btn-grouped btn-reopen"
+ = link_to 'Reopen Issue', project_issue_path(@project, @issue, issue: {state_event: :reopen }, status_only: true), method: :put, class: "btn btn-grouped btn-reopen js-note-target-reopen", title: 'Reopen Issue'
- else
- = link_to 'Close Issue', project_issue_path(@project, @issue, issue: {state_event: :close }, status_only: true), method: :put, class: "btn btn-grouped btn-close", title: "Close Issue"
+ = link_to 'Close Issue', project_issue_path(@project, @issue, issue: {state_event: :close }, status_only: true), method: :put, class: "btn btn-grouped btn-close js-note-target-close", title: "Close Issue"
.participants
%cite.cgray #{@issue.participants.count} participants
@@ -68,6 +68,7 @@
.issue-show-labels.pull-right
- @issue.labels.each do |label|
- = render_colored_label(label)
+ = link_to project_issues_path(@project, label_name: label.name) do
+ = render_colored_label(label)
.voting_notes#notes= render "projects/notes/notes_with_form"
diff --git a/app/views/projects/labels/destroy.js.haml b/app/views/projects/labels/destroy.js.haml
new file mode 100644
index 00000000000..1b4c83ab097
--- /dev/null
+++ b/app/views/projects/labels/destroy.js.haml
@@ -0,0 +1,2 @@
+- if @project.labels.size == 0
+ $('.labels').load(document.URL + ' .light-well').hide().fadeIn(1000)
diff --git a/app/views/projects/labels/index.html.haml b/app/views/projects/labels/index.html.haml
index 075779a9c88..06568278de8 100644
--- a/app/views/projects/labels/index.html.haml
+++ b/app/views/projects/labels/index.html.haml
@@ -7,11 +7,11 @@
Labels
%hr
-- if @labels.present?
- %ul.bordered-list.manage-labels-list
- = render @labels
- = paginate @labels, theme: 'gitlab'
-
-- else
- .light-well
- .nothing-here-block Create first label or #{link_to 'generate', generate_project_labels_path(@project), method: :post} default set of labels
+.labels
+ - if @labels.present?
+ %ul.bordered-list.manage-labels-list
+ = render @labels
+ = paginate @labels, theme: 'gitlab'
+ - else
+ .light-well
+ .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/merge_requests/_form.html.haml b/app/views/projects/merge_requests/_form.html.haml
index 0af89b6e376..154a01f59ad 100644
--- a/app/views/projects/merge_requests/_form.html.haml
+++ b/app/views/projects/merge_requests/_form.html.haml
@@ -1,51 +1,6 @@
= form_for [@project, @merge_request], html: { class: "merge-request-form form-horizontal" } do |f|
- .row
- .col-sm-2
- .col-sm-10
- - if @repository.contribution_guide && !@merge_request.persisted?
- - contribution_guide_url = project_blob_path(@project, tree_join(@repository.root_ref, @repository.contribution_guide.name))
- .alert.alert-info
- Please review the
- %strong #{link_to "guidelines for contribution", contribution_guide_url}
- to this repository.
-
- -if @merge_request.errors.any?
- .alert.alert-danger
- - @merge_request.errors.full_messages.each do |msg|
- %div= msg
-
.merge-request-form-info
- .form-group
- = f.label :title, class: 'control-label' do
- %strong= "Title *"
- .col-sm-10= f.text_field :title, class: "form-control pad js-gfm-input", maxlength: 255, rows: 5, required: true
- .form-group
- = f.label :description, "Description", class: 'control-label'
- .col-sm-10
- = f.text_area :description, class: "form-control js-gfm-input markdown-area", rows: 14
- .col-sm-12.hint
- .pull-left Description is parsed with #{link_to "GitLab Flavored Markdown", help_page_path("markdown", "markdown"), target: '_blank'}.
- .pull-right Attach images (JPG, PNG, GIF) by dragging &amp; dropping or #{link_to "selecting them", '#', class: 'markdown-selector' }.
- .clearfix
- .error-alert
- %hr
- .form-group
- .issue-assignee
- = f.label :assignee_id, class: 'control-label' do
- %i.icon-user
- Assign to
- .col-sm-10
- = project_users_select_tag('merge_request[assignee_id]', placeholder: 'Select a user', class: 'custom-form-control', selected: @merge_request.assignee_id)
- &nbsp;
- = link_to 'Assign to me', '#', class: 'btn assign-to-me-link'
- .form-group
- .issue-milestone
- = f.label :milestone_id, class: 'control-label' do
- %i.icon-time
- Milestone
- .col-sm-10= f.select(:milestone_id, milestone_options(@merge_request), { include_blank: "Select milestone" }, {class: 'select2'})
-
-
+ = render 'projects/issuable_form', f: f, issuable: @merge_request
.form-group
= f.label :label_ids, class: 'control-label' do
%i.icon-tag
diff --git a/app/views/projects/merge_requests/_merge_request.html.haml b/app/views/projects/merge_requests/_merge_request.html.haml
index 7f5de232dcf..2649fb55c30 100644
--- a/app/views/projects/merge_requests/_merge_request.html.haml
+++ b/app/views/projects/merge_requests/_merge_request.html.haml
@@ -5,7 +5,7 @@
- if merge_request.merged?
%small.pull-right
%i.icon-ok
- = "MERGED"
+ MERGED
- else
%span.pull-right
- if merge_request.for_fork?
@@ -34,4 +34,5 @@
.merge-request-labels
- merge_request.labels.each do |label|
- = render_colored_label(label)
+ = link_to project_merge_requests_path(merge_request.project, label_name: label.name) do
+ = render_colored_label(label)
diff --git a/app/views/projects/merge_requests/_new_submit.html.haml b/app/views/projects/merge_requests/_new_submit.html.haml
index 7c43d355987..84bf81441b1 100644
--- a/app/views/projects/merge_requests/_new_submit.html.haml
+++ b/app/views/projects/merge_requests/_new_submit.html.haml
@@ -16,12 +16,13 @@
.form-group
.light
= f.label :title do
- = "Title *"
+ Title *
= f.text_field :title, class: "form-control input-lg js-gfm-input", maxlength: 255, rows: 5, required: true
.form-group
.light
= f.label :description, "Description"
- = f.text_area :description, class: "form-control js-gfm-input markdown-area", rows: 10
+ = render 'projects/zen', f: f, attr: :description,
+ classes: 'description form-control'
.clearfix.hint
.pull-left Description is parsed with #{link_to "GitLab Flavored Markdown", help_page_path("markdown", "markdown"), target: '_blank'}.
.pull-right Attach images (JPG, PNG, GIF) by dragging & dropping or #{link_to "selecting them", '#', class: 'markdown-selector' }.
@@ -61,21 +62,11 @@
= f.submit 'Submit merge request', class: "btn btn-create"
.mr-compare
- %div.panel.panel-default
- .panel-heading
- Commits (#{@commits.count})
- - if @commits.size > MergeRequestDiff::COMMITS_SAFE_SIZE
- %ul.well-list
- - Commit.decorate(@commits.first(MergeRequestDiff::COMMITS_SAFE_SIZE)).each do |commit|
- = render "projects/commits/inline_commit", commit: commit, project: @project
- %li.warning-row.unstyled
- other #{@commits.size - MergeRequestDiff::COMMITS_SAFE_SIZE} commits hidden to prevent performance issues.
- - else
- %ul.well-list= render Commit.decorate(@commits), project: @project
+ = render "projects/commits/commit_list"
%h4 Changes
- if @diffs.present?
- = render "projects/commits/diffs", diffs: @diffs, project: @project
+ = render "projects/diffs/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.
diff --git a/app/views/projects/merge_requests/_show.html.haml b/app/views/projects/merge_requests/_show.html.haml
index 8fca9f0212b..4323c8f65a4 100644
--- a/app/views/projects/merge_requests/_show.html.haml
+++ b/app/views/projects/merge_requests/_show.html.haml
@@ -22,9 +22,9 @@
- content_for :note_actions do
- if can?(current_user, :modify_merge_request, @merge_request)
- unless @merge_request.closed? || @merge_request.merged?
- = link_to 'Close', project_merge_request_path(@project, @merge_request, merge_request: {state_event: :close }), method: :put, class: "btn btn-grouped btn-close close-mr-link", title: "Close merge request"
+ = link_to 'Close', project_merge_request_path(@project, @merge_request, merge_request: {state_event: :close }), method: :put, class: "btn btn-grouped btn-close close-mr-link js-note-target-close", title: "Close merge request"
- if @merge_request.closed?
- = link_to 'Reopen', project_merge_request_path(@project, @merge_request, merge_request: {state_event: :reopen }), method: :put, class: "btn btn-grouped btn-reopen reopen-mr-link", title: "Close merge request"
+ = link_to 'Reopen', project_merge_request_path(@project, @merge_request, merge_request: {state_event: :reopen }), method: :put, class: "btn btn-grouped btn-reopen reopen-mr-link js-note-target-reopen", title: "Reopen merge request"
.diffs.tab-content
- if current_page?(action: 'diffs')
diff --git a/app/views/projects/merge_requests/show/_context.html.haml b/app/views/projects/merge_requests/show/_context.html.haml
index ab00b34242a..089302e3588 100644
--- a/app/views/projects/merge_requests/show/_context.html.haml
+++ b/app/views/projects/merge_requests/show/_context.html.haml
@@ -5,7 +5,7 @@
Assignee:
- if can?(current_user, :modify_merge_request, @merge_request)
- = project_users_select_tag('merge_request[assignee_id]', placeholder: 'Select assignee', class: 'custom-form-control', selected: @merge_request.assignee_id)
+ = project_users_select_tag('merge_request[assignee_id]', placeholder: 'Select assignee', class: 'custom-form-control js-select2 js-assignee', selected: @merge_request.assignee_id)
- elsif merge_request.assignee
= link_to_member(@project, @merge_request.assignee)
- else
@@ -15,7 +15,7 @@
%strong.append-right-10
Milestone:
- if can?(current_user, :modify_merge_request, @merge_request)
- = f.select(:milestone_id, milestone_options(@merge_request), { include_blank: "Select milestone" }, {class: 'select2 select2-compact'})
+ = f.select(:milestone_id, milestone_options(@merge_request), { include_blank: "Select milestone" }, {class: 'select2 select2-compact js-select2 js-milestone'})
= hidden_field_tag :merge_request_context
= f.submit class: 'btn'
- elsif merge_request.milestone
diff --git a/app/views/projects/merge_requests/show/_diffs.html.haml b/app/views/projects/merge_requests/show/_diffs.html.haml
index eb63b68106e..d361c5f579a 100644
--- a/app/views/projects/merge_requests/show/_diffs.html.haml
+++ b/app/views/projects/merge_requests/show/_diffs.html.haml
@@ -1,5 +1,5 @@
- if @merge_request_diff.collected?
- = render "projects/commits/diffs", diffs: @merge_request.diffs, project: @merge_request.source_project
+ = render "projects/diffs/diffs", diffs: @merge_request.diffs, project: @merge_request.source_project
- elsif @merge_request_diff.empty?
.nothing-here-block Nothing to merge from #{@merge_request.source_branch} into #{@merge_request.target_branch}
- else
diff --git a/app/views/projects/merge_requests/show/_participants.html.haml b/app/views/projects/merge_requests/show/_participants.html.haml
index 007c111f7fb..b709c89cec2 100644
--- a/app/views/projects/merge_requests/show/_participants.html.haml
+++ b/app/views/projects/merge_requests/show/_participants.html.haml
@@ -5,4 +5,5 @@
.merge-request-show-labels.pull-right
- @merge_request.labels.each do |label|
- = render_colored_label(label)
+ = link_to project_merge_requests_path(@project, label_name: label.name) do
+ = render_colored_label(label)
diff --git a/app/views/projects/merge_requests/show/_state_widget.html.haml b/app/views/projects/merge_requests/show/_state_widget.html.haml
index c30310f1258..a5f8af89d1a 100644
--- a/app/views/projects/merge_requests/show/_state_widget.html.haml
+++ b/app/views/projects/merge_requests/show/_state_widget.html.haml
@@ -13,7 +13,7 @@
%h4
Closed by #{link_to_member(@project, @merge_request.closed_event.author, avatar: false)}
#{time_ago_with_tooltip(@merge_request.closed_event.created_at)}
- %p Changes was not merged into target branch
+ %p Changes were not merged into target branch
- if @merge_request.merged?
%h4
diff --git a/app/views/projects/milestones/show.html.haml b/app/views/projects/milestones/show.html.haml
index 42c3f45f6c9..1a495aa1c40 100644
--- a/app/views/projects/milestones/show.html.haml
+++ b/app/views/projects/milestones/show.html.haml
@@ -47,6 +47,8 @@
#{@milestone.closed_items_count} closed
&ndash;
#{@milestone.open_items_count} open
+ &nbsp;
+ %span.light #{@milestone.percent_complete}% complete
%span.pull-right= @milestone.expires_at
.progress.progress-info
.progress-bar{style: "width: #{@milestone.percent_complete}%;"}
diff --git a/app/views/projects/network/show.html.haml b/app/views/projects/network/show.html.haml
index 5310822823d..52a66f64d9f 100644
--- a/app/views/projects/network/show.html.haml
+++ b/app/views/projects/network/show.html.haml
@@ -2,8 +2,8 @@
.project-network
.controls
= form_tag project_network_path(@project, @id), method: :get, class: 'form-inline network-form' do |f|
- = text_field_tag :extended_sha1, @options[:extended_sha1], placeholder: "Input an extended SHA1 syntax", class: "search-input form-control input-mx-250"
- = button_tag type: 'submit', class: 'btn btn-success' do
+ = text_field_tag :extended_sha1, @options[:extended_sha1], placeholder: "Input an extended SHA1 syntax", class: 'search-input form-control input-mx-250 search-sha'
+ = button_tag class: 'btn btn-success btn-search-sha' do
%i.icon-search
.inline.prepend-left-20
.checkbox.light
@@ -15,9 +15,12 @@
= spinner nil, true
:javascript
- new Network({
+ disableButtonIfEmptyField('#extended_sha1', '.btn-search-sha')
+
+ network_graph = new Network({
url: '#{project_network_path(@project, @ref, @options.merge(format: :json))}',
commit_url: '#{project_commit_path(@project, 'ae45ca32').gsub("ae45ca32", "%s")}',
ref: '#{@ref}',
commit_id: '#{@commit.id}'
})
+ new ShortcutsNetwork(network_graph.branch_graph)
diff --git a/app/views/projects/new.html.haml b/app/views/projects/new.html.haml
index 7efaf5a087b..949b72356d7 100644
--- a/app/views/projects/new.html.haml
+++ b/app/views/projects/new.html.haml
@@ -48,9 +48,9 @@
.col-sm-10
= f.text_field :import_url, class: 'form-control', placeholder: 'https://github.com/randx/six.git'
.bs-callout.bs-callout-info
- This url must be publicly accessible or you can add a username and password like this: https://username:password@gitlab.com/company/project.git.
+ This URL must be publicly accessible or you can add a username and password like this: https://username:password@gitlab.com/company/project.git.
%br
- The import will time out after 2 minutes. For big repositories, use a clone/push combination.
+ The import will time out after 4 minutes. For big repositories, use a clone/push combination.
%hr
.form-group
diff --git a/app/views/projects/new_tree/show.html.haml b/app/views/projects/new_tree/show.html.haml
index 9ecbbe7508e..4ce8d372a38 100644
--- a/app/views/projects/new_tree/show.html.haml
+++ b/app/views/projects/new_tree/show.html.haml
@@ -1,9 +1,9 @@
%h3.page-title New file
%hr
.file-editor
- = form_tag(project_new_tree_path(@project, @id), method: :put, class: "form-horizontal") do
+ = form_tag(project_new_tree_path(@project, @id), method: :put, class: 'form-horizontal form-new-file') do
.form-group.commit_message-group
- = label_tag 'file_name', class: "control-label" do
+ = label_tag 'file_name', class: 'control-label' do
File name
.col-sm-10
.input-group
@@ -46,7 +46,7 @@
ace.config.set("modePath", gon.relative_url_root + "#{Gitlab::Application.config.assets.prefix}/ace-src-noconflict")
var editor = ace.edit("editor");
- disableButtonIfEmptyField("#commit_message", ".js-commit-button");
+ disableButtonIfAnyEmptyField($('.form-new-file'), '.form-control', '.btn-create')
$(".js-commit-button").click(function(){
$("#file-content").val(editor.getValue());
diff --git a/app/views/projects/notes/_diff_note_link.html.haml b/app/views/projects/notes/_diff_note_link.html.haml
deleted file mode 100644
index 377c926a204..00000000000
--- a/app/views/projects/notes/_diff_note_link.html.haml
+++ /dev/null
@@ -1,10 +0,0 @@
-- note = @project.notes.new(@comments_target.merge({ line_code: line_code }))
-= link_to "",
- "javascript:;",
- class: "add-diff-note js-add-diff-note-button",
- data: { noteable_type: note.noteable_type,
- noteable_id: note.noteable_id,
- commit_id: note.commit_id,
- line_code: note.line_code,
- discussion_id: note.discussion_id },
- title: "Add a comment to this line"
diff --git a/app/views/projects/notes/_diff_notes_with_reply.html.haml b/app/views/projects/notes/_diff_notes_with_reply.html.haml
index 79a66eff129..a01056b7166 100644
--- a/app/views/projects/notes/_diff_notes_with_reply.html.haml
+++ b/app/views/projects/notes/_diff_notes_with_reply.html.haml
@@ -3,7 +3,7 @@
- if !defined?(line) || line == note.diff_line
%tr.notes_holder
%td.notes_line{ colspan: 2 }
- %span.btn.disabled
+ %span.discussion-notes-count
%i.icon-comment
= notes.count
%td.notes_content
diff --git a/app/views/projects/notes/_diff_notes_with_reply_parallel.html.haml b/app/views/projects/notes/_diff_notes_with_reply_parallel.html.haml
index 8adf903a9a1..506d1fff008 100644
--- a/app/views/projects/notes/_diff_notes_with_reply_parallel.html.haml
+++ b/app/views/projects/notes/_diff_notes_with_reply_parallel.html.haml
@@ -1,14 +1,13 @@
-- note1 = notes1.first # example note
-- note2 = notes2.first # example note
--# Check if line want not changed since comment was left
-/- if !defined?(line) || line == note.diff_line
+- note1 = notes1.present? ? notes1.first : nil
+- note2 = notes2.present? ? notes2.first : nil
+
%tr.notes_holder
- if note1
%td.notes_line
%span.btn.disabled
%i.icon-comment
= notes1.count
- %td.notes_content
+ %td.notes_content.parallel
%ul.notes{ rel: note1.discussion_id }
= render notes1
@@ -23,7 +22,7 @@
%span.btn.disabled
%i.icon-comment
= notes2.count
- %td.notes_content
+ %td.notes_content.parallel
%ul.notes{ rel: note2.discussion_id }
= render notes2
diff --git a/app/views/projects/notes/_discussion.html.haml b/app/views/projects/notes/_discussion.html.haml
index 8c7964cbf3e..f4c6fad2fed 100644
--- a/app/views/projects/notes/_discussion.html.haml
+++ b/app/views/projects/notes/_discussion.html.haml
@@ -1,8 +1,13 @@
- note = discussion_notes.first
-- if note.for_merge_request?
- - if note.outdated?
- = render "projects/notes/discussions/outdated", discussion_notes: discussion_notes
- - else
- = render "projects/notes/discussions/active", discussion_notes: discussion_notes
-- else
- = render "projects/notes/discussions/commit", discussion_notes: discussion_notes
+.timeline-entry
+ .timeline-entry-inner
+ .timeline-icon
+ = image_tag avatar_icon(note.author_email), class: "avatar s40"
+ .timeline-content
+ - if note.for_merge_request?
+ - if note.outdated?
+ = render "projects/notes/discussions/outdated", discussion_notes: discussion_notes
+ - else
+ = render "projects/notes/discussions/active", discussion_notes: discussion_notes
+ - else
+ = render "projects/notes/discussions/commit", discussion_notes: discussion_notes
diff --git a/app/views/projects/notes/_form.html.haml b/app/views/projects/notes/_form.html.haml
index 5ebafb13f1c..65d7f081545 100644
--- a/app/views/projects/notes/_form.html.haml
+++ b/app/views/projects/notes/_form.html.haml
@@ -14,8 +14,8 @@
Preview
%div
.note-write-holder
- = f.text_area :note, size: 255, class: 'note_text js-note-text js-gfm-input markdown-area'
-
+ = render 'projects/zen', f: f, attr: :note,
+ classes: 'note_text js-note-text'
.light.clearfix
.pull-left Comments are parsed with #{link_to "GitLab Flavored Markdown", help_page_path("markdown", "markdown"),{ target: '_blank', tabindex: -1 }}
.pull-right Attach images (JPG, PNG, GIF) by dragging &amp; dropping or #{link_to "selecting them", '#', class: 'markdown-selector', tabindex: -1 }.
diff --git a/app/views/projects/notes/_note.html.haml b/app/views/projects/notes/_note.html.haml
index 5e84aed0cc4..394fa88e045 100644
--- a/app/views/projects/notes/_note.html.haml
+++ b/app/views/projects/notes/_note.html.haml
@@ -1,66 +1,69 @@
-%li{ id: dom_id(note), class: dom_class(note), data: { discussion: note.discussion_id } }
- .note-header
- .note-actions
- = link_to "##{dom_id(note)}", name: dom_id(note) do
- %i.icon-link
- Link here
- &nbsp;
- - if(note.author_id == current_user.try(:id)) || can?(current_user, :admin_note, @project)
- = link_to "#", title: "Edit comment", class: "js-note-edit" do
- %i.icon-edit
- Edit
- &nbsp;
- = link_to project_note_path(@project, note), title: "Remove comment", method: :delete, data: { confirm: 'Are you sure you want to remove this comment?' }, remote: true, class: "danger js-note-delete" do
- %i.icon-trash.cred
- Remove
- = image_tag avatar_icon(note.author_email), class: "avatar s32"
- = link_to_member(@project, note.author, avatar: false)
- %span.note-last-update
- = note_timestamp(note)
+%li.timeline-entry{ id: dom_id(note), class: dom_class(note), data: { discussion: note.discussion_id } }
+ .timeline-entry-inner
+ .timeline-icon
+ = image_tag avatar_icon(note.author_email), class: "avatar s40"
+ .timeline-content
+ .note-header
+ .note-actions
+ = link_to "##{dom_id(note)}", name: dom_id(note) do
+ %i.icon-link
+ Link here
+ &nbsp;
+ - if can?(current_user, :admin_note, note) && note.editable?
+ = link_to "#", title: "Edit comment", class: "js-note-edit" do
+ %i.icon-edit
+ Edit
+ &nbsp;
+ = link_to project_note_path(@project, note), title: "Remove comment", method: :delete, data: { confirm: 'Are you sure you want to remove this comment?' }, remote: true, class: "danger js-note-delete" do
+ %i.icon-trash.cred
+ Remove
+ = link_to_member(@project, note.author, avatar: false)
+ %span.note-last-update
+ = note_timestamp(note)
- - if note.upvote?
- %span.vote.upvote.label.label-success
- %i.icon-thumbs-up
- \+1
- - if note.downvote?
- %span.vote.downvote.label.label-danger
- %i.icon-thumbs-down
- \-1
+ - if note.upvote?
+ %span.vote.upvote.label.label-success
+ %i.icon-thumbs-up
+ \+1
+ - if note.downvote?
+ %span.vote.downvote.label.label-danger
+ %i.icon-thumbs-down
+ \-1
- .note-body
- .note-text
- = preserve do
- = markdown(note.note, {no_header_anchors: true})
+ .note-body
+ .note-text
+ = preserve do
+ = markdown(note.note, {no_header_anchors: true})
- .note-edit-form
- = form_for note, url: project_note_path(@project, note), method: :put, remote: true, authenticity_token: true do |f|
- = f.text_area :note, class: 'note_text js-note-text js-gfm-input turn-on'
+ .note-edit-form
+ = form_for note, url: project_note_path(@project, note), method: :put, remote: true, authenticity_token: true do |f|
+ = f.text_area :note, class: 'note_text js-note-text js-gfm-input turn-on'
- .form-actions.clearfix
- = f.submit 'Save changes', class: "btn btn-primary btn-save js-comment-button"
+ .form-actions.clearfix
+ = f.submit 'Save changes', class: "btn btn-primary btn-save js-comment-button"
- .note-form-option
- %a.choose-btn.btn.js-choose-note-attachment-button
- %i.icon-paper-clip
- %span Choose File ...
- &nbsp;
- %span.file_name.js-attachment-filename File name...
- = f.file_field :attachment, class: "js-note-attachment-input hidden"
+ .note-form-option
+ %a.choose-btn.btn.js-choose-note-attachment-button
+ %i.icon-paper-clip
+ %span Choose File ...
+ &nbsp;
+ %span.file_name.js-attachment-filename File name...
+ = f.file_field :attachment, class: "js-note-attachment-input hidden"
- = link_to 'Cancel', "#", class: "btn btn-cancel note-edit-cancel"
+ = link_to 'Cancel', "#", class: "btn btn-cancel note-edit-cancel"
- - if note.attachment.url
- .note-attachment
- - if note.attachment.image?
- = link_to note.attachment.secure_url, target: '_blank' do
- = image_tag note.attachment.secure_url, class: 'note-image-attach'
- .attachment.pull-right
- = link_to note.attachment.secure_url, target: "_blank" do
- %i.icon-paper-clip
- = note.attachment_identifier
- = link_to delete_attachment_project_note_path(@project, note),
- title: "Delete this attachment", method: :delete, remote: true, data: { confirm: 'Are you sure you want to remove the attachment?' }, class: "danger js-note-attachment-delete" do
- %i.icon-trash.cred
- .clear
+ - if note.attachment.url
+ .note-attachment
+ - if note.attachment.image?
+ = link_to note.attachment.secure_url, target: '_blank' do
+ = image_tag note.attachment.secure_url, class: 'note-image-attach'
+ .attachment.pull-right
+ = link_to note.attachment.secure_url, target: "_blank" do
+ %i.icon-paper-clip
+ = note.attachment_identifier
+ = link_to delete_attachment_project_note_path(@project, note),
+ title: "Delete this attachment", method: :delete, remote: true, data: { confirm: 'Are you sure you want to remove the attachment?' }, class: "danger js-note-attachment-delete" do
+ %i.icon-trash.cred
+ .clear
diff --git a/app/views/projects/notes/_notes_with_form.html.haml b/app/views/projects/notes/_notes_with_form.html.haml
index 052661962e4..04ee17a40a0 100644
--- a/app/views/projects/notes/_notes_with_form.html.haml
+++ b/app/views/projects/notes/_notes_with_form.html.haml
@@ -1,4 +1,4 @@
-%ul#notes-list.notes.main-notes-list
+%ul#notes-list.notes.main-notes-list.timeline
= render "projects/notes/notes"
.js-notes-busy
diff --git a/app/views/projects/notes/discussions/_active.html.haml b/app/views/projects/notes/discussions/_active.html.haml
index ef296b35dd5..eb416c5b5f0 100644
--- a/app/views/projects/notes/discussions/_active.html.haml
+++ b/app/views/projects/notes/discussions/_active.html.haml
@@ -5,7 +5,6 @@
= link_to "#", class: "js-toggle-button" do
%i.icon-chevron-up
Show/hide discussion
- = image_tag avatar_icon(note.author_email), class: "avatar s32"
%div
= link_to_member(@project, note.author, avatar: false)
started a discussion
diff --git a/app/views/projects/notes/discussions/_commit.html.haml b/app/views/projects/notes/discussions/_commit.html.haml
index 78460974a9b..a928029a5e5 100644
--- a/app/views/projects/notes/discussions/_commit.html.haml
+++ b/app/views/projects/notes/discussions/_commit.html.haml
@@ -5,7 +5,6 @@
= link_to "#", class: "js-toggle-button" do
%i.icon-chevron-up
Show/hide discussion
- = image_tag avatar_icon(note.author_email), class: "avatar s32"
%div
= link_to_member(@project, note.author, avatar: false)
started a discussion on commit
diff --git a/app/views/projects/notes/discussions/_diff.html.haml b/app/views/projects/notes/discussions/_diff.html.haml
index 26c5494f466..da71220af17 100644
--- a/app/views/projects/notes/discussions/_diff.html.haml
+++ b/app/views/projects/notes/discussions/_diff.html.haml
@@ -11,16 +11,17 @@
%br/
.diff-content
%table
- - each_diff_line_near(diff, note.diff_file_index, note.line_code) do |line, type, line_code, line_new, line_old|
+ - note.truncated_diff_lines.each do |line|
+ - line_code = generate_line_code(note.file_path, line)
%tr.line_holder{ id: line_code }
- - if type == "match"
+ - if line.type == "match"
%td.old_line= "..."
%td.new_line= "..."
- %td.line_content.matched= line
+ %td.line_content.matched= line.text
- else
- %td.old_line= raw(type == "new" ? "&nbsp;" : line_old)
- %td.new_line= raw(type == "old" ? "&nbsp;" : line_new)
- %td.line_content{class: "noteable_line #{type} #{line_code}", "line_code" => line_code}= raw "#{line} &nbsp;"
+ %td.old_line= raw(line.type == "new" ? "&nbsp;" : line.old_pos)
+ %td.new_line= raw(line.type == "old" ? "&nbsp;" : line.new_pos)
+ %td.line_content{class: "noteable_line #{line.type} #{line_code}", "line_code" => line_code}= raw "#{line.text} &nbsp;"
- if line_code == note.line_code
= render "projects/notes/diff_notes_with_reply", notes: discussion_notes
diff --git a/app/views/projects/notes/discussions/_outdated.html.haml b/app/views/projects/notes/discussions/_outdated.html.haml
index 67c29be8ac1..4ae914c107b 100644
--- a/app/views/projects/notes/discussions/_outdated.html.haml
+++ b/app/views/projects/notes/discussions/_outdated.html.haml
@@ -5,7 +5,6 @@
= link_to "#", class: "js-toggle-button" do
%i.icon-chevron-down
Show/hide discussion
- = image_tag avatar_icon(note.author_email), class: "avatar s32"
%div
= link_to_member(@project, note.author, avatar: false)
started a discussion on the
diff --git a/app/views/projects/protected_branches/index.html.haml b/app/views/projects/protected_branches/index.html.haml
index 7925e800305..3980a6c0863 100644
--- a/app/views/projects/protected_branches/index.html.haml
+++ b/app/views/projects/protected_branches/index.html.haml
@@ -1,14 +1,14 @@
%h3.page-title Protected branches
-%p.light This ability allows to keep stable branches secured and force code review before merge to protected branches
+%p.light This ability keeps stable branches secure and forces developers to use code reviews
%hr
.bs-callout.bs-callout-info
- %p Protected branches designed to
+ %p Protected branches are designed to
%ul
- %li prevent push for all except #{link_to "masters", help_page_path("permissions", "permissions"), class: "vlink"}
- %li prevent branch from force push
- %li prevent branch from removal
- %p Read more about project permissions #{link_to "here", help_page_path("permissions", "permissions"), class: "underlined-link"}
+ %li prevent pushes from everybody except #{link_to "masters", help_page_path("permissions", "permissions"), class: "vlink"}
+ %li prevents anyone from force pushing to the branch
+ %li prevents anyone from deleting the branch
+ %p Read more about #{link_to "project permissions", help_page_path("permissions", "permissions"), class: "underlined-link"}
- if can? current_user, :admin_project, @project
= form_for [@project, @protected_branch], html: { class: 'form-horizontal' } do |f|
diff --git a/app/views/projects/repositories/stats.html.haml b/app/views/projects/repositories/stats.html.haml
deleted file mode 100644
index 70db27d6444..00000000000
--- a/app/views/projects/repositories/stats.html.haml
+++ /dev/null
@@ -1,33 +0,0 @@
-= render "projects/commits/head"
-.row
- .col-md-6
- %div#activity-chart.chart
- %hr
- %p
- %b Total commits:
- %span= @repository.commit_count
- %p
- %b Total files in #{@repository.root_ref}:
- %span= @stats.files_count
- %p
- %b Authors:
- %span= @stats.authors_count
-
-
- .col-md-6
- %h4 Top 50 Committers:
- %ol.styled
- - @stats.authors[0...50].each do |author|
- %li
- = image_tag avatar_icon(author.email, 16), class: 'avatar s16', alt: ''
- = author.name
- %small.light= author.email
- .pull-right
- = author.commits
-
-
-:javascript
- var labels = [#{@graph.labels.to_json}];
- var commits = [#{@graph.commits.join(', ')}];
- var title = "Commit activity for last #{@graph.weeks} weeks";
- Chart.init(labels, commits, title);
diff --git a/app/views/projects/show.html.haml b/app/views/projects/show.html.haml
index 0fd290b5398..7902f51f72f 100644
--- a/app/views/projects/show.html.haml
+++ b/app/views/projects/show.html.haml
@@ -1,5 +1,16 @@
= render "home_panel"
+%ul.nav.nav-tabs
+ %li.active
+ = link_to project_path(@project) do
+ Activity
+ .project-home-links
+ - unless @project.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)
+ %span.light.prepend-left-20= repository_size
+
.row
%section.col-md-9
= render "events/event_last_push", event: @last_push
@@ -22,33 +33,7 @@
%br
= link_to @project.forked_from_project.name_with_namespace, project_path(@project.forked_from_project)
- .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_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
-
= link_to project_compare_index_path(@project, from: @repository.root_ref, to: @ref || @repository.root_ref), class: 'btn btn-block' do
Compare code
diff --git a/app/views/projects/tags/destroy.js.haml b/app/views/projects/tags/destroy.js.haml
new file mode 100644
index 00000000000..ada6710f940
--- /dev/null
+++ b/app/views/projects/tags/destroy.js.haml
@@ -0,0 +1,3 @@
+$('.js-totaltags-count').html("#{@repository.tags.size}")
+- if @repository.tags.size == 0
+ $('.tags').load(document.URL + ' .nothing-here-block').hide().fadeIn(1000)
diff --git a/app/views/projects/tags/index.html.haml b/app/views/projects/tags/index.html.haml
index dc3188d43b8..6cbf99239ee 100644
--- a/app/views/projects/tags/index.html.haml
+++ b/app/views/projects/tags/index.html.haml
@@ -12,18 +12,19 @@
Tags give the ability to mark specific points in history as being important
%hr
-- unless @tags.empty?
- %ul.bordered-list
- - @tags.each do |tag|
- = render 'tag', tag: @repository.find_tag(tag)
+.tags
+ - unless @tags.empty?
+ %ul.bordered-list
+ - @tags.each do |tag|
+ = render 'tag', tag: @repository.find_tag(tag)
- = paginate @tags, theme: 'gitlab'
+ = paginate @tags, theme: 'gitlab'
-- else
- .nothing-here-block
- Repository has no tags yet.
- %br
- %small
- Use git tag command to add a new one:
+ - else
+ .nothing-here-block
+ Repository has no tags yet.
%br
- %span.monospace git tag -a v1.4 -m 'version 1.4'
+ %small
+ Use git tag command to add a new one:
+ %br
+ %span.monospace git tag -a v1.4 -m 'version 1.4'
diff --git a/app/views/projects/tags/new.html.haml b/app/views/projects/tags/new.html.haml
index a9fd97f8915..45ee61caf68 100644
--- a/app/views/projects/tags/new.html.haml
+++ b/app/views/projects/tags/new.html.haml
@@ -1,3 +1,7 @@
+- if @error
+ .alert.alert-danger
+ %button{ type: "button", class: "close", "data-dismiss" => "alert"} &times;
+ = @error
%h3.page-title
%i.icon-code-fork
New tag
@@ -5,12 +9,17 @@
.form-group
= label_tag :tag_name, 'Name for new tag', class: 'control-label'
.col-sm-10
- = text_field_tag :tag_name, nil, placeholder: 'v3.0.1', required: true, tabindex: 1, class: 'form-control'
+ = text_field_tag :tag_name, params[:tag_name], placeholder: 'v3.0.1', required: true, tabindex: 1, class: 'form-control'
.form-group
= label_tag :ref, 'Create from', class: 'control-label'
.col-sm-10
- = text_field_tag :ref, nil, placeholder: 'master', required: true, tabindex: 2, class: 'form-control'
+ = text_field_tag :ref, params[:ref], placeholder: 'master', required: true, tabindex: 2, class: 'form-control'
.light Branch name or commit SHA
+ .form-group
+ = label_tag :message, 'Message', class: 'control-label'
+ .col-sm-10
+ = text_field_tag :message, nil, placeholder: 'Enter message.', required: false, tabindex: 3, class: 'form-control'
+ .light (Optional) Entering a message will create an annotated tag.
.form-actions
= submit_tag 'Create tag', class: 'btn btn-create', tabindex: 3
= link_to 'Cancel', project_tags_path(@project), class: 'btn btn-cancel'
diff --git a/app/views/projects/team_members/_form.html.haml b/app/views/projects/team_members/_form.html.haml
index dd059fb99d3..2bf61fa12bb 100644
--- a/app/views/projects/team_members/_form.html.haml
+++ b/app/views/projects/team_members/_form.html.haml
@@ -1,7 +1,7 @@
%h3.page-title
- = "New project member(s)"
+ New project member(s)
-= form_for @user_project_relation, as: :team_member, url: project_team_members_path(@project), html: { class: "form-horizontal users-project-form" } do |f|
+= form_for @user_project_relation, as: :project_member, url: project_team_members_path(@project), html: { class: "form-horizontal users-project-form" } do |f|
-if @user_project_relation.errors.any?
.alert.alert-danger
%ul
@@ -16,8 +16,8 @@
%p 2. Set access level for them
.form-group
- = f.label :project_access, "Project Access", class: 'control-label'
- .col-sm-10= select_tag :project_access, options_for_select(Gitlab::Access.options, @user_project_relation.project_access), class: "project-access-select select2"
+ = f.label :access_level, "Project Access", class: 'control-label'
+ .col-sm-10= select_tag :access_level, options_for_select(Gitlab::Access.options, @user_project_relation.access_level), class: "project-access-select select2"
.form-actions
= f.submit 'Add users', class: "btn btn-create"
diff --git a/app/views/projects/team_members/_group_members.html.haml b/app/views/projects/team_members/_group_members.html.haml
index 83c4b6f87d5..77ffab89f37 100644
--- a/app/views/projects/team_members/_group_members.html.haml
+++ b/app/views/projects/team_members/_group_members.html.haml
@@ -1,4 +1,4 @@
-- group_users_count = @group.users_groups.count
+- group_users_count = @group.group_members.count
.panel.panel-default
.panel-heading
%strong #{@group.name}
@@ -7,8 +7,8 @@
= link_to members_group_path(@group), class: 'btn btn-small' do
%i.icon-edit
%ul.well-list
- - @group.users_groups.order('group_access DESC').limit(20).each do |member|
- = render 'users_groups/users_group', member: member, show_controls: false
+ - @group.group_members.order('access_level DESC').limit(20).each do |member|
+ = render 'groups/group_members/group_member', member: member, show_controls: false
- if group_users_count > 20
%li
and #{group_users_count - 20} more. For full list visit #{link_to 'group members page', members_group_path(@group)}
diff --git a/app/views/projects/team_members/_team_member.html.haml b/app/views/projects/team_members/_team_member.html.haml
index d93bb44ab96..79b78665417 100644
--- a/app/views/projects/team_members/_team_member.html.haml
+++ b/app/views/projects/team_members/_team_member.html.haml
@@ -4,8 +4,8 @@
- if current_user_can_admin_project
- unless @project.personal? && user == current_user
.pull-left
- = form_for(member, as: :team_member, url: project_team_member_path(@project, member.user)) do |f|
- = f.select :project_access, options_for_select(UsersProject.access_roles, member.project_access), {}, class: "medium project-access-select span2 trigger-submit"
+ = form_for(member, as: :project_member, url: project_team_member_path(@project, member.user)) do |f|
+ = f.select :access_level, options_for_select(ProjectMember.access_roles, member.access_level), {}, class: "medium project-access-select span2 trigger-submit"
&nbsp;
= link_to project_team_member_path(@project, user), data: { confirm: remove_from_project_team_message(@project, user)}, method: :delete, class: "btn-tiny btn btn-remove", title: 'Remove user from team' do
%i.icon-minus.icon-white
diff --git a/app/views/projects/team_members/import.html.haml b/app/views/projects/team_members/import.html.haml
index d3e4a762018..510b579fe2f 100644
--- a/app/views/projects/team_members/import.html.haml
+++ b/app/views/projects/team_members/import.html.haml
@@ -1,5 +1,5 @@
%h3.page-title
- = "Import members from another project"
+ Import members from another project
%p.light
Only project members will be imported. Group members will be skipped.
%hr
diff --git a/app/views/projects/team_members/index.html.haml b/app/views/projects/team_members/index.html.haml
index ddb3b9d4a9d..ecb7c689e8a 100644
--- a/app/views/projects/team_members/index.html.haml
+++ b/app/views/projects/team_members/index.html.haml
@@ -11,6 +11,6 @@
%p.light
Read more about project permissions
%strong= link_to "here", help_page_path("permissions", "permissions"), class: "vlink"
-= render "team", members: @users_projects
+= render "team", members: @project_members
- if @group
= render "group_members"
diff --git a/app/views/projects/tree/_readme.html.haml b/app/views/projects/tree/_readme.html.haml
index 9d0292059d6..ec2701af0eb 100644
--- a/app/views/projects/tree/_readme.html.haml
+++ b/app/views/projects/tree/_readme.html.haml
@@ -1,6 +1,7 @@
%article.readme-holder#README
- %h4.readme-file-title
- %i.icon-file
- = readme.name
+ = link_to '#README' do
+ %h4.readme-file-title
+ %i.icon-file
+ = readme.name
.wiki
= render_readme(readme)
diff --git a/app/views/projects/wikis/history.html.haml b/app/views/projects/wikis/history.html.haml
index 7bc566cf7f5..d3a66c48c9b 100644
--- a/app/views/projects/wikis/history.html.haml
+++ b/app/views/projects/wikis/history.html.haml
@@ -17,11 +17,11 @@
%tr
%td
= link_to project_wiki_path(@project, @page, version_id: commit.id) do
- = commit.short_id
+ = commit.id[0..10]
%td
- = commit_author_link(commit, avatar: true, size: 24)
+ = commit.author.name
%td
- = commit.title
+ = commit.message
%td
#{time_ago_with_tooltip(version.date)}
%td
diff --git a/app/views/projects/wikis/pages.html.haml b/app/views/projects/wikis/pages.html.haml
index 74317faf9d6..264b48ec36c 100644
--- a/app/views/projects/wikis/pages.html.haml
+++ b/app/views/projects/wikis/pages.html.haml
@@ -8,5 +8,5 @@
= link_to wiki_page.title, project_wiki_path(@project, wiki_page)
%small (#{wiki_page.format})
.pull-right
- %small Last edited #{time_ago_with_tooltip(wiki_page.commit.created_at)}
+ %small Last edited #{time_ago_with_tooltip(wiki_page.commit.authored_date)}
= paginate @wiki_pages, theme: 'gitlab'
diff --git a/app/views/projects/wikis/show.html.haml b/app/views/projects/wikis/show.html.haml
index cb923e4ca32..ede4fef9e24 100644
--- a/app/views/projects/wikis/show.html.haml
+++ b/app/views/projects/wikis/show.html.haml
@@ -17,4 +17,4 @@
%hr
.wiki-last-edit-by
- Last edited by #{commit_author_link(@page.commit, avatar: true, size: 16)} #{time_ago_with_tooltip(@page.commit.created_at)}
+ Last edited by #{@page.commit.author.name} #{time_ago_with_tooltip(@page.commit.authored_date)}
diff --git a/app/views/search/_filter.html.haml b/app/views/search/_filter.html.haml
index 979b18e3856..049aff0bc9b 100644
--- a/app/views/search/_filter.html.haml
+++ b/app/views/search/_filter.html.haml
@@ -9,14 +9,14 @@
%b.caret
%ul.dropdown-menu
%li
- = link_to search_path(group_id: nil, search: params[:search]) do
+ = link_to search_filter_path(group_id: nil) do
Any
- current_user.authorized_groups.sort_by(&:name).each do |group|
%li
- = link_to search_path(group_id: group.id, search: params[:search]) do
+ = link_to search_filter_path(group_id: group.id, project_id: nil) do
= group.name
-.dropdown.inline.prepend-left-10
+.dropdown.inline.prepend-left-10.project-filter
%a.dropdown-toggle.btn.btn-small{href: '#', "data-toggle" => "dropdown"}
%i.icon-tags
%span.light Project:
@@ -27,9 +27,9 @@
%b.caret
%ul.dropdown-menu
%li
- = link_to search_path(project_id: nil, search: params[:search]) do
+ = link_to search_filter_path(project_id: nil) do
Any
- current_user.authorized_projects.sort_by(&:name_with_namespace).each do |project|
%li
- = link_to search_path(project_id: project.id, search: params[:search]) do
+ = link_to search_filter_path(project_id: project.id, group_id: nil) do
= project.name_with_namespace
diff --git a/app/views/search/_global_filter.html.haml b/app/views/search/_global_filter.html.haml
new file mode 100644
index 00000000000..442bd84f930
--- /dev/null
+++ b/app/views/search/_global_filter.html.haml
@@ -0,0 +1,16 @@
+%ul.nav.nav-pills.nav-stacked.search-filter
+ %li{class: ("active" if @scope == 'projects')}
+ = link_to search_filter_path(scope: 'projects') do
+ Projects
+ .pull-right
+ = @search_results.projects_count
+ %li{class: ("active" if @scope == 'issues')}
+ = link_to search_filter_path(scope: 'issues') do
+ Issues
+ .pull-right
+ = @search_results.issues_count
+ %li{class: ("active" if @scope == 'merge_requests')}
+ = link_to search_filter_path(scope: 'merge_requests') do
+ Merge requests
+ .pull-right
+ = @search_results.merge_requests_count
diff --git a/app/views/search/_global_results.html.haml b/app/views/search/_global_results.html.haml
deleted file mode 100644
index 7f4f0e5e000..00000000000
--- a/app/views/search/_global_results.html.haml
+++ /dev/null
@@ -1,5 +0,0 @@
-.search_results
- %ul.bordered-list
- = render partial: "search/results/project", collection: @search_results[:projects]
- = render partial: "search/results/merge_request", collection: @search_results[:merge_requests]
- = render partial: "search/results/issue", collection: @search_results[:issues]
diff --git a/app/views/search/_project_filter.html.haml b/app/views/search/_project_filter.html.haml
new file mode 100644
index 00000000000..57a45c9acb6
--- /dev/null
+++ b/app/views/search/_project_filter.html.haml
@@ -0,0 +1,31 @@
+%ul.nav.nav-pills.nav-stacked.search-filter
+ %li{class: ("active" if @scope == 'blobs')}
+ = link_to search_filter_path(scope: 'blobs') do
+ %i.icon-code
+ Code
+ .pull-right
+ = @search_results.blobs_count
+ %li{class: ("active" if @scope == 'issues')}
+ = link_to search_filter_path(scope: 'issues') do
+ %i.icon-exclamation-sign
+ Issues
+ .pull-right
+ = @search_results.issues_count
+ %li{class: ("active" if @scope == 'merge_requests')}
+ = link_to search_filter_path(scope: 'merge_requests') do
+ %i.icon-code-fork
+ Merge requests
+ .pull-right
+ = @search_results.merge_requests_count
+ %li{class: ("active" if @scope == 'notes')}
+ = link_to search_filter_path(scope: 'notes') do
+ %i.icon-comments
+ Comments
+ .pull-right
+ = @search_results.notes_count
+ %li{class: ("active" if @scope == 'wiki_blobs')}
+ = link_to search_filter_path(scope: 'wiki_blobs') do
+ Wiki
+ .pull-right
+ = @search_results.wiki_blobs_count
+
diff --git a/app/views/search/_project_results.html.haml b/app/views/search/_project_results.html.haml
deleted file mode 100644
index 5e8346a8262..00000000000
--- a/app/views/search/_project_results.html.haml
+++ /dev/null
@@ -1,24 +0,0 @@
-%ul.nav.nav-tabs
- %li{class: ("active" if params[:search_code].present?)}
- = link_to search_path(params.merge(search_code: true)) do
- Repository Code
- %li{class: ("active" if params[:search_code].blank?)}
- = link_to search_path(params.merge(search_code: nil)) do
- Issues and Merge requests
-
-.search_results
- - if params[:search_code].present?
- .blob-results
- - if !@search_results[:blobs].empty?
- = render partial: "search/results/blob", collection: @search_results[:blobs]
- = paginate @search_results[:blobs], theme: 'gitlab'
- - else
- = render partial: "search/results/empty", :locals => { message: "We couldn't find any matching code" }
- - else
- - if @search_results[:merge_requests].present? || @search_results[:issues].present? || @search_results[:notes].present?
- %ul.bordered-list
- = render partial: "search/results/merge_request", collection: @search_results[:merge_requests]
- = render partial: "search/results/issue", collection: @search_results[:issues]
- = render partial: "search/results/note", collection: @search_results[:notes]
- - else
- = render partial: "search/results/empty", locals: { message: "We couldn't find any issues, merge requests or notes" }
diff --git a/app/views/search/_results.html.haml b/app/views/search/_results.html.haml
index 2336d0f71d5..58bcff9dbe3 100644
--- a/app/views/search/_results.html.haml
+++ b/app/views/search/_results.html.haml
@@ -1,17 +1,28 @@
%h4
- #{@search_results[:total_results]} results found
- - if @project
- for #{link_to @project.name_with_namespace, @project}
- - elsif @group
- for #{link_to @group.name, @group}
+ #{@search_results.total_count} results found
+ - unless @show_snippets
+ - if @project
+ for #{link_to @project.name_with_namespace, @project}
+ - elsif @group
+ for #{link_to @group.name, @group}
%hr
-- if @project
- = render "project_results"
-- else
- = render "global_results"
+.row
+ .col-sm-3
+ - if @project
+ = render "project_filter"
+ - elsif @show_snippets
+ = render 'snippet_filter'
+ - else
+ = render "global_filter"
+ .col-sm-9
+ .search-results
+ - if @search_results.empty?
+ = render partial: "search/results/empty", locals: { message: "We couldn't find any matching results" }
+ - else
+ = render partial: "search/results/#{@scope.singularize}", collection: @objects
+ = paginate @objects, theme: 'gitlab'
:javascript
- $(".search_results .term").highlight("#{escape_javascript(params[:search])}");
-
+ $(".search-results .term").highlight("#{escape_javascript(params[:search])}");
diff --git a/app/views/search/_snippet_filter.html.haml b/app/views/search/_snippet_filter.html.haml
new file mode 100644
index 00000000000..0d1984a0d78
--- /dev/null
+++ b/app/views/search/_snippet_filter.html.haml
@@ -0,0 +1,13 @@
+%ul.nav.nav-pills.nav-stacked.search-filter
+ %li{class: ("active" if @scope == 'snippet_blobs')}
+ = link_to search_filter_path(scope: 'snippet_blobs', snippets: true, group_id: nil, project_id: nil) do
+ %i.icon-code
+ Snippet Contents
+ .pull-right
+ = @search_results.snippet_blobs_count
+ %li{class: ("active" if @scope == 'snippet_titles')}
+ = link_to search_filter_path(scope: 'snippet_titles', snippets: true, group_id: nil, project_id: nil) do
+ %i.icon-book
+ Titles and Filenames
+ .pull-right
+ = @search_results.snippet_titles_count
diff --git a/app/views/search/results/_issue.html.haml b/app/views/search/results/_issue.html.haml
index 8147cf272fb..7868f958261 100644
--- a/app/views/search/results/_issue.html.haml
+++ b/app/views/search/results/_issue.html.haml
@@ -1,9 +1,14 @@
-%li
- issue:
- = link_to [issue.project, issue] do
- %span ##{issue.iid}
- %strong.term
- = truncate issue.title, length: 50
- %span.light (#{issue.project.name_with_namespace})
+.search-result-row
+ %h4
+ = link_to [issue.project, issue] do
+ %span.term.str-truncated= issue.title
+ .pull-right ##{issue.iid}
+ - if issue.description.present?
+ .description.term
+ = preserve do
+ = search_md_sanitize(markdown(issue.description))
+ %span.light
+ #{issue.project.name_with_namespace}
- if issue.closed?
- %span.label.label-danger Closed
+ .pull-right
+ %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 de2a79970c1..56b185283bd 100644
--- a/app/views/search/results/_merge_request.html.haml
+++ b/app/views/search/results/_merge_request.html.haml
@@ -1,14 +1,16 @@
-%li
- merge request:
- = link_to [merge_request.target_project, merge_request] do
- %span ##{merge_request.iid}
- %strong.term
- = truncate merge_request.title, length: 50
- - if merge_request.for_fork?
- %span.light (#{merge_request.source_project.name_with_namespace}:#{merge_request.source_branch} &rarr; #{merge_request.target_project.name_with_namespace}:#{merge_request.target_branch})
- - else
- %span.light (#{merge_request.source_branch} &rarr; #{merge_request.target_branch})
- - if merge_request.merged?
- %span.label.label-primary Merged
- - elsif merge_request.closed?
- %span.label.label-danger Closed
+.search-result-row
+ %h4
+ = link_to [merge_request.target_project, merge_request] do
+ %span.term.str-truncated= merge_request.title
+ .pull-right ##{merge_request.iid}
+ - if merge_request.description.present?
+ .description.term
+ = preserve do
+ = search_md_sanitize(markdown(merge_request.description))
+ %span.light
+ #{merge_request.project.name_with_namespace}
+ .pull-right
+ - if merge_request.merged?
+ %span.label.label-primary Merged
+ - elsif merge_request.closed?
+ %span.label.label-danger Closed
diff --git a/app/views/search/results/_note.html.haml b/app/views/search/results/_note.html.haml
index 97e892bdd4d..6a446538574 100644
--- a/app/views/search/results/_note.html.haml
+++ b/app/views/search/results/_note.html.haml
@@ -1,9 +1,26 @@
-%li
- note on issue:
- = link_to [note.project, note.noteable] do
- %span ##{note.noteable.iid}
- %strong.term
- = truncate note.noteable.title, length: 50
- %span.light (#{note.project.name_with_namespace})
- - if note.noteable.closed?
- %span.label Closed
+- project = note.project
+.search-result-row
+ %h5.note-search-caption.str-truncated
+ %i.icon-comment
+ = link_to_member(project, note.author, avatar: false)
+ commented on
+
+ - if note.for_commit?
+ = link_to project do
+ = project.name_with_namespace
+ &middot;
+ = link_to project_commit_path(project, note.commit_id, anchor: dom_id(note)) do
+ Commit #{note.commit_id[0..8]}
+ - else
+ = link_to project do
+ = project.name_with_namespace
+ &middot;
+ %span #{note.noteable_type.titleize} ##{note.noteable.iid}
+ &middot;
+ = link_to [project, note.noteable, anchor: dom_id(note)] do
+ = note.noteable.title
+
+ .note-search-result
+ .term
+ = preserve do
+ = search_md_sanitize(markdown(note.note, {no_header_anchors: true}))
diff --git a/app/views/search/results/_project.html.haml b/app/views/search/results/_project.html.haml
index abc86c72bef..301b65eca29 100644
--- a/app/views/search/results/_project.html.haml
+++ b/app/views/search/results/_project.html.haml
@@ -1,7 +1,6 @@
-%li
- project:
- = link_to project do
- %strong.term= project.name_with_namespace
+.search-result-row
+ %h4
+ = link_to project do
+ %span.term= project.name_with_namespace
- if project.description.present?
- &ndash;
%span.light.term= project.description
diff --git a/app/views/search/results/_snippet_blob.html.haml b/app/views/search/results/_snippet_blob.html.haml
new file mode 100644
index 00000000000..a3d909d44dc
--- /dev/null
+++ b/app/views/search/results/_snippet_blob.html.haml
@@ -0,0 +1,65 @@
+.search-result-row
+ %span
+ = snippet_blob[:snippet_object].title
+ by
+ = link_to user_snippets_path(snippet_blob[:snippet_object].author) do
+ = image_tag avatar_icon(snippet_blob[:snippet_object].author_email), class: "avatar avatar-inline s16", alt: ''
+ = snippet_blob[:snippet_object].author_name
+ %span.light #{time_ago_with_tooltip(snippet_blob[:snippet_object].created_at)}
+ %h4.snippet-title
+ - snippet_path = reliable_snippet_path(snippet_blob[:snippet_object])
+ = link_to snippet_path do
+ .file-holder
+ .file-title
+ %i.icon-file
+ %strong= snippet_blob[:snippet_object].file_name
+ %span.options
+ .btn-group.tree-btn-group.pull-right
+ - if snippet_blob[:snippet_object].author == current_user
+ = link_to "Edit", edit_snippet_path(snippet_blob[:snippet_object]), class: "btn btn-tiny", title: 'Edit Snippet'
+ = link_to "Delete", snippet_path(snippet_blob[:snippet_object]), method: :delete, data: { confirm: "Are you sure?" }, class: "btn btn-tiny", title: 'Delete Snippet'
+ = link_to "Raw", raw_snippet_path(snippet_blob[:snippet_object]), class: "btn btn-tiny", target: "_blank"
+ - if gitlab_markdown?(snippet_blob[:snippet_object].file_name)
+ .file-content.wiki
+ - snippet_blob[:snippet_chunks].each do |snippet|
+ - unless snippet[:data].empty?
+ = preserve do
+ = markdown(snippet[:data])
+ - else
+ .file-content.code
+ .nothing-here-block Empty file
+ - elsif markup?(snippet_blob[:snippet_object].file_name)
+ .file-content.wiki
+ - snippet_blob[:snippet_chunks].each do |snippet|
+ - unless snippet[:data].empty?
+ = render_markup(snippet_blob[:snippet_object].file_name, snippet[:data])
+ - else
+ .file-content.code
+ .nothing-here-block Empty file
+ - else
+ .file-content.code
+ %div.highlighted-data{class: user_color_scheme_class}
+ .line-numbers
+ - snippet_blob[:snippet_chunks].each do |snippet|
+ - unless snippet[:data].empty?
+ - snippet[:data].lines.to_a.size.times do |index|
+ - offset = defined?(snippet[:start_line]) ? snippet[:start_line] : 1
+ - i = index + offset
+ = link_to snippet_path+"#L#{i}", id: "L#{i}", rel: "#L#{i}" do
+ %i.icon-link
+ = i
+ - unless snippet == snippet_blob[:snippet_chunks].last
+ %a
+ = "."
+ .highlight.term
+ %pre
+ %code
+ - snippet_blob[:snippet_chunks].each do |snippet|
+ - unless snippet[:data].empty?
+ = snippet[:data]
+ - unless snippet == snippet_blob[:snippet_chunks].last
+ %a
+ = "..."
+ - else
+ .file-content.code
+ .nothing-here-block Empty file
diff --git a/app/views/search/results/_snippet_title.html.haml b/app/views/search/results/_snippet_title.html.haml
new file mode 100644
index 00000000000..84abb9293b2
--- /dev/null
+++ b/app/views/search/results/_snippet_title.html.haml
@@ -0,0 +1,23 @@
+.search-result-row
+ %h4.snippet-title.term
+ = link_to reliable_snippet_path(snippet_title) do
+ = truncate(snippet_title.title, length: 60)
+ - if snippet_title.private?
+ %span.label.label-gray
+ %i.icon-lock
+ private
+ %span.cgray.monospace.tiny.pull-right.term
+ = snippet_title.file_name
+
+ %small.pull-right.cgray
+ - if snippet_title.project_id?
+ = link_to snippet_title.project.name_with_namespace, project_path(snippet_title.project)
+
+ .snippet-info
+ = "##{snippet_title.id}"
+ %span
+ by
+ = link_to user_snippets_path(snippet_title.author) do
+ = image_tag avatar_icon(snippet_title.author_email), class: "avatar avatar-inline s16", alt: ''
+ = snippet_title.author_name
+ %span.light #{time_ago_with_tooltip(snippet_title.created_at)}
diff --git a/app/views/search/results/_wiki_blob.html.haml b/app/views/search/results/_wiki_blob.html.haml
new file mode 100644
index 00000000000..75414d73b0c
--- /dev/null
+++ b/app/views/search/results/_wiki_blob.html.haml
@@ -0,0 +1,9 @@
+.blob-result
+ .file-holder
+ .file-title
+ = link_to project_wiki_path(@project, wiki_blob.filename) do
+ %i.icon-file
+ %strong
+ = wiki_blob.filename
+ .file-content.code.term
+ = render 'shared/file_hljs', blob: wiki_blob, first_line_number: wiki_blob.startline
diff --git a/app/views/search/show.html.haml b/app/views/search/show.html.haml
index 3b6f10d4d9c..bae57917a4c 100644
--- a/app/views/search/show.html.haml
+++ b/app/views/search/show.html.haml
@@ -9,11 +9,13 @@
= submit_tag 'Search', class: "btn btn-create"
.form-group
.col-sm-2
- .col-sm-10
- = render 'filter', f: f
+ - unless params[:snippets].eql? 'true'
+ .col-sm-10
+ = render 'filter', f: f
= hidden_field_tag :project_id, params[:project_id]
= hidden_field_tag :group_id, params[:group_id]
- = hidden_field_tag :search_code, params[:search_code]
+ = hidden_field_tag :snippets, params[:snippets]
+ = hidden_field_tag :scope, params[:scope]
.results.prepend-top-10
- if params[:search].present?
diff --git a/app/views/shared/_clone_panel.html.haml b/app/views/shared/_clone_panel.html.haml
index 8cd426c71e6..1cc6043f56b 100644
--- a/app/views/shared/_clone_panel.html.haml
+++ b/app/views/shared/_clone_panel.html.haml
@@ -4,3 +4,8 @@
%button{class: "btn #{ 'active' if default_clone_protocol == 'ssh' }", :"data-clone" => project.ssh_url_to_repo} SSH
%button{class: "btn #{ 'active' if default_clone_protocol == 'http' }", :"data-clone" => project.http_url_to_repo}= gitlab_config.protocol.upcase
= text_field_tag :project_clone, default_url_to_repo(project), class: "one_click_select form-control", readonly: true
+ - if project.kind_of?(Project)
+ .input-group-addon
+ .visibility-level-label.has_tooltip{'data-title' => "#{visibility_level_label(project.visibility_level)} project" }
+ = visibility_level_icon(project.visibility_level)
+ = visibility_level_label(project.visibility_level).downcase
diff --git a/app/views/shared/_file_hljs.html.haml b/app/views/shared/_file_hljs.html.haml
index ceee2c7527d..cbc01bd60e0 100644
--- a/app/views/shared/_file_hljs.html.haml
+++ b/app/views/shared/_file_hljs.html.haml
@@ -1,12 +1,13 @@
%div.highlighted-data{class: user_color_scheme_class}
.line-numbers
- - blob.data.lines.to_a.size.times do |index|
- - offset = defined?(first_line_number) ? first_line_number : 1
- - i = index + offset
- = link_to "#L#{i}", id: "L#{i}", rel: "#L#{i}" do
- %i.icon-link
- = i
+ - if blob.data.present?
+ - blob.data.lines.to_a.size.times do |index|
+ - offset = defined?(first_line_number) ? first_line_number : 1
+ - i = index + offset
+ = link_to "#L#{i}", id: "L#{i}", rel: "#L#{i}" do
+ %i.icon-link
+ = i
.highlight
%pre
%code{ class: highlightjs_class(blob.name) }
- = blob.data
+ #{blob.data}
diff --git a/app/views/shared/_promo.html.haml b/app/views/shared/_promo.html.haml
index 7dec48e6585..5675e43b05f 100644
--- a/app/views/shared/_promo.html.haml
+++ b/app/views/shared/_promo.html.haml
@@ -2,3 +2,4 @@
= link_to "Homepage", "https://www.gitlab.com/"
= link_to "Blog", "https://www.gitlab.com/blog/"
= link_to "@gitlabhq", "https://twitter.com/gitlabhq"
+ = link_to "Requests", "http://feedback.gitlab.com/"
diff --git a/app/workers/post_receive.rb b/app/workers/post_receive.rb
index f110e20bf00..1406cba2db3 100644
--- a/app/workers/post_receive.rb
+++ b/app/workers/post_receive.rb
@@ -4,8 +4,7 @@ class PostReceive
sidekiq_options queue: :post_receive
- def perform(repo_path, oldrev, newrev, ref, identifier)
-
+ def perform(repo_path, identifier, changes)
if repo_path.start_with?(Gitlab.config.gitlab_shell.repos_path.to_s)
repo_path.gsub!(Gitlab.config.gitlab_shell.repos_path.to_s, "")
else
@@ -22,17 +21,23 @@ class PostReceive
return false
end
- user = identify(identifier, project, newrev)
+ changes = changes.lines if changes.kind_of?(String)
- unless user
- log("Triggered hook for non-existing user \"#{identifier} \"")
- return false
- end
+ changes.each do |change|
+ oldrev, newrev, ref = change.strip.split(' ')
- if tag?(ref)
- GitTagPushService.new.execute(project, user, oldrev, newrev, ref)
- else
- GitPushService.new.execute(project, user, oldrev, newrev, ref)
+ @user ||= identify(identifier, project, newrev)
+
+ unless @user
+ log("Triggered hook for non-existing user \"#{identifier} \"")
+ return false
+ end
+
+ if tag?(ref)
+ GitTagPushService.new.execute(project, @user, oldrev, newrev, ref)
+ else
+ GitPushService.new.execute(project, @user, oldrev, newrev, ref)
+ end
end
end
diff --git a/bin/background_jobs b/bin/background_jobs
index c7ba4398cfb..59a51c5c868 100755
--- a/bin/background_jobs
+++ b/bin/background_jobs
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/bin/sh
cd $(dirname $0)/..
app_root=$(pwd)
@@ -6,22 +6,22 @@ sidekiq_pidfile="$app_root/tmp/pids/sidekiq.pid"
sidekiq_logfile="$app_root/log/sidekiq.log"
gitlab_user=$(ls -l config.ru | awk '{print $3}')
-function warn
+warn()
{
echo "$@" 1>&2
}
-function stop
+stop()
{
bundle exec sidekiqctl stop $sidekiq_pidfile >> $sidekiq_logfile 2>&1
}
-function killall
+killall()
{
pkill -u $gitlab_user -f 'sidekiq [0-9]'
}
-function restart
+restart()
{
if [ -f $sidekiq_pidfile ]; then
stop
@@ -30,20 +30,20 @@ function restart
start_sidekiq -d -L $sidekiq_logfile
}
-function start_no_deamonize
+start_no_deamonize()
{
start_sidekiq
}
-function start_sidekiq
+start_sidekiq()
{
bundle exec sidekiq -q post_receive -q mailer -q system_hook -q project_web_hook -q gitlab_shell -q common -q default -e $RAILS_ENV -P $sidekiq_pidfile $@ >> $sidekiq_logfile 2>&1
}
-function load_ok
+load_ok()
{
sidekiq_pid=$(cat $sidekiq_pidfile)
- if [[ -z $sidekiq_pid ]] ; then
+ if [ -z "$sidekiq_pid" ] ; then
warn "Could not find a PID in $sidekiq_pidfile"
exit 0
fi
diff --git a/bin/web b/bin/web
index 1ad3b5d24b9..67f236eb0bb 100755
--- a/bin/web
+++ b/bin/web
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/bin/sh
cd $(dirname $0)/..
app_root=$(pwd)
@@ -6,28 +6,28 @@ app_root=$(pwd)
unicorn_pidfile="$app_root/tmp/pids/unicorn.pid"
unicorn_config="$app_root/config/unicorn.rb"
-function get_unicorn_pid
+get_unicorn_pid()
{
local pid=$(cat $unicorn_pidfile)
- if [ -z $pid ] ; then
+ if [ -z "$pid" ] ; then
echo "Could not find a PID in $unicorn_pidfile"
exit 1
fi
unicorn_pid=$pid
}
-function start
+start()
{
bundle exec unicorn_rails -D -c $unicorn_config -E $RAILS_ENV
}
-function stop
+stop()
{
get_unicorn_pid
kill -QUIT $unicorn_pid
}
-function reload
+reload()
{
get_unicorn_pid
kill -USR2 $unicorn_pid
diff --git a/config/application.rb b/config/application.rb
index 58a5949c653..99dfafdb786 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -12,7 +12,12 @@ module Gitlab
# -- all .rb files in that directory are automatically loaded.
# Custom directories with classes and modules you want to be autoloadable.
- config.autoload_paths += %W(#{config.root}/lib #{config.root}/app/finders #{config.root}/app/models/concerns #{config.root}/app/models/project_services)
+ config.autoload_paths += %W(#{config.root}/lib
+ #{config.root}/app/finders
+ #{config.root}/app/models/hooks
+ #{config.root}/app/models/concerns
+ #{config.root}/app/models/project_services
+ #{config.root}/app/models/members)
# Only load the plugins named here, in the order given (default is alphabetical).
# :all can be used as a placeholder for all plugins not explicitly named.
@@ -73,5 +78,24 @@ module Gitlab
resource '/api/*', headers: :any, methods: [:get, :post, :options, :put, :delete]
end
end
+
+ # Use Redis caching across all environments
+ redis_config_file = Rails.root.join('config', 'resque.yml')
+
+ redis_url_string = if File.exists?(redis_config_file)
+ YAML.load_file(redis_config_file)[Rails.env]
+ else
+ "redis://localhost:6379"
+ end
+
+ # Redis::Store does not handle Unix sockets well, so let's do it for them
+ redis_config_hash = Redis::Store::Factory.extract_host_options_from_uri(redis_url_string)
+ redis_uri = URI.parse(redis_url_string)
+ if redis_uri.scheme == 'unix'
+ redis_config_hash[:path] = redis_uri.path
+ end
+
+ redis_config_hash[:namespace] = 'cache:gitlab'
+ config.cache_store = :redis_store, redis_config_hash
end
end
diff --git a/config/database.yml.mysql b/config/database.yml.mysql
index 55ac088bc1d..a99c50706c5 100644
--- a/config/database.yml.mysql
+++ b/config/database.yml.mysql
@@ -4,6 +4,7 @@
production:
adapter: mysql2
encoding: utf8
+ collation: utf8_general_ci
reconnect: false
database: gitlabhq_production
pool: 10
@@ -18,6 +19,7 @@ production:
development:
adapter: mysql2
encoding: utf8
+ collation: utf8_general_ci
reconnect: false
database: gitlabhq_development
pool: 5
@@ -31,6 +33,7 @@ development:
test: &test
adapter: mysql2
encoding: utf8
+ collation: utf8_general_ci
reconnect: false
database: gitlabhq_test
pool: 5
diff --git a/config/environments/production.rb b/config/environments/production.rb
index 2450d5719eb..78bf543402b 100644
--- a/config/environments/production.rb
+++ b/config/environments/production.rb
@@ -45,16 +45,6 @@ Gitlab::Application.configure do
# Use a different logger for distributed setups
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
- # Use a different cache store in production
- config_file = Rails.root.join('config', 'resque.yml')
-
- resque_url = if File.exists?(config_file)
- YAML.load_file(config_file)[Rails.env]
- else
- "redis://localhost:6379"
- end
- config.cache_store = :redis_store, resque_url, {namespace: 'cache:gitlab'}
-
# Enable serving of images, stylesheets, and JavaScripts from an asset server
# config.action_controller.asset_host = "http://assets.example.com"
diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example
index 47865ff4b44..3092ebf3450 100644
--- a/config/gitlab.yml.example
+++ b/config/gitlab.yml.example
@@ -3,9 +3,11 @@
# # # # # # # # # # # # # # # # # #
#
# How to use:
-# 1. copy file as gitlab.yml
-# 2. Replace gitlab -> host with your domain
-# 3. Replace gitlab -> email_from
+# 1. Copy file as gitlab.yml
+# 2. Update gitlab -> host with your fully qualified domain name
+# 3. Update gitlab -> email_from
+# 4. If you installed Git from source, change git -> bin_path to /usr/local/bin/git
+# 5. Review this configuration file for other settings you may want to adjust
production: &base
#
@@ -16,8 +18,8 @@ production: &base
gitlab:
## Web server settings (note: host is the FQDN, do not include http://)
host: localhost
- port: 80
- https: false
+ port: 80 # Set to 443 if using HTTPS, see installation.md#using-https for additional HTTPS configuration details
+ https: false # Set to true if using HTTPS, see installation.md#using-https for additional HTTPS configuration details
# Uncommment this line below if your ssh host is different from HTTP/HTTPS one
# (you'd obviously need to replace ssh.host_example.com with your own host).
@@ -78,6 +80,10 @@ production: &base
snippets: false
visibility_level: "private" # can be "private" | "internal" | "public"
+ ## Webhook settings
+ # Number of seconds to wait for HTTP response after sending webhook HTTP POST request (default: 10)
+ # webhook_timeout: 10
+
## Repository downloads directory
# When a user clicks e.g. 'Download zip' on a project, a temporary zip file is created in the following directory.
# The default is 'tmp/repositories' relative to the root of the Rails app.
@@ -143,7 +149,7 @@ production: &base
#
# If you are using "uid: 'userPrincipalName'" on ActiveDirectory you need to
# disable this setting, because the userPrincipalName contains an '@'.
- allow_username_or_email_login: true
+ allow_username_or_email_login: false
# Base where we can search for users
#
@@ -153,9 +159,11 @@ production: &base
# Filter LDAP users
#
- # Format: RFC 4515
+ # Format: RFC 4515 http://tools.ietf.org/search/rfc4515
# Ex. (employeeType=developer)
#
+ # Note: GitLab does not support omniauth-ldap's custom filter syntax.
+ #
user_filter: ''
@@ -261,9 +269,9 @@ test:
port: 80
# When you run tests we clone and setup gitlab-shell
- # In order to setup it correctly you need to specify
+ # In order to setup it correctly you need to specify
# your system username you use to run GitLab
- # user: YOUR_USERNAME
+ # user: YOUR_USERNAME
satellites:
path: tmp/tests/gitlab-satellites/
gitlab_shell:
diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb
index 136622c65a2..5b7e69fbc6a 100644
--- a/config/initializers/1_settings.rb
+++ b/config/initializers/1_settings.rb
@@ -92,6 +92,7 @@ Settings.gitlab['restricted_visibility_levels'] = Settings.send(:verify_constant
Settings.gitlab['username_changing_enabled'] = true if Settings.gitlab['username_changing_enabled'].nil?
Settings.gitlab['issue_closing_pattern'] = '([Cc]lose[sd]|[Ff]ixe[sd]) #(\d+)' if Settings.gitlab['issue_closing_pattern'].nil?
Settings.gitlab['default_projects_features'] ||= {}
+Settings.gitlab['webhook_timeout'] ||= 10
Settings.gitlab.default_projects_features['issues'] = true if Settings.gitlab.default_projects_features['issues'].nil?
Settings.gitlab.default_projects_features['merge_requests'] = true if Settings.gitlab.default_projects_features['merge_requests'].nil?
Settings.gitlab.default_projects_features['wiki'] = true if Settings.gitlab.default_projects_features['wiki'].nil?
diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb
index 5fe5270236b..b2d59f1c4b7 100644
--- a/config/initializers/session_store.rb
+++ b/config/initializers/session_store.rb
@@ -2,9 +2,10 @@
Gitlab::Application.config.session_store(
:redis_store, # Using the cookie_store would enable session replay attacks.
- servers: Gitlab::Application.config.cache_store[1], # re-use the Redis config from the Rails cache store
+ servers: Gitlab::Application.config.cache_store[1].merge(namespace: 'session:gitlab'), # re-use the Redis config from the Rails cache store
key: '_gitlab_session',
secure: Gitlab.config.gitlab.https,
httponly: true,
+ expire_after: 1.week,
path: (Rails.application.config.relative_url_root.nil?) ? '/' : Rails.application.config.relative_url_root
)
diff --git a/config/newrelic.yml b/config/newrelic.yml
new file mode 100644
index 00000000000..9ef922a38d9
--- /dev/null
+++ b/config/newrelic.yml
@@ -0,0 +1,16 @@
+# New Relic configuration file
+#
+# This file is here to make sure the New Relic gem stays
+# quiet by default.
+#
+# To enable and configure New Relic, please use
+# environment variables, e.g. NEW_RELIC_ENABLED=true
+
+production:
+ enabled: false
+
+development:
+ enabled: false
+
+test:
+ enabled: false
diff --git a/config/resque.yml.example b/config/resque.yml.example
index 3c7ad0e5778..347f3599b20 100644
--- a/config/resque.yml.example
+++ b/config/resque.yml.example
@@ -1,3 +1,3 @@
development: redis://localhost:6379
test: redis://localhost:6379
-production: redis://redis.example.com:6379
+production: unix:/var/run/redis/redis.sock
diff --git a/config/routes.rb b/config/routes.rb
index ce66ea99951..00267b13161 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -161,9 +161,8 @@ Gitlab::Application.routes.draw do
get :projects
end
- resources :users_groups, only: [:create, :update, :destroy]
-
scope module: :groups do
+ resources :group_members, only: [:create, :update, :destroy]
resource :avatar, only: [:destroy]
resources :milestones
end
@@ -207,7 +206,11 @@ Gitlab::Application.routes.draw do
resources :compare, only: [:index, :create]
resources :blame, only: [:show], constraints: {id: /.+/}
resources :network, only: [:show], constraints: {id: /(?:[^.]|\.(?!json$))+/, format: /json/}
- resources :graphs, only: [:show], constraints: {id: /(?:[^.]|\.(?!json$))+/, format: /json/}
+ resources :graphs, only: [:show], constraints: {id: /(?:[^.]|\.(?!json$))+/, format: /json/} do
+ member do
+ get :commits
+ end
+ end
match "/compare/:from...:to" => "compare#show", as: "compare", via: [:get, :post], constraints: {from: /.+/, to: /.+/}
@@ -231,7 +234,6 @@ Gitlab::Application.routes.draw do
resource :repository, only: [:show] do
member do
- get "stats"
get "archive", constraints: { format: Gitlab::Regex.archive_formats_regex }
end
end
diff --git a/config/unicorn.rb.example b/config/unicorn.rb.example
index e88a4522338..6833082d68b 100644
--- a/config/unicorn.rb.example
+++ b/config/unicorn.rb.example
@@ -28,9 +28,10 @@ worker_processes 2
# "current" directory that Capistrano sets up.
working_directory "/home/git/gitlab" # available in 0.94.0+
-# listen on both a Unix domain socket and a TCP port,
-# we use a shorter backlog for quicker failover when busy
-listen "/home/git/gitlab/tmp/sockets/gitlab.socket", :backlog => 64
+# Listen on both a Unix domain socket and a TCP port.
+# If you are load-balancing multiple Unicorn masters, lower the backlog
+# setting to e.g. 64 for faster failover.
+listen "/home/git/gitlab/tmp/sockets/gitlab.socket", :backlog => 1024
listen "127.0.0.1:8080", :tcp_nopush => true
# nuke workers after 30 seconds instead of 60 seconds (the default)
@@ -48,7 +49,7 @@ listen "127.0.0.1:8080", :tcp_nopush => true
#
# For more information see http://stackoverflow.com/a/21682112/752049
#
-timeout 30
+timeout 60
# feel free to point this anywhere accessible on the filesystem
pid "/home/git/gitlab/tmp/pids/unicorn.pid"
diff --git a/config/unicorn.rb.example.development b/config/unicorn.rb.example.development
index 94a7061451d..3cd00d53a15 100644
--- a/config/unicorn.rb.example.development
+++ b/config/unicorn.rb.example.development
@@ -1,2 +1,2 @@
worker_processes 2
-timeout 30
+timeout 60
diff --git a/db/fixtures/development/04_project.rb b/db/fixtures/development/04_project.rb
index b93229a0609..fef9666c6cb 100644
--- a/db/fixtures/development/04_project.rb
+++ b/db/fixtures/development/04_project.rb
@@ -4,10 +4,10 @@ Sidekiq::Testing.inline! do
Gitlab::Seeder.quiet do
project_urls = [
'https://github.com/documentcloud/underscore.git',
- 'https://github.com/gitlabhq/gitlabhq.git',
- 'https://github.com/gitlabhq/gitlab-ci.git',
- 'https://github.com/gitlabhq/gitlab-shell.git',
- 'https://github.com/gitlabhq/testme.git',
+ 'https://gitlab.com/gitlab-org/gitlab-ce.git',
+ 'https://gitlab.com/gitlab-org/gitlab-ci.git',
+ 'https://gitlab.com/gitlab-org/gitlab-shell.git',
+ 'https://gitlab.com/gitlab-org/testme.git',
'https://github.com/twitter/flight.git',
'https://github.com/twitter/typeahead.js.git',
'https://github.com/h5bp/html5-boilerplate.git',
diff --git a/db/fixtures/development/05_users.rb b/db/fixtures/development/05_users.rb
index f4a5b8631a4..c263dd232af 100644
--- a/db/fixtures/development/05_users.rb
+++ b/db/fixtures/development/05_users.rb
@@ -13,4 +13,20 @@ Gitlab::Seeder.quiet do
print 'F'
end
end
+
+ (1..5).each do |i|
+ begin
+ User.seed(:id, [
+ id: i + 10,
+ username: "user#{i}",
+ name: "User #{i}",
+ email: "user#{i}@example.com",
+ confirmed_at: DateTime.now,
+ password: '12345678'
+ ])
+ print '.'
+ rescue ActiveRecord::RecordNotSaved
+ print 'F'
+ end
+ end
end
diff --git a/db/fixtures/development/06_teams.rb b/db/fixtures/development/06_teams.rb
index dfbe75fd20e..3e8cdcd67b4 100644
--- a/db/fixtures/development/06_teams.rb
+++ b/db/fixtures/development/06_teams.rb
@@ -1,7 +1,7 @@
Gitlab::Seeder.quiet do
Group.all.each do |group|
User.all.sample(4).each do |user|
- if group.add_users([user.id], UsersGroup.group_access_roles.values.sample)
+ if group.add_users([user.id], Gitlab::Access.values.sample)
print '.'
else
print 'F'
@@ -11,7 +11,7 @@ Gitlab::Seeder.quiet do
Project.all.each do |project|
User.all.sample(4).each do |user|
- if project.team << [user, UsersProject.access_roles.values.sample]
+ if project.team << [user, Gitlab::Access.values.sample]
print '.'
else
print 'F'
diff --git a/db/fixtures/production/001_admin.rb b/db/fixtures/production/001_admin.rb
index c00ba3c10ba..f84d0903910 100644
--- a/db/fixtures/production/001_admin.rb
+++ b/db/fixtures/production/001_admin.rb
@@ -1,9 +1,15 @@
+password = if ENV['GITLAB_ROOT_PASSWORD'].blank?
+ "5iveL!fe"
+ else
+ ENV['GITLAB_ROOT_PASSWORD']
+ end
+
admin = User.create(
email: "admin@example.com",
name: "Administrator",
username: 'root',
- password: "5iveL!fe",
- password_confirmation: "5iveL!fe",
+ password: password,
+ password_confirmation: password,
password_expires_at: Time.now,
theme_id: Gitlab::Theme::MARS
@@ -19,6 +25,6 @@ puts %q[
Administrator account created:
login.........root
-password......5iveL!fe
+password......#{password}
]
end
diff --git a/db/migrate/20140729152420_migrate_taggable_labels.rb b/db/migrate/20140729152420_migrate_taggable_labels.rb
index f164015506d..dc28d727d9a 100644
--- a/db/migrate/20140729152420_migrate_taggable_labels.rb
+++ b/db/migrate/20140729152420_migrate_taggable_labels.rb
@@ -2,6 +2,12 @@ class MigrateTaggableLabels < ActiveRecord::Migration
def up
taggings = ActsAsTaggableOn::Tagging.where(taggable_type: ['Issue', 'MergeRequest'], context: 'labels')
taggings.find_each(batch_size: 500) do |tagging|
+ # Clean up orphaned taggings while we are here
+ if tagging.taggable.blank? || tagging.tag.nil?
+ tagging.destroy
+ print 'D'
+ next
+ end
create_label_from_tagging(tagging)
end
end
diff --git a/db/migrate/20140903115954_migrate_to_new_shell.rb b/db/migrate/20140903115954_migrate_to_new_shell.rb
new file mode 100644
index 00000000000..2d832109513
--- /dev/null
+++ b/db/migrate/20140903115954_migrate_to_new_shell.rb
@@ -0,0 +1,10 @@
+class MigrateToNewShell < ActiveRecord::Migration
+ def change
+ gitlab_shell_path = Gitlab.config.gitlab_shell.path
+ if system("#{gitlab_shell_path}/bin/create-hooks")
+ puts 'Repositories updated with new hooks'
+ else
+ raise 'Failed to rewrite gitlab-shell hooks in repositories'
+ end
+ end
+end
diff --git a/db/migrate/20140907220153_serialize_service_properties.rb b/db/migrate/20140907220153_serialize_service_properties.rb
new file mode 100644
index 00000000000..b95f5b82e03
--- /dev/null
+++ b/db/migrate/20140907220153_serialize_service_properties.rb
@@ -0,0 +1,36 @@
+class SerializeServiceProperties < ActiveRecord::Migration
+ def change
+ add_column :services, :properties, :text
+ Service.reset_column_information
+
+ associations =
+ {
+ AssemblaService: [:token, :subdomain],
+ CampfireService: [:token, :subdomain, :room],
+ EmailsOnPushService: [:recipients],
+ FlowdockService: [:token],
+ GemnasiumService: [:api_key, :token],
+ GitlabCiService: [:token, :project_url],
+ HipchatService: [:token, :room],
+ PivotaltrackerService: [:token],
+ SlackService: [:subdomain, :token, :room],
+ JenkinsService: [:project_url],
+ JiraService: [:project_url, :username, :password,
+ :api_version, :jira_issue_transition_id],
+ }
+
+ Service.all.each do |service|
+ associations[service.type.to_sym].each do |attribute|
+ service.send("#{attribute}=", service.attributes[attribute.to_s])
+ end
+ service.save!
+ end
+
+ remove_column :services, :project_url, :string
+ remove_column :services, :subdomain, :string
+ remove_column :services, :room, :string
+ remove_column :services, :recipients, :text
+ remove_column :services, :api_key, :string
+ remove_column :services, :token, :string
+ end
+end
diff --git a/db/migrate/20140914113604_add_members_table.rb b/db/migrate/20140914113604_add_members_table.rb
new file mode 100644
index 00000000000..d311f3033ee
--- /dev/null
+++ b/db/migrate/20140914113604_add_members_table.rb
@@ -0,0 +1,19 @@
+class AddMembersTable < ActiveRecord::Migration
+ def change
+ create_table :members do |t|
+ t.integer :access_level, null: false
+ t.integer :source_id, null: false
+ t.string :source_type, null: false
+ t.integer :user_id, null: false
+ t.integer :notification_level, null: false
+ t.string :type
+
+ t.timestamps
+ end
+
+ add_index :members, :type
+ add_index :members, :user_id
+ add_index :members, :access_level
+ add_index :members, [:source_id, :source_type]
+ end
+end
diff --git a/db/migrate/20140914145549_migrate_to_new_members_model.rb b/db/migrate/20140914145549_migrate_to_new_members_model.rb
new file mode 100644
index 00000000000..2a5a49c724a
--- /dev/null
+++ b/db/migrate/20140914145549_migrate_to_new_members_model.rb
@@ -0,0 +1,11 @@
+class MigrateToNewMembersModel < ActiveRecord::Migration
+ def up
+ execute "INSERT INTO members ( user_id, source_id, source_type, access_level, notification_level, type ) SELECT user_id, group_id, 'Namespace', group_access, notification_level, 'GroupMember' FROM users_groups"
+ execute "INSERT INTO members ( user_id, source_id, source_type, access_level, notification_level, type ) SELECT user_id, project_id, 'Project', project_access, notification_level, 'ProjectMember' FROM users_projects"
+ end
+
+ def down
+ Member.delete_all
+ end
+end
+
diff --git a/db/migrate/20140914173417_remove_old_member_tables.rb b/db/migrate/20140914173417_remove_old_member_tables.rb
new file mode 100644
index 00000000000..408b9551dbb
--- /dev/null
+++ b/db/migrate/20140914173417_remove_old_member_tables.rb
@@ -0,0 +1,26 @@
+class RemoveOldMemberTables < ActiveRecord::Migration
+ def up
+ drop_table :users_groups
+ drop_table :users_projects
+ end
+
+ def down
+ create_table :users_groups do |t|
+ t.integer :group_access, null: false
+ t.integer :group_id, null: false
+ t.integer :user_id, null: false
+ t.integer :notification_level, null: false, default: 3
+
+ t.timestamps
+ end
+
+ create_table :users_projects do |t|
+ t.integer :project_access, null: false
+ t.integer :project_id, null: false
+ t.integer :user_id, null: false
+ t.integer :notification_level, null: false, default: 3
+
+ t.timestamps
+ end
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 9159556ac72..4e249caa022 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: 20140730111702) do
+ActiveRecord::Schema.define(version: 20140914173417) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -130,6 +130,22 @@ ActiveRecord::Schema.define(version: 20140730111702) do
add_index "labels", ["project_id"], name: "index_labels_on_project_id", using: :btree
+ create_table "members", force: true do |t|
+ t.integer "access_level", null: false
+ t.integer "source_id", null: false
+ t.string "source_type", null: false
+ t.integer "user_id", null: false
+ t.integer "notification_level", null: false
+ t.string "type"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
+ add_index "members", ["access_level"], name: "index_members_on_access_level", using: :btree
+ add_index "members", ["source_id", "source_type"], name: "index_members_on_source_id_and_source_type", using: :btree
+ add_index "members", ["type"], name: "index_members_on_type", using: :btree
+ add_index "members", ["user_id"], name: "index_members_on_user_id", using: :btree
+
create_table "merge_request_diffs", force: true do |t|
t.string "state"
t.text "st_commits"
@@ -265,16 +281,11 @@ ActiveRecord::Schema.define(version: 20140730111702) do
create_table "services", force: true do |t|
t.string "type"
t.string "title"
- t.string "token"
- t.integer "project_id", null: false
+ t.integer "project_id", null: false
t.datetime "created_at"
t.datetime "updated_at"
- t.boolean "active", default: false, null: false
- t.string "project_url"
- t.string "subdomain"
- t.string "room"
- t.text "recipients"
- t.string "api_key"
+ t.boolean "active", default: false, null: false
+ t.text "properties"
end
add_index "services", ["project_id"], name: "index_services_on_project_id", using: :btree
@@ -368,30 +379,6 @@ ActiveRecord::Schema.define(version: 20140730111702) do
add_index "users", ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true, using: :btree
add_index "users", ["username"], name: "index_users_on_username", using: :btree
- create_table "users_groups", force: true do |t|
- t.integer "group_access", null: false
- t.integer "group_id", null: false
- t.integer "user_id", null: false
- t.datetime "created_at"
- t.datetime "updated_at"
- t.integer "notification_level", default: 3, null: false
- end
-
- add_index "users_groups", ["user_id"], name: "index_users_groups_on_user_id", using: :btree
-
- create_table "users_projects", force: true do |t|
- t.integer "user_id", null: false
- t.integer "project_id", null: false
- t.datetime "created_at"
- t.datetime "updated_at"
- t.integer "project_access", default: 0, null: false
- t.integer "notification_level", default: 3, null: false
- end
-
- add_index "users_projects", ["project_access"], name: "index_users_projects_on_project_access", using: :btree
- 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
diff --git a/doc/README.md b/doc/README.md
index f05078ee388..a85f2b6256e 100644
--- a/doc/README.md
+++ b/doc/README.md
@@ -18,6 +18,7 @@
- [System hooks](system_hooks/system_hooks.md) Let GitLab notify you when certain management tasks need to be carried out.
- [Security](security/README.md) Learn what you can do to further secure your GitLab instance.
- [Update](update/README.md) Update guides to upgrade your installation.
+- [Welcome message](customization/welcome_message.md) Add a custom welcome message to the sign-in page.
## Contributor documentation
diff --git a/doc/api/README.md b/doc/api/README.md
index ababb7b6999..f76a253083f 100644
--- a/doc/api/README.md
+++ b/doc/api/README.md
@@ -80,6 +80,7 @@ Return values:
- `404 Not Found` - A resource could not be accessed, e.g. an ID for a resource could not be found
- `405 Method Not Allowed` - The request is not supported
- `409 Conflict` - A conflicting resource already exists, e.g. creating a project with a name that already exists
+- `422 Unprocessable` - The entity could not be processed
- `500 Server Error` - While handling the request something went wrong on the server side
## Sudo
@@ -144,3 +145,52 @@ Issue:
- iid - is unique only in scope of a single project. When you browse issues or merge requests with Web UI, you see iid.
So if you want to get issue with api you use `http://host/api/v3/.../issues/:id.json`. But when you want to create a link to web page - use `http:://host/project/issues/:iid.json`
+
+## Data validation and error reporting
+
+When working with the API you may encounter validation errors. In such case, the API will answer with an HTTP `400` status.
+Such errors appear in two cases:
+
+* A required attribute of the API request is missing, e.g. the title of an issue is not given
+* An attribute did not pass the validation, e.g. user bio is too long
+
+When an attribute is missing, you will get something like:
+
+ HTTP/1.1 400 Bad Request
+ Content-Type: application/json
+
+ {
+ "message":"400 (Bad request) \"title\" not given"
+ }
+
+When a validation error occurs, error messages will be different. They will hold all details of validation errors:
+
+ HTTP/1.1 400 Bad Request
+ Content-Type: application/json
+
+ {
+ "message": {
+ "bio": [
+ "is too long (maximum is 255 characters)"
+ ]
+ }
+ }
+
+This makes error messages more machine-readable. The format can be described as follow:
+
+ {
+ "message": {
+ "<property-name>": [
+ "<error-message>",
+ "<error-message>",
+ ...
+ ],
+ "<embed-entity>": {
+ "<property-name>": [
+ "<error-message>",
+ "<error-message>",
+ ...
+ ],
+ }
+ }
+ }
diff --git a/doc/api/branches.md b/doc/api/branches.md
index 31469b6fe97..74386615545 100644
--- a/doc/api/branches.md
+++ b/doc/api/branches.md
@@ -196,6 +196,8 @@ Parameters:
}
```
+It return 200 if succeed or 400 if failed with error message explaining reason.
+
## Delete repository branch
```
@@ -207,4 +209,5 @@ Parameters:
- `id` (required) - The ID of a project
- `branch` (required) - The name of the branch
-It return 200 if succeed or 405 if failed with error message explaining reason.
+It return 200 if succeed, 404 if the branch to be deleted does not exist
+or 400 for other reasons. In case of an error, an explaining message is provided.
diff --git a/doc/api/issues.md b/doc/api/issues.md
index a4b3b3e9918..a935b146d37 100644
--- a/doc/api/issues.md
+++ b/doc/api/issues.md
@@ -7,8 +7,18 @@ Get all issues created by authenticated user. This function takes pagination par
```
GET /issues
+GET /issues?state=opened
+GET /issues?state=closed
+GET /issues?labels=foo
+GET /issues?labels=foo,bar
+GET /issues?labels=foo,bar&state=opened
```
+Parameters:
+
+- `state` (optional) - Return `all` issues or just those that are `opened` or `closed`
+- `labels` (optional) - Comma-separated list of label names
+
```json
[
{
@@ -80,11 +90,18 @@ to return the list of project issues.
```
GET /projects/:id/issues
+GET /projects/:id/issues?state=opened
+GET /projects/:id/issues?state=closed
+GET /projects/:id/issues?labels=foo
+GET /projects/:id/issues?labels=foo,bar
+GET /projects/:id/issues?labels=foo,bar&state=opened
```
Parameters:
- `id` (required) - The ID of a project
+- `state` (optional) - Return `all` issues or just those that are `opened` or `closed`
+- `labels` (optional) - Comma-separated list of label names
## Single issue
diff --git a/doc/api/merge_requests.md b/doc/api/merge_requests.md
index 3616e29ef7c..14884e53915 100644
--- a/doc/api/merge_requests.md
+++ b/doc/api/merge_requests.md
@@ -14,6 +14,8 @@ Parameters:
- `id` (required) - The ID of a project
- `state` (optional) - Return `all` requests or just those that are `merged`, `opened` or `closed`
+- `order_by` (optional) - Return requests ordered by `created_at` or `updated_at` fields
+- `sort` (optional) - Return requests sorted in `asc` or `desc` order
```json
[
diff --git a/doc/api/projects.md b/doc/api/projects.md
index 8995551b9ea..9f6f6741093 100644
--- a/doc/api/projects.md
+++ b/doc/api/projects.md
@@ -248,6 +248,7 @@ POST /projects
Parameters:
- `name` (required) - new project name
+- `path` (optional) - custom repository name for new project. By default generated based on name
- `namespace_id` (optional) - namespace for the new project (defaults to user)
- `description` (optional) - short project description
- `issues_enabled` (optional)
diff --git a/doc/api/repositories.md b/doc/api/repositories.md
index 1074b78fd73..a412f60c0d9 100644
--- a/doc/api/repositories.md
+++ b/doc/api/repositories.md
@@ -50,6 +50,7 @@ Parameters:
- `id` (required) - The ID of a project
- `tag_name` (required) - The name of a tag
- `ref` (required) - Create tag using commit SHA, another tag name, or branch name.
+- `message` (optional) - Creates annotated tag.
```json
[
@@ -71,6 +72,9 @@ Parameters:
]
```
+It returns 200 if the operation succeed. In case of an error,
+405 with an explaining error message is returned.
+
## List repository tree
Get a list of repository files and directories in a project.
diff --git a/doc/customization/welcome_message.md b/doc/customization/welcome_message.md
new file mode 100644
index 00000000000..6000d389796
--- /dev/null
+++ b/doc/customization/welcome_message.md
@@ -0,0 +1,34 @@
+# Add a welcome message to the sign-in page (GitLab Community Edition)
+
+It is possible to add a markdown-formatted welcome message to your GitLab
+sign-in page. Users of GitLab Enterprise Edition should use the [branded login
+page feature](/ee/customization/branded_login_page.html) instead.
+
+## Omnibus-gitlab example
+
+In `/etc/gitlab/gitlab.rb`:
+
+```ruby
+gitlab_rails['extra_sign_in_text'] = <<'EOS'
+# ACME GitLab
+Welcome to the [ACME](http://www.example.com) GitLab server!
+EOS
+```
+
+Run `sudo gitlab-ctl reconfigure` for changes to take effect.
+
+## Installation from source
+
+In `/home/git/gitlab/config/gitlab.yml`:
+
+```yaml
+# snip
+production:
+ # snip
+ extra:
+ sign_in_text: |
+ # ACME GitLab
+ Welcome to the [ACME](http://www.example.com) GitLab server!
+```
+
+Run `sudo service gitlab reload` for the change to take effect.
diff --git a/doc/development/README.md b/doc/development/README.md
index 67ee828db6b..20db6662aca 100644
--- a/doc/development/README.md
+++ b/doc/development/README.md
@@ -3,3 +3,4 @@
- [Architecture](architecture.md) of GitLab
- [Shell commands](shell_commands.md) in the GitLab codebase
- [Rake tasks](rake_tasks.md) for development
+- [CI setup](ci_setup.md) for testing GitLab
diff --git a/doc/development/ci_setup.md b/doc/development/ci_setup.md
new file mode 100644
index 00000000000..b3e84183a41
--- /dev/null
+++ b/doc/development/ci_setup.md
@@ -0,0 +1,41 @@
+# CI setup
+
+This document describes what services we use for testing GitLab and GitLab CI.
+
+We currently use three CI services to test GitLab:
+
+1. GitLab CI on [GitHost.io](https://gitlab-ce.githost.io/projects/2/) for the [GitLab.com repo](https://gitlab.com/gitlab-org/gitlab-ce)
+2. GitLab CI at ci.gitlab.org to test the private GitLab B.V. repo at dev.gitlab.org
+3. [Semephore](https://semaphoreapp.com/gitlabhq/gitlabhq/) for [GitHub.com repo](https://github.com/gitlabhq/gitlabhq)
+
+| Software @ configuration being tested | GitLab CI (ci.gitlab.org) | GitLab CI (GitHost.io) | Semaphore |
+|---------------------------------------|---------------------------|------------------------|-----------|
+| GitLab CE @ MySQL | ✓ | ✓ | |
+| GitLab CE @ PostgreSQL | | | ✓ |
+| GitLab EE @ MySQL | ✓ | | |
+| GitLab CI @ MySQL | ✓ | | |
+| GitLab CI @ PostgreSQL | | | ✓ |
+| GitLab CI Runner | ✓ | | ✓ |
+| GitLab Shell | ✓ | | ✓ |
+| GitLab Shell | ✓ | | ✓ |
+
+We use [these build scripts](https://gitlab.com/gitlab-org/gitlab-ci/blob/master/doc/examples/build_script_gitlab_ce.md) for testing with GitLab CI.
+
+# Build configuration on [Semaphore](https://semaphoreapp.com/gitlabhq/gitlabhq/) for testing the [GitHub.com repo](https://github.com/gitlabhq/gitlabhq)
+
+Language: Ruby
+Ruby verion: 2.1.2
+database.yml: pg
+
+Build commands
+
+```bash
+sudo apt-get install cmake libicu-dev -y (Setup)
+bundle install --deployment --path vendor/bundle (Setup)
+cp config/gitlab.yml.example config/gitlab.yml (Setup)
+bundle exec rake db:create (Setup)
+bundle exec rake spinach (Thread #1)
+bundle exec rake spec (Thread #2)
+```
+
+Use rubygems mirror.
diff --git a/doc/install/database_mysql.md b/doc/install/database_mysql.md
index 270ad3b0b86..362c492d0ac 100644
--- a/doc/install/database_mysql.md
+++ b/doc/install/database_mysql.md
@@ -1,4 +1,4 @@
-# Database Mysql
+# Database MySQL
## Note
@@ -12,31 +12,31 @@ We do not recommend using MySQL due to various issues. For example, case [(in)se
# Ensure you have MySQL version 5.5.14 or later
mysql --version
- # Pick a database root password (can be anything), type it and press enter
- # Retype the database root password and press enter
+ # Pick a MySQL root password (can be anything), type it and press enter
+ # Retype the MySQL root password and press enter
- # Secure your installation.
+ # Secure your installation
sudo mysql_secure_installation
# Login to MySQL
mysql -u root -p
- # Type the database root password
+ # Type the MySQL root password
# Create a user for GitLab
# do not type the 'mysql>', this is part of the prompt
# change $password in the command below to a real password you pick
mysql> CREATE USER 'git'@'localhost' IDENTIFIED BY '$password';
- # Ensure you can use the InnoDB engine which is necessary to support long indexes.
+ # Ensure you can use the InnoDB engine which is necessary to support long indexes
# If this fails, check your MySQL config files (e.g. `/etc/mysql/*.cnf`, `/etc/mysql/conf.d/*`) for the setting "innodb = off"
mysql> SET storage_engine=INNODB;
# Create the GitLab production database
mysql> CREATE DATABASE IF NOT EXISTS `gitlabhq_production` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`;
- # Grant the GitLab user necessary permissions on the table.
- mysql> GRANT SELECT, LOCK TABLES, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON `gitlabhq_production`.* TO 'git'@'localhost';
+ # Grant the GitLab user necessary permissions on the database
+ mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, LOCK TABLES ON `gitlabhq_production`.* TO 'git'@'localhost';
# Quit the database session
mysql> \q
diff --git a/doc/install/installation.md b/doc/install/installation.md
index 77ce78025d7..c39a83dea19 100644
--- a/doc/install/installation.md
+++ b/doc/install/installation.md
@@ -28,6 +28,7 @@ The GitLab installation consists of setting up the following components:
1. Ruby
1. System Users
1. Database
+1. Redis
1. GitLab
1. Nginx
@@ -49,7 +50,7 @@ up-to-date and install it.
Install the required packages (needed to compile Ruby and native extensions to Ruby gems):
- sudo apt-get install -y build-essential zlib1g-dev libyaml-dev libssl-dev libgdbm-dev libreadline-dev libncurses5-dev libffi-dev curl openssh-server redis-server checkinstall libxml2-dev libxslt-dev libcurl4-openssl-dev libicu-dev logrotate python-docutils cmake
+ sudo apt-get install -y build-essential zlib1g-dev libyaml-dev libssl-dev libgdbm-dev libreadline-dev libncurses5-dev libffi-dev curl openssh-server redis-server checkinstall libxml2-dev libxslt-dev libcurl4-openssl-dev libicu-dev logrotate python-docutils pkg-config cmake
Make sure you have the right version of Git installed
@@ -76,7 +77,7 @@ Is the system packaged Git too old? Remove it and compile from source.
# Install into /usr/local/bin
sudo make prefix=/usr/local install
- # When editing config/gitlab.yml (Step 5), change the git bin_path to /usr/local/bin/git
+ # 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 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:
@@ -116,7 +117,7 @@ Create a `git` user for GitLab:
We recommend using a PostgreSQL database. For MySQL check [MySQL setup guide](database_mysql.md). *Note*: because we need to make use of extensions you need at least pgsql 9.1.
# Install the database packages
- sudo apt-get install -y postgresql-9.1 postgresql-client libpq-dev
+ sudo apt-get install -y postgresql postgresql-client libpq-dev
# Login to PostgreSQL
sudo -u postgres psql -d template1
@@ -133,7 +134,26 @@ We recommend using a PostgreSQL database. For MySQL check [MySQL setup guide](da
# Try connecting to the new database with the new user
sudo -u git -H psql -d gitlabhq_production
-## 5. GitLab
+## 5. Redis
+
+ sudo apt-get install redis-server
+
+ # Configure redis to use sockets
+ sudo cp /etc/redis/redis.conf /etc/redis/redis.conf.orig
+
+ # Disable Redis listening on TCP by setting 'port' to 0
+ sed 's/^port .*/port 0/' /etc/redis/redis.conf.orig | sudo tee /etc/redis/redis.conf
+
+ # Enable Redis socket for default Debian / Ubuntu path
+ echo 'unixsocket /var/run/redis/redis.sock' | sudo tee -a /etc/redis/redis.conf
+
+ # Activate the changes to redis.conf
+ sudo service redis-server restart
+
+ # Add git to the redis group
+ sudo usermod -aG redis git
+
+## 6. GitLab
# We'll install GitLab into home directory of the user "git"
cd /home/git
@@ -141,9 +161,9 @@ 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-2-stable gitlab
+ sudo -u git -H git clone https://gitlab.com/gitlab-org/gitlab-ce.git -b 7-3-stable gitlab
-**Note:** You can change `7-2-stable` to `master` if you want the *bleeding edge* version, but never install master on a production server!
+**Note:** You can change `7-3-stable` to `master` if you want the *bleeding edge* version, but never install master on a production server!
### Configure It
@@ -153,12 +173,7 @@ We recommend using a PostgreSQL database. For MySQL check [MySQL setup guide](da
# Copy the example GitLab config
sudo -u git -H cp config/gitlab.yml.example config/gitlab.yml
- # Make sure to change "localhost" to the fully-qualified domain name of your
- # host serving GitLab where necessary
- #
- # If you want to use https make sure that you set `https` to `true`. See #using-https for all necessary details.
- #
- # If you installed Git from source, change the git bin_path to /usr/local/bin/git
+ # Update GitLab config file, follow the directions at top of file
sudo -u git -H editor config/gitlab.yml
# Make sure GitLab can write to the log/ and tmp/ directories
@@ -181,8 +196,12 @@ We recommend using a PostgreSQL database. For MySQL check [MySQL setup guide](da
# Copy the example Unicorn config
sudo -u git -H cp config/unicorn.rb.example config/unicorn.rb
+ # Find number of cores
+ nproc
+
# Enable cluster mode if you expect to have a high load instance
# Ex. change amount of workers to 3 for 2GB RAM server
+ # Set the number of workers to at least the number of cores
sudo -u git -H editor config/unicorn.rb
# Copy the example Rack attack config
@@ -194,8 +213,16 @@ We recommend using a PostgreSQL database. For MySQL check [MySQL setup guide](da
sudo -u git -H git config --global user.email "example@example.com"
sudo -u git -H git config --global core.autocrlf input
+ # Configure Redis connection settings
+ sudo -u git -H cp config/resque.yml.example config/resque.yml
+
+ # Change the Redis socket path if you are not using the default Debian / Ubuntu configuration
+ sudo -u git -H editor config/resque.yml
+
**Important Note:** Make sure to edit both `gitlab.yml` and `unicorn.rb` to match your setup.
+**Note:** If you want to use HTTPS, see [Using HTTPS](#using-https) for the additional steps.
+
### Configure GitLab DB Settings
# PostgreSQL only:
@@ -231,19 +258,14 @@ We recommend using a PostgreSQL database. For MySQL check [MySQL setup guide](da
GitLab Shell is an SSH access and repository management software developed specially for GitLab.
# Run the installation task for gitlab-shell (replace `REDIS_URL` if needed):
- sudo -u git -H bundle exec rake gitlab:shell:install[v1.9.7] REDIS_URL=redis://localhost:6379 RAILS_ENV=production
-
- # By default, the gitlab-shell config is generated from your main gitlab config.
- #
- # Note: When using GitLab with HTTPS please change the following:
- # - Provide paths to the certificates under `ca_file` and `ca_path` options.
- # - The `gitlab_url` option must point to the https endpoint of GitLab.
- # - In case you are using self signed certificate set `self_signed_cert` to `true`.
- # See #using-https for all necessary details.
- #
+ sudo -u git -H bundle exec rake gitlab:shell:install[v2.0.0] REDIS_URL=unix:/var/run/redis/redis.sock RAILS_ENV=production
+
+ # By default, the gitlab-shell config is generated from your main GitLab config.
# You can review (and modify) the gitlab-shell config as follows:
sudo -u git -H editor /home/git/gitlab-shell/config.yml
+**Note:** If you want to use HTTPS, see [Using HTTPS](#using-https) for the additional steps.
+
### Initialize Database and Activate Advanced Features
sudo -u git -H bundle exec rake gitlab:setup RAILS_ENV=production
@@ -252,6 +274,10 @@ GitLab Shell is an SSH access and repository management software developed speci
# When done you see 'Administrator account created:'
+**Note:** You can set the Administrator password by supplying it in environmental variable `GITLAB_ROOT_PASSWORD`, eg.:
+
+ sudo -u git -H bundle exec rake gitlab:setup RAILS_ENV=production GITLAB_ROOT_PASSWORD=newpassword
+
### Install Init Script
Download the init script (will be `/etc/init.d/gitlab`):
@@ -288,7 +314,7 @@ Check if GitLab and its environment are configured correctly:
# or
sudo /etc/init.d/gitlab restart
-## 6. Nginx
+## 7. Nginx
**Note:** Nginx is the officially supported web server for GitLab. If you cannot or do not want to use Nginx as your web server, have a look at the [GitLab recipes](https://gitlab.com/gitlab-org/gitlab-recipes/).
@@ -309,15 +335,15 @@ Make sure to edit the config file to match your setup:
# domain name of your host serving GitLab.
sudo editor /etc/nginx/sites-available/gitlab
-**Note:** If you want to use HTTPS, replace the `gitlab` Nginx config with `gitlab-ssl`. See [Using HTTPS](#using-https) for all necessary details.
+**Note:** If you want to use HTTPS, replace the `gitlab` Nginx config with `gitlab-ssl`. See [Using HTTPS](#using-https) for HTTPS configuration details.
### Test Configuration
Validate your `gitlab` or `gitlab-ssl` Nginx config file with the following command:
sudo nginx -t
-
-You should receive `syntax is okay` and `test is successful` messages. If you receive errors check your `gitlab` or `gitlab-ssl` Nginx config file for typos, etc. as indiciated in the error message given.
+
+You should receive `syntax is okay` and `test is successful` messages. If you receive errors check your `gitlab` or `gitlab-ssl` Nginx config file for typos, etc. as indicated in the error message given.
### Restart
@@ -350,11 +376,30 @@ Visit YOUR_SERVER in your web browser for your first GitLab login. The setup has
### Using HTTPS
-To recapitulate what is needed to use GitLab with HTTPS:
+To use GitLab with HTTPS:
+
+1. In `gitlab.yml`:
+ 1. Set the `port` option in section 1 to `443`.
+ 1. Set the `https` option in section 1 to `true`.
+1. In the `config.yml` of gitlab-shell:
+ 1. Set `gitlab_url` option to the HTTPS endpoint of GitLab (e.g. `https://git.example.com`).
+ 1. Set the certificates using either the `ca_file` or `ca_path` option.
+1. Use the `gitlab-ssl` Nginx example config instead of the `gitlab` config.
+ 1. Update `YOUR_SERVER_FQDN`.
+ 1. Update `ssl_certificate` and `ssl_certificate_key`.
+ 1. Review the configuration file and consider applying other security and performance enhancing features.
+
+Using a self-signed certificate is discouraged but if you must use it follow the normal directions then:
-1. In `gitlab.yml` set the `https` option to `true`
-1. In the `config.yml` of gitlab-shell set the relevant options (see the [install GitLab Shell section](#install-gitlab-shell) of this document).
-1. Use the `gitlab-ssl` nginx example config instead of the `gitlab` config.
+1. Generate a self-signed SSL certificate:
+
+ ```
+ mkdir -p /etc/nginx/ssl/
+ cd /etc/nginx/ssl/
+ sudo openssl req -newkey rsa:2048 -x509 -nodes -days 3560 -out gitlab.crt -keyout gitlab.key
+ sudo chmod o-r gitlab.key
+ ```
+1. In the `config.yml` of gitlab-shell set `self_signed_cert` to `true`.
### Additional Markup Styles
@@ -390,38 +435,4 @@ You can configure LDAP authentication in `config/gitlab.yml`. Please restart Git
### Using Custom Omniauth Providers
-GitLab uses [Omniauth](http://www.omniauth.org/) for authentication and already ships with a few providers preinstalled (e.g. LDAP, GitHub, Twitter). But sometimes that is not enough and you need to integrate with other authentication solutions. For these cases you can use the Omniauth provider.
-
-#### Steps
-
-These steps are fairly general and you will need to figure out the exact details from the Omniauth provider's documentation.
-
-- Stop GitLab:
-
- sudo service gitlab stop
-
-- Add the gem to your [Gemfile](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/Gemfile):
-
- gem "omniauth-your-auth-provider"
-
-- If you're using MySQL, install the new Omniauth provider gem by running the following command:
-
- sudo -u git -H bundle install --without development test postgres --path vendor/bundle --no-deployment
-
-- If you're using PostgreSQL, install the new Omniauth provider gem by running the following command:
-
- sudo -u git -H bundle install --without development test mysql --path vendor/bundle --no-deployment
-
- > These are the same commands you used in the [Install Gems section](#install-gems) with `--path vendor/bundle --no-deployment` instead of `--deployment`.
-
-- Start GitLab:
-
- sudo service gitlab start
-
-#### Examples
-
-If you have successfully set up a provider that is not shipped with GitLab itself, please let us know.
-
-You can help others by reporting successful configurations and probably share a few insights or provide warnings for common errors or pitfalls by sharing your experience [in the public Wiki](https://github.com/gitlabhq/gitlab-public-wiki/wiki/Custom-omniauth-provider-configurations).
-
-While we can't officially support every possible authentication mechanism out there, we'd like to at least help those with special needs.
+See the [omniauth integration document](doc/integration/omniauth.md)
diff --git a/doc/install/requirements.md b/doc/install/requirements.md
index 53f6ccc8c34..49edf36f574 100644
--- a/doc/install/requirements.md
+++ b/doc/install/requirements.md
@@ -7,9 +7,9 @@
- Ubuntu
- Debian
- CentOS
-- RedHat Enterprise Linux
-- Scientific Linux
-- Oracle Linux
+- RedHat Enterprise Linux (please use the CentOS packages and instructions)
+- Scientific Linux (please use the CentOS packages and instructions)
+- Oracle Linux (please use the CentOS packages and instructions)
For the installations options please see [the installation page on the GitLab website](https://about.gitlab.com/installation/).
@@ -34,7 +34,7 @@ Please consider using a virtual machine to run GitLab.
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.
+We love [JRuby](http://jruby.org/) and [Rubinius](http://rubini.us/) but GitLab needs several Gems that have native extensions.
## Hardware requirements
diff --git a/doc/install/structure.md b/doc/install/structure.md
index 67ca1895374..5c03f073c18 100644
--- a/doc/install/structure.md
+++ b/doc/install/structure.md
@@ -13,9 +13,9 @@ This is the directory structure you will end up with following the instructions
* `/home/git/.ssh` - contains openssh settings. Specifically the `authorized_keys` file managed by gitlab-shell.
* `/home/git/gitlab` - GitLab core software.
* `/home/git/gitlab-satellites` - checked out repositories for merge requests and file editing from web UI. This can be treated as a temporary files directory.
-* `/home/git/gitlab-shell` - Core add-on component of gitlab. Maintains SSH cloning and other functionality.
+* `/home/git/gitlab-shell` - Core add-on component of GitLab. Maintains SSH cloning and other functionality.
* `/home/git/repositories` - bare repositories for all projects organized by namespace. This is where the git repositories which are pushed/pulled are maintained for all projects. **This area is critical data for projects. [Keep a backup](../raketasks/backup_restore.md)**
-*Note: the default locations for gitlab-satellites and repositories can be configured in `config/gitlab.yml` of gitlab and `config.yml` of gitlab-shell.*
+*Note: the default locations for gitlab-satellites and repositories can be configured in `config/gitlab.yml` of GitLab and `config.yml` of gitlab-shell.*
To see a more in-depth overview see the [GitLab architecture doc](../development/architecture.md).
diff --git a/doc/integration/external-issue-tracker.md b/doc/integration/external-issue-tracker.md
index 6245836bef1..87af94512ed 100644
--- a/doc/integration/external-issue-tracker.md
+++ b/doc/integration/external-issue-tracker.md
@@ -1,6 +1,6 @@
# External issue tracker
-GitLab has a great issue tracker but you can also use an external issue tracker such as JIRA or Redmine. This is something that you can turn on per GitLab project. If for example you configure JIRA it provides the following functionality:
+GitLab has a great issue tracker but you can also use an external issue tracker such as JIRA, Bugzilla or Redmine. This is something that you can turn on per GitLab project. If for example you configure JIRA it provides the following functionality:
- the 'Issues' link on the GitLab project pages takes you to the appropriate JIRA issue index;
- clicking 'New issue' on the project dashboard creates a new JIRA issue;
diff --git a/doc/integration/ldap.md b/doc/integration/ldap.md
index 62bb957d951..ee472ac3e3b 100644
--- a/doc/integration/ldap.md
+++ b/doc/integration/ldap.md
@@ -17,3 +17,28 @@ In other words, if an existing GitLab user wants to enable LDAP sign-in for them
GitLab recognizes the following LDAP attributes as email addresses: `mail`, `email` and `userPrincipalName`.
If multiple LDAP email attributes are present, e.g. `mail: foo@bar.com` and `email: foo@example.com`, then the first attribute found wins -- in this case `foo@bar.com`.
+
+## Using an LDAP filter to limit access to your GitLab server
+
+If you want to limit all GitLab access to a subset of the LDAP users on your LDAP server you can set up an LDAP user filter.
+The filter must comply with [RFC 4515](http://tools.ietf.org/search/rfc4515).
+
+```ruby
+# For omnibus-gitlab
+gitlab_rails['ldap_user_filter'] = '(employeeType=developer)'
+```
+
+```yaml
+# For installations from source
+production:
+ ldap:
+ user_filter: '(employeeType=developer)'
+```
+
+Tip: if you want to limit access to the nested members of an Active Directory group you can use the following syntax:
+
+```
+(memberOf:1.2.840.113556.1.4.1941:=CN=My Group,DC=Example,DC=com)
+```
+
+Please note that GitLab does not support the custom filter syntax used by omniauth-ldap.
diff --git a/doc/integration/omniauth.md b/doc/integration/omniauth.md
index 1b0bf9c5f64..00adae58dfa 100644
--- a/doc/integration/omniauth.md
+++ b/doc/integration/omniauth.md
@@ -50,6 +50,13 @@ Before configuring individual OmniAuth providers there are a few global settings
# - { name: 'github', app_id: 'YOUR APP ID',
# app_secret: 'YOUR APP SECRET',
# args: { scope: 'user:email' } }
+ # - {"name": 'shibboleth',
+ # args: { shib_session_id_field: "HTTP_SHIB_SESSION_ID",
+ # shib_application_id_field: "HTTP_SHIB_APPLICATION_ID",
+ # uid_field: "HTTP_EPPN",
+ # name_field: "HTTP_CN",
+ # info_fields: {"email": "HTTP_MAIL" } } }
+
```
1. Change `enabled` to `true`.
@@ -69,6 +76,7 @@ Before configuring individual OmniAuth providers there are a few global settings
- [GitHub](github.md)
- [Google](google.md)
+- [Shibboleth](shibboleth.md)
- [Twitter](twitter.md)
## Enable OmniAuth for an Existing User
@@ -82,3 +90,41 @@ Existing users can enable OmniAuth for specific providers after the account is c
1. The user will be redirected to the provider. Once the user authorized GitLab they will be redirected back to GitLab.
The chosen OmniAuth provider is now active and can be used to sign in to GitLab from then on.
+
+## Using Custom Omniauth Providers
+
+GitLab uses [Omniauth](http://www.omniauth.org/) for authentication and already ships with a few providers preinstalled (e.g. LDAP, GitHub, Twitter). But sometimes that is not enough and you need to integrate with other authentication solutions. For these cases you can use the Omniauth provider.
+
+### Steps
+
+These steps are fairly general and you will need to figure out the exact details from the Omniauth provider's documentation.
+
+- Stop GitLab:
+
+ sudo service gitlab stop
+
+- Add the gem to your [Gemfile](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/Gemfile):
+
+ gem "omniauth-your-auth-provider"
+
+- If you're using MySQL, install the new Omniauth provider gem by running the following command:
+
+ sudo -u git -H bundle install --without development test postgres --path vendor/bundle --no-deployment
+
+- If you're using PostgreSQL, install the new Omniauth provider gem by running the following command:
+
+ sudo -u git -H bundle install --without development test mysql --path vendor/bundle --no-deployment
+
+ > These are the same commands you used in the [Install Gems section](#install-gems) with `--path vendor/bundle --no-deployment` instead of `--deployment`.
+
+- Start GitLab:
+
+ sudo service gitlab start
+
+### Examples
+
+If you have successfully set up a provider that is not shipped with GitLab itself, please let us know.
+
+You can help others by reporting successful configurations and probably share a few insights or provide warnings for common errors or pitfalls by sharing your experience [in the public Wiki](https://github.com/gitlabhq/gitlab-public-wiki/wiki/Custom-omniauth-provider-configurations).
+
+While we can't officially support every possible authentication mechanism out there, we'd like to at least help those with specific needs.
diff --git a/doc/integration/shibboleth.md b/doc/integration/shibboleth.md
new file mode 100644
index 00000000000..78317a5c0f2
--- /dev/null
+++ b/doc/integration/shibboleth.md
@@ -0,0 +1,78 @@
+# Shibboleth OmniAuth Provider
+
+This documentation is for enabling shibboleth with gitlab-omnibus package.
+
+In order to enable Shibboleth support in gitlab we need to use Apache instead of Nginx (It may be possible to use Nginx, however I did not found way to easily configure nginx that is bundled in gitlab-omnibus package). Apache uses mod_shib2 module for shibboleth authentication and can pass attributes as headers to omniauth-shibboleth provider.
+
+
+To enable the Shibboleth OmniAuth provider you must:
+
+1. Configure Apache shibboleth module. Installation and configuration of module it self is out of scope of this document.
+Check https://wiki.shibboleth.net/ for more info.
+
+1. You can find Apache config in gitlab-reciepes (https://github.com/gitlabhq/gitlab-recipes/blob/master/web-server/apache/gitlab-ssl.conf)
+
+Following changes are needed to enable shibboleth:
+
+protect omniauth-shibboleth callback url:
+```
+ <Location /users/auth/shibboleth/callback>
+ AuthType shibboleth
+ ShibRequestSetting requireSession 1
+ ShibUseHeaders On
+ require valid-user
+ </Location>
+
+ Alias /shibboleth-sp /usr/share/shibboleth
+ <Location /shibboleth-sp>
+ Satisfy any
+ </Location>
+
+ <Location /Shibboleth.sso>
+ SetHandler shib
+ </Location>
+```
+exclude shibboleth urls from rewriting, add "RewriteCond %{REQUEST_URI} !/Shibboleth.sso" and "RewriteCond %{REQUEST_URI} !/shibboleth-sp", config should look like this:
+```
+ #apache equivalent of nginx try files
+ RewriteEngine on
+ RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
+ RewriteCond %{REQUEST_URI} !/Shibboleth.sso
+ RewriteCond %{REQUEST_URI} !/shibboleth-sp
+ RewriteRule .* http://127.0.0.1:8080%{REQUEST_URI} [P,QSA]
+ RequestHeader set X_FORWARDED_PROTO 'https'
+```
+
+1. Edit /etc/gitlab/gitlab.rb configuration file, your shibboleth attributes should be in form of "HTTP_ATTRIBUTE" and you should addjust them to your need and environment. Add any other configuration you need.
+
+File it should look like this:
+```
+external_url 'https://gitlab.example.com'
+gitlab_rails['internal_api_url'] = 'https://gitlab.example.com'
+
+# disable nginx
+nginx['enable'] = false
+
+gitlab_rails['omniauth_allow_single_sign_on'] = true
+gitlab_rails['omniauth_block_auto_created_users'] = false
+gitlab_rails['omniauth_enabled'] = true
+gitlab_rails['omniauth_providers'] = [
+ {
+ "name" => 'shibboleth',
+ "args" => {
+ "shib_session_id_field" => "HTTP_SHIB_SESSION_ID",
+ "shib_application_id_field" => "HTTP_SHIB_APPLICATION_ID",
+ "uid_field" => 'HTTP_EPPN',
+ "name_field" => 'HTTP_CN',
+ "info_fields" => { "email" => 'HTTP_MAIL'}
+ }
+ }
+]
+
+```
+1. Save changes and reconfigure gitlab:
+```
+sudo gitlab-ctl reconfigure
+```
+
+On the sign in page there should now be a "Sign in with: Shibboleth" icon below the regular sign in form. Click the icon to begin the authentication process. You will be redirected to IdP server (Depends on your Shibboleth module configuration). If everything goes well the user will be returned to GitLab and will be signed in.
diff --git a/doc/permissions/permissions.md b/doc/permissions/permissions.md
index db22b7dbe56..d561868c8bb 100644
--- a/doc/permissions/permissions.md
+++ b/doc/permissions/permissions.md
@@ -27,11 +27,11 @@ If a user is a GitLab administrator they receive all permissions.
| Create new milestones | | | | ✓ | ✓ |
| Add new team members | | | | ✓ | ✓ |
| Push to protected branches | | | | ✓ | ✓ |
-| Enable/Disable branch protection | | | | ✓ | ✓ |
+| Enable/disable branch protection | | | | ✓ | ✓ |
| Rewrite/remove git tags | | | | ✓ | ✓ |
| Edit project | | | | ✓ | ✓ |
-| Add Deploy Keys to project | | | | ✓ | ✓ |
-| Configure Project Hooks | | | | ✓ | ✓ |
+| Add deploy keys to project | | | | ✓ | ✓ |
+| Configure project hooks | | | | ✓ | ✓ |
| Switch visibility level | | | | | ✓ |
| Transfer project to another namespace | | | | | ✓ |
| Remove project | | | | | ✓ |
diff --git a/doc/raketasks/backup_restore.md b/doc/raketasks/backup_restore.md
index 8200a8cf630..beb2c33a67b 100644
--- a/doc/raketasks/backup_restore.md
+++ b/doc/raketasks/backup_restore.md
@@ -6,14 +6,14 @@
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.
+You can only restore a backup to exactly the same version of GitLab that you created it on, for example 7.2.1.
```
-# omnibus-gitlab
+# use this command if you've installed GitLab with the Omnibus package
sudo gitlab-rake gitlab:backup:create
-# installation from source or cookbook
+# if you've installed GitLab from source or using the cookbook
bundle exec rake gitlab:backup:create RAILS_ENV=production
```
@@ -49,14 +49,16 @@ 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 use an Omnibus package 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
+You can only restore a backup to exactly the same version of GitLab that you created it on, for example 7.2.1.
+
```
-# omnibus-gitlab
+# Omnibus package installation
sudo gitlab-rake gitlab:backup:restore
# installation from source or cookbook
@@ -102,8 +104,9 @@ Deleting tmp directories...[DONE]
## Configure cron to make daily backups
-For omnibus-gitlab, see https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md#scheduling-a-backup .
+For Omnibus package installations, see https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md#scheduling-a-backup .
+For installation from source or cookbook:
```
cd /home/git/gitlab
sudo -u git -H editor config/gitlab.yml # Enable keep_time in the backup section to automatically delete old backups
@@ -113,6 +116,6 @@ sudo -u git crontab -e # Edit the crontab for the git user
Add the following lines at the bottom:
```
-# Create a full backup of the GitLab repositories and SQL database every day at 2am
-0 2 * * * cd /home/git/gitlab && PATH=/usr/local/bin:/usr/bin:/bin bundle exec rake gitlab:backup:create RAILS_ENV=production
+# Create a full backup of the GitLab repositories and SQL database every day at 4am
+0 4 * * * cd /home/git/gitlab && PATH=/usr/local/bin:/usr/bin:/bin bundle exec rake gitlab:backup:create RAILS_ENV=production
```
diff --git a/doc/raketasks/maintenance.md b/doc/raketasks/maintenance.md
index a0901cc4070..f6bd7565799 100644
--- a/doc/raketasks/maintenance.md
+++ b/doc/raketasks/maintenance.md
@@ -115,8 +115,10 @@ Checking GitLab ... Finished
This will create satellite repositories for all your projects.
-If necessary, remove the `tmp/repo_satellites` directory and rerun the command below.
+If necessary, remove the `repo_satellites` directory and rerun the commands below.
```
-bundle exec rake gitlab:satellites:create RAILS_ENV=production
+sudo -u git -H mkdir -p /home/git/gitlab-satellites
+sudo -u git -H bundle exec rake gitlab:satellites:create RAILS_ENV=production
+sudo chmod u+rwx,g=rx,o-rwx /home/git/gitlab-satellites
```
diff --git a/doc/raketasks/user_management.md b/doc/raketasks/user_management.md
index eb9eebb4b4a..3c67753ad28 100644
--- a/doc/raketasks/user_management.md
+++ b/doc/raketasks/user_management.md
@@ -7,7 +7,7 @@
sudo gitlab-rake gitlab:import:user_to_projects[username@domain.tld]
# installation from source or cookbook
-bundle exec rake gitlab:import:user_to_projects[username@domain.tld]
+bundle exec rake gitlab:import:user_to_projects[username@domain.tld] RAILS_ENV=production
```
## Add all users to all projects
@@ -21,7 +21,7 @@ Notes:
sudo gitlab-rake gitlab:import:all_users_to_all_projects
# installation from source or cookbook
-bundle exec rake gitlab:import:all_users_to_all_projects
+bundle exec rake gitlab:import:all_users_to_all_projects RAILS_ENV=production
```
## Add user as a developer to all groups
@@ -31,7 +31,7 @@ bundle exec rake gitlab:import:all_users_to_all_projects
sudo gitlab-rake gitlab:import:user_to_groups[username@domain.tld]
# installation from source or cookbook
-bundle exec rake gitlab:import:user_to_groups[username@domain.tld]
+bundle exec rake gitlab:import:user_to_groups[username@domain.tld] RAILS_ENV=production
```
## Add all users to all groups
@@ -45,5 +45,5 @@ Notes:
sudo gitlab-rake gitlab:import:all_users_to_all_groups
# installation from source or cookbook
-bundle exec rake gitlab:import:all_users_to_all_groups
+bundle exec rake gitlab:import:all_users_to_all_groups RAILS_ENV=production
```
diff --git a/doc/release/monthly.md b/doc/release/monthly.md
index 09bdde81dcc..c46a3ed9c93 100644
--- a/doc/release/monthly.md
+++ b/doc/release/monthly.md
@@ -10,11 +10,8 @@ NOTE: This is a guide for GitLab developers.
A release manager is selected that coordinates the entire release of this version. The release manager has to make sure all the steps below are done and delegated where necessary. This person should also make sure this document is kept up to date and issues are created and updated.
-### **3. Update Changelog**
-
-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.
-
-### **4. Create an overall issue**
+### **3. Create an overall issue**
+Name it "Release x.x.x" for easier searching.
```
15th:
@@ -30,10 +27,11 @@ Any changes not yet added to the changelog are added by lead developer and in th
17th:
* Create x.x.0.rc1 (#LINK)
+* Build package for GitLab.com (https://dev.gitlab.org/cookbooks/chef-repo/blob/master/doc/administration.md#build-a-package)
18th:
-* Update GitLab.com with rc1 (#LINK)
+* Update GitLab.com with rc1 (#LINK) (https://dev.gitlab.org/cookbooks/chef-repo/blob/master/doc/administration.md#deploy-the-package)
* Regression issue and tweet about rc1 (#LINK)
* Start blog post (#LINK)
@@ -54,6 +52,14 @@ Any changes not yet added to the changelog are added by lead developer and in th
* Deploy to GitLab.com (#LINK)
```
+### **4. Update Changelog**
+
+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.
+
+### **5. Take weekend and vacations into account**
+
+Ensure that there is enough time to incorporate the findings of the release candidate, etc.
+
# **16th - Merge the CE into EE**
Do this via a merge request.
@@ -107,11 +113,14 @@ List any major changes here, so the user is aware of them before starting to upg
Check if any of these changed since last release:
- <https://gitlab.com/gitlab-org/gitlab-ce/commits/master/lib/support/nginx/gitlab>
+- <https://gitlab.com/gitlab-org/gitlab-ce/commits/master/lib/support/nginx/gitlab-ssl>
- <https://gitlab.com/gitlab-org/gitlab-shell/commits/master/config.yml.example>
- <https://gitlab.com/gitlab-org/gitlab-ce/commits/master/config/gitlab.yml.example>
- <https://gitlab.com/gitlab-org/gitlab-ce/commits/master/config/unicorn.rb.example>
- <https://gitlab.com/gitlab-org/gitlab-ce/commits/master/config/database.yml.mysql>
- <https://gitlab.com/gitlab-org/gitlab-ce/commits/master/config/database.yml.postgresql>
+- <https://gitlab.com/gitlab-org/gitlab-ce/commits/master/config/initializers/rack_attack.rb.example>
+- <https://gitlab.com/gitlab-org/gitlab-ce/commits/master/config/resque.yml.example>
#### 8. Need to update init script?
@@ -125,9 +134,9 @@ Check if the `init.d/gitlab` script changed since last release: <https://gitlab.
Make sure the code quality indicators are green / good.
-- [![build status](http://ci.gitlab.org/projects/1/status.png?ref=master)](http://ci.gitlab.org/projects/1?ref=master) on ci.gitlab.org (master branch)
+- [![Build status](http://ci.gitlab.org/projects/1/status.png?ref=master)](http://ci.gitlab.org/projects/1?ref=master) on ci.gitlab.org (master branch)
-- [![build status](https://secure.travis-ci.org/gitlabhq/gitlabhq.png)](https://travis-ci.org/gitlabhq/gitlabhq) on travis-ci.org (master branch)
+- [![Build Status](https://semaphoreapp.com/api/v1/projects/2f1a5809-418b-4cc2-a1f4-819607579fe7/243338/badge.png)](https://semaphoreapp.com/gitlabhq/gitlabhq) (master branch)
- [![Code Climate](https://codeclimate.com/github/gitlabhq/gitlabhq.png)](https://codeclimate.com/github/gitlabhq/gitlabhq)
@@ -147,12 +156,30 @@ Create an annotated tag that points to the version change commit:
git tag -a vx.x.0.rc1 -m 'Version x.x.0.rc1'
```
+### **6. Create stable branches**
+
+For GitLab EE, append `-ee` to the branch.
+
+`x-x-stable-ee`
+
+```
+git checkout master
+git pull
+git checkout -b x-x-stable
+git push <remote> x-x-stable
+```
+
+Now developers can use master for merging new features.
+So you should use stable branch for future code chages related to release.
+
+
# **18th - Release RC1**
### **1. Update GitLab.com**
Merge the RC1 EE code into GitLab.com.
Once the build is green, create a package.
+If there are big database migrations consider testing them with the production db on a VM.
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.
@@ -192,7 +219,7 @@ 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.
+Create issue on dev.gitlab.org `gitlab` repository, named "GitLab X.X QA" in order to keep track of the progress.
Use the omnibus packages of Enterprise Edition using [this guide](https://dev.gitlab.org/gitlab/gitlab-ee/blob/master/doc/release/manual_testing.md).
@@ -200,7 +227,10 @@ Use the omnibus packages of Enterprise Edition using [this guide](https://dev.gi
### **3. Fix anything coming out of the QA**
-Create an issue with description of a problem, if it is quick fix fix yourself otherwise contact the team for advice.
+Create an issue with description of a problem, if it is quick fix fix it yourself otherwise contact the team for advice.
+
+**NOTE** If there is a problem that cannot be fixed in a timely manner, reverting the feature is an option! If the feature is reverted,
+create an issue about it in order to discuss the next steps after the release.
# **22nd - Release CE and EE**
@@ -210,33 +240,32 @@ For GitLab EE, append `-ee` to the branches and tags.
`v.x.x.0-ee`
-Merge CE into EE if needed.
+Note: Merge CE into EE if needed.
-### **1. Create x-x-stable branch and push to the repositories**
+### **1. Set VERSION to x.x.x and push**
+
+- Change the GITLAB_SHELL_VERSION file in `master` of the CE repository if the version changed.
+- Change the GITLAB_SHELL_VERSION file in `master` of the EE repository if the version changed.
+- Change the VERSION file in `master` branch of the CE repository and commit and push to origin.
+- Change the VERSION file in `master` branch of the EE repository and commit and push to origin.
+
+### **2. Update installation.md**
+
+Update [installation.md](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/install/installation.md) to the newest version in master.
+
+### **3. Push latest changes from x-x-stable branch to dev.gitlab.org**
```
-git checkout master
-git pull
git checkout -b x-x-stable
-git push <remote> x-x-stable
+git push origin x-x-stable
```
-### **2. Build the Omnibus packages**
+### **4. Build the Omnibus packages**
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**
-
-Change the GITLAB_SHELL_VERSION file in `master` of the CE repository if the version changed.
-
-Change the GITLAB_SHELL_VERSION file in `master` of the EE repository if the version changed.
-
-Change the VERSION file in `master` branch of the CE repository and commit. Cherry-pick into the `x-x-stable` branch of CE.
-
-Change the VERSION file in `master` branch of the EE repository and commit. Cherry-pick into the `x-x-stable-ee` branch of EE.
-
-### **4. Create annotated tag vx.x.x**
+### **5. Create annotated tag vx.x.x**
In `x-x-stable` branch check for the SHA-1 of the commit with VERSION file changed. Tag that commit,
@@ -246,13 +275,7 @@ git tag -a vx.x.0 -m 'Version x.x.0' xxxxx
where `xxxxx` is SHA-1.
-### **5. Push the tag**
-
-```
-git push origin vx.x.0
-```
-
-### **6. Push to remotes**
+### **6. Push the tag and x-x-stable branch to the remotes**
For GitLab CE, push to dev, GitLab.com and GitHub.
@@ -260,28 +283,38 @@ For GitLab EE, push to the subscribers repo.
Make sure the branch is marked 'protected' on each of the remotes you pushed to.
-NOTE: You might not have the rights to push to master on dev. Ask Dmitriy.
+```
+git push <remote> x-x-stable(-ee)
+git push <remote> vx.x.0
+```
+
+### **7. Publish packages for new release**
+
+Update `downloads/index.html` and `downloads/archive/index.html` in `www-gitlab-com` repository.
-### **7. Publish blog for new release**
+### **8. Publish blog for new release**
Merge the [blog merge request](#1-prepare-the-blog-post) in `www-gitlab-com` repository.
-### **8. Tweet to blog**
+### **9. Tweet to blog**
Send out a tweet to share the good news with the world.
List the most important features and link to the blog post.
Proposed tweet for CE "GitLab X.X is released! It brings *** <link-to-blogpost>"
-### **9. Send out the newsletter**
+### **10. 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.
+**Do not forget to edit `Subject line` and regenerate `Plain-Text Email` from HTML source**
+
Include a link to the blog post and keep it short.
Proposed email text:
"We have released a new version of GitLab. See our blog post(<link>) for more information."
+
# **23rd - Optional Patch Release**
# **24th - Update GitLab.com**
diff --git a/doc/security/README.md b/doc/security/README.md
index b89e8cbe020..f88375f2afd 100644
--- a/doc/security/README.md
+++ b/doc/security/README.md
@@ -2,3 +2,4 @@
- [Password length limits](password_length_limits.md)
- [Rack attack](rack_attack.md)
+- [Information exclusivity](information_exclusivity.md)
diff --git a/doc/security/information_exclusivity.md b/doc/security/information_exclusivity.md
new file mode 100644
index 00000000000..127166ae2e7
--- /dev/null
+++ b/doc/security/information_exclusivity.md
@@ -0,0 +1,9 @@
+# Information exclusivity
+
+Git is a distributed version control system (DVCS).
+This means that everyone that works with the source code has a local copy of the complete repository.
+In GitLab every project member that is not a guest (so reporters, developers and masters) can clone the repository to get a local copy.
+After obtaining this local copy the user can upload the full repository anywhere, including another project under their control or another server.
+The consequense is that you can't build access controls that prevent the intentional sharing of source code by users that have access to the source code.
+This is an inherent feature of a DVCS and all git management systems have this limitation.
+Obviously you can take steps to prevent unintentional sharing and information destruction, this is why only some people are allowed to invite others and nobody can force push a protected branch.
diff --git a/doc/system_hooks/system_hooks.md b/doc/system_hooks/system_hooks.md
index 47f17c1a080..54e6e3a9e3f 100644
--- a/doc/system_hooks/system_hooks.md
+++ b/doc/system_hooks/system_hooks.md
@@ -1,6 +1,6 @@
# System hooks
-Your GitLab instance can perform HTTP POST requests on the following events: `create_project`, `delete_project`, `create_user`, `delete_user` and `change_team_member`.
+Your GitLab instance can perform HTTP POST requests on the following events: `project_create`, `project_destroy`, `user_add_to_team`, `user_remove_from_team`, `user_create`, `user_destroy`, `key_create` and `key_destroy`.
System hooks can be used, e.g. for logging or changing information in a LDAP server.
@@ -93,3 +93,27 @@ System hooks can be used, e.g. for logging or changing information in a LDAP ser
"user_id": 41
}
```
+
+**Key added**
+
+```json
+{
+ "event_name": "key_create",
+ "created_at": "2014-08-18 18:45:16 UTC",
+ "username": "root",
+ "key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC58FwqHUbebw2SdT7SP4FxZ0w+lAO/erhy2ylhlcW/tZ3GY3mBu9VeeiSGoGz8hCx80Zrz+aQv28xfFfKlC8XQFpCWwsnWnQqO2Lv9bS8V1fIHgMxOHIt5Vs+9CAWGCCvUOAurjsUDoE2ALIXLDMKnJxcxD13XjWdK54j6ZXDB4syLF0C2PnAQSVY9X7MfCYwtuFmhQhKaBussAXpaVMRHltie3UYSBUUuZaB3J4cg/7TxlmxcNd+ppPRIpSZAB0NI6aOnqoBCpimscO/VpQRJMVLr3XiSYeT6HBiDXWHnIVPfQc03OGcaFqOit6p8lYKMaP/iUQLm+pgpZqrXZ9vB john@localhost",
+ "id": 4
+}
+```
+
+**Key removed**
+
+```json
+{
+ "event_name": "key_destroy",
+ "created_at": "2014-08-18 18:45:16 UTC",
+ "username": "root",
+ "key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC58FwqHUbebw2SdT7SP4FxZ0w+lAO/erhy2ylhlcW/tZ3GY3mBu9VeeiSGoGz8hCx80Zrz+aQv28xfFfKlC8XQFpCWwsnWnQqO2Lv9bS8V1fIHgMxOHIt5Vs+9CAWGCCvUOAurjsUDoE2ALIXLDMKnJxcxD13XjWdK54j6ZXDB4syLF0C2PnAQSVY9X7MfCYwtuFmhQhKaBussAXpaVMRHltie3UYSBUUuZaB3J4cg/7TxlmxcNd+ppPRIpSZAB0NI6aOnqoBCpimscO/VpQRJMVLr3XiSYeT6HBiDXWHnIVPfQc03OGcaFqOit6p8lYKMaP/iUQLm+pgpZqrXZ9vB john@localhost",
+ "id": 4
+}
+```
diff --git a/doc/update/4.2-to-5.0.md b/doc/update/4.2-to-5.0.md
index 6ec153f6245..897cd0b91fa 100644
--- a/doc/update/4.2-to-5.0.md
+++ b/doc/update/4.2-to-5.0.md
@@ -10,7 +10,7 @@ GitLab 5.0 is affected by critical security vulnerability CVE-2013-4490.
- Self signed SSL certificates are not supported until GitLab 5.1
- **requires ruby1.9.3**
-## 0. Stop gitlab
+## 0. Stop GitLab
sudo service gitlab stop
@@ -41,7 +41,7 @@ git checkout v1.1.0
# copy config
cp config.yml.example config.yml
-# change url to gitlab instance
+# change url to GitLab instance
# ! make sure url end with '/' like 'https://gitlab.example/'
vim config.yml
@@ -49,14 +49,14 @@ vim config.yml
./support/rewrite-hooks.sh
# check ruby version for git user ( 1.9 required!! )
-# gitlab shell requires system ruby 1.9
+# GitLab shell requires system ruby 1.9
ruby -v
# exit from git user
exit
```
-## 4. Copy gitlab instance to git user
+## 4. Copy GitLab instance to git user
```bash
sudo cp -R /home/gitlab/gitlab /home/git/gitlab
@@ -162,8 +162,43 @@ sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production
```
-**P.S. If everything works as expected you can remove gitlab user from system**
+## 9. Cleanup
+
+**If everything works as expected you can cleanup some old things**
+Recommend you wait a bit and do a backup before completing the following.
```bash
+# remove GitLab user from system
sudo userdel -r gitlab
+
+cd /home/git
+
+# cleanup .profile
+## remove text from .profile added during gitolite installation:
+## PATH=\$PATH:/home/git/bin
+## export PATH
+## to see what a clean .profile for new users on your system would look like see /etc/skel/.profile
+sudo -u git -H vim .profile
+
+# remove gitolite
+sudo rm -R bin
+sudo rm -Rf gitolite
+sudo rm -R .gitolite
+sudo rm .gitolite.rc
+sudo rm -f gitlab.pub
+sudo rm projects.list
+
+# reset tmp folders
+sudo service gitlab stop
+cd /home/git/gitlab
+sudo rm -R tmp
+sudo -u git -H mkdir tmp
+sudo chmod -R u+rwX tmp/
+
+# reboot system
+sudo reboot
+
+# login, check that GitLab is running fine
+cd /home/git/gitlab
+sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production
```
diff --git a/doc/update/5.1-to-6.0.md b/doc/update/5.1-to-6.0.md
index 8870f5bc859..a76b371e6d6 100644
--- a/doc/update/5.1-to-6.0.md
+++ b/doc/update/5.1-to-6.0.md
@@ -28,7 +28,7 @@ Any changes to group members will immediately be reflected in the project permis
You can even have multiple owners for a group, greatly simplifying administration.
-## 0. Backup
+## 0. Backup & prepare for update
It's useful to make a backup just in case things go south:
(With MySQL, this may require granting "LOCK TABLES" privileges to the GitLab user on the database version)
@@ -38,6 +38,72 @@ cd /home/git/gitlab
sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production
```
+The migrations in this update are very sensitive to incomplete or inconsistent data. If you have a long-running GitLab installation and some of the previous upgrades did not work out 100% correct this may bite you now. The following can help you have a more smooth upgrade.
+
+### Find projets with invalid project names
+
+#### MySQL
+Login to MySQL:
+
+ mysql -u root -p
+
+Find projects with invalid names:
+
+```bash
+mysql> use gitlabhq_production;
+
+# find projects with invalid first char, projects must start with letter
+mysql> select name from projects where name REGEXP '^[^A-Za-z]';
+
+# find projects with other invalid chars
+## names must only contain alphanumeric chars, underscores, spaces, periods, and dashes
+mysql> select name from projects where name REGEXP '[^a-zA-Z0-9_ .-]+';
+```
+
+If any projects have invalid names try correcting them from the web interface before starting the upgrade.
+If correcting them from the web interface fails you can correct them using MySQL:
+
+```bash
+# e.g. replace invalid / with allowed _
+mysql> update projects set name = REPLACE(name,'/','_');
+# repeat for all invalid chars found in project names
+```
+
+#### PostgreSQL
+Make sure all project names start with a letter and only contain alphanumeric chars, underscores, spaces, periods, and dashes (a-zA-Z0-9_ .-).
+
+### Find other common errors
+
+```
+cd /home/git/gitlab
+# Start rails console
+sudo -u git -H bin/rails console production
+
+# Make sure none of the following rails commands return results
+
+# All project owners should have an owner:
+Project.all.select { |project| project.owner.blank? }
+
+# Every user should have a namespace:
+User.all.select { |u| u.namespace.blank? }
+
+# Projects in the global namespace should not conflict with projects in the owner namespace:
+Project.where(namespace_id: nil).select { |p| Project.where(path: p.path, namespace_id: p.owner.try(:namespace).try(:id)).present? }
+```
+
+If any of the above rails commands returned results other than `=> []` try correcting the issue from the web interface.
+
+If you find projects without an owner (first rails command above), correct it. For MySQL setups:
+
+```bash
+# get your user id
+mysql> select id, name from users order by name;
+
+# set yourself as owner of project
+# replace your_user_id with your user id and bad_project_id with the project id from the rails command
+mysql> update projects set creator_id=your_user_id where id=bad_project_id;
+```
+
## 1. Stop server
sudo service gitlab stop
@@ -147,31 +213,3 @@ Follow the [upgrade guide from 5.0 to 5.1](5.0-to-5.1.md), except for the databa
cd /home/git/gitlab
sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production
```
-
-## Troubleshooting
-
-The migrations in this update are very sensitive to incomplete or inconsistent data. If you have a long-running GitLab installation and some of the previous upgrades did not work out 100% correct this may bite you now. The following commands can be run in the rails console to look for 'bad' data.
-
-Start rails console:
-
-```
-sudo -u git -H rails console production
-```
-
-All project owners should have an owner:
-
-```
-Project.all.select { |project| project.owner.blank? }
-```
-
-Every user should have a namespace:
-
-```
-User.all.select { |u| u.namespace.blank? }
-```
-
-Projects in the global namespace should not conflict with projects in the owner namespace:
-
-```
-Project.where(namespace_id: nil).select { |p| Project.where(path: p.path, namespace_id: p.owner.try(:namespace).try(:id)).present? }
-```
diff --git a/doc/update/6.0-to-6.1.md b/doc/update/6.0-to-6.1.md
index b8df16bfd97..9d67a3bcb96 100644
--- a/doc/update/6.0-to-6.1.md
+++ b/doc/update/6.0-to-6.1.md
@@ -73,7 +73,6 @@ sudo -u git -H bundle exec rake cache:clear RAILS_ENV=production
```bash
sudo rm /etc/init.d/gitlab
sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab
-sudo chmod +x /etc/init.d/gitlab
```
## 7. Start application
diff --git a/doc/update/6.0-to-7.2.md b/doc/update/6.0-to-7.3.md
index bb756460233..ec4cac2f4fa 100644
--- a/doc/update/6.0-to-7.2.md
+++ b/doc/update/6.0-to-7.3.md
@@ -1,4 +1,6 @@
-# From 6.0 to 7.2
+# From 6.0 to 7.3
+
+# GitLab 7.3 has not been released yet!
## Global issue numbers
@@ -7,7 +9,7 @@ As of 6.1 issue numbers are project specific. This means all issues are renumber
## Editable labels
In GitLab 7.2 we replace Issue and Merge Request tags with labels, making it
-possible to edit the label text and color. The characters '?', '&' and ',' are
+possible to edit the label text and color. The characters `?`, `&` and `,` are
no longer allowed however so those will be removed from your tags during the
database migrations for GitLab 7.2.
@@ -67,7 +69,7 @@ sudo -u git -H git fetch --all
For GitLab Community Edition:
```bash
-sudo -u git -H git checkout 7-2-stable
+sudo -u git -H git checkout 7-3-stable
```
OR
@@ -75,29 +77,49 @@ OR
For GitLab Enterprise Edition:
```bash
-sudo -u git -H git checkout 7-2-stable-ee
+sudo -u git -H git checkout 7-3-stable-ee
```
-
## 4. Install additional packages
```bash
# Add support for lograte for better log file handling
sudo apt-get install logrotate
-# Install cmake, which is needed for the latest versions of rugged
-sudo apt-get install cmake
+# Install pkg-config and cmake, which is needed for the latest versions of rugged
+sudo apt-get install pkg-config cmake
```
-## 5. Update gitlab-shell
+## 5. Configure Redis to use sockets
+
+ # Configure redis to use sockets
+ sudo cp /etc/redis/redis.conf /etc/redis/redis.conf.orig
+ # Disable Redis listening on TCP by setting 'port' to 0
+ sed 's/^port .*/port 0/' /etc/redis/redis.conf.orig | sudo tee /etc/redis/redis.conf
+ # Enable Redis socket for default Debian / Ubuntu path
+ echo 'unixsocket /var/run/redis/redis.sock' | sudo tee -a /etc/redis/redis.conf
+ # Activate the changes to redis.conf
+ sudo service redis-server restart
+ # Add git to the redis group
+ sudo usermod -aG redis git
+
+ # Configure Redis connection settings
+ sudo -u git -H cp config/resque.yml.example config/resque.yml
+ # Change the Redis socket path if you are not using the default Debian / Ubuntu configuration
+ sudo -u git -H editor config/resque.yml
+
+ # Configure gitlab-shell to use Redis sockets
+ sudo -u git -H sed -i 's|^ # socket.*| socket: /var/run/redis/redis.sock|' /home/git/gitlab-shell/config.yml
+
+## 6. Update gitlab-shell
```bash
cd /home/git/gitlab-shell
sudo -u git -H git fetch
-sudo -u git -H git checkout v1.9.7
+sudo -u git -H git checkout v2.0.0
```
-## 6. Install libs, migrations, etc.
+## 7. Install libs, migrations, etc.
```bash
cd /home/git/gitlab
@@ -108,7 +130,6 @@ 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
@@ -120,20 +141,24 @@ sudo -u git -H bundle exec rake assets:clean assets:precompile cache:clear RAILS
# Close access to gitlab-satellites for others
sudo chmod u+rwx,g+rx,o-rwx /home/git/gitlab-satellites
+
+# Update init.d script
+sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab
```
-## 7. Update config files
+## 8. Update config files
-TIP: to see what changed in gitlab.yml.example in this release use next command:
+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-2-stable:config/gitlab.yml.example
+git diff 6-0-stable:config/gitlab.yml.example 7-3-stable:config/gitlab.yml.example
```
-* Make `/home/git/gitlab/config/gitlab.yml` the same as https://gitlab.com/gitlab-org/gitlab-ce/blob/7-2-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-2-stable/config/unicorn.rb.example but with your settings.
-* Make `/home/git/gitlab-shell/config.yml` the same as https://gitlab.com/gitlab-org/gitlab-shell/blob/v1.9.7/config.yml.example but with your settings.
-* Make `/etc/nginx/sites-available/nginx` the same as https://gitlab.com/gitlab-org/gitlab-ce/blob/7-2-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-3-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-3-stable/config/unicorn.rb.example but with your settings.
+* Make `/home/git/gitlab-shell/config.yml` the same as https://gitlab.com/gitlab-org/gitlab-shell/blob/v2.0.0/config.yml.example but with your settings.
+* HTTP setups: Make `/etc/nginx/sites-available/nginx` the same as https://gitlab.com/gitlab-org/gitlab-ce/blob/7-3-stable/lib/support/nginx/gitlab but with your settings.
+* HTTPS setups: Make `/etc/nginx/sites-available/nginx-ssl` the same as https://gitlab.com/gitlab-org/gitlab-ce/blob/7-3-stable/lib/support/nginx/gitlab-ssl but with your settings.
* Copy rack attack middleware config
```bash
@@ -146,12 +171,6 @@ sudo -u git -H cp config/initializers/rack_attack.rb.example config/initializers
sudo cp lib/support/logrotate/gitlab /etc/logrotate.d/gitlab
```
-## 8. Update Init script
-
-```bash
-sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab
-```
-
## 9. Start application
sudo service gitlab start
diff --git a/doc/update/6.1-to-6.2.md b/doc/update/6.1-to-6.2.md
index f189899f57b..efa6e43124c 100644
--- a/doc/update/6.1-to-6.2.md
+++ b/doc/update/6.1-to-6.2.md
@@ -88,7 +88,6 @@ sudo cp lib/support/logrotate/gitlab /etc/logrotate.d/gitlab
```bash
sudo rm /etc/init.d/gitlab
sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab
-sudo chmod +x /etc/init.d/gitlab
```
## 8. Start application
diff --git a/doc/update/6.2-to-6.3.md b/doc/update/6.2-to-6.3.md
index aa6ef56990b..e9b3bdd2f54 100644
--- a/doc/update/6.2-to-6.3.md
+++ b/doc/update/6.2-to-6.3.md
@@ -74,7 +74,6 @@ sudo -u git -H cp config/initializers/rack_attack.rb.example config/initializers
```bash
sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab
-sudo chmod +x /etc/init.d/gitlab
```
## 7. Start application
diff --git a/doc/update/6.7-to-6.8.md b/doc/update/6.7-to-6.8.md
index b5b47f8930e..16f3439c998 100644
--- a/doc/update/6.7-to-6.8.md
+++ b/doc/update/6.7-to-6.8.md
@@ -62,7 +62,6 @@ sudo -u git -H bundle exec rake assets:clean assets:precompile cache:clear RAILS
# Update init.d script
sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab
-sudo chmod +x /etc/init.d/gitlab
# Close access to gitlab-satellites for others
sudo chmod u+rwx,g=rx,o-rwx /home/git/gitlab-satellites
diff --git a/doc/update/6.9-to-7.0.md b/doc/update/6.9-to-7.0.md
index f1d3d9c7b2d..1f3421a799b 100644
--- a/doc/update/6.9-to-7.0.md
+++ b/doc/update/6.9-to-7.0.md
@@ -93,7 +93,6 @@ sudo -u git -H bundle exec rake assets:clean assets:precompile cache:clear RAILS
# 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
@@ -106,6 +105,9 @@ There are new configuration options available for gitlab.yml. View them with the
git diff origin/6-9-stable:config/gitlab.yml.example origin/7-0-stable:config/gitlab.yml.example
```
+* HTTP setups: 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.
+* HTTPS setups: Make `/etc/nginx/sites-available/nginx-ssl` the same as https://gitlab.com/gitlab-org/gitlab-ce/blob/7-0-stable/lib/support/nginx/gitlab-ssl but with your setting
+
### 7. Start application
sudo service gitlab start
diff --git a/doc/update/7.0-to-7.1.md b/doc/update/7.0-to-7.1.md
index 166ff0ea136..82bb5708734 100644
--- a/doc/update/7.0-to-7.1.md
+++ b/doc/update/7.0-to-7.1.md
@@ -93,7 +93,6 @@ sudo -u git -H bundle exec rake assets:clean assets:precompile cache:clear RAILS
# 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
diff --git a/doc/update/7.1-to-7.2.md b/doc/update/7.1-to-7.2.md
index 408ed42cdbb..699111f0143 100644
--- a/doc/update/7.1-to-7.2.md
+++ b/doc/update/7.1-to-7.2.md
@@ -3,7 +3,7 @@
## Editable labels
In GitLab 7.2 we replace Issue and Merge Request tags with labels, making it
-possible to edit the label text and color. The characters '?', '&' and ',' are
+possible to edit the label text and color. The characters `?`, `&` and `,` are
no longer allowed however so those will be removed from your tags during the
database migrations for GitLab 7.2.
@@ -46,16 +46,16 @@ sudo -u git -H git checkout 7-2-stable-ee
```bash
cd /home/git/gitlab-shell
sudo -u git -H git fetch
-sudo -u git -H git checkout v1.9.7
+sudo -u git -H git checkout v1.9.8
```
### 4. Install new system dependencies
-The latest version of the 'rugged' gem requires cmake to build its native
-extensions.
+The latest version of the 'rugged' gem requires `pkg-config` and `cmake` to
+build its native extensions.
```bash
-sudo apt-get install cmake
+sudo apt-get install pkg-config cmake
```
### 5. Install libs, migrations, etc.
@@ -77,19 +77,21 @@ sudo -u git -H bundle exec rake assets:clean assets:precompile cache:clear RAILS
# 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
+#### 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.
+There are new configuration options available for `gitlab.yml`. View them with the command below and apply them to your current `gitlab.yml`.
```
git diff 7-1-stable:config/gitlab.yml.example 7-2-stable:config/gitlab.yml.example
```
+* HTTP setups: 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.
+* HTTPS setups: Make `/etc/nginx/sites-available/nginx-ssl` the same as https://gitlab.com/gitlab-org/gitlab-ce/blob/7-0-stable/lib/support/nginx/gitlab-ssl but with your setting
+
Update rack attack middleware config
```
diff --git a/doc/update/7.2-to-7.3.md b/doc/update/7.2-to-7.3.md
new file mode 100644
index 00000000000..48f515ad467
--- /dev/null
+++ b/doc/update/7.2-to-7.3.md
@@ -0,0 +1,143 @@
+# From 7.2 to 7.3
+
+### 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. 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-3-stable
+```
+
+OR
+
+For GitLab Enterprise Edition:
+
+```bash
+sudo -u git -H git checkout 7-3-stable-ee
+```
+
+### 3. Update gitlab-shell
+
+```bash
+cd /home/git/gitlab-shell
+sudo -u git -H git fetch
+sudo -u git -H git checkout v2.0.0
+```
+
+### 4. 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
+```
+
+
+### 5. Configure Redis to use sockets
+
+ # Configure redis to use sockets
+ sudo cp /etc/redis/redis.conf /etc/redis/redis.conf.orig
+ # Disable Redis listening on TCP by setting 'port' to 0
+ sed 's/^port .*/port 0/' /etc/redis/redis.conf.orig | sudo tee /etc/redis/redis.conf
+ # Enable Redis socket for default Debian / Ubuntu path
+ echo 'unixsocket /var/run/redis/redis.sock' | sudo tee -a /etc/redis/redis.conf
+ # Be sure redis group can write to the socket, enable only if supported (>= redis 2.4.0).
+ sed -i '/# unixsocketperm/ s/^# unixsocketperm.*/unixsocketperm 0775/' /etc/redis/redis.conf
+ # Activate the changes to redis.conf
+ sudo service redis-server restart
+ # Add git to the redis group
+ sudo usermod -aG redis git
+
+ # Configure Redis connection settings
+ sudo -u git -H cp config/resque.yml.example config/resque.yml
+ # Change the Redis socket path if you are not using the default Debian / Ubuntu configuration
+ sudo -u git -H editor config/resque.yml
+
+ # Configure gitlab-shell to use Redis sockets
+ sudo -u git -H sed -i 's|^ # socket.*| socket: /var/run/redis/redis.sock|' /home/git/gitlab-shell/config.yml
+
+### 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.
+
+```
+git diff origin/7-2-stable:config/gitlab.yml.example origin/7-3-stable:config/gitlab.yml.example
+```
+
+```
+# Use the default Unicorn socket backlog value of 1024
+sudo -u git -H sed -i 's/:backlog => 64/:backlog => 1024/' config/unicorn.rb
+```
+
+* HTTP setups: Make `/etc/nginx/sites-available/nginx` the same as https://gitlab.com/gitlab-org/gitlab-ce/blob/7-3-stable/lib/support/nginx/gitlab but with your settings.
+* HTTPS setups: Make `/etc/nginx/sites-available/nginx-ssl` the same as https://gitlab.com/gitlab-org/gitlab-ce/blob/7-3-stable/lib/support/nginx/gitlab-ssl but with your setting
+
+### 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!
+
+### 9. Update OmniAuth configuration
+
+When using Google omniauth login, changes of the Google account required.
+Ensure that `Contacts API` and the `Google+ API` are enabled in the [Google Developers Console](https://console.developers.google.com/).
+More details can be found at the [integration documentation](../integration/google.md).
+
+## Things went south? Revert to previous version (7.2)
+
+### 1. Revert the code to the previous version
+Follow the [upgrade guide from 7.1 to 7.2](7.1-to-7.2.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 ed72e156efe..695c083d361 100644
--- a/doc/update/mysql_to_postgresql.md
+++ b/doc/update/mysql_to_postgresql.md
@@ -21,6 +21,9 @@ sudo -u git psql -f databasename.psql -d gitlabhq_production
# Rebuild indexes (see below)
+# Install gems for PostgreSQL (note: the line below states '--without ... mysql')
+sudo -u git -H bundle install --without development test mysql --deployment
+
sudo service gitlab start
```
diff --git a/doc/update/upgrader.md b/doc/update/upgrader.md
index 966430c2c01..9943e9205db 100644
--- a/doc/update/upgrader.md
+++ b/doc/update/upgrader.md
@@ -21,7 +21,7 @@ If you have local changes to your GitLab repository the script will stash them a
## 2. Run GitLab upgrade tool
-Note: GitLab 7.2 adds cmake as dependency. Please check the dependencies in the [installation guide.](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/install/installation.md#1-packages-dependencies)
+Note: GitLab 7.2 adds `pkg-config` and `cmake` as dependency. Please check the dependencies in the [installation guide.](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/install/installation.md#1-packages-dependencies)
# Starting with GitLab version 7.0 upgrader script has been moved to bin directory
cd /home/git/gitlab
@@ -47,12 +47,12 @@ If all items are green, then congratulations upgrade is complete!
If the `gitlab:check` task reports an outdated version of `gitlab-shell` you should upgrade it.
-Upgrade it by running the commands below after replacing 1.9.4 with the correct version number:
+Upgrade it by running the commands below after replacing 2.0.0 with the correct version number:
```
cd /home/git/gitlab-shell
sudo -u git -H git fetch
-sudo -u git -H git checkout v1.9.4
+sudo -u git -H git checkout v2.0.0
```
## One line upgrade command
diff --git a/doc/web_hooks/web_hooks.md b/doc/web_hooks/web_hooks.md
index 13c4de4301e..16817d1933d 100644
--- a/doc/web_hooks/web_hooks.md
+++ b/doc/web_hooks/web_hooks.md
@@ -124,12 +124,14 @@ Save the following file as `print_http_body.rb`.
```ruby
require 'webrick'
-server = WEBrick::HTTPServer.new(Port: ARGV.first)
+server = WEBrick::HTTPServer.new(:Port => ARGV.first)
server.mount_proc '/' do |req, res|
puts req.body
end
-trap 'INT' do server.shutdown end
+trap 'INT' do
+ server.shutdown
+end
server.start
```
diff --git a/features/dashboard/search.feature b/features/dashboard/search.feature
deleted file mode 100644
index 24c45028697..00000000000
--- a/features/dashboard/search.feature
+++ /dev/null
@@ -1,10 +0,0 @@
-@dashboard
-Feature: Dashboard Search
- Background:
- Given I sign in as a user
- And I own project "Shop"
- And I visit dashboard search page
-
- Scenario: I should see project I am looking for
- Given I search for "Sho"
- Then I should see "Shop" project link
diff --git a/features/dashboard/shortcuts.feature b/features/dashboard/shortcuts.feature
new file mode 100644
index 00000000000..7c25b3926c9
--- /dev/null
+++ b/features/dashboard/shortcuts.feature
@@ -0,0 +1,21 @@
+@dashboard
+Feature: Dashboard shortcuts
+ Background:
+ Given I sign in as a user
+ And I visit dashboard page
+
+ @javascript
+ Scenario: Navigate to projects tab
+ Given I press "g" and "p"
+ Then the active main tab should be Projects
+
+ @javascript
+ Scenario: Navigate to issue tab
+ Given I press "g" and "i"
+ Then the active main tab should be Issues
+
+ @javascript
+ Scenario: Navigate to merge requests tab
+ Given I press "g" and "m"
+ Then the active main tab should be Merge Requests
+
diff --git a/features/project/commits/branches.feature b/features/project/commits/branches.feature
index abebef04fcd..d124cb7eecd 100644
--- a/features/project/commits/branches.feature
+++ b/features/project/commits/branches.feature
@@ -15,5 +15,29 @@ Feature: Project Browse branches
Scenario: I create a branch
Given I visit project branches page
And I click new branch link
- When I submit new branch form
+ And I submit new branch form
Then I should see new branch created
+
+ @javascript
+ Scenario: I delete a branch
+ Given I visit project branches page
+ And I click branch 'improve/awesome' delete link
+ Then I should not see branch 'improve/awesome'
+
+ Scenario: I create a branch with invalid name
+ Given I visit project branches page
+ And I click new branch link
+ And I submit new branch form with invalid name
+ Then I should see new an error that branch is invalid
+
+ Scenario: I create a branch with invalid reference
+ Given I visit project branches page
+ And I click new branch link
+ And I submit new branch form with invalid reference
+ Then I should see new an error that ref is invalid
+
+ Scenario: I create a branch that already exists
+ Given I visit project branches page
+ And I click new branch link
+ And I submit new branch form with branch that already exists
+ Then I should see new an error that branch already exists
diff --git a/features/project/commits/commits.feature b/features/project/commits/commits.feature
index 7c6db3c465a..8a213067548 100644
--- a/features/project/commits/commits.feature
+++ b/features/project/commits/commits.feature
@@ -30,9 +30,10 @@ Feature: Project Browse commits
Given I visit my project's commits page for a specific path
Then I see breadcrumb links
- Scenario: I browse commits stats
- Given I visit my project's commits stats page
- Then I see commits stats
+ # TODO: Implement feature in graphs
+ #Scenario: I browse commits stats
+ #Given I visit my project's commits stats page
+ #Then I see commits stats
Scenario: I browse big commit
Given I visit big commit page
diff --git a/features/project/commits/tags.feature b/features/project/commits/tags.feature
index 1ac0f8bfa45..bea463cb786 100644
--- a/features/project/commits/tags.feature
+++ b/features/project/commits/tags.feature
@@ -7,5 +7,35 @@ Feature: Project Browse tags
Scenario: I can see all git tags
Then I should see "Shop" all tags list
+ Scenario: I create a tag
+ And I click new tag link
+ And I submit new tag form
+ Then I should see new tag created
+
+ Scenario: I create a tag with invalid name
+ And I click new tag link
+ And I submit new tag form with invalid name
+ Then I should see new an error that tag is invalid
+
+ Scenario: I create a tag with invalid reference
+ And I click new tag link
+ And I submit new tag form with invalid reference
+ Then I should see new an error that tag ref is invalid
+
+ Scenario: I create a tag that already exists
+ And I click new tag link
+ And I submit new tag form with tag that already exists
+ Then I should see new an error that tag already exists
+
+ @javascript
+ Scenario: I delete a tag
+ Given I delete tag 'v1.1.0'
+ Then I should not see tag 'v1.1.0'
+
+ @javascript
+ Scenario: I delete all tags and see info message
+ Given I delete all tags
+ Then I should see tags info message
+
# @wip
# Scenario: I can download project by tag
diff --git a/features/project/graph.feature b/features/project/graph.feature
index cda95f5dda6..89064242c1c 100644
--- a/features/project/graph.feature
+++ b/features/project/graph.feature
@@ -2,8 +2,13 @@ Feature: Project Graph
Background:
Given I sign in as a user
And I own project "Shop"
- And I visit project "Shop" graph page
@javascript
Scenario: I should see project graphs
+ When I visit project "Shop" graph page
Then page should have graphs
+
+ @javascript
+ Scenario: I should see project commits graphs
+ When I visit project "Shop" commits graph page
+ Then page should have commits graphs
diff --git a/features/project/issues/issues.feature b/features/project/issues/issues.feature
index b2e6f1f9324..ae6a03ce865 100644
--- a/features/project/issues/issues.feature
+++ b/features/project/issues/issues.feature
@@ -63,6 +63,36 @@ Feature: Project Issues
Then I should see "Release 0.3" in issues
And I should not see "Release 0.4" in issues
+ @javascript
+ Scenario: Search issues when search string exactly matches issue description
+ Given project 'Shop' has issue 'Bugfix1' with description: 'Description for issue1'
+ And I fill in issue search with 'Description for issue1'
+ Then I should see 'Bugfix1' in issues
+ And I should not see "Release 0.4" in issues
+ And I should not see "Release 0.3" in issues
+ And I should not see "Tweet control" in issues
+
+ @javascript
+ Scenario: Search issues when search string partially matches issue description
+ Given project 'Shop' has issue 'Bugfix1' with description: 'Description for issue1'
+ And project 'Shop' has issue 'Feature1' with description: 'Feature submitted for issue1'
+ And I fill in issue search with 'issue1'
+ Then I should see 'Feature1' in issues
+ Then I should see 'Bugfix1' in issues
+ And I should not see "Release 0.4" in issues
+ And I should not see "Release 0.3" in issues
+ And I should not see "Tweet control" in issues
+
+ @javascript
+ Scenario: Search issues when search string matches no issue description
+ Given project 'Shop' has issue 'Bugfix1' with description: 'Description for issue1'
+ And I fill in issue search with 'Rock and roll'
+ Then I should not see 'Bugfix1' in issues
+ And I should not see "Release 0.4" in issues
+ And I should not see "Release 0.3" in issues
+ And I should not see "Tweet control" in issues
+
+
# Markdown
Scenario: Headers inside the description should have ids generated for them.
@@ -89,3 +119,10 @@ Feature: Project Issues
Given I click link "New Issue"
And I submit new issue "500 error on profile"
Then I should see issue "500 error on profile"
+
+ Scenario: Clickable labels
+ Given issue 'Release 0.4' has label 'bug'
+ And I visit project "Shop" issues page
+ When I click label 'bug'
+ And I should see "Release 0.4" in issues
+ And I should not see "Tweet control" in issues
diff --git a/features/project/issues/labels.feature b/features/project/issues/labels.feature
index 29cf5307271..a9fe1595fc5 100644
--- a/features/project/issues/labels.feature
+++ b/features/project/issues/labels.feature
@@ -6,8 +6,8 @@ Feature: Project Labels
Given I visit project "Shop" labels page
Scenario: I should see labels list
- Then I should see label "bug"
- And I should see label "feature"
+ Then I should see label 'bug'
+ And I should see label 'feature'
Scenario: I create new label
Given I visit project "Shop" new label page
@@ -24,6 +24,11 @@ Feature: Project Labels
When I remove label 'bug'
Then I should not see label 'bug'
+ @javascript
+ Scenario: I remove all labels
+ When I delete all labels
+ Then I should see labels help message
+
Scenario: I create a label with invalid color
Given I visit project "Shop" new label page
When I submit new label with invalid color
@@ -40,4 +45,3 @@ Feature: Project Labels
And I visit project "Forum" new label page
When I submit new label 'bug'
Then I should see label 'bug'
-
diff --git a/features/project/merge_requests.feature b/features/project/merge_requests.feature
index 8b6c296dfe6..f8dccc15c0e 100644
--- a/features/project/merge_requests.feature
+++ b/features/project/merge_requests.feature
@@ -147,3 +147,13 @@ Feature: Project Merge Requests
And I switch to the diff tab
And I unfold diff
Then I should see additional file lines
+
+ @javascript
+ Scenario: I show comments on a merge request side-by-side diff with comments in multiple files
+ Given project "Shop" have "Bug NS-05" open merge request with diffs inside
+ And I visit merge request page "Bug NS-05"
+ And I switch to the diff tab
+ And I leave a comment like "Line is correct" on line 12 of the first file
+ And I leave a comment like "Line is wrong" on line 39 of the second file
+ And I click Side-by-side Diff tab
+ Then I should see comments on the side-by-side diff page
diff --git a/features/project/shortcuts.feature b/features/project/shortcuts.feature
new file mode 100644
index 00000000000..e5f9c103fb1
--- /dev/null
+++ b/features/project/shortcuts.feature
@@ -0,0 +1,52 @@
+@dashboard
+Feature: Project shortcuts
+ Background:
+ Given I sign in as a user
+ And I own a project
+ And I visit my project's home page
+
+ @javascript
+ Scenario: Navigate to files tab
+ Given I press "g" and "f"
+ Then the active main tab should be Files
+
+ @javascript
+ Scenario: Navigate to commits tab
+ Given I press "g" and "c"
+ Then the active main tab should be Commits
+
+ @javascript
+ Scenario: Navigate to network tab
+ Given I press "g" and "n"
+ Then the active main tab should be Network
+
+ @javascript
+ Scenario: Navigate to graphs tab
+ Given I press "g" and "g"
+ Then the active main tab should be Graphs
+
+ @javascript
+ Scenario: Navigate to issues tab
+ Given I press "g" and "i"
+ Then the active main tab should be Issues
+
+ @javascript
+ Scenario: Navigate to merge requests tab
+ Given I press "g" and "m"
+ Then the active main tab should be Merge Requests
+
+ @javascript
+ Scenario: Navigate to snippets tab
+ Given I press "g" and "s"
+ Then the active main tab should be Snippets
+
+ @javascript
+ Scenario: Navigate to wiki tab
+ Given I press "g" and "w"
+ Then the active main tab should be Wiki
+
+ @javascript
+ Scenario: Navigate to project feed
+ Given I visit my project's files page
+ Given I press "g" and "p"
+ Then the active main tab should be Home
diff --git a/features/project/source/browse_files.feature b/features/project/source/browse_files.feature
index f8934da8de5..e4f10c0de2e 100644
--- a/features/project/source/browse_files.feature
+++ b/features/project/source/browse_files.feature
@@ -13,7 +13,7 @@ Feature: Project Browse files
Scenario: I browse file content
Given I click on ".gitignore" file in repo
- Then I should see it content
+ Then I should see its content
Scenario: I browse raw file
Given I visit blob file from repo
@@ -51,3 +51,15 @@ Feature: Project Browse files
Scenario: I can browse code with Browse Code
Given I click on history link
Then I see Browse code link
+
+ # Permalink
+
+ Scenario: I click on the permalink link from a branch ref
+ Given I click on ".gitignore" file in repo
+ And I click on permalink
+ Then I am redirected to the permalink URL
+
+ Scenario: I don't see the permalink link from a SHA ref
+ Given I visit project source page for "6d394385cf567f80a8fd85055db1ab4c5295806f"
+ And I click on ".gitignore" file in repo
+ Then I don't see the permalink link
diff --git a/features/search.feature b/features/search.feature
new file mode 100644
index 00000000000..54708c17575
--- /dev/null
+++ b/features/search.feature
@@ -0,0 +1,46 @@
+@dashboard
+Feature: Search
+ Background:
+ Given I sign in as a user
+ And I own project "Shop"
+ And I visit dashboard search page
+
+ Scenario: I should see project I am looking for
+ Given I search for "Sho"
+ Then I should see "Shop" project link
+
+ Scenario: I should see issues I am looking for
+ And project has issues
+ When I search for "Foo"
+ And I click "Issues" link
+ Then I should see "Foo" link
+ And I should not see "Bar" link
+
+ Scenario: I should see merge requests I am looking for
+ And project has merge requests
+ When I search for "Foo"
+ When I click "Merge requests" link
+ Then I should see "Foo" link
+ And I should not see "Bar" link
+
+ Scenario: I should see project code I am looking for
+ When I click project "Shop" link
+ And I search for "rspec"
+ Then I should see code results for project "Shop"
+
+ Scenario: I should see project issues
+ And project has issues
+ When I click project "Shop" link
+ And I search for "Foo"
+ And I click "Issues" link
+ Then I should see "Foo" link
+ And I should not see "Bar" link
+
+ Scenario: I should see project merge requests
+ And project has merge requests
+ When I click project "Shop" link
+ And I search for "Foo"
+ And I click "Merge requests" link
+ Then I should see "Foo" link
+ And I should not see "Bar" link
+
diff --git a/features/snippet_search.feature b/features/snippet_search.feature
new file mode 100644
index 00000000000..834bd3b2376
--- /dev/null
+++ b/features/snippet_search.feature
@@ -0,0 +1,20 @@
+@dashboard
+Feature: Snippet Search
+ Background:
+ Given I sign in as a user
+ And I have public "Personal snippet one" snippet
+ And I have private "Personal snippet private" snippet
+ And I have a public many lined snippet
+
+ Scenario: I should see my public and private snippets
+ When I search for "snippet" in snippet titles
+ Then I should see "Personal snippet one" in results
+ And I should see "Personal snippet private" in results
+
+ Scenario: I should see three surrounding lines on either side of a matching snippet line
+ When I search for "line seven" in snippet contents
+ Then I should see "line four" in results
+ And I should see "line seven" in results
+ And I should see "line ten" in results
+ And I should not see "line three" in results
+ And I should not see "line eleven" in results
diff --git a/features/steps/admin/active_tab.rb b/features/steps/admin/active_tab.rb
index 8f09e51ccef..90d13abdb13 100644
--- a/features/steps/admin/active_tab.rb
+++ b/features/steps/admin/active_tab.rb
@@ -1,37 +1,37 @@
-class AdminActiveTab < Spinach::FeatureSteps
+class Spinach::Features::AdminActiveTab < Spinach::FeatureSteps
include SharedAuthentication
include SharedPaths
include SharedActiveTab
- Then 'the active main tab should be Home' do
+ step 'the active main tab should be Home' do
ensure_active_main_tab('Overview')
end
- Then 'the active main tab should be Projects' do
+ step 'the active main tab should be Projects' do
ensure_active_main_tab('Projects')
end
- Then 'the active main tab should be Groups' do
+ step 'the active main tab should be Groups' do
ensure_active_main_tab('Groups')
end
- Then 'the active main tab should be Users' do
+ step 'the active main tab should be Users' do
ensure_active_main_tab('Users')
end
- Then 'the active main tab should be Logs' do
+ step 'the active main tab should be Logs' do
ensure_active_main_tab('Logs')
end
- Then 'the active main tab should be Hooks' do
+ step 'the active main tab should be Hooks' do
ensure_active_main_tab('Hooks')
end
- Then 'the active main tab should be Resque' do
+ step 'the active main tab should be Resque' do
ensure_active_main_tab('Background Jobs')
end
- Then 'the active main tab should be Messages' do
+ step 'the active main tab should be Messages' do
ensure_active_main_tab('Messages')
end
end
diff --git a/features/steps/admin/groups.rb b/features/steps/admin/groups.rb
index 9c1bcfefb9c..4f0ba05606d 100644
--- a/features/steps/admin/groups.rb
+++ b/features/steps/admin/groups.rb
@@ -1,4 +1,4 @@
-class AdminGroups < Spinach::FeatureSteps
+class Spinach::Features::AdminGroups < Spinach::FeatureSteps
include SharedAuthentication
include SharedPaths
include SharedUser
@@ -13,7 +13,7 @@ class AdminGroups < Spinach::FeatureSteps
click_link "New Group"
end
- And 'I have group with projects' do
+ step 'I have group with projects' do
@group = create(:group)
@project = create(:project, group: @group)
@event = create(:closed_issue_event, project: @project)
@@ -21,18 +21,18 @@ class AdminGroups < Spinach::FeatureSteps
@project.team << [current_user, :master]
end
- And 'submit form with new group info' do
+ step 'submit form with new group info' do
fill_in 'group_name', with: 'gitlab'
fill_in 'group_description', with: 'Group description'
click_button "Create group"
end
- Then 'I should see newly created group' do
+ step 'I should see newly created group' do
page.should have_content "Group: gitlab"
page.should have_content "Group description"
end
- Then 'I should be redirected to group page' do
+ step 'I should be redirected to group page' do
current_path.should == admin_group_path(Group.last)
end
@@ -40,12 +40,12 @@ class AdminGroups < Spinach::FeatureSteps
user = User.find_by(name: "John Doe")
select2(user.id, from: "#user_ids", multiple: true)
within "#new_team_member" do
- select "Reporter", from: "group_access"
+ select "Reporter", from: "access_level"
end
click_button "Add users into group"
end
- Then 'I should see "John Doe" in team list in every project as "Reporter"' do
+ step 'I should see "John Doe" in team list in every project as "Reporter"' do
within ".group-users-list" do
page.should have_content "John Doe"
page.should have_content "Reporter"
diff --git a/features/steps/admin/logs.rb b/features/steps/admin/logs.rb
index 83958545c4d..904e5468655 100644
--- a/features/steps/admin/logs.rb
+++ b/features/steps/admin/logs.rb
@@ -1,9 +1,9 @@
-class AdminLogs < Spinach::FeatureSteps
+class Spinach::Features::AdminLogs < Spinach::FeatureSteps
include SharedAuthentication
include SharedPaths
include SharedAdmin
- Then 'I should see tabs with available logs' do
+ step 'I should see tabs with available logs' do
page.should have_content 'production.log'
page.should have_content 'githost.log'
page.should have_content 'application.log'
diff --git a/features/steps/admin/projects.rb b/features/steps/admin/projects.rb
index 992aa46a8bc..2fd6385fe7b 100644
--- a/features/steps/admin/projects.rb
+++ b/features/steps/admin/projects.rb
@@ -1,19 +1,19 @@
-class AdminProjects < Spinach::FeatureSteps
+class Spinach::Features::AdminProjects < Spinach::FeatureSteps
include SharedAuthentication
include SharedPaths
include SharedAdmin
- And 'I should see all projects' do
+ step 'I should see all projects' do
Project.all.each do |p|
page.should have_content p.name_with_namespace
end
end
- And 'I click on first project' do
+ step 'I click on first project' do
click_link Project.first.name_with_namespace
end
- Then 'I should see project details' do
+ step 'I should see project details' do
project = Project.first
current_path.should == admin_project_path(project)
page.should have_content(project.name_with_namespace)
diff --git a/features/steps/admin/users.rb b/features/steps/admin/users.rb
index 253c4609e82..3422dc2b5af 100644
--- a/features/steps/admin/users.rb
+++ b/features/steps/admin/users.rb
@@ -1,34 +1,34 @@
-class AdminUsers < Spinach::FeatureSteps
+class Spinach::Features::AdminUsers < Spinach::FeatureSteps
include SharedAuthentication
include SharedPaths
include SharedAdmin
- Then 'I should see all users' do
+ step 'I should see all users' do
User.all.each do |user|
page.should have_content user.name
end
end
- And 'Click edit' do
+ step 'Click edit' do
@user = User.first
find("#edit_user_#{@user.id}").click
end
- And 'Input non ascii char in username' do
+ step 'Input non ascii char in username' do
fill_in 'user_username', with: "\u3042\u3044"
end
- And 'Click save' do
+ step 'Click save' do
click_button("Save")
end
- Then 'See username error message' do
+ step 'See username error message' do
within "#error_explanation" do
page.should have_content "Username"
end
end
- And 'Not changed form action url' do
+ step 'Not changed form action url' do
page.should have_selector %(form[action="/admin/users/#{@user.username}"])
end
diff --git a/features/steps/dashboard/active_tab.rb b/features/steps/dashboard/active_tab.rb
index 68d32ed971a..0e2c04fb299 100644
--- a/features/steps/dashboard/active_tab.rb
+++ b/features/steps/dashboard/active_tab.rb
@@ -1,21 +1,9 @@
-class DashboardActiveTab < Spinach::FeatureSteps
+class Spinach::Features::DashboardActiveTab < Spinach::FeatureSteps
include SharedAuthentication
include SharedPaths
include SharedActiveTab
- Then 'the active main tab should be Home' do
- ensure_active_main_tab('Activity')
- end
-
- Then 'the active main tab should be Issues' do
- ensure_active_main_tab('Issues')
- end
-
- Then 'the active main tab should be Merge Requests' do
- ensure_active_main_tab('Merge Requests')
- end
-
- Then 'the active main tab should be Help' do
+ step 'the active main tab should be Help' do
ensure_active_main_tab('Help')
end
end
diff --git a/features/steps/dashboard/dashboard.rb b/features/steps/dashboard/dashboard.rb
index 84a480bd7f8..7fcca732626 100644
--- a/features/steps/dashboard/dashboard.rb
+++ b/features/steps/dashboard/dashboard.rb
@@ -1,33 +1,33 @@
-class Dashboard < Spinach::FeatureSteps
+class Spinach::Features::Dashboard < Spinach::FeatureSteps
include SharedAuthentication
include SharedPaths
include SharedProject
- Then 'I should see "New Project" link' do
+ step 'I should see "New Project" link' do
page.should have_link "New project"
end
- Then 'I should see "Shop" project link' do
+ step 'I should see "Shop" project link' do
page.should have_link "Shop"
end
- Then 'I should see last push widget' do
+ step 'I should see last push widget' do
page.should have_content "You pushed to fix"
page.should have_link "Create Merge Request"
end
- And 'I click "Create Merge Request" link' do
+ step 'I click "Create Merge Request" link' do
click_link "Create Merge Request"
end
- Then 'I see prefilled new Merge Request page' do
+ step 'I see prefilled new Merge Request page' do
current_path.should == new_project_merge_request_path(@project)
find("#merge_request_target_project_id").value.should == @project.id.to_s
find("#merge_request_source_branch").value.should == "fix"
find("#merge_request_target_branch").value.should == "master"
end
- Given 'user with name "John Doe" joined project "Shop"' do
+ step 'user with name "John Doe" joined project "Shop"' do
user = create(:user, {name: "John Doe"})
project.team << [user, :master]
Event.create(
@@ -37,11 +37,11 @@ class Dashboard < Spinach::FeatureSteps
)
end
- Then 'I should see "John Doe joined project at Shop" event' do
+ step 'I should see "John Doe joined project at Shop" event' do
page.should have_content "John Doe joined project at #{project.name_with_namespace}"
end
- And 'user with name "John Doe" left project "Shop"' do
+ step 'user with name "John Doe" left project "Shop"' do
user = User.find_by(name: "John Doe")
Event.create(
project: project,
@@ -50,11 +50,11 @@ class Dashboard < Spinach::FeatureSteps
)
end
- Then 'I should see "John Doe left project at Shop" event' do
+ step 'I should see "John Doe left project at Shop" event' do
page.should have_content "John Doe left project at #{project.name_with_namespace}"
end
- And 'I have group with projects' do
+ step 'I have group with projects' do
@group = create(:group)
@project = create(:project, namespace: @group)
@event = create(:closed_issue_event, project: @project)
@@ -62,25 +62,25 @@ class Dashboard < Spinach::FeatureSteps
@project.team << [current_user, :master]
end
- Then 'I should see projects list' do
+ step 'I should see projects list' do
@user.authorized_projects.all.each do |project|
page.should have_link project.name_with_namespace
end
end
- Then 'I should see groups list' do
+ step 'I should see groups list' do
Group.all.each do |group|
page.should have_link group.name
end
end
- And 'group has a projects that does not belongs to me' do
+ step 'group has a projects that does not belongs to me' do
@forbidden_project1 = create(:project, group: @group)
@forbidden_project2 = create(:project, group: @group)
end
- Then 'I should see 1 project at group list' do
- page.find('span.last_activity/span').should have_content('1')
+ step 'I should see 1 project at group list' do
+ find('span.last_activity/span').should have_content('1')
end
def project
diff --git a/features/steps/dashboard/event_filters.rb b/features/steps/dashboard/event_filters.rb
index d0fe5c9b64b..332bfa95d97 100644
--- a/features/steps/dashboard/event_filters.rb
+++ b/features/steps/dashboard/event_filters.rb
@@ -1,33 +1,33 @@
-class EventFilters < Spinach::FeatureSteps
+class Spinach::Features::EventFilters < Spinach::FeatureSteps
include SharedAuthentication
include SharedPaths
include SharedProject
- Then 'I should see push event' do
+ step 'I should see push event' do
page.should have_selector('span.pushed')
end
- Then 'I should not see push event' do
+ step 'I should not see push event' do
page.should_not have_selector('span.pushed')
end
- Then 'I should see new member event' do
+ step 'I should see new member event' do
page.should have_selector('span.joined')
end
- And 'I should not see new member event' do
+ step 'I should not see new member event' do
page.should_not have_selector('span.joined')
end
- Then 'I should see merge request event' do
+ step 'I should see merge request event' do
page.should have_selector('span.accepted')
end
- And 'I should not see merge request event' do
+ step 'I should not see merge request event' do
page.should_not have_selector('span.accepted')
end
- And 'this project has push event' do
+ step 'this project has push event' do
data = {
before: "0000000000000000000000000000000000000000",
after: "0220c11b9a3e6c69dc8fd35321254ca9a7b98f7e",
@@ -51,7 +51,7 @@ class EventFilters < Spinach::FeatureSteps
)
end
- And 'this project has new member event' do
+ step 'this project has new member event' do
user = create(:user, {name: "John Doe"})
Event.create(
project: @project,
@@ -60,7 +60,7 @@ class EventFilters < Spinach::FeatureSteps
)
end
- And 'this project has merge request event' do
+ step 'this project has merge request event' do
merge_request = create :merge_request, author: @user, source_project: @project, target_project: @project
Event.create(
project: @project,
@@ -82,6 +82,4 @@ class EventFilters < Spinach::FeatureSteps
When 'I click "merge" event filter' do
click_link("merged_event_filter")
end
-
end
-
diff --git a/features/steps/dashboard/issues.rb b/features/steps/dashboard/issues.rb
index 1344edfa80b..6b5f88e5895 100644
--- a/features/steps/dashboard/issues.rb
+++ b/features/steps/dashboard/issues.rb
@@ -1,4 +1,4 @@
-class DashboardIssues < Spinach::FeatureSteps
+class Spinach::Features::DashboardIssues < Spinach::FeatureSteps
include SharedAuthentication
include SharedPaths
diff --git a/features/steps/dashboard/merge_requests.rb b/features/steps/dashboard/merge_requests.rb
index e198bc0cf9c..95c378fa201 100644
--- a/features/steps/dashboard/merge_requests.rb
+++ b/features/steps/dashboard/merge_requests.rb
@@ -1,4 +1,4 @@
-class DashboardMergeRequests < Spinach::FeatureSteps
+class Spinach::Features::DashboardMergeRequests < Spinach::FeatureSteps
include SharedAuthentication
include SharedPaths
diff --git a/features/steps/dashboard/projects.rb b/features/steps/dashboard/projects.rb
index 85251565446..2a348163060 100644
--- a/features/steps/dashboard/projects.rb
+++ b/features/steps/dashboard/projects.rb
@@ -1,9 +1,9 @@
-class DashboardProjects < Spinach::FeatureSteps
+class Spinach::Features::DashboardProjects < Spinach::FeatureSteps
include SharedAuthentication
include SharedPaths
include SharedProject
- Then 'I should see projects list' do
+ step 'I should see projects list' do
@user.authorized_projects.all.each do |project|
page.should have_link project.name_with_namespace
end
diff --git a/features/steps/dashboard/search.rb b/features/steps/dashboard/search.rb
deleted file mode 100644
index 32966a8617a..00000000000
--- a/features/steps/dashboard/search.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-class DashboardSearch < Spinach::FeatureSteps
- include SharedAuthentication
- include SharedPaths
- include SharedProject
-
- Given 'I search for "Sho"' do
- fill_in "dashboard_search", with: "Sho"
- click_button "Search"
- end
-
- Then 'I should see "Shop" project link' do
- page.should have_link "Shop"
- end
-
- Given 'I search for "Contibuting"' do
- fill_in "dashboard_search", with: "Contibuting"
- click_button "Search"
- end
-end
diff --git a/features/steps/dashboard/shortcuts.rb b/features/steps/dashboard/shortcuts.rb
new file mode 100644
index 00000000000..a9083850b52
--- /dev/null
+++ b/features/steps/dashboard/shortcuts.rb
@@ -0,0 +1,6 @@
+class Spinach::Features::DashboardShortcuts < Spinach::FeatureSteps
+ include SharedAuthentication
+ include SharedPaths
+ include SharedProject
+ include SharedActiveTab
+end
diff --git a/features/steps/dashboard/with_archived_projects.rb b/features/steps/dashboard/with_archived_projects.rb
index 1bc69555b56..256629382a7 100644
--- a/features/steps/dashboard/with_archived_projects.rb
+++ b/features/steps/dashboard/with_archived_projects.rb
@@ -1,4 +1,4 @@
-class DashboardWithArchivedProjects < Spinach::FeatureSteps
+class Spinach::Features::DashboardWithArchivedProjects < Spinach::FeatureSteps
include SharedAuthentication
include SharedPaths
include SharedProject
@@ -8,15 +8,15 @@ class DashboardWithArchivedProjects < Spinach::FeatureSteps
project.update_attribute(:archived, true)
end
- Then 'I should see "Shop" project link' do
+ step 'I should see "Shop" project link' do
page.should have_link "Shop"
end
- Then 'I should not see "Forum" project link' do
+ step 'I should not see "Forum" project link' do
page.should_not have_link "Forum"
end
- Then 'I should see "Forum" project link' do
+ step 'I should see "Forum" project link' do
page.should have_link "Forum"
end
end
diff --git a/features/steps/explore/groups_feature.rb b/features/steps/explore/groups_feature.rb
index b529c5f8455..94c918d932b 100644
--- a/features/steps/explore/groups_feature.rb
+++ b/features/steps/explore/groups_feature.rb
@@ -63,7 +63,7 @@ class Spinach::Features::ExploreGroupsFeature < Spinach::FeatureSteps
end
step 'I should not see member roles' do
- page.body.should_not match(%r{owner|developer|reporter|guest}i)
+ body.should_not match(%r{owner|developer|reporter|guest}i)
end
protected
diff --git a/features/steps/explore/projects.rb b/features/steps/explore/projects.rb
index dfd51060738..7248b2e8d8c 100644
--- a/features/steps/explore/projects.rb
+++ b/features/steps/explore/projects.rb
@@ -22,26 +22,26 @@ class Spinach::Features::ExploreProjectsFeature < Spinach::FeatureSteps
step 'I should see empty public project details with http clone info' do
project = Project.find_by(name: 'Empty Public Project')
- page.all(:css, '.git-empty .clone').each do |element|
+ all(:css, '.git-empty .clone').each do |element|
element.text.should include(project.http_url_to_repo)
end
end
step 'I should see empty public project details with ssh clone info' do
project = Project.find_by(name: 'Empty Public Project')
- page.all(:css, '.git-empty .clone').each do |element|
+ all(:css, '.git-empty .clone').each do |element|
element.text.should include(project.url_to_repo)
end
end
step 'I should see project "Community" home page' do
- within '.project-home-title' do
+ within '.navbar-gitlab .title' do
page.should have_content 'Community'
end
end
step 'I should see project "Internal" home page' do
- within '.project-home-title' do
+ within '.navbar-gitlab .title' do
page.should have_content 'Internal'
end
end
diff --git a/features/steps/group/group.rb b/features/steps/group/group.rb
index c3ee42f1127..da0cf7bbd45 100644
--- a/features/steps/group/group.rb
+++ b/features/steps/group/group.rb
@@ -1,70 +1,70 @@
-class Groups < Spinach::FeatureSteps
+class Spinach::Features::Groups < Spinach::FeatureSteps
include SharedAuthentication
include SharedPaths
include SharedGroup
include SharedUser
include Select2Helper
- Then 'I should see group "Owned" projects list' do
+ step 'I should see group "Owned" projects list' do
Group.find_by(name: "Owned").projects.each do |project|
page.should have_link project.name
end
end
- And 'I should see projects activity feed' do
+ step 'I should see projects activity feed' do
page.should have_content 'closed issue'
end
- Then 'I should see issues from group "Owned" assigned to me' do
+ step 'I should see issues from group "Owned" assigned to me' do
assigned_to_me(:issues).each do |issue|
page.should have_content issue.title
end
end
- Then 'I should see merge requests from group "Owned" assigned to me' do
+ step 'I should see merge requests from group "Owned" assigned to me' do
assigned_to_me(:merge_requests).each do |issue|
page.should have_content issue.title[0..80]
end
end
- And 'I select user "Mary Jane" from list with role "Reporter"' do
+ step 'I select user "Mary Jane" from list with role "Reporter"' do
user = User.find_by(name: "Mary Jane") || create(:user, name: "Mary Jane")
click_link 'Add members'
within ".users-group-form" do
select2(user.id, from: "#user_ids", multiple: true)
- select "Reporter", from: "group_access"
+ select "Reporter", from: "access_level"
end
click_button "Add users into group"
end
- Then 'I should see user "John Doe" in team list' do
+ step 'I should see user "John Doe" in team list' do
projects_with_access = find(".panel .well-list")
projects_with_access.should have_content("John Doe")
end
- Then 'I should not see user "John Doe" in team list' do
+ step 'I should not see user "John Doe" in team list' do
projects_with_access = find(".panel .well-list")
projects_with_access.should_not have_content("John Doe")
end
- Then 'I should see user "Mary Jane" in team list' do
+ step 'I should see user "Mary Jane" in team list' do
projects_with_access = find(".panel .well-list")
projects_with_access.should have_content("Mary Jane")
end
- Then 'I should not see user "Mary Jane" in team list' do
+ step 'I should not see user "Mary Jane" in team list' do
projects_with_access = find(".panel .well-list")
projects_with_access.should_not have_content("Mary Jane")
end
- Given 'project from group "Owned" has issues assigned to me' do
+ step 'project from group "Owned" has issues assigned to me' do
create :issue,
project: project,
assignee: current_user,
author: current_user
end
- Given 'project from group "Owned" has merge requests assigned to me' do
+ step 'project from group "Owned" has merge requests assigned to me' do
create :merge_request,
source_project: project,
target_project: project,
@@ -76,28 +76,28 @@ class Groups < Spinach::FeatureSteps
click_link "New group"
end
- And 'submit form with new group "Samurai" info' do
+ step 'submit form with new group "Samurai" info' do
fill_in 'group_name', with: 'Samurai'
fill_in 'group_description', with: 'Tokugawa Shogunate'
click_button "Create group"
end
- Then 'I should be redirected to group "Samurai" page' do
+ step 'I should be redirected to group "Samurai" page' do
current_path.should == group_path(Group.last)
end
- Then 'I should see newly created group "Samurai"' do
+ step 'I should see newly created group "Samurai"' do
page.should have_content "Samurai"
page.should have_content "Tokugawa Shogunate"
page.should have_content "Currently you are only seeing events from the"
end
- And 'I change group "Owned" name to "new-name"' do
+ step 'I change group "Owned" name to "new-name"' do
fill_in 'group_name', with: 'new-name'
click_button "Save group"
end
- Then 'I should see new group "Owned" name' do
+ step 'I should see new group "Owned" name' do
within ".navbar-gitlab" do
page.should have_content "group: new-name"
end
diff --git a/features/steps/profile/active_tab.rb b/features/steps/profile/active_tab.rb
index 1924a6fa785..8595ee876a4 100644
--- a/features/steps/profile/active_tab.rb
+++ b/features/steps/profile/active_tab.rb
@@ -1,25 +1,25 @@
-class ProfileActiveTab < Spinach::FeatureSteps
+class Spinach::Features::ProfileActiveTab < Spinach::FeatureSteps
include SharedAuthentication
include SharedPaths
include SharedActiveTab
- Then 'the active main tab should be Home' do
+ step 'the active main tab should be Home' do
ensure_active_main_tab('Profile')
end
- Then 'the active main tab should be Account' do
+ step 'the active main tab should be Account' do
ensure_active_main_tab('Account')
end
- Then 'the active main tab should be SSH Keys' do
+ step 'the active main tab should be SSH Keys' do
ensure_active_main_tab('SSH Keys')
end
- Then 'the active main tab should be Design' do
+ step 'the active main tab should be Design' do
ensure_active_main_tab('Design')
end
- Then 'the active main tab should be History' do
+ step 'the active main tab should be History' do
ensure_active_main_tab('History')
end
end
diff --git a/features/steps/profile/emails.rb b/features/steps/profile/emails.rb
index 99588c85991..2b6ac37d866 100644
--- a/features/steps/profile/emails.rb
+++ b/features/steps/profile/emails.rb
@@ -1,47 +1,47 @@
-class ProfileEmails < Spinach::FeatureSteps
+class Spinach::Features::ProfileEmails < Spinach::FeatureSteps
include SharedAuthentication
- Then 'I visit profile emails page' do
+ step 'I visit profile emails page' do
visit profile_emails_path
end
- Then 'I should see my emails' do
+ step 'I should see my emails' do
page.should have_content(@user.email)
@user.emails.each do |email|
page.should have_content(email.email)
end
end
- And 'I submit new email "my@email.com"' do
+ step 'I submit new email "my@email.com"' do
fill_in "email_email", with: "my@email.com"
click_button "Add"
end
- Then 'I should see new email "my@email.com"' do
+ step 'I should see new email "my@email.com"' do
email = @user.emails.find_by(email: "my@email.com")
email.should_not be_nil
page.should have_content("my@email.com")
end
- Then 'I should not see email "my@email.com"' do
+ step 'I should not see email "my@email.com"' do
email = @user.emails.find_by(email: "my@email.com")
email.should be_nil
page.should_not have_content("my@email.com")
end
- Then 'I click link "Remove" for "my@email.com"' do
+ step 'I click link "Remove" for "my@email.com"' do
# there should only be one remove button at this time
click_link "Remove"
# force these to reload as they have been cached
@user.emails.reload
end
- And 'I submit duplicate email @user.email' do
+ step 'I submit duplicate email @user.email' do
fill_in "email_email", with: @user.email
click_button "Add"
end
- Then 'I should not have @user.email added' do
+ step 'I should not have @user.email added' do
email = @user.emails.find_by(email: @user.email)
email.should be_nil
end
diff --git a/features/steps/profile/group.rb b/features/steps/profile/group.rb
index 03144104c7e..81d5bc15e21 100644
--- a/features/steps/profile/group.rb
+++ b/features/steps/profile/group.rb
@@ -1,4 +1,4 @@
-class ProfileGroup < Spinach::FeatureSteps
+class Spinach::Features::ProfileGroup < Spinach::FeatureSteps
include SharedAuthentication
include SharedGroup
include SharedPaths
diff --git a/features/steps/profile/notifications.rb b/features/steps/profile/notifications.rb
index e884df3098e..df96dddd06e 100644
--- a/features/steps/profile/notifications.rb
+++ b/features/steps/profile/notifications.rb
@@ -1,4 +1,4 @@
-class ProfileNotifications < Spinach::FeatureSteps
+class Spinach::Features::ProfileNotifications < Spinach::FeatureSteps
include SharedAuthentication
include SharedProject
diff --git a/features/steps/profile/profile.rb b/features/steps/profile/profile.rb
index 5a7ac207314..adfaefb1644 100644
--- a/features/steps/profile/profile.rb
+++ b/features/steps/profile/profile.rb
@@ -1,4 +1,4 @@
-class Profile < Spinach::FeatureSteps
+class Spinach::Features::Profile < Spinach::FeatureSteps
include SharedAuthentication
include SharedPaths
diff --git a/features/steps/profile/ssh_keys.rb b/features/steps/profile/ssh_keys.rb
index 65ca824bb5b..d1e87d40705 100644
--- a/features/steps/profile/ssh_keys.rb
+++ b/features/steps/profile/ssh_keys.rb
@@ -1,48 +1,48 @@
-class ProfileSshKeys < Spinach::FeatureSteps
+class Spinach::Features::ProfileSshKeys < Spinach::FeatureSteps
include SharedAuthentication
- Then 'I should see my ssh keys' do
+ step 'I should see my ssh keys' do
@user.keys.each do |key|
page.should have_content(key.title)
end
end
- Given 'I click link "Add new"' do
+ step 'I click link "Add new"' do
click_link "Add SSH Key"
end
- And 'I submit new ssh key "Laptop"' do
+ step 'I submit new ssh key "Laptop"' do
fill_in "key_title", with: "Laptop"
fill_in "key_key", with: "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAzrEJUIR6Y03TCE9rIJ+GqTBvgb8t1jI9h5UBzCLuK4VawOmkLornPqLDrGbm6tcwM/wBrrLvVOqi2HwmkKEIecVO0a64A4rIYScVsXIniHRS6w5twyn1MD3sIbN+socBDcaldECQa2u1dI3tnNVcs8wi77fiRe7RSxePsJceGoheRQgC8AZ510UdIlO+9rjIHUdVN7LLyz512auAfYsgx1OfablkQ/XJcdEwDNgi9imI6nAXhmoKUm1IPLT2yKajTIC64AjLOnE0YyCh6+7RFMpiMyu1qiOCpdjYwTgBRiciNRZCH8xIedyCoAmiUgkUT40XYHwLuwiPJICpkAzp7Q== user@laptop"
click_button "Add key"
end
- Then 'I should see new ssh key "Laptop"' do
+ step 'I should see new ssh key "Laptop"' do
key = Key.find_by(title: "Laptop")
page.should have_content(key.title)
page.should have_content(key.key)
current_path.should == profile_key_path(key)
end
- Given 'I click link "Work"' do
+ step 'I click link "Work"' do
click_link "Work"
end
- And 'I click link "Remove"' do
+ step 'I click link "Remove"' do
click_link "Remove"
end
- Then 'I visit profile keys page' do
+ step 'I visit profile keys page' do
visit profile_keys_path
end
- And 'I should not see "Work" ssh key' do
+ step 'I should not see "Work" ssh key' do
within "#keys-table" do
page.should_not have_content "Work"
end
end
- And 'I have ssh key "ssh-rsa Work"' do
+ step 'I have ssh key "ssh-rsa Work"' do
create(:key, user: @user, title: "ssh-rsa Work", key: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC+L3TbFegm3k8QjejSwemk4HhlRh+DuN679Pc5ckqE/MPhVtE/+kZQDYCTB284GiT2aIoGzmZ8ee9TkaoejAsBwlA+Wz2Q3vhz65X6sMgalRwpdJx8kSEUYV8ZPV3MZvPo8KdNg993o4jL6G36GDW4BPIyO6FPZhfsawdf6liVD0Xo5kibIK7B9VoE178cdLQtLpS2YolRwf5yy6XR6hbbBGQR+6xrGOdP16eGZDb1CE2bMvvJijjloFqPscGktWOqW+nfh5txwFfBzlfARDTBsS8WZtg3Yoj1kn33kPsWRlgHfNutFRAIynDuDdQzQq8tTtVwm+Yi75RfcPHW8y3P Work")
end
end
diff --git a/features/steps/project/active_tab.rb b/features/steps/project/active_tab.rb
index dfafbc6fc0e..83796b0ba88 100644
--- a/features/steps/project/active_tab.rb
+++ b/features/steps/project/active_tab.rb
@@ -1,140 +1,103 @@
-class ProjectActiveTab < Spinach::FeatureSteps
+class Spinach::Features::ProjectActiveTab < Spinach::FeatureSteps
include SharedAuthentication
include SharedPaths
include SharedProject
include SharedActiveTab
-
- # Main Tabs
-
- Then 'the active main tab should be Home' do
- ensure_active_main_tab('Activity')
- end
-
- Then 'the active main tab should be Settings' do
- ensure_active_main_tab('Settings')
- end
-
- Then 'the active main tab should be Files' do
- ensure_active_main_tab('Files')
- end
-
- Then 'the active main tab should be Commits' do
- ensure_active_main_tab('Commits')
- end
-
- Then 'the active main tab should be Network' do
- ensure_active_main_tab('Network')
- end
-
- Then 'the active main tab should be Issues' do
- ensure_active_main_tab('Issues')
- end
-
- Then 'the active main tab should be Merge Requests' do
- ensure_active_main_tab('Merge Requests')
- end
-
- Then 'the active main tab should be Wall' do
- ensure_active_main_tab('Wall')
- end
-
- Then 'the active main tab should be Wiki' do
- ensure_active_main_tab('Wiki')
- end
+ include SharedProjectTab
# Sub Tabs: Home
- Given 'I click the "Team" tab' do
+ step 'I click the "Team" tab' do
click_link('Members')
end
- Given 'I click the "Attachments" tab' do
+ step 'I click the "Attachments" tab' do
click_link('Attachments')
end
- Given 'I click the "Snippets" tab' do
+ step 'I click the "Snippets" tab' do
click_link('Snippets')
end
- Given 'I click the "Edit" tab' do
+ step 'I click the "Edit" tab' do
within '.project-settings-nav' do
click_link('Project')
end
end
- Given 'I click the "Hooks" tab' do
+ step 'I click the "Hooks" tab' do
click_link('Web Hooks')
end
- Given 'I click the "Deploy Keys" tab' do
+ step 'I click the "Deploy Keys" tab' do
click_link('Deploy Keys')
end
- Then 'the active sub nav should be Team' do
+ step 'the active sub nav should be Team' do
ensure_active_sub_nav('Members')
end
- Then 'the active sub nav should be Edit' do
+ step 'the active sub nav should be Edit' do
ensure_active_sub_nav('Project')
end
- Then 'the active sub nav should be Hooks' do
+ step 'the active sub nav should be Hooks' do
ensure_active_sub_nav('Web Hooks')
end
- Then 'the active sub nav should be Deploy Keys' do
+ step 'the active sub nav should be Deploy Keys' do
ensure_active_sub_nav('Deploy Keys')
end
# Sub Tabs: Commits
- Given 'I click the "Compare" tab' do
+ step 'I click the "Compare" tab' do
click_link('Compare')
end
- Given 'I click the "Branches" tab' do
+ step 'I click the "Branches" tab' do
click_link('Branches')
end
- Given 'I click the "Tags" tab' do
+ step 'I click the "Tags" tab' do
click_link('Tags')
end
- Then 'the active sub tab should be Commits' do
+ step 'the active sub tab should be Commits' do
ensure_active_sub_tab('Commits')
end
- Then 'the active sub tab should be Compare' do
+ step 'the active sub tab should be Compare' do
ensure_active_sub_tab('Compare')
end
- Then 'the active sub tab should be Branches' do
+ step 'the active sub tab should be Branches' do
ensure_active_sub_tab('Branches')
end
- Then 'the active sub tab should be Tags' do
+ step 'the active sub tab should be Tags' do
ensure_active_sub_tab('Tags')
end
# Sub Tabs: Issues
- Given 'I click the "Milestones" tab' do
+ step 'I click the "Milestones" tab' do
click_link('Milestones')
end
- Given 'I click the "Labels" tab' do
+ step 'I click the "Labels" tab' do
click_link('Labels')
end
- Then 'the active sub tab should be Browse Issues' do
+ step 'the active sub tab should be Browse Issues' do
ensure_active_sub_tab('Browse Issues')
end
- Then 'the active sub tab should be Milestones' do
+ step 'the active sub tab should be Milestones' do
ensure_active_sub_tab('Milestones')
end
- Then 'the active sub tab should be Labels' do
+ step 'the active sub tab should be Labels' do
ensure_active_sub_tab('Labels')
end
end
diff --git a/features/steps/project/archived.rb b/features/steps/project/archived.rb
index 8b490d2ffc0..afbf4d5950d 100644
--- a/features/steps/project/archived.rb
+++ b/features/steps/project/archived.rb
@@ -1,4 +1,4 @@
-class ProjectArchived < Spinach::FeatureSteps
+class Spinach::Features::ProjectArchived < Spinach::FeatureSteps
include SharedAuthentication
include SharedProject
include SharedPaths
@@ -18,11 +18,11 @@ class ProjectArchived < Spinach::FeatureSteps
visit project_path(project)
end
- Then 'I should not see "Archived"' do
+ step 'I should not see "Archived"' do
page.should_not have_content "Archived"
end
- Then 'I should see "Archived"' do
+ step 'I should see "Archived"' do
page.should have_content "Archived"
end
diff --git a/features/steps/project/browse_branches.rb b/features/steps/project/browse_branches.rb
index 7a0625952de..3b1e51f179a 100644
--- a/features/steps/project/browse_branches.rb
+++ b/features/steps/project/browse_branches.rb
@@ -1,4 +1,4 @@
-class ProjectBrowseBranches < Spinach::FeatureSteps
+class Spinach::Features::ProjectBrowseBranches < Spinach::FeatureSteps
include SharedAuthentication
include SharedProject
include SharedPaths
@@ -38,9 +38,48 @@ class ProjectBrowseBranches < Spinach::FeatureSteps
click_button 'Create branch'
end
+ step 'I submit new branch form with invalid name' do
+ fill_in 'branch_name', with: '1.0 stable'
+ fill_in 'ref', with: 'master'
+ click_button 'Create branch'
+ end
+
+ step 'I submit new branch form with invalid reference' do
+ fill_in 'branch_name', with: 'foo'
+ fill_in 'ref', with: 'foo'
+ click_button 'Create branch'
+ end
+
+ step 'I submit new branch form with branch that already exists' do
+ fill_in 'branch_name', with: 'master'
+ fill_in 'ref', with: 'master'
+ click_button 'Create branch'
+ end
+
step 'I should see new branch created' do
- within '.tree-ref-holder' do
- page.should have_content 'deploy_keys'
+ page.should have_content 'deploy_keys'
+ end
+
+ step 'I should see new an error that branch is invalid' do
+ page.should have_content 'Branch name invalid'
+ end
+
+ step 'I should see new an error that ref is invalid' do
+ page.should have_content 'Invalid reference name'
+ end
+
+ step 'I should see new an error that branch already exists' do
+ page.should have_content 'Branch already exists'
+ end
+
+ step "I click branch 'improve/awesome' delete link" do
+ within '.js-branch-improve\/awesome' do
+ find('.btn-remove').click
+ sleep 0.05
end
end
+
+ step "I should not see branch 'improve/awesome'" do
+ all(visible: true).should_not have_content 'improve/awesome'
+ end
end
diff --git a/features/steps/project/browse_commits.rb b/features/steps/project/browse_commits.rb
index 37207aafebe..2048818e88c 100644
--- a/features/steps/project/browse_commits.rb
+++ b/features/steps/project/browse_commits.rb
@@ -1,91 +1,91 @@
-class ProjectBrowseCommits < Spinach::FeatureSteps
+class Spinach::Features::ProjectBrowseCommits < Spinach::FeatureSteps
include SharedAuthentication
include SharedProject
include SharedPaths
include RepoHelpers
- Then 'I see project commits' do
+ step 'I see project commits' do
commit = @project.repository.commit
page.should have_content(@project.name)
page.should have_content(commit.message[0..20])
page.should have_content(commit.id.to_s[0..5])
end
- Given 'I click atom feed link' do
+ step 'I click atom feed link' do
click_link "Feed"
end
- Then 'I see commits atom feed' do
+ step 'I see commits atom feed' do
commit = @project.repository.commit
- page.response_headers['Content-Type'].should have_content("application/atom+xml")
- page.body.should have_selector("title", text: "Recent commits to #{@project.name}")
- page.body.should have_selector("author email", text: commit.author_email)
- page.body.should have_selector("entry summary", text: commit.description[0..10])
+ response_headers['Content-Type'].should have_content("application/atom+xml")
+ body.should have_selector("title", text: "Recent commits to #{@project.name}")
+ body.should have_selector("author email", text: commit.author_email)
+ body.should have_selector("entry summary", text: commit.description[0..10])
end
- Given 'I click on commit link' do
+ step 'I click on commit link' do
visit project_commit_path(@project, sample_commit.id)
end
- Then 'I see commit info' do
+ step 'I see commit info' do
page.should have_content sample_commit.message
page.should have_content "Showing #{sample_commit.files_changed_count} changed files"
end
- And 'I fill compare fields with refs' do
+ step 'I fill compare fields with refs' do
fill_in "from", with: sample_commit.parent_id
fill_in "to", with: sample_commit.id
click_button "Compare"
end
- Then 'I see compared refs' do
+ step 'I see compared refs' do
page.should have_content "Compare View"
page.should have_content "Commits (1)"
page.should have_content "Showing 2 changed files"
end
- Then 'I see breadcrumb links' do
+ step 'I see breadcrumb links' do
page.should have_selector('ul.breadcrumb')
page.should have_selector('ul.breadcrumb a', count: 4)
end
- Then 'I see commits stats' do
+ step 'I see commits stats' do
page.should have_content 'Top 50 Committers'
page.should have_content 'Committers'
page.should have_content 'Total commits'
page.should have_content 'Authors'
end
- Given 'I visit big commit page' do
+ step 'I visit big commit page' do
Commit::DIFF_SAFE_FILES = 20
visit project_commit_path(@project, sample_big_commit.id)
end
- Then 'I see big commit warning' do
+ step 'I see big commit warning' do
page.should have_content sample_big_commit.message
page.should have_content "Too many changes"
Commit::DIFF_SAFE_FILES = 100
end
- Given 'I visit a commit with an image that changed' do
+ step 'I visit a commit with an image that changed' do
visit project_commit_path(@project, sample_image_commit.id)
end
- Then 'The diff links to both the previous and current image' do
- links = page.all('.two-up span div a')
+ step 'The diff links to both the previous and current image' do
+ links = all('.two-up span div a')
links[0]['href'].should =~ %r{blob/#{sample_image_commit.old_blob_id}}
links[1]['href'].should =~ %r{blob/#{sample_image_commit.new_blob_id}}
end
- Given 'I click side-by-side diff button' do
+ step 'I click side-by-side diff button' do
click_link "Side-by-side Diff"
end
- Then 'I see side-by-side diff button' do
+ step 'I see side-by-side diff button' do
page.should have_content "Side-by-side Diff"
end
- Then 'I see inline diff button' do
+ step 'I see inline diff button' do
page.should have_content "Inline Diff"
end
end
diff --git a/features/steps/project/browse_commits_user_lookup.rb b/features/steps/project/browse_commits_user_lookup.rb
index 198ea29f28d..196c69eda65 100644
--- a/features/steps/project/browse_commits_user_lookup.rb
+++ b/features/steps/project/browse_commits_user_lookup.rb
@@ -1,13 +1,13 @@
-class ProjectBrowseCommitsUserLookup < Spinach::FeatureSteps
+class Spinach::Features::ProjectBrowseCommitsUserLookup < Spinach::FeatureSteps
include SharedAuthentication
include SharedProject
include SharedPaths
- Given 'I click on commit link' do
+ step 'I click on commit link' do
visit project_commit_path(@project, sample_commit.id)
end
- Given 'I click on another commit link' do
+ step 'I click on another commit link' do
visit project_commit_path(@project, sample_commit.parent_id)
end
diff --git a/features/steps/project/browse_files.rb b/features/steps/project/browse_files.rb
index 6fd0c2c2ded..536902934ba 100644
--- a/features/steps/project/browse_files.rb
+++ b/features/steps/project/browse_files.rb
@@ -1,4 +1,4 @@
-class ProjectBrowseFiles < Spinach::FeatureSteps
+class Spinach::Features::ProjectBrowseFiles < Spinach::FeatureSteps
include SharedAuthentication
include SharedProject
include SharedPaths
@@ -20,7 +20,7 @@ class ProjectBrowseFiles < Spinach::FeatureSteps
click_link ".gitignore"
end
- step 'I should see it content' do
+ step 'I should see its content' do
page.should have_content "*.rbc"
end
@@ -29,7 +29,7 @@ class ProjectBrowseFiles < Spinach::FeatureSteps
end
step 'I should see raw file content' do
- page.source.should == sample_blob.data
+ source.should == sample_blob.data
end
step 'I click button "edit"' do
@@ -37,12 +37,12 @@ class ProjectBrowseFiles < Spinach::FeatureSteps
end
step 'I can edit code' do
- page.execute_script('editor.setValue("GitlabFileEditor")')
- page.evaluate_script('editor.getValue()').should == "GitlabFileEditor"
+ execute_script('editor.setValue("GitlabFileEditor")')
+ evaluate_script('editor.getValue()').should == "GitlabFileEditor"
end
step 'I edit code' do
- page.execute_script('editor.setValue("GitlabFileEditor")')
+ execute_script('editor.setValue("GitlabFileEditor")')
end
step 'I click link "Diff"' do
@@ -77,7 +77,9 @@ class ProjectBrowseFiles < Spinach::FeatureSteps
end
step 'I click on readme file' do
- click_link 'README.md'
+ within '.tree-table' do
+ click_link 'README.md'
+ end
end
step 'I see Browse file link' do
@@ -90,4 +92,17 @@ class ProjectBrowseFiles < Spinach::FeatureSteps
page.should_not have_link 'Browse File »'
page.should_not have_link 'Browse Dir »'
end
+
+ step 'I click on permalink' do
+ click_link 'permalink'
+ end
+
+ step 'I am redirected to the permalink URL' do
+ expect(current_path).to eq(project_blob_path(
+ @project, @project.repository.commit.sha + '/.gitignore'))
+ end
+
+ step "I don't see the permalink link" do
+ expect(page).not_to have_link('permalink')
+ end
end
diff --git a/features/steps/project/browse_git_repo.rb b/features/steps/project/browse_git_repo.rb
index 2c3017dd4e2..09f44eb4c6d 100644
--- a/features/steps/project/browse_git_repo.rb
+++ b/features/steps/project/browse_git_repo.rb
@@ -1,17 +1,17 @@
-class ProjectBrowseGitRepo < Spinach::FeatureSteps
+class Spinach::Features::ProjectBrowseGitRepo < Spinach::FeatureSteps
include SharedAuthentication
include SharedProject
include SharedPaths
- Given 'I click on ".gitignore" file in repo' do
+ step 'I click on ".gitignore" file in repo' do
click_link ".gitignore"
end
- And 'I click blame button' do
+ step 'I click blame button' do
click_link "blame"
end
- Then 'I should see git file blame' do
+ step 'I should see git file blame' do
page.should have_content "*.rb"
page.should have_content "Dmitriy Zaporozhets"
page.should have_content "Initial commit"
diff --git a/features/steps/project/browse_tags.rb b/features/steps/project/browse_tags.rb
index 7c679911e00..722c0a91076 100644
--- a/features/steps/project/browse_tags.rb
+++ b/features/steps/project/browse_tags.rb
@@ -1,10 +1,82 @@
-class ProjectBrowseTags < Spinach::FeatureSteps
+class Spinach::Features::ProjectBrowseTags < Spinach::FeatureSteps
include SharedAuthentication
include SharedProject
include SharedPaths
- Then 'I should see "Shop" all tags list' do
+ step 'I should see "Shop" all tags list' do
page.should have_content "Tags"
page.should have_content "v1.0.0"
end
+
+ step 'I click new tag link' do
+ click_link 'New tag'
+ end
+
+ step 'I submit new tag form' do
+ fill_in 'tag_name', with: 'v7.0'
+ fill_in 'ref', with: 'master'
+ click_button 'Create tag'
+ end
+
+ step 'I submit new tag form with invalid name' do
+ fill_in 'tag_name', with: 'v 1.0'
+ fill_in 'ref', with: 'master'
+ click_button 'Create tag'
+ end
+
+ step 'I submit new tag form with invalid reference' do
+ fill_in 'tag_name', with: 'foo'
+ fill_in 'ref', with: 'foo'
+ click_button 'Create tag'
+ end
+
+ step 'I submit new tag form with tag that already exists' do
+ fill_in 'tag_name', with: 'v1.0.0'
+ fill_in 'ref', with: 'master'
+ click_button 'Create tag'
+ end
+
+ step 'I should see new tag created' do
+ page.should have_content 'v7.0'
+ end
+
+ step 'I should see new an error that tag is invalid' do
+ page.should have_content 'Tag name invalid'
+ end
+
+ step 'I should see new an error that tag ref is invalid' do
+ page.should have_content 'Invalid reference name'
+ end
+
+ step 'I should see new an error that tag already exists' do
+ page.should have_content 'Tag already exists'
+ end
+
+ step "I delete tag 'v1.1.0'" do
+ within '.tags' do
+ first('.btn-remove').click
+ sleep 0.05
+ end
+ end
+
+ step "I should not see tag 'v1.1.0'" do
+ within '.tags' do
+ all(visible: true).should_not have_content 'v1.1.0'
+ end
+ end
+
+ step 'I delete all tags' do
+ within '.tags' do
+ all('.btn-remove').each do |remove|
+ remove.click
+ sleep 0.05
+ end
+ end
+ end
+
+ step 'I should see tags info message' do
+ within '.tags' do
+ page.should have_content 'Repository has no tags yet.'
+ end
+ end
end
diff --git a/features/steps/project/comments_on_commit_diffs.rb b/features/steps/project/comments_on_commit_diffs.rb
index fc397a4fa91..50b978a5d23 100644
--- a/features/steps/project/comments_on_commit_diffs.rb
+++ b/features/steps/project/comments_on_commit_diffs.rb
@@ -1,4 +1,4 @@
-class CommentsOnCommitDiffs < Spinach::FeatureSteps
+class Spinach::Features::CommentsOnCommitDiffs < Spinach::FeatureSteps
include SharedAuthentication
include SharedDiffNote
include SharedPaths
diff --git a/features/steps/project/comments_on_commits.rb b/features/steps/project/comments_on_commits.rb
index 56bb12a8209..03e6867c7b1 100644
--- a/features/steps/project/comments_on_commits.rb
+++ b/features/steps/project/comments_on_commits.rb
@@ -1,4 +1,4 @@
-class CommentsOnCommits < Spinach::FeatureSteps
+class Spinach::Features::CommentsOnCommits < Spinach::FeatureSteps
include SharedAuthentication
include SharedNote
include SharedPaths
diff --git a/features/steps/project/create.rb b/features/steps/project/create.rb
index b42e5bd3623..bcd2524c205 100644
--- a/features/steps/project/create.rb
+++ b/features/steps/project/create.rb
@@ -1,42 +1,42 @@
-class CreateProject < Spinach::FeatureSteps
+class Spinach::Features::CreateProject < Spinach::FeatureSteps
include SharedAuthentication
include SharedPaths
- And 'fill project form with valid data' do
+ step 'fill project form with valid data' do
fill_in 'project_name', with: 'Empty'
click_button "Create project"
end
- Then 'I should see project page' do
+ step 'I should see project page' do
page.should have_content "Empty"
current_path.should == project_path(Project.last)
end
- And 'I should see empty project instuctions' do
+ step 'I should see empty project instuctions' do
page.should have_content "git init"
page.should have_content "git remote"
page.should have_content Project.last.url_to_repo
end
- Then 'I see empty project instuctions' do
+ step 'I see empty project instuctions' do
page.should have_content "git init"
page.should have_content "git remote"
page.should have_content Project.last.url_to_repo
end
- And 'I click on HTTP' do
+ step 'I click on HTTP' do
click_button 'HTTP'
end
- Then 'Remote url should update to http link' do
+ step 'Remote url should update to http link' do
page.should have_content "git remote add origin #{Project.last.http_url_to_repo}"
end
- And 'If I click on SSH' do
+ step 'If I click on SSH' do
click_button 'SSH'
end
- Then 'Remote url should update to ssh link' do
+ step 'Remote url should update to ssh link' do
page.should have_content "git remote add origin #{Project.last.url_to_repo}"
end
end
diff --git a/features/steps/project/filter_labels.rb b/features/steps/project/filter_labels.rb
index 9b31a6d9da2..aaa0cfe3379 100644
--- a/features/steps/project/filter_labels.rb
+++ b/features/steps/project/filter_labels.rb
@@ -1,4 +1,4 @@
-class ProjectFilterLabels < Spinach::FeatureSteps
+class Spinach::Features::ProjectFilterLabels < Spinach::FeatureSteps
include SharedAuthentication
include SharedProject
include SharedPaths
diff --git a/features/steps/project/fork.rb b/features/steps/project/fork.rb
index 93ceaa0ebb1..791c6b1ffb9 100644
--- a/features/steps/project/fork.rb
+++ b/features/steps/project/fork.rb
@@ -1,4 +1,4 @@
-class ForkProject < Spinach::FeatureSteps
+class Spinach::Features::ForkProject < Spinach::FeatureSteps
include SharedAuthentication
include SharedPaths
include SharedProject
diff --git a/features/steps/project/forked_merge_requests.rb b/features/steps/project/forked_merge_requests.rb
index 6ec527df13d..e8a6d635308 100644
--- a/features/steps/project/forked_merge_requests.rb
+++ b/features/steps/project/forked_merge_requests.rb
@@ -1,4 +1,4 @@
-class ProjectForkedMergeRequests < Spinach::FeatureSteps
+class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps
include SharedAuthentication
include SharedProject
include SharedNote
diff --git a/features/steps/project/graph.rb b/features/steps/project/graph.rb
index 89fe5fdeadf..ba460ac8097 100644
--- a/features/steps/project/graph.rb
+++ b/features/steps/project/graph.rb
@@ -1,8 +1,8 @@
-class ProjectGraph < Spinach::FeatureSteps
+class Spinach::Features::ProjectGraph < Spinach::FeatureSteps
include SharedAuthentication
include SharedProject
- Then 'page should have graphs' do
+ step 'page should have graphs' do
page.should have_selector ".stat-graph"
end
@@ -10,4 +10,14 @@ class ProjectGraph < Spinach::FeatureSteps
project = Project.find_by(name: "Shop")
visit project_graph_path(project, "master")
end
+
+ step 'I visit project "Shop" commits graph page' do
+ project = Project.find_by(name: "Shop")
+ visit commits_project_graph_path(project, "master")
+ end
+
+ step 'page should have commits graphs' do
+ page.should have_content "Commits statistic for master"
+ page.should have_content "Commits per day of month"
+ end
end
diff --git a/features/steps/project/hooks.rb b/features/steps/project/hooks.rb
index 2bd383676e7..f4b8d372be8 100644
--- a/features/steps/project/hooks.rb
+++ b/features/steps/project/hooks.rb
@@ -1,6 +1,6 @@
require 'webmock'
-class ProjectHooks < Spinach::FeatureSteps
+class Spinach::Features::ProjectHooks < Spinach::FeatureSteps
include SharedAuthentication
include SharedProject
include SharedPaths
@@ -29,7 +29,7 @@ class ProjectHooks < Spinach::FeatureSteps
end
step 'I should see newly created hook' do
- page.current_path.should == project_hooks_path(current_project)
+ current_path.should == project_hooks_path(current_project)
page.should have_content(@url)
end
@@ -44,7 +44,7 @@ class ProjectHooks < Spinach::FeatureSteps
end
step 'hook should be triggered' do
- page.current_path.should == project_hooks_path(current_project)
+ current_path.should == project_hooks_path(current_project)
page.should have_selector '.flash-notice',
text: 'Hook successfully executed.'
end
diff --git a/features/steps/project/issue_tracker.rb b/features/steps/project/issue_tracker.rb
index c2fd4e15c9e..e1700292701 100644
--- a/features/steps/project/issue_tracker.rb
+++ b/features/steps/project/issue_tracker.rb
@@ -1,4 +1,4 @@
-class ProjectIssueTracker < Spinach::FeatureSteps
+class Spinach::Features::ProjectIssueTracker < Spinach::FeatureSteps
include SharedAuthentication
include SharedProject
include SharedPaths
@@ -25,7 +25,7 @@ class ProjectIssueTracker < Spinach::FeatureSteps
find_field('project_issues_tracker').value.should == 'redmine'
end
- And 'I save project' do
+ step 'I save project' do
click_button 'Save changes'
end
end
diff --git a/features/steps/project/issues.rb b/features/steps/project/issues.rb
index 557ea2fdca8..137eac33238 100644
--- a/features/steps/project/issues.rb
+++ b/features/steps/project/issues.rb
@@ -1,51 +1,51 @@
-class ProjectIssues < Spinach::FeatureSteps
+class Spinach::Features::ProjectIssues < Spinach::FeatureSteps
include SharedAuthentication
include SharedProject
include SharedNote
include SharedPaths
include SharedMarkdown
- Given 'I should see "Release 0.4" in issues' do
+ step 'I should see "Release 0.4" in issues' do
page.should have_content "Release 0.4"
end
- And 'I should not see "Release 0.3" in issues' do
+ step 'I should not see "Release 0.3" in issues' do
page.should_not have_content "Release 0.3"
end
- And 'I should not see "Tweet control" in issues' do
+ step 'I should not see "Tweet control" in issues' do
page.should_not have_content "Tweet control"
end
- Given 'I click link "Closed"' do
+ step 'I click link "Closed"' do
click_link "Closed"
end
- Then 'I should see "Release 0.3" in issues' do
+ step 'I should see "Release 0.3" in issues' do
page.should have_content "Release 0.3"
end
- And 'I should not see "Release 0.4" in issues' do
+ step 'I should not see "Release 0.4" in issues' do
page.should_not have_content "Release 0.4"
end
- Given 'I click link "All"' do
+ step 'I click link "All"' do
click_link "All"
end
- Given 'I click link "Release 0.4"' do
+ step 'I click link "Release 0.4"' do
click_link "Release 0.4"
end
- Then 'I should see issue "Release 0.4"' do
+ step 'I should see issue "Release 0.4"' do
page.should have_content "Release 0.4"
end
- Given 'I click link "New Issue"' do
+ step 'I click link "New Issue"' do
click_link "New Issue"
end
- And 'I submit new issue "500 error on profile"' do
+ step 'I submit new issue "500 error on profile"' do
fill_in "issue_title", with: "500 error on profile"
click_button "Submit new issue"
end
@@ -56,7 +56,7 @@ class ProjectIssues < Spinach::FeatureSteps
click_button "Submit new issue"
end
- Given 'I click link "500 error on profile"' do
+ step 'I click link "500 error on profile"' do
click_link "500 error on profile"
end
@@ -66,42 +66,42 @@ class ProjectIssues < Spinach::FeatureSteps
end
end
- Then 'I should see issue "500 error on profile"' do
+ step 'I should see issue "500 error on profile"' do
issue = Issue.find_by(title: "500 error on profile")
page.should have_content issue.title
page.should have_content issue.author_name
page.should have_content issue.project.name
end
- Given 'I fill in issue search with "Re"' do
- fill_in 'issue_search', with: "Re"
+ step 'I fill in issue search with "Re"' do
+ filter_issue "Re"
end
- Given 'I fill in issue search with "Bu"' do
- fill_in 'issue_search', with: "Bu"
+ step 'I fill in issue search with "Bu"' do
+ filter_issue "Bu"
end
- And 'I fill in issue search with ".3"' do
- fill_in 'issue_search', with: ".3"
+ step 'I fill in issue search with ".3"' do
+ filter_issue ".3"
end
- And 'I fill in issue search with "Something"' do
- fill_in 'issue_search', with: "Something"
+ step 'I fill in issue search with "Something"' do
+ filter_issue "Something"
end
- And 'I fill in issue search with ""' do
- fill_in 'issue_search', with: ""
+ step 'I fill in issue search with ""' do
+ filter_issue ""
end
- Given 'project "Shop" has milestone "v2.2"' do
- project = Project.find_by(name: "Shop")
+ step 'project "Shop" has milestone "v2.2"' do
+
milestone = create(:milestone, title: "v2.2", project: project)
3.times { create(:issue, project: project, milestone: milestone) }
end
- And 'project "Shop" has milestone "v3.0"' do
- project = Project.find_by(name: "Shop")
+ step 'project "Shop" has milestone "v3.0"' do
+
milestone = create(:milestone, title: "v3.0", project: project)
3.times { create(:issue, project: project, milestone: milestone) }
@@ -111,26 +111,26 @@ class ProjectIssues < Spinach::FeatureSteps
select "v3.0", from: "milestone_id"
end
- Then 'I should see selected milestone with title "v3.0"' do
+ step 'I should see selected milestone with title "v3.0"' do
issues_milestone_selector = "#issue_milestone_id_chzn > a"
- page.find(issues_milestone_selector).should have_content("v3.0")
+ find(issues_milestone_selector).should have_content("v3.0")
end
When 'I select first assignee from "Shop" project' do
- project = Project.find_by(name: "Shop")
+
first_assignee = project.users.first
select first_assignee.name, from: "assignee_id"
end
- Then 'I should see first assignee from "Shop" as selected assignee' do
+ step 'I should see first assignee from "Shop" as selected assignee' do
issues_assignee_selector = "#issue_assignee_id_chzn > a"
- project = Project.find_by(name: "Shop")
+
assignee_name = project.users.first.name
- page.find(issues_assignee_selector).should have_content(assignee_name)
+ find(issues_assignee_selector).should have_content(assignee_name)
end
- And 'project "Shop" have "Release 0.4" open issue' do
- project = Project.find_by(name: "Shop")
+ step 'project "Shop" have "Release 0.4" open issue' do
+
create(:issue,
title: "Release 0.4",
project: project,
@@ -139,23 +139,21 @@ class ProjectIssues < Spinach::FeatureSteps
)
end
- And 'project "Shop" have "Tweet control" open issue' do
- project = Project.find_by(name: "Shop")
+ step 'project "Shop" have "Tweet control" open issue' do
create(:issue,
title: "Tweet control",
project: project,
author: project.users.first)
end
- And 'project "Shop" have "Release 0.3" closed issue' do
- project = Project.find_by(name: "Shop")
+ step 'project "Shop" have "Release 0.3" closed issue' do
create(:closed_issue,
title: "Release 0.3",
project: project,
author: project.users.first)
end
- Given 'empty project "Empty Project"' do
+ step 'empty project "Empty Project"' do
create :empty_project, name: 'Empty Project', namespace: @user.namespace
end
@@ -164,9 +162,9 @@ class ProjectIssues < Spinach::FeatureSteps
visit project_path(project)
end
- And 'I see empty project details with ssh clone info' do
+ step 'I see empty project details with ssh clone info' do
project = Project.find_by(name: 'Empty Project')
- page.all(:css, '.git-empty .clone').each do |element|
+ all(:css, '.git-empty .clone').each do |element|
element.text.should include(project.url_to_repo)
end
end
@@ -187,4 +185,59 @@ class ProjectIssues < Spinach::FeatureSteps
step 'The code block should be unchanged' do
page.should have_content("```\nCommand [1]: /usr/local/bin/git , see [text](doc/text)\n```")
end
+
+ step 'project \'Shop\' has issue \'Bugfix1\' with description: \'Description for issue1\'' do
+ issue = create(:issue, title: 'Bugfix1', description: 'Description for issue1', project: project)
+ end
+
+ step 'project \'Shop\' has issue \'Feature1\' with description: \'Feature submitted for issue1\'' do
+ issue = create(:issue, title: 'Feature1', description: 'Feature submitted for issue1', project: project)
+ end
+
+ step 'I fill in issue search with \'Description for issue1\'' do
+ filter_issue 'Description for issue'
+ end
+
+ step 'I fill in issue search with \'issue1\'' do
+ filter_issue 'issue1'
+ end
+
+ step 'I fill in issue search with \'Rock and roll\'' do
+ filter_issue 'Description for issue'
+ end
+
+ step 'I should see \'Bugfix1\' in issues' do
+ page.should have_content 'Bugfix1'
+ end
+
+ step 'I should see \'Feature1\' in issues' do
+ page.should have_content 'Feature1'
+ end
+
+ step 'I should not see \'Bugfix1\' in issues' do
+ page.should_not have_content 'Bugfix1'
+ end
+
+ step 'issue \'Release 0.4\' has label \'bug\'' do
+ label = project.labels.create!(name: 'bug', color: '#990000')
+ issue = Issue.find_by!(title: 'Release 0.4')
+ issue.labels << label
+ end
+
+ step 'I click label \'bug\'' do
+ within ".issues-list" do
+ click_link 'bug'
+ end
+ end
+
+ def filter_issue(text)
+ fill_in 'issue_search', with: text
+
+ # make sure AJAX request finished
+ URI.parse(current_url).request_uri == project_issues_path(project, issue_search: text)
+ end
+
+ def project
+ @project ||= Project.find_by(name: 'Shop')
+ end
end
diff --git a/features/steps/project/labels.rb b/features/steps/project/labels.rb
index 8320405e096..b287e183b91 100644
--- a/features/steps/project/labels.rb
+++ b/features/steps/project/labels.rb
@@ -1,20 +1,8 @@
-class ProjectLabels < Spinach::FeatureSteps
+class Spinach::Features::ProjectLabels < Spinach::FeatureSteps
include SharedAuthentication
include SharedProject
include SharedPaths
- step 'I should see label "bug"' do
- within ".manage-labels-list" do
- page.should have_content "bug"
- end
- end
-
- step 'I should see label "feature"' do
- within ".manage-labels-list" do
- page.should have_content "feature"
- end
- end
-
step 'I visit \'bug\' label edit page' do
visit edit_project_label_path(project, bug_label)
end
@@ -25,6 +13,22 @@ class ProjectLabels < Spinach::FeatureSteps
end
end
+ step 'I delete all labels' do
+ within '.labels' do
+ all('.btn-remove').each do |remove|
+ remove.click
+ sleep 0.05
+ end
+ end
+ end
+
+ step 'I should see labels help message' do
+ within '.labels' do
+ page.should have_content 'Create first label or generate default set of '\
+ 'labels'
+ end
+ end
+
step 'I submit new label \'support\'' do
fill_in 'Title', with: 'support'
fill_in 'Background Color', with: '#F95610'
@@ -55,6 +59,12 @@ class ProjectLabels < Spinach::FeatureSteps
end
end
+ step 'I should see label \'feature\'' do
+ within '.manage-labels-list' do
+ page.should have_content 'feature'
+ end
+ end
+
step 'I should see label \'bug\'' do
within '.manage-labels-list' do
page.should have_content 'bug'
diff --git a/features/steps/project/markdown_render.rb b/features/steps/project/markdown_render.rb
index 1885649891e..a8631af2e05 100644
--- a/features/steps/project/markdown_render.rb
+++ b/features/steps/project/markdown_render.rb
@@ -6,19 +6,19 @@ class Spinach::Features::ProjectMarkdownRender < Spinach::FeatureSteps
include SharedPaths
include SharedMarkdown
- And 'I own project "Delta"' do
+ step 'I own project "Delta"' do
@project = Project.find_by(name: "Delta")
@project ||= create(:project, name: "Delta", namespace: @user.namespace)
@project.team << [@user, :master]
end
- Then 'I should see files from repository in markdown' do
+ step 'I should see files from repository in markdown' do
current_path.should == project_tree_path(@project, "markdown")
page.should have_content "README.md"
page.should have_content "CHANGELOG"
end
- And 'I should see rendered README which contains correct links' do
+ step 'I should see rendered README which contains correct links' do
page.should have_content "Welcome to GitLab GitLab is a free project and repository management application"
page.should have_link "GitLab API doc"
page.should have_link "GitLab API website"
@@ -28,79 +28,87 @@ class Spinach::Features::ProjectMarkdownRender < Spinach::FeatureSteps
page.should have_link "Maintenance"
end
- And 'I click on Gitlab API in README' do
+ step 'I click on Gitlab API in README' do
click_link "GitLab API doc"
end
- Then 'I should see correct document rendered' do
+ step 'I should see correct document rendered' do
current_path.should == project_blob_path(@project, "markdown/doc/api/README.md")
page.should have_content "All API requests require authentication"
end
- And 'I click on Rake tasks in README' do
+ step 'I click on Rake tasks in README' do
click_link "Rake tasks"
end
- Then 'I should see correct directory rendered' do
+ step 'I should see correct directory rendered' do
current_path.should == project_tree_path(@project, "markdown/doc/raketasks")
page.should have_content "backup_restore.md"
page.should have_content "maintenance.md"
end
- And 'I click on GitLab API doc directory in README' do
+ step 'I click on GitLab API doc directory in README' do
click_link "GitLab API doc directory"
end
- Then 'I should see correct doc/api directory rendered' do
+ step 'I should see correct doc/api directory rendered' do
current_path.should == project_tree_path(@project, "markdown/doc/api")
page.should have_content "README.md"
page.should have_content "users.md"
end
- And 'I click on Maintenance in README' do
+ step 'I click on Maintenance in README' do
click_link "Maintenance"
end
- Then 'I should see correct maintenance file rendered' do
+ step 'I should see correct maintenance file rendered' do
current_path.should == project_blob_path(@project, "markdown/doc/raketasks/maintenance.md")
page.should have_content "bundle exec rake gitlab:env:info RAILS_ENV=production"
end
- And 'I click on link "empty" in the README' do
+ step 'I click on link "empty" in the README' do
within('.readme-holder') do
click_link "empty"
end
end
- And 'I click on link "id" in the README' do
+ step 'I click on link "id" in the README' do
within('.readme-holder') do
click_link "#id"
end
end
- And 'I navigate to the doc/api/README' do
- click_link "doc"
- click_link "api"
- click_link "README.md"
+ step 'I navigate to the doc/api/README' do
+ within '.tree-table' do
+ click_link "doc"
+ end
+
+ within '.tree-table' do
+ click_link "api"
+ end
+
+ within '.tree-table' do
+ click_link "README.md"
+ end
end
- And 'I see correct file rendered' do
+ step 'I see correct file rendered' do
current_path.should == project_blob_path(@project, "markdown/doc/api/README.md")
page.should have_content "Contents"
page.should have_link "Users"
page.should have_link "Rake tasks"
end
- And 'I click on users in doc/api/README' do
+ step 'I click on users in doc/api/README' do
click_link "Users"
end
- Then 'I should see the correct document file' do
+ step 'I should see the correct document file' do
current_path.should == project_blob_path(@project, "markdown/doc/api/users.md")
page.should have_content "Get a list of users."
end
- And 'I click on raketasks in doc/api/README' do
+ step 'I click on raketasks in doc/api/README' do
click_link "Rake tasks"
end
@@ -122,91 +130,94 @@ class Spinach::Features::ProjectMarkdownRender < Spinach::FeatureSteps
visit project_blob_path(@project, "markdown/d/README.md")
end
- Then 'I should see files from repository in markdown branch' do
+ step 'I should see files from repository in markdown branch' do
current_path.should == project_tree_path(@project, "markdown")
page.should have_content "README.md"
page.should have_content "CHANGELOG"
end
- And 'I see correct file rendered in markdown branch' do
+ step 'I see correct file rendered in markdown branch' do
current_path.should == project_blob_path(@project, "markdown/doc/api/README.md")
page.should have_content "Contents"
page.should have_link "Users"
page.should have_link "Rake tasks"
end
- Then 'I should see correct document rendered for markdown branch' do
+ step 'I should see correct document rendered for markdown branch' do
current_path.should == project_blob_path(@project, "markdown/doc/api/README.md")
page.should have_content "All API requests require authentication"
end
- Then 'I should see correct directory rendered for markdown branch' do
+ step 'I should see correct directory rendered for markdown branch' do
current_path.should == project_tree_path(@project, "markdown/doc/raketasks")
page.should have_content "backup_restore.md"
page.should have_content "maintenance.md"
end
- Then 'I should see the users document file in markdown branch' do
+ step 'I should see the users document file in markdown branch' do
current_path.should == project_blob_path(@project, "markdown/doc/api/users.md")
page.should have_content "Get a list of users."
end
# Expected link contents
- Then 'The link with text "empty" should have url "tree/markdown"' do
+ step 'The link with text "empty" should have url "tree/markdown"' do
find('a', text: /^empty$/)['href'] == current_host + project_tree_path(@project, "markdown")
end
- Then 'The link with text "empty" should have url "blob/markdown/README.md"' do
+ step 'The link with text "empty" should have url "blob/markdown/README.md"' do
find('a', text: /^empty$/)['href'] == current_host + project_blob_path(@project, "markdown/README.md")
end
- Then 'The link with text "empty" should have url "tree/markdown/d"' do
+ step 'The link with text "empty" should have url "tree/markdown/d"' do
find('a', text: /^empty$/)['href'] == current_host + project_tree_path(@project, "markdown/d")
end
- Then 'The link with text "empty" should have url "blob/markdown/d/README.md"' do
+ step 'The link with text "empty" should have '\
+ 'url "blob/markdown/d/README.md"' do
find('a', text: /^empty$/)['href'] == current_host + project_blob_path(@project, "markdown/d/README.md")
end
- Then 'The link with text "ID" should have url "tree/markdownID"' do
+ step 'The link with text "ID" should have url "tree/markdownID"' do
find('a', text: /^#id$/)['href'] == current_host + project_tree_path(@project, "markdown") + '#id'
end
- Then 'The link with text "/ID" should have url "tree/markdownID"' do
+ step 'The link with text "/ID" should have url "tree/markdownID"' do
find('a', text: /^\/#id$/)['href'] == current_host + project_tree_path(@project, "markdown") + '#id'
end
- Then 'The link with text "README.mdID" should have url "blob/markdown/README.mdID"' do
+ step 'The link with text "README.mdID" '\
+ 'should have url "blob/markdown/README.mdID"' do
find('a', text: /^README.md#id$/)['href'] == current_host + project_blob_path(@project, "markdown/README.md") + '#id'
end
- Then 'The link with text "d/README.mdID" should have url "blob/markdown/d/README.mdID"' do
+ step 'The link with text "d/README.mdID" should have '\
+ 'url "blob/markdown/d/README.mdID"' do
find('a', text: /^d\/README.md#id$/)['href'] == current_host + project_blob_path(@project, "d/markdown/README.md") + '#id'
end
- Then 'The link with text "ID" should have url "blob/markdown/README.mdID"' do
+ step 'The link with text "ID" should have url "blob/markdown/README.mdID"' do
find('a', text: /^#id$/)['href'] == current_host + project_blob_path(@project, "markdown/README.md") + '#id'
end
- Then 'The link with text "/ID" should have url "blob/markdown/README.mdID"' do
+ step 'The link with text "/ID" should have url "blob/markdown/README.mdID"' do
find('a', text: /^\/#id$/)['href'] == current_host + project_blob_path(@project, "markdown/README.md") + '#id'
end
# Wiki
- Given 'I go to wiki page' do
+ step 'I go to wiki page' do
click_link "Wiki"
current_path.should == project_wiki_path(@project, "home")
end
- And 'I add various links to the wiki page' do
+ step 'I add various links to the wiki page' do
fill_in "wiki[content]", with: "[test](test)\n[GitLab API doc](api)\n[Rake tasks](raketasks)\n"
fill_in "wiki[message]", with: "Adding links to wiki"
click_button "Create page"
end
- Then 'Wiki page should have added links' do
+ step 'Wiki page should have added links' do
current_path.should == project_wiki_path(@project, "home")
page.should have_content "test GitLab API doc Rake tasks"
end
@@ -221,11 +232,11 @@ class Spinach::Features::ProjectMarkdownRender < Spinach::FeatureSteps
header_should_have_correct_id_and_link(1, 'Wiki header', 'wiki-header')
end
- And 'I click on test link' do
+ step 'I click on test link' do
click_link "test"
end
- Then 'I see new wiki page named test' do
+ step 'I see new wiki page named test' do
current_path.should == project_wiki_path(@project, "test")
page.should have_content "Editing"
end
@@ -235,34 +246,34 @@ class Spinach::Features::ProjectMarkdownRender < Spinach::FeatureSteps
current_path.should == project_wiki_path(@project, "home")
end
- And 'I click on GitLab API doc link' do
+ step 'I click on GitLab API doc link' do
click_link "GitLab API"
end
- Then 'I see Gitlab API document' do
+ step 'I see Gitlab API document' do
current_path.should == project_wiki_path(@project, "api")
page.should have_content "Editing"
end
- And 'I click on Rake tasks link' do
+ step 'I click on Rake tasks link' do
click_link "Rake tasks"
end
- Then 'I see Rake tasks directory' do
+ step 'I see Rake tasks directory' do
current_path.should == project_wiki_path(@project, "raketasks")
page.should have_content "Editing"
end
- Given 'I go directory which contains README file' do
+ step 'I go directory which contains README file' do
visit project_tree_path(@project, "markdown/doc/api")
current_path.should == project_tree_path(@project, "markdown/doc/api")
end
- And 'I click on a relative link in README' do
+ step 'I click on a relative link in README' do
click_link "Users"
end
- Then 'I should see the correct markdown' do
+ step 'I should see the correct markdown' do
current_path.should == project_blob_path(@project, "markdown/doc/api/users.md")
page.should have_content "List users"
end
diff --git a/features/steps/project/merge_requests.rb b/features/steps/project/merge_requests.rb
index 05d3e5067c5..cd8475c14ac 100644
--- a/features/steps/project/merge_requests.rb
+++ b/features/steps/project/merge_requests.rb
@@ -1,9 +1,10 @@
-class ProjectMergeRequests < Spinach::FeatureSteps
+class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
include SharedAuthentication
include SharedProject
include SharedNote
include SharedPaths
include SharedMarkdown
+ include SharedDiffNote
step 'I click link "New Merge Request"' do
click_link "New Merge Request"
@@ -250,6 +251,16 @@ class ProjectMergeRequests < Spinach::FeatureSteps
expect(first('.text-file')).to have_content('.bundle')
end
+ step 'I click Side-by-side Diff tab' do
+ click_link 'Side-by-side Diff'
+ end
+
+ step 'I should see comments on the side-by-side diff page' do
+ within '.files [id^=diff]:nth-child(1) .note-text' do
+ page.should have_visible_content "Line is correct"
+ end
+ end
+
def project
@project ||= Project.find_by!(name: "Shop")
end
@@ -282,8 +293,4 @@ class ProjectMergeRequests < Spinach::FeatureSteps
def have_visible_content (text)
have_css("*", text: text, visible: true)
end
-
- def click_diff_line(code)
- find("a[data-line-code='#{code}']").click
- end
end
diff --git a/features/steps/project/milestones.rb b/features/steps/project/milestones.rb
index 5562b523d1b..13f917a6279 100644
--- a/features/steps/project/milestones.rb
+++ b/features/steps/project/milestones.rb
@@ -1,37 +1,37 @@
-class ProjectMilestones < Spinach::FeatureSteps
+class Spinach::Features::ProjectMilestones < Spinach::FeatureSteps
include SharedAuthentication
include SharedProject
include SharedPaths
include SharedMarkdown
- Then 'I should see milestone "v2.2"' do
+ step 'I should see milestone "v2.2"' do
milestone = @project.milestones.find_by(title: "v2.2")
page.should have_content(milestone.title[0..10])
page.should have_content(milestone.expires_at)
page.should have_content("Browse Issues")
end
- Given 'I click link "v2.2"' do
+ step 'I click link "v2.2"' do
click_link "v2.2"
end
- Given 'I click link "New Milestone"' do
+ step 'I click link "New Milestone"' do
click_link "New Milestone"
end
- And 'I submit new milestone "v2.3"' do
+ step 'I submit new milestone "v2.3"' do
fill_in "milestone_title", with: "v2.3"
click_button "Create milestone"
end
- Then 'I should see milestone "v2.3"' do
+ step 'I should see milestone "v2.3"' do
milestone = @project.milestones.find_by(title: "v2.3")
page.should have_content(milestone.title[0..10])
page.should have_content(milestone.expires_at)
page.should have_content("Browse Issues")
end
- And 'project "Shop" has milestone "v2.2"' do
+ step 'project "Shop" has milestone "v2.2"' do
project = Project.find_by(name: "Shop")
milestone = create(:milestone,
title: "v2.2",
@@ -41,7 +41,7 @@ class ProjectMilestones < Spinach::FeatureSteps
3.times { create(:issue, project: project, milestone: milestone) }
end
- Given 'the milestone has open and closed issues' do
+ step 'the milestone has open and closed issues' do
project = Project.find_by(name: "Shop")
milestone = project.milestones.find_by(title: 'v2.2')
@@ -53,7 +53,7 @@ class ProjectMilestones < Spinach::FeatureSteps
click_link 'All Issues'
end
- Then "I should see 3 issues" do
+ step 'I should see 3 issues' do
page.should have_selector('#tab-issues li.issue-row', count: 4)
end
end
diff --git a/features/steps/project/multiselect_blob.rb b/features/steps/project/multiselect_blob.rb
index d4dc1186970..611289a6162 100644
--- a/features/steps/project/multiselect_blob.rb
+++ b/features/steps/project/multiselect_blob.rb
@@ -1,4 +1,4 @@
-class ProjectMultiselectBlob < Spinach::FeatureSteps
+class Spinach::Features::ProjectMultiselectBlob < Spinach::FeatureSteps
include SharedAuthentication
include SharedProject
include SharedPaths
@@ -12,7 +12,7 @@ class ProjectMultiselectBlob < Spinach::FeatureSteps
step "I shift-click line #{line_number} in file" do
script = "$('#L#{line_number}').trigger($.Event('click', { shiftKey: true }));"
- page.evaluate_script(script)
+ execute_script(script)
end
end
end
@@ -45,11 +45,11 @@ class ProjectMultiselectBlob < Spinach::FeatureSteps
check_state_steps *Array(1..5), Array(1..2), Array(1..3), Array(1..4), Array(1..5), Array(3..5)
step 'I go back in history' do
- page.evaluate_script("window.history.back()")
+ go_back
end
step 'I go forward in history' do
- page.evaluate_script("window.history.forward()")
+ go_forward
end
step 'I click on ".gitignore" file in repo' do
diff --git a/features/steps/project/network_graph.rb b/features/steps/project/network_graph.rb
index 9f5da288914..14fdc72b8b6 100644
--- a/features/steps/project/network_graph.rb
+++ b/features/steps/project/network_graph.rb
@@ -1,9 +1,9 @@
-class ProjectNetworkGraph < Spinach::FeatureSteps
+class Spinach::Features::ProjectNetworkGraph < Spinach::FeatureSteps
include SharedAuthentication
include SharedPaths
include SharedProject
- Then 'page should have network graph' do
+ step 'page should have network graph' do
page.should have_selector ".network-graph"
end
@@ -15,27 +15,27 @@ class ProjectNetworkGraph < Spinach::FeatureSteps
visit project_network_path(project, "master")
end
- And 'page should select "master" in select box' do
+ step 'page should select "master" in select box' do
page.should have_selector '.select2-chosen', text: "master"
end
- And 'page should select "v1.0.0" in select box' do
+ step 'page should select "v1.0.0" in select box' do
page.should have_selector '.select2-chosen', text: "v1.0.0"
end
- And 'page should have "master" on graph' do
+ step 'page should have "master" on graph' do
within '.network-graph' do
page.should have_content 'master'
end
end
When 'I switch ref to "feature"' do
- page.select 'feature', from: 'ref'
+ select 'feature', from: 'ref'
sleep 2
end
When 'I switch ref to "v1.0.0"' do
- page.select 'v1.0.0', from: 'ref'
+ select 'v1.0.0', from: 'ref'
sleep 2
end
@@ -44,27 +44,27 @@ class ProjectNetworkGraph < Spinach::FeatureSteps
sleep 2
end
- Then 'page should have content not containing "v1.0.0"' do
+ step 'page should have content not containing "v1.0.0"' do
within '.network-graph' do
page.should have_content 'Change some files'
end
end
- Then 'page should not have content not containing "v1.0.0"' do
+ step 'page should not have content not containing "v1.0.0"' do
within '.network-graph' do
page.should_not have_content 'Change some files'
end
end
- And 'page should select "feature" in select box' do
+ step 'page should select "feature" in select box' do
page.should have_selector '.select2-chosen', text: "feature"
end
- And 'page should select "v1.0.0" in select box' do
+ step 'page should select "v1.0.0" in select box' do
page.should have_selector '.select2-chosen', text: "v1.0.0"
end
- And 'page should have "feature" on graph' do
+ step 'page should have "feature" on graph' do
within '.network-graph' do
page.should have_content 'feature'
end
@@ -78,7 +78,7 @@ class ProjectNetworkGraph < Spinach::FeatureSteps
sleep 2
end
- And 'page should have "v1.0.0" on graph' do
+ step 'page should have "v1.0.0" on graph' do
within '.network-graph' do
page.should have_content 'v1.0.0'
end
diff --git a/features/steps/project/project.rb b/features/steps/project/project.rb
index 2ffa1a62978..3e7061a421f 100644
--- a/features/steps/project/project.rb
+++ b/features/steps/project/project.rb
@@ -1,4 +1,4 @@
-class ProjectFeature < Spinach::FeatureSteps
+class Spinach::Features::ProjectFeature < Spinach::FeatureSteps
include SharedAuthentication
include SharedProject
include SharedPaths
diff --git a/features/steps/project/project_shortcuts.rb b/features/steps/project/project_shortcuts.rb
new file mode 100644
index 00000000000..a10e7bf78ee
--- /dev/null
+++ b/features/steps/project/project_shortcuts.rb
@@ -0,0 +1,36 @@
+class Spinach::Features::ProjectShortcuts < Spinach::FeatureSteps
+ include SharedAuthentication
+ include SharedPaths
+ include SharedProject
+ include SharedProjectTab
+
+ step 'I press "g" and "f"' do
+ find('body').native.send_key('g')
+ find('body').native.send_key('f')
+ end
+
+ step 'I press "g" and "c"' do
+ find('body').native.send_key('g')
+ find('body').native.send_key('c')
+ end
+
+ step 'I press "g" and "n"' do
+ find('body').native.send_key('g')
+ find('body').native.send_key('n')
+ end
+
+ step 'I press "g" and "g"' do
+ find('body').native.send_key('g')
+ find('body').native.send_key('g')
+ end
+
+ step 'I press "g" and "s"' do
+ find('body').native.send_key('g')
+ find('body').native.send_key('s')
+ end
+
+ step 'I press "g" and "w"' do
+ find('body').native.send_key('g')
+ find('body').native.send_key('w')
+ end
+end
diff --git a/features/steps/project/redirects.rb b/features/steps/project/redirects.rb
index 7e01735af95..e54637120ce 100644
--- a/features/steps/project/redirects.rb
+++ b/features/steps/project/redirects.rb
@@ -18,7 +18,7 @@ class Spinach::Features::ProjectRedirects < Spinach::FeatureSteps
step 'I should see project "Community" home page' do
Gitlab.config.gitlab.stub(:host).and_return("www.example.com")
- within '.project-home-title' do
+ within '.navbar-gitlab .title' do
page.should have_content 'Community'
end
end
@@ -34,9 +34,7 @@ class Spinach::Features::ProjectRedirects < Spinach::FeatureSteps
end
step 'I click on "Sign In"' do
- within '.pull-right' do
- click_link "Sign in"
- end
+ first(:link, "Sign in").click
end
step 'Authenticate' do
@@ -50,8 +48,8 @@ class Spinach::Features::ProjectRedirects < Spinach::FeatureSteps
step 'I should be redirected to "Community" page' do
project = Project.find_by(name: 'Community')
- page.current_path.should == "/#{project.path_with_namespace}"
- page.status_code.should == 200
+ current_path.should == "/#{project.path_with_namespace}"
+ status_code.should == 200
end
step 'I get redirected to signin page where I sign in' do
@@ -65,7 +63,7 @@ class Spinach::Features::ProjectRedirects < Spinach::FeatureSteps
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
+ current_path.should == "/#{project.path_with_namespace}"
+ status_code.should == 200
end
end
diff --git a/features/steps/project/search_code.rb b/features/steps/project/search_code.rb
index affa7d3b43b..5753296251f 100644
--- a/features/steps/project/search_code.rb
+++ b/features/steps/project/search_code.rb
@@ -1,4 +1,4 @@
-class ProjectSearchCode < Spinach::FeatureSteps
+class Spinach::Features::ProjectSearchCode < Spinach::FeatureSteps
include SharedAuthentication
include SharedProject
include SharedPaths
@@ -6,7 +6,6 @@ class ProjectSearchCode < Spinach::FeatureSteps
step 'I search for term "coffee"' do
fill_in "search", with: "coffee"
click_button "Go"
- click_link 'Repository Code'
end
step 'I should see files from repository containing "coffee"' do
@@ -15,6 +14,6 @@ class ProjectSearchCode < Spinach::FeatureSteps
end
step 'I should see empty result' do
- page.should have_content "We couldn't find any matching code"
+ page.should have_content "We couldn't find any matching"
end
end
diff --git a/features/steps/project/services.rb b/features/steps/project/services.rb
index 0594a08a5e7..b56b413eac8 100644
--- a/features/steps/project/services.rb
+++ b/features/steps/project/services.rb
@@ -1,4 +1,4 @@
-class ProjectServices < Spinach::FeatureSteps
+class Spinach::Features::ProjectServices < Spinach::FeatureSteps
include SharedAuthentication
include SharedProject
include SharedPaths
diff --git a/features/steps/project/snippets.rb b/features/steps/project/snippets.rb
index feae535fbea..2f8d3205d6c 100644
--- a/features/steps/project/snippets.rb
+++ b/features/steps/project/snippets.rb
@@ -1,10 +1,10 @@
-class ProjectSnippets < Spinach::FeatureSteps
+class Spinach::Features::ProjectSnippets < Spinach::FeatureSteps
include SharedAuthentication
include SharedProject
include SharedNote
include SharedPaths
- And 'project "Shop" have "Snippet one" snippet' do
+ step 'project "Shop" have "Snippet one" snippet' do
create(:project_snippet,
title: "Snippet one",
content: "Test content",
@@ -13,7 +13,7 @@ class ProjectSnippets < Spinach::FeatureSteps
author: project.users.first)
end
- And 'project "Shop" have no "Snippet two" snippet' do
+ step 'project "Shop" have no "Snippet two" snippet' do
create(:snippet,
title: "Snippet two",
content: "Test content",
@@ -21,37 +21,37 @@ class ProjectSnippets < Spinach::FeatureSteps
author: project.users.first)
end
- Given 'I click link "New Snippet"' do
+ step 'I click link "New Snippet"' do
click_link "Add new snippet"
end
- Given 'I click link "Snippet one"' do
+ step 'I click link "Snippet one"' do
click_link "Snippet one"
end
- Then 'I should see "Snippet one" in snippets' do
+ step 'I should see "Snippet one" in snippets' do
page.should have_content "Snippet one"
end
- And 'I should not see "Snippet two" in snippets' do
+ step 'I should not see "Snippet two" in snippets' do
page.should_not have_content "Snippet two"
end
- And 'I should not see "Snippet one" in snippets' do
+ step 'I should not see "Snippet one" in snippets' do
page.should_not have_content "Snippet one"
end
- And 'I click link "Edit"' do
+ step 'I click link "Edit"' do
within ".file-title" do
click_link "Edit"
end
end
- And 'I click link "Remove Snippet"' do
+ step 'I click link "Remove Snippet"' do
click_link "remove"
end
- And 'I submit new snippet "Snippet three"' do
+ step 'I submit new snippet "Snippet three"' do
fill_in "project_snippet_title", :with => "Snippet three"
fill_in "project_snippet_file_name", :with => "my_snippet.rb"
within('.file-editor') do
@@ -60,32 +60,32 @@ class ProjectSnippets < Spinach::FeatureSteps
click_button "Create snippet"
end
- Then 'I should see snippet "Snippet three"' do
+ step 'I should see snippet "Snippet three"' do
page.should have_content "Snippet three"
page.should have_content "Content of snippet three"
end
- And 'I submit new title "Snippet new title"' do
+ step 'I submit new title "Snippet new title"' do
fill_in "project_snippet_title", :with => "Snippet new title"
click_button "Save"
end
- Then 'I should see "Snippet new title"' do
+ step 'I should see "Snippet new title"' do
page.should have_content "Snippet new title"
end
- And 'I leave a comment like "Good snippet!"' do
+ step 'I leave a comment like "Good snippet!"' do
within('.js-main-target-form') do
fill_in "note_note", with: "Good snippet!"
click_button "Add Comment"
end
end
- Then 'I should see comment "Good snippet!"' do
+ step 'I should see comment "Good snippet!"' do
page.should have_content "Good snippet!"
end
- And 'I visit snippet page "Snippet one"' do
+ step 'I visit snippet page "Snippet one"' do
visit project_snippet_path(project, project_snippet)
end
diff --git a/features/steps/project/star.rb b/features/steps/project/star.rb
index 562df04e340..ae2e4c7a201 100644
--- a/features/steps/project/star.rb
+++ b/features/steps/project/star.rb
@@ -22,7 +22,7 @@ class Spinach::Features::ProjectStar < Spinach::FeatureSteps
# Requires @javascript
step "I click on the star toggle button" do
- page.find(".star .toggle", visible: true).click
+ find(".star .toggle", visible: true).click
end
protected
diff --git a/features/steps/project/team_management.rb b/features/steps/project/team_management.rb
index ffc5016529f..7907f2a6fe3 100644
--- a/features/steps/project/team_management.rb
+++ b/features/steps/project/team_management.rb
@@ -1,95 +1,95 @@
-class ProjectTeamManagement < Spinach::FeatureSteps
+class Spinach::Features::ProjectTeamManagement < Spinach::FeatureSteps
include SharedAuthentication
include SharedProject
include SharedPaths
include Select2Helper
- Then 'I should be able to see myself in team' do
+ step 'I should be able to see myself in team' do
page.should have_content(@user.name)
page.should have_content(@user.username)
end
- And 'I should see "Sam" in team list' do
+ step 'I should see "Sam" in team list' do
user = User.find_by(name: "Sam")
page.should have_content(user.name)
page.should have_content(user.username)
end
- Given 'I click link "New Team Member"' do
+ step 'I click link "New Team Member"' do
click_link "New project member"
end
- And 'I select "Mike" as "Reporter"' do
+ step 'I select "Mike" as "Reporter"' do
user = User.find_by(name: "Mike")
select2(user.id, from: "#user_ids", multiple: true)
- within "#new_team_member" do
- select "Reporter", from: "project_access"
+ within "#new_project_member" do
+ select "Reporter", from: "access_level"
end
click_button "Add users"
end
- Then 'I should see "Mike" in team list as "Reporter"' do
+ step 'I should see "Mike" in team list as "Reporter"' do
within ".access-reporter" do
page.should have_content('Mike')
end
end
- Given 'I should see "Sam" in team list as "Developer"' do
+ step 'I should see "Sam" in team list as "Developer"' do
within ".access-developer" do
page.should have_content('Sam')
end
end
- And 'I change "Sam" role to "Reporter"' do
+ step 'I change "Sam" role to "Reporter"' do
user = User.find_by(name: "Sam")
within "#user_#{user.id}" do
- select "Reporter", from: "team_member_project_access"
+ select "Reporter", from: "project_member_access_level"
end
end
- And 'I should see "Sam" in team list as "Reporter"' do
+ step 'I should see "Sam" in team list as "Reporter"' do
within ".access-reporter" do
page.should have_content('Sam')
end
end
- And 'I click link "Remove from team"' do
+ step 'I click link "Remove from team"' do
click_link "Remove from team"
end
- And 'I should not see "Sam" in team list' do
+ step 'I should not see "Sam" in team list' do
user = User.find_by(name: "Sam")
page.should_not have_content(user.name)
page.should_not have_content(user.username)
end
- And 'gitlab user "Mike"' do
+ step 'gitlab user "Mike"' do
create(:user, name: "Mike")
end
- And 'gitlab user "Sam"' do
+ step 'gitlab user "Sam"' do
create(:user, name: "Sam")
end
- And '"Sam" is "Shop" developer' do
+ step '"Sam" is "Shop" developer' do
user = User.find_by(name: "Sam")
project = Project.find_by(name: "Shop")
project.team << [user, :developer]
end
- Given 'I own project "Website"' do
+ step 'I own project "Website"' do
@project = create(:empty_project, name: "Website", namespace: @user.namespace)
@project.team << [@user, :master]
end
- And '"Mike" is "Website" reporter' do
+ step '"Mike" is "Website" reporter' do
user = User.find_by(name: "Mike")
project = Project.find_by(name: "Website")
project.team << [user, :reporter]
end
- And 'I click link "Import team from another project"' do
+ step 'I click link "Import team from another project"' do
click_link "Import members from another project"
end
diff --git a/features/steps/project/wiki.rb b/features/steps/project/wiki.rb
index 96f2505d24c..aa00818c602 100644
--- a/features/steps/project/wiki.rb
+++ b/features/steps/project/wiki.rb
@@ -4,23 +4,22 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps
include SharedNote
include SharedPaths
- Given 'I click on the Cancel button' do
+ step 'I click on the Cancel button' do
within(:css, ".form-actions") do
click_on "Cancel"
end
end
- Then 'I should be redirected back to the Edit Home Wiki page' do
- url = URI.parse(current_url)
- url.path.should == project_wiki_path(project, :home)
+ step 'I should be redirected back to the Edit Home Wiki page' do
+ current_path.should == project_wiki_path(project, :home)
end
- Given 'I create the Wiki Home page' do
+ step 'I create the Wiki Home page' do
fill_in "wiki_content", with: '[link test](test)'
click_on "Create page"
end
- Then 'I should see the newly created wiki page' do
+ step 'I should see the newly created wiki page' do
page.should have_content "Home"
page.should have_content "link test"
@@ -28,74 +27,73 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps
page.should have_content "Editing"
end
- Given 'I have an existing Wiki page' do
+ step 'I have an existing Wiki page' do
wiki.create_page("existing", "content", :markdown, "first commit")
@page = wiki.find_page("existing")
end
- And 'I browse to that Wiki page' do
+ step 'I browse to that Wiki page' do
visit project_wiki_path(project, @page)
end
- And 'I click on the Edit button' do
+ step 'I click on the Edit button' do
click_on "Edit"
end
- And 'I change the content' do
+ step 'I change the content' do
fill_in "Content", with: 'Updated Wiki Content'
click_on "Save changes"
end
- Then 'I should see the updated content' do
+ step 'I should see the updated content' do
page.should have_content "Updated Wiki Content"
end
- Then 'I should be redirected back to that Wiki page' do
- url = URI.parse(current_url)
- url.path.should == project_wiki_path(project, @page)
+ step 'I should be redirected back to that Wiki page' do
+ current_path.should == project_wiki_path(project, @page)
end
- And 'That page has two revisions' do
+ step 'That page has two revisions' do
@page.update("new content", :markdown, "second commit")
end
- And 'I click the History button' do
+ step 'I click the History button' do
click_on "History"
end
- Then 'I should see both revisions' do
+ step 'I should see both revisions' do
page.should have_content current_user.name
page.should have_content "first commit"
page.should have_content "second commit"
end
- And 'I click on the "Delete this page" button' do
+ step 'I click on the "Delete this page" button' do
click_on "Delete this page"
end
- Then 'The page should be deleted' do
+ step 'The page should be deleted' do
page.should have_content "Page was successfully deleted"
end
- And 'I click on the "Pages" button' do
+ step 'I click on the "Pages" button' do
click_on "Pages"
end
- Then 'I should see the existing page in the pages list' do
+ step 'I should see the existing page in the pages list' do
page.should have_content current_user.name
page.should have_content @page.title
end
- Given 'I have an existing Wiki page with images linked on page' do
+ step 'I have an existing Wiki page with images linked on page' do
wiki.create_page("pictures", "Look at this [image](image.jpg)\n\n ![image](image.jpg)", :markdown, "first commit")
@wiki_page = wiki.find_page("pictures")
end
- And 'I browse to wiki page with images' do
+ step 'I browse to wiki page with images' do
visit project_wiki_path(project, @wiki_page)
end
- And 'I click on existing image link' do
+ step 'I click on existing image link' do
file = Gollum::File.new(wiki.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")
@@ -103,26 +101,24 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps
click_on "image"
end
- Then 'I should see the image from wiki repo' do
- url = URI.parse(current_url)
- url.path.should match("wikis/image.jpg")
+ step 'I should see the image from wiki repo' do
+ current_path.should match('wikis/image.jpg')
page.should_not have_xpath('/html') # Page should render the image which means there is no html involved
Gollum::Wiki.any_instance.unstub(:file)
Gollum::File.any_instance.unstub(:mime_type)
end
- Then 'Image should be shown on the page' do
+ step 'Image should be shown on the page' do
page.should have_xpath("//img[@src=\"image.jpg\"]")
end
- And 'I click on image link' do
+ step 'I click on image link' do
page.should have_link('image', href: "image.jpg")
click_on "image"
end
- Then 'I should see the new wiki page form' do
- url = URI.parse(current_url)
- url.path.should match("wikis/image.jpg")
+ step 'I should see the new wiki page form' do
+ current_path.should match('wikis/image.jpg')
page.should have_content('New Wiki Page')
page.should have_content('Editing - image.jpg')
end
diff --git a/features/steps/search.rb b/features/steps/search.rb
new file mode 100644
index 00000000000..b1058989d0b
--- /dev/null
+++ b/features/steps/search.rb
@@ -0,0 +1,73 @@
+class Spinach::Features::Search < Spinach::FeatureSteps
+ include SharedAuthentication
+ include SharedPaths
+ include SharedProject
+
+ step 'I search for "Sho"' do
+ fill_in "dashboard_search", with: "Sho"
+ click_button "Search"
+ end
+
+ step 'I search for "Foo"' do
+ fill_in "dashboard_search", with: "Foo"
+ click_button "Search"
+ end
+
+ step 'I search for "rspec"' do
+ fill_in "dashboard_search", with: "rspec"
+ click_button "Search"
+ end
+
+ step 'I click "Issues" link' do
+ within '.search-filter' do
+ click_link 'Issues'
+ end
+ end
+
+ step 'I click project "Shop" link' do
+ within '.project-filter' do
+ click_link project.name_with_namespace
+ end
+ end
+
+ step 'I click "Merge requests" link' do
+ within '.search-filter' do
+ click_link 'Merge requests'
+ end
+ end
+
+ step 'I should see "Shop" project link' do
+ page.should have_link "Shop"
+ end
+
+ step 'I should see code results for project "Shop"' do
+ page.should have_content 'Update capybara, rspec-rails, poltergeist to recent versions'
+ end
+
+ step 'I search for "Contibuting"' do
+ fill_in "dashboard_search", with: "Contibuting"
+ click_button "Search"
+ end
+
+ step 'project has issues' do
+ create(:issue, title: "Foo", project: project)
+ create(:issue, title: "Bar", project: project)
+ end
+
+ step 'project has merge requests' do
+ create(:merge_request, title: "Foo", source_project: project, target_project: project)
+ create(:merge_request, :simple, title: "Bar", source_project: project, target_project: project)
+ end
+
+ step 'I should see "Foo" link' do
+ page.should have_link "Foo"
+ end
+
+ step 'I should not see "Bar" link' do
+ page.should_not have_link "Bar"
+ end
+
+ def project
+ @project ||= Project.find_by(name: "Shop")
+ end
+end
diff --git a/features/steps/shared/active_tab.rb b/features/steps/shared/active_tab.rb
index e3cd5fcfe85..f41b59a6f2b 100644
--- a/features/steps/shared/active_tab.rb
+++ b/features/steps/shared/active_tab.rb
@@ -2,26 +2,46 @@ module SharedActiveTab
include Spinach::DSL
def ensure_active_main_tab(content)
- page.find('.main-nav li.active').should have_content(content)
+ find('.main-nav li.active').should have_content(content)
end
def ensure_active_sub_tab(content)
- page.find('div.content ul.nav-tabs li.active').should have_content(content)
+ find('div.content ul.nav-tabs li.active').should have_content(content)
end
def ensure_active_sub_nav(content)
- page.find('div.content ul.nav-stacked-menu li.active').should have_content(content)
+ find('div.content ul.nav-stacked-menu li.active').should have_content(content)
end
- And 'no other main tabs should be active' do
+ step 'no other main tabs should be active' do
page.should have_selector('.main-nav li.active', count: 1)
end
- And 'no other sub tabs should be active' do
+ step 'no other sub tabs should be active' do
page.should have_selector('div.content ul.nav-tabs li.active', count: 1)
end
- And 'no other sub navs should be active' do
+ step 'no other sub navs should be active' do
page.should have_selector('div.content ul.nav-stacked-menu li.active', count: 1)
end
+
+ step 'the active main tab should be Home' do
+ ensure_active_main_tab('Activity')
+ end
+
+ step 'the active main tab should be Projects' do
+ ensure_active_main_tab('Projects')
+ end
+
+ step 'the active main tab should be Issues' do
+ ensure_active_main_tab('Issues')
+ end
+
+ step 'the active main tab should be Merge Requests' do
+ ensure_active_main_tab('Merge Requests')
+ end
+
+ step 'the active main tab should be Help' do
+ ensure_active_main_tab('Help')
+ end
end
diff --git a/features/steps/shared/admin.rb b/features/steps/shared/admin.rb
index 1b712dc6d04..b6072995677 100644
--- a/features/steps/shared/admin.rb
+++ b/features/steps/shared/admin.rb
@@ -1,11 +1,11 @@
module SharedAdmin
include Spinach::DSL
- And 'there are projects in system' do
+ step 'there are projects in system' do
2.times { create(:project) }
end
- And 'system has users' do
+ step 'system has users' do
2.times { create(:user) }
end
end
diff --git a/features/steps/shared/authentication.rb b/features/steps/shared/authentication.rb
index b48021dc146..ac8a3df6bb9 100644
--- a/features/steps/shared/authentication.rb
+++ b/features/steps/shared/authentication.rb
@@ -4,11 +4,11 @@ module SharedAuthentication
include Spinach::DSL
include LoginHelpers
- Given 'I sign in as a user' do
+ step 'I sign in as a user' do
login_as :user
end
- Given 'I sign in as an admin' do
+ step 'I sign in as an admin' do
login_as :admin
end
diff --git a/features/steps/shared/diff_note.rb b/features/steps/shared/diff_note.rb
index b107b083220..10f3ed90b56 100644
--- a/features/steps/shared/diff_note.rb
+++ b/features/steps/shared/diff_note.rb
@@ -2,24 +2,24 @@ module SharedDiffNote
include Spinach::DSL
include RepoHelpers
- Given 'I cancel the diff comment' do
+ step 'I cancel the diff comment' do
within(diff_file_selector) do
find(".js-close-discussion-note-form").click
end
end
- Given 'I delete a diff comment' do
+ step 'I delete a diff comment' do
find('.note').hover
find(".js-note-delete").click
end
- Given 'I haven\'t written any diff comment text' do
+ step 'I haven\'t written any diff comment text' do
within(diff_file_selector) do
fill_in "note[note]", with: ""
end
end
- Given 'I leave a diff comment like "Typo, please fix"' do
+ step 'I leave a diff comment like "Typo, please fix"' do
click_diff_line(sample_commit.line_code)
within("#{diff_file_selector} form[rel$='#{sample_commit.line_code}']") do
fill_in "note[note]", with: "Typo, please fix"
@@ -28,7 +28,7 @@ module SharedDiffNote
end
end
- Given 'I preview a diff comment text like "Should fix it :smile:"' do
+ step 'I preview a diff comment text like "Should fix it :smile:"' do
click_diff_line(sample_commit.line_code)
within("#{diff_file_selector} form[rel$='#{sample_commit.line_code}']") do
fill_in "note[note]", with: "Should fix it :smile:"
@@ -36,7 +36,7 @@ module SharedDiffNote
end
end
- Given 'I preview another diff comment text like "DRY this up"' do
+ step 'I preview another diff comment text like "DRY this up"' do
click_diff_line(sample_commit.del_line_code)
within("#{diff_file_selector} form[rel$='#{sample_commit.del_line_code}']") do
@@ -45,109 +45,109 @@ module SharedDiffNote
end
end
- Given 'I open a diff comment form' do
+ step 'I open a diff comment form' do
click_diff_line(sample_commit.line_code)
end
- Given 'I open another diff comment form' do
+ step 'I open another diff comment form' do
click_diff_line(sample_commit.del_line_code)
end
- Given 'I write a diff comment like ":-1: I don\'t like this"' do
+ step 'I write a diff comment like ":-1: I don\'t like this"' do
within(diff_file_selector) do
fill_in "note[note]", with: ":-1: I don\'t like this"
end
end
- Given 'I submit the diff comment' do
+ step 'I submit the diff comment' do
within(diff_file_selector) do
click_button("Add Comment")
end
end
- Then 'I should not see the diff comment form' do
+ step 'I should not see the diff comment form' do
within(diff_file_selector) do
page.should_not have_css("form.new_note")
end
end
- Then 'I should not see the diff comment preview button' do
+ step 'I should not see the diff comment preview button' do
within(diff_file_selector) do
page.should have_css(".js-note-preview-button", visible: false)
end
end
- Then 'I should not see the diff comment text field' do
+ step 'I should not see the diff comment text field' do
within(diff_file_selector) do
page.should have_css(".js-note-text", visible: false)
end
end
- Then 'I should only see one diff form' do
+ step 'I should only see one diff form' do
within(diff_file_selector) do
page.should have_css("form.new_note", count: 1)
end
end
- Then 'I should see a diff comment form with ":-1: I don\'t like this"' do
+ step 'I should see a diff comment form with ":-1: I don\'t like this"' do
within(diff_file_selector) do
page.should have_field("note[note]", with: ":-1: I don\'t like this")
end
end
- Then 'I should see a diff comment saying "Typo, please fix"' do
+ step 'I should see a diff comment saying "Typo, please fix"' do
within("#{diff_file_selector} .note") do
page.should have_content("Typo, please fix")
end
end
- Then 'I should see a discussion reply button' do
+ step 'I should see a discussion reply button' do
within(diff_file_selector) do
- page.should have_link("Reply")
+ page.should have_button('Reply')
end
end
- Then 'I should see a temporary diff comment form' do
+ step 'I should see a temporary diff comment form' do
within(diff_file_selector) do
page.should have_css(".js-temp-notes-holder form.new_note")
end
end
- Then 'I should see add a diff comment button' do
+ step 'I should see add a diff comment button' do
page.should have_css(".js-add-diff-note-button", visible: false)
end
- Then 'I should see an empty diff comment form' do
+ step 'I should see an empty diff comment form' do
within(diff_file_selector) do
page.should have_field("note[note]", with: "")
end
end
- Then 'I should see the cancel comment button' do
+ step 'I should see the cancel comment button' do
within("#{diff_file_selector} form") do
page.should have_css(".js-close-discussion-note-form", text: "Cancel")
end
end
- Then 'I should see the diff comment preview' do
+ step 'I should see the diff comment preview' do
within("#{diff_file_selector} form") do
page.should have_css(".js-note-preview", visible: false)
end
end
- Then 'I should see the diff comment edit button' do
+ step 'I should see the diff comment edit button' do
within(diff_file_selector) do
page.should have_css(".js-note-write-button", visible: true)
end
end
- Then 'I should see the diff comment preview button' do
+ step 'I should see the diff comment preview button' do
within(diff_file_selector) do
page.should have_css(".js-note-preview-button", visible: true)
end
end
- Then 'I should see two separate previews' do
+ step 'I should see two separate previews' do
within(diff_file_selector) do
page.should have_css(".js-note-preview", visible: true, count: 2)
page.should have_content("Should fix it")
@@ -160,6 +160,6 @@ module SharedDiffNote
end
def click_diff_line(code)
- find("a[data-line-code='#{code}']").click
+ find("button[data-line-code='#{code}']").click
end
end
diff --git a/features/steps/shared/markdown.rb b/features/steps/shared/markdown.rb
index 782f3f0920b..092f2fceb57 100644
--- a/features/steps/shared/markdown.rb
+++ b/features/steps/shared/markdown.rb
@@ -2,8 +2,8 @@ module SharedMarkdown
include Spinach::DSL
def header_should_have_correct_id_and_link(level, text, id, parent = ".wiki")
- page.find(:css, "#{parent} h#{level}##{id}").text.should == text
- page.find(:css, "#{parent} h#{level}##{id} > :last-child")[:href].should =~ /##{id}$/
+ find(:css, "#{parent} h#{level}##{id}").text.should == text
+ find(:css, "#{parent} h#{level}##{id} > :last-child")[:href].should =~ /##{id}$/
end
step 'Header "Description header" should have correct id and link' do
diff --git a/features/steps/shared/note.rb b/features/steps/shared/note.rb
index 1c52d4c72d8..4019fe3697a 100644
--- a/features/steps/shared/note.rb
+++ b/features/steps/shared/note.rb
@@ -1,18 +1,18 @@
module SharedNote
include Spinach::DSL
- Given 'I delete a comment' do
+ step 'I delete a comment' do
find('.note').hover
find(".js-note-delete").click
end
- Given 'I haven\'t written any comment text' do
+ step 'I haven\'t written any comment text' do
within(".js-main-target-form") do
fill_in "note[note]", with: ""
end
end
- Given 'I leave a comment like "XML attached"' do
+ step 'I leave a comment like "XML attached"' do
within(".js-main-target-form") do
fill_in "note[note]", with: "XML attached"
click_button "Add Comment"
@@ -20,84 +20,84 @@ module SharedNote
end
end
- Given 'I preview a comment text like "Bug fixed :smile:"' do
+ step 'I preview a comment text like "Bug fixed :smile:"' do
within(".js-main-target-form") do
fill_in "note[note]", with: "Bug fixed :smile:"
find(".js-note-preview-button").trigger("click")
end
end
- Given 'I submit the comment' do
+ step 'I submit the comment' do
within(".js-main-target-form") do
click_button "Add Comment"
end
end
- Given 'I write a comment like "Nice"' do
+ step 'I write a comment like "Nice"' do
within(".js-main-target-form") do
fill_in "note[note]", with: "Nice"
end
end
- Then 'I should not see a comment saying "XML attached"' do
+ step 'I should not see a comment saying "XML attached"' do
page.should_not have_css(".note")
end
- Then 'I should not see the cancel comment button' do
+ step 'I should not see the cancel comment button' do
within(".js-main-target-form") do
should_not have_link("Cancel")
end
end
- Then 'I should not see the comment preview' do
+ step 'I should not see the comment preview' do
within(".js-main-target-form") do
page.should have_css(".js-note-preview", visible: false)
end
end
- Then 'I should not see the comment preview button' do
+ step 'I should not see the comment preview button' do
within(".js-main-target-form") do
page.should have_css(".js-note-preview-button", visible: false)
end
end
- Then 'I should not see the comment text field' do
+ step 'I should not see the comment text field' do
within(".js-main-target-form") do
page.should have_css(".js-note-text", visible: false)
end
end
- Then 'I should see a comment saying "XML attached"' do
+ step 'I should see a comment saying "XML attached"' do
within(".note") do
page.should have_content("XML attached")
end
end
- Then 'I should see an empty comment text field' do
+ step 'I should see an empty comment text field' do
within(".js-main-target-form") do
page.should have_field("note[note]", with: "")
end
end
- Then 'I should see the comment edit button' do
+ step 'I should see the comment edit button' do
within(".js-main-target-form") do
page.should have_css(".js-note-write-button", visible: true)
end
end
- Then 'I should see the comment preview' do
+ step 'I should see the comment preview' do
within(".js-main-target-form") do
page.should have_css(".js-note-preview", visible: true)
end
end
- Then 'I should see the comment preview button' do
+ step 'I should see the comment preview button' do
within(".js-main-target-form") do
page.should have_css(".js-note-preview-button", visible: true)
end
end
- Then 'I should see comment "XML attached"' do
+ step 'I should see comment "XML attached"' do
within(".note") do
page.should have_content("XML attached")
end
diff --git a/features/steps/shared/paths.rb b/features/steps/shared/paths.rb
index 0d06383509f..babbef33ec4 100644
--- a/features/steps/shared/paths.rb
+++ b/features/steps/shared/paths.rb
@@ -269,6 +269,12 @@ module SharedPaths
visit project_tree_path(@project, "6d39438")
end
+ step 'I visit project source page for' \
+ ' "6d394385cf567f80a8fd85055db1ab4c5295806f"' do
+ visit project_tree_path(@project,
+ '6d394385cf567f80a8fd85055db1ab4c5295806f')
+ end
+
step 'I visit project tags page' do
visit project_tags_path(@project)
end
@@ -388,15 +394,15 @@ module SharedPaths
# Snippets
# ----------------------------------------
- Given 'I visit project "Shop" snippets page' do
+ step 'I visit project "Shop" snippets page' do
visit project_snippets_path(project)
end
- Given 'I visit snippets page' do
+ step 'I visit snippets page' do
visit snippets_path
end
- Given 'I visit new snippet page' do
+ step 'I visit new snippet page' do
visit new_snippet_path
end
@@ -412,7 +418,7 @@ module SharedPaths
# Errors
# ----------------------------------------
- Then 'page status code should be 404' do
- page.status_code.should == 404
+ step 'page status code should be 404' do
+ status_code.should == 404
end
end
diff --git a/features/steps/shared/project.rb b/features/steps/shared/project.rb
index c131976614f..4b833850a1c 100644
--- a/features/steps/shared/project.rb
+++ b/features/steps/shared/project.rb
@@ -2,33 +2,33 @@ module SharedProject
include Spinach::DSL
# Create a project without caring about what it's called
- And "I own a project" do
+ step "I own a project" do
@project = create(:project, namespace: @user.namespace)
@project.team << [@user, :master]
end
# Create a specific project called "Shop"
- And 'I own project "Shop"' do
+ step 'I own project "Shop"' do
@project = Project.find_by(name: "Shop")
@project ||= create(:project, name: "Shop", namespace: @user.namespace, snippets_enabled: true)
@project.team << [@user, :master]
end
# Create another specific project called "Forum"
- And 'I own project "Forum"' do
+ step 'I own project "Forum"' do
@project = Project.find_by(name: "Forum")
@project ||= create(:project, name: "Forum", namespace: @user.namespace, path: 'forum_project')
@project.team << [@user, :master]
end
# Create an empty project without caring about the name
- And 'I own an empty project' do
+ step 'I own an empty project' do
@project = create(:empty_project,
name: 'Empty Project', namespace: @user.namespace)
@project.team << [@user, :master]
end
- And 'project "Shop" has push event' do
+ step 'project "Shop" has push event' do
@project = Project.find_by(name: "Shop")
data = {
@@ -54,12 +54,12 @@ module SharedProject
)
end
- Then 'I should see project "Shop" activity feed' do
+ step 'I should see project "Shop" activity feed' do
project = Project.find_by(name: "Shop")
page.should have_content "#{@user.name} pushed new branch fix at #{project.name_with_namespace}"
end
- Then 'I should see project settings' do
+ step 'I should see project settings' do
current_path.should == edit_project_path(@project)
page.should have_content("Project name")
page.should have_content("Features:")
diff --git a/features/steps/shared/project_tab.rb b/features/steps/shared/project_tab.rb
new file mode 100644
index 00000000000..6aa4f1b20df
--- /dev/null
+++ b/features/steps/shared/project_tab.rb
@@ -0,0 +1,46 @@
+require_relative 'active_tab'
+
+module SharedProjectTab
+ include Spinach::DSL
+ include SharedActiveTab
+
+ step 'the active main tab should be Home' do
+ ensure_active_main_tab('Project')
+ end
+
+ step 'the active main tab should be Files' do
+ ensure_active_main_tab('Files')
+ end
+
+ step 'the active main tab should be Commits' do
+ ensure_active_main_tab('Commits')
+ end
+
+ step 'the active main tab should be Network' do
+ ensure_active_main_tab('Network')
+ end
+
+ step 'the active main tab should be Graphs' do
+ ensure_active_main_tab('Graphs')
+ end
+
+ step 'the active main tab should be Issues' do
+ ensure_active_main_tab('Issues')
+ end
+
+ step 'the active main tab should be Merge Requests' do
+ ensure_active_main_tab('Merge Requests')
+ end
+
+ step 'the active main tab should be Snippets' do
+ ensure_active_main_tab('Snippets')
+ end
+
+ step 'the active main tab should be Wiki' do
+ ensure_active_main_tab('Wiki')
+ end
+
+ step 'the active main tab should be Settings' do
+ ensure_active_main_tab('Settings')
+ end
+end
diff --git a/features/steps/shared/search.rb b/features/steps/shared/search.rb
new file mode 100644
index 00000000000..6c3d601763d
--- /dev/null
+++ b/features/steps/shared/search.rb
@@ -0,0 +1,11 @@
+module SharedSearch
+ include Spinach::DSL
+
+ def search_snippet_contents(query)
+ visit "/search?search=#{URI::encode(query)}&snippets=true&scope=snippet_blobs"
+ end
+
+ def search_snippet_titles(query)
+ visit "/search?search=#{URI::encode(query)}&snippets=true&scope=snippet_titles"
+ end
+end
diff --git a/features/steps/shared/shortcuts.rb b/features/steps/shared/shortcuts.rb
new file mode 100644
index 00000000000..bbb7afec0ad
--- /dev/null
+++ b/features/steps/shared/shortcuts.rb
@@ -0,0 +1,18 @@
+module SharedActiveTab
+ include Spinach::DSL
+
+ step 'I press "g" and "p"' do
+ find('body').native.send_key('g')
+ find('body').native.send_key('p')
+ end
+
+ step 'I press "g" and "i"' do
+ find('body').native.send_key('g')
+ find('body').native.send_key('i')
+ end
+
+ step 'I press "g" and "m"' do
+ find('body').native.send_key('g')
+ find('body').native.send_key('m')
+ end
+end
diff --git a/features/steps/shared/snippet.rb b/features/steps/shared/snippet.rb
index 543e43196a5..5a27e8750cf 100644
--- a/features/steps/shared/snippet.rb
+++ b/features/steps/shared/snippet.rb
@@ -1,7 +1,7 @@
module SharedSnippet
include Spinach::DSL
- And 'I have public "Personal snippet one" snippet' do
+ step 'I have public "Personal snippet one" snippet' do
create(:personal_snippet,
title: "Personal snippet one",
content: "Test content",
@@ -10,7 +10,7 @@ module SharedSnippet
author: current_user)
end
- And 'I have private "Personal snippet private" snippet' do
+ step 'I have private "Personal snippet private" snippet' do
create(:personal_snippet,
title: "Personal snippet private",
content: "Provate content",
@@ -18,4 +18,27 @@ module SharedSnippet
private: true,
author: current_user)
end
+ step 'I have a public many lined snippet' do
+ create(:personal_snippet,
+ title: 'Many lined snippet',
+ content: <<-END.gsub(/^\s+\|/, ''),
+ |line one
+ |line two
+ |line three
+ |line four
+ |line five
+ |line six
+ |line seven
+ |line eight
+ |line nine
+ |line ten
+ |line eleven
+ |line twelve
+ |line thirteen
+ |line fourteen
+ END
+ file_name: 'many_lined_snippet.rb',
+ private: true,
+ author: current_user)
+ end
end
diff --git a/features/steps/snippet_search.rb b/features/steps/snippet_search.rb
new file mode 100644
index 00000000000..669c7186c1b
--- /dev/null
+++ b/features/steps/snippet_search.rb
@@ -0,0 +1,56 @@
+class Spinach::Features::SnippetSearch < Spinach::FeatureSteps
+ include SharedAuthentication
+ include SharedPaths
+ include SharedSnippet
+ include SharedUser
+ include SharedSearch
+
+ step 'I search for "snippet" in snippet titles' do
+ search_snippet_titles 'snippet'
+ end
+
+ step 'I search for "snippet private" in snippet titles' do
+ search_snippet_titles 'snippet private'
+ end
+
+ step 'I search for "line seven" in snippet contents' do
+ search_snippet_contents 'line seven'
+ end
+
+ step 'I should see "line seven" in results' do
+ page.should have_content 'line seven'
+ end
+
+ step 'I should see "line four" in results' do
+ page.should have_content 'line four'
+ end
+
+ step 'I should see "line ten" in results' do
+ page.should have_content 'line ten'
+ end
+
+ step 'I should not see "line eleven" in results' do
+ page.should_not have_content 'line eleven'
+ end
+
+ step 'I should not see "line three" in results' do
+ page.should_not have_content 'line three'
+ end
+
+ step 'I should see "Personal snippet one" in results' do
+ page.should have_content 'Personal snippet one'
+ end
+
+ step 'I should see "Personal snippet private" in results' do
+ page.should have_content 'Personal snippet private'
+ end
+
+ step 'I should not see "Personal snippet one" in results' do
+ page.should_not have_content 'Personal snippet one'
+ end
+
+ step 'I should not see "Personal snippet private" in results' do
+ page.should_not have_content 'Personal snippet private'
+ end
+
+end
diff --git a/features/steps/snippets/discover.rb b/features/steps/snippets/discover.rb
index 09337937002..da73dfc68be 100644
--- a/features/steps/snippets/discover.rb
+++ b/features/steps/snippets/discover.rb
@@ -1,13 +1,13 @@
-class DiscoverSnippets < Spinach::FeatureSteps
+class Spinach::Features::DiscoverSnippets < Spinach::FeatureSteps
include SharedAuthentication
include SharedPaths
include SharedSnippet
- Then 'I should see "Personal snippet one" in snippets' do
+ step 'I should see "Personal snippet one" in snippets' do
page.should have_content "Personal snippet one"
end
- And 'I should not see "Personal snippet private" in snippets' do
+ step 'I should not see "Personal snippet private" in snippets' do
page.should_not have_content "Personal snippet private"
end
diff --git a/features/steps/snippets/snippets.rb b/features/steps/snippets/snippets.rb
index 040b5390a5a..e8154c8ce57 100644
--- a/features/steps/snippets/snippets.rb
+++ b/features/steps/snippets/snippets.rb
@@ -1,28 +1,28 @@
-class SnippetsFeature < Spinach::FeatureSteps
+class Spinach::Features::SnippetsFeature < Spinach::FeatureSteps
include SharedAuthentication
include SharedPaths
include SharedProject
include SharedSnippet
- Given 'I click link "Personal snippet one"' do
+ step 'I click link "Personal snippet one"' do
click_link "Personal snippet one"
end
- And 'I should not see "Personal snippet one" in snippets' do
+ step 'I should not see "Personal snippet one" in snippets' do
page.should_not have_content "Personal snippet one"
end
- And 'I click link "Edit"' do
+ step 'I click link "Edit"' do
within ".file-title" do
click_link "Edit"
end
end
- And 'I click link "Destroy"' do
+ step 'I click link "Destroy"' do
click_link "remove"
end
- And 'I submit new snippet "Personal snippet three"' do
+ step 'I submit new snippet "Personal snippet three"' do
fill_in "personal_snippet_title", :with => "Personal snippet three"
fill_in "personal_snippet_file_name", :with => "my_snippet.rb"
within('.file-editor') do
@@ -31,30 +31,30 @@ class SnippetsFeature < Spinach::FeatureSteps
click_button "Create snippet"
end
- Then 'I should see snippet "Personal snippet three"' do
+ step 'I should see snippet "Personal snippet three"' do
page.should have_content "Personal snippet three"
page.should have_content "Content of snippet three"
end
- And 'I submit new title "Personal snippet new title"' do
+ step 'I submit new title "Personal snippet new title"' do
fill_in "personal_snippet_title", :with => "Personal snippet new title"
click_button "Save"
end
- Then 'I should see "Personal snippet new title"' do
+ step 'I should see "Personal snippet new title"' do
page.should have_content "Personal snippet new title"
end
- And 'I uncheck "Private" checkbox' do
+ step 'I uncheck "Private" checkbox' do
choose "Public"
click_button "Save"
end
- Then 'I should see "Personal snippet one" public' do
+ step 'I should see "Personal snippet one" public' do
page.should have_no_xpath("//i[@class='public-snippet']")
end
- And 'I visit snippet page "Personal snippet one"' do
+ step 'I visit snippet page "Personal snippet one"' do
visit snippet_path(snippet)
end
diff --git a/features/steps/snippets/user.rb b/features/steps/snippets/user.rb
index 2d7ffc866e7..71a1952926f 100644
--- a/features/steps/snippets/user.rb
+++ b/features/steps/snippets/user.rb
@@ -1,35 +1,35 @@
-class UserSnippets < Spinach::FeatureSteps
+class Spinach::Features::UserSnippets < Spinach::FeatureSteps
include SharedAuthentication
include SharedPaths
include SharedSnippet
- Given 'I visit my snippets page' do
+ step 'I visit my snippets page' do
visit user_snippets_path(current_user)
end
- Then 'I should see "Personal snippet one" in snippets' do
+ step 'I should see "Personal snippet one" in snippets' do
page.should have_content "Personal snippet one"
end
- And 'I should see "Personal snippet private" in snippets' do
+ step 'I should see "Personal snippet private" in snippets' do
page.should have_content "Personal snippet private"
end
- Then 'I should not see "Personal snippet one" in snippets' do
+ step 'I should not see "Personal snippet one" in snippets' do
page.should_not have_content "Personal snippet one"
end
- And 'I should not see "Personal snippet private" in snippets' do
+ step 'I should not see "Personal snippet private" in snippets' do
page.should_not have_content "Personal snippet private"
end
- Given 'I click "Public" filter' do
+ step 'I click "Public" filter' do
within('.nav-stacked') do
click_link "Public"
end
end
- Given 'I click "Private" filter' do
+ step 'I click "Private" filter' do
within('.nav-stacked') do
click_link "Private"
end
diff --git a/features/steps/user.rb b/features/steps/user.rb
index 5fb248ffcbc..d6f05ecb2c7 100644
--- a/features/steps/user.rb
+++ b/features/steps/user.rb
@@ -5,6 +5,6 @@ class Spinach::Features::User < Spinach::FeatureSteps
include SharedProject
step 'I should see user "John Doe" page' do
- expect(page.title).to match(/^\s*John Doe/)
+ expect(title).to match(/^\s*John Doe/)
end
end
diff --git a/features/support/env.rb b/features/support/env.rb
index 22f28987fe3..4b76faab564 100644
--- a/features/support/env.rb
+++ b/features/support/env.rb
@@ -1,20 +1,20 @@
-require 'simplecov' unless ENV['CI']
+if ENV['SIMPLECOV']
+ require 'simplecov'
+end
-if ENV['TRAVIS']
+if ENV['COVERALLS']
require 'coveralls'
- Coveralls.wear!
+ Coveralls.wear_merged!('rails')
end
ENV['RAILS_ENV'] = 'test'
require './config/environment'
-
require 'rspec'
require 'rspec/expectations'
require 'database_cleaner'
require 'spinach/capybara'
require 'sidekiq/testing/inline'
-
%w(select2_helper test_env repo_helpers).each do |f|
require Rails.root.join('spec', 'support', f)
end
diff --git a/lib/api/branches.rb b/lib/api/branches.rb
index b32a4aa7bc2..14f8b20f6b2 100644
--- a/lib/api/branches.rb
+++ b/lib/api/branches.rb
@@ -14,7 +14,7 @@ module API
# Example Request:
# GET /projects/:id/repository/branches
get ":id/repository/branches" do
- present user_project.repo.heads.sort_by(&:name), with: Entities::RepoObject, project: user_project
+ present user_project.repository.branches.sort_by(&:name), with: Entities::RepoObject, project: user_project
end
# Get a single branch
@@ -25,7 +25,7 @@ module API
# Example Request:
# GET /projects/:id/repository/branches/:branch
get ':id/repository/branches/:branch', requirements: { branch: /.*/ } do
- @branch = user_project.repo.heads.find { |item| item.name == params[:branch] }
+ @branch = user_project.repository.branches.find { |item| item.name == params[:branch] }
not_found!("Branch does not exist") if @branch.nil?
present @branch, with: Entities::RepoObject, project: user_project
end
@@ -80,9 +80,15 @@ module API
# POST /projects/:id/repository/branches
post ":id/repository/branches" do
authorize_push_project
- @branch = CreateBranchService.new.execute(user_project, params[:branch_name], params[:ref], current_user)
-
- present @branch, with: Entities::RepoObject, project: user_project
+ result = CreateBranchService.new(user_project, current_user).
+ execute(params[:branch_name], params[:ref])
+ if result[:status] == :success
+ present result[:branch],
+ with: Entities::RepoObject,
+ project: user_project
+ else
+ render_api_error!(result[:message], 400)
+ end
end
# Delete branch
@@ -94,12 +100,13 @@ module API
# DELETE /projects/:id/repository/branches/:branch
delete ":id/repository/branches/:branch" do
authorize_push_project
- result = DeleteBranchService.new.execute(user_project, params[:branch], current_user)
+ result = DeleteBranchService.new(user_project, current_user).
+ execute(params[:branch])
- if result[:state] == :success
+ if result[:status] == :success
true
else
- render_api_error!(result[:message], 405)
+ render_api_error!(result[:message], result[:return_code])
end
end
end
diff --git a/lib/api/deploy_keys.rb b/lib/api/deploy_keys.rb
index 7f5a125038c..06eb7756841 100644
--- a/lib/api/deploy_keys.rb
+++ b/lib/api/deploy_keys.rb
@@ -58,7 +58,7 @@ module API
if key.valid? && user_project.deploy_keys << key
present key, with: Entities::SSHKey
else
- not_found!
+ render_validation_error!(key)
end
end
diff --git a/lib/api/entities.rb b/lib/api/entities.rb
index 74fdef93543..ffa3e8a149e 100644
--- a/lib/api/entities.rb
+++ b/lib/api/entities.rb
@@ -53,8 +53,8 @@ module API
end
class ProjectMember < UserBasic
- expose :project_access, as: :access_level do |user, options|
- options[:project].users_projects.find_by(user_id: user.id).project_access
+ expose :access_level do |user, options|
+ options[:project].project_members.find_by(user_id: user.id).access_level
end
end
@@ -67,8 +67,8 @@ module API
end
class GroupMember < UserBasic
- expose :group_access, as: :access_level do |user, options|
- options[:group].users_groups.find_by(user_id: user.id).group_access
+ expose :access_level do |user, options|
+ options[:group].group_members.find_by(user_id: user.id).access_level
end
end
@@ -170,24 +170,24 @@ module API
end
class ProjectAccess < Grape::Entity
- expose :project_access, as: :access_level
+ expose :access_level
expose :notification_level
end
class GroupAccess < Grape::Entity
- expose :group_access, as: :access_level
+ expose :access_level
expose :notification_level
end
class ProjectWithAccess < Project
expose :permissions do
expose :project_access, using: Entities::ProjectAccess do |project, options|
- project.users_projects.find_by(user_id: options[:user].id)
+ project.project_members.find_by(user_id: options[:user].id)
end
expose :group_access, using: Entities::GroupAccess do |project, options|
if project.group
- project.group.users_groups.find_by(user_id: options[:user].id)
+ project.group.group_members.find_by(user_id: options[:user].id)
end
end
end
diff --git a/lib/api/groups.rb b/lib/api/groups.rb
index caa2ca97a3e..4841e04689d 100644
--- a/lib/api/groups.rb
+++ b/lib/api/groups.rb
@@ -104,7 +104,7 @@ module API
# GET /groups/:id/members
get ":id/members" do
group = find_group(params[:id])
- members = group.users_groups
+ members = group.group_members
users = (paginate members).collect(&:user)
present users, with: Entities::GroupMember, group: group
end
@@ -123,11 +123,11 @@ module API
render_api_error!("Wrong access level", 422)
end
group = find_group(params[:id])
- if group.users_groups.find_by(user_id: params[:user_id])
+ if group.group_members.find_by(user_id: params[:user_id])
render_api_error!("Already exists", 409)
end
group.add_users([params[:user_id]], params[:access_level])
- member = group.users_groups.find_by(user_id: params[:user_id])
+ member = group.group_members.find_by(user_id: params[:user_id])
present member.user, with: Entities::GroupMember, group: group
end
@@ -141,7 +141,7 @@ module API
# DELETE /groups/:id/members/:user_id
delete ":id/members/:user_id" do
group = find_group(params[:id])
- member = group.users_groups.find_by(user_id: params[:user_id])
+ member = group.group_members.find_by(user_id: params[:user_id])
if member.nil?
render_api_error!("404 Not Found - user_id:#{params[:user_id]} not a member of group #{group.name}",404)
else
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb
index 6af0f6d1b25..3a619169eca 100644
--- a/lib/api/helpers.rb
+++ b/lib/api/helpers.rb
@@ -155,7 +155,17 @@ module API
end
def not_allowed!
- render_api_error!('Method Not Allowed', 405)
+ render_api_error!('405 Method Not Allowed', 405)
+ end
+
+ def conflict!(message = nil)
+ render_api_error!(message || '409 Conflict', 409)
+ end
+
+ def render_validation_error!(model)
+ unless model.valid?
+ render_api_error!(model.errors.messages || '400 Bad Request', 400)
+ end
end
def render_api_error!(message, status)
diff --git a/lib/api/internal.rb b/lib/api/internal.rb
index 5850892df07..5f484f63418 100644
--- a/lib/api/internal.rb
+++ b/lib/api/internal.rb
@@ -12,7 +12,9 @@ module API
# ref - branch name
# forced_push - forced_push
#
- get "/allowed" do
+ post "/allowed" do
+ status 200
+
# Check for *.wiki repositories.
# Strip out the .wiki from the pathname before finding the
# project. This applies the correct project permissions to
@@ -34,10 +36,7 @@ module API
actor,
params[:action],
project,
- params[:ref],
- params[:oldrev],
- params[:newrev],
- params[:forced_push]
+ params[:changes]
)
end
diff --git a/lib/api/issues.rb b/lib/api/issues.rb
index eb6a74cd2bc..30170c657ba 100644
--- a/lib/api/issues.rb
+++ b/lib/api/issues.rb
@@ -3,13 +3,41 @@ module API
class Issues < Grape::API
before { authenticate! }
+ helpers do
+ def filter_issues_state(issues, state = nil)
+ case state
+ when 'opened' then issues.opened
+ when 'closed' then issues.closed
+ else issues
+ end
+ end
+
+ def filter_issues_labels(issues, labels)
+ issues.includes(:labels).where("labels.title" => labels.split(','))
+ end
+ end
+
resource :issues do
# Get currently authenticated user's issues
#
- # Example Request:
+ # Parameters:
+ # state (optional) - Return "opened" or "closed" issues
+ # labels (optional) - Comma-separated list of label names
+
+ # Example Requests:
# GET /issues
+ # GET /issues?state=opened
+ # GET /issues?state=closed
+ # GET /issues?labels=foo
+ # GET /issues?labels=foo,bar
+ # GET /issues?labels=foo,bar&state=opened
get do
- present paginate(current_user.issues), with: Entities::Issue
+ issues = current_user.issues
+ issues = filter_issues_state(issues, params[:state]) unless params[:state].nil?
+ issues = filter_issues_labels(issues, params[:labels]) unless params[:labels].nil?
+ issues = issues.order('issues.id DESC')
+
+ present paginate(issues), with: Entities::Issue
end
end
@@ -18,10 +46,24 @@ module API
#
# Parameters:
# id (required) - The ID of a project
- # Example Request:
+ # state (optional) - Return "opened" or "closed" issues
+ # labels (optional) - Comma-separated list of label names
+ #
+ # Example Requests:
+ # GET /projects/:id/issues
+ # GET /projects/:id/issues?state=opened
+ # GET /projects/:id/issues?state=closed
# GET /projects/:id/issues
+ # GET /projects/:id/issues?labels=foo
+ # GET /projects/:id/issues?labels=foo,bar
+ # GET /projects/:id/issues?labels=foo,bar&state=opened
get ":id/issues" do
- present paginate(user_project.issues), with: Entities::Issue
+ issues = user_project.issues
+ issues = filter_issues_state(issues, params[:state]) unless params[:state].nil?
+ issues = filter_issues_labels(issues, params[:labels]) unless params[:labels].nil?
+ issues = issues.order('issues.id DESC')
+
+ present paginate(issues), with: Entities::Issue
end
# Get a single project issue
@@ -67,7 +109,7 @@ module API
present issue, with: Entities::Issue
else
- not_found!
+ render_validation_error!(issue)
end
end
@@ -107,7 +149,7 @@ module API
present issue, with: Entities::Issue
else
- not_found!
+ render_validation_error!(issue)
end
end
diff --git a/lib/api/labels.rb b/lib/api/labels.rb
index 2fdf53ffec2..78ca58ad0d1 100644
--- a/lib/api/labels.rb
+++ b/lib/api/labels.rb
@@ -30,16 +30,14 @@ module API
attrs = attributes_for_keys [:name, :color]
label = user_project.find_label(attrs[:name])
- if label
- return render_api_error!('Label already exists', 409)
- end
+ conflict!('Label already exists') if label
label = user_project.labels.create(attrs)
if label.valid?
present label, with: Entities::Label
else
- render_api_error!(label.errors.full_messages.join(', '), 400)
+ render_validation_error!(label)
end
end
@@ -56,9 +54,7 @@ module API
required_attributes! [:name]
label = user_project.find_label(params[:name])
- if !label
- return render_api_error!('Label not found', 404)
- end
+ not_found!('Label') unless label
label.destroy
end
@@ -66,10 +62,11 @@ module API
# Updates an existing label. At least one optional parameter is required.
#
# Parameters:
- # id (required) - The ID of a project
- # name (optional) - The name of the label to be deleted
- # color (optional) - Color of the label given in 6-digit hex
- # notation with leading '#' sign (e.g. #FFAABB)
+ # id (required) - The ID of a project
+ # name (required) - The name of the label to be deleted
+ # new_name (optional) - The new name of the label
+ # color (optional) - Color of the label given in 6-digit hex
+ # notation with leading '#' sign (e.g. #FFAABB)
# Example Request:
# PUT /projects/:id/labels
put ':id/labels' do
@@ -77,16 +74,14 @@ module API
required_attributes! [:name]
label = user_project.find_label(params[:name])
- if !label
- return render_api_error!('Label not found', 404)
- end
+ not_found!('Label not found') unless label
attrs = attributes_for_keys [:new_name, :color]
if attrs.empty?
- return render_api_error!('Required parameters "name" or "color" ' \
- 'missing',
- 400)
+ render_api_error!('Required parameters "new_name" or "color" ' \
+ 'missing',
+ 400)
end
# Rename new name to the actual label attribute name
@@ -95,7 +90,7 @@ module API
if label.update(attrs)
present label, with: Entities::Label
else
- render_api_error!(label.errors.full_messages.join(', '), 400)
+ render_validation_error!(label)
end
end
end
diff --git a/lib/api/merge_requests.rb b/lib/api/merge_requests.rb
index 8726379bf3c..a365f1db00f 100644
--- a/lib/api/merge_requests.rb
+++ b/lib/api/merge_requests.rb
@@ -10,8 +10,13 @@ module API
error!(errors[:project_access], 422)
elsif errors[:branch_conflict].any?
error!(errors[:branch_conflict], 422)
+ elsif errors[:validate_fork].any?
+ error!(errors[:validate_fork], 422)
+ elsif errors[:validate_branches].any?
+ conflict!(errors[:validate_branches])
end
- not_found!
+
+ render_api_error!(errors, 400)
end
end
@@ -25,6 +30,10 @@ module API
# GET /projects/:id/merge_requests
# GET /projects/:id/merge_requests?state=opened
# GET /projects/:id/merge_requests?state=closed
+ # GET /projects/:id/merge_requests?order_by=created_at
+ # GET /projects/:id/merge_requests?order_by=updated_at
+ # GET /projects/:id/merge_requests?sort=desc
+ # GET /projects/:id/merge_requests?sort=asc
#
get ":id/merge_requests" do
authorize! :read_merge_request, user_project
@@ -36,6 +45,16 @@ module API
else user_project.merge_requests
end
+ sort = case params["sort"]
+ when 'desc' then 'DESC'
+ else 'ASC'
+ end
+
+ mrs = case params["order_by"]
+ when 'updated_at' then mrs.order("updated_at #{sort}")
+ else mrs.order("created_at #{sort}")
+ end
+
present paginate(mrs), with: Entities::MergeRequest
end
@@ -214,7 +233,7 @@ module API
if note.save
present note, with: Entities::MRNote
else
- not_found!
+ render_validation_error!(note)
end
end
end
diff --git a/lib/api/project_members.rb b/lib/api/project_members.rb
index 47c4ddce163..1595ed0bc36 100644
--- a/lib/api/project_members.rb
+++ b/lib/api/project_members.rb
@@ -6,8 +6,8 @@ module API
resource :projects do
helpers do
def handle_project_member_errors(errors)
- if errors[:project_access].any?
- error!(errors[:project_access], 422)
+ if errors[:access_level].any?
+ error!(errors[:access_level], 422)
end
not_found!
end
@@ -56,9 +56,9 @@ module API
# either the user is already a team member or a new one
team_member = user_project.team_member_by_id(params[:user_id])
if team_member.nil?
- team_member = user_project.users_projects.new(
+ team_member = user_project.project_members.new(
user_id: params[:user_id],
- project_access: params[:access_level]
+ access_level: params[:access_level]
)
end
@@ -82,10 +82,10 @@ module API
authorize! :admin_project, user_project
required_attributes! [:access_level]
- team_member = user_project.users_projects.find_by(user_id: params[:user_id])
+ team_member = user_project.project_members.find_by(user_id: params[:user_id])
not_found!("User can not be found") if team_member.nil?
- if team_member.update_attributes(project_access: params[:access_level])
+ if team_member.update_attributes(access_level: params[:access_level])
@member = team_member.user
present @member, with: Entities::ProjectMember, project: user_project
else
@@ -102,7 +102,7 @@ module API
# DELETE /projects/:id/members/:user_id
delete ":id/members/:user_id" do
authorize! :admin_project, user_project
- team_member = user_project.users_projects.find_by(user_id: params[:user_id])
+ team_member = user_project.project_members.find_by(user_id: params[:user_id])
unless team_member.nil?
team_member.destroy
else
diff --git a/lib/api/project_snippets.rb b/lib/api/project_snippets.rb
index 8e09fff6843..0c2d282f785 100644
--- a/lib/api/project_snippets.rb
+++ b/lib/api/project_snippets.rb
@@ -56,7 +56,7 @@ module API
if @snippet.save
present @snippet, with: Entities::ProjectSnippet
else
- not_found!
+ render_validation_error!(@snippet)
end
end
@@ -80,7 +80,7 @@ module API
if @snippet.update_attributes attrs
present @snippet, with: Entities::ProjectSnippet
else
- not_found!
+ render_validation_error!(@snippet)
end
end
@@ -97,6 +97,7 @@ module API
authorize! :modify_project_snippet, @snippet
@snippet.destroy
rescue
+ not_found!('Snippet')
end
end
diff --git a/lib/api/projects.rb b/lib/api/projects.rb
index 55f7975bbf7..f555819df1b 100644
--- a/lib/api/projects.rb
+++ b/lib/api/projects.rb
@@ -111,7 +111,7 @@ module API
if @project.errors[:limit_reached].present?
error!(@project.errors[:limit_reached], 403)
end
- not_found!
+ render_validation_error!(@project)
end
end
@@ -149,7 +149,7 @@ module API
if @project.saved?
present @project, with: Entities::Project
else
- not_found!
+ render_validation_error!(@project)
end
end
diff --git a/lib/api/repositories.rb b/lib/api/repositories.rb
index 42068bb343d..626d99c2649 100644
--- a/lib/api/repositories.rb
+++ b/lib/api/repositories.rb
@@ -32,14 +32,22 @@ module API
# id (required) - The ID of a project
# tag_name (required) - The name of the tag
# ref (required) - Create tag from commit sha or branch
+ # message (optional) - Specifying a message creates an annotated tag.
# Example Request:
# POST /projects/:id/repository/tags
post ':id/repository/tags' do
authorize_push_project
- @tag = CreateTagService.new.execute(user_project, params[:tag_name],
- params[:ref], current_user)
-
- present @tag, with: Entities::RepoObject, project: user_project
+ message = params[:message] || nil
+ result = CreateTagService.new(user_project, current_user).
+ execute(params[:tag_name], params[:ref], message)
+
+ if result[:status] == :success
+ present result[:tag],
+ with: Entities::RepoObject,
+ project: user_project
+ else
+ render_api_error!(result[:message], 400)
+ end
end
# Get a project repository tree
diff --git a/lib/api/users.rb b/lib/api/users.rb
index 69553f16397..d07815a8a97 100644
--- a/lib/api/users.rb
+++ b/lib/api/users.rb
@@ -42,7 +42,8 @@ module API
# Parameters:
# email (required) - Email
# password (required) - Password
- # name - Name
+ # name (required) - Name
+ # username (required) - Name
# skype - Skype ID
# linkedin - Linkedin
# twitter - Twitter account
@@ -65,7 +66,15 @@ module API
if user.save
present user, with: Entities::UserFull
else
- not_found!
+ conflict!('Email has already been taken') if User.
+ where(email: user.email).
+ count > 0
+
+ conflict!('Username has already been taken') if User.
+ where(username: user.username).
+ count > 0
+
+ render_validation_error!(user)
end
end
@@ -92,14 +101,23 @@ module API
attrs = attributes_for_keys [:email, :name, :password, :skype, :linkedin, :twitter, :website_url, :projects_limit, :username, :extern_uid, :provider, :bio, :can_create_group, :admin]
user = User.find(params[:id])
- not_found!("User not found") unless user
+ not_found!('User') unless user
admin = attrs.delete(:admin)
user.admin = admin unless admin.nil?
+
+ conflict!('Email has already been taken') if attrs[:email] &&
+ User.where(email: attrs[:email]).
+ where.not(id: user.id).count > 0
+
+ conflict!('Username has already been taken') if attrs[:username] &&
+ User.where(username: attrs[:username]).
+ where.not(id: user.id).count > 0
+
if user.update_attributes(attrs)
present user, with: Entities::UserFull
else
- not_found!
+ render_validation_error!(user)
end
end
@@ -113,13 +131,15 @@ module API
# POST /users/:id/keys
post ":id/keys" do
authenticated_as_admin!
+ required_attributes! [:title, :key]
+
user = User.find(params[:id])
attrs = attributes_for_keys [:title, :key]
key = user.keys.new attrs
if key.save
present key, with: Entities::SSHKey
else
- not_found!
+ render_validation_error!(key)
end
end
@@ -132,11 +152,9 @@ module API
get ':uid/keys' do
authenticated_as_admin!
user = User.find_by(id: params[:uid])
- if user
- present user.keys, with: Entities::SSHKey
- else
- not_found!
- end
+ not_found!('User') unless user
+
+ present user.keys, with: Entities::SSHKey
end
# Delete existing ssh key of a specified user. Only available to admin
@@ -150,15 +168,13 @@ module API
delete ':uid/keys/:id' do
authenticated_as_admin!
user = User.find_by(id: params[:uid])
- if user
- begin
- key = user.keys.find params[:id]
- key.destroy
- rescue ActiveRecord::RecordNotFound
- not_found!
- end
- else
- not_found!
+ not_found!('User') unless user
+
+ begin
+ key = user.keys.find params[:id]
+ key.destroy
+ rescue ActiveRecord::RecordNotFound
+ not_found!('Key')
end
end
@@ -173,7 +189,7 @@ module API
if user
user.destroy
else
- not_found!
+ not_found!('User')
end
end
end
@@ -219,7 +235,7 @@ module API
if key.save
present key, with: Entities::SSHKey
else
- not_found!
+ render_validation_error!(key)
end
end
diff --git a/lib/backup/repository.rb b/lib/backup/repository.rb
index 6f7c4f7c909..ea05fa2c261 100644
--- a/lib/backup/repository.rb
+++ b/lib/backup/repository.rb
@@ -69,7 +69,7 @@ module Backup
end
print 'Put GitLab hooks in repositories dirs'.yellow
- if system("#{Gitlab.config.gitlab_shell.path}/support/rewrite-hooks.sh", Gitlab.config.gitlab_shell.repos_path)
+ if system("#{Gitlab.config.gitlab_shell.path}/bin/create-hooks")
puts " [DONE]".green
else
puts " [FAILED]".red
diff --git a/lib/gitlab/access.rb b/lib/gitlab/access.rb
index 87f9cfab608..411b2b9a3cc 100644
--- a/lib/gitlab/access.rb
+++ b/lib/gitlab/access.rb
@@ -16,6 +16,10 @@ module Gitlab
options.values
end
+ def all_values
+ options_with_owner.values
+ end
+
def options
{
"Guest" => GUEST,
diff --git a/lib/gitlab/backend/shell.rb b/lib/gitlab/backend/shell.rb
index 53bff3037e5..907373ab991 100644
--- a/lib/gitlab/backend/shell.rb
+++ b/lib/gitlab/backend/shell.rb
@@ -107,12 +107,17 @@ module Gitlab
# path - project path with namespace
# tag_name - new tag name
# ref - HEAD for new tag
+ # message - optional message for tag (annotated tag)
#
# Ex.
# add_tag("gitlab/gitlab-ci", "v4.0", "master")
+ # add_tag("gitlab/gitlab-ci", "v4.0", "master", "message")
#
- def add_tag(path, tag_name, ref)
- system "#{gitlab_shell_path}/bin/gitlab-projects", "create-tag", "#{path}.git", tag_name, ref
+ def add_tag(path, tag_name, ref, message = nil)
+ cmd = %W(#{gitlab_shell_path}/bin/gitlab-projects create-tag #{path}.git
+ #{tag_name} #{ref})
+ cmd << message unless message.nil? || message.empty?
+ system *cmd
end
# Remove repository tag
diff --git a/lib/gitlab/blacklist.rb b/lib/gitlab/blacklist.rb
index a47d120dd21..43145e0ee1b 100644
--- a/lib/gitlab/blacklist.rb
+++ b/lib/gitlab/blacklist.rb
@@ -26,6 +26,8 @@ module Gitlab
hooks
notes
unsubscribes
+ all
+ ci
)
end
end
diff --git a/lib/gitlab/diff/file.rb b/lib/gitlab/diff/file.rb
new file mode 100644
index 00000000000..4daf65331e8
--- /dev/null
+++ b/lib/gitlab/diff/file.rb
@@ -0,0 +1,49 @@
+module Gitlab
+ module Diff
+ class File
+ attr_reader :diff
+
+ delegate :new_file, :deleted_file, :renamed_file,
+ :old_path, :new_path, to: :diff, prefix: false
+
+ def initialize(diff)
+ @diff = diff
+ end
+
+ # Array of Gitlab::DIff::Line objects
+ def diff_lines
+ @lines ||= parser.parse(raw_diff.lines)
+ end
+
+ def mode_changed?
+ !!(diff.a_mode && diff.b_mode && diff.a_mode != diff.b_mode)
+ end
+
+ def parser
+ Gitlab::Diff::Parser.new
+ end
+
+ def raw_diff
+ diff.diff.to_s
+ end
+
+ def next_line(index)
+ diff_lines[index + 1]
+ end
+
+ def prev_line(index)
+ if index > 0
+ diff_lines[index - 1]
+ end
+ end
+
+ def file_path
+ if diff.new_path.present?
+ diff.new_path
+ elsif diff.old_path.present?
+ diff.old_path
+ end
+ end
+ end
+ end
+end
diff --git a/lib/gitlab/diff/line.rb b/lib/gitlab/diff/line.rb
new file mode 100644
index 00000000000..8ac1b15e88a
--- /dev/null
+++ b/lib/gitlab/diff/line.rb
@@ -0,0 +1,12 @@
+module Gitlab
+ module Diff
+ class Line
+ attr_reader :type, :text, :index, :old_pos, :new_pos
+
+ def initialize(text, type, index, old_pos, new_pos)
+ @text, @type, @index = text, type, index
+ @old_pos, @new_pos = old_pos, new_pos
+ end
+ end
+ end
+end
diff --git a/lib/gitlab/diff/line_code.rb b/lib/gitlab/diff/line_code.rb
new file mode 100644
index 00000000000..f3578ab3d35
--- /dev/null
+++ b/lib/gitlab/diff/line_code.rb
@@ -0,0 +1,9 @@
+module Gitlab
+ module Diff
+ class LineCode
+ def self.generate(file_path, new_line_position, old_line_position)
+ "#{Digest::SHA1.hexdigest(file_path)}_#{old_line_position}_#{new_line_position}"
+ end
+ end
+ end
+end
diff --git a/lib/gitlab/diff/parser.rb b/lib/gitlab/diff/parser.rb
new file mode 100644
index 00000000000..9d6309954a4
--- /dev/null
+++ b/lib/gitlab/diff/parser.rb
@@ -0,0 +1,81 @@
+module Gitlab
+ module Diff
+ class Parser
+ include Enumerable
+
+ def parse(lines)
+ @lines = lines,
+ lines_obj = []
+ line_obj_index = 0
+ line_old = 1
+ line_new = 1
+ type = nil
+
+ lines_arr = ::Gitlab::InlineDiff.processing lines
+
+ lines_arr.each do |line|
+ raw_line = line.dup
+
+ next if filename?(line)
+
+ full_line = html_escape(line.gsub(/\n/, ''))
+ full_line = ::Gitlab::InlineDiff.replace_markers full_line
+
+ if line.match(/^@@ -/)
+ type = "match"
+
+ line_old = line.match(/\-[0-9]*/)[0].to_i.abs rescue 0
+ line_new = line.match(/\+[0-9]*/)[0].to_i.abs rescue 0
+
+ next if line_old == 1 && line_new == 1 #top of file
+ lines_obj << Gitlab::Diff::Line.new(full_line, type, line_obj_index, line_old, line_new)
+ line_obj_index += 1
+ next
+ else
+ type = identification_type(line)
+ lines_obj << Gitlab::Diff::Line.new(full_line, type, line_obj_index, line_old, line_new)
+ line_obj_index += 1
+ end
+
+
+ if line[0] == "+"
+ line_new += 1
+ elsif line[0] == "-"
+ line_old += 1
+ else
+ line_new += 1
+ line_old += 1
+ end
+ end
+
+ lines_obj
+ end
+
+ def empty?
+ @lines.empty?
+ end
+
+ private
+
+ def filename?(line)
+ line.start_with?('--- /dev/null', '+++ /dev/null', '--- a', '+++ b',
+ '--- /tmp/diffy', '+++ /tmp/diffy')
+ end
+
+ def identification_type(line)
+ if line[0] == "+"
+ "new"
+ elsif line[0] == "-"
+ "old"
+ else
+ nil
+ end
+ end
+
+ def html_escape str
+ replacements = { '&' => '&amp;', '>' => '&gt;', '<' => '&lt;', '"' => '&quot;', "'" => '&#39;' }
+ str.gsub(/[&"'><]/, replacements)
+ end
+ end
+ end
+end
diff --git a/lib/gitlab/diff_parser.rb b/lib/gitlab/diff_parser.rb
deleted file mode 100644
index b244295027e..00000000000
--- a/lib/gitlab/diff_parser.rb
+++ /dev/null
@@ -1,83 +0,0 @@
-module Gitlab
- class DiffParser
- include Enumerable
-
- attr_reader :lines, :new_path
-
- def initialize(lines, new_path = '')
- @lines = lines
- @new_path = new_path
- end
-
- def each
- line_old = 1
- line_new = 1
- type = nil
-
- lines_arr = ::Gitlab::InlineDiff.processing lines
- lines_arr.each do |line|
- raw_line = line.dup
-
- next if filename?(line)
-
- full_line = html_escape(line.gsub(/\n/, ''))
- full_line = ::Gitlab::InlineDiff.replace_markers full_line
-
- if line.match(/^@@ -/)
- type = "match"
-
- line_old = line.match(/\-[0-9]*/)[0].to_i.abs rescue 0
- line_new = line.match(/\+[0-9]*/)[0].to_i.abs rescue 0
-
- next if line_old == 1 && line_new == 1 #top of file
- yield(full_line, type, nil, line_new, line_old)
- next
- else
- type = identification_type(line)
- line_code = generate_line_code(new_path, line_new, line_old)
- yield(full_line, type, line_code, line_new, line_old, raw_line)
- end
-
-
- if line[0] == "+"
- line_new += 1
- elsif line[0] == "-"
- line_old += 1
- else
- line_new += 1
- line_old += 1
- end
- end
- end
-
- def empty?
- @lines.empty?
- end
-
- private
-
- def filename?(line)
- line.start_with?('--- /dev/null', '+++ /dev/null', '--- a', '+++ b',
- '--- /tmp/diffy', '+++ /tmp/diffy')
- end
-
- def identification_type(line)
- if line[0] == "+"
- "new"
- elsif line[0] == "-"
- "old"
- else
- nil
- end
- end
-
- def generate_line_code(path, line_new, line_old)
- "#{Digest::SHA1.hexdigest(path)}_#{line_old}_#{line_new}"
- end
-
- def html_escape str
- replacements = { '&' => '&amp;', '>' => '&gt;', '<' => '&lt;', '"' => '&quot;', "'" => '&#39;' }
- str.gsub(/[&"'><]/, replacements)
- end
- end
-end
diff --git a/lib/gitlab/git_access.rb b/lib/gitlab/git_access.rb
index 38b3d82e2f4..6247dd59867 100644
--- a/lib/gitlab/git_access.rb
+++ b/lib/gitlab/git_access.rb
@@ -5,7 +5,7 @@ module Gitlab
attr_reader :params, :project, :git_cmd, :user
- def allowed?(actor, cmd, project, ref = nil, oldrev = nil, newrev = nil, forced_push = false)
+ def allowed?(actor, cmd, project, changes = nil)
case cmd
when *DOWNLOAD_COMMANDS
if actor.is_a? User
@@ -19,12 +19,12 @@ module Gitlab
end
when *PUSH_COMMANDS
if actor.is_a? User
- push_allowed?(actor, project, ref, oldrev, newrev, forced_push)
+ push_allowed?(actor, project, changes)
elsif actor.is_a? DeployKey
# Deploy key not allowed to push
return false
elsif actor.is_a? Key
- push_allowed?(actor.user, project, ref, oldrev, newrev, forced_push)
+ push_allowed?(actor.user, project, changes)
else
raise 'Wrong actor'
end
@@ -41,25 +41,48 @@ module Gitlab
end
end
- def push_allowed?(user, project, ref, oldrev, newrev, forced_push)
- if user && user_allowed?(user)
- action = if project.protected_branch?(ref)
+ def push_allowed?(user, project, changes)
+ return false unless user && user_allowed?(user)
+ return true if changes.blank?
+
+ changes = changes.lines if changes.kind_of?(String)
+
+ # Iterate over all changes to find if user allowed all of them to be applied
+ changes.each do |change|
+ oldrev, newrev, ref = change.split(' ')
+
+ action = if project.protected_branch?(branch_name(ref))
# we dont allow force push to protected branch
- if forced_push.to_s == 'true'
+ if forced_push?(project, oldrev, newrev)
:force_push_code_to_protected_branches
- # and we dont allow remove of protected branch
+ # and we dont allow remove of protected branch
elsif newrev =~ /0000000/
:remove_protected_branches
else
:push_code_to_protected_branches
end
- elsif project.repository && project.repository.tag_names.include?(ref)
+ elsif project.repository && project.repository.tag_names.include?(tag_name(ref))
# Prevent any changes to existing git tag unless user has permissions
:admin_project
else
:push_code
end
- user.can?(action, project)
+ unless user.can?(action, project)
+ # If user does not have access to make at least one change - cancel all push
+ return false
+ end
+ end
+
+ # If user has access to make all changes
+ true
+ end
+
+ def forced_push?(project, oldrev, newrev)
+ return false if project.empty_repo?
+
+ if oldrev !~ /00000000/ && newrev !~ /00000000/
+ missed_refs = IO.popen(%W(git --git-dir=#{project.repository.path_to_repo} rev-list #{oldrev} ^#{newrev})).read
+ missed_refs.split("\n").size > 0
else
false
end
@@ -70,5 +93,23 @@ module Gitlab
def user_allowed?(user)
Gitlab::UserAccess.allowed?(user)
end
+
+ def branch_name(ref)
+ ref = ref.to_s
+ if ref.start_with?('refs/heads')
+ ref.sub(%r{\Arefs/heads/}, '')
+ else
+ nil
+ end
+ end
+
+ def tag_name(ref)
+ ref = ref.to_s
+ if ref.start_with?('refs/tags')
+ ref.sub(%r{\Arefs/tags/}, '')
+ else
+ nil
+ end
+ end
end
end
diff --git a/lib/gitlab/git_ref_validator.rb b/lib/gitlab/git_ref_validator.rb
new file mode 100644
index 00000000000..13cb08948bb
--- /dev/null
+++ b/lib/gitlab/git_ref_validator.rb
@@ -0,0 +1,11 @@
+module Gitlab
+ module GitRefValidator
+ extend self
+ # Validates a given name against the git reference specification
+ #
+ # Returns true for a valid reference name, false otherwise
+ def validate(ref_name)
+ system *%W(git check-ref-format refs/#{ref_name})
+ end
+ end
+end
diff --git a/lib/gitlab/graphs/commits.rb b/lib/gitlab/graphs/commits.rb
new file mode 100644
index 00000000000..2122339d2db
--- /dev/null
+++ b/lib/gitlab/graphs/commits.rb
@@ -0,0 +1,49 @@
+module Gitlab
+ module Graphs
+ class Commits
+ attr_reader :commits, :start_date, :end_date, :duration,
+ :commits_per_week_days, :commits_per_time, :commits_per_month
+
+ def initialize(commits)
+ @commits = commits
+ @start_date = commits.last.committed_date.to_date
+ @end_date = commits.first.committed_date.to_date
+ @duration = (@end_date - @start_date).to_i
+
+ collect_data
+ end
+
+ def authors
+ @authors ||= @commits.map(&:author_email).uniq.size
+ end
+
+ def commit_per_day
+ @commit_per_day ||= (@commits.size.to_f / @duration).round(1)
+ end
+
+ def collect_data
+ @commits_per_week_days = {}
+ Date::DAYNAMES.each { |day| @commits_per_week_days[day] = 0 }
+
+ @commits_per_time = {}
+ (0..23).to_a.each { |hour| @commits_per_time[hour] = 0 }
+
+ @commits_per_month = {}
+ (1..31).to_a.each { |day| @commits_per_month[day] = 0 }
+
+ @commits.each do |commit|
+ hour = commit.committed_date.strftime('%k').to_i
+ day_of_month = commit.committed_date.strftime('%e').to_i
+ weekday = commit.committed_date.strftime('%A')
+
+ @commits_per_week_days[weekday] ||= 0
+ @commits_per_week_days[weekday] += 1
+ @commits_per_time[hour] ||= 0
+ @commits_per_time[hour] += 1
+ @commits_per_month[day_of_month] ||= 0
+ @commits_per_month[day_of_month] += 1
+ end
+ end
+ end
+ end
+end
diff --git a/lib/gitlab/ldap/access.rb b/lib/gitlab/ldap/access.rb
index 62709a12942..c054b6f5865 100644
--- a/lib/gitlab/ldap/access.rb
+++ b/lib/gitlab/ldap/access.rb
@@ -28,7 +28,7 @@ module Gitlab
def allowed?(user)
if Gitlab::LDAP::Person.find_by_dn(user.extern_uid, adapter)
- !Gitlab::LDAP::Person.active_directory_disabled?(user.extern_uid, adapter)
+ !Gitlab::LDAP::Person.disabled_via_active_directory?(user.extern_uid, adapter)
else
false
end
diff --git a/lib/gitlab/ldap/adapter.rb b/lib/gitlab/ldap/adapter.rb
index ca239bea884..68ac1b22909 100644
--- a/lib/gitlab/ldap/adapter.rb
+++ b/lib/gitlab/ldap/adapter.rb
@@ -86,7 +86,8 @@ module Gitlab
end
def dn_matches_filter?(dn, filter)
- ldap_search(base: dn, filter: filter, scope: Net::LDAP::SearchScope_BaseObject, attributes: %w{dn}).any?
+ ldap_search(base: dn, filter: filter,
+ scope: Net::LDAP::SearchScope_BaseObject, attributes: %w{dn}).any?
end
def ldap_search(*args)
diff --git a/lib/gitlab/ldap/person.rb b/lib/gitlab/ldap/person.rb
index 9ad6618bd46..87c3d711db4 100644
--- a/lib/gitlab/ldap/person.rb
+++ b/lib/gitlab/ldap/person.rb
@@ -16,7 +16,7 @@ module Gitlab
adapter.user('dn', dn)
end
- def self.active_directory_disabled?(dn, adapter=nil)
+ def self.disabled_via_active_directory?(dn, adapter=nil)
adapter ||= Gitlab::LDAP::Adapter.new
adapter.dn_matches_filter?(dn, AD_USER_DISABLED)
end
diff --git a/lib/gitlab/ldap/user.rb b/lib/gitlab/ldap/user.rb
index be3fcc4f035..25b5a702f9a 100644
--- a/lib/gitlab/ldap/user.rb
+++ b/lib/gitlab/ldap/user.rb
@@ -10,52 +10,20 @@ module Gitlab
module LDAP
class User < Gitlab::OAuth::User
class << self
- def find_or_create(auth)
- @auth = auth
-
- if uid.blank? || email.blank? || username.blank?
- raise_error("Account must provide a dn, uid and email address")
- end
-
- user = find(auth)
-
- unless user
- # Look for user with same emails
- #
- # Possible cases:
- # * When user already has account and need to link their LDAP account.
- # * LDAP uid changed for user with same email and we need to update their uid
- #
- user = find_user(email)
-
- if user
- user.update_attributes(extern_uid: uid, provider: provider)
- log.info("(LDAP) Updating legacy LDAP user #{email} with extern_uid => #{uid}")
- else
- # Create a new user inside GitLab database
- # based on LDAP credentials
- #
- #
- user = create(auth)
- end
- end
-
- user
+ def find_or_create(auth_hash)
+ self.auth_hash = auth_hash
+ find(auth_hash) || find_and_connect_by_email(auth_hash) || create(auth_hash)
end
- def find_user(email)
- user = model.find_by(email: email)
+ def find_and_connect_by_email(auth_hash)
+ self.auth_hash = auth_hash
+ user = model.find_by(email: self.auth_hash.email)
- # If no user found and allow_username_or_email_login is true
- # we look for user by extracting part of their email
- if !user && email && ldap_conf['allow_username_or_email_login']
- uname = email.partition('@').first
- # Strip apostrophes since they are disallowed as part of username
- username = uname.gsub("'", "")
- user = model.find_by(username: username)
+ if user
+ user.update_attributes(extern_uid: auth_hash.uid, provider: auth_hash.provider)
+ Gitlab::AppLogger.info("(LDAP) Updating legacy LDAP user #{self.auth_hash.email} with extern_uid => #{auth_hash.uid}")
+ return user
end
-
- user
end
def authenticate(login, password)
@@ -63,17 +31,8 @@ module Gitlab
# Only check with valid login and password to prevent anonymous bind results
return nil unless ldap_conf.enabled && login.present? && password.present?
- ldap = OmniAuth::LDAP::Adaptor.new(ldap_conf)
- filter = Net::LDAP::Filter.eq(ldap.uid, login)
-
- # Apply LDAP user filter if present
- if ldap_conf['user_filter'].present?
- user_filter = Net::LDAP::Filter.construct(ldap_conf['user_filter'])
- filter = Net::LDAP::Filter.join(filter, user_filter)
- end
-
- ldap_user = ldap.bind_as(
- filter: filter,
+ ldap_user = adapter.bind_as(
+ filter: user_filter(login),
size: 1,
password: password
)
@@ -81,10 +40,14 @@ module Gitlab
find_by_uid(ldap_user.dn) if ldap_user
end
- private
+ def adapter
+ @adapter ||= OmniAuth::LDAP::Adaptor.new(ldap_conf)
+ end
+
+ protected
def find_by_uid_and_provider
- find_by_uid(uid)
+ find_by_uid(auth_hash.uid)
end
def find_by_uid(uid)
@@ -92,10 +55,6 @@ module Gitlab
model.where("provider = ? and lower(extern_uid) = ?", provider, uid.downcase).last
end
- def username
- auth.info.nickname.to_s.force_encoding("utf-8")
- end
-
def provider
'ldap'
end
@@ -107,6 +66,20 @@ module Gitlab
def ldap_conf
Gitlab.config.ldap
end
+
+ def user_filter(login)
+ filter = Net::LDAP::Filter.eq(adapter.uid, login)
+ # Apply LDAP user filter if present
+ if ldap_conf['user_filter'].present?
+ user_filter = Net::LDAP::Filter.construct(ldap_conf['user_filter'])
+ filter = Net::LDAP::Filter.join(filter, user_filter)
+ end
+ filter
+ end
+ end
+
+ def needs_blocking?
+ false
end
end
end
diff --git a/lib/gitlab/markdown.rb b/lib/gitlab/markdown.rb
index b248d8f9436..6017a4c86c1 100644
--- a/lib/gitlab/markdown.rb
+++ b/lib/gitlab/markdown.rb
@@ -192,8 +192,12 @@ module Gitlab
link_to("##{identifier}", url, options)
end
- elsif project.issues_tracker == 'jira'
- reference_jira_issue(identifier, project)
+ else
+ config = Gitlab.config
+ external_issue_tracker = config.issues_tracker[project.issues_tracker]
+ if external_issue_tracker.present?
+ reference_external_issue(identifier, external_issue_tracker, project)
+ end
end
end
@@ -229,15 +233,15 @@ module Gitlab
end
end
- def reference_jira_issue(identifier, project = @project)
- url = url_for_issue(identifier)
- title = Gitlab.config.issues_tracker[project.issues_tracker]["title"]
+ def reference_external_issue(identifier, issue_tracker, project = @project)
+ url = url_for_issue(identifier, project)
+ title = issue_tracker['title']
options = html_options.merge(
title: "Issue in #{title}",
class: "gfm gfm-issue #{html_options[:class]}"
)
- link_to("#{identifier}", url, options)
+ link_to("##{identifier}", url, options)
end
end
end
diff --git a/lib/gitlab/oauth/auth_hash.rb b/lib/gitlab/oauth/auth_hash.rb
new file mode 100644
index 00000000000..0198f61f427
--- /dev/null
+++ b/lib/gitlab/oauth/auth_hash.rb
@@ -0,0 +1,54 @@
+# Class to parse and transform the info provided by omniauth
+#
+module Gitlab
+ module OAuth
+ class AuthHash
+ attr_reader :auth_hash
+ def initialize(auth_hash)
+ @auth_hash = auth_hash
+ end
+
+ def uid
+ auth_hash.uid.to_s
+ end
+
+ def provider
+ auth_hash.provider
+ end
+
+ def info
+ auth_hash.info
+ end
+
+ def name
+ (info.name || full_name).to_s.force_encoding('utf-8')
+ end
+
+ def full_name
+ "#{info.first_name} #{info.last_name}"
+ end
+
+ def username
+ (info.try(:nickname) || generate_username).to_s.force_encoding('utf-8')
+ end
+
+ def email
+ (info.try(:email) || generate_temporarily_email).downcase
+ end
+
+ def password
+ @password ||= Devise.friendly_token[0, 8].downcase
+ end
+
+ # Get the first part of the email address (before @)
+ # In addtion in removes illegal characters
+ def generate_username
+ email.match(/^[^@]*/)[0].parameterize
+ end
+
+ def generate_temporarily_email
+ "temp-email-for-oauth-#{username}@gitlab.localhost"
+ end
+ end
+ end
+end
diff --git a/lib/gitlab/oauth/user.rb b/lib/gitlab/oauth/user.rb
index 0056eb3a28b..b768eda185f 100644
--- a/lib/gitlab/oauth/user.rb
+++ b/lib/gitlab/oauth/user.rb
@@ -7,106 +7,78 @@ module Gitlab
module OAuth
class User
class << self
- attr_reader :auth
+ attr_reader :auth_hash
- def find(auth)
- @auth = auth
+ def find(auth_hash)
+ self.auth_hash = auth_hash
find_by_uid_and_provider
end
- def create(auth)
- @auth = auth
- password = Devise.friendly_token[0, 8].downcase
- opts = {
- extern_uid: uid,
- provider: provider,
- name: name,
- username: username,
- email: email,
- password: password,
- password_confirmation: password,
- }
-
- user = model.build_user(opts)
- user.skip_confirmation!
-
- # Services like twitter and github does not return email via oauth
- # In this case we generate temporary email and force user to fill it later
- if user.email.blank?
- user.generate_tmp_oauth_email
- elsif provider != "ldap"
- # Google oauth returns email but dont return nickname
- # So we use part of email as username for new user
- # For LDAP, username is already set to the user's
- # uid/userid/sAMAccountName.
- email_username = email.match(/^[^@]*/)[0]
- # Strip apostrophes since they are disallowed as part of username
- user.username = email_username.gsub("'", "")
- end
-
- begin
- user.save!
- rescue ActiveRecord::RecordInvalid => e
- log.info "(OAuth) Email #{e.record.errors[:email]}. Username #{e.record.errors[:username]}"
- return nil, e.record.errors
- end
-
- log.info "(OAuth) Creating user #{email} from login with extern_uid => #{uid}"
-
- if Gitlab.config.omniauth['block_auto_created_users'] && !ldap?
- user.block
- end
+ def create(auth_hash)
+ user = new(auth_hash)
+ user.save_and_trigger_callbacks
+ end
- user
+ def model
+ ::User
end
- private
+ def auth_hash=(auth_hash)
+ @auth_hash = AuthHash.new(auth_hash)
+ end
+ protected
def find_by_uid_and_provider
- model.where(provider: provider, extern_uid: uid).last
+ model.where(provider: auth_hash.provider, extern_uid: auth_hash.uid).last
end
+ end
- def uid
- uid = auth.info.uid || auth.uid
- uid = uid.to_s unless uid.nil?
- uid
- end
+ # Instance methods
+ attr_accessor :auth_hash, :user
- def email
- auth.info.email.downcase unless auth.info.email.nil?
- end
+ def initialize(auth_hash)
+ self.auth_hash = auth_hash
+ self.user = self.class.model.new(user_attributes)
+ user.skip_confirmation!
+ end
- def name
- if auth.info.name.nil?
- "#{auth.info.first_name} #{auth.info.last_name}".force_encoding('utf-8')
- else
- auth.info.name.to_s.force_encoding('utf-8')
- end
- end
+ def auth_hash=(auth_hash)
+ @auth_hash = AuthHash.new(auth_hash)
+ end
- def username
- auth.info.nickname.to_s.force_encoding("utf-8")
- end
+ def save_and_trigger_callbacks
+ user.save!
+ log.info "(OAuth) Creating user #{auth_hash.email} from login with extern_uid => #{auth_hash.uid}"
+ user.block if needs_blocking?
- def provider
- auth.provider
- end
+ user
+ rescue ActiveRecord::RecordInvalid => e
+ log.info "(OAuth) Email #{e.record.errors[:email]}. Username #{e.record.errors[:username]}"
+ return nil, e.record.errors
+ end
- def log
- Gitlab::AppLogger
- end
+ def user_attributes
+ {
+ extern_uid: auth_hash.uid,
+ provider: auth_hash.provider,
+ name: auth_hash.name,
+ username: auth_hash.username,
+ email: auth_hash.email,
+ password: auth_hash.password,
+ password_confirmation: auth_hash.password,
+ }
+ end
- def model
- ::User
- end
+ def log
+ Gitlab::AppLogger
+ end
- def raise_error(message)
- raise OmniAuth::Error, "(OAuth) " + message
- end
+ def raise_error(message)
+ raise OmniAuth::Error, "(OAuth) " + message
+ end
- def ldap?
- provider == 'ldap'
- end
+ def needs_blocking?
+ Gitlab.config.omniauth['block_auto_created_users']
end
end
end
diff --git a/lib/gitlab/project_search_results.rb b/lib/gitlab/project_search_results.rb
new file mode 100644
index 00000000000..8b85f3da83f
--- /dev/null
+++ b/lib/gitlab/project_search_results.rb
@@ -0,0 +1,77 @@
+module Gitlab
+ class ProjectSearchResults < SearchResults
+ attr_reader :project, :repository_ref
+
+ def initialize(project_id, query, repository_ref = nil)
+ @project = Project.find(project_id)
+ @repository_ref = if repository_ref.present?
+ repository_ref
+ else
+ nil
+ end
+ @query = Shellwords.shellescape(query) if query.present?
+ end
+
+ def objects(scope, page = nil)
+ case scope
+ when 'notes'
+ notes.page(page).per(per_page)
+ when 'blobs'
+ Kaminari.paginate_array(blobs).page(page).per(per_page)
+ when 'wiki_blobs'
+ Kaminari.paginate_array(wiki_blobs).page(page).per(per_page)
+ else
+ super
+ end
+ end
+
+ def total_count
+ @total_count ||= issues_count + merge_requests_count + blobs_count +
+ notes_count + wiki_blobs_count
+ end
+
+ def blobs_count
+ @blobs_count ||= blobs.count
+ end
+
+ def notes_count
+ @notes_count ||= notes.count
+ end
+
+ def wiki_blobs_count
+ @wiki_blobs_count ||= wiki_blobs.count
+ end
+
+ private
+
+ def blobs
+ if project.empty_repo? || query.blank?
+ []
+ else
+ project.repository.search_files(query, repository_ref)
+ end
+ end
+
+ def wiki_blobs
+ if project.wiki_enabled? && query.present?
+ project_wiki = ProjectWiki.new(project)
+
+ unless project_wiki.empty?
+ project_wiki.search_files(query)
+ else
+ []
+ end
+ else
+ []
+ end
+ end
+
+ def notes
+ Note.where(project_id: limit_project_ids).search(query).order('updated_at DESC')
+ end
+
+ def limit_project_ids
+ [project.id]
+ end
+ end
+end
diff --git a/lib/gitlab/satellite/merge_action.rb b/lib/gitlab/satellite/merge_action.rb
index 7c9b2294647..e9141f735aa 100644
--- a/lib/gitlab/satellite/merge_action.rb
+++ b/lib/gitlab/satellite/merge_action.rb
@@ -65,15 +65,16 @@ module Gitlab
prepare_satellite!(merge_repo)
update_satellite_source_and_target!(merge_repo)
if merge_request.for_fork?
- # 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"
- common_commit = merge_repo.git.native(:merge_base, default_options, ["origin/#{merge_request.target_branch}", "source/#{merge_request.source_branch}"]).strip
- diffs = merge_repo.diff(common_commit, "source/#{merge_request.source_branch}")
+ repository = Gitlab::Git::Repository.new(merge_repo.path)
+ diffs = Gitlab::Git::Diff.between(
+ repository,
+ "source/#{merge_request.source_branch}",
+ "origin/#{merge_request.target_branch}"
+ )
else
raise "Attempt to determine diffs between for a non forked merge request in satellite MergeRequest.id:[#{merge_request.id}]"
end
- diffs = diffs.map { |diff| Gitlab::Git::Diff.new(diff) }
+
return diffs
end
rescue Grit::Git::CommandFailed => ex
@@ -97,11 +98,16 @@ module Gitlab
prepare_satellite!(merge_repo)
update_satellite_source_and_target!(merge_repo)
if (merge_request.for_fork?)
- commits = merge_repo.commits_between("origin/#{merge_request.target_branch}", "source/#{merge_request.source_branch}")
+ repository = Gitlab::Git::Repository.new(merge_repo.path)
+ commits = Gitlab::Git::Commit.between(
+ repository,
+ "origin/#{merge_request.target_branch}",
+ "source/#{merge_request.source_branch}"
+ )
else
raise "Attempt to determine commits between for a non forked merge request in satellite MergeRequest.id:[#{merge_request.id}]"
end
- commits = commits.map { |commit| Gitlab::Git::Commit.new(commit, nil) }
+
return commits
end
rescue Grit::Git::CommandFailed => ex
diff --git a/lib/gitlab/search_results.rb b/lib/gitlab/search_results.rb
new file mode 100644
index 00000000000..75a3dfe37c3
--- /dev/null
+++ b/lib/gitlab/search_results.rb
@@ -0,0 +1,69 @@
+module Gitlab
+ class SearchResults
+ attr_reader :query
+
+ # Limit search results by passed project ids
+ # It allows us to search only for projects user has access to
+ attr_reader :limit_project_ids
+
+ def initialize(limit_project_ids, query)
+ @limit_project_ids = limit_project_ids || Project.all
+ @query = Shellwords.shellescape(query) if query.present?
+ end
+
+ def objects(scope, page = nil)
+ case scope
+ when 'projects'
+ projects.page(page).per(per_page)
+ when 'issues'
+ issues.page(page).per(per_page)
+ when 'merge_requests'
+ merge_requests.page(page).per(per_page)
+ else
+ Kaminari.paginate_array([]).page(page).per(per_page)
+ end
+ end
+
+ def total_count
+ @total_count ||= projects_count + issues_count + merge_requests_count
+ end
+
+ def projects_count
+ @projects_count ||= projects.count
+ end
+
+ def issues_count
+ @issues_count ||= issues.count
+ end
+
+ def merge_requests_count
+ @merge_requests_count ||= merge_requests.count
+ end
+
+ def empty?
+ total_count.zero?
+ end
+
+ private
+
+ def projects
+ Project.where(id: limit_project_ids).search(query)
+ end
+
+ def issues
+ Issue.where(project_id: limit_project_ids).full_search(query).order('updated_at DESC')
+ end
+
+ def merge_requests
+ MergeRequest.in_projects(limit_project_ids).full_search(query).order('updated_at DESC')
+ end
+
+ def default_scope
+ 'projects'
+ end
+
+ def per_page
+ 20
+ end
+ end
+end
diff --git a/lib/gitlab/snippet_search_results.rb b/lib/gitlab/snippet_search_results.rb
new file mode 100644
index 00000000000..938219efdb2
--- /dev/null
+++ b/lib/gitlab/snippet_search_results.rb
@@ -0,0 +1,131 @@
+module Gitlab
+ class SnippetSearchResults < SearchResults
+ attr_reader :limit_snippet_ids
+
+ def initialize(limit_snippet_ids, query)
+ @limit_snippet_ids = limit_snippet_ids
+ @query = query
+ end
+
+ def objects(scope, page = nil)
+ case scope
+ when 'snippet_titles'
+ Kaminari.paginate_array(snippet_titles).page(page).per(per_page)
+ when 'snippet_blobs'
+ Kaminari.paginate_array(snippet_blobs).page(page).per(per_page)
+ else
+ super
+ end
+ end
+
+ def total_count
+ @total_count ||= snippet_titles_count + snippet_blobs_count
+ end
+
+ def snippet_titles_count
+ @snippet_titles_count ||= snippet_titles.count
+ end
+
+ def snippet_blobs_count
+ @snippet_blobs_count ||= snippet_blobs.count
+ end
+
+ private
+
+ def snippet_titles
+ Snippet.where(id: limit_snippet_ids).search(query).order('updated_at DESC')
+ end
+
+ def snippet_blobs
+ search = Snippet.where(id: limit_snippet_ids).search_code(query)
+ search = search.order('updated_at DESC').to_a
+ snippets = []
+ search.each { |e| snippets << chunk_snippet(e) }
+ snippets
+ end
+
+ def default_scope
+ 'snippet_blobs'
+ end
+
+ # Get an array of line numbers surrounding a matching
+ # line, bounded by min/max.
+ #
+ # @returns Array of line numbers
+ def bounded_line_numbers(line, min, max)
+ lower = line - surrounding_lines > min ? line - surrounding_lines : min
+ upper = line + surrounding_lines < max ? line + surrounding_lines : max
+ (lower..upper).to_a
+ end
+
+ # Returns a sorted set of lines to be included in a snippet preview.
+ # This ensures matching adjacent lines do not display duplicated
+ # surrounding code.
+ #
+ # @returns Array, unique and sorted.
+ def matching_lines(lined_content)
+ used_lines = []
+ lined_content.each_with_index do |line, line_number|
+ used_lines.concat bounded_line_numbers(
+ line_number,
+ 0,
+ lined_content.size
+ ) if line.include?(query)
+ end
+
+ used_lines.uniq.sort
+ end
+
+ # 'Chunkify' entire snippet. Splits the snippet data into matching lines +
+ # surrounding_lines() worth of unmatching lines.
+ #
+ # @returns a hash with {snippet_object, snippet_chunks:{data,start_line}}
+ def chunk_snippet(snippet)
+ lined_content = snippet.content.split("\n")
+ used_lines = matching_lines(lined_content)
+
+ snippet_chunk = []
+ snippet_chunks = []
+ snippet_start_line = 0
+ last_line = -1
+
+ # Go through each used line, and add consecutive lines as a single chunk
+ # to the snippet chunk array.
+ used_lines.each do |line_number|
+ if last_line < 0
+ # Start a new chunk.
+ snippet_start_line = line_number
+ snippet_chunk << lined_content[line_number]
+ elsif last_line == line_number - 1
+ # Consecutive line, continue chunk.
+ snippet_chunk << lined_content[line_number]
+ else
+ # Non-consecutive line, add chunk to chunk array.
+ snippet_chunks << {
+ data: snippet_chunk.join("\n"),
+ start_line: snippet_start_line + 1
+ }
+
+ # Start a new chunk.
+ snippet_chunk = [lined_content[line_number]]
+ snippet_start_line = line_number
+ end
+ last_line = line_number
+ end
+ # Add final chunk to chunk array
+ snippet_chunks << {
+ data: snippet_chunk.join("\n"),
+ start_line: snippet_start_line + 1
+ }
+
+ # Return snippet with chunk array
+ { snippet_object: snippet, snippet_chunks: snippet_chunks }
+ end
+
+ # Defines how many unmatching lines should be
+ # included around the matching lines in a snippet
+ def surrounding_lines
+ 3
+ end
+ end
+end
diff --git a/lib/gitlab/upgrader.rb b/lib/gitlab/upgrader.rb
index 0846359f9b1..74b049b5143 100644
--- a/lib/gitlab/upgrader.rb
+++ b/lib/gitlab/upgrader.rb
@@ -43,7 +43,7 @@ module Gitlab
end
def latest_version_raw
- remote_tags, _ = Gitlab::Popen.popen(%W(git ls-remote --tags origin))
+ remote_tags, _ = Gitlab::Popen.popen(%W(git ls-remote --tags https://gitlab.com/gitlab-org/gitlab-ce.git))
git_tags = remote_tags.split("\n").grep(/tags\/v#{current_version.major}/)
git_tags = git_tags.select { |version| version =~ /v\d\.\d\.\d\Z/ }
last_tag = git_tags.last.match(/v\d\.\d\.\d/).to_s
diff --git a/lib/gitlab/visibility_level.rb b/lib/gitlab/visibility_level.rb
index ea1319268f8..d0b6cde3c7e 100644
--- a/lib/gitlab/visibility_level.rb
+++ b/lib/gitlab/visibility_level.rb
@@ -23,7 +23,21 @@ module Gitlab
end
def allowed_for?(user, level)
- user.is_admin? || !Gitlab.config.gitlab.restricted_visibility_levels.include?(level)
+ user.is_admin? || allowed_level?(level)
+ end
+
+ # Level can be a string `"public"` or a value `20`, first check if valid,
+ # then check if the corresponding string appears in the config
+ def allowed_level?(level)
+ if options.has_key?(level.to_s)
+ non_restricted_level?(level)
+ elsif options.has_value?(level.to_i)
+ non_restricted_level?(options.key(level.to_i).downcase)
+ end
+ end
+
+ def non_restricted_level?(level)
+ ! Gitlab.config.gitlab.restricted_visibility_levels.include?(level)
end
end
diff --git a/lib/support/nginx/gitlab b/lib/support/nginx/gitlab
index 16b06fe006e..49a68c62293 100644
--- a/lib/support/nginx/gitlab
+++ b/lib/support/nginx/gitlab
@@ -28,7 +28,7 @@
##
upstream gitlab {
- server unix:/home/git/gitlab/tmp/sockets/gitlab.socket;
+ server unix:/home/git/gitlab/tmp/sockets/gitlab.socket fail_timeout=0;
}
## Normal HTTP host
diff --git a/lib/support/nginx/gitlab-ssl b/lib/support/nginx/gitlab-ssl
index 90b4282b1fd..19409e41f40 100644
--- a/lib/support/nginx/gitlab-ssl
+++ b/lib/support/nginx/gitlab-ssl
@@ -26,26 +26,15 @@
## [1] https://github.com/agentzh/chunkin-nginx-module#status
## [2] https://github.com/agentzh/chunkin-nginx-module
##
-###################################
-## SSL file editing ##
-###################################
-##
-## Edit `gitlab-shell/config.yml`:
-## 1) Set "gitlab_url" param in `gitlab-shell/config.yml` to `https://git.example.com`
-## 2) Set "ca_file" to `/etc/nginx/ssl/gitlab.crt`
-## 3) Set "self_signed_cert" to `true`
-## Edit `gitlab/config/gitlab.yml`:
-## 1) Define port for http "port: 443"
-## 2) Enable https "https: true"
-## 3) Update ssl for gravatar "ssl_url: https://secure.gravatar.com/avatar/%{hash}?s=%{size}&d=mm"
##
###################################
## SSL configuration ##
###################################
##
+## See installation.md#using-https for additional HTTPS configuration details.
upstream gitlab {
- server unix:/home/git/gitlab/tmp/sockets/gitlab.socket;
+ server unix:/home/git/gitlab/tmp/sockets/gitlab.socket fail_timeout=0;
}
## Normal HTTP host
@@ -56,7 +45,7 @@ server {
## Redirects all traffic to the HTTPS host
root /nowhere; ## root doesn't have to be a valid path since we are redirecting
- rewrite ^ https://$server_name$request_uri permanent;
+ rewrite ^ https://$server_name$request_uri? permanent;
}
## HTTPS host
@@ -76,7 +65,7 @@ server {
ssl_certificate /etc/nginx/ssl/gitlab.crt;
ssl_certificate_key /etc/nginx/ssl/gitlab.key;
- ssl_ciphers 'ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES128-SHA256:DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256:AES256-SHA:AES128-SHA:DES-CBC3-SHA:HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4';
+ ssl_ciphers 'AES256+EECDH:AES256+EDH';
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_session_cache builtin:1000 shared:SSL:10m;
@@ -87,6 +76,23 @@ server {
add_header X-Frame-Options SAMEORIGIN;
add_header X-Content-Type-Options nosniff;
+ ## [Optional] If your certficate has OCSP, enable OCSP stapling to reduce the overhead and latency of running SSL.
+ ## Replace with your ssl_trusted_certificate. For more info see:
+ ## - https://medium.com/devops-programming/4445f4862461
+ ## - https://www.ruby-forum.com/topic/4419319
+ ## - https://www.digitalocean.com/community/tutorials/how-to-configure-ocsp-stapling-on-apache-and-nginx
+ # ssl_stapling on;
+ # ssl_stapling_verify on;
+ # ssl_trusted_certificate /etc/nginx/ssl/stapling.trusted.crt;
+ # resolver 208.67.222.222 208.67.222.220 valid=300s; # Can change to your DNS resolver if desired
+ # resolver_timeout 10s;
+
+ ## [Optional] Generate a stronger DHE parameter:
+ ## cd /etc/ssl/certs
+ ## sudo openssl dhparam -out dhparam.pem 4096
+ ##
+ # ssl_dhparam /etc/ssl/certs/dhparam.pem;
+
## Individual nginx logs for this GitLab vhost
access_log /var/log/nginx/gitlab_access.log;
error_log /var/log/nginx/gitlab_error.log;
diff --git a/lib/tasks/gitlab/bulk_add_permission.rake b/lib/tasks/gitlab/bulk_add_permission.rake
index 0e1a3d071e9..3d8c171dfa3 100644
--- a/lib/tasks/gitlab/bulk_add_permission.rake
+++ b/lib/tasks/gitlab/bulk_add_permission.rake
@@ -7,10 +7,10 @@ namespace :gitlab do
projects_ids = Project.pluck(:id)
puts "Importing #{user_ids.size} users into #{projects_ids.size} projects"
- UsersProject.add_users_into_projects(projects_ids, user_ids, UsersProject::DEVELOPER)
+ ProjectMember.add_users_into_projects(projects_ids, user_ids, ProjectMember::DEVELOPER)
puts "Importing #{admin_ids.size} admins into #{projects_ids.size} projects"
- UsersProject.add_users_into_projects(projects_ids, admin_ids, UsersProject::MASTER)
+ ProjectMember.add_users_into_projects(projects_ids, admin_ids, ProjectMember::MASTER)
end
desc "GITLAB | Add a specific user to all projects (as a developer)"
@@ -18,7 +18,7 @@ namespace :gitlab do
user = User.find_by(email: args.email)
project_ids = Project.pluck(:id)
puts "Importing #{user.email} users into #{project_ids.size} projects"
- UsersProject.add_users_into_projects(project_ids, Array.wrap(user.id), UsersProject::DEVELOPER)
+ ProjectMember.add_users_into_projects(project_ids, Array.wrap(user.id), ProjectMember::DEVELOPER)
end
desc "GITLAB | Add all users to all groups (admin users are added as owners)"
@@ -30,8 +30,8 @@ namespace :gitlab do
puts "Importing #{user_ids.size} users into #{groups.size} groups"
puts "Importing #{admin_ids.size} admins into #{groups.size} groups"
groups.each do |group|
- group.add_users(user_ids, UsersGroup::DEVELOPER)
- group.add_users(admin_ids, UsersGroup::OWNER)
+ group.add_users(user_ids, GroupMember::DEVELOPER)
+ group.add_users(admin_ids, GroupMember::OWNER)
end
end
@@ -41,7 +41,7 @@ namespace :gitlab do
groups = Group.all
puts "Importing #{user.email} users into #{groups.size} groups"
groups.each do |group|
- group.add_users(Array.wrap(user.id), UsersGroup::DEVELOPER)
+ group.add_users(Array.wrap(user.id), GroupMember::DEVELOPER)
end
end
end
diff --git a/lib/tasks/gitlab/check.rake b/lib/tasks/gitlab/check.rake
index 032ed5ee370..9ec368254ac 100644
--- a/lib/tasks/gitlab/check.rake
+++ b/lib/tasks/gitlab/check.rake
@@ -17,7 +17,7 @@ namespace :gitlab do
check_database_config_exists
check_database_is_not_sqlite
check_migrations_are_up
- check_orphaned_users_groups
+ check_orphaned_group_members
check_gitlab_config_exists
check_gitlab_config_not_outdated
check_log_writable
@@ -194,13 +194,13 @@ namespace :gitlab do
end
end
- def check_orphaned_users_groups
- print "Database contains orphaned UsersGroups? ... "
- if UsersGroup.where("user_id not in (select id from users)").count > 0
+ def check_orphaned_group_members
+ print "Database contains orphaned GroupMembers? ... "
+ if GroupMember.where("user_id not in (select id from users)").count > 0
puts "yes".red
try_fixing_it(
"You can delete the orphaned records using something along the lines of:",
- sudo_gitlab("bundle exec rails runner -e production 'UsersGroup.where(\"user_id NOT IN (SELECT id FROM users)\").delete_all'")
+ sudo_gitlab("bundle exec rails runner -e production 'GroupMember.where(\"user_id NOT IN (SELECT id FROM users)\").delete_all'")
)
else
puts "no".green
@@ -322,7 +322,7 @@ namespace :gitlab do
"core.autocrlf" => "input"
}
correct_options = options.map do |name, value|
- run(%W(git config --global --get #{name})).try(:squish) == value
+ run(%W(#{Gitlab.config.git.bin_path} config --global --get #{name})).try(:squish) == value
end
if correct_options.all?
@@ -330,9 +330,9 @@ namespace :gitlab do
else
puts "no".red
try_fixing_it(
- sudo_gitlab("git config --global user.name \"#{options["user.name"]}\""),
- sudo_gitlab("git config --global user.email \"#{options["user.email"]}\""),
- sudo_gitlab("git config --global core.autocrlf \"#{options["core.autocrlf"]}\"")
+ sudo_gitlab("\"#{Gitlab.config.git.bin_path}\" config --global user.name \"#{options["user.name"]}\""),
+ sudo_gitlab("\"#{Gitlab.config.git.bin_path}\" config --global user.email \"#{options["user.email"]}\""),
+ sudo_gitlab("\"#{Gitlab.config.git.bin_path}\" config --global core.autocrlf \"#{options["core.autocrlf"]}\"")
)
for_more_information(
see_installation_guide_section "GitLab"
@@ -356,8 +356,7 @@ namespace :gitlab do
check_repo_base_user_and_group
check_repo_base_permissions
check_satellites_permissions
- check_update_hook_is_up_to_date
- check_repos_update_hooks_is_link
+ check_repos_hooks_directory_is_link
check_gitlab_shell_self_test
finished_checking "GitLab Shell"
@@ -367,29 +366,6 @@ namespace :gitlab do
# Checks
########################
-
- def check_update_hook_is_up_to_date
- print "update hook up-to-date? ... "
-
- hook_file = "update"
- gitlab_shell_hooks_path = Gitlab.config.gitlab_shell.hooks_path
- gitlab_shell_hook_file = File.join(gitlab_shell_hooks_path, hook_file)
-
- if File.exists?(gitlab_shell_hook_file)
- puts "yes".green
- else
- puts "no".red
- puts "Could not find #{gitlab_shell_hook_file}"
- try_fixing_it(
- 'Check the hooks_path in config/gitlab.yml',
- 'Check your gitlab-shell installation'
- )
- for_more_information(
- see_installation_guide_section "GitLab Shell"
- )
- end
- end
-
def check_repo_base_exists
print "Repo base directory exists? ... "
@@ -508,18 +484,10 @@ namespace :gitlab do
end
end
- def check_repos_update_hooks_is_link
- print "update hooks in repos are links: ... "
+ def check_repos_hooks_directory_is_link
+ print "hooks directories in repos are links: ... "
- hook_file = "update"
gitlab_shell_hooks_path = Gitlab.config.gitlab_shell.hooks_path
- gitlab_shell_hook_file = File.join(gitlab_shell_hooks_path, hook_file)
- gitlab_shell_ssh_user = Gitlab.config.gitlab_shell.ssh_user
-
- unless File.exists?(gitlab_shell_hook_file)
- puts "can't check because of previous errors".magenta
- return
- end
unless Project.count > 0
puts "can't check, you have no projects".magenta
@@ -529,38 +497,25 @@ namespace :gitlab do
Project.find_each(batch_size: 100) do |project|
print sanitized_message(project)
+ project_hook_directory = File.join(project.repository.path_to_repo, "hooks")
if project.empty_repo?
puts "repository is empty".magenta
+ elsif File.realpath(project_hook_directory) == File.realpath(gitlab_shell_hooks_path)
+ puts 'ok'.green
else
- project_hook_file = File.join(project.repository.path_to_repo, "hooks", hook_file)
-
- unless File.exists?(project_hook_file)
- puts "missing".red
- try_fixing_it(
- "sudo -u #{gitlab_shell_ssh_user} ln -sf #{gitlab_shell_hook_file} #{project_hook_file}"
- )
- for_more_information(
- "#{gitlab_shell_path}/support/rewrite-hooks.sh"
- )
- fix_and_rerun
- next
- end
-
- if File.lstat(project_hook_file).symlink? &&
- File.realpath(project_hook_file) == File.realpath(gitlab_shell_hook_file)
- puts "ok".green
- else
- puts "not a link to GitLab Shell's hook".red
- try_fixing_it(
- "sudo -u #{gitlab_shell_ssh_user} ln -sf #{gitlab_shell_hook_file} #{project_hook_file}"
- )
- for_more_information(
- "lib/support/rewrite-hooks.sh"
- )
- fix_and_rerun
- end
+ puts "wrong or missing hooks".red
+ try_fixing_it(
+ sudo_gitlab("#{gitlab_shell_path}/bin/create-hooks"),
+ 'Check the hooks_path in config/gitlab.yml',
+ 'Check your gitlab-shell installation'
+ )
+ for_more_information(
+ see_installation_guide_section "GitLab Shell"
+ )
+ fix_and_rerun
end
+
end
end
diff --git a/lib/tasks/gitlab/shell.rake b/lib/tasks/gitlab/shell.rake
index ff27e6a3066..a8f26a7c029 100644
--- a/lib/tasks/gitlab/shell.rake
+++ b/lib/tasks/gitlab/shell.rake
@@ -8,7 +8,7 @@ namespace :gitlab do
args.with_defaults(tag: 'v' + default_version, repo: "https://gitlab.com/gitlab-org/gitlab-shell.git")
user = Settings.gitlab.user
- home_dir = Settings.gitlab.user_home
+ home_dir = Rails.env.test? ? Rails.root.join('tmp/tests') : Settings.gitlab.user_home
gitlab_url = Settings.gitlab.url
# gitlab-shell requires a / at the end of the url
gitlab_url += "/" unless gitlab_url.match(/\/$/)
@@ -22,9 +22,10 @@ namespace :gitlab do
# Make sure we're on the right tag
Dir.chdir(target_dir) do
- sh "git fetch origin && git reset --hard $(git describe #{args.tag} || git describe origin/#{args.tag})"
-
- redis_url = URI.parse(ENV['REDIS_URL'] || "redis://localhost:6379")
+ # First try to checkout without fetching
+ # to avoid stalling tests if the Internet is down.
+ reset = "git reset --hard $(git describe #{args.tag} || git describe origin/#{args.tag})"
+ sh "#{reset} || git fetch origin && #{reset}"
config = {
user: user,
@@ -34,14 +35,21 @@ namespace :gitlab do
auth_file: File.join(home_dir, ".ssh", "authorized_keys"),
redis: {
bin: %x{which redis-cli}.chomp,
- host: redis_url.host,
- port: redis_url.port,
namespace: "resque:gitlab"
}.stringify_keys,
log_level: "INFO",
audit_usernames: false
}.stringify_keys
+ redis_url = URI.parse(ENV['REDIS_URL'] || "redis://localhost:6379")
+
+ if redis_url.scheme == 'unix'
+ config['redis']['socket'] = redis_url.path
+ else
+ config['redis']['host'] = redis_url.host
+ config['redis']['port'] = redis_url.port
+ end
+
# Generate config.yml based on existing gitlab settings
File.open("config.yml", "w+") {|f| f.puts config.to_yaml}
diff --git a/lib/tasks/gitlab/sidekiq.rake b/lib/tasks/gitlab/sidekiq.rake
new file mode 100644
index 00000000000..7e2a6668e59
--- /dev/null
+++ b/lib/tasks/gitlab/sidekiq.rake
@@ -0,0 +1,47 @@
+namespace :gitlab do
+ namespace :sidekiq do
+ QUEUE = 'queue:post_receive'
+
+ desc 'Drop all Sidekiq PostReceive jobs for a given project'
+ task :drop_post_receive , [:project] => :environment do |t, args|
+ unless args.project.present?
+ abort "Please specify the project you want to drop PostReceive jobs for:\n rake gitlab:sidekiq:drop_post_receive[group/project]"
+ end
+ project_path = Project.find_with_namespace(args.project).repository.path_to_repo
+
+ Sidekiq.redis do |redis|
+ unless redis.exists(QUEUE)
+ abort "Queue #{QUEUE} is empty"
+ end
+
+ temp_queue = "#{QUEUE}_#{Time.now.to_i}"
+ redis.rename(QUEUE, temp_queue)
+
+ # At this point, then post_receive queue is empty. It may be receiving
+ # new jobs already. We will repopulate it with the old jobs, skipping the
+ # ones we want to drop.
+ dropped = 0
+ while (job = redis.lpop(temp_queue)) do
+ if repo_path(job) == project_path
+ dropped += 1
+ else
+ redis.rpush(QUEUE, job)
+ end
+ end
+ # The temp_queue will delete itself after we have popped all elements
+ # from it
+
+ puts "Dropped #{dropped} jobs containing #{project_path} from #{QUEUE}"
+ end
+ end
+
+ def repo_path(job)
+ job_args = JSON.parse(job)['args']
+ if job_args
+ job_args.first
+ else
+ nil
+ end
+ end
+ end
+end
diff --git a/spec/factories.rb b/spec/factories.rb
index 03c87fcc6c5..a960571206c 100644
--- a/spec/factories.rb
+++ b/spec/factories.rb
@@ -39,10 +39,10 @@ FactoryGirl.define do
owner
end
- factory :users_project do
+ factory :project_member do
user
project
- project_access { UsersProject::MASTER }
+ access_level { ProjectMember::MASTER }
end
factory :issue do
@@ -165,7 +165,6 @@ FactoryGirl.define do
factory :service do
type ""
title "GitLab CI"
- token "x56olispAND34ng"
project
end
diff --git a/spec/factories/users_groups.rb b/spec/factories/group_members.rb
index 49c3a367e16..debb86d997f 100644
--- a/spec/factories/users_groups.rb
+++ b/spec/factories/group_members.rb
@@ -1,6 +1,6 @@
# == Schema Information
#
-# Table name: users_groups
+# Table name: group_members
#
# id :integer not null, primary key
# group_access :integer not null
@@ -12,8 +12,8 @@
#
FactoryGirl.define do
- factory :users_group do
- group_access { UsersGroup::OWNER }
+ factory :group_member do
+ access_level { GroupMember::OWNER }
group
user
end
diff --git a/spec/features/admin/admin_hooks_spec.rb b/spec/features/admin/admin_hooks_spec.rb
index 120448ae335..b557567bd04 100644
--- a/spec/features/admin/admin_hooks_spec.rb
+++ b/spec/features/admin/admin_hooks_spec.rb
@@ -33,7 +33,7 @@ describe "Admin::Hooks", feature: true do
end
it "should open new hook popup" do
- page.current_path.should == admin_hooks_path
+ current_path.should == admin_hooks_path
page.should have_content(@url)
end
end
@@ -45,7 +45,7 @@ describe "Admin::Hooks", feature: true do
click_link "Test Hook"
end
- it { page.current_path.should == admin_hooks_path }
+ it { current_path.should == admin_hooks_path }
end
end
diff --git a/spec/features/atom/dashboard_issues_spec.rb b/spec/features/atom/dashboard_issues_spec.rb
index 9fd2933b2cc..187f2ffcffd 100644
--- a/spec/features/atom/dashboard_issues_spec.rb
+++ b/spec/features/atom/dashboard_issues_spec.rb
@@ -17,12 +17,12 @@ describe "Dashboard Issues Feed", feature: true do
it "should render atom feed via private token" do
visit issues_dashboard_path(:atom, private_token: user.private_token)
- page.response_headers['Content-Type'].should have_content("application/atom+xml")
- page.body.should have_selector("title", text: "#{user.name} issues")
- page.body.should have_selector("author email", text: issue1.author_email)
- page.body.should have_selector("entry summary", text: issue1.title)
- page.body.should have_selector("author email", text: issue2.author_email)
- page.body.should have_selector("entry summary", text: issue2.title)
+ response_headers['Content-Type'].should have_content("application/atom+xml")
+ body.should have_selector("title", text: "#{user.name} issues")
+ body.should have_selector("author email", text: issue1.author_email)
+ body.should have_selector("entry summary", text: issue1.title)
+ body.should have_selector("author email", text: issue2.author_email)
+ body.should have_selector("entry summary", text: issue2.title)
end
end
end
diff --git a/spec/features/atom/dashboard_spec.rb b/spec/features/atom/dashboard_spec.rb
index e5d9f8ab5d5..a7f87906b2d 100644
--- a/spec/features/atom/dashboard_spec.rb
+++ b/spec/features/atom/dashboard_spec.rb
@@ -7,8 +7,37 @@ describe "Dashboard Feed", feature: true do
context "projects atom feed via private token" do
it "should render projects atom feed" do
visit dashboard_path(:atom, private_token: user.private_token)
- page.body.should have_selector("feed title")
+ body.should have_selector("feed title")
end
end
+
+ context 'feed content' do
+ let(:project) { create(:project) }
+ let(:issue) { create(:issue, project: project, author: user, description: '') }
+ let(:note) { create(:note, noteable: issue, author: user, note: 'Bug confirmed', project: project) }
+
+ before do
+ project.team << [user, :master]
+ issue_event(issue, user)
+ note_event(note, user)
+ visit dashboard_path(:atom, private_token: user.private_token)
+ end
+
+ it "should have issue opened event" do
+ body.should have_content("#{user.name} opened issue ##{issue.iid}")
+ end
+
+ it "should have issue comment event" do
+ body.should have_content("#{user.name} commented on issue ##{issue.iid}")
+ end
+ end
+ end
+
+ def issue_event(issue, user)
+ EventCreateService.new.open_issue(issue, user)
+ end
+
+ def note_event(note, user)
+ EventCreateService.new.leave_note(note, user)
end
end
diff --git a/spec/features/atom/issues_spec.rb b/spec/features/atom/issues_spec.rb
index 6ff03ec862c..453dca69094 100644
--- a/spec/features/atom/issues_spec.rb
+++ b/spec/features/atom/issues_spec.rb
@@ -13,10 +13,10 @@ describe "Issues Feed", feature: true do
login_with user
visit project_issues_path(project, :atom)
- page.response_headers['Content-Type'].should have_content("application/atom+xml")
- page.body.should have_selector("title", text: "#{project.name} issues")
- page.body.should have_selector("author email", text: issue.author_email)
- page.body.should have_selector("entry summary", text: issue.title)
+ response_headers['Content-Type'].should have_content("application/atom+xml")
+ body.should have_selector("title", text: "#{project.name} issues")
+ body.should have_selector("author email", text: issue.author_email)
+ body.should have_selector("entry summary", text: issue.title)
end
end
@@ -24,10 +24,10 @@ describe "Issues Feed", feature: true do
it "should render atom feed" do
visit project_issues_path(project, :atom, private_token: user.private_token)
- page.response_headers['Content-Type'].should have_content("application/atom+xml")
- page.body.should have_selector("title", text: "#{project.name} issues")
- page.body.should have_selector("author email", text: issue.author_email)
- page.body.should have_selector("entry summary", text: issue.title)
+ response_headers['Content-Type'].should have_content("application/atom+xml")
+ body.should have_selector("title", text: "#{project.name} issues")
+ body.should have_selector("author email", text: issue.author_email)
+ body.should have_selector("entry summary", text: issue.title)
end
end
end
diff --git a/spec/features/issues_spec.rb b/spec/features/issues_spec.rb
index f0daf081018..26607b0090c 100644
--- a/spec/features/issues_spec.rb
+++ b/spec/features/issues_spec.rb
@@ -59,9 +59,9 @@ describe "Issues", feature: true do
page.should have_content "Assign to #{@user.name}"
- page.first('#s2id_issue_assignee_id').click
+ first('#s2id_issue_assignee_id').click
sleep 2 # wait for ajax stuff to complete
- page.first('.user-result').click
+ first('.user-result').click
click_button "Save changes"
@@ -212,7 +212,7 @@ describe "Issues", feature: true do
click_button 'Update Issue'
page.should have_content "Assignee:"
- page.has_select?('issue_assignee_id', :selected => project.team.members.first.name)
+ has_select?('issue_assignee_id', :selected => project.team.members.first.name)
end
end
@@ -249,7 +249,7 @@ describe "Issues", feature: true do
click_button 'Update Issue'
page.should have_content "Milestone changed to #{milestone.title}"
- page.has_select?('issue_assignee_id', :selected => milestone.title)
+ has_select?('issue_assignee_id', :selected => milestone.title)
end
end
@@ -283,9 +283,9 @@ describe "Issues", feature: true do
visit project_issue_path(project, issue)
page.should have_content "Assignee: #{user2.name}"
- page.first('#s2id_issue_assignee_id').click
+ first('#s2id_issue_assignee_id').click
sleep 2 # wait for ajax stuff to complete
- page.first('.user-result').click
+ first('.user-result').click
page.should have_content "Assignee: Unassigned"
sleep 2 # wait for ajax stuff to complete
diff --git a/spec/features/notes_on_merge_requests_spec.rb b/spec/features/notes_on_merge_requests_spec.rb
index 47776ba7f3f..92f3a6c0929 100644
--- a/spec/features/notes_on_merge_requests_spec.rb
+++ b/spec/features/notes_on_merge_requests_spec.rb
@@ -133,7 +133,7 @@ describe 'Comments' do
describe "when adding a note" do
before do
- find("a[data-line-code=\"#{line_code}\"]").click
+ click_diff_line
end
describe "the notes holder" do
@@ -144,7 +144,7 @@ describe 'Comments' do
describe "the note form" do
it "shouldn't add a second form for same row" do
- find("a[data-line-code=\"#{line_code}\"]").click
+ click_diff_line
should have_css("tr[id='#{line_code}'] + .js-temp-notes-holder form", count: 1)
end
@@ -161,8 +161,8 @@ describe 'Comments' do
describe "with muliple note forms" do
before do
- find("a[data-line-code=\"#{line_code}\"]").click
- find("a[data-line-code=\"#{line_code_2}\"]").click
+ click_diff_line
+ click_diff_line(line_code_2)
end
it { should have_css(".js-temp-notes-holder", count: 2) }
@@ -193,7 +193,7 @@ describe 'Comments' do
should have_content("Another comment on line 10")
should have_css(".notes_holder")
should have_css(".notes_holder .note", count: 1)
- should have_link("Reply")
+ should have_button('Reply')
end
end
end
@@ -206,4 +206,9 @@ describe 'Comments' do
def line_code_2
sample_compare.changes.last[:line_code]
end
+
+ def click_diff_line(data = nil)
+ data ||= line_code
+ find("button[data-line-code=\"#{data}\"]").click
+ end
end
diff --git a/spec/features/security/project/internal_access_spec.rb b/spec/features/security/project/internal_access_spec.rb
index f86b3db32eb..598d554a946 100644
--- a/spec/features/security/project/internal_access_spec.rb
+++ b/spec/features/security/project/internal_access_spec.rb
@@ -90,7 +90,7 @@ describe "Internal Project Access", feature: true do
describe "GET /:project_path/blob" do
before do
commit = project.repository.commit
- path = commit.tree.contents.select { |i| i.is_a?(Grit::Blob) }.first.name
+ path = '.gitignore'
@blob_path = project_blob_path(project, File.join(commit.id, path))
end
diff --git a/spec/features/security/project/private_access_spec.rb b/spec/features/security/project/private_access_spec.rb
index a27361f4d15..b1d4c79e05b 100644
--- a/spec/features/security/project/private_access_spec.rb
+++ b/spec/features/security/project/private_access_spec.rb
@@ -90,7 +90,7 @@ describe "Private Project Access", feature: true do
describe "GET /:project_path/blob" do
before do
commit = project.repository.commit
- path = commit.tree.contents.select { |i| i.is_a?(Grit::Blob) }.first.name
+ path = '.gitignore'
@blob_path = project_blob_path(project, File.join(commit.id, path))
end
diff --git a/spec/features/security/project/public_access_spec.rb b/spec/features/security/project/public_access_spec.rb
index f114965bd4a..a4c8a2be25a 100644
--- a/spec/features/security/project/public_access_spec.rb
+++ b/spec/features/security/project/public_access_spec.rb
@@ -95,7 +95,7 @@ describe "Public Project Access", feature: true do
describe "GET /:project_path/blob" do
before do
commit = project.repository.commit
- path = commit.tree.contents.select { |i| i.is_a?(Grit::Blob) }.first.name
+ path = '.gitignore'
@blob_path = project_blob_path(project, File.join(commit.id, path))
end
diff --git a/spec/helpers/diff_helper_spec.rb b/spec/helpers/diff_helper_spec.rb
new file mode 100644
index 00000000000..b07742a6ee2
--- /dev/null
+++ b/spec/helpers/diff_helper_spec.rb
@@ -0,0 +1,99 @@
+require 'spec_helper'
+
+describe DiffHelper do
+ include RepoHelpers
+
+ let(:project) { create(:project) }
+ let(:commit) { project.repository.commit(sample_commit.id) }
+ let(:diff) { commit.diffs.first }
+ let(:diff_file) { Gitlab::Diff::File.new(diff) }
+
+ describe 'diff_hard_limit_enabled?' do
+ it 'should return true if param is provided' do
+ controller.stub(:params).and_return { { :force_show_diff => true } }
+ diff_hard_limit_enabled?.should be_true
+ end
+
+ it 'should return false if param is not provided' do
+ diff_hard_limit_enabled?.should be_false
+ end
+ end
+
+ describe 'allowed_diff_size' do
+ it 'should return hard limit for a diff if force diff is true' do
+ controller.stub(:params).and_return { { :force_show_diff => true } }
+ allowed_diff_size.should eq(1000)
+ end
+
+ it 'should return safe limit for a diff if force diff is false' do
+ allowed_diff_size.should eq(100)
+ end
+ end
+
+ describe 'parallel_diff' do
+ it 'should return an array of arrays containing the parsed diff' do
+ parallel_diff(diff_file, 0).should match_array(parallel_diff_result_array)
+ end
+ end
+
+ describe 'generate_line_code' do
+ it 'should generate correct line code' do
+ generate_line_code(diff_file.file_path, diff_file.diff_lines.first).should == '2f6fcd96b88b36ce98c38da085c795a27d92a3dd_6_6'
+ end
+ end
+
+ describe 'unfold_bottom_class' do
+ it 'should return empty string when bottom line shouldnt be unfolded' do
+ unfold_bottom_class(false).should == ''
+ end
+
+ it 'should return js class when bottom lines should be unfolded' do
+ unfold_bottom_class(true).should == 'js-unfold-bottom'
+ end
+ end
+
+ describe 'diff_line_content' do
+
+ it 'should return non breaking space when line is empty' do
+ diff_line_content(nil).should eq(" &nbsp;")
+ end
+
+ it 'should return the line itself' do
+ diff_line_content(diff_file.diff_lines.first.text).should eq("@@ -6,12 +6,18 @@ module Popen")
+ diff_line_content(diff_file.diff_lines.first.type).should eq("match")
+ diff_line_content(diff_file.diff_lines.first.new_pos).should eq(6)
+ end
+ end
+
+ def parallel_diff_result_array
+ [
+ ["match", 6, "@@ -6,12 +6,18 @@ module Popen", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_6_6", "match", 6, "@@ -6,12 +6,18 @@ module Popen", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_6_6"],
+ [nil, 6, " ", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_6_6", nil, 6, " ", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_6_6"], [nil, 7, " def popen(cmd, path=nil)", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_7_7", nil, 7, " def popen(cmd, path=nil)", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_7_7"],
+ [nil, 8, " unless cmd.is_a?(Array)", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_8_8", nil, 8, " unless cmd.is_a?(Array)", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_8_8"],
+ ["old", 9, "- raise <span class='idiff'></span>&quot;System commands must be given as an array of strings&quot;", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_9_9", "new", 9, "+ raise <span class='idiff'>RuntimeError, </span>&quot;System commands must be given as an array of strings&quot;", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_10_9"],
+ [nil, 10, " end", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_10_10", nil, 10, " end", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_10_10"],
+ [nil, 11, " ", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_11_11", nil, 11, " ", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_11_11"],
+ [nil, 12, " path ||= Dir.pwd", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_12_12", nil, 12, " path ||= Dir.pwd", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_12_12"],
+ ["old", 13, "- vars = { &quot;PWD&quot; =&gt; path }", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_13_13", "old", nil, "&nbsp;", nil],
+ ["old", 14, "- options = { chdir: path }", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_14_13", "new", 13, "+", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_13"],
+ [nil, nil, "&nbsp;", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_14", "new", 14, "+ vars = {", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_14"],
+ [nil, nil, "&nbsp;", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_15", "new", 15, "+ &quot;PWD&quot; =&gt; path", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_15"],
+ [nil, nil, "&nbsp;", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_16", "new", 16, "+ }", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_16"],
+ [nil, nil, "&nbsp;", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_17", "new", 17, "+", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_17"],
+ [nil, nil, "&nbsp;", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_18", "new", 18, "+ options = {", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_18"],
+ [nil, nil, "&nbsp;", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_19", "new", 19, "+ chdir: path", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_19"],
+ [nil, nil, "&nbsp;", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_20", "new", 20, "+ }", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_20"],
+ [nil, 15, " ", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_21", nil, 21, " ", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_21"],
+ [nil, 16, " unless File.directory?(path)", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_16_22", nil, 22, " unless File.directory?(path)", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_16_22"],
+ [nil, 17, " FileUtils.mkdir_p(path)", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_17_23", nil, 23, " FileUtils.mkdir_p(path)", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_17_23"],
+ ["match", 19, "@@ -19,6 +25,7 @@ module Popen", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_19_25", "match", 25, "@@ -19,6 +25,7 @@ module Popen", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_19_25"],
+ [nil, 19, " ", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_19_25", nil, 25, " ", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_19_25"],
+ [nil, 20, " @cmd_output = &quot;&quot;", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_20_26", nil, 26, " @cmd_output = &quot;&quot;", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_20_26"],
+ [nil, 21, " @cmd_status = 0", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_21_27", nil, 27, " @cmd_status = 0", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_21_27"],
+ [nil, nil, "&nbsp;", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_22_28", "new", 28, "+", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_22_28"],
+ [nil, 22, " Open3.popen3(vars, *cmd, options) do |stdin, stdout, stderr, wait_thr|", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_22_29", nil, 29, " Open3.popen3(vars, *cmd, options) do |stdin, stdout, stderr, wait_thr|", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_22_29"],
+ [nil, 23, " @cmd_output &lt;&lt; stdout.read", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_23_30", nil, 30, " @cmd_output &lt;&lt; stdout.read", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_23_30"],
+ [nil, 24, " @cmd_output &lt;&lt; stderr.read", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_24_31", nil, 31, " @cmd_output &lt;&lt; stderr.read", "2f6fcd96b88b36ce98c38da085c795a27d92a3dd_24_31"]
+ ]
+ end
+end
diff --git a/spec/helpers/gitlab_markdown_helper_spec.rb b/spec/helpers/gitlab_markdown_helper_spec.rb
index ba6af6f8b45..46337f8bafd 100644
--- a/spec/helpers/gitlab_markdown_helper_spec.rb
+++ b/spec/helpers/gitlab_markdown_helper_spec.rb
@@ -12,7 +12,7 @@ describe GitlabMarkdownHelper do
let(:issue) { create(:issue, project: project) }
let(:merge_request) { create(:merge_request, source_project: project, target_project: project) }
let(:snippet) { create(:project_snippet, project: project) }
- let(:member) { project.users_projects.where(user_id: user).first }
+ let(:member) { project.project_members.where(user_id: user).first }
before do
# Helper expects a @project instance variable
diff --git a/spec/lib/auth_spec.rb b/spec/lib/auth_spec.rb
deleted file mode 100644
index 073b811c3fb..00000000000
--- a/spec/lib/auth_spec.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-require 'spec_helper'
-
-describe Gitlab::Auth do
- let(:gl_auth) { Gitlab::Auth.new }
-
- describe :find do
- before do
- @user = create(
- :user,
- username: 'john',
- password: '88877711',
- password_confirmation: '88877711'
- )
- end
-
- it "should find user by valid login/password" do
- gl_auth.find('john', '88877711').should == @user
- end
-
- it "should not find user with invalid password" do
- gl_auth.find('john', 'invalid11').should_not == @user
- end
-
- it "should not find user with invalid login and password" do
- gl_auth.find('jon', 'invalid11').should_not == @user
- end
- end
-end
diff --git a/spec/lib/git_ref_validator_spec.rb b/spec/lib/git_ref_validator_spec.rb
new file mode 100644
index 00000000000..b2469c18395
--- /dev/null
+++ b/spec/lib/git_ref_validator_spec.rb
@@ -0,0 +1,20 @@
+require 'spec_helper'
+
+describe Gitlab::GitRefValidator do
+ it { Gitlab::GitRefValidator.validate('feature/new').should be_true }
+ it { Gitlab::GitRefValidator.validate('implement_@all').should be_true }
+ it { Gitlab::GitRefValidator.validate('my_new_feature').should be_true }
+ it { Gitlab::GitRefValidator.validate('#1').should be_true }
+ it { Gitlab::GitRefValidator.validate('feature/~new/').should be_false }
+ it { Gitlab::GitRefValidator.validate('feature/^new/').should be_false }
+ it { Gitlab::GitRefValidator.validate('feature/:new/').should be_false }
+ it { Gitlab::GitRefValidator.validate('feature/?new/').should be_false }
+ it { Gitlab::GitRefValidator.validate('feature/*new/').should be_false }
+ it { Gitlab::GitRefValidator.validate('feature/[new/').should be_false }
+ it { Gitlab::GitRefValidator.validate('feature/new/').should be_false }
+ it { Gitlab::GitRefValidator.validate('feature/new.').should be_false }
+ it { Gitlab::GitRefValidator.validate('feature\@{').should be_false }
+ it { Gitlab::GitRefValidator.validate('feature\new').should be_false }
+ it { Gitlab::GitRefValidator.validate('feature//new').should be_false }
+ it { Gitlab::GitRefValidator.validate('feature new').should be_false }
+end
diff --git a/spec/lib/gitlab/auth_spec.rb b/spec/lib/gitlab/auth_spec.rb
new file mode 100644
index 00000000000..551fb3fb5f6
--- /dev/null
+++ b/spec/lib/gitlab/auth_spec.rb
@@ -0,0 +1,47 @@
+require 'spec_helper'
+
+describe Gitlab::Auth do
+ let(:gl_auth) { Gitlab::Auth.new }
+
+ describe :find do
+ let!(:user) do
+ create(:user,
+ username: username,
+ password: password,
+ password_confirmation: password)
+ end
+ let(:username) { 'john' }
+ let(:password) { 'my-secret' }
+
+ it "should find user by valid login/password" do
+ expect( gl_auth.find(username, password) ).to eql user
+ end
+
+ it "should not find user with invalid password" do
+ password = 'wrong'
+ expect( gl_auth.find(username, password) ).to_not eql user
+ end
+
+ it "should not find user with invalid login" do
+ user = 'wrong'
+ expect( gl_auth.find(username, password) ).to_not eql user
+ end
+
+ context "with ldap enabled" do
+ before { Gitlab.config.ldap['enabled'] = true }
+ after { Gitlab.config.ldap['enabled'] = false }
+
+ it "tries to autheticate with db before ldap" do
+ expect(Gitlab::LDAP::User).not_to receive(:authenticate)
+
+ gl_auth.find(username, password)
+ end
+
+ it "uses ldap as fallback to for authentication" do
+ expect(Gitlab::LDAP::User).to receive(:authenticate)
+
+ gl_auth.find('ldap_user', 'password')
+ end
+ end
+ end
+end
diff --git a/spec/lib/gitlab/diff/file_spec.rb b/spec/lib/gitlab/diff/file_spec.rb
new file mode 100644
index 00000000000..cf0b5c282c1
--- /dev/null
+++ b/spec/lib/gitlab/diff/file_spec.rb
@@ -0,0 +1,21 @@
+require 'spec_helper'
+
+describe Gitlab::Diff::File do
+ include RepoHelpers
+
+ let(:project) { create(:project) }
+ let(:commit) { project.repository.commit(sample_commit.id) }
+ let(:diff) { commit.diffs.first }
+ let(:diff_file) { Gitlab::Diff::File.new(diff) }
+
+ describe :diff_lines do
+ let(:diff_lines) { diff_file.diff_lines }
+
+ it { diff_lines.size.should == 30 }
+ it { diff_lines.first.should be_kind_of(Gitlab::Diff::Line) }
+ end
+
+ describe :mode_changed? do
+ it { diff_file.mode_changed?.should be_false }
+ end
+end
diff --git a/spec/lib/gitlab/diff/parser_spec.rb b/spec/lib/gitlab/diff/parser_spec.rb
new file mode 100644
index 00000000000..35b78260acd
--- /dev/null
+++ b/spec/lib/gitlab/diff/parser_spec.rb
@@ -0,0 +1,93 @@
+require 'spec_helper'
+
+describe Gitlab::Diff::Parser do
+ include RepoHelpers
+
+ let(:project) { create(:project) }
+ let(:commit) { project.repository.commit(sample_commit.id) }
+ let(:diff) { commit.diffs.first }
+ let(:parser) { Gitlab::Diff::Parser.new }
+
+ describe :parse do
+ let(:diff) do
+ <<eos
+--- a/files/ruby/popen.rb
++++ b/files/ruby/popen.rb
+@@ -6,12 +6,18 @@ module Popen
+
+ def popen(cmd, path=nil)
+ unless cmd.is_a?(Array)
+- raise "System commands must be given as an array of strings"
++ raise RuntimeError, "System commands must be given as an array of strings"
+ end
+
+ path ||= Dir.pwd
+- vars = { "PWD" => path }
+- options = { chdir: path }
++
++ vars = {
++ "PWD" => path
++ }
++
++ options = {
++ chdir: path
++ }
+
+ unless File.directory?(path)
+ FileUtils.mkdir_p(path)
+@@ -19,6 +25,7 @@ module Popen
+
+ @cmd_output = ""
+ @cmd_status = 0
++
+ Open3.popen3(vars, *cmd, options) do |stdin, stdout, stderr, wait_thr|
+ @cmd_output << stdout.read
+ @cmd_output << stderr.read
+eos
+ end
+
+ before do
+ @lines = parser.parse(diff.lines)
+ end
+
+ it { @lines.size.should == 30 }
+
+ describe 'lines' do
+ describe 'first line' do
+ let(:line) { @lines.first }
+
+ it { line.type.should == 'match' }
+ it { line.old_pos.should == 6 }
+ it { line.new_pos.should == 6 }
+ it { line.text.should == '@@ -6,12 +6,18 @@ module Popen' }
+ end
+
+ describe 'removal line' do
+ let(:line) { @lines[10] }
+
+ it { line.type.should == 'old' }
+ it { line.old_pos.should == 14 }
+ it { line.new_pos.should == 13 }
+ it { line.text.should == '- options = { chdir: path }' }
+ end
+
+ describe 'addition line' do
+ let(:line) { @lines[16] }
+
+ it { line.type.should == 'new' }
+ it { line.old_pos.should == 15 }
+ it { line.new_pos.should == 18 }
+ it { line.text.should == '+ options = {' }
+ end
+
+ describe 'unchanged line' do
+ let(:line) { @lines.last }
+
+ it { line.type.should == nil }
+ it { line.old_pos.should == 24 }
+ it { line.new_pos.should == 31 }
+ it { line.text.should == ' @cmd_output &lt;&lt; stderr.read' }
+ end
+ end
+ end
+end
diff --git a/spec/lib/gitlab/git_access_spec.rb b/spec/lib/gitlab/git_access_spec.rb
new file mode 100644
index 00000000000..570b03827a8
--- /dev/null
+++ b/spec/lib/gitlab/git_access_spec.rb
@@ -0,0 +1,127 @@
+require 'spec_helper'
+
+describe Gitlab::GitAccess do
+ let(:access) { Gitlab::GitAccess.new }
+ let(:project) { create(:project) }
+ let(:user) { create(:user) }
+
+ describe 'download_allowed?' do
+ describe 'master permissions' do
+ before { project.team << [user, :master] }
+
+ context 'pull code' do
+ subject { access.download_allowed?(user, project) }
+
+ it { should be_true }
+ end
+ end
+
+ describe 'guest permissions' do
+ before { project.team << [user, :guest] }
+
+ context 'pull code' do
+ subject { access.download_allowed?(user, project) }
+
+ it { should be_false }
+ end
+ end
+
+ describe 'blocked user' do
+ before do
+ project.team << [user, :master]
+ user.block
+ end
+
+ context 'pull code' do
+ subject { access.download_allowed?(user, project) }
+
+ it { should be_false }
+ end
+ end
+
+ describe 'without acccess to project' do
+ context 'pull code' do
+ subject { access.download_allowed?(user, project) }
+
+ it { should be_false }
+ end
+ end
+ end
+
+ describe 'push_allowed?' do
+ def protect_feature_branch
+ create(:protected_branch, name: 'feature', project: project)
+ end
+
+ def changes
+ {
+ push_new_branch: '000000000 570e7b2ab refs/heads/wow',
+ push_master: '6f6d7e7ed 570e7b2ab refs/heads/master',
+ push_protected_branch: '6f6d7e7ed 570e7b2ab refs/heads/feature',
+ push_remove_protected_branch: '570e7b2ab 000000000 refs/heads/feature',
+ push_tag: '6f6d7e7ed 570e7b2ab refs/tags/v1.0.0',
+ push_new_tag: '000000000 570e7b2ab refs/tags/v7.8.9',
+ push_all: ['6f6d7e7ed 570e7b2ab refs/heads/master', '6f6d7e7ed 570e7b2ab refs/heads/feature']
+ }
+ end
+
+ def self.permissions_matrix
+ {
+ master: {
+ push_new_branch: true,
+ push_master: true,
+ push_protected_branch: true,
+ push_remove_protected_branch: false,
+ push_tag: true,
+ push_new_tag: true,
+ push_all: true,
+ },
+
+ developer: {
+ push_new_branch: true,
+ push_master: true,
+ push_protected_branch: false,
+ push_remove_protected_branch: false,
+ push_tag: false,
+ push_new_tag: true,
+ push_all: false,
+ },
+
+ reporter: {
+ push_new_branch: false,
+ push_master: false,
+ push_protected_branch: false,
+ push_remove_protected_branch: false,
+ push_tag: false,
+ push_new_tag: false,
+ push_all: false,
+ },
+
+ guest: {
+ push_new_branch: false,
+ push_master: false,
+ push_protected_branch: false,
+ push_remove_protected_branch: false,
+ push_tag: false,
+ push_new_tag: false,
+ push_all: false,
+ }
+ }
+ end
+
+ permissions_matrix.keys.each do |role|
+ describe "#{role} access" do
+ before { protect_feature_branch }
+ before { project.team << [user, role] }
+
+ permissions_matrix[role].each do |action, allowed|
+ context action do
+ subject { access.push_allowed?(user, project, changes[action]) }
+
+ it { should allowed ? be_true : be_false }
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/spec/lib/gitlab/ldap/ldap_access_spec.rb b/spec/lib/gitlab/ldap/access_spec.rb
index d8c107502ba..2307a03f656 100644
--- a/spec/lib/gitlab/ldap/ldap_access_spec.rb
+++ b/spec/lib/gitlab/ldap/access_spec.rb
@@ -16,14 +16,14 @@ describe Gitlab::LDAP::Access do
context 'when the user is found' do
before { Gitlab::LDAP::Person.stub(find_by_dn: :ldap_user) }
- context 'and the Active Directory disabled flag is set' do
- before { Gitlab::LDAP::Person.stub(active_directory_disabled?: true) }
+ context 'and the user is diabled via active directory' do
+ before { Gitlab::LDAP::Person.stub(disabled_via_active_directory?: true) }
it { should be_false }
end
- context 'and the Active Directory disabled flag is not set' do
- before { Gitlab::LDAP::Person.stub(active_directory_disabled?: false) }
+ context 'and has no disabled flag in active diretory' do
+ before { Gitlab::LDAP::Person.stub(disabled_via_active_directory?: false) }
it { should be_true }
end
diff --git a/spec/lib/gitlab/ldap/ldap_adapter_spec.rb b/spec/lib/gitlab/ldap/adapter_spec.rb
index c3f07334431..c3f07334431 100644
--- a/spec/lib/gitlab/ldap/ldap_adapter_spec.rb
+++ b/spec/lib/gitlab/ldap/adapter_spec.rb
diff --git a/spec/lib/gitlab/ldap/ldap_user_auth_spec.rb b/spec/lib/gitlab/ldap/ldap_user_auth_spec.rb
deleted file mode 100644
index 501642dca79..00000000000
--- a/spec/lib/gitlab/ldap/ldap_user_auth_spec.rb
+++ /dev/null
@@ -1,58 +0,0 @@
-require 'spec_helper'
-
-describe Gitlab::LDAP do
- let(:gl_auth) { Gitlab::LDAP::User }
-
- before do
- Gitlab.config.stub(omniauth: {})
-
- @info = double(
- uid: '12djsak321',
- name: 'John',
- email: 'john@mail.com',
- nickname: 'john'
- )
- end
-
- describe :find_for_ldap_auth do
- before do
- @auth = double(
- uid: '12djsak321',
- info: @info,
- provider: 'ldap'
- )
- end
-
- it "should update credentials by email if missing uid" do
- user = double('User')
- User.stub find_by_extern_uid_and_provider: nil
- User.stub(:find_by).with(hash_including(email: anything())) { user }
- user.should_receive :update_attributes
- gl_auth.find_or_create(@auth)
- end
-
- it "should update credentials by username if missing uid and Gitlab.config.ldap.allow_username_or_email_login is true" do
- user = double('User')
- value = Gitlab.config.ldap.allow_username_or_email_login
- Gitlab.config.ldap['allow_username_or_email_login'] = true
- User.stub find_by_extern_uid_and_provider: nil
- User.stub(:find_by).with(hash_including(email: anything())) { nil }
- User.stub(:find_by).with(hash_including(username: anything())) { user }
- user.should_receive :update_attributes
- gl_auth.find_or_create(@auth)
- Gitlab.config.ldap['allow_username_or_email_login'] = value
- end
-
- it "should not update credentials by username if missing uid and Gitlab.config.ldap.allow_username_or_email_login is false" do
- user = double('User')
- value = Gitlab.config.ldap.allow_username_or_email_login
- Gitlab.config.ldap['allow_username_or_email_login'] = false
- User.stub find_by_extern_uid_and_provider: nil
- User.stub(:find_by).with(hash_including(email: anything())) { nil }
- User.stub(:find_by).with(hash_including(username: anything())) { user }
- user.should_not_receive :update_attributes
- gl_auth.find_or_create(@auth)
- Gitlab.config.ldap['allow_username_or_email_login'] = value
- end
- end
-end
diff --git a/spec/lib/gitlab/ldap/user_spec.rb b/spec/lib/gitlab/ldap/user_spec.rb
new file mode 100644
index 00000000000..d232cb20759
--- /dev/null
+++ b/spec/lib/gitlab/ldap/user_spec.rb
@@ -0,0 +1,54 @@
+require 'spec_helper'
+
+describe Gitlab::LDAP::User do
+ let(:gl_user) { Gitlab::LDAP::User }
+ let(:info) do
+ double(
+ name: 'John',
+ email: 'john@example.com',
+ nickname: 'john'
+ )
+ end
+ before { Gitlab.config.stub(omniauth: {}) }
+
+ describe :find_or_create do
+ let(:auth) do
+ double(info: info, provider: 'ldap', uid: 'my-uid')
+ end
+
+ it "finds the user if already existing" do
+ existing_user = create(:user, extern_uid: 'my-uid', provider: 'ldap')
+
+ expect{ gl_user.find_or_create(auth) }.to_not change{ User.count }
+ end
+
+ it "connects to existing non-ldap user if the email matches" do
+ existing_user = create(:user, email: 'john@example.com')
+ expect{ gl_user.find_or_create(auth) }.to_not change{ User.count }
+
+ existing_user.reload
+ expect(existing_user.extern_uid).to eql 'my-uid'
+ expect(existing_user.provider).to eql 'ldap'
+ end
+
+ it "creates a new user if not found" do
+ expect{ gl_user.find_or_create(auth) }.to change{ User.count }.by(1)
+ end
+ end
+
+ describe "authenticate" do
+ let(:login) { 'john' }
+ let(:password) { 'my-secret' }
+
+ before {
+ Gitlab.config.ldap['enabled'] = true
+ Gitlab.config.ldap['user_filter'] = 'employeeType=developer'
+ }
+ after { Gitlab.config.ldap['enabled'] = false }
+
+ it "send an authentication request to ldap" do
+ expect( Gitlab::LDAP::User.adapter ).to receive(:bind_as)
+ Gitlab::LDAP::User.authenticate(login, password)
+ end
+ end
+end
diff --git a/spec/lib/gitlab/oauth/user_spec.rb b/spec/lib/gitlab/oauth/user_spec.rb
new file mode 100644
index 00000000000..c241e198609
--- /dev/null
+++ b/spec/lib/gitlab/oauth/user_spec.rb
@@ -0,0 +1,83 @@
+require 'spec_helper'
+
+describe Gitlab::OAuth::User do
+ let(:gl_auth) { Gitlab::OAuth::User }
+ let(:info) do
+ double(
+ nickname: 'john',
+ name: 'John',
+ email: 'john@mail.com'
+ )
+ end
+
+ before do
+ Gitlab.config.stub(omniauth: {})
+ end
+
+ describe :find do
+ let!(:existing_user) { create(:user, extern_uid: 'my-uid', provider: 'my-provider') }
+
+ it "finds an existing user based on uid and provider (facebook)" do
+ auth = double(info: double(name: 'John'), uid: 'my-uid', provider: 'my-provider')
+ assert gl_auth.find(auth)
+ end
+
+ it "finds an existing user based on nested uid and provider" do
+ auth = double(info: info, uid: 'my-uid', provider: 'my-provider')
+ assert gl_auth.find(auth)
+ end
+ end
+
+ describe :create do
+ it "should create user from LDAP" do
+ auth = double(info: info, uid: 'my-uid', provider: 'ldap')
+ user = gl_auth.create(auth)
+
+ user.should be_valid
+ user.extern_uid.should == auth.uid
+ user.provider.should == 'ldap'
+ end
+
+ it "should create user from Omniauth" do
+ auth = double(info: info, uid: 'my-uid', provider: 'twitter')
+ user = gl_auth.create(auth)
+
+ user.should be_valid
+ user.extern_uid.should == auth.uid
+ user.provider.should == 'twitter'
+ end
+
+ it "should apply defaults to user" do
+ auth = double(info: info, uid: 'my-uid', provider: 'ldap')
+ user = gl_auth.create(auth)
+
+ user.should be_valid
+ user.projects_limit.should == Gitlab.config.gitlab.default_projects_limit
+ user.can_create_group.should == Gitlab.config.gitlab.default_can_create_group
+ end
+
+ it "Set a temp email address if not provided (like twitter does)" do
+ info = double(
+ uid: 'my-uid',
+ nickname: 'john',
+ name: 'John'
+ )
+ auth = double(info: info, uid: 'my-uid', provider: 'my-provider')
+
+ user = gl_auth.create(auth)
+ expect(user.email).to_not be_empty
+ end
+
+ it 'generates a username if non provided (google)' do
+ info = double(
+ uid: 'my-uid',
+ name: 'John',
+ email: 'john@example.com'
+ )
+ auth = double(info: info, uid: 'my-uid', provider: 'my-provider')
+
+ user = gl_auth.create(auth)
+ expect(user.username).to eql 'john'
+ end
+ end
+end
diff --git a/spec/lib/gitlab/satellite/action_spec.rb b/spec/lib/gitlab/satellite/action_spec.rb
index 0622caf1e3b..2af1e9e32f9 100644
--- a/spec/lib/gitlab/satellite/action_spec.rb
+++ b/spec/lib/gitlab/satellite/action_spec.rb
@@ -59,7 +59,7 @@ describe 'Gitlab::Satellite::Action' do
called = false
#set assumptions
- File.rm(project.satellite.lock_file) unless !File.exists? project.satellite.lock_file
+ FileUtils.rm_f(project.satellite.lock_file)
File.exists?(project.satellite.lock_file).should be_false
diff --git a/spec/lib/oauth_spec.rb b/spec/lib/oauth_spec.rb
deleted file mode 100644
index 2f15b5e0349..00000000000
--- a/spec/lib/oauth_spec.rb
+++ /dev/null
@@ -1,45 +0,0 @@
-require 'spec_helper'
-
-describe Gitlab::OAuth::User do
- let(:gl_auth) { Gitlab::OAuth::User }
-
- before do
- Gitlab.config.stub(omniauth: {})
-
- @info = double(
- uid: '12djsak321',
- nickname: 'john',
- name: 'John',
- email: 'john@mail.com'
- )
- end
-
- describe :create do
- it "should create user from LDAP" do
- @auth = double(info: @info, provider: 'ldap')
- user = gl_auth.create(@auth)
-
- user.should be_valid
- user.extern_uid.should == @info.uid
- user.provider.should == 'ldap'
- end
-
- it "should create user from Omniauth" do
- @auth = double(info: @info, provider: 'twitter')
- user = gl_auth.create(@auth)
-
- user.should be_valid
- user.extern_uid.should == @info.uid
- user.provider.should == 'twitter'
- end
-
- it "should apply defaults to user" do
- @auth = double(info: @info, provider: 'ldap')
- user = gl_auth.create(@auth)
-
- user.should be_valid
- user.projects_limit.should == Gitlab.config.gitlab.default_projects_limit
- user.can_create_group.should == Gitlab.config.gitlab.default_can_create_group
- end
- end
-end
diff --git a/spec/mailers/notify_spec.rb b/spec/mailers/notify_spec.rb
index 702431e0712..799dce442cc 100644
--- a/spec/mailers/notify_spec.rb
+++ b/spec/mailers/notify_spec.rb
@@ -402,10 +402,10 @@ describe Notify do
describe 'project access changed' do
let(:project) { create(:project) }
let(:user) { create(:user) }
- let(:users_project) { create(:users_project,
+ let(:project_member) { create(:project_member,
project: project,
user: user) }
- subject { Notify.project_access_granted_email(users_project.id) }
+ subject { Notify.project_access_granted_email(project_member.id) }
it_behaves_like 'an email sent from GitLab'
@@ -416,7 +416,7 @@ describe Notify do
should have_body_text /#{project.name}/
end
it 'contains new user role' do
- should have_body_text /#{users_project.human_access}/
+ should have_body_text /#{project_member.human_access}/
end
end
@@ -506,7 +506,7 @@ describe Notify do
describe 'group access changed' do
let(:group) { create(:group) }
let(:user) { create(:user) }
- let(:membership) { create(:users_group, group: group, user: user) }
+ let(:membership) { create(:group_member, group: group, user: user) }
subject { Notify.group_access_granted_email(membership.id) }
diff --git a/spec/models/assembla_service_spec.rb b/spec/models/assembla_service_spec.rb
index acc08fc4d69..0ef475b87c3 100644
--- a/spec/models/assembla_service_spec.rb
+++ b/spec/models/assembla_service_spec.rb
@@ -5,16 +5,11 @@
# id :integer not null, primary key
# type :string(255)
# title :string(255)
-# token :string(255)
# project_id :integer not null
# created_at :datetime
# updated_at :datetime
# active :boolean default(FALSE), not null
-# project_url :string(255)
-# subdomain :string(255)
-# room :string(255)
-# recipients :text
-# api_key :string(255)
+# properties :text
#
require 'spec_helper'
diff --git a/spec/models/flowdock_service_spec.rb b/spec/models/flowdock_service_spec.rb
index 25ad133e122..710b8cba502 100644
--- a/spec/models/flowdock_service_spec.rb
+++ b/spec/models/flowdock_service_spec.rb
@@ -5,16 +5,11 @@
# id :integer not null, primary key
# type :string(255)
# title :string(255)
-# token :string(255)
# project_id :integer not null
# created_at :datetime
# updated_at :datetime
# active :boolean default(FALSE), not null
-# project_url :string(255)
-# subdomain :string(255)
-# room :string(255)
-# recipients :text
-# api_key :string(255)
+# properties :text
#
require 'spec_helper'
diff --git a/spec/models/gemnasium_service_spec.rb b/spec/models/gemnasium_service_spec.rb
index efdf0dc891b..5de645cdf33 100644
--- a/spec/models/gemnasium_service_spec.rb
+++ b/spec/models/gemnasium_service_spec.rb
@@ -5,16 +5,11 @@
# id :integer not null, primary key
# type :string(255)
# title :string(255)
-# token :string(255)
# project_id :integer not null
# created_at :datetime
# updated_at :datetime
# active :boolean default(FALSE), not null
-# project_url :string(255)
-# subdomain :string(255)
-# room :string(255)
-# recipients :text
-# api_key :string(255)
+# properties :text
#
require 'spec_helper'
diff --git a/spec/models/gitlab_ci_service_spec.rb b/spec/models/gitlab_ci_service_spec.rb
index 439a30869bb..e4cd8bb90c3 100644
--- a/spec/models/gitlab_ci_service_spec.rb
+++ b/spec/models/gitlab_ci_service_spec.rb
@@ -5,16 +5,11 @@
# id :integer not null, primary key
# type :string(255)
# title :string(255)
-# token :string(255)
# project_id :integer not null
# created_at :datetime
# updated_at :datetime
# active :boolean default(FALSE), not null
-# project_url :string(255)
-# subdomain :string(255)
-# room :string(255)
-# recipients :text
-# api_key :string(255)
+# properties :text
#
require 'spec_helper'
diff --git a/spec/models/users_group_spec.rb b/spec/models/group_member_spec.rb
index 0b6f7a08198..6acbc9bb4ae 100644
--- a/spec/models/users_group_spec.rb
+++ b/spec/models/group_member_spec.rb
@@ -1,9 +1,9 @@
# == Schema Information
#
-# Table name: users_groups
+# Table name: group_members
#
# id :integer not null, primary key
-# group_access :integer not null
+# access_level :integer not null
# group_id :integer not null
# user_id :integer not null
# created_at :datetime
@@ -13,34 +13,11 @@
require 'spec_helper'
-describe UsersGroup do
- describe "Associations" do
- it { should belong_to(:group) }
- it { should belong_to(:user) }
- end
-
- describe "Mass assignment" do
- end
-
- describe "Validation" do
- let!(:users_group) { create(:users_group) }
-
- it { should validate_presence_of(:user_id) }
- it { should validate_uniqueness_of(:user_id).scoped_to(:group_id).with_message(/already exists/) }
-
- it { should validate_presence_of(:group_id) }
- it { should ensure_inclusion_of(:group_access).in_array(UsersGroup.group_access_roles.values) }
- end
-
- describe "Delegate methods" do
- it { should respond_to(:user_name) }
- it { should respond_to(:user_email) }
- end
-
+describe GroupMember do
context 'notification' do
describe "#after_create" do
it "should send email to user" do
- membership = build(:users_group)
+ membership = build(:group_member)
membership.stub(notification_service: double('NotificationService').as_null_object)
membership.should_receive(:notification_service)
membership.save
@@ -49,18 +26,18 @@ describe UsersGroup do
describe "#after_update" do
before do
- @membership = create :users_group
+ @membership = create :group_member
@membership.stub(notification_service: double('NotificationService').as_null_object)
end
it "should send email to user" do
@membership.should_receive(:notification_service)
- @membership.update_attribute(:group_access, UsersGroup::MASTER)
+ @membership.update_attribute(:access_level, GroupMember::MASTER)
end
it "does not send an email when the access level has not changed" do
@membership.should_not_receive(:notification_service)
- @membership.update_attribute(:group_access, UsersGroup::OWNER)
+ @membership.update_attribute(:access_level, GroupMember::OWNER)
end
end
end
diff --git a/spec/models/group_spec.rb b/spec/models/group_spec.rb
index 8259ed88d83..1d4ba8a2b85 100644
--- a/spec/models/group_spec.rb
+++ b/spec/models/group_spec.rb
@@ -20,7 +20,7 @@ describe Group do
describe "Associations" do
it { should have_many :projects }
- it { should have_many :users_groups }
+ it { should have_many :group_members }
end
it { should validate_presence_of :name }
@@ -39,26 +39,26 @@ describe Group do
describe :add_users do
let(:user) { create(:user) }
- before { group.add_user(user, UsersGroup::MASTER) }
+ before { group.add_user(user, GroupMember::MASTER) }
- it { group.users_groups.masters.map(&:user).should include(user) }
+ it { group.group_members.masters.map(&:user).should include(user) }
end
describe :add_users do
let(:user) { create(:user) }
- before { group.add_users([user.id], UsersGroup::GUEST) }
+ before { group.add_users([user.id], GroupMember::GUEST) }
it "should update the group permission" do
- group.users_groups.guests.map(&:user).should include(user)
- group.add_users([user.id], UsersGroup::DEVELOPER)
- group.users_groups.developers.map(&:user).should include(user)
- group.users_groups.guests.map(&:user).should_not include(user)
+ group.group_members.guests.map(&:user).should include(user)
+ group.add_users([user.id], GroupMember::DEVELOPER)
+ group.group_members.developers.map(&:user).should include(user)
+ group.group_members.guests.map(&:user).should_not include(user)
end
end
describe :avatar_type do
let(:user) { create(:user) }
- before { group.add_user(user, UsersGroup::MASTER) }
+ before { group.add_user(user, GroupMember::MASTER) }
it "should be true if avatar is image" do
group.update_attribute(:avatar, 'uploads/avatar.png')
diff --git a/spec/models/members_spec.rb b/spec/models/members_spec.rb
new file mode 100644
index 00000000000..6866c4794c2
--- /dev/null
+++ b/spec/models/members_spec.rb
@@ -0,0 +1,20 @@
+require 'spec_helper'
+
+describe Member do
+ describe "Associations" do
+ it { should belong_to(:user) }
+ end
+
+ describe "Validation" do
+ subject { Member.new(access_level: Member::GUEST) }
+
+ it { should validate_presence_of(:user) }
+ it { should validate_presence_of(:source) }
+ it { should ensure_inclusion_of(:access_level).in_array(Gitlab::Access.values) }
+ end
+
+ describe "Delegate methods" do
+ it { should respond_to(:user_name) }
+ it { should respond_to(:user_email) }
+ end
+end
diff --git a/spec/models/note_spec.rb b/spec/models/note_spec.rb
index d06dee6ce92..da51100e0d7 100644
--- a/spec/models/note_spec.rb
+++ b/spec/models/note_spec.rb
@@ -321,8 +321,8 @@ describe Note do
describe :read do
before do
- @p1.users_projects.create(user: @u2, project_access: UsersProject::GUEST)
- @p2.users_projects.create(user: @u3, project_access: UsersProject::GUEST)
+ @p1.project_members.create(user: @u2, access_level: ProjectMember::GUEST)
+ @p2.project_members.create(user: @u3, access_level: ProjectMember::GUEST)
end
it { @abilities.allowed?(@u1, :read_note, @p1).should be_false }
@@ -332,8 +332,8 @@ describe Note do
describe :write do
before do
- @p1.users_projects.create(user: @u2, project_access: UsersProject::DEVELOPER)
- @p2.users_projects.create(user: @u3, project_access: UsersProject::DEVELOPER)
+ @p1.project_members.create(user: @u2, access_level: ProjectMember::DEVELOPER)
+ @p2.project_members.create(user: @u3, access_level: ProjectMember::DEVELOPER)
end
it { @abilities.allowed?(@u1, :write_note, @p1).should be_false }
@@ -343,9 +343,9 @@ describe Note do
describe :admin do
before do
- @p1.users_projects.create(user: @u1, project_access: UsersProject::REPORTER)
- @p1.users_projects.create(user: @u2, project_access: UsersProject::MASTER)
- @p2.users_projects.create(user: @u3, project_access: UsersProject::MASTER)
+ @p1.project_members.create(user: @u1, access_level: ProjectMember::REPORTER)
+ @p1.project_members.create(user: @u2, access_level: ProjectMember::MASTER)
+ @p2.project_members.create(user: @u3, access_level: ProjectMember::MASTER)
end
it { @abilities.allowed?(@u1, :admin_note, @p1).should be_false }
diff --git a/spec/models/users_project_spec.rb b/spec/models/project_member_spec.rb
index 3f38164e964..0178d065e57 100644
--- a/spec/models/users_project_spec.rb
+++ b/spec/models/project_member_spec.rb
@@ -1,6 +1,6 @@
# == Schema Information
#
-# Table name: users_projects
+# Table name: project_members
#
# id :integer not null, primary key
# user_id :integer not null
@@ -13,30 +13,7 @@
require 'spec_helper'
-describe UsersProject do
- describe "Associations" do
- it { should belong_to(:project) }
- it { should belong_to(:user) }
- end
-
- describe "Mass assignment" do
- end
-
- describe "Validation" do
- let!(:users_project) { create(:users_project) }
-
- it { should validate_presence_of(:user) }
- it { should validate_uniqueness_of(:user_id).scoped_to(:project_id).with_message(/already exists/) }
-
- it { should validate_presence_of(:project) }
- it { should ensure_inclusion_of(:project_access).in_array(UsersProject.access_roles.values) }
- end
-
- describe "Delegate methods" do
- it { should respond_to(:user_name) }
- it { should respond_to(:user_email) }
- end
-
+describe ProjectMember do
describe :import_team do
before do
@abilities = Six.new
@@ -78,10 +55,10 @@ describe UsersProject do
@user_1 = create :user
@user_2 = create :user
- UsersProject.add_users_into_projects(
+ ProjectMember.add_users_into_projects(
[@project_1.id, @project_2.id],
[@user_1.id, @user_2.id],
- UsersProject::MASTER
+ ProjectMember::MASTER
)
end
@@ -104,7 +81,7 @@ describe UsersProject do
@project_1.team << [ @user_1, :developer]
@project_2.team << [ @user_2, :reporter]
- UsersProject.truncate_teams([@project_1.id, @project_2.id])
+ ProjectMember.truncate_teams([@project_1.id, @project_2.id])
end
it { @project_1.users.should be_empty }
diff --git a/spec/models/project_security_spec.rb b/spec/models/project_security_spec.rb
index 1f2bd7a56ff..5c8d1e7438b 100644
--- a/spec/models/project_security_spec.rb
+++ b/spec/models/project_security_spec.rb
@@ -30,7 +30,7 @@ describe Project do
describe "Guest Rules" do
before do
- @p1.users_projects.create(project: @p1, user: @u2, project_access: UsersProject::GUEST)
+ @p1.project_members.create(project: @p1, user: @u2, access_level: ProjectMember::GUEST)
end
it "should allow for project user any guest actions" do
@@ -42,7 +42,7 @@ describe Project do
describe "Report Rules" do
before do
- @p1.users_projects.create(project: @p1, user: @u2, project_access: UsersProject::REPORTER)
+ @p1.project_members.create(project: @p1, user: @u2, access_level: ProjectMember::REPORTER)
end
it "should allow for project user any report actions" do
@@ -54,8 +54,8 @@ describe Project do
describe "Developer Rules" do
before do
- @p1.users_projects.create(project: @p1, user: @u2, project_access: UsersProject::REPORTER)
- @p1.users_projects.create(project: @p1, user: @u3, project_access: UsersProject::DEVELOPER)
+ @p1.project_members.create(project: @p1, user: @u2, access_level: ProjectMember::REPORTER)
+ @p1.project_members.create(project: @p1, user: @u3, access_level: ProjectMember::DEVELOPER)
end
it "should deny for developer master-specific actions" do
@@ -73,8 +73,8 @@ describe Project do
describe "Master Rules" do
before do
- @p1.users_projects.create(project: @p1, user: @u2, project_access: UsersProject::DEVELOPER)
- @p1.users_projects.create(project: @p1, user: @u3, project_access: UsersProject::MASTER)
+ @p1.project_members.create(project: @p1, user: @u2, access_level: ProjectMember::DEVELOPER)
+ @p1.project_members.create(project: @p1, user: @u3, access_level: ProjectMember::MASTER)
end
it "should deny for developer master-specific actions" do
@@ -92,8 +92,8 @@ describe Project do
describe "Admin Rules" do
before do
- @p1.users_projects.create(project: @p1, user: @u2, project_access: UsersProject::DEVELOPER)
- @p1.users_projects.create(project: @p1, user: @u3, project_access: UsersProject::MASTER)
+ @p1.project_members.create(project: @p1, user: @u2, access_level: ProjectMember::DEVELOPER)
+ @p1.project_members.create(project: @p1, user: @u3, access_level: ProjectMember::MASTER)
end
it "should deny for masters admin-specific actions" do
diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb
index 1c11ac39567..524cab2b925 100644
--- a/spec/models/project_spec.rb
+++ b/spec/models/project_spec.rb
@@ -38,7 +38,7 @@ describe Project do
it { should have_many(:merge_requests).dependent(:destroy) }
it { should have_many(:issues).dependent(:destroy) }
it { should have_many(:milestones).dependent(:destroy) }
- it { should have_many(:users_projects).dependent(:destroy) }
+ it { should have_many(:project_members).dependent(:destroy) }
it { should have_many(:notes).dependent(:destroy) }
it { should have_many(:snippets).class_name('ProjectSnippet').dependent(:destroy) }
it { should have_many(:deploy_keys_projects).dependent(:destroy) }
@@ -144,6 +144,62 @@ describe Project do
end
end
+ describe 'comment merge requests with commits' do
+ before do
+ @user = create(:user)
+ group = create(:group)
+ group.add_owner(@user)
+
+ @project = create(:project, namespace: group)
+ @fork_project = Projects::ForkService.new(@project, @user).execute
+ @merge_request = create(:merge_request, source_project: @project,
+ source_branch: 'master',
+ target_branch: 'feature',
+ target_project: @project)
+ @fork_merge_request = create(:merge_request, source_project: @fork_project,
+ source_branch: 'master',
+ target_branch: 'feature',
+ target_project: @project)
+
+ @commits = @merge_request.commits
+ end
+
+ context 'push to origin repo source branch' do
+ before do
+ @project.comment_mr_with_commits('master', @commits, @user)
+ end
+
+ it { @merge_request.notes.should_not be_empty }
+ it { @fork_merge_request.notes.should be_empty }
+ end
+
+ context 'push to origin repo target branch' do
+ before do
+ @project.comment_mr_with_commits('feature', @commits, @user)
+ end
+
+ it { @merge_request.notes.should be_empty }
+ it { @fork_merge_request.notes.should be_empty }
+ end
+
+ context 'push to fork repo source branch' do
+ before do
+ @fork_project.comment_mr_with_commits('master', @commits, @user)
+ end
+
+ it { @merge_request.notes.should be_empty }
+ it { @fork_merge_request.notes.should_not be_empty }
+ end
+
+ context 'push to fork repo target branch' do
+ before do
+ @fork_project.comment_mr_with_commits('feature', @commits, @user)
+ end
+
+ it { @merge_request.notes.should be_empty }
+ it { @fork_merge_request.notes.should be_empty }
+ end
+ end
describe :find_with_namespace do
context 'with namespace' do
diff --git a/spec/models/service_spec.rb b/spec/models/service_spec.rb
index adeeac115c1..480aeabf67f 100644
--- a/spec/models/service_spec.rb
+++ b/spec/models/service_spec.rb
@@ -5,16 +5,11 @@
# id :integer not null, primary key
# type :string(255)
# title :string(255)
-# token :string(255)
# project_id :integer not null
# created_at :datetime
# updated_at :datetime
# active :boolean default(FALSE), not null
-# project_url :string(255)
-# subdomain :string(255)
-# room :string(255)
-# recipients :text
-# api_key :string(255)
+# properties :text
#
require 'spec_helper'
diff --git a/spec/models/slack_service_spec.rb b/spec/models/slack_service_spec.rb
index b00eb30569b..4576913b473 100644
--- a/spec/models/slack_service_spec.rb
+++ b/spec/models/slack_service_spec.rb
@@ -5,16 +5,11 @@
# id :integer not null, primary key
# type :string(255)
# title :string(255)
-# token :string(255)
# project_id :integer not null
# created_at :datetime
# updated_at :datetime
# active :boolean default(FALSE), not null
-# project_url :string(255)
-# subdomain :string(255)
-# room :string(255)
-# recipients :text
-# api_key :string(255)
+# properties :text
#
require 'spec_helper'
diff --git a/spec/models/system_hook_spec.rb b/spec/models/system_hook_spec.rb
index 2b98acdeb6c..4ab5261dc9d 100644
--- a/spec/models/system_hook_spec.rb
+++ b/spec/models/system_hook_spec.rb
@@ -58,7 +58,7 @@ describe SystemHook do
user = create(:user)
project = create(:project)
project.team << [user, :master]
- project.users_projects.destroy_all
+ project.project_members.destroy_all
WebMock.should have_requested(:post, @system_hook.url).with(body: /user_remove_from_team/).once
end
end
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb
index 7221328a45f..0250014bc21 100644
--- a/spec/models/user_spec.rb
+++ b/spec/models/user_spec.rb
@@ -52,7 +52,7 @@ describe User do
describe "Associations" do
it { should have_one(:namespace) }
it { should have_many(:snippets).class_name('Snippet').dependent(:destroy) }
- it { should have_many(:users_projects).dependent(:destroy) }
+ it { should have_many(:project_members).dependent(:destroy) }
it { should have_many(:groups) }
it { should have_many(:keys).dependent(:destroy) }
it { should have_many(:events).class_name('Event').dependent(:destroy) }
@@ -182,7 +182,7 @@ describe User do
@group = create :group
@group.add_owner(@user)
- @group.add_user(@user2, UsersGroup::OWNER)
+ @group.add_user(@user2, GroupMember::OWNER)
end
it { @user2.several_namespaces?.should be_true }
diff --git a/spec/models/wiki_page_spec.rb b/spec/models/wiki_page_spec.rb
index cb42822b9bb..d065431ee3a 100644
--- a/spec/models/wiki_page_spec.rb
+++ b/spec/models/wiki_page_spec.rb
@@ -36,7 +36,7 @@ describe WikiPage do
end
it "sets the version attribute" do
- @wiki_page.version.should be_a Commit
+ @wiki_page.version.should be_a Grit::Commit
end
end
end
diff --git a/spec/requests/api/branches_spec.rb b/spec/requests/api/branches_spec.rb
index f3d7ca2ed21..8834a6cfa83 100644
--- a/spec/requests/api/branches_spec.rb
+++ b/spec/requests/api/branches_spec.rb
@@ -7,8 +7,8 @@ describe API::API, api: true do
let(:user) { create(:user) }
let(:user2) { create(:user) }
let!(:project) { create(:project, creator_id: user.id) }
- let!(:master) { create(:users_project, user: user, project: project, project_access: UsersProject::MASTER) }
- let!(:guest) { create(:users_project, user: user2, project: project, project_access: UsersProject::GUEST) }
+ let!(:master) { create(:project_member, user: user, project: project, access_level: ProjectMember::MASTER) }
+ let!(:guest) { create(:project_member, user: user2, project: project, access_level: ProjectMember::GUEST) }
let!(:branch_name) { 'feature' }
let!(:branch_sha) { '0b4bc9a49b562e85de7cc9e834518ea6828729b9' }
@@ -17,7 +17,7 @@ describe API::API, api: true do
get api("/projects/#{project.id}/repository/branches", user)
response.status.should == 200
json_response.should be_an Array
- json_response.first['name'].should == project.repo.heads.sort_by(&:name).first.name
+ json_response.first['name'].should == project.repository.branch_names.first
end
end
@@ -94,22 +94,50 @@ describe API::API, api: true do
describe "POST /projects/:id/repository/branches" do
it "should create a new branch" do
post api("/projects/#{project.id}/repository/branches", user),
- branch_name: branch_name,
- ref: branch_sha
+ branch_name: 'feature1',
+ ref: branch_sha
response.status.should == 201
- json_response['name'].should == branch_name
+ json_response['name'].should == 'feature1'
json_response['commit']['id'].should == branch_sha
end
it "should deny for user without push access" do
post api("/projects/#{project.id}/repository/branches", user2),
- branch_name: branch_name,
- ref: branch_sha
-
+ branch_name: branch_name,
+ ref: branch_sha
response.status.should == 403
end
+
+ it 'should return 400 if branch name is invalid' do
+ post api("/projects/#{project.id}/repository/branches", user),
+ branch_name: 'new design',
+ ref: branch_sha
+ response.status.should == 400
+ json_response['message'].should == 'Branch name invalid'
+ end
+
+ it 'should return 400 if branch already exists' do
+ post api("/projects/#{project.id}/repository/branches", user),
+ branch_name: 'new_design1',
+ ref: branch_sha
+ response.status.should == 201
+
+ post api("/projects/#{project.id}/repository/branches", user),
+ branch_name: 'new_design1',
+ ref: branch_sha
+ response.status.should == 400
+ json_response['message'].should == 'Branch already exists'
+ end
+
+ it 'should return 400 if ref name is invalid' do
+ post api("/projects/#{project.id}/repository/branches", user),
+ branch_name: 'new_design3',
+ ref: 'foo'
+ response.status.should == 400
+ json_response['message'].should == 'Invalid reference name'
+ end
end
describe "DELETE /projects/:id/repository/branches/:branch" do
@@ -120,6 +148,11 @@ describe API::API, api: true do
response.status.should == 200
end
+ it 'should return 404 if branch not exists' do
+ delete api("/projects/#{project.id}/repository/branches/foobar", user)
+ response.status.should == 404
+ end
+
it "should remove protected branch" do
project.protected_branches.create(name: branch_name)
delete api("/projects/#{project.id}/repository/branches/#{branch_name}", user)
diff --git a/spec/requests/api/commits_spec.rb b/spec/requests/api/commits_spec.rb
index b56269d275d..38e0a284c36 100644
--- a/spec/requests/api/commits_spec.rb
+++ b/spec/requests/api/commits_spec.rb
@@ -6,8 +6,8 @@ describe API::API, api: true do
let(:user) { create(:user) }
let(:user2) { create(:user) }
let!(:project) { create(:project, creator_id: user.id) }
- let!(:master) { create(:users_project, user: user, project: project, project_access: UsersProject::MASTER) }
- let!(:guest) { create(:users_project, user: user2, project: project, project_access: UsersProject::GUEST) }
+ let!(:master) { create(:project_member, user: user, project: project, access_level: ProjectMember::MASTER) }
+ let!(:guest) { create(:project_member, user: user2, project: project, access_level: ProjectMember::GUEST) }
before { project.team << [user, :reporter] }
diff --git a/spec/requests/api/groups_spec.rb b/spec/requests/api/groups_spec.rb
index f27a60e4bc0..42ccad71aaf 100644
--- a/spec/requests/api/groups_spec.rb
+++ b/spec/requests/api/groups_spec.rb
@@ -174,10 +174,10 @@ describe API::API, api: true do
let(:guest) { create(:user) }
let!(:group_with_members) do
group = create(:group)
- group.add_users([reporter.id], UsersGroup::REPORTER)
- group.add_users([developer.id], UsersGroup::DEVELOPER)
- group.add_users([master.id], UsersGroup::MASTER)
- group.add_users([guest.id], UsersGroup::GUEST)
+ group.add_users([reporter.id], GroupMember::REPORTER)
+ group.add_users([developer.id], GroupMember::DEVELOPER)
+ group.add_users([master.id], GroupMember::MASTER)
+ group.add_users([guest.id], GroupMember::GUEST)
group
end
let!(:group_no_members) { create(:group) }
@@ -195,11 +195,11 @@ describe API::API, api: true do
response.status.should == 200
json_response.should be_an Array
json_response.size.should == 5
- json_response.find { |e| e['id']==owner.id }['access_level'].should == UsersGroup::OWNER
- json_response.find { |e| e['id']==reporter.id }['access_level'].should == UsersGroup::REPORTER
- json_response.find { |e| e['id']==developer.id }['access_level'].should == UsersGroup::DEVELOPER
- json_response.find { |e| e['id']==master.id }['access_level'].should == UsersGroup::MASTER
- json_response.find { |e| e['id']==guest.id }['access_level'].should == UsersGroup::GUEST
+ json_response.find { |e| e['id']==owner.id }['access_level'].should == GroupMember::OWNER
+ json_response.find { |e| e['id']==reporter.id }['access_level'].should == GroupMember::REPORTER
+ json_response.find { |e| e['id']==developer.id }['access_level'].should == GroupMember::DEVELOPER
+ json_response.find { |e| e['id']==master.id }['access_level'].should == GroupMember::MASTER
+ json_response.find { |e| e['id']==guest.id }['access_level'].should == GroupMember::GUEST
end
end
@@ -213,29 +213,29 @@ describe API::API, api: true do
describe "POST /groups/:id/members" do
context "when not a member of the group" do
it "should not add guest as member of group_no_members when adding being done by person outside the group" do
- post api("/groups/#{group_no_members.id}/members", reporter), user_id: guest.id, access_level: UsersGroup::MASTER
+ post api("/groups/#{group_no_members.id}/members", reporter), user_id: guest.id, access_level: GroupMember::MASTER
response.status.should == 403
end
end
context "when a member of the group" do
it "should return ok and add new member" do
- count_before=group_no_members.users_groups.count
+ count_before=group_no_members.group_members.count
new_user = create(:user)
- post api("/groups/#{group_no_members.id}/members", owner), user_id: new_user.id, access_level: UsersGroup::MASTER
+ post api("/groups/#{group_no_members.id}/members", owner), user_id: new_user.id, access_level: GroupMember::MASTER
response.status.should == 201
json_response['name'].should == new_user.name
- json_response['access_level'].should == UsersGroup::MASTER
- group_no_members.users_groups.count.should == count_before + 1
+ json_response['access_level'].should == GroupMember::MASTER
+ group_no_members.group_members.count.should == count_before + 1
end
it "should return error if member already exists" do
- post api("/groups/#{group_with_members.id}/members", owner), user_id: master.id, access_level: UsersGroup::MASTER
+ post api("/groups/#{group_with_members.id}/members", owner), user_id: master.id, access_level: GroupMember::MASTER
response.status.should == 409
end
it "should return a 400 error when user id is not given" do
- post api("/groups/#{group_no_members.id}/members", owner), access_level: UsersGroup::MASTER
+ post api("/groups/#{group_no_members.id}/members", owner), access_level: GroupMember::MASTER
response.status.should == 400
end
@@ -262,10 +262,10 @@ describe API::API, api: true do
context "when a member of the group" do
it "should delete guest's membership of group" do
- count_before=group_with_members.users_groups.count
+ count_before=group_with_members.group_members.count
delete api("/groups/#{group_with_members.id}/members/#{guest.id}", owner)
response.status.should == 200
- group_with_members.users_groups.count.should == count_before - 1
+ group_with_members.group_members.count.should == count_before - 1
end
it "should return a 404 error when user id is not known" do
diff --git a/spec/requests/api/internal_spec.rb b/spec/requests/api/internal_spec.rb
index dbe8043c633..6df5ef38961 100644
--- a/spec/requests/api/internal_spec.rb
+++ b/spec/requests/api/internal_spec.rb
@@ -155,9 +155,8 @@ describe API::API, api: true do
end
def pull(key, project)
- get(
+ post(
api("/internal/allowed"),
- ref: 'master',
key_id: key.id,
project: project.path_with_namespace,
action: 'git-upload-pack'
@@ -165,9 +164,9 @@ describe API::API, api: true do
end
def push(key, project)
- get(
+ post(
api("/internal/allowed"),
- ref: 'master',
+ changes: 'd14d6c0abdd253381df51a723d58691b2ee1ab08 570e7b2abdd848b95f2f578043fc23bd6f6fd24d refs/heads/master',
key_id: key.id,
project: project.path_with_namespace,
action: 'git-receive-pack'
@@ -175,7 +174,7 @@ describe API::API, api: true do
end
def archive(key, project)
- get(
+ post(
api("/internal/allowed"),
ref: 'master',
key_id: key.id,
diff --git a/spec/requests/api/issues_spec.rb b/spec/requests/api/issues_spec.rb
index 08dc94ebdf3..9876452f81d 100644
--- a/spec/requests/api/issues_spec.rb
+++ b/spec/requests/api/issues_spec.rb
@@ -4,10 +4,12 @@ describe API::API, api: true do
include ApiHelpers
let(:user) { create(:user) }
let!(:project) { create(:project, namespace: user.namespace ) }
+ let!(:closed_issue) { create(:closed_issue, author: user, assignee: user, project: project, state: :closed) }
let!(:issue) { create(:issue, author: user, assignee: user, project: project) }
let!(:label) do
create(:label, title: 'label', color: '#FFAABB', project: project)
end
+ let!(:label_link) { create(:label_link, label: label, target: issue) }
before { project.team << [user, :reporter] }
@@ -32,6 +34,70 @@ describe API::API, api: true do
response.headers['Link'].should ==
'<http://www.example.com/api/v3/issues?page=1&per_page=3>; rel="first", <http://www.example.com/api/v3/issues?page=1&per_page=3>; rel="last"'
end
+
+ it 'should return an array of closed issues' do
+ get api('/issues?state=closed', user)
+ response.status.should == 200
+ json_response.should be_an Array
+ json_response.length.should == 1
+ json_response.first['id'].should == closed_issue.id
+ end
+
+ it 'should return an array of opened issues' do
+ get api('/issues?state=opened', user)
+ response.status.should == 200
+ json_response.should be_an Array
+ json_response.length.should == 1
+ json_response.first['id'].should == issue.id
+ end
+
+ it 'should return an array of all issues' do
+ get api('/issues?state=all', user)
+ response.status.should == 200
+ json_response.should be_an Array
+ json_response.length.should == 2
+ json_response.first['id'].should == issue.id
+ json_response.second['id'].should == closed_issue.id
+ end
+
+ it 'should return an array of labeled issues' do
+ get api("/issues?labels=#{label.title}", user)
+ response.status.should == 200
+ json_response.should be_an Array
+ json_response.length.should == 1
+ json_response.first['labels'].should == [label.title]
+ end
+
+ it 'should return an array of labeled issues when at least one label matches' do
+ get api("/issues?labels=#{label.title},foo,bar", user)
+ response.status.should == 200
+ json_response.should be_an Array
+ json_response.length.should == 1
+ json_response.first['labels'].should == [label.title]
+ end
+
+ it 'should return an empty array if no issue matches labels' do
+ get api('/issues?labels=foo,bar', user)
+ response.status.should == 200
+ json_response.should be_an Array
+ json_response.length.should == 0
+ end
+
+ it 'should return an array of labeled issues matching given state' do
+ get api("/issues?labels=#{label.title}&state=opened", user)
+ response.status.should == 200
+ json_response.should be_an Array
+ json_response.length.should == 1
+ json_response.first['labels'].should == [label.title]
+ json_response.first['state'].should == 'opened'
+ end
+
+ it 'should return an empty array if no issue matches labels and state filters' do
+ get api("/issues?labels=#{label.title}&state=closed", user)
+ response.status.should == 200
+ json_response.should be_an Array
+ json_response.length.should == 0
+ end
end
end
@@ -42,6 +108,29 @@ describe API::API, api: true do
json_response.should be_an Array
json_response.first['title'].should == issue.title
end
+
+ it 'should return an array of labeled project issues' do
+ get api("/projects/#{project.id}/issues?labels=#{label.title}", user)
+ response.status.should == 200
+ json_response.should be_an Array
+ json_response.length.should == 1
+ json_response.first['labels'].should == [label.title]
+ end
+
+ it 'should return an array of labeled project issues when at least one label matches' do
+ get api("/projects/#{project.id}/issues?labels=#{label.title},foo,bar", user)
+ response.status.should == 200
+ json_response.should be_an Array
+ json_response.length.should == 1
+ json_response.first['labels'].should == [label.title]
+ end
+
+ it 'should return an empty array if no project issue matches labels' do
+ get api("/projects/#{project.id}/issues?labels=foo,bar", user)
+ response.status.should == 200
+ json_response.should be_an Array
+ json_response.length.should == 0
+ end
end
describe "GET /projects/:id/issues/:issue_id" do
@@ -80,6 +169,15 @@ describe API::API, api: true do
response.status.should == 400
json_response['message']['labels']['?']['title'].should == ['is invalid']
end
+
+ it 'should return 400 if title is too long' do
+ post api("/projects/#{project.id}/issues", user),
+ title: 'g' * 256
+ response.status.should == 400
+ json_response['message']['title'].should == [
+ 'is too long (maximum is 255 characters)'
+ ]
+ end
end
describe "PUT /projects/:id/issues/:issue_id to update only title" do
@@ -148,6 +246,15 @@ describe API::API, api: true do
json_response['labels'].should include 'label_bar'
json_response['labels'].should include 'label/bar'
end
+
+ it 'should return 400 if title is too long' do
+ put api("/projects/#{project.id}/issues/#{issue.id}", user),
+ title: 'g' * 256
+ response.status.should == 400
+ json_response['message']['title'].should == [
+ 'is too long (maximum is 255 characters)'
+ ]
+ end
end
describe "PUT /projects/:id/issues/:issue_id to update state and label" do
@@ -156,7 +263,7 @@ describe API::API, api: true do
labels: 'label2', state_event: "close"
response.status.should == 200
- json_response['labels'].should == ['label2']
+ json_response['labels'].should include 'label2'
json_response['state'].should eq "closed"
end
end
diff --git a/spec/requests/api/labels_spec.rb b/spec/requests/api/labels_spec.rb
index ee9088933a1..dbddc8a7da4 100644
--- a/spec/requests/api/labels_spec.rb
+++ b/spec/requests/api/labels_spec.rb
@@ -47,7 +47,7 @@ describe API::API, api: true do
name: 'Foo',
color: '#FFAA'
response.status.should == 400
- json_response['message'].should == 'Color is invalid'
+ json_response['message']['color'].should == ['is invalid']
end
it 'should return 400 for too long color code' do
@@ -55,7 +55,7 @@ describe API::API, api: true do
name: 'Foo',
color: '#FFAAFFFF'
response.status.should == 400
- json_response['message'].should == 'Color is invalid'
+ json_response['message']['color'].should == ['is invalid']
end
it 'should return 400 for invalid name' do
@@ -63,7 +63,7 @@ describe API::API, api: true do
name: '?',
color: '#FFAABB'
response.status.should == 400
- json_response['message'].should == 'Title is invalid'
+ json_response['message']['title'].should == ['is invalid']
end
it 'should return 409 if label already exists' do
@@ -84,7 +84,7 @@ describe API::API, api: true do
it 'should return 404 for non existing label' do
delete api("/projects/#{project.id}/labels", user), name: 'label2'
response.status.should == 404
- json_response['message'].should == 'Label not found'
+ json_response['message'].should == '404 Label Not Found'
end
it 'should return 400 for wrong parameters' do
@@ -132,11 +132,14 @@ describe API::API, api: true do
it 'should return 400 if no label name given' do
put api("/projects/#{project.id}/labels", user), new_name: 'label2'
response.status.should == 400
+ json_response['message'].should == '400 (Bad request) "name" not given'
end
it 'should return 400 if no new parameters given' do
put api("/projects/#{project.id}/labels", user), name: 'label1'
response.status.should == 400
+ json_response['message'].should == 'Required parameters '\
+ '"new_name" or "color" missing'
end
it 'should return 400 for invalid name' do
@@ -145,7 +148,7 @@ describe API::API, api: true do
new_name: '?',
color: '#FFFFFF'
response.status.should == 400
- json_response['message'].should == 'Title is invalid'
+ json_response['message']['title'].should == ['is invalid']
end
it 'should return 400 for invalid name' do
@@ -153,7 +156,7 @@ describe API::API, api: true do
name: 'label1',
color: '#FF'
response.status.should == 400
- json_response['message'].should == 'Color is invalid'
+ json_response['message']['color'].should == ['is invalid']
end
it 'should return 400 for too long color code' do
@@ -161,7 +164,7 @@ describe API::API, api: true do
name: 'Foo',
color: '#FFAAFFFF'
response.status.should == 400
- json_response['message'].should == 'Color is invalid'
+ json_response['message']['color'].should == ['is invalid']
end
end
end
diff --git a/spec/requests/api/merge_requests_spec.rb b/spec/requests/api/merge_requests_spec.rb
index 06a25c5e3a5..5ba3a330991 100644
--- a/spec/requests/api/merge_requests_spec.rb
+++ b/spec/requests/api/merge_requests_spec.rb
@@ -57,6 +57,46 @@ describe API::API, api: true do
json_response.length.should == 1
json_response.first['title'].should == merge_request_merged.title
end
+
+ context "with ordering" do
+ before do
+ @mr_later = mr_with_later_created_and_updated_at_time
+ @mr_earlier = mr_with_earlier_created_and_updated_at_time
+ end
+
+ it "should return an array of merge_requests in ascending order" do
+ get api("/projects/#{project.id}/merge_requests?sort=asc", user)
+ response.status.should == 200
+ json_response.should be_an Array
+ json_response.length.should == 3
+ json_response.first['id'].should == @mr_earlier.id
+ json_response.last['id'].should == @mr_later.id
+ end
+ it "should return an array of merge_requests in descending order" do
+ get api("/projects/#{project.id}/merge_requests?sort=desc", user)
+ response.status.should == 200
+ json_response.should be_an Array
+ json_response.length.should == 3
+ json_response.first['id'].should == @mr_later.id
+ json_response.last['id'].should == @mr_earlier.id
+ end
+ it "should return an array of merge_requests ordered by updated_at" do
+ get api("/projects/#{project.id}/merge_requests?order_by=updated_at", user)
+ response.status.should == 200
+ json_response.should be_an Array
+ json_response.length.should == 3
+ json_response.first['id'].should == @mr_earlier.id
+ json_response.last['id'].should == @mr_later.id
+ end
+ it "should return an array of merge_requests ordered by created_at" do
+ get api("/projects/#{project.id}/merge_requests?sort=created_at", user)
+ response.status.should == 200
+ json_response.should be_an Array
+ json_response.length.should == 3
+ json_response.first['id'].should == @mr_earlier.id
+ json_response.last['id'].should == @mr_later.id
+ end
+ end
end
end
@@ -123,6 +163,28 @@ describe API::API, api: true do
json_response['message']['labels']['?']['title'].should ==
['is invalid']
end
+
+ context 'with existing MR' do
+ before do
+ post api("/projects/#{project.id}/merge_requests", user),
+ title: 'Test merge_request',
+ source_branch: 'stable',
+ target_branch: 'master',
+ author: user
+ @mr = MergeRequest.all.last
+ end
+
+ it 'should return 409 when MR already exists for source/target' do
+ expect do
+ post api("/projects/#{project.id}/merge_requests", user),
+ title: 'New test merge_request',
+ source_branch: 'stable',
+ target_branch: 'master',
+ author: user
+ end.to change { MergeRequest.count }.by(0)
+ response.status.should == 409
+ end
+ end
end
context 'forked projects' do
@@ -170,16 +232,26 @@ describe API::API, api: true do
response.status.should == 400
end
- it "should return 404 when target_branch is specified and not a forked project" do
- post api("/projects/#{project.id}/merge_requests", user),
- title: 'Test merge_request', target_branch: 'master', source_branch: 'stable', author: user, target_project_id: fork_project.id
- response.status.should == 404
- end
-
- it "should return 404 when target_branch is specified and for a different fork" do
- post api("/projects/#{fork_project.id}/merge_requests", user2),
- title: 'Test merge_request', target_branch: 'master', source_branch: 'stable', author: user2, target_project_id: unrelated_project.id
- response.status.should == 404
+ context 'when target_branch is specified' do
+ it 'should return 422 if not a forked project' do
+ post api("/projects/#{project.id}/merge_requests", user),
+ title: 'Test merge_request',
+ target_branch: 'master',
+ source_branch: 'stable',
+ author: user,
+ target_project_id: fork_project.id
+ response.status.should == 422
+ end
+
+ it 'should return 422 if targeting a different fork' do
+ post api("/projects/#{fork_project.id}/merge_requests", user2),
+ title: 'Test merge_request',
+ target_branch: 'master',
+ source_branch: 'stable',
+ author: user2,
+ target_project_id: unrelated_project.id
+ response.status.should == 422
+ end
end
it "should return 201 when target_branch is specified and for the same project" do
@@ -216,7 +288,7 @@ describe API::API, api: true do
merge_request.close
put api("/projects/#{project.id}/merge_request/#{merge_request.id}/merge", user)
response.status.should == 405
- json_response['message'].should == 'Method Not Allowed'
+ json_response['message'].should == '405 Method Not Allowed'
end
it "should return 401 if user has no permissions to merge" do
@@ -276,7 +348,8 @@ describe API::API, api: true do
end
it "should return 404 if note is attached to non existent merge request" do
- post api("/projects/#{project.id}/merge_request/111/comments", user), note: "My comment"
+ post api("/projects/#{project.id}/merge_request/404/comments", user),
+ note: 'My comment'
response.status.should == 404
end
end
@@ -296,4 +369,20 @@ describe API::API, api: true do
response.status.should == 404
end
end
+
+ def mr_with_later_created_and_updated_at_time
+ merge_request
+ merge_request.created_at += 1.hour
+ merge_request.updated_at += 30.minutes
+ merge_request.save
+ merge_request
+ end
+
+ def mr_with_earlier_created_and_updated_at_time
+ merge_request_closed
+ merge_request_closed.created_at -= 1.hour
+ merge_request_closed.updated_at -= 30.minutes
+ merge_request_closed.save
+ merge_request_closed
+ end
end
diff --git a/spec/requests/api/project_members_spec.rb b/spec/requests/api/project_members_spec.rb
index 3c480c2ac4b..836f21f3e0b 100644
--- a/spec/requests/api/project_members_spec.rb
+++ b/spec/requests/api/project_members_spec.rb
@@ -6,12 +6,12 @@ describe API::API, api: true do
let(:user2) { create(:user) }
let(:user3) { create(:user) }
let(:project) { create(:project, creator_id: user.id, namespace: user.namespace) }
- 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(:project_member) { create(:project_member, user: user, project: project, access_level: ProjectMember::MASTER) }
+ let(:project_member2) { create(:project_member, user: user3, project: project, access_level: ProjectMember::DEVELOPER) }
describe "GET /projects/:id/members" do
- before { users_project }
- before { users_project2 }
+ before { project_member }
+ before { project_member2 }
it "should return project team members" do
get api("/projects/#{project.id}/members", user)
@@ -36,13 +36,13 @@ describe API::API, api: true do
end
describe "GET /projects/:id/members/:user_id" do
- before { users_project }
+ before { project_member }
it "should return project team member" do
get api("/projects/#{project.id}/members/#{user.id}", user)
response.status.should == 200
json_response['username'].should == user.username
- json_response['access_level'].should == UsersProject::MASTER
+ json_response['access_level'].should == ProjectMember::MASTER
end
it "should return a 404 error if user id not found" do
@@ -55,29 +55,29 @@ describe API::API, api: true do
it "should add user to project team" do
expect {
post api("/projects/#{project.id}/members", user), user_id: user2.id,
- access_level: UsersProject::DEVELOPER
- }.to change { UsersProject.count }.by(1)
+ access_level: ProjectMember::DEVELOPER
+ }.to change { ProjectMember.count }.by(1)
response.status.should == 201
json_response['username'].should == user2.username
- json_response['access_level'].should == UsersProject::DEVELOPER
+ json_response['access_level'].should == ProjectMember::DEVELOPER
end
it "should return a 201 status if user is already project member" do
post api("/projects/#{project.id}/members", user), user_id: user2.id,
- access_level: UsersProject::DEVELOPER
+ access_level: ProjectMember::DEVELOPER
expect {
post api("/projects/#{project.id}/members", user), user_id: user2.id,
- access_level: UsersProject::DEVELOPER
- }.not_to change { UsersProject.count }.by(1)
+ access_level: ProjectMember::DEVELOPER
+ }.not_to change { ProjectMember.count }.by(1)
response.status.should == 201
json_response['username'].should == user2.username
- json_response['access_level'].should == UsersProject::DEVELOPER
+ json_response['access_level'].should == ProjectMember::DEVELOPER
end
it "should return a 400 error when user id is not given" do
- post api("/projects/#{project.id}/members", user), access_level: UsersProject::MASTER
+ post api("/projects/#{project.id}/members", user), access_level: ProjectMember::MASTER
response.status.should == 400
end
@@ -93,17 +93,17 @@ describe API::API, api: true do
end
describe "PUT /projects/:id/members/:user_id" do
- before { users_project2 }
+ before { project_member2 }
it "should update project team member" do
- put api("/projects/#{project.id}/members/#{user3.id}", user), access_level: UsersProject::MASTER
+ put api("/projects/#{project.id}/members/#{user3.id}", user), access_level: ProjectMember::MASTER
response.status.should == 200
json_response['username'].should == user3.username
- json_response['access_level'].should == UsersProject::MASTER
+ json_response['access_level'].should == ProjectMember::MASTER
end
it "should return a 404 error if user_id is not found" do
- put api("/projects/#{project.id}/members/1234", user), access_level: UsersProject::MASTER
+ put api("/projects/#{project.id}/members/1234", user), access_level: ProjectMember::MASTER
response.status.should == 404
end
@@ -119,20 +119,20 @@ describe API::API, api: true do
end
describe "DELETE /projects/:id/members/:user_id" do
- before { users_project }
- before { users_project2 }
+ before { project_member }
+ before { project_member2 }
it "should remove user from project team" do
expect {
delete api("/projects/#{project.id}/members/#{user3.id}", user)
- }.to change { UsersProject.count }.by(-1)
+ }.to change { ProjectMember.count }.by(-1)
end
it "should return 200 if team member is not part of a project" do
delete api("/projects/#{project.id}/members/#{user3.id}", user)
expect {
delete api("/projects/#{project.id}/members/#{user3.id}", user)
- }.to_not change { UsersProject.count }.by(1)
+ }.to_not change { ProjectMember.count }.by(1)
end
it "should return 200 if team member already removed" do
@@ -144,7 +144,7 @@ describe API::API, api: true do
it "should return 200 OK when the user was not member" do
expect {
delete api("/projects/#{project.id}/members/1000000", user)
- }.to change { UsersProject.count }.by(0)
+ }.to change { ProjectMember.count }.by(0)
response.status.should == 200
json_response['message'].should == "Access revoked"
json_response['id'].should == 1000000
diff --git a/spec/requests/api/projects_spec.rb b/spec/requests/api/projects_spec.rb
index 12a3a07ff76..571d8506277 100644
--- a/spec/requests/api/projects_spec.rb
+++ b/spec/requests/api/projects_spec.rb
@@ -8,8 +8,8 @@ describe API::API, api: true do
let(:admin) { create(:admin) }
let(:project) { create(:project, creator_id: user.id, namespace: user.namespace) }
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(:project_member) { create(:project_member, user: user, project: project, access_level: ProjectMember::MASTER) }
+ let(:project_member2) { create(:project_member, user: user3, project: project, access_level: ProjectMember::DEVELOPER) }
describe "GET /projects" do
before { project }
@@ -114,6 +114,7 @@ describe API::API, api: true do
it "should assign attributes to project" do
project = attributes_for(:project, {
+ path: 'camelCasePath',
description: Faker::Lorem.sentence,
issues_enabled: false,
merge_requests_enabled: false,
@@ -123,7 +124,6 @@ describe API::API, api: true do
post api("/projects", user), project
project.each_pair do |k,v|
- next if k == :path
json_response[k.to_s].should == v
end
end
@@ -188,9 +188,24 @@ describe API::API, api: true do
response.status.should == 201
end
- it "should respond with 404 on failure" do
+ it 'should respond with 400 on failure' do
post api("/projects/user/#{user.id}", admin)
- response.status.should == 404
+ response.status.should == 400
+ json_response['message']['creator'].should == ['can\'t be blank']
+ json_response['message']['namespace'].should == ['can\'t be blank']
+ json_response['message']['name'].should == [
+ 'can\'t be blank',
+ 'is too short (minimum is 0 characters)',
+ 'can contain only letters, digits, \'_\', \'-\' and \'.\' and '\
+ 'space. It must start with letter, digit or \'_\'.'
+ ]
+ json_response['message']['path'].should == [
+ 'can\'t be blank',
+ 'is too short (minimum is 0 characters)',
+ 'can contain only letters, digits, \'_\', \'-\' and \'.\'. It must '\
+ 'start with letter, digit or \'_\', optionally preceeded by \'.\'. '\
+ 'It must not end in \'.git\'.'
+ ]
end
it "should assign attributes to project" do
@@ -254,7 +269,7 @@ describe API::API, api: true do
describe "GET /projects/:id" do
before { project }
- before { users_project }
+ before { project_member }
it "should return a project by id" do
get api("/projects/#{project.id}", user)
@@ -283,7 +298,10 @@ describe API::API, api: true do
describe 'permissions' do
context 'personal project' do
- before { get api("/projects/#{project.id}", user) }
+ before do
+ project.team << [user, :master]
+ get api("/projects/#{project.id}", user)
+ end
it { response.status.should == 200 }
it { json_response['permissions']["project_access"]["access_level"].should == Gitlab::Access::MASTER }
@@ -305,7 +323,7 @@ describe API::API, api: true do
end
describe "GET /projects/:id/events" do
- before { users_project }
+ before { project_member }
it "should return a project events" do
get api("/projects/#{project.id}/events", user)
@@ -407,9 +425,9 @@ describe API::API, api: true do
response.status.should == 200
end
- it "should return success when deleting unknown snippet id" do
+ it 'should return 404 when deleting unknown snippet id' do
delete api("/projects/#{project.id}/snippets/1234", user)
- response.status.should == 200
+ response.status.should == 404
end
end
@@ -456,7 +474,21 @@ describe API::API, api: true do
describe "POST /projects/:id/keys" do
it "should not create an invalid ssh key" do
post api("/projects/#{project.id}/keys", user), { title: "invalid key" }
- response.status.should == 404
+ response.status.should == 400
+ json_response['message']['key'].should == [
+ 'can\'t be blank',
+ 'is too short (minimum is 0 characters)',
+ 'is invalid'
+ ]
+ end
+
+ it 'should not create a key without title' do
+ post api("/projects/#{project.id}/keys", user), key: 'some key'
+ response.status.should == 400
+ json_response['message']['title'].should == [
+ 'can\'t be blank',
+ 'is too short (minimum is 0 characters)'
+ ]
end
it "should create new ssh key" do
diff --git a/spec/requests/api/repositories_spec.rb b/spec/requests/api/repositories_spec.rb
index f8603e11a04..a339dbfe9db 100644
--- a/spec/requests/api/repositories_spec.rb
+++ b/spec/requests/api/repositories_spec.rb
@@ -8,8 +8,8 @@ describe API::API, api: true do
let(:user) { create(:user) }
let(:user2) { create(:user) }
let!(:project) { create(:project, creator_id: user.id) }
- let!(:master) { create(:users_project, user: user, project: project, project_access: UsersProject::MASTER) }
- let!(:guest) { create(:users_project, user: user2, project: project, project_access: UsersProject::GUEST) }
+ let!(:master) { create(:project_member, user: user, project: project, access_level: ProjectMember::MASTER) }
+ let!(:guest) { create(:project_member, user: user2, project: project, access_level: ProjectMember::GUEST) }
before { project.team << [user, :reporter] }
@@ -23,22 +23,67 @@ describe API::API, api: true do
end
describe 'POST /projects/:id/repository/tags' do
- it 'should create a new tag' do
- post api("/projects/#{project.id}/repository/tags", user),
- tag_name: 'v1.0.0',
- ref: 'master'
-
- response.status.should == 201
- json_response['name'].should == 'v1.0.0'
+ context 'lightweight tags' do
+ it 'should create a new tag' do
+ post api("/projects/#{project.id}/repository/tags", user),
+ tag_name: 'v7.0.1',
+ ref: 'master'
+
+ response.status.should == 201
+ json_response['name'].should == 'v7.0.1'
+ end
end
+ # TODO: fix this test for CI
+ #context 'annotated tag' do
+ #it 'should create a new annotated tag' do
+ #post api("/projects/#{project.id}/repository/tags", user),
+ #tag_name: 'v7.1.0',
+ #ref: 'master',
+ #message: 'tag message'
+
+ #response.status.should == 201
+ #json_response['name'].should == 'v7.1.0'
+ # The message is not part of the JSON response.
+ # Additional changes to the gitlab_git gem may be required.
+ # json_response['message'].should == 'tag message'
+ #end
+ #end
+
it 'should deny for user without push access' do
post api("/projects/#{project.id}/repository/tags", user2),
- tag_name: 'v1.0.0',
+ tag_name: 'v1.9.0',
ref: '621491c677087aa243f165eab467bfdfbee00be1'
-
response.status.should == 403
end
+
+ it 'should return 400 if tag name is invalid' do
+ post api("/projects/#{project.id}/repository/tags", user),
+ tag_name: 'v 1.0.0',
+ ref: 'master'
+ response.status.should == 400
+ json_response['message'].should == 'Tag name invalid'
+ end
+
+ it 'should return 400 if tag already exists' do
+ post api("/projects/#{project.id}/repository/tags", user),
+ tag_name: 'v8.0.0',
+ ref: 'master'
+ response.status.should == 201
+ post api("/projects/#{project.id}/repository/tags", user),
+ tag_name: 'v8.0.0',
+ ref: 'master'
+ response.status.should == 400
+ json_response['message'].should == 'Tag already exists'
+ end
+
+ it 'should return 400 if ref name is invalid' do
+ post api("/projects/#{project.id}/repository/tags", user),
+ tag_name: 'mytag',
+ ref: 'foo'
+ response.status.should == 400
+ json_response['message'].should == 'Invalid reference name'
+ end
end
describe "GET /projects/:id/repository/tree" do
diff --git a/spec/requests/api/users_spec.rb b/spec/requests/api/users_spec.rb
index 8bbe9b5b736..b0752ebe43c 100644
--- a/spec/requests/api/users_spec.rb
+++ b/spec/requests/api/users_spec.rb
@@ -51,6 +51,7 @@ describe API::API, api: true do
it "should return a 404 error if user id not found" do
get api("/users/9999", user)
response.status.should == 404
+ json_response['message'].should == '404 Not found'
end
end
@@ -98,18 +99,47 @@ describe API::API, api: true do
end
it "should not create user with invalid email" do
- post api("/users", admin), { email: "invalid email", password: 'password' }
+ post api('/users', admin),
+ email: 'invalid email',
+ password: 'password',
+ name: 'test'
response.status.should == 400
end
- it "should return 400 error if password not given" do
- post api("/users", admin), { email: 'test@example.com' }
+ it 'should return 400 error if name not given' do
+ post api('/users', admin), email: 'test@example.com', password: 'pass1234'
+ response.status.should == 400
+ end
+
+ it 'should return 400 error if password not given' do
+ post api('/users', admin), email: 'test@example.com', name: 'test'
response.status.should == 400
end
it "should return 400 error if email not given" do
- post api("/users", admin), { password: 'pass1234' }
+ post api('/users', admin), password: 'pass1234', name: 'test'
+ response.status.should == 400
+ end
+
+ it 'should return 400 error if user does not validate' do
+ post api('/users', admin),
+ password: 'pass',
+ email: 'test@example.com',
+ username: 'test!',
+ name: 'test',
+ bio: 'g' * 256,
+ projects_limit: -1
response.status.should == 400
+ json_response['message']['password'].
+ should == ['is too short (minimum is 8 characters)']
+ json_response['message']['bio'].
+ should == ['is too long (maximum is 255 characters)']
+ json_response['message']['projects_limit'].
+ should == ['must be greater than or equal to 0']
+ json_response['message']['username'].
+ should == ['can contain only letters, digits, '\
+ '\'_\', \'-\' and \'.\'. It must start with letter, digit or '\
+ '\'_\', optionally preceeded by \'.\'. It must not end in \'.git\'.']
end
it "shouldn't available for non admin users" do
@@ -117,21 +147,37 @@ describe API::API, api: true do
response.status.should == 403
end
- context "with existing user" do
- before { post api("/users", admin), { email: 'test@example.com', password: 'password', username: 'test' } }
+ context 'with existing user' do
+ before do
+ post api('/users', admin),
+ email: 'test@example.com',
+ password: 'password',
+ username: 'test',
+ name: 'foo'
+ end
- it "should not create user with same email" do
+ it 'should return 409 conflict error if user with same email exists' do
expect {
- post api("/users", admin), { email: 'test@example.com', password: 'password' }
+ post api('/users', admin),
+ name: 'foo',
+ email: 'test@example.com',
+ password: 'password',
+ username: 'foo'
}.to change { User.count }.by(0)
+ response.status.should == 409
+ json_response['message'].should == 'Email has already been taken'
end
- it "should return 409 conflict error if user with email exists" do
- post api("/users", admin), { email: 'test@example.com', password: 'password' }
- end
-
- it "should return 409 conflict error if same username exists" do
- post api("/users", admin), { email: 'foo@example.com', password: 'pass', username: 'test' }
+ it 'should return 409 conflict error if same username exists' do
+ expect do
+ post api('/users', admin),
+ name: 'foo',
+ email: 'foo@example.com',
+ password: 'password',
+ username: 'test'
+ end.to change { User.count }.by(0)
+ response.status.should == 409
+ json_response['message'].should == 'Username has already been taken'
end
end
end
@@ -173,6 +219,20 @@ describe API::API, api: true do
user.reload.bio.should == 'new test bio'
end
+ it 'should update user with his own email' do
+ put api("/users/#{user.id}", admin), email: user.email
+ response.status.should == 200
+ json_response['email'].should == user.email
+ user.reload.email.should == user.email
+ end
+
+ it 'should update user with his own username' do
+ put api("/users/#{user.id}", admin), username: user.username
+ response.status.should == 200
+ json_response['username'].should == user.username
+ user.reload.username.should == user.username
+ end
+
it "should update admin status" do
put api("/users/#{user.id}", admin), {admin: true}
response.status.should == 200
@@ -190,7 +250,7 @@ describe API::API, api: true do
it "should not allow invalid update" do
put api("/users/#{user.id}", admin), {email: 'invalid email'}
- response.status.should == 404
+ response.status.should == 400
user.reload.email.should_not == 'invalid email'
end
@@ -202,25 +262,49 @@ describe API::API, api: true do
it "should return 404 for non-existing user" do
put api("/users/999999", admin), {bio: 'update should fail'}
response.status.should == 404
+ json_response['message'].should == '404 Not found'
+ end
+
+ it 'should return 400 error if user does not validate' do
+ put api("/users/#{user.id}", admin),
+ password: 'pass',
+ email: 'test@example.com',
+ username: 'test!',
+ name: 'test',
+ bio: 'g' * 256,
+ projects_limit: -1
+ response.status.should == 400
+ json_response['message']['password'].
+ should == ['is too short (minimum is 8 characters)']
+ json_response['message']['bio'].
+ should == ['is too long (maximum is 255 characters)']
+ json_response['message']['projects_limit'].
+ should == ['must be greater than or equal to 0']
+ json_response['message']['username'].
+ should == ['can contain only letters, digits, '\
+ '\'_\', \'-\' and \'.\'. It must start with letter, digit or '\
+ '\'_\', optionally preceeded by \'.\'. It must not end in \'.git\'.']
end
context "with existing user" do
before {
post api("/users", admin), { email: 'test@example.com', password: 'password', username: 'test', name: 'test' }
post api("/users", admin), { email: 'foo@bar.com', password: 'password', username: 'john', name: 'john' }
- @user_id = User.all.last.id
+ @user = User.all.last
}
-# it "should return 409 conflict error if email address exists" do
-# put api("/users/#{@user_id}", admin), { email: 'test@example.com' }
-# response.status.should == 409
-# end
-#
-# it "should return 409 conflict error if username taken" do
-# @user_id = User.all.last.id
-# put api("/users/#{@user_id}", admin), { username: 'test' }
-# response.status.should == 409
-# end
+ it 'should return 409 conflict error if email address exists' do
+ put api("/users/#{@user.id}", admin), email: 'test@example.com'
+ response.status.should == 409
+ @user.reload.email.should == @user.email
+ end
+
+ it 'should return 409 conflict error if username taken' do
+ @user_id = User.all.last.id
+ put api("/users/#{@user.id}", admin), username: 'test'
+ response.status.should == 409
+ @user.reload.username.should == @user.username
+ end
end
end
@@ -229,7 +313,14 @@ describe API::API, api: true do
it "should not create invalid ssh key" do
post api("/users/#{user.id}/keys", admin), { title: "invalid key" }
- response.status.should == 404
+ response.status.should == 400
+ json_response['message'].should == '400 (Bad request) "key" not given'
+ end
+
+ it 'should not create key without title' do
+ post api("/users/#{user.id}/keys", admin), key: 'some key'
+ response.status.should == 400
+ json_response['message'].should == '400 (Bad request) "title" not given'
end
it "should create ssh key" do
@@ -254,6 +345,7 @@ describe API::API, api: true do
it 'should return 404 for non-existing user' do
get api('/users/999999/keys', admin)
response.status.should == 404
+ json_response['message'].should == '404 User Not Found'
end
it 'should return array of ssh keys' do
@@ -292,11 +384,13 @@ describe API::API, api: true do
user.save
delete api("/users/999999/keys/#{key.id}", admin)
response.status.should == 404
+ json_response['message'].should == '404 User Not Found'
end
it 'should return 404 error if key not foud' do
delete api("/users/#{user.id}/keys/42", admin)
response.status.should == 404
+ json_response['message'].should == '404 Key Not Found'
end
end
end
@@ -324,6 +418,7 @@ describe API::API, api: true do
it "should return 404 for non-existing user" do
delete api("/users/999999", admin)
response.status.should == 404
+ json_response['message'].should == '404 User Not Found'
end
end
@@ -375,6 +470,7 @@ describe API::API, api: true do
it "should return 404 Not Found within invalid ID" do
get api("/user/keys/42", user)
response.status.should == 404
+ json_response['message'].should == '404 Not found'
end
it "should return 404 error if admin accesses user's ssh key" do
@@ -383,6 +479,7 @@ describe API::API, api: true do
admin
get api("/user/keys/#{key.id}", admin)
response.status.should == 404
+ json_response['message'].should == '404 Not found'
end
end
@@ -403,6 +500,13 @@ describe API::API, api: true do
it "should not create ssh key without key" do
post api("/user/keys", user), title: 'title'
response.status.should == 400
+ json_response['message'].should == '400 (Bad request) "key" not given'
+ end
+
+ it 'should not create ssh key without title' do
+ post api('/user/keys', user), key: 'some key'
+ response.status.should == 400
+ json_response['message'].should == '400 (Bad request) "title" not given'
end
it "should not create ssh key without title" do
diff --git a/spec/services/git_push_service_spec.rb b/spec/services/git_push_service_spec.rb
index fa99acabc78..9afa4953d61 100644
--- a/spec/services/git_push_service_spec.rb
+++ b/spec/services/git_push_service_spec.rb
@@ -14,6 +14,32 @@ describe GitPushService do
@ref = 'refs/heads/master'
end
+ describe 'Push branches' do
+ context 'new branch' do
+ subject do
+ service.execute(project, user, @blankrev, @newrev, @ref)
+ end
+
+ it { should be_true }
+ end
+
+ context 'existing branch' do
+ subject do
+ service.execute(project, user, @oldrev, @newrev, @ref)
+ end
+
+ it { should be_true }
+ end
+
+ context 'rm branch' do
+ subject do
+ service.execute(project, user, @oldrev, @blankrev, @ref)
+ end
+
+ it { should be_true }
+ end
+ end
+
describe "Git Push Data" do
before do
service.execute(project, user, @oldrev, @newrev, @ref)
diff --git a/spec/services/notification_service_spec.rb b/spec/services/notification_service_spec.rb
index df355f6f07a..f8377650e0a 100644
--- a/spec/services/notification_service_spec.rb
+++ b/spec/services/notification_service_spec.rb
@@ -64,12 +64,12 @@ describe NotificationService do
before do
note.project.namespace_id = group.id
- note.project.group.add_user(@u_watcher, UsersGroup::MASTER)
+ note.project.group.add_user(@u_watcher, GroupMember::MASTER)
note.project.save
- user_project = note.project.users_projects.find_by_user_id(@u_watcher.id)
+ user_project = note.project.project_members.find_by_user_id(@u_watcher.id)
user_project.notification_level = Notification::N_PARTICIPATING
user_project.save
- user_group = note.project.group.users_groups.find_by_user_id(@u_watcher.id)
+ user_group = note.project.group.group_members.find_by_user_id(@u_watcher.id)
user_group.notification_level = Notification::N_GLOBAL
user_group.save
end
diff --git a/spec/services/projects/update_service_spec.rb b/spec/services/projects/update_service_spec.rb
index 62357787521..5a10174eb36 100644
--- a/spec/services/projects/update_service_spec.rb
+++ b/spec/services/projects/update_service_spec.rb
@@ -48,7 +48,7 @@ describe Projects::UpdateService do
context 'respect configured visibility restrictions setting' do
before(:each) do
@restrictions = double("restrictions")
- @restrictions.stub(:restricted_visibility_levels) { [ Gitlab::VisibilityLevel::PUBLIC ] }
+ @restrictions.stub(:restricted_visibility_levels) { [ "public" ] }
Settings.stub_chain(:gitlab).and_return(@restrictions)
end
diff --git a/spec/services/search_service_spec.rb b/spec/services/search_service_spec.rb
index daffe98a8ed..3217c571e67 100644
--- a/spec/services/search_service_spec.rb
+++ b/spec/services/search_service_spec.rb
@@ -19,7 +19,7 @@ describe 'Search::GlobalService' do
it 'should return public projects only' do
context = Search::GlobalService.new(nil, search: "searchable")
results = context.execute
- results[:projects].should match_array [public_project]
+ results.objects('projects').should match_array [public_project]
end
end
@@ -27,19 +27,19 @@ describe 'Search::GlobalService' do
it 'should return public, internal and private projects' do
context = Search::GlobalService.new(user, search: "searchable")
results = context.execute
- results[:projects].should match_array [public_project, found_project, internal_project]
+ results.objects('projects').should match_array [public_project, found_project, internal_project]
end
it 'should return only public & internal projects' do
context = Search::GlobalService.new(internal_user, search: "searchable")
results = context.execute
- results[:projects].should match_array [internal_project, public_project]
+ results.objects('projects').should match_array [internal_project, public_project]
end
it 'namespace name should be searchable' do
context = Search::GlobalService.new(user, search: found_project.namespace.path)
results = context.execute
- results[:projects].should match_array [found_project]
+ results.objects('projects').should match_array [found_project]
end
end
end
diff --git a/spec/services/system_hooks_service_spec.rb b/spec/services/system_hooks_service_spec.rb
index 3c2eec6cfd9..573446d3a19 100644
--- a/spec/services/system_hooks_service_spec.rb
+++ b/spec/services/system_hooks_service_spec.rb
@@ -3,15 +3,18 @@ require 'spec_helper'
describe SystemHooksService do
let (:user) { create :user }
let (:project) { create :project }
- let (:users_project) { create :users_project }
+ let (:project_member) { create :project_member }
+ let (:key) { create(:key, user: user) }
context 'event data' do
it { event_data(user, :create).should include(:event_name, :name, :created_at, :email, :user_id) }
it { event_data(user, :destroy).should include(:event_name, :name, :created_at, :email, :user_id) }
it { event_data(project, :create).should include(:event_name, :name, :created_at, :path, :project_id, :owner_name, :owner_email, :project_visibility) }
it { event_data(project, :destroy).should include(:event_name, :name, :created_at, :path, :project_id, :owner_name, :owner_email, :project_visibility) }
- it { event_data(users_project, :create).should include(:event_name, :created_at, :project_name, :project_path, :project_id, :user_name, :user_email, :project_access, :project_visibility) }
- it { event_data(users_project, :destroy).should include(:event_name, :created_at, :project_name, :project_path, :project_id, :user_name, :user_email, :project_access, :project_visibility) }
+ it { event_data(project_member, :create).should include(:event_name, :created_at, :project_name, :project_path, :project_id, :user_name, :user_email, :access_level, :project_visibility) }
+ it { event_data(project_member, :destroy).should include(:event_name, :created_at, :project_name, :project_path, :project_id, :user_name, :user_email, :access_level, :project_visibility) }
+ it { event_data(key, :create).should include(:username, :key, :id) }
+ it { event_data(key, :destroy).should include(:username, :key, :id) }
end
context 'event names' do
@@ -19,8 +22,10 @@ describe SystemHooksService do
it { event_name(user, :destroy).should eq "user_destroy" }
it { event_name(project, :create).should eq "project_create" }
it { event_name(project, :destroy).should eq "project_destroy" }
- it { event_name(users_project, :create).should eq "user_add_to_team" }
- it { event_name(users_project, :destroy).should eq "user_remove_from_team" }
+ it { event_name(project_member, :create).should eq "user_add_to_team" }
+ it { event_name(project_member, :destroy).should eq "user_remove_from_team" }
+ it { event_name(key, :create).should eq 'key_create' }
+ it { event_name(key, :destroy).should eq 'key_destroy' }
end
def event_data(*args)
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 6934cabadfa..60322b67a79 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -1,14 +1,14 @@
-# This file is copied to spec/ when you run 'rails generate rspec:install'
-ENV["RAILS_ENV"] ||= 'test'
-require File.expand_path("../../config/environment", __FILE__)
-
-require 'simplecov' unless ENV['CI']
+if ENV['SIMPLECOV']
+ require 'simplecov'
+end
-if ENV['TRAVIS']
+if ENV['COVERALLS']
require 'coveralls'
- Coveralls.wear!
+ Coveralls.wear_merged!('rails')
end
+ENV["RAILS_ENV"] ||= 'test'
+require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
require 'capybara/rails'
require 'capybara/rspec'
diff --git a/spec/support/login_helpers.rb b/spec/support/login_helpers.rb
index 238ac7c6611..cd8a076318c 100644
--- a/spec/support/login_helpers.rb
+++ b/spec/support/login_helpers.rb
@@ -21,6 +21,6 @@ module LoginHelpers
# Requires Javascript driver.
def logout
- page.find(:css, ".icon-signout").click
+ find(:css, ".icon-signout").click
end
end
diff --git a/spec/support/matchers.rb b/spec/support/matchers.rb
index 15fb47004e9..52b11bd6323 100644
--- a/spec/support/matchers.rb
+++ b/spec/support/matchers.rb
@@ -42,19 +42,19 @@ module UrlAccess
def url_allowed?(user, url)
emulate_user(user)
visit url
- (page.status_code != 404 && current_path != new_user_session_path)
+ (status_code != 404 && current_path != new_user_session_path)
end
def url_denied?(user, url)
emulate_user(user)
visit url
- (page.status_code == 404 || current_path == new_user_session_path)
+ (status_code == 404 || current_path == new_user_session_path)
end
def url_404?(user, url)
emulate_user(user)
visit url
- page.status_code == 404
+ status_code == 404
end
def emulate_user(user)
diff --git a/spec/support/select2_helper.rb b/spec/support/select2_helper.rb
index 32c1ded2e9d..c7cf109a7bb 100644
--- a/spec/support/select2_helper.rb
+++ b/spec/support/select2_helper.rb
@@ -17,9 +17,9 @@ module Select2Helper
selector = options[:from]
if options[:multiple]
- page.execute_script("$('#{selector}').select2('val', ['#{value}']);")
+ execute_script("$('#{selector}').select2('val', ['#{value}']);")
else
- page.execute_script("$('#{selector}').select2('val', '#{value}');")
+ execute_script("$('#{selector}').select2('val', '#{value}');")
end
end
end
diff --git a/spec/support/test_env.rb b/spec/support/test_env.rb
index e67c29a6783..4b0a3856f89 100644
--- a/spec/support/test_env.rb
+++ b/spec/support/test_env.rb
@@ -17,7 +17,11 @@ module TestEnv
tmp_test_path = Rails.root.join('tmp', 'tests')
if File.directory?(tmp_test_path)
- FileUtils.rm_r(tmp_test_path)
+ Dir.entries(tmp_test_path).each do |entry|
+ unless ['.', '..', 'gitlab-shell'].include?(entry)
+ FileUtils.rm_r(File.join(tmp_test_path, entry))
+ end
+ end
end
FileUtils.mkdir_p(tmp_test_path)
@@ -38,9 +42,7 @@ module TestEnv
end
def setup_gitlab_shell
- unless File.directory?(Gitlab.config.gitlab_shell.path)
- %x[rake gitlab:shell:install]
- end
+ `rake gitlab:shell:install`
end
def setup_factory_repo
diff --git a/spec/workers/post_receive_spec.rb b/spec/workers/post_receive_spec.rb
index e6bf79b853c..4273fd1019a 100644
--- a/spec/workers/post_receive_spec.rb
+++ b/spec/workers/post_receive_spec.rb
@@ -1,7 +1,6 @@
require 'spec_helper'
describe PostReceive do
-
context "as a resque worker" do
it "reponds to #perform" do
PostReceive.new.should respond_to(:perform)
@@ -15,7 +14,7 @@ describe PostReceive do
it "fetches the correct project" do
Project.should_receive(:find_with_namespace).with(project.path_with_namespace).and_return(project)
- PostReceive.new.perform(pwd(project), 'sha-old', 'sha-new', 'refs/heads/master', key_id)
+ PostReceive.new.perform(pwd(project), key_id, changes)
end
it "does not run if the author is not in the project" do
@@ -23,7 +22,7 @@ describe PostReceive do
project.should_not_receive(:execute_hooks)
- PostReceive.new.perform(pwd(project), 'sha-old', 'sha-new', 'refs/heads/master', key_id).should be_false
+ PostReceive.new.perform(pwd(project), key_id, changes).should be_false
end
it "asks the project to trigger all hooks" do
@@ -32,11 +31,15 @@ describe PostReceive do
project.should_receive(:execute_services)
project.should_receive(:update_merge_requests)
- PostReceive.new.perform(pwd(project), 'sha-old', 'sha-new', 'refs/heads/master', key_id)
+ PostReceive.new.perform(pwd(project), key_id, changes)
end
end
def pwd(project)
File.join(Gitlab.config.gitlab_shell.repos_path, project.path_with_namespace)
end
+
+ def changes
+ 'd14d6c0abdd253381df51a723d58691b2ee1ab08 570e7b2abdd848b95f2f578043fc23bd6f6fd24d refs/heads/master'
+ end
end
diff --git a/vendor/assets/javascripts/chart-lib.min.js b/vendor/assets/javascripts/chart-lib.min.js
new file mode 100755
index 00000000000..626e6c3cdb9
--- /dev/null
+++ b/vendor/assets/javascripts/chart-lib.min.js
@@ -0,0 +1,11 @@
+/*!
+ * Chart.js
+ * http://chartjs.org/
+ * Version: 1.0.1-beta.4
+ *
+ * Copyright 2014 Nick Downie
+ * Released under the MIT license
+ * https://github.com/nnnick/Chart.js/blob/master/LICENSE.md
+ */
+(function(){"use strict";var t=this,i=t.Chart,e=function(t){this.canvas=t.canvas,this.ctx=t;this.width=t.canvas.width,this.height=t.canvas.height;return this.aspectRatio=this.width/this.height,s.retinaScale(this),this};e.defaults={global:{animation:!0,animationSteps:60,animationEasing:"easeOutQuart",showScale:!0,scaleOverride:!1,scaleSteps:null,scaleStepWidth:null,scaleStartValue:null,scaleLineColor:"rgba(0,0,0,.1)",scaleLineWidth:1,scaleShowLabels:!0,scaleLabel:"<%=value%>",scaleIntegersOnly:!0,scaleBeginAtZero:!1,scaleFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",scaleFontSize:12,scaleFontStyle:"normal",scaleFontColor:"#666",responsive:!1,maintainAspectRatio:!0,showTooltips:!0,tooltipEvents:["mousemove","touchstart","touchmove","mouseout"],tooltipFillColor:"rgba(0,0,0,0.8)",tooltipFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",tooltipFontSize:14,tooltipFontStyle:"normal",tooltipFontColor:"#fff",tooltipTitleFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",tooltipTitleFontSize:14,tooltipTitleFontStyle:"bold",tooltipTitleFontColor:"#fff",tooltipYPadding:6,tooltipXPadding:6,tooltipCaretSize:8,tooltipCornerRadius:6,tooltipXOffset:10,tooltipTemplate:"<%if (label){%><%=label%>: <%}%><%= value %>",multiTooltipTemplate:"<%= value %>",multiTooltipKeyBackground:"#fff",onAnimationProgress:function(){},onAnimationComplete:function(){}}},e.types={};var s=e.helpers={},n=s.each=function(t,i,e){var s=Array.prototype.slice.call(arguments,3);if(t)if(t.length===+t.length){var n;for(n=0;n<t.length;n++)i.apply(e,[t[n],n].concat(s))}else for(var o in t)i.apply(e,[t[o],o].concat(s))},o=s.clone=function(t){var i={};return n(t,function(e,s){t.hasOwnProperty(s)&&(i[s]=e)}),i},a=s.extend=function(t){return n(Array.prototype.slice.call(arguments,1),function(i){n(i,function(e,s){i.hasOwnProperty(s)&&(t[s]=e)})}),t},h=s.merge=function(){var t=Array.prototype.slice.call(arguments,0);return t.unshift({}),a.apply(null,t)},l=s.indexOf=function(t,i){if(Array.prototype.indexOf)return t.indexOf(i);for(var e=0;e<t.length;e++)if(t[e]===i)return e;return-1},r=(s.where=function(t,i){var e=[];return s.each(t,function(t){i(t)&&e.push(t)}),e},s.findNextWhere=function(t,i,e){e||(e=-1);for(var s=e+1;s<t.length;s++){var n=t[s];if(i(n))return n}},s.findPreviousWhere=function(t,i,e){e||(e=t.length);for(var s=e-1;s>=0;s--){var n=t[s];if(i(n))return n}},s.inherits=function(t){var i=this,e=t&&t.hasOwnProperty("constructor")?t.constructor:function(){return i.apply(this,arguments)},s=function(){this.constructor=e};return s.prototype=i.prototype,e.prototype=new s,e.extend=r,t&&a(e.prototype,t),e.__super__=i.prototype,e}),c=s.noop=function(){},u=s.uid=function(){var t=0;return function(){return"chart-"+t++}}(),d=s.warn=function(t){window.console&&"function"==typeof window.console.warn&&console.warn(t)},p=s.amd="function"==typeof t.define&&t.define.amd,f=s.isNumber=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},g=s.max=function(t){return Math.max.apply(Math,t)},m=s.min=function(t){return Math.min.apply(Math,t)},v=(s.cap=function(t,i,e){if(f(i)){if(t>i)return i}else if(f(e)&&e>t)return e;return t},s.getDecimalPlaces=function(t){return t%1!==0&&f(t)?t.toString().split(".")[1].length:0}),x=s.radians=function(t){return t*(Math.PI/180)},S=(s.getAngleFromPoint=function(t,i){var e=i.x-t.x,s=i.y-t.y,n=Math.sqrt(e*e+s*s),o=2*Math.PI+Math.atan2(s,e);return 0>e&&0>s&&(o+=2*Math.PI),{angle:o,distance:n}},s.aliasPixel=function(t){return t%2===0?0:.5}),y=(s.splineCurve=function(t,i,e,s){var n=Math.sqrt(Math.pow(i.x-t.x,2)+Math.pow(i.y-t.y,2)),o=Math.sqrt(Math.pow(e.x-i.x,2)+Math.pow(e.y-i.y,2)),a=s*n/(n+o),h=s*o/(n+o);return{inner:{x:i.x-a*(e.x-t.x),y:i.y-a*(e.y-t.y)},outer:{x:i.x+h*(e.x-t.x),y:i.y+h*(e.y-t.y)}}},s.calculateOrderOfMagnitude=function(t){return Math.floor(Math.log(t)/Math.LN10)}),C=(s.calculateScaleRange=function(t,i,e,s,n){var o=2,a=Math.floor(i/(1.5*e)),h=o>=a,l=g(t),r=m(t);l===r&&(l+=.5,r>=.5&&!s?r-=.5:l+=.5);for(var c=Math.abs(l-r),u=y(c),d=Math.ceil(l/(1*Math.pow(10,u)))*Math.pow(10,u),p=s?0:Math.floor(r/(1*Math.pow(10,u)))*Math.pow(10,u),f=d-p,v=Math.pow(10,u),x=Math.round(f/v);(x>a||a>2*x)&&!h;)if(x>a)v*=2,x=Math.round(f/v),x%1!==0&&(h=!0);else if(n&&u>=0){if(v/2%1!==0)break;v/=2,x=Math.round(f/v)}else v/=2,x=Math.round(f/v);return h&&(x=o,v=f/x),{steps:x,stepValue:v,min:p,max:p+x*v}},s.template=function(t,i){function e(t,i){var e=/\W/.test(t)?new Function("obj","var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('"+t.replace(/[\r\t\n]/g," ").split("<%").join(" ").replace(/((^|%>)[^\t]*)'/g,"$1\r").replace(/\t=(.*?)%>/g,"',$1,'").split(" ").join("');").split("%>").join("p.push('").split("\r").join("\\'")+"');}return p.join('');"):s[t]=s[t];return i?e(i):e}if(t instanceof Function)return t(i);var s={};return e(t,i)}),b=(s.generateLabels=function(t,i,e,s){var o=new Array(i);return labelTemplateString&&n(o,function(i,n){o[n]=C(t,{value:e+s*(n+1)})}),o},s.easingEffects={linear:function(t){return t},easeInQuad:function(t){return t*t},easeOutQuad:function(t){return-1*t*(t-2)},easeInOutQuad:function(t){return(t/=.5)<1?.5*t*t:-0.5*(--t*(t-2)-1)},easeInCubic:function(t){return t*t*t},easeOutCubic:function(t){return 1*((t=t/1-1)*t*t+1)},easeInOutCubic:function(t){return(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},easeInQuart:function(t){return t*t*t*t},easeOutQuart:function(t){return-1*((t=t/1-1)*t*t*t-1)},easeInOutQuart:function(t){return(t/=.5)<1?.5*t*t*t*t:-0.5*((t-=2)*t*t*t-2)},easeInQuint:function(t){return 1*(t/=1)*t*t*t*t},easeOutQuint:function(t){return 1*((t=t/1-1)*t*t*t*t+1)},easeInOutQuint:function(t){return(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},easeInSine:function(t){return-1*Math.cos(t/1*(Math.PI/2))+1},easeOutSine:function(t){return 1*Math.sin(t/1*(Math.PI/2))},easeInOutSine:function(t){return-0.5*(Math.cos(Math.PI*t/1)-1)},easeInExpo:function(t){return 0===t?1:1*Math.pow(2,10*(t/1-1))},easeOutExpo:function(t){return 1===t?1:1*(-Math.pow(2,-10*t/1)+1)},easeInOutExpo:function(t){return 0===t?0:1===t?1:(t/=.5)<1?.5*Math.pow(2,10*(t-1)):.5*(-Math.pow(2,-10*--t)+2)},easeInCirc:function(t){return t>=1?t:-1*(Math.sqrt(1-(t/=1)*t)-1)},easeOutCirc:function(t){return 1*Math.sqrt(1-(t=t/1-1)*t)},easeInOutCirc:function(t){return(t/=.5)<1?-0.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},easeInElastic:function(t){var i=1.70158,e=0,s=1;return 0===t?0:1==(t/=1)?1:(e||(e=.3),s<Math.abs(1)?(s=1,i=e/4):i=e/(2*Math.PI)*Math.asin(1/s),-(s*Math.pow(2,10*(t-=1))*Math.sin(2*(1*t-i)*Math.PI/e)))},easeOutElastic:function(t){var i=1.70158,e=0,s=1;return 0===t?0:1==(t/=1)?1:(e||(e=.3),s<Math.abs(1)?(s=1,i=e/4):i=e/(2*Math.PI)*Math.asin(1/s),s*Math.pow(2,-10*t)*Math.sin(2*(1*t-i)*Math.PI/e)+1)},easeInOutElastic:function(t){var i=1.70158,e=0,s=1;return 0===t?0:2==(t/=.5)?1:(e||(e=.3*1.5),s<Math.abs(1)?(s=1,i=e/4):i=e/(2*Math.PI)*Math.asin(1/s),1>t?-.5*s*Math.pow(2,10*(t-=1))*Math.sin(2*(1*t-i)*Math.PI/e):s*Math.pow(2,-10*(t-=1))*Math.sin(2*(1*t-i)*Math.PI/e)*.5+1)},easeInBack:function(t){var i=1.70158;return 1*(t/=1)*t*((i+1)*t-i)},easeOutBack:function(t){var i=1.70158;return 1*((t=t/1-1)*t*((i+1)*t+i)+1)},easeInOutBack:function(t){var i=1.70158;return(t/=.5)<1?.5*t*t*(((i*=1.525)+1)*t-i):.5*((t-=2)*t*(((i*=1.525)+1)*t+i)+2)},easeInBounce:function(t){return 1-b.easeOutBounce(1-t)},easeOutBounce:function(t){return(t/=1)<1/2.75?7.5625*t*t:2/2.75>t?1*(7.5625*(t-=1.5/2.75)*t+.75):2.5/2.75>t?1*(7.5625*(t-=2.25/2.75)*t+.9375):1*(7.5625*(t-=2.625/2.75)*t+.984375)},easeInOutBounce:function(t){return.5>t?.5*b.easeInBounce(2*t):.5*b.easeOutBounce(2*t-1)+.5}}),w=s.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return window.setTimeout(t,1e3/60)}}(),P=(s.cancelAnimFrame=function(){return window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.oCancelAnimationFrame||window.msCancelAnimationFrame||function(t){return window.clearTimeout(t,1e3/60)}}(),s.animationLoop=function(t,i,e,s,n,o){var a=0,h=b[e]||b.linear,l=function(){a++;var e=a/i,r=h(e);t.call(o,r,e,a),s.call(o,r,e),i>a?o.animationFrame=w(l):n.apply(o)};w(l)},s.getRelativePosition=function(t){var i,e,s=t.originalEvent||t,n=t.currentTarget||t.srcElement,o=n.getBoundingClientRect();return s.touches?(i=s.touches[0].clientX-o.left,e=s.touches[0].clientY-o.top):(i=s.clientX-o.left,e=s.clientY-o.top),{x:i,y:e}},s.addEvent=function(t,i,e){t.addEventListener?t.addEventListener(i,e):t.attachEvent?t.attachEvent("on"+i,e):t["on"+i]=e}),L=s.removeEvent=function(t,i,e){t.removeEventListener?t.removeEventListener(i,e,!1):t.detachEvent?t.detachEvent("on"+i,e):t["on"+i]=c},k=(s.bindEvents=function(t,i,e){t.events||(t.events={}),n(i,function(i){t.events[i]=function(){e.apply(t,arguments)},P(t.chart.canvas,i,t.events[i])})},s.unbindEvents=function(t,i){n(i,function(i,e){L(t.chart.canvas,e,i)})}),F=s.getMaximumWidth=function(t){var i=t.parentNode;return i.clientWidth},R=s.getMaximumHeight=function(t){var i=t.parentNode;return i.clientHeight},A=(s.getMaximumSize=s.getMaximumWidth,s.retinaScale=function(t){var i=t.ctx,e=t.canvas.width,s=t.canvas.height;window.devicePixelRatio&&(i.canvas.style.width=e+"px",i.canvas.style.height=s+"px",i.canvas.height=s*window.devicePixelRatio,i.canvas.width=e*window.devicePixelRatio,i.scale(window.devicePixelRatio,window.devicePixelRatio))}),T=s.clear=function(t){t.ctx.clearRect(0,0,t.width,t.height)},M=s.fontString=function(t,i,e){return i+" "+t+"px "+e},W=s.longestText=function(t,i,e){t.font=i;var s=0;return n(e,function(i){var e=t.measureText(i).width;s=e>s?e:s}),s},z=s.drawRoundedRectangle=function(t,i,e,s,n,o){t.beginPath(),t.moveTo(i+o,e),t.lineTo(i+s-o,e),t.quadraticCurveTo(i+s,e,i+s,e+o),t.lineTo(i+s,e+n-o),t.quadraticCurveTo(i+s,e+n,i+s-o,e+n),t.lineTo(i+o,e+n),t.quadraticCurveTo(i,e+n,i,e+n-o),t.lineTo(i,e+o),t.quadraticCurveTo(i,e,i+o,e),t.closePath()};e.instances={},e.Type=function(t,i,s){this.options=i,this.chart=s,this.id=u(),e.instances[this.id]=this,i.responsive&&this.resize(),this.initialize.call(this,t)},a(e.Type.prototype,{initialize:function(){return this},clear:function(){return T(this.chart),this},stop:function(){return s.cancelAnimFrame.call(t,this.animationFrame),this},resize:function(t){this.stop();var i=this.chart.canvas,e=F(this.chart.canvas),s=this.options.maintainAspectRatio?e/this.chart.aspectRatio:R(this.chart.canvas);return i.width=this.chart.width=e,i.height=this.chart.height=s,A(this.chart),"function"==typeof t&&t.apply(this,Array.prototype.slice.call(arguments,1)),this},reflow:c,render:function(t){return t&&this.reflow(),this.options.animation&&!t?s.animationLoop(this.draw,this.options.animationSteps,this.options.animationEasing,this.options.onAnimationProgress,this.options.onAnimationComplete,this):(this.draw(),this.options.onAnimationComplete.call(this)),this},generateLegend:function(){return C(this.options.legendTemplate,this)},destroy:function(){this.clear(),k(this,this.events),delete e.instances[this.id]},showTooltip:function(t,i){"undefined"==typeof this.activeElements&&(this.activeElements=[]);var o=function(t){var i=!1;return t.length!==this.activeElements.length?i=!0:(n(t,function(t,e){t!==this.activeElements[e]&&(i=!0)},this),i)}.call(this,t);if(o||i){if(this.activeElements=t,this.draw(),t.length>0)if(this.datasets&&this.datasets.length>1){for(var a,h,r=this.datasets.length-1;r>=0&&(a=this.datasets[r].points||this.datasets[r].bars||this.datasets[r].segments,h=l(a,t[0]),-1===h);r--);var c=[],u=[],d=function(){var t,i,e,n,o,a=[],l=[],r=[];return s.each(this.datasets,function(i){t=i.points||i.bars||i.segments,t[h]&&t[h].hasValue()&&a.push(t[h])}),s.each(a,function(t){l.push(t.x),r.push(t.y),c.push(s.template(this.options.multiTooltipTemplate,t)),u.push({fill:t._saved.fillColor||t.fillColor,stroke:t._saved.strokeColor||t.strokeColor})},this),o=m(r),e=g(r),n=m(l),i=g(l),{x:n>this.chart.width/2?n:i,y:(o+e)/2}}.call(this,h);new e.MultiTooltip({x:d.x,y:d.y,xPadding:this.options.tooltipXPadding,yPadding:this.options.tooltipYPadding,xOffset:this.options.tooltipXOffset,fillColor:this.options.tooltipFillColor,textColor:this.options.tooltipFontColor,fontFamily:this.options.tooltipFontFamily,fontStyle:this.options.tooltipFontStyle,fontSize:this.options.tooltipFontSize,titleTextColor:this.options.tooltipTitleFontColor,titleFontFamily:this.options.tooltipTitleFontFamily,titleFontStyle:this.options.tooltipTitleFontStyle,titleFontSize:this.options.tooltipTitleFontSize,cornerRadius:this.options.tooltipCornerRadius,labels:c,legendColors:u,legendColorBackground:this.options.multiTooltipKeyBackground,title:t[0].label,chart:this.chart,ctx:this.chart.ctx}).draw()}else n(t,function(t){var i=t.tooltipPosition();new e.Tooltip({x:Math.round(i.x),y:Math.round(i.y),xPadding:this.options.tooltipXPadding,yPadding:this.options.tooltipYPadding,fillColor:this.options.tooltipFillColor,textColor:this.options.tooltipFontColor,fontFamily:this.options.tooltipFontFamily,fontStyle:this.options.tooltipFontStyle,fontSize:this.options.tooltipFontSize,caretHeight:this.options.tooltipCaretSize,cornerRadius:this.options.tooltipCornerRadius,text:C(this.options.tooltipTemplate,t),chart:this.chart}).draw()},this);return this}},toBase64Image:function(){return this.chart.canvas.toDataURL.apply(this.chart.canvas,arguments)}}),e.Type.extend=function(t){var i=this,s=function(){return i.apply(this,arguments)};if(s.prototype=o(i.prototype),a(s.prototype,t),s.extend=e.Type.extend,t.name||i.prototype.name){var n=t.name||i.prototype.name,l=e.defaults[i.prototype.name]?o(e.defaults[i.prototype.name]):{};e.defaults[n]=a(l,t.defaults),e.types[n]=s,e.prototype[n]=function(t,i){var o=h(e.defaults.global,e.defaults[n],i||{});return new s(t,o,this)}}else d("Name not provided for this chart, so it hasn't been registered");return i},e.Element=function(t){a(this,t),this.initialize.apply(this,arguments),this.save()},a(e.Element.prototype,{initialize:function(){},restore:function(t){return t?n(t,function(t){this[t]=this._saved[t]},this):a(this,this._saved),this},save:function(){return this._saved=o(this),delete this._saved._saved,this},update:function(t){return n(t,function(t,i){this._saved[i]=this[i],this[i]=t},this),this},transition:function(t,i){return n(t,function(t,e){this[e]=(t-this._saved[e])*i+this._saved[e]},this),this},tooltipPosition:function(){return{x:this.x,y:this.y}},hasValue:function(){return f(this.value)}}),e.Element.extend=r,e.Point=e.Element.extend({display:!0,inRange:function(t,i){var e=this.hitDetectionRadius+this.radius;return Math.pow(t-this.x,2)+Math.pow(i-this.y,2)<Math.pow(e,2)},draw:function(){if(this.display){var t=this.ctx;t.beginPath(),t.arc(this.x,this.y,this.radius,0,2*Math.PI),t.closePath(),t.strokeStyle=this.strokeColor,t.lineWidth=this.strokeWidth,t.fillStyle=this.fillColor,t.fill(),t.stroke()}}}),e.Arc=e.Element.extend({inRange:function(t,i){var e=s.getAngleFromPoint(this,{x:t,y:i}),n=e.angle>=this.startAngle&&e.angle<=this.endAngle,o=e.distance>=this.innerRadius&&e.distance<=this.outerRadius;return n&&o},tooltipPosition:function(){var t=this.startAngle+(this.endAngle-this.startAngle)/2,i=(this.outerRadius-this.innerRadius)/2+this.innerRadius;return{x:this.x+Math.cos(t)*i,y:this.y+Math.sin(t)*i}},draw:function(t){var i=this.ctx;i.beginPath(),i.arc(this.x,this.y,this.outerRadius,this.startAngle,this.endAngle),i.arc(this.x,this.y,this.innerRadius,this.endAngle,this.startAngle,!0),i.closePath(),i.strokeStyle=this.strokeColor,i.lineWidth=this.strokeWidth,i.fillStyle=this.fillColor,i.fill(),i.lineJoin="bevel",this.showStroke&&i.stroke()}}),e.Rectangle=e.Element.extend({draw:function(){var t=this.ctx,i=this.width/2,e=this.x-i,s=this.x+i,n=this.base-(this.base-this.y),o=this.strokeWidth/2;this.showStroke&&(e+=o,s-=o,n+=o),t.beginPath(),t.fillStyle=this.fillColor,t.strokeStyle=this.strokeColor,t.lineWidth=this.strokeWidth,t.moveTo(e,this.base),t.lineTo(e,n),t.lineTo(s,n),t.lineTo(s,this.base),t.fill(),this.showStroke&&t.stroke()},height:function(){return this.base-this.y},inRange:function(t,i){return t>=this.x-this.width/2&&t<=this.x+this.width/2&&i>=this.y&&i<=this.base}}),e.Tooltip=e.Element.extend({draw:function(){var t=this.chart.ctx;t.font=M(this.fontSize,this.fontStyle,this.fontFamily),this.xAlign="center",this.yAlign="above";var i=2,e=t.measureText(this.text).width+2*this.xPadding,s=this.fontSize+2*this.yPadding,n=s+this.caretHeight+i;this.x+e/2>this.chart.width?this.xAlign="left":this.x-e/2<0&&(this.xAlign="right"),this.y-n<0&&(this.yAlign="below");var o=this.x-e/2,a=this.y-n;switch(t.fillStyle=this.fillColor,this.yAlign){case"above":t.beginPath(),t.moveTo(this.x,this.y-i),t.lineTo(this.x+this.caretHeight,this.y-(i+this.caretHeight)),t.lineTo(this.x-this.caretHeight,this.y-(i+this.caretHeight)),t.closePath(),t.fill();break;case"below":a=this.y+i+this.caretHeight,t.beginPath(),t.moveTo(this.x,this.y+i),t.lineTo(this.x+this.caretHeight,this.y+i+this.caretHeight),t.lineTo(this.x-this.caretHeight,this.y+i+this.caretHeight),t.closePath(),t.fill()}switch(this.xAlign){case"left":o=this.x-e+(this.cornerRadius+this.caretHeight);break;case"right":o=this.x-(this.cornerRadius+this.caretHeight)}z(t,o,a,e,s,this.cornerRadius),t.fill(),t.fillStyle=this.textColor,t.textAlign="center",t.textBaseline="middle",t.fillText(this.text,o+e/2,a+s/2)}}),e.MultiTooltip=e.Element.extend({initialize:function(){this.font=M(this.fontSize,this.fontStyle,this.fontFamily),this.titleFont=M(this.titleFontSize,this.titleFontStyle,this.titleFontFamily),this.height=this.labels.length*this.fontSize+(this.labels.length-1)*(this.fontSize/2)+2*this.yPadding+1.5*this.titleFontSize,this.ctx.font=this.titleFont;var t=this.ctx.measureText(this.title).width,i=W(this.ctx,this.font,this.labels)+this.fontSize+3,e=g([i,t]);this.width=e+2*this.xPadding;var s=this.height/2;this.y-s<0?this.y=s:this.y+s>this.chart.height&&(this.y=this.chart.height-s),this.x>this.chart.width/2?this.x-=this.xOffset+this.width:this.x+=this.xOffset},getLineHeight:function(t){var i=this.y-this.height/2+this.yPadding,e=t-1;return 0===t?i+this.titleFontSize/2:i+(1.5*this.fontSize*e+this.fontSize/2)+1.5*this.titleFontSize},draw:function(){z(this.ctx,this.x,this.y-this.height/2,this.width,this.height,this.cornerRadius);var t=this.ctx;t.fillStyle=this.fillColor,t.fill(),t.closePath(),t.textAlign="left",t.textBaseline="middle",t.fillStyle=this.titleTextColor,t.font=this.titleFont,t.fillText(this.title,this.x+this.xPadding,this.getLineHeight(0)),t.font=this.font,s.each(this.labels,function(i,e){t.fillStyle=this.textColor,t.fillText(i,this.x+this.xPadding+this.fontSize+3,this.getLineHeight(e+1)),t.fillStyle=this.legendColorBackground,t.fillRect(this.x+this.xPadding,this.getLineHeight(e+1)-this.fontSize/2,this.fontSize,this.fontSize),t.fillStyle=this.legendColors[e].fill,t.fillRect(this.x+this.xPadding,this.getLineHeight(e+1)-this.fontSize/2,this.fontSize,this.fontSize)},this)}}),e.Scale=e.Element.extend({initialize:function(){this.fit()},buildYLabels:function(){this.yLabels=[];for(var t=v(this.stepValue),i=0;i<=this.steps;i++)this.yLabels.push(C(this.templateString,{value:(this.min+i*this.stepValue).toFixed(t)}));this.yLabelWidth=this.display&&this.showLabels?W(this.ctx,this.font,this.yLabels):0},addXLabel:function(t){this.xLabels.push(t),this.valuesCount++,this.fit()},removeXLabel:function(){this.xLabels.shift(),this.valuesCount--,this.fit()},fit:function(){this.startPoint=this.display?this.fontSize:0,this.endPoint=this.display?this.height-1.5*this.fontSize-5:this.height,this.startPoint+=this.padding,this.endPoint-=this.padding;var t,i=this.endPoint-this.startPoint;for(this.calculateYRange(i),this.buildYLabels(),this.calculateXLabelRotation();i>this.endPoint-this.startPoint;)i=this.endPoint-this.startPoint,t=this.yLabelWidth,this.calculateYRange(i),this.buildYLabels(),t<this.yLabelWidth&&this.calculateXLabelRotation()},calculateXLabelRotation:function(){this.ctx.font=this.font;var t,i,e=this.ctx.measureText(this.xLabels[0]).width,s=this.ctx.measureText(this.xLabels[this.xLabels.length-1]).width;if(this.xScalePaddingRight=s/2+3,this.xScalePaddingLeft=e/2>this.yLabelWidth+10?e/2:this.yLabelWidth+10,this.xLabelRotation=0,this.display){var n,o=W(this.ctx,this.font,this.xLabels);this.xLabelWidth=o;for(var a=Math.floor(this.calculateX(1)-this.calculateX(0))-6;this.xLabelWidth>a&&0===this.xLabelRotation||this.xLabelWidth>a&&this.xLabelRotation<=90&&this.xLabelRotation>0;)n=Math.cos(x(this.xLabelRotation)),t=n*e,i=n*s,t+this.fontSize/2>this.yLabelWidth+8&&(this.xScalePaddingLeft=t+this.fontSize/2),this.xScalePaddingRight=this.fontSize/2,this.xLabelRotation++,this.xLabelWidth=n*o;this.xLabelRotation>0&&(this.endPoint-=Math.sin(x(this.xLabelRotation))*o+3)}else this.xLabelWidth=0,this.xScalePaddingRight=this.padding,this.xScalePaddingLeft=this.padding},calculateYRange:c,drawingArea:function(){return this.startPoint-this.endPoint},calculateY:function(t){var i=this.drawingArea()/(this.min-this.max);return this.endPoint-i*(t-this.min)},calculateX:function(t){var i=(this.xLabelRotation>0,this.width-(this.xScalePaddingLeft+this.xScalePaddingRight)),e=i/(this.valuesCount-(this.offsetGridLines?0:1)),s=e*t+this.xScalePaddingLeft;return this.offsetGridLines&&(s+=e/2),Math.round(s)},update:function(t){s.extend(this,t),this.fit()},draw:function(){var t=this.ctx,i=(this.endPoint-this.startPoint)/this.steps,e=Math.round(this.xScalePaddingLeft);this.display&&(t.fillStyle=this.textColor,t.font=this.font,n(this.yLabels,function(n,o){var a=this.endPoint-i*o,h=Math.round(a);t.textAlign="right",t.textBaseline="middle",this.showLabels&&t.fillText(n,e-10,a),t.beginPath(),o>0?(t.lineWidth=this.gridLineWidth,t.strokeStyle=this.gridLineColor):(t.lineWidth=this.lineWidth,t.strokeStyle=this.lineColor),h+=s.aliasPixel(t.lineWidth),t.moveTo(e,h),t.lineTo(this.width,h),t.stroke(),t.closePath(),t.lineWidth=this.lineWidth,t.strokeStyle=this.lineColor,t.beginPath(),t.moveTo(e-5,h),t.lineTo(e,h),t.stroke(),t.closePath()},this),n(this.xLabels,function(i,e){var s=this.calculateX(e)+S(this.lineWidth),n=this.calculateX(e-(this.offsetGridLines?.5:0))+S(this.lineWidth),o=this.xLabelRotation>0;t.beginPath(),e>0?(t.lineWidth=this.gridLineWidth,t.strokeStyle=this.gridLineColor):(t.lineWidth=this.lineWidth,t.strokeStyle=this.lineColor),t.moveTo(n,this.endPoint),t.lineTo(n,this.startPoint-3),t.stroke(),t.closePath(),t.lineWidth=this.lineWidth,t.strokeStyle=this.lineColor,t.beginPath(),t.moveTo(n,this.endPoint),t.lineTo(n,this.endPoint+5),t.stroke(),t.closePath(),t.save(),t.translate(s,o?this.endPoint+12:this.endPoint+8),t.rotate(-1*x(this.xLabelRotation)),t.font=this.font,t.textAlign=o?"right":"center",t.textBaseline=o?"middle":"top",t.fillText(i,0,0),t.restore()},this))}}),e.RadialScale=e.Element.extend({initialize:function(){this.size=m([this.height,this.width]),this.drawingArea=this.display?this.size/2-(this.fontSize/2+this.backdropPaddingY):this.size/2},calculateCenterOffset:function(t){var i=this.drawingArea/(this.max-this.min);return(t-this.min)*i},update:function(){this.lineArc?this.drawingArea=this.display?this.size/2-(this.fontSize/2+this.backdropPaddingY):this.size/2:this.setScaleSize(),this.buildYLabels()},buildYLabels:function(){this.yLabels=[];for(var t=v(this.stepValue),i=0;i<=this.steps;i++)this.yLabels.push(C(this.templateString,{value:(this.min+i*this.stepValue).toFixed(t)}))},getCircumference:function(){return 2*Math.PI/this.valuesCount},setScaleSize:function(){var t,i,e,s,n,o,a,h,l,r,c,u,d=m([this.height/2-this.pointLabelFontSize-5,this.width/2]),p=this.width,g=0;for(this.ctx.font=M(this.pointLabelFontSize,this.pointLabelFontStyle,this.pointLabelFontFamily),i=0;i<this.valuesCount;i++)t=this.getPointPosition(i,d),e=this.ctx.measureText(C(this.templateString,{value:this.labels[i]})).width+5,0===i||i===this.valuesCount/2?(s=e/2,t.x+s>p&&(p=t.x+s,n=i),t.x-s<g&&(g=t.x-s,a=i)):i<this.valuesCount/2?t.x+e>p&&(p=t.x+e,n=i):i>this.valuesCount/2&&t.x-e<g&&(g=t.x-e,a=i);l=g,r=Math.ceil(p-this.width),o=this.getIndexAngle(n),h=this.getIndexAngle(a),c=r/Math.sin(o+Math.PI/2),u=l/Math.sin(h+Math.PI/2),c=f(c)?c:0,u=f(u)?u:0,this.drawingArea=d-(u+c)/2,this.setCenterPoint(u,c)},setCenterPoint:function(t,i){var e=this.width-i-this.drawingArea,s=t+this.drawingArea;this.xCenter=(s+e)/2,this.yCenter=this.height/2},getIndexAngle:function(t){var i=2*Math.PI/this.valuesCount;return t*i-Math.PI/2},getPointPosition:function(t,i){var e=this.getIndexAngle(t);return{x:Math.cos(e)*i+this.xCenter,y:Math.sin(e)*i+this.yCenter}},draw:function(){if(this.display){var t=this.ctx;if(n(this.yLabels,function(i,e){if(e>0){var s,n=e*(this.drawingArea/this.steps),o=this.yCenter-n;if(this.lineWidth>0)if(t.strokeStyle=this.lineColor,t.lineWidth=this.lineWidth,this.lineArc)t.beginPath(),t.arc(this.xCenter,this.yCenter,n,0,2*Math.PI),t.closePath(),t.stroke();else{t.beginPath();for(var a=0;a<this.valuesCount;a++)s=this.getPointPosition(a,this.calculateCenterOffset(this.min+e*this.stepValue)),0===a?t.moveTo(s.x,s.y):t.lineTo(s.x,s.y);t.closePath(),t.stroke()}if(this.showLabels){if(t.font=M(this.fontSize,this.fontStyle,this.fontFamily),this.showLabelBackdrop){var h=t.measureText(i).width;t.fillStyle=this.backdropColor,t.fillRect(this.xCenter-h/2-this.backdropPaddingX,o-this.fontSize/2-this.backdropPaddingY,h+2*this.backdropPaddingX,this.fontSize+2*this.backdropPaddingY)}t.textAlign="center",t.textBaseline="middle",t.fillStyle=this.fontColor,t.fillText(i,this.xCenter,o)}}},this),!this.lineArc){t.lineWidth=this.angleLineWidth,t.strokeStyle=this.angleLineColor;for(var i=this.valuesCount-1;i>=0;i--){if(this.angleLineWidth>0){var e=this.getPointPosition(i,this.calculateCenterOffset(this.max));t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(e.x,e.y),t.stroke(),t.closePath()}var s=this.getPointPosition(i,this.calculateCenterOffset(this.max)+5);t.font=M(this.pointLabelFontSize,this.pointLabelFontStyle,this.pointLabelFontFamily),t.fillStyle=this.pointLabelFontColor;var o=this.labels.length,a=this.labels.length/2,h=a/2,l=h>i||i>o-h,r=i===h||i===o-h;t.textAlign=0===i?"center":i===a?"center":a>i?"left":"right",t.textBaseline=r?"middle":l?"bottom":"top",t.fillText(this.labels[i],s.x,s.y)}}}}}),s.addEvent(window,"resize",function(){var t;return function(){clearTimeout(t),t=setTimeout(function(){n(e.instances,function(t){t.options.responsive&&t.resize(t.render,!0)})},50)}}()),p?define(function(){return e}):"object"==typeof module&&module.exports&&(module.exports=e),t.Chart=e,e.noConflict=function(){return t.Chart=i,e}}).call(this),function(){"use strict";var t=this,i=t.Chart,e=i.helpers,s={scaleBeginAtZero:!0,scaleShowGridLines:!0,scaleGridLineColor:"rgba(0,0,0,.05)",scaleGridLineWidth:1,barShowStroke:!0,barStrokeWidth:2,barValueSpacing:5,barDatasetSpacing:1,legendTemplate:'<ul class="<%=name.toLowerCase()%>-legend"><% for (var i=0; i<datasets.length; i++){%><li><span style="background-color:<%=datasets[i].fillColor%>"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>'};i.Type.extend({name:"Bar",defaults:s,initialize:function(t){var s=this.options;this.ScaleClass=i.Scale.extend({offsetGridLines:!0,calculateBarX:function(t,i,e){var n=this.calculateBaseWidth(),o=this.calculateX(e)-n/2,a=this.calculateBarWidth(t);return o+a*i+i*s.barDatasetSpacing+a/2},calculateBaseWidth:function(){return this.calculateX(1)-this.calculateX(0)-2*s.barValueSpacing},calculateBarWidth:function(t){var i=this.calculateBaseWidth()-(t-1)*s.barDatasetSpacing;return i/t}}),this.datasets=[],this.options.showTooltips&&e.bindEvents(this,this.options.tooltipEvents,function(t){var i="mouseout"!==t.type?this.getBarsAtEvent(t):[];this.eachBars(function(t){t.restore(["fillColor","strokeColor"])}),e.each(i,function(t){t.fillColor=t.highlightFill,t.strokeColor=t.highlightStroke}),this.showTooltip(i)}),this.BarClass=i.Rectangle.extend({strokeWidth:this.options.barStrokeWidth,showStroke:this.options.barShowStroke,ctx:this.chart.ctx}),e.each(t.datasets,function(i){var s={label:i.label||null,fillColor:i.fillColor,strokeColor:i.strokeColor,bars:[]};this.datasets.push(s),e.each(i.data,function(e,n){s.bars.push(new this.BarClass({value:e,label:t.labels[n],datasetLabel:i.label,strokeColor:i.strokeColor,fillColor:i.fillColor,highlightFill:i.highlightFill||i.fillColor,highlightStroke:i.highlightStroke||i.strokeColor}))},this)},this),this.buildScale(t.labels),this.BarClass.prototype.base=this.scale.endPoint,this.eachBars(function(t,i,s){e.extend(t,{width:this.scale.calculateBarWidth(this.datasets.length),x:this.scale.calculateBarX(this.datasets.length,s,i),y:this.scale.endPoint}),t.save()},this),this.render()},update:function(){this.scale.update(),e.each(this.activeElements,function(t){t.restore(["fillColor","strokeColor"])}),this.eachBars(function(t){t.save()}),this.render()},eachBars:function(t){e.each(this.datasets,function(i,s){e.each(i.bars,t,this,s)},this)},getBarsAtEvent:function(t){for(var i,s=[],n=e.getRelativePosition(t),o=function(t){s.push(t.bars[i])},a=0;a<this.datasets.length;a++)for(i=0;i<this.datasets[a].bars.length;i++)if(this.datasets[a].bars[i].inRange(n.x,n.y))return e.each(this.datasets,o),s;return s},buildScale:function(t){var i=this,s=function(){var t=[];return i.eachBars(function(i){t.push(i.value)}),t},n={templateString:this.options.scaleLabel,height:this.chart.height,width:this.chart.width,ctx:this.chart.ctx,textColor:this.options.scaleFontColor,fontSize:this.options.scaleFontSize,fontStyle:this.options.scaleFontStyle,fontFamily:this.options.scaleFontFamily,valuesCount:t.length,beginAtZero:this.options.scaleBeginAtZero,integersOnly:this.options.scaleIntegersOnly,calculateYRange:function(t){var i=e.calculateScaleRange(s(),t,this.fontSize,this.beginAtZero,this.integersOnly);e.extend(this,i)},xLabels:t,font:e.fontString(this.options.scaleFontSize,this.options.scaleFontStyle,this.options.scaleFontFamily),lineWidth:this.options.scaleLineWidth,lineColor:this.options.scaleLineColor,gridLineWidth:this.options.scaleShowGridLines?this.options.scaleGridLineWidth:0,gridLineColor:this.options.scaleShowGridLines?this.options.scaleGridLineColor:"rgba(0,0,0,0)",padding:this.options.showScale?0:this.options.barShowStroke?this.options.barStrokeWidth:0,showLabels:this.options.scaleShowLabels,display:this.options.showScale};this.options.scaleOverride&&e.extend(n,{calculateYRange:e.noop,steps:this.options.scaleSteps,stepValue:this.options.scaleStepWidth,min:this.options.scaleStartValue,max:this.options.scaleStartValue+this.options.scaleSteps*this.options.scaleStepWidth}),this.scale=new this.ScaleClass(n)},addData:function(t,i){e.each(t,function(t,e){this.datasets[e].bars.push(new this.BarClass({value:t,label:i,x:this.scale.calculateBarX(this.datasets.length,e,this.scale.valuesCount+1),y:this.scale.endPoint,width:this.scale.calculateBarWidth(this.datasets.length),base:this.scale.endPoint,strokeColor:this.datasets[e].strokeColor,fillColor:this.datasets[e].fillColor}))},this),this.scale.addXLabel(i),this.update()},removeData:function(){this.scale.removeXLabel(),e.each(this.datasets,function(t){t.bars.shift()},this),this.update()},reflow:function(){e.extend(this.BarClass.prototype,{y:this.scale.endPoint,base:this.scale.endPoint});var t=e.extend({height:this.chart.height,width:this.chart.width});this.scale.update(t)},draw:function(t){var i=t||1;this.clear();this.chart.ctx;this.scale.draw(i),e.each(this.datasets,function(t,s){e.each(t.bars,function(t,e){t.hasValue()&&(t.base=this.scale.endPoint,t.transition({x:this.scale.calculateBarX(this.datasets.length,s,e),y:this.scale.calculateY(t.value),width:this.scale.calculateBarWidth(this.datasets.length)},i).draw())},this)},this)}})}.call(this),function(){"use strict";var t=this,i=t.Chart,e=i.helpers,s={segmentShowStroke:!0,segmentStrokeColor:"#fff",segmentStrokeWidth:2,percentageInnerCutout:50,animationSteps:100,animationEasing:"easeOutBounce",animateRotate:!0,animateScale:!1,legendTemplate:'<ul class="<%=name.toLowerCase()%>-legend"><% for (var i=0; i<segments.length; i++){%><li><span style="background-color:<%=segments[i].fillColor%>"></span><%if(segments[i].label){%><%=segments[i].label%><%}%></li><%}%></ul>'};
+i.Type.extend({name:"Doughnut",defaults:s,initialize:function(t){this.segments=[],this.outerRadius=(e.min([this.chart.width,this.chart.height])-this.options.segmentStrokeWidth/2)/2,this.SegmentArc=i.Arc.extend({ctx:this.chart.ctx,x:this.chart.width/2,y:this.chart.height/2}),this.options.showTooltips&&e.bindEvents(this,this.options.tooltipEvents,function(t){var i="mouseout"!==t.type?this.getSegmentsAtEvent(t):[];e.each(this.segments,function(t){t.restore(["fillColor"])}),e.each(i,function(t){t.fillColor=t.highlightColor}),this.showTooltip(i)}),this.calculateTotal(t),e.each(t,function(t,i){this.addData(t,i,!0)},this),this.render()},getSegmentsAtEvent:function(t){var i=[],s=e.getRelativePosition(t);return e.each(this.segments,function(t){t.inRange(s.x,s.y)&&i.push(t)},this),i},addData:function(t,i,e){var s=i||this.segments.length;this.segments.splice(s,0,new this.SegmentArc({value:t.value,outerRadius:this.options.animateScale?0:this.outerRadius,innerRadius:this.options.animateScale?0:this.outerRadius/100*this.options.percentageInnerCutout,fillColor:t.color,highlightColor:t.highlight||t.color,showStroke:this.options.segmentShowStroke,strokeWidth:this.options.segmentStrokeWidth,strokeColor:this.options.segmentStrokeColor,startAngle:1.5*Math.PI,circumference:this.options.animateRotate?0:this.calculateCircumference(t.value),label:t.label})),e||(this.reflow(),this.update())},calculateCircumference:function(t){return 2*Math.PI*(t/this.total)},calculateTotal:function(t){this.total=0,e.each(t,function(t){this.total+=t.value},this)},update:function(){this.calculateTotal(this.segments),e.each(this.activeElements,function(t){t.restore(["fillColor"])}),e.each(this.segments,function(t){t.save()}),this.render()},removeData:function(t){var i=e.isNumber(t)?t:this.segments.length-1;this.segments.splice(i,1),this.reflow(),this.update()},reflow:function(){e.extend(this.SegmentArc.prototype,{x:this.chart.width/2,y:this.chart.height/2}),this.outerRadius=(e.min([this.chart.width,this.chart.height])-this.options.segmentStrokeWidth/2)/2,e.each(this.segments,function(t){t.update({outerRadius:this.outerRadius,innerRadius:this.outerRadius/100*this.options.percentageInnerCutout})},this)},draw:function(t){var i=t?t:1;this.clear(),e.each(this.segments,function(t,e){t.transition({circumference:this.calculateCircumference(t.value),outerRadius:this.outerRadius,innerRadius:this.outerRadius/100*this.options.percentageInnerCutout},i),t.endAngle=t.startAngle+t.circumference,t.draw(),0===e&&(t.startAngle=1.5*Math.PI),e<this.segments.length-1&&(this.segments[e+1].startAngle=t.endAngle)},this)}}),i.types.Doughnut.extend({name:"Pie",defaults:e.merge(s,{percentageInnerCutout:0})})}.call(this),function(){"use strict";var t=this,i=t.Chart,e=i.helpers,s={scaleShowGridLines:!0,scaleGridLineColor:"rgba(0,0,0,.05)",scaleGridLineWidth:1,bezierCurve:!0,bezierCurveTension:.4,pointDot:!0,pointDotRadius:4,pointDotStrokeWidth:1,pointHitDetectionRadius:20,datasetStroke:!0,datasetStrokeWidth:2,datasetFill:!0,legendTemplate:'<ul class="<%=name.toLowerCase()%>-legend"><% for (var i=0; i<datasets.length; i++){%><li><span style="background-color:<%=datasets[i].strokeColor%>"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>'};i.Type.extend({name:"Line",defaults:s,initialize:function(t){this.PointClass=i.Point.extend({strokeWidth:this.options.pointDotStrokeWidth,radius:this.options.pointDotRadius,display:this.options.pointDot,hitDetectionRadius:this.options.pointHitDetectionRadius,ctx:this.chart.ctx,inRange:function(t){return Math.pow(t-this.x,2)<Math.pow(this.radius+this.hitDetectionRadius,2)}}),this.datasets=[],this.options.showTooltips&&e.bindEvents(this,this.options.tooltipEvents,function(t){var i="mouseout"!==t.type?this.getPointsAtEvent(t):[];this.eachPoints(function(t){t.restore(["fillColor","strokeColor"])}),e.each(i,function(t){t.fillColor=t.highlightFill,t.strokeColor=t.highlightStroke}),this.showTooltip(i)}),e.each(t.datasets,function(i){var s={label:i.label||null,fillColor:i.fillColor,strokeColor:i.strokeColor,pointColor:i.pointColor,pointStrokeColor:i.pointStrokeColor,points:[]};this.datasets.push(s),e.each(i.data,function(e,n){s.points.push(new this.PointClass({value:e,label:t.labels[n],datasetLabel:i.label,strokeColor:i.pointStrokeColor,fillColor:i.pointColor,highlightFill:i.pointHighlightFill||i.pointColor,highlightStroke:i.pointHighlightStroke||i.pointStrokeColor}))},this),this.buildScale(t.labels),this.eachPoints(function(t,i){e.extend(t,{x:this.scale.calculateX(i),y:this.scale.endPoint}),t.save()},this)},this),this.render()},update:function(){this.scale.update(),e.each(this.activeElements,function(t){t.restore(["fillColor","strokeColor"])}),this.eachPoints(function(t){t.save()}),this.render()},eachPoints:function(t){e.each(this.datasets,function(i){e.each(i.points,t,this)},this)},getPointsAtEvent:function(t){var i=[],s=e.getRelativePosition(t);return e.each(this.datasets,function(t){e.each(t.points,function(t){t.inRange(s.x,s.y)&&i.push(t)})},this),i},buildScale:function(t){var s=this,n=function(){var t=[];return s.eachPoints(function(i){t.push(i.value)}),t},o={templateString:this.options.scaleLabel,height:this.chart.height,width:this.chart.width,ctx:this.chart.ctx,textColor:this.options.scaleFontColor,fontSize:this.options.scaleFontSize,fontStyle:this.options.scaleFontStyle,fontFamily:this.options.scaleFontFamily,valuesCount:t.length,beginAtZero:this.options.scaleBeginAtZero,integersOnly:this.options.scaleIntegersOnly,calculateYRange:function(t){var i=e.calculateScaleRange(n(),t,this.fontSize,this.beginAtZero,this.integersOnly);e.extend(this,i)},xLabels:t,font:e.fontString(this.options.scaleFontSize,this.options.scaleFontStyle,this.options.scaleFontFamily),lineWidth:this.options.scaleLineWidth,lineColor:this.options.scaleLineColor,gridLineWidth:this.options.scaleShowGridLines?this.options.scaleGridLineWidth:0,gridLineColor:this.options.scaleShowGridLines?this.options.scaleGridLineColor:"rgba(0,0,0,0)",padding:this.options.showScale?0:this.options.pointDotRadius+this.options.pointDotStrokeWidth,showLabels:this.options.scaleShowLabels,display:this.options.showScale};this.options.scaleOverride&&e.extend(o,{calculateYRange:e.noop,steps:this.options.scaleSteps,stepValue:this.options.scaleStepWidth,min:this.options.scaleStartValue,max:this.options.scaleStartValue+this.options.scaleSteps*this.options.scaleStepWidth}),this.scale=new i.Scale(o)},addData:function(t,i){e.each(t,function(t,e){this.datasets[e].points.push(new this.PointClass({value:t,label:i,x:this.scale.calculateX(this.scale.valuesCount+1),y:this.scale.endPoint,strokeColor:this.datasets[e].pointStrokeColor,fillColor:this.datasets[e].pointColor}))},this),this.scale.addXLabel(i),this.update()},removeData:function(){this.scale.removeXLabel(),e.each(this.datasets,function(t){t.points.shift()},this),this.update()},reflow:function(){var t=e.extend({height:this.chart.height,width:this.chart.width});this.scale.update(t)},draw:function(t){var i=t||1;this.clear();var s=this.chart.ctx,n=function(t){return null!==t.value},o=function(t,i,s){return e.findNextWhere(i,n,s)||t},a=function(t,i,s){return e.findPreviousWhere(i,n,s)||t};this.scale.draw(i),e.each(this.datasets,function(t){var h=e.where(t.points,n);e.each(t.points,function(t,e){t.hasValue()&&t.transition({y:this.scale.calculateY(t.value),x:this.scale.calculateX(e)},i)},this),this.options.bezierCurve&&e.each(h,function(t,i){var s=i>0&&i<h.length-1?this.options.bezierCurveTension:0;t.controlPoints=e.splineCurve(a(t,h,i),t,o(t,h,i),s),t.controlPoints.outer.y>this.scale.endPoint?t.controlPoints.outer.y=this.scale.endPoint:t.controlPoints.outer.y<this.scale.startPoint&&(t.controlPoints.outer.y=this.scale.startPoint),t.controlPoints.inner.y>this.scale.endPoint?t.controlPoints.inner.y=this.scale.endPoint:t.controlPoints.inner.y<this.scale.startPoint&&(t.controlPoints.inner.y=this.scale.startPoint)},this),s.lineWidth=this.options.datasetStrokeWidth,s.strokeStyle=t.strokeColor,s.beginPath(),e.each(h,function(t,i){if(0===i)s.moveTo(t.x,t.y);else if(this.options.bezierCurve){var e=a(t,h,i);s.bezierCurveTo(e.controlPoints.outer.x,e.controlPoints.outer.y,t.controlPoints.inner.x,t.controlPoints.inner.y,t.x,t.y)}else s.lineTo(t.x,t.y)},this),s.stroke(),this.options.datasetFill&&h.length>0&&(s.lineTo(h[h.length-1].x,this.scale.endPoint),s.lineTo(h[0].x,this.scale.endPoint),s.fillStyle=t.fillColor,s.closePath(),s.fill()),e.each(h,function(t){t.draw()})},this)}})}.call(this),function(){"use strict";var t=this,i=t.Chart,e=i.helpers,s={scaleShowLabelBackdrop:!0,scaleBackdropColor:"rgba(255,255,255,0.75)",scaleBeginAtZero:!0,scaleBackdropPaddingY:2,scaleBackdropPaddingX:2,scaleShowLine:!0,segmentShowStroke:!0,segmentStrokeColor:"#fff",segmentStrokeWidth:2,animationSteps:100,animationEasing:"easeOutBounce",animateRotate:!0,animateScale:!1,legendTemplate:'<ul class="<%=name.toLowerCase()%>-legend"><% for (var i=0; i<segments.length; i++){%><li><span style="background-color:<%=segments[i].fillColor%>"></span><%if(segments[i].label){%><%=segments[i].label%><%}%></li><%}%></ul>'};i.Type.extend({name:"PolarArea",defaults:s,initialize:function(t){this.segments=[],this.SegmentArc=i.Arc.extend({showStroke:this.options.segmentShowStroke,strokeWidth:this.options.segmentStrokeWidth,strokeColor:this.options.segmentStrokeColor,ctx:this.chart.ctx,innerRadius:0,x:this.chart.width/2,y:this.chart.height/2}),this.scale=new i.RadialScale({display:this.options.showScale,fontStyle:this.options.scaleFontStyle,fontSize:this.options.scaleFontSize,fontFamily:this.options.scaleFontFamily,fontColor:this.options.scaleFontColor,showLabels:this.options.scaleShowLabels,showLabelBackdrop:this.options.scaleShowLabelBackdrop,backdropColor:this.options.scaleBackdropColor,backdropPaddingY:this.options.scaleBackdropPaddingY,backdropPaddingX:this.options.scaleBackdropPaddingX,lineWidth:this.options.scaleShowLine?this.options.scaleLineWidth:0,lineColor:this.options.scaleLineColor,lineArc:!0,width:this.chart.width,height:this.chart.height,xCenter:this.chart.width/2,yCenter:this.chart.height/2,ctx:this.chart.ctx,templateString:this.options.scaleLabel,valuesCount:t.length}),this.updateScaleRange(t),this.scale.update(),e.each(t,function(t,i){this.addData(t,i,!0)},this),this.options.showTooltips&&e.bindEvents(this,this.options.tooltipEvents,function(t){var i="mouseout"!==t.type?this.getSegmentsAtEvent(t):[];e.each(this.segments,function(t){t.restore(["fillColor"])}),e.each(i,function(t){t.fillColor=t.highlightColor}),this.showTooltip(i)}),this.render()},getSegmentsAtEvent:function(t){var i=[],s=e.getRelativePosition(t);return e.each(this.segments,function(t){t.inRange(s.x,s.y)&&i.push(t)},this),i},addData:function(t,i,e){var s=i||this.segments.length;this.segments.splice(s,0,new this.SegmentArc({fillColor:t.color,highlightColor:t.highlight||t.color,label:t.label,value:t.value,outerRadius:this.options.animateScale?0:this.scale.calculateCenterOffset(t.value),circumference:this.options.animateRotate?0:this.scale.getCircumference(),startAngle:1.5*Math.PI})),e||(this.reflow(),this.update())},removeData:function(t){var i=e.isNumber(t)?t:this.segments.length-1;this.segments.splice(i,1),this.reflow(),this.update()},calculateTotal:function(t){this.total=0,e.each(t,function(t){this.total+=t.value},this),this.scale.valuesCount=this.segments.length},updateScaleRange:function(t){var i=[];e.each(t,function(t){i.push(t.value)});var s=this.options.scaleOverride?{steps:this.options.scaleSteps,stepValue:this.options.scaleStepWidth,min:this.options.scaleStartValue,max:this.options.scaleStartValue+this.options.scaleSteps*this.options.scaleStepWidth}:e.calculateScaleRange(i,e.min([this.chart.width,this.chart.height])/2,this.options.scaleFontSize,this.options.scaleBeginAtZero,this.options.scaleIntegersOnly);e.extend(this.scale,s,{size:e.min([this.chart.width,this.chart.height]),xCenter:this.chart.width/2,yCenter:this.chart.height/2})},update:function(){this.calculateTotal(this.segments),e.each(this.segments,function(t){t.save()}),this.render()},reflow:function(){e.extend(this.SegmentArc.prototype,{x:this.chart.width/2,y:this.chart.height/2}),this.updateScaleRange(this.segments),this.scale.update(),e.extend(this.scale,{xCenter:this.chart.width/2,yCenter:this.chart.height/2}),e.each(this.segments,function(t){t.update({outerRadius:this.scale.calculateCenterOffset(t.value)})},this)},draw:function(t){var i=t||1;this.clear(),e.each(this.segments,function(t,e){t.transition({circumference:this.scale.getCircumference(),outerRadius:this.scale.calculateCenterOffset(t.value)},i),t.endAngle=t.startAngle+t.circumference,0===e&&(t.startAngle=1.5*Math.PI),e<this.segments.length-1&&(this.segments[e+1].startAngle=t.endAngle),t.draw()},this),this.scale.draw()}})}.call(this),function(){"use strict";var t=this,i=t.Chart,e=i.helpers;i.Type.extend({name:"Radar",defaults:{scaleShowLine:!0,angleShowLineOut:!0,scaleShowLabels:!1,scaleBeginAtZero:!0,angleLineColor:"rgba(0,0,0,.1)",angleLineWidth:1,pointLabelFontFamily:"'Arial'",pointLabelFontStyle:"normal",pointLabelFontSize:10,pointLabelFontColor:"#666",pointDot:!0,pointDotRadius:3,pointDotStrokeWidth:1,pointHitDetectionRadius:20,datasetStroke:!0,datasetStrokeWidth:2,datasetFill:!0,legendTemplate:'<ul class="<%=name.toLowerCase()%>-legend"><% for (var i=0; i<datasets.length; i++){%><li><span style="background-color:<%=datasets[i].strokeColor%>"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>'},initialize:function(t){this.PointClass=i.Point.extend({strokeWidth:this.options.pointDotStrokeWidth,radius:this.options.pointDotRadius,display:this.options.pointDot,hitDetectionRadius:this.options.pointHitDetectionRadius,ctx:this.chart.ctx}),this.datasets=[],this.buildScale(t),this.options.showTooltips&&e.bindEvents(this,this.options.tooltipEvents,function(t){var i="mouseout"!==t.type?this.getPointsAtEvent(t):[];this.eachPoints(function(t){t.restore(["fillColor","strokeColor"])}),e.each(i,function(t){t.fillColor=t.highlightFill,t.strokeColor=t.highlightStroke}),this.showTooltip(i)}),e.each(t.datasets,function(i){var s={label:i.label||null,fillColor:i.fillColor,strokeColor:i.strokeColor,pointColor:i.pointColor,pointStrokeColor:i.pointStrokeColor,points:[]};this.datasets.push(s),e.each(i.data,function(e,n){var o;this.scale.animation||(o=this.scale.getPointPosition(n,this.scale.calculateCenterOffset(e))),s.points.push(new this.PointClass({value:e,label:t.labels[n],datasetLabel:i.label,x:this.options.animation?this.scale.xCenter:o.x,y:this.options.animation?this.scale.yCenter:o.y,strokeColor:i.pointStrokeColor,fillColor:i.pointColor,highlightFill:i.pointHighlightFill||i.pointColor,highlightStroke:i.pointHighlightStroke||i.pointStrokeColor}))},this)},this),this.render()},eachPoints:function(t){e.each(this.datasets,function(i){e.each(i.points,t,this)},this)},getPointsAtEvent:function(t){var i=e.getRelativePosition(t),s=e.getAngleFromPoint({x:this.scale.xCenter,y:this.scale.yCenter},i),n=2*Math.PI/this.scale.valuesCount,o=Math.round((s.angle-1.5*Math.PI)/n),a=[];return(o>=this.scale.valuesCount||0>o)&&(o=0),s.distance<=this.scale.drawingArea&&e.each(this.datasets,function(t){a.push(t.points[o])}),a},buildScale:function(t){this.scale=new i.RadialScale({display:this.options.showScale,fontStyle:this.options.scaleFontStyle,fontSize:this.options.scaleFontSize,fontFamily:this.options.scaleFontFamily,fontColor:this.options.scaleFontColor,showLabels:this.options.scaleShowLabels,showLabelBackdrop:this.options.scaleShowLabelBackdrop,backdropColor:this.options.scaleBackdropColor,backdropPaddingY:this.options.scaleBackdropPaddingY,backdropPaddingX:this.options.scaleBackdropPaddingX,lineWidth:this.options.scaleShowLine?this.options.scaleLineWidth:0,lineColor:this.options.scaleLineColor,angleLineColor:this.options.angleLineColor,angleLineWidth:this.options.angleShowLineOut?this.options.angleLineWidth:0,pointLabelFontColor:this.options.pointLabelFontColor,pointLabelFontSize:this.options.pointLabelFontSize,pointLabelFontFamily:this.options.pointLabelFontFamily,pointLabelFontStyle:this.options.pointLabelFontStyle,height:this.chart.height,width:this.chart.width,xCenter:this.chart.width/2,yCenter:this.chart.height/2,ctx:this.chart.ctx,templateString:this.options.scaleLabel,labels:t.labels,valuesCount:t.datasets[0].data.length}),this.scale.setScaleSize(),this.updateScaleRange(t.datasets),this.scale.buildYLabels()},updateScaleRange:function(t){var i=function(){var i=[];return e.each(t,function(t){t.data?i=i.concat(t.data):e.each(t.points,function(t){i.push(t.value)})}),i}(),s=this.options.scaleOverride?{steps:this.options.scaleSteps,stepValue:this.options.scaleStepWidth,min:this.options.scaleStartValue,max:this.options.scaleStartValue+this.options.scaleSteps*this.options.scaleStepWidth}:e.calculateScaleRange(i,e.min([this.chart.width,this.chart.height])/2,this.options.scaleFontSize,this.options.scaleBeginAtZero,this.options.scaleIntegersOnly);e.extend(this.scale,s)},addData:function(t,i){this.scale.valuesCount++,e.each(t,function(t,e){var s=this.scale.getPointPosition(this.scale.valuesCount,this.scale.calculateCenterOffset(t));this.datasets[e].points.push(new this.PointClass({value:t,label:i,x:s.x,y:s.y,strokeColor:this.datasets[e].pointStrokeColor,fillColor:this.datasets[e].pointColor}))},this),this.scale.labels.push(i),this.reflow(),this.update()},removeData:function(){this.scale.valuesCount--,this.scale.labels.shift(),e.each(this.datasets,function(t){t.points.shift()},this),this.reflow(),this.update()},update:function(){this.eachPoints(function(t){t.save()}),this.reflow(),this.render()},reflow:function(){e.extend(this.scale,{width:this.chart.width,height:this.chart.height,size:e.min([this.chart.width,this.chart.height]),xCenter:this.chart.width/2,yCenter:this.chart.height/2}),this.updateScaleRange(this.datasets),this.scale.setScaleSize(),this.scale.buildYLabels()},draw:function(t){var i=t||1,s=this.chart.ctx;this.clear(),this.scale.draw(),e.each(this.datasets,function(t){e.each(t.points,function(t,e){t.hasValue()&&t.transition(this.scale.getPointPosition(e,this.scale.calculateCenterOffset(t.value)),i)},this),s.lineWidth=this.options.datasetStrokeWidth,s.strokeStyle=t.strokeColor,s.beginPath(),e.each(t.points,function(t,i){0===i?s.moveTo(t.x,t.y):s.lineTo(t.x,t.y)},this),s.closePath(),s.stroke(),s.fillStyle=t.fillColor,s.fill(),e.each(t.points,function(t){t.hasValue()&&t.draw()})},this)}})}.call(this); \ No newline at end of file
diff --git a/vendor/assets/javascripts/highlight.pack.js b/vendor/assets/javascripts/highlight.pack.js
index 17b457bf743..c09eac02df9 100644
--- a/vendor/assets/javascripts/highlight.pack.js
+++ b/vendor/assets/javascripts/highlight.pack.js
@@ -1 +1 @@
-var hljs=new function(){function j(v){return v.replace(/&/gm,"&amp;").replace(/</gm,"&lt;").replace(/>/gm,"&gt;")}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= = &lt; < > &lt;= <= >= == + / * - 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
+var hljs=new function(){function j(v){return v.replace(/&/gm,"&amp;").replace(/</gm,"&lt;").replace(/>/gm,"&gt;")}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)||/no(-?)highlight/.test(x)})[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(A.nodeType==1){v.push({event:"start",offset:z,node:A});z=w(A,z);if(!t(A).match(/br|hr|img|input/)){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}}}x(y)}function c(T,L,J,R){function v(V,W){for(var U=0;U<W.c.length;U++){if(h(W.c[U].bR,V)){return W.c[U]}}}function z(V,U){if(h(V.eR,U)){return V}if(V.eW){return z(V.parent,U)}}function A(U,V){return !J&&h(V.iR,U)}function E(W,U){var V=M.cI?U[0].toLowerCase():U[0];return W.k.hasOwnProperty(V)&&W.k[V]}function w(aa,Y,X,W){var U=W?"":b.classPrefix,V='<span class="'+U,Z=X?"":"</span>";V+=aa+'">';return V+Y+Z}function N(){if(!I.k){return j(C)}var U="";var X=0;I.lR.lastIndex=0;var V=I.lR.exec(C);while(V){U+=j(C.substr(X,V.index-X));var W=E(I,V);if(W){H+=W[1];U+=w(W[0],j(V[0]))}else{U+=j(V[0])}X=I.lR.lastIndex;V=I.lR.exec(C)}return U+j(C.substr(X))}function F(){if(I.sL&&!f[I.sL]){return j(C)}var U=I.sL?c(I.sL,C,true,S):e(C);if(I.r>0){H+=U.r}if(I.subLanguageMode=="continuous"){S=U.top}return w(U.language,U.value,false,true)}function Q(){return I.sL!==undefined?F():N()}function P(W,V){var U=W.cN?w(W.cN,"",true):"";if(W.rB){D+=U;C=""}else{if(W.eB){D+=j(V)+U;C=""}else{D+=U;C=V}}I=Object.create(W,{parent:{value:I}})}function G(U,Y){C+=U;if(Y===undefined){D+=Q();return 0}var W=v(Y,I);if(W){D+=Q();P(W,Y);return W.rB?0:Y.length}var X=z(I,Y);if(X){var V=I;if(!(V.rE||V.eE)){C+=Y}D+=Q();do{if(I.cN){D+="</span>"}H+=I.r;I=I.parent}while(I!=X.parent);if(V.eE){D+=j(Y)}C="";if(X.starts){P(X.starts,"")}return V.rE?0:Y.length}if(A(Y,I)){throw new Error('Illegal lexeme "'+Y+'" for mode "'+(I.cN||"<unnamed>")+'"')}C+=Y;return Y.length||1}var M=i(T);if(!M){throw new Error('Unknown language: "'+T+'"')}m(M);var I=R||M;var S;var D="";for(var K=I;K!=M;K=K.parent){if(K.cN){D=w(K.cN,"",true)+D}}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:T,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(A){var B=r(A);if(/no(-?)highlight/.test(B)){return}var y;if(b.useBR){y=document.createElementNS("http://www.w3.org/1999/xhtml","div");y.innerHTML=A.innerHTML.replace(/\n/g,"").replace(/<br[ \/]*>/g,"\n")}else{y=A}var z=y.textContent;var v=B?c(B,z,true):e(z);var x=u(y);if(x.length){var w=document.createElementNS("http://www.w3.org/1999/xhtml","div");w.innerHTML=v.value;v.value=q(x,u(w),z)}v.value=g(v.value);A.innerHTML=v.value;A.className+=" hljs "+(!B&&v.language||"");A.result={language:v.language,re:v.r};if(v.second_best){A.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("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("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("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("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("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:/[^ \/><\n\t]+/,r:0},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("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("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("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:[{bK:"extends implements"},a.UTM]}]}});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("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("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("clojure",function(j){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 i=j.inherit(j.QSM,{i:null});var n={cN:"comment",b:";",e:"$",r:0};var m={cN:"collection",b:"[\\[\\{]",e:"[\\]\\}]"};var c={cN:"comment",b:"\\^"+f};var b={cN:"comment",b:"\\^\\{",e:"\\}"};var h={cN:"attribute",b:"[:]"+f};var l={cN:"list",b:"\\(",e:"\\)"};var g={eW:true,k:{literal:"true false nil"},r:0};var o={k:e,l:f,cN:"keyword",b:f,starts:g};l.c=[{cN:"comment",b:"comment"},o,g];g.c=[l,i,c,b,n,h,m,d];m.c=[l,i,c,n,h,m,d];return{aliases:["clj"],i:/\S/,c:[n,l,{cN:"prompt",b:/^=> /,starts:{e:/\n\n|\Z/}}]}});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("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:/\/(?![ *])(\\\/|.)*?\/[gim]*(?=\W|$)/}]},{cN:"property",b:"@"+a},{b:"`",e:"`",eB:true,eE:true,sL:"javascript"}];e.c=d;return{aliases:["coffee","cson","iced"],k:b,i:/\/\*/,c:d.concat([{cN:"comment",b:"###",e:"###"},c.HCM,{cN:"function",b:"(^\\s*|\\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("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("cs",function(c){var b="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 protected public private internal ascending descending from get group into join let orderby partial select set value var where yield";var a=c.IR+"(<"+c.IR+">)?";return{aliases:["csharp"],k:b,i:/::/,c:[{cN:"comment",b:"///",e:"$",rB:true,c:[{cN:"xmlDocTag",v:[{b:"///",r:0},{b:"<!--|-->"},{b:"</?",e:">"}]}]},c.CLCM,c.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:'""'}]},c.ASM,c.QSM,c.CNM,{bK:"class namespace interface",e:/[{;=]/,i:/[^\s:]/,c:[c.TM,c.CLCM,c.CBCM]},{bK:"new",e:/\s/,r:0},{cN:"function",b:"("+a+"\\s+)+"+c.IR+"\\s*\\(",rB:true,e:/[{;=]/,eE:true,k:b,c:[{b:c.IR+"\\s*\\(",rB:true,c:[c.TM]},{cN:"params",b:/\(/,e:/\)/,k:b,c:[c.ASM,c.QSM,c.CNM,c.CBCM]},c.CLCM,c.CBCM]}]}});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("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("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:"^\\[.+\\]:",rB:true,c:[{cN:"link_reference",b:"\\[",e:"\\]:",eB:true,eE:true,starts:{cN:"link_url",e:"$"}}]}]}});hljs.registerLanguage("dart",function(b){var d={cN:"subst",b:"\\$\\{",e:"}",k:"true false null this is new super"};var c={cN:"string",v:[{b:"r'''",e:"'''"},{b:'r"""',e:'"""'},{b:"r'",e:"'",i:"\\n"},{b:'r"',e:'"',i:"\\n"},{b:"'''",e:"'''",c:[b.BE,d]},{b:'"""',e:'"""',c:[b.BE,d]},{b:"'",e:"'",i:"\\n",c:[b.BE,d]},{b:'"',e:'"',i:"\\n",c:[b.BE,d]}]};d.c=[b.CNM,c];var a={keyword:"assert break case catch class const continue default do else enum extends false final finally for if in is new null rethrow return super switch this throw true try var void while with",literal:"abstract as dynamic export external factory get implements import library operator part set static typedef",built_in:"print Comparable DateTime Duration Function Iterable Iterator List Map Match Null Object Pattern RegExp Set Stopwatch String StringBuffer StringSink Symbol Type Uri bool double int num document window querySelector querySelectorAll Element ElementList"};return{k:a,c:[c,{cN:"dartdoc",b:"/\\*\\*",e:"\\*/",sL:"markdown",subLanguageMode:"continuous"},{cN:"dartdoc",b:"///",e:"$",sL:"markdown",subLanguageMode:"continuous"},b.CLCM,b.CBCM,{cN:"class",bK:"class interface",e:"{",eE:true,c:[{bK:"extends implements"},b.UTM]},b.CNM,{cN:"annotation",b:"@[A-Za-z]+"},{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("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("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("dos",function(a){var c={cN:"comment",b:/@?rem\b/,e:/$/,r:10};var b={cN:"label",b:"^\\s*[A-Za-z._?][A-Za-z0-9_$#@~.?]*(:|\\s+label)",r:0};return{aliases:["bat","cmd"],cI:true,k:{flow:"if else goto for in do call exit not exist errorlevel defined",operator:"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",built_in:"append assoc at attrib break cacls cd chcp chdir chkdsk chkntfs cls cmd color comp compact convert date dir diskcomp diskcopy doskey erase fs find findstr format ftype graftabl help keyb label md mkdir mode more move path pause print popd pushd promt rd recover rem rename replace restore rmdir shiftsort start subst time title tree type ver verify vol",},c:[{cN:"envvar",b:/%%[^ ]|%[^ ]+?%|![^ ]+?!/},{cN:"function",b:b.b,e:"goto:eof",c:[a.inherit(a.TM,{b:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),c]},{cN:"number",b:"\\b\\d+",r:0},c]}});hljs.registerLanguage("dust",function(b){var a="if eq ne lt lte gt gte select default math sep";return{aliases:["dst"],cI:true,sL:"xml",subLanguageMode:"continuous",c:[{cN:"expression",b:"{",e:"}",r:0,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,r:0}]}]}});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("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("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 if 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("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("fsharp",function(a){var b={b:"<",e:">",c:[a.inherit(a.TM,{b:/'[a-zA-Z0-9_]+/})]};return{aliases:["fs"],k:"yield! return! let! do!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,b]},{cN:"annotation",b:"\\[<",e:">\\]",r:10},{cN:"attribute",b:"\\B('[A-Za-z])\\b",c:[a.BE]},a.CLCM,a.inherit(a.QSM,{i:null}),a.CNM]}});hljs.registerLanguage("gcode",function(a){var e="[A-Z_][A-Z0-9_.]*";var f="\\%";var c={literal:"",built_in:"",keyword:"IF DO WHILE ENDWHILE CALL ENDIF SUB ENDSUB GOTO REPEAT ENDREPEAT EQ LT GT NE GE LE OR XOR"};var b={cN:"preprocessor",b:"([O])([0-9]+)"};var d=[a.CLCM,{cN:"comment",b:/\(/,e:/\)/,c:[a.PWM]},a.CBCM,a.inherit(a.CNM,{b:"([-+]?([0-9]*\\.?[0-9]+\\.?))|"+a.CNR}),a.inherit(a.ASM,{i:null}),a.inherit(a.QSM,{i:null}),{cN:"keyword",b:"([G])([0-9]+\\.?[0-9]?)"},{cN:"title",b:"([M])([0-9]+\\.?[0-9]?)"},{cN:"title",b:"(VC|VS|#)",e:"(\\d+)"},{cN:"title",b:"(VZOFX|VZOFY|VZOFZ)"},{cN:"built_in",b:"(ATAN|ABS|ACOS|ASIN|SIN|COS|EXP|FIX|FUP|ROUND|LN|TAN)(\\[)",e:"([-+]?([0-9]*\\.?[0-9]+\\.?))(\\])"},{cN:"label",v:[{b:"N",e:"\\d+",i:"\\W"}]}];return{aliases:["nc"],cI:true,l:e,k:c,c:[{cN:"preprocessor",b:f},b].concat(d)}});hljs.registerLanguage("gherkin",function(a){return{aliases:["feature"],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("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("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]}});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("groovy",function(a){return{k:{typename:"byte short char int long boolean float double void",literal:"true false null",keyword:"def as in assert trait super this abstract static volatile transient public private protected synchronized final class interface enum if else for while switch case break default continue throw throws try catch finally implements extends new import package return instanceof"},c:[a.CLCM,{cN:"javadoc",b:"/\\*\\*",e:"\\*//*",c:[{cN:"javadoctag",b:"@[A-Za-z]+"}]},a.CBCM,{cN:"string",b:'"""',e:'"""'},{cN:"string",b:"'''",e:"'''"},{cN:"string",b:"\\$/",e:"/\\$",r:10},a.ASM,{cN:"regexp",b:/~?\/[^\/\n]+\//,c:[a.BE]},a.QSM,{cN:"shebang",b:"^#!/usr/bin/env",e:"$",i:"\n"},a.BNM,{cN:"class",bK:"class interface trait enum",e:"{",i:":",c:[{bK:"extends implements"},a.UTM,]},a.CNM,{cN:"annotation",b:"@[A-Za-z]+"},{cN:"string",b:/[^\?]{0}[A-Za-z0-9_$]+ *:/},{b:/\?/,e:/\:/},{cN:"label",b:"^\\s*[A-Za-z0-9_$]+:"},]}});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:f.UIR+"(\\!|\\?)?:",r:0},{cN:"symbol",b:":",c:[e,{b:j}],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=[{b:/^\s*=>/,cN:"status",starts:{e:"$",c:h}},{cN:"prompt",b:/^\S[^=>\n]*>+/,starts:{e:"$",c:h}}];return{aliases:["rb","gemspec","podspec","thor","irb"],k:i,c:[k].concat(g).concat(h)}});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("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("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("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("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("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("java",function(c){var b=c.UIR+"(<"+c.UIR+">)?";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 protected public private";return{aliases:["jsp"],k:a,i:/<\//,c:[{cN:"javadoc",b:"/\\*\\*",e:"\\*/",r:0,c:[{cN:"javadoctag",b:"(^|\\s)@[A-Za-z]+"}]},c.CLCM,c.CBCM,c.ASM,c.QSM,{cN:"class",bK:"class interface",e:/[{;=]/,eE:true,k:"class interface",i:/[:"\[\]]/,c:[{bK:"extends implements"},c.UTM]},{bK:"new",e:/\s/,r:0},{cN:"function",b:"("+b+"\\s+)+"+c.UIR+"\\s*\\(",rB:true,e:/[{;=]/,eE:true,k:a,c:[{b:c.UIR+"\\s*\\(",rB:true,c:[c.UTM]},{cN:"params",b:/\(/,e:/\)/,k:a,c:[c.ASM,c.QSM,c.CNM,c.CBCM]},c.CLCM,c.CBCM]},c.CNM,{cN:"annotation",b:"@[A-Za-z]+"}]}});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("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("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("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:"$",r:0};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:"quote"}]};var c={cN:"quoted",b:"'"+l};var j={cN:"list",b:"\\(",e:"\\)"};var f={eW:true,r:0};j.c=[{cN:"keyword",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("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("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("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:/$/,r:0,c:[a.QSM,b]}]}});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("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("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("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("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("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,c:[b]},{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("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("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("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("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 NSData 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 NSURLSession NSURLSessionDataTask NSURLSessionDownloadTask NSURLSessionUploadTask NSURLResponseUIInterfaceOrientation 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("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("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("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("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("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"},b.UTM]},{bK:"namespace",e:";",i:/[\.']/,c:[b.UTM]},{bK:"use",e:";",c:[b.UTM]},{b:"=>"},c,d]}});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("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("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("q",function(a){var b={keyword:"do while select delete by update from",constant:"0b 1b",built_in:"neg not null string reciprocal floor ceiling signum mod xbar xlog and or each scan over prior mmu lsq inv md5 ltime gtime count first var dev med cov cor all any rand sums prds mins maxs fills deltas ratios avgs differ prev next rank reverse iasc idesc asc desc msum mcount mavg mdev xrank mmin mmax xprev rotate distinct group where flip type key til get value attr cut set upsert raze union inter except cross sv vs sublist enlist read0 read1 hopen hclose hdel hsym hcount peach system ltrim rtrim trim lower upper ssr view tables views cols xcols keys xkey xcol xasc xdesc fkeys meta lj aj aj0 ij pj asof uj ww wj wj1 fby xgroup ungroup ej save load rsave rload show csv parse eval min max avg wavg wsum sin cos tan sum",typename:"`float `double int `timestamp `timespan `datetime `time `boolean `symbol `char `byte `short `long `real `month `date `minute `second `guid"};return{aliases:["k","kdb"],k:b,l:/\b(`?)[A-Za-z0-9_]+\b/,c:[a.CLCM,a.QSM,a.CNM]}});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("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("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("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("rust",function(a){return{aliases:["rs"],k:{keyword:"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",built_in:"assert! assert_eq! bitflags! bytes! cfg! col! concat! concat_idents! debug_assert! debug_assert_eq! env! fail! file! format! format_args! include_bin! include_str! line! local_data_key! module_path! option_env! print! println! select! stringify! try! unimplemented! unreachable! vec! write! writeln!"},l:a.IR+"!?",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("scala",function(d){var b={cN:"annotation",b:"@[A-Za-z]+"};var c={cN:"string",b:'u?r?"""',e:'"""',r:10};var a={cN:"symbol",b:"'\\w[\\w\\d_]*(?!')"};var e={cN:"type",b:"\\b[A-Z][A-Za-z0-9_]*",r:0};var h={cN:"title",b:/[^0-9\n\t "'(),.`{}\[\]:;][^\n\t "'(),.`{}\[\]:;]+|[^0-9\n\t "'(),.`{}\[\]:;=]/,r:0};var i={cN:"class",bK:"class object trait type",e:/[:={\[(\n;]/,c:[{cN:"keyword",bK:"extends with",r:10},h]};var g={cN:"function",bK:"def val",e:/[:={\[(\n;]/,c:[h]};var f={cN:"javadoc",b:"/\\*\\*",e:"\\*/",c:[{cN:"javadoctag",b:"@[A-Za-z]+"}],r:10};return{k:{literal:"true false null",keyword:"type yield lazy override def with val var sealed abstract private trait object if forSome for while throw finally protected extends import final return else break new catch super class case package default try this match continue throws implicit"},c:[d.CLCM,d.CBCM,c,d.QSM,a,e,g,i,d.CNM,b]}});hljs.registerLanguage("scheme",function(k){var m="[^\\(\\)\\[\\]\\{\\}\",'`;#|\\\\\\s]+";var d="(\\-|\\+)?\\d+([./]\\d+)?";var h=d+"[+\\-]"+d+"i";var e={built_in:"case-lambda call/cc class define-class exit-handler field import inherit init-field interface let*-values let-values let/ec mixin opt-lambda override protect provide public rename require require-for-syntax syntax syntax-case syntax-error unit/sig unless when with-syntax and begin call-with-current-continuation call-with-input-file call-with-output-file case cond define define-syntax delay do dynamic-wind else for-each if lambda let let* let-syntax letrec letrec-syntax map or syntax-rules ' * + , ,@ - ... / ; < <= = => > >= ` abs acos angle append apply asin assoc assq assv atan boolean? caar cadr call-with-input-file call-with-output-file call-with-values car cdddar cddddr cdr ceiling char->integer char-alphabetic? char-ci<=? char-ci<? char-ci=? char-ci>=? char-ci>? char-downcase char-lower-case? char-numeric? char-ready? char-upcase char-upper-case? char-whitespace? char<=? char<? char=? char>=? char>? char? close-input-port close-output-port complex? cons cos current-input-port current-output-port denominator display eof-object? eq? equal? eqv? eval even? exact->inexact exact? exp expt floor force gcd imag-part inexact->exact inexact? input-port? integer->char integer? interaction-environment lcm length list list->string list->vector list-ref list-tail list? load log magnitude make-polar make-rectangular make-string make-vector max member memq memv min modulo negative? newline not null-environment null? number->string number? numerator odd? open-input-file open-output-file output-port? pair? peek-char port? positive? procedure? quasiquote quote quotient rational? rationalize read read-char real-part real? remainder reverse round scheme-report-environment set! set-car! set-cdr! sin sqrt string string->list string->number string->symbol string-append string-ci<=? string-ci<? string-ci=? string-ci>=? string-ci>? string-copy string-fill! string-length string-ref string-set! string<=? string<? string=? string>=? string>? string? substring symbol->string symbol? tan transcript-off transcript-on truncate values vector vector->list vector-fill! vector-length vector-ref vector-set! with-input-from-file with-output-to-file write write-char zero?"};var n={cN:"shebang",b:"^#!",e:"$"};var f={cN:"literal",b:"(#t|#f|#\\\\"+m+"|#\\\\.)"};var g={cN:"number",v:[{b:d,r:0},{b:h,r:0},{b:"#b[0-1]+(/[0-1]+)?"},{b:"#o[0-7]+(/[0-7]+)?"},{b:"#x[0-9a-f]+(/[0-9a-f]+)?"}]};var j=k.QSM;var b={cN:"regexp",b:'#[pr]x"',e:'[^\\\\]"'};var o={cN:"comment",v:[{b:";",e:"$",r:0},{b:"#\\|",e:"\\|#"}]};var c={b:m,r:0};var a={cN:"variable",b:"'"+m};var i={eW:true,r:0};var l={cN:"list",v:[{b:"\\(",e:"\\)"},{b:"\\[",e:"\\]"}],c:[{cN:"keyword",b:m,l:m,k:e},i]};i.c=[f,g,j,o,c,a,l];return{i:/\S/,c:[n,g,j,o,a,l]}});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("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("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("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("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",e:"{",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:/\)/,k:e,c:["self",f,d,a.CBCM,{b:":"}],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("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("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("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("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("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("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("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("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("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}]}}); \ No newline at end of file