From 716d7a737b0f69316cb6eecdd689e92232064e26 Mon Sep 17 00:00:00 2001 From: Jimmy Zelinskie Date: Mon, 24 Nov 2014 16:07:38 -0500 Subject: [PATCH] Strip whitespace from ALL the things. --- Bobfile | 2 +- app.py | 2 +- auth/scopes.py | 2 +- buildstatus/building.svg | 2 +- buildstatus/failed.svg | 2 +- buildstatus/none.svg | 2 +- buildstatus/ready.svg | 2 +- conf/gunicorn_local.py | 2 +- conf/gunicorn_registry.py | 2 +- conf/gunicorn_verbs.py | 2 +- conf/gunicorn_web.py | 2 +- conf/root-base.conf | 2 +- conf/server-base.conf | 4 +- config.py | 6 +- data/buildlogs.py | 2 +- ...4abf14783d_add_log_entry_kind_for_verbs.py | 2 +- ...c79d9_prepare_the_database_for_the_new_.py | 2 +- .../5a07499ce53f_set_up_initial_database.py | 2 +- data/model/__init__.py | 2 +- data/model/oauth.py | 4 +- data/queue.py | 2 +- data/userevent.py | 4 +- emails/base.html | 8 +- endpoints/api/__init__.py | 2 +- endpoints/api/billing.py | 10 +- endpoints/api/build.py | 4 +- endpoints/api/discovery.py | 6 +- endpoints/api/logs.py | 8 +- endpoints/api/organization.py | 32 +- endpoints/api/permission.py | 6 +- endpoints/api/prototype.py | 16 +- endpoints/api/repoemail.py | 2 +- endpoints/api/repository.py | 4 +- endpoints/api/repositorynotification.py | 4 +- endpoints/api/robot.py | 2 +- endpoints/api/search.py | 4 +- endpoints/api/subscribe.py | 4 +- endpoints/api/superuser.py | 6 +- endpoints/api/tag.py | 2 +- endpoints/api/team.py | 18 +- endpoints/api/trigger.py | 16 +- endpoints/api/user.py | 10 +- endpoints/csrf.py | 2 +- endpoints/index.py | 8 +- endpoints/notificationevent.py | 10 +- endpoints/notificationhelper.py | 2 +- endpoints/notificationmethod.py | 10 +- endpoints/trackhelper.py | 2 +- endpoints/trigger.py | 8 +- endpoints/verbs.py | 4 +- endpoints/web.py | 12 +- endpoints/webhooks.py | 2 +- events/build_failure.html | 4 +- events/build_start.html | 2 +- events/build_success.html | 4 +- events/repo_push.html | 4 +- external_libraries.py | 4 +- features/__init__.py | 2 +- grunt/Gruntfile.js | 4 +- health/healthcheck.py | 8 +- initdb.py | 10 +- requirements-nover.txt | 2 +- screenshots/README.md | 2 +- static/css/quay.css | 42 +-- static/directives/angular-tour-ui.html | 2 +- static/directives/application-manager.html | 2 +- static/directives/billing-invoices.html | 2 +- static/directives/billing-options.html | 2 +- static/directives/build-log-error.html | 2 +- .../create-external-notification-dialog.html | 12 +- static/directives/docker-auth-dialog.html | 2 +- static/directives/dropdown-select.html | 2 +- static/directives/entity-reference.html | 2 +- static/directives/entity-search.html | 10 +- static/directives/external-login-button.html | 8 +- .../external-notification-view.html | 2 +- static/directives/header-bar.html | 6 +- static/directives/location-view.html | 2 +- static/directives/logs-view.html | 18 +- .../manual-trigger-build-dialog.html | 4 +- static/directives/markdown-input.html | 4 +- static/directives/namespace-selector.html | 2 +- static/directives/notification-bar.html | 2 +- static/directives/plan-manager.html | 8 +- static/directives/plans-table.html | 2 +- static/directives/popup-input-button.html | 4 +- static/directives/prototype-manager.html | 12 +- static/directives/repo-breadcrumb.html | 4 +- static/directives/robots-manager.html | 4 +- static/directives/setup-trigger-dialog.html | 14 +- static/directives/signin-form.html | 4 +- static/directives/step-view-step.html | 2 +- static/directives/step-view.html | 2 +- static/directives/tour-content.html | 10 +- static/directives/trigger-setup-github.html | 24 +- static/directives/user-setup.html | 4 +- static/img/500/background.svg | 2 +- static/img/500/ship.svg | 4 +- static/js/app.js | 306 +++++++++--------- static/js/controllers.js | 102 +++--- static/js/graphing.js | 76 ++--- static/js/tour.js | 14 +- static/js/untar.js | 8 +- static/partials/about.html | 2 +- static/partials/confirm-invite.html | 2 +- static/partials/contact.html | 2 +- static/partials/guide.html | 2 +- static/partials/image-view.html | 10 +- static/partials/landing-normal.html | 12 +- static/partials/landing.html | 2 +- static/partials/manage-application.html | 6 +- static/partials/new-organization.html | 6 +- static/partials/new-repo.html | 24 +- static/partials/org-admin.html | 12 +- static/partials/organizations.html | 2 +- static/partials/plans.html | 6 +- static/partials/repo-admin.html | 30 +- static/partials/repo-build.html | 6 +- static/partials/repo-list.html | 4 +- static/partials/security.html | 2 +- static/partials/super-user.html | 30 +- static/partials/team-view.html | 14 +- static/partials/user-admin.html | 18 +- static/partials/view-repo.html | 26 +- static/robots.txt | 2 +- static/sitemap.xml | 4 +- static/tutorial/create-container.html | 4 +- storage/basestorage.py | 6 +- storage/distributedstorage.py | 2 +- storage/fakestorage.py | 2 +- templates/500.html | 4 +- templates/base.html | 4 +- templates/disclaimer.html | 2 +- templates/index.html | 2 +- templates/message.html | 2 +- templates/oauthorize.html | 4 +- templates/privacy.html | 2 +- templates/tos.html | 36 +-- test/data/test.db | Bin 251904 -> 251904 bytes test/fulldbtest.sh | 2 +- test/test_api_usage.py | 138 ++++---- test/test_endpoint_security.py | 2 +- test/test_gc.py | 8 +- test/test_image_sharing.py | 2 +- test/test_streamlayerformat.py | 6 +- test/testconfig.py | 2 +- test/testlogs.py | 2 +- tools/emailinvoice.py | 2 +- tools/migratebranchregex.py | 2 +- tools/migrateimage.py | 2 +- tools/parsebuildpack.py | 2 +- tools/renderinvoice.py | 2 +- util/changes.py | 2 +- util/checksums.py | 2 +- util/dockerfileparse.py | 4 +- util/dockerloadformat.py | 8 +- util/gzipstream.py | 2 +- util/gzipwrap.py | 6 +- util/invoice.py | 8 +- util/morecollections.py | 2 +- util/queuefile.py | 4 +- util/queuemetrics.py | 2 +- util/queueprocess.py | 4 +- util/streamingjsonencoder.py | 16 +- util/streamlayerformat.py | 4 +- util/tarfileappender.py | 6 +- util/tarlayerformat.py | 4 +- util/useremails.py | 6 +- workers/diffsworker.py | 2 +- workers/dockerfilebuild.py | 4 +- workers/notificationworker.py | 4 +- 171 files changed, 807 insertions(+), 807 deletions(-) diff --git a/Bobfile b/Bobfile index 37f001b79..86b721675 100644 --- a/Bobfile +++ b/Bobfile @@ -19,4 +19,4 @@ version = 1 project = "builder" tags = ["git:short"] -# vim:ft=toml \ No newline at end of file +# vim:ft=toml diff --git a/app.py b/app.py index 33c22d818..908c2681e 100644 --- a/app.py +++ b/app.py @@ -29,7 +29,7 @@ from data.userevent import UserEventsBuilderModule class Config(BaseConfig): """ Flask config enhanced with a `from_yamlfile` method """ - + def from_yamlfile(self, config_file): with open(config_file) as f: c = yaml.load(f) diff --git a/auth/scopes.py b/auth/scopes.py index c71e5faa7..e2192a2bd 100644 --- a/auth/scopes.py +++ b/auth/scopes.py @@ -77,7 +77,7 @@ IMPLIED_SCOPES = { def scopes_from_scope_string(scopes): if not scopes: return {} - + return {ALL_SCOPES.get(scope, None) for scope in scopes.split(',')} diff --git a/buildstatus/building.svg b/buildstatus/building.svg index 6a2e8fc8c..dc7aeae7b 100644 --- a/buildstatus/building.svg +++ b/buildstatus/building.svg @@ -1 +1 @@ -Docker ImageDocker Imagebuildingbuilding \ No newline at end of file +Docker ImageDocker Imagebuildingbuilding \ No newline at end of file diff --git a/buildstatus/failed.svg b/buildstatus/failed.svg index 1a3d79f75..069d9f4e4 100644 --- a/buildstatus/failed.svg +++ b/buildstatus/failed.svg @@ -1 +1 @@ -Docker ImageDocker Imagebuild failedbuild failed \ No newline at end of file +Docker ImageDocker Imagebuild failedbuild failed \ No newline at end of file diff --git a/buildstatus/none.svg b/buildstatus/none.svg index 0f513d9cd..3c31d29b1 100644 --- a/buildstatus/none.svg +++ b/buildstatus/none.svg @@ -1 +1 @@ -Docker ImageDocker Imagenonenone \ No newline at end of file +Docker ImageDocker Imagenonenone \ No newline at end of file diff --git a/buildstatus/ready.svg b/buildstatus/ready.svg index 4ea770599..111262e3b 100644 --- a/buildstatus/ready.svg +++ b/buildstatus/ready.svg @@ -1 +1 @@ -Docker ImageDocker Imagereadyready \ No newline at end of file +Docker ImageDocker Imagereadyready \ No newline at end of file diff --git a/conf/gunicorn_local.py b/conf/gunicorn_local.py index 3d2a36844..aa16e63ec 100644 --- a/conf/gunicorn_local.py +++ b/conf/gunicorn_local.py @@ -4,4 +4,4 @@ worker_class = 'gevent' timeout = 2000 daemon = False logconfig = 'conf/logging.conf' -pythonpath = '.' \ No newline at end of file +pythonpath = '.' diff --git a/conf/gunicorn_registry.py b/conf/gunicorn_registry.py index 3a7d4462b..4f7bb37f2 100644 --- a/conf/gunicorn_registry.py +++ b/conf/gunicorn_registry.py @@ -4,4 +4,4 @@ worker_class = 'gevent' timeout = 2000 logconfig = 'conf/logging.conf' pythonpath = '.' -preload_app = True \ No newline at end of file +preload_app = True diff --git a/conf/gunicorn_verbs.py b/conf/gunicorn_verbs.py index c23b3f304..eaf8041df 100644 --- a/conf/gunicorn_verbs.py +++ b/conf/gunicorn_verbs.py @@ -3,4 +3,4 @@ workers = 4 timeout = 2000 logconfig = 'conf/logging.conf' pythonpath = '.' -preload_app = True \ No newline at end of file +preload_app = True diff --git a/conf/gunicorn_web.py b/conf/gunicorn_web.py index 919dfc88d..bdfa8001a 100644 --- a/conf/gunicorn_web.py +++ b/conf/gunicorn_web.py @@ -4,4 +4,4 @@ worker_class = 'gevent' timeout = 30 logconfig = 'conf/logging.conf' pythonpath = '.' -preload_app = True \ No newline at end of file +preload_app = True diff --git a/conf/root-base.conf b/conf/root-base.conf index 31c32d25d..be8072945 100644 --- a/conf/root-base.conf +++ b/conf/root-base.conf @@ -4,4 +4,4 @@ error_log /var/log/nginx/nginx.error.log; events { worker_connections 1024; accept_mutex off; -} \ No newline at end of file +} diff --git a/conf/server-base.conf b/conf/server-base.conf index 75c6594bb..da46a5d5f 100644 --- a/conf/server-base.conf +++ b/conf/server-base.conf @@ -24,7 +24,7 @@ location / { location /realtime { proxy_pass http://web_app_server; proxy_buffering off; - proxy_request_buffering off; + proxy_request_buffering off; } location /v1/ { @@ -59,4 +59,4 @@ location /v1/_ping { add_header X-Docker-Registry-Version 0.6.0; add_header X-Docker-Registry-Standalone 0; return 200 'true'; -} \ No newline at end of file +} diff --git a/config.py b/config.py index 506e23b74..4627dc9a2 100644 --- a/config.py +++ b/config.py @@ -49,9 +49,9 @@ class DefaultConfig(object): REGISTRY_TITLE = 'Quay.io' REGISTRY_TITLE_SHORT = 'Quay.io' CONTACT_INFO = [ - 'mailto:support@quay.io', - 'irc://chat.freenode.net:6665/quayio', - 'tel:+1-888-930-3475', + 'mailto:support@quay.io', + 'irc://chat.freenode.net:6665/quayio', + 'tel:+1-888-930-3475', 'https://twitter.com/quayio', ] diff --git a/data/buildlogs.py b/data/buildlogs.py index 6e24f501b..17e5b397f 100644 --- a/data/buildlogs.py +++ b/data/buildlogs.py @@ -48,7 +48,7 @@ class RedisBuildLogs(object): return self._redis.rpush(self._logs_key(build_id), json.dumps(log_obj)) - 1 def get_log_entries(self, build_id, start_index): - """ + """ Returns a tuple of the current length of the list and an iterable of the requested log entries. """ diff --git a/data/migrations/versions/204abf14783d_add_log_entry_kind_for_verbs.py b/data/migrations/versions/204abf14783d_add_log_entry_kind_for_verbs.py index 6765a6aef..981c46087 100644 --- a/data/migrations/versions/204abf14783d_add_log_entry_kind_for_verbs.py +++ b/data/migrations/versions/204abf14783d_add_log_entry_kind_for_verbs.py @@ -25,4 +25,4 @@ def downgrade(tables): (tables.logentrykind.delete() .where(tables.logentrykind.c.name == op.inline_literal('repo_verb'))) - ) \ No newline at end of file + ) diff --git a/data/migrations/versions/325a4d7c79d9_prepare_the_database_for_the_new_.py b/data/migrations/versions/325a4d7c79d9_prepare_the_database_for_the_new_.py index e3be811b6..d6bdcb35e 100644 --- a/data/migrations/versions/325a4d7c79d9_prepare_the_database_for_the_new_.py +++ b/data/migrations/versions/325a4d7c79d9_prepare_the_database_for_the_new_.py @@ -71,7 +71,7 @@ def upgrade(tables): op.create_index('repositorynotification_repository_id', 'repositorynotification', ['repository_id'], unique=False) op.create_index('repositorynotification_uuid', 'repositorynotification', ['uuid'], unique=False) op.add_column(u'notification', sa.Column('dismissed', sa.Boolean(), nullable=False)) - + # Manually add the new notificationkind types op.bulk_insert(tables.notificationkind, [ diff --git a/data/migrations/versions/5a07499ce53f_set_up_initial_database.py b/data/migrations/versions/5a07499ce53f_set_up_initial_database.py index 78d7674bd..0e786de14 100644 --- a/data/migrations/versions/5a07499ce53f_set_up_initial_database.py +++ b/data/migrations/versions/5a07499ce53f_set_up_initial_database.py @@ -114,7 +114,7 @@ def upgrade(tables): {'id':30, 'name':'create_prototype_permission'}, {'id':31, 'name':'modify_prototype_permission'}, {'id':32, 'name':'delete_prototype_permission'}, - + {'id':33, 'name':'setup_repo_trigger'}, {'id':34, 'name':'delete_repo_trigger'}, diff --git a/data/model/__init__.py b/data/model/__init__.py index 8258c9c94..f7c9ba24b 100644 --- a/data/model/__init__.py +++ b/data/model/__init__.py @@ -1 +1 @@ -from data.model.legacy import * \ No newline at end of file +from data.model.legacy import * \ No newline at end of file diff --git a/data/model/oauth.py b/data/model/oauth.py index 51bfc053e..8bdca1020 100644 --- a/data/model/oauth.py +++ b/data/model/oauth.py @@ -102,7 +102,7 @@ class DatabaseAuthorizationProvider(AuthorizationProvider): .get()) return found.data except OAuthAccessToken.DoesNotExist: - return None + return None def persist_authorization_code(self, client_id, code, scope): app = OAuthApplication.get(client_id=client_id) @@ -261,7 +261,7 @@ def list_access_tokens_for_user(user): .join(User) .where(OAuthAccessToken.authorized_user == user)) - return query + return query def list_applications_for_org(org): diff --git a/data/queue.py b/data/queue.py index ea6b7d08f..159bd56ce 100644 --- a/data/queue.py +++ b/data/queue.py @@ -44,7 +44,7 @@ class WorkQueue(object): def update_metrics(self): if self._reporter is None: return - + with self._transaction_factory(db): now = datetime.utcnow() name_match_query = self._name_match_query() diff --git a/data/userevent.py b/data/userevent.py index 508ea572f..5523da2e5 100644 --- a/data/userevent.py +++ b/data/userevent.py @@ -102,13 +102,13 @@ class UserEventListener(object): data = None try: - data = json.loads(item['data'] or '{}') + data = json.loads(item['data'] or '{}') except: pass if data: yield event_id, data - + def stop(self): """ Unsubscribes from the channel(s). Should be called once the connection diff --git a/emails/base.html b/emails/base.html index 33dac53de..e01343d53 100644 --- a/emails/base.html +++ b/emails/base.html @@ -22,11 +22,11 @@
- +
- +
{{ app_title }}
{{ app_title }}
- +
@@ -37,7 +37,7 @@ {% block content %}{% endblock %}
- + diff --git a/endpoints/api/__init__.py b/endpoints/api/__init__.py index 1943051e0..b523cf4c2 100644 --- a/endpoints/api/__init__.py +++ b/endpoints/api/__init__.py @@ -289,7 +289,7 @@ def require_fresh_login(func): if not user.password_hash or last_login >= valid_span: return func(*args, **kwargs) - + raise FreshLoginRequired() return wrapped diff --git a/endpoints/api/billing.py b/endpoints/api/billing.py index c41bcec77..c246e4475 100644 --- a/endpoints/api/billing.py +++ b/endpoints/api/billing.py @@ -84,7 +84,7 @@ def get_invoices(customer_id): 'total': i.total, 'plan': i.lines.data[0].plan.id if i.lines.data[0].plan else None } - + try: invoices = billing.Invoice.all(customer=customer_id, count=12) except stripe.APIConnectionError as e: @@ -247,7 +247,7 @@ class UserPlan(ApiResource): except stripe.APIConnectionError as e: abort(503, message='Cannot contact Stripe') - if cus.subscription: + if cus.subscription: return subscription_view(cus.subscription, private_repos) return { @@ -313,7 +313,7 @@ class OrganizationPlan(ApiResource): except stripe.APIConnectionError as e: abort(503, message='Cannot contact Stripe') - if cus.subscription: + if cus.subscription: return subscription_view(cus.subscription, private_repos) return { @@ -338,7 +338,7 @@ class UserInvoiceList(ApiResource): user = get_authenticated_user() if not user.stripe_id: raise NotFound() - + return get_invoices(user.stripe_id) @@ -356,7 +356,7 @@ class OrgnaizationInvoiceList(ApiResource): organization = model.get_organization(orgname) if not organization.stripe_id: raise NotFound() - + return get_invoices(organization.stripe_id) raise Unauthorized() diff --git a/endpoints/api/build.py b/endpoints/api/build.py index 33398c15c..8eb565f50 100644 --- a/endpoints/api/build.py +++ b/endpoints/api/build.py @@ -42,7 +42,7 @@ def user_view(user): def trigger_view(trigger): - if trigger and trigger.uuid: + if trigger and trigger.uuid: config_dict = get_trigger_config(trigger) build_trigger = BuildTrigger.get_trigger_for_service(trigger.service.name) return { @@ -200,7 +200,7 @@ class RepositoryBuildStatus(RepositoryParamResource): if (not build or build.repository.name != repository or build.repository.namespace_user.username != namespace): raise NotFound() - + can_write = ModifyRepositoryPermission(namespace, repository).can() return build_status_view(build, can_write) diff --git a/endpoints/api/discovery.py b/endpoints/api/discovery.py index c3525639f..4e0ff56b1 100644 --- a/endpoints/api/discovery.py +++ b/endpoints/api/discovery.py @@ -39,7 +39,7 @@ def swagger_route_data(include_internal=False, compact=False): if 'view_class' in dir(endpoint_method): view_class = endpoint_method.view_class - + param_data_map = {} if '__api_path_params' in dir(view_class): param_data_map = view_class.__api_path_params @@ -126,7 +126,7 @@ def swagger_route_data(include_internal=False, compact=False): if not internal or (internal and include_internal): # Swagger requires valid nicknames on all operations. - if new_operation.get('nickname'): + if new_operation.get('nickname'): operations.append(new_operation) else: logger.debug('Operation missing nickname: %s' % method) @@ -149,7 +149,7 @@ def swagger_route_data(include_internal=False, compact=False): if not internal or (internal and include_internal): apis.append(new_resource) - + # If compact form was requested, simply return the APIs. if compact: return {'apis': apis} diff --git a/endpoints/api/logs.py b/endpoints/api/logs.py index 8585339e3..271ca9d02 100644 --- a/endpoints/api/logs.py +++ b/endpoints/api/logs.py @@ -15,7 +15,7 @@ def log_view(log): view = { 'kind': log.kind.name, 'metadata': json.loads(log.metadata_json), - 'ip': log.ip, + 'ip': log.ip, 'datetime': format_date(log.datetime), } @@ -40,7 +40,7 @@ def get_logs(start_time, end_time, performer_name=None, repository=None, namespa except ValueError: start_time = None - if not start_time: + if not start_time: start_time = datetime.today() - timedelta(7) # One week if end_time: @@ -49,8 +49,8 @@ def get_logs(start_time, end_time, performer_name=None, repository=None, namespa end_time = end_time + timedelta(days=1) except ValueError: end_time = None - - if not end_time: + + if not end_time: end_time = datetime.today() logs = model.list_logs(start_time, end_time, performer=performer, repository=repository, diff --git a/endpoints/api/organization.py b/endpoints/api/organization.py index f6a381ace..954500735 100644 --- a/endpoints/api/organization.py +++ b/endpoints/api/organization.py @@ -143,7 +143,7 @@ class Organization(ApiResource): org = model.get_organization(orgname) except model.InvalidOrganizationException: raise NotFound() - + org_data = request.get_json() if 'invoice_email' in org_data: logger.debug('Changing invoice_email for organization: %s', org.username) @@ -153,10 +153,10 @@ class Organization(ApiResource): new_email = org_data['email'] if model.find_user_by_email(new_email): raise request_error(message='E-mail address already used') - + logger.debug('Changing email address for organization: %s', org.username) model.update_email(org, new_email) - + teams = model.get_teams_within_org(org) return org_view(org, teams) raise Unauthorized() @@ -186,13 +186,13 @@ class OrgPrivateRepositories(ApiResource): plan = get_plan(cus.subscription.plan.id) if plan: repos_allowed = plan['privateRepos'] - + data['privateAllowed'] = (private_repos < repos_allowed) - + if AdministerOrganizationPermission(orgname).can(): data['privateCount'] = private_repos - + return data raise Unauthorized() @@ -211,19 +211,19 @@ class OrgnaizationMemberList(ApiResource): org = model.get_organization(orgname) except model.InvalidOrganizationException: raise NotFound() - + # Loop to create the members dictionary. Note that the members collection # will return an entry for *every team* a member is on, so we will have # duplicate keys (which is why we pre-build the dictionary). members_dict = {} - members = model.get_organization_members_with_teams(org) + members = model.get_organization_members_with_teams(org) for member in members: if not member.user.username in members_dict: members_dict[member.user.username] = {'name': member.user.username, 'kind': 'user', 'is_robot': member.user.robot, 'teams': []} - + members_dict[member.user.username]['teams'].append(member.team.name) return {'members': members_dict} @@ -244,7 +244,7 @@ class OrganizationMember(ApiResource): org = model.get_organization(orgname) except model.InvalidOrganizationException: raise NotFound() - + member_dict = None member_teams = model.get_organization_members_with_teams(org, membername=membername) for member in member_teams: @@ -253,7 +253,7 @@ class OrganizationMember(ApiResource): 'kind': 'user', 'is_robot': member.user.robot, 'teams': []} - + member_dict['teams'].append(member.team.name) if not member_dict: @@ -364,7 +364,7 @@ class OrganizationApplications(ApiResource): org = model.get_organization(orgname) except model.InvalidOrganizationException: raise NotFound() - + app_data = request.get_json() application = model.oauth.create_application( org, app_data['name'], @@ -397,7 +397,7 @@ class OrganizationApplicationResource(ApiResource): 'required': [ 'name', 'redirect_uri', - 'application_uri' + 'application_uri' ], 'properties': { 'name': { @@ -452,7 +452,7 @@ class OrganizationApplicationResource(ApiResource): org = model.get_organization(orgname) except model.InvalidOrganizationException: raise NotFound() - + application = model.oauth.lookup_application(org, client_id) if not application: raise NotFound() @@ -485,7 +485,7 @@ class OrganizationApplicationResource(ApiResource): org = model.get_organization(orgname) except model.InvalidOrganizationException: raise NotFound() - + application = model.oauth.delete_application(org, client_id) if not application: raise NotFound() @@ -510,7 +510,7 @@ class OrganizationApplicationResetClientSecret(ApiResource): org = model.get_organization(orgname) except model.InvalidOrganizationException: raise NotFound() - + application = model.oauth.lookup_application(org, client_id) if not application: raise NotFound() diff --git a/endpoints/api/permission.py b/endpoints/api/permission.py index 601a549e3..f0fb69f74 100644 --- a/endpoints/api/permission.py +++ b/endpoints/api/permission.py @@ -70,7 +70,7 @@ class RepositoryUserPermissionList(RepositoryParamResource): org_members) role_view_func = wrapped_role_org_view - + # Load and return the permissions. repo_perms = model.get_all_repo_users(namespace, repository) return { @@ -150,7 +150,7 @@ class RepositoryUserPermission(RepositoryParamResource): pass except model.DataModelException as ex: raise request_error(exception=ex) - + log_action('change_repo_permission', namespace, {'username': username, 'repo': repository, 'role': new_permission['role']}, @@ -170,7 +170,7 @@ class RepositoryUserPermission(RepositoryParamResource): log_action('delete_repo_permission', namespace, {'username': username, 'repo': repository}, repo=model.get_repository(namespace, repository)) - + return 'Deleted', 204 diff --git a/endpoints/api/prototype.py b/endpoints/api/prototype.py index bedc19832..c1394e300 100644 --- a/endpoints/api/prototype.py +++ b/endpoints/api/prototype.py @@ -49,7 +49,7 @@ def log_prototype_action(action_kind, orgname, prototype, **kwargs): log_params['delegate_user'] = prototype.delegate_user.username elif prototype.delegate_team: log_params['delegate_team'] = prototype.delegate_team.name - + log_action(action_kind, orgname, log_params) @@ -100,7 +100,7 @@ class PermissionPrototypeList(ApiResource): 'name': { 'type': 'string', 'description': 'The name for the delegate team or user', - }, + }, 'kind': { 'type': 'string', 'description': 'Whether the delegate is a user or a team', @@ -108,7 +108,7 @@ class PermissionPrototypeList(ApiResource): 'user', 'team', ], - }, + }, }, }, }, @@ -128,7 +128,7 @@ class PermissionPrototypeList(ApiResource): permissions = model.get_prototype_permissions(org) org_members = model.get_organization_member_set(orgname) return {'prototypes': [prototype_view(p, org_members) for p in permissions]} - + raise Unauthorized() @nickname('createOrganizationPrototypePermission') @@ -148,7 +148,7 @@ class PermissionPrototypeList(ApiResource): if ('activating_user' in details and details['activating_user'] and 'name' in details['activating_user']): activating_username = details['activating_user']['name'] - + delegate = details['delegate'] if 'delegate' in details else {} delegate_kind = delegate.get('kind', None) delegate_name = delegate.get('name', None) @@ -174,7 +174,7 @@ class PermissionPrototypeList(ApiResource): log_prototype_action('create_prototype_permission', orgname, prototype) org_members = model.get_organization_member_set(orgname) return prototype_view(prototype, org_members) - + raise Unauthorized() @@ -221,7 +221,7 @@ class PermissionPrototype(ApiResource): log_prototype_action('delete_prototype_permission', orgname, prototype) return 'Deleted', 204 - + raise Unauthorized() @nickname('updateOrganizationPrototypePermission') @@ -249,5 +249,5 @@ class PermissionPrototype(ApiResource): original_role=existing.role.name) org_members = model.get_organization_member_set(orgname) return prototype_view(prototype, org_members) - + raise Unauthorized() diff --git a/endpoints/api/repoemail.py b/endpoints/api/repoemail.py index db4c9b571..3a9151b7d 100644 --- a/endpoints/api/repoemail.py +++ b/endpoints/api/repoemail.py @@ -45,7 +45,7 @@ class RepositoryAuthorizedEmail(RepositoryParamResource): @nickname('sendAuthorizeRepoEmail') def post(self, namespace, repository, email): """ Starts the authorization process for an e-mail address on a repository. """ - + with tf(db): record = model.get_email_authorized_for_repo(namespace, repository, email) if record and record.confirmed: diff --git a/endpoints/api/repository.py b/endpoints/api/repository.py index be8c9e8f9..edaf2da58 100644 --- a/endpoints/api/repository.py +++ b/endpoints/api/repository.py @@ -201,7 +201,7 @@ class Repository(RepositoryParamResource): } raise NotFound() - + @require_repo_write @nickname('updateRepo') @validate_json_request('RepoUpdate') @@ -212,7 +212,7 @@ class Repository(RepositoryParamResource): values = request.get_json() repo.description = values['description'] repo.save() - + log_action('set_repo_description', namespace, {'repo': repository, 'description': values['description']}, repo=repo) diff --git a/endpoints/api/repositorynotification.py b/endpoints/api/repositorynotification.py index d9f84a8bc..6dadf3567 100644 --- a/endpoints/api/repositorynotification.py +++ b/endpoints/api/repositorynotification.py @@ -78,7 +78,7 @@ class RepositoryNotificationList(RepositoryParamResource): json['config']) resp = notification_view(notification) - log_action('add_repo_notification', namespace, + log_action('add_repo_notification', namespace, {'repo': repository, 'notification_id': notification.uuid, 'event': json['event'], 'method': json['method']}, repo=repo) @@ -117,7 +117,7 @@ class RepositoryNotification(RepositoryParamResource): def delete(self, namespace, repository, uuid): """ Deletes the specified notification. """ notification = model.delete_repo_notification(namespace, repository, uuid) - log_action('delete_repo_notification', namespace, + log_action('delete_repo_notification', namespace, {'repo': repository, 'notification_id': uuid, 'event': notification.event.name, 'method': notification.method.name}, repo=model.get_repository(namespace, repository)) diff --git a/endpoints/api/robot.py b/endpoints/api/robot.py index b8338c911..b7614a356 100644 --- a/endpoints/api/robot.py +++ b/endpoints/api/robot.py @@ -96,7 +96,7 @@ class OrgRobot(ApiResource): parent = model.get_organization(orgname) robot, password = model.get_robot(robot_shortname, parent) return robot_view(robot.username, password) - + raise Unauthorized() @require_scope(scopes.ORG_ADMIN) diff --git a/endpoints/api/search.py b/endpoints/api/search.py index 1cce618d9..080615582 100644 --- a/endpoints/api/search.py +++ b/endpoints/api/search.py @@ -36,7 +36,7 @@ class EntitySearch(ApiResource): robot_namespace = namespace_name if args['includeTeams']: - teams = model.get_matching_teams(prefix, organization) + teams = model.get_matching_teams(prefix, organization) if args['includeOrgs'] and AdministerOrganizationPermission(namespace_name) \ and namespace_name.startswith(prefix): @@ -124,6 +124,6 @@ class FindRepositories(ApiResource): matching = model.get_matching_repositories(prefix, username) return { 'repositories': [repo_view(repo) for repo in matching - if (repo.visibility.name == 'public' or + if (repo.visibility.name == 'public' or ReadRepositoryPermission(repo.namespace_user.username, repo.name).can())] } diff --git a/endpoints/api/subscribe.py b/endpoints/api/subscribe.py index 2c3fba359..fc93c330f 100644 --- a/endpoints/api/subscribe.py +++ b/endpoints/api/subscribe.py @@ -68,7 +68,7 @@ def subscribe(user, plan, token, require_business_plan): # They want a real paying plan, create the customer and plan # simultaneously card = token - + try: cus = billing.Customer.create(email=user.email, plan=plan, card=card) user.stripe_id = cus.id @@ -116,7 +116,7 @@ def subscribe(user, plan, token, require_business_plan): return carderror_response(e) except stripe.APIConnectionError as e: return connection_response(e) - + response_json = subscription_view(cus.subscription, private_repos) check_repository_usage(user, plan_found) log_action('account_change_plan', user.username, {'plan': plan}) diff --git a/endpoints/api/superuser.py b/endpoints/api/superuser.py index 4e99fe128..3e3315b57 100644 --- a/endpoints/api/superuser.py +++ b/endpoints/api/superuser.py @@ -38,7 +38,7 @@ class SuperUserLogs(ApiResource): performer_name = args['performer'] start_time = args['starttime'] end_time = args['endtime'] - + return get_logs(start_time, end_time) abort(403) @@ -196,7 +196,7 @@ class SuperUserManagement(ApiResource): user = model.get_user(username) if not user or user.organization or user.robot: abort(404) - + return user_view(user) abort(403) @@ -237,7 +237,7 @@ class SuperUserManagement(ApiResource): if 'email' in user_data: model.update_email(user, user_data['email']) - + return user_view(user) abort(403) diff --git a/endpoints/api/tag.py b/endpoints/api/tag.py index 779b821ae..718b220c5 100644 --- a/endpoints/api/tag.py +++ b/endpoints/api/tag.py @@ -36,7 +36,7 @@ class RepositoryTag(RepositoryParamResource): image = model.get_repo_image(namespace, repository, image_id) if not image: raise NotFound() - + original_image_id = None try: original_tag_image = model.get_tag_image(namespace, repository, tag) diff --git a/endpoints/api/team.py b/endpoints/api/team.py index a448cefc9..1bb9f9e1a 100644 --- a/endpoints/api/team.py +++ b/endpoints/api/team.py @@ -28,7 +28,7 @@ def try_accept_invite(code, user): def handle_addinvite_team(inviter, team, user=None, email=None): - invite = model.add_or_invite_to_team(inviter, team, user, email, + invite = model.add_or_invite_to_team(inviter, team, user, email, requires_invite = features.MAILING) if not invite: # User was added to the team directly. @@ -146,7 +146,7 @@ class OrganizationTeam(ApiResource): team = model.set_team_org_permission(team, details['role'], get_authenticated_user().username) log_action('org_set_team_role', orgname, {'team': teamname, 'role': details['role']}) - + return team_view(orgname, team), 200 raise Unauthorized() @@ -181,7 +181,7 @@ class TeamMemberList(ApiResource): team = model.get_organization_team(orgname, teamname) except model.InvalidTeamException: raise NotFound() - + members = model.get_organization_team_members(team.id) invites = [] @@ -220,14 +220,14 @@ class TeamMember(ApiResource): user = model.get_user(membername) if not user: raise request_error(message='Unknown user') - + # Add or invite the user to the team. inviter = get_authenticated_user() invite = handle_addinvite_team(inviter, team, user=user) if not invite: log_action('org_add_team_member', orgname, {'member': membername, 'team': teamname}) return member_view(user, invited=False) - + # User was invited. log_action('org_invite_team_member', orgname, { 'user': membername, @@ -254,7 +254,7 @@ class TeamMember(ApiResource): team = model.get_organization_team(orgname, teamname) except model.InvalidTeamException: raise NotFound() - + # Find the member. member = model.get_user(membername) if not member: @@ -294,7 +294,7 @@ class InviteTeamMember(ApiResource): team = model.get_organization_team(orgname, teamname) except model.InvalidTeamException: raise NotFound() - + # Invite the email to the team. inviter = get_authenticated_user() invite = handle_addinvite_team(inviter, team, email=email) @@ -320,7 +320,7 @@ class InviteTeamMember(ApiResource): team = model.get_organization_team(orgname, teamname) except model.InvalidTeamException: raise NotFound() - + # Delete the invite. model.delete_team_email_invite(team, email) log_action('org_delete_team_member_invite', orgname, { @@ -345,7 +345,7 @@ class TeamMemberInvite(ApiResource): # Accept the invite for the current user. team = try_accept_invite(code, get_authenticated_user()) if not team: - raise NotFound() + raise NotFound() orgname = team.organization.username return { diff --git a/endpoints/api/trigger.py b/endpoints/api/trigger.py index 56bc061dc..e75b2ec07 100644 --- a/endpoints/api/trigger.py +++ b/endpoints/api/trigger.py @@ -76,7 +76,7 @@ class BuildTrigger(RepositoryParamResource): # We are just going to eat this error logger.warning('Trigger deactivation problem: %s', ex) - log_action('delete_repo_trigger', namespace, + log_action('delete_repo_trigger', namespace, {'repo': repository, 'trigger_id': trigger_uuid, 'service': trigger.service.name, 'config': config_dict}, repo=model.get_repository(namespace, repository)) @@ -192,7 +192,7 @@ class BuildTriggerActivate(RepositoryParamResource): # Make sure the namespace matches that of the trigger. if robot_namespace != namespace: - raise Unauthorized() + raise Unauthorized() # Set the pull robot. trigger.pull_robot = pull_robot @@ -224,7 +224,7 @@ class BuildTriggerActivate(RepositoryParamResource): repo = model.get_repository(namespace, repository) log_action('setup_repo_trigger', namespace, {'repo': repository, 'namespace': namespace, - 'trigger_id': trigger.uuid, 'service': trigger.service.name, + 'trigger_id': trigger.uuid, 'service': trigger.service.name, 'pull_robot': trigger.pull_robot.username if trigger.pull_robot else None, 'config': final_config}, repo=repo) @@ -284,7 +284,7 @@ class BuildTriggerAnalyze(RepositoryParamResource): 'status': 'error', 'message': 'Could not parse the Dockerfile specified' } - + # Determine the base image (i.e. the FROM) for the Dockerfile. base_image = parsed.get_base_image() if not base_image: @@ -346,7 +346,7 @@ class BuildTriggerAnalyze(RepositoryParamResource): # Make sure the current user can see/administer the robot. (robot_namespace, shortname) = parse_robot_username(user.username) return AdministerOrganizationPermission(robot_namespace).can() - + repo_users = list(model.get_all_repo_users_transitive(base_namespace, base_repository)) read_robots = [robot_view(user) for user in repo_users if is_valid_robot(user)] @@ -366,7 +366,7 @@ class BuildTriggerAnalyze(RepositoryParamResource): } raise NotFound() - + @resource('/v1/repository//trigger//start') class ActivateBuildTrigger(RepositoryParamResource): @@ -462,7 +462,7 @@ class BuildTriggerFieldValues(RepositoryParamResource): if values is None: raise NotFound() - + return { 'values': values } @@ -486,7 +486,7 @@ class BuildTriggerSources(RepositoryParamResource): user_permission = UserAdminPermission(trigger.connected_user.username) if user_permission.can(): trigger_handler = BuildTriggerBase.get_trigger_for_service(trigger.service.name) - + return { 'sources': trigger_handler.list_build_sources(trigger.auth_token) } diff --git a/endpoints/api/user.py b/endpoints/api/user.py index 8cad4b30a..b7d92e2b1 100644 --- a/endpoints/api/user.py +++ b/endpoints/api/user.py @@ -171,7 +171,7 @@ class User(ApiResource): user = get_authenticated_user() user_data = request.get_json() - try: + try: if 'password' in user_data: logger.debug('Changing password for user: %s', user.username) log_action('account_change_password', user.username) @@ -189,8 +189,8 @@ class User(ApiResource): if model.find_user_by_email(new_email): # Email already used. raise request_error(message='E-mail address already used') - - if features.MAILING: + + if features.MAILING: logger.debug('Sending email to change email address for user: %s', user.username) code = model.create_confirm_email_code(user, new_email=new_email) @@ -206,7 +206,7 @@ class User(ApiResource): raise request_error(message='Username is already in use') model.change_username(user, new_username) - + except model.InvalidPasswordException, ex: raise request_error(exception=ex) @@ -275,7 +275,7 @@ class PrivateRepositories(ApiResource): plan = get_plan(cus.subscription.plan.id) if plan: repos_allowed = plan['privateRepos'] - + return { 'privateCount': private_repos, 'privateAllowed': (private_repos < repos_allowed) diff --git a/endpoints/csrf.py b/endpoints/csrf.py index 7fa8194bc..b4b40d17c 100644 --- a/endpoints/csrf.py +++ b/endpoints/csrf.py @@ -37,4 +37,4 @@ def csrf_protect(func): return wrapper -app.jinja_env.globals['csrf_token'] = generate_csrf_token \ No newline at end of file +app.jinja_env.globals['csrf_token'] = generate_csrf_token diff --git a/endpoints/index.py b/endpoints/index.py index d97dd94f5..85afc6710 100644 --- a/endpoints/index.py +++ b/endpoints/index.py @@ -146,7 +146,7 @@ def get_user(): 'username': '$oauthtoken', 'email': None, }) - elif get_authenticated_user(): + elif get_authenticated_user(): return jsonify({ 'username': get_authenticated_user().username, 'email': get_authenticated_user().email, @@ -205,7 +205,7 @@ def create_repository(namespace, repository): elif repo: permission = ModifyRepositoryPermission(namespace, repository) if not permission.can(): - abort(403, + abort(403, message='You do not have permission to modify repository %(namespace)s/%(repository)s', issue='no-repo-write-permission', namespace=namespace, repository=repository) @@ -214,7 +214,7 @@ def create_repository(namespace, repository): permission = CreateRepositoryPermission(namespace) if not permission.can(): logger.info('Attempt to create a new repo with insufficient perms.') - abort(403, + abort(403, message='You do not have permission to create repositories in namespace "%(namespace)s"', issue='no-create-permission', namespace=namespace) @@ -369,7 +369,7 @@ def get_search(): matching = [] results = [result_view(repo) for repo in matching - if (repo.visibility.name == 'public' or + if (repo.visibility.name == 'public' or ReadRepositoryPermission(repo.namespace_user.username, repo.name).can())] data = { diff --git a/endpoints/notificationevent.py b/endpoints/notificationevent.py index 617beb177..3f27623f5 100644 --- a/endpoints/notificationevent.py +++ b/endpoints/notificationevent.py @@ -83,7 +83,7 @@ class BuildQueueEvent(NotificationEvent): def get_level(self, event_data, notification_data): return 'info' - + def get_sample_data(self, repository): build_uuid = 'fake-build-id' @@ -94,9 +94,9 @@ class BuildQueueEvent(NotificationEvent): 'docker_tags': ['latest', 'foo', 'bar'], 'trigger_kind': 'GitHub' }, subpage='/build?current=%s' % build_uuid) - + def get_summary(self, event_data, notification_data): - return 'Build queued for repository %s' % (event_data['repository']) + return 'Build queued for repository %s' % (event_data['repository']) class BuildStartEvent(NotificationEvent): @@ -116,7 +116,7 @@ class BuildStartEvent(NotificationEvent): 'docker_tags': ['latest', 'foo', 'bar'], 'trigger_kind': 'GitHub' }, subpage='/build?current=%s' % build_uuid) - + def get_summary(self, event_data, notification_data): return 'Build started for repository %s' % (event_data['repository']) @@ -161,7 +161,7 @@ class BuildFailureEvent(NotificationEvent): 'trigger_kind': 'GitHub', 'error_message': 'This is a fake error message' }, subpage='/build?current=%s' % build_uuid) - + def get_summary(self, event_data, notification_data): return 'Build failure for repository %s' % (event_data['repository']) diff --git a/endpoints/notificationhelper.py b/endpoints/notificationhelper.py index 0b73513d9..405a0bdcc 100644 --- a/endpoints/notificationhelper.py +++ b/endpoints/notificationhelper.py @@ -6,7 +6,7 @@ import json def build_event_data(repo, extra_data={}, subpage=None): repo_string = '%s/%s' % (repo.namespace_user.username, repo.name) - homepage = '%s://%s/repository/%s' % (app.config['PREFERRED_URL_SCHEME'], + homepage = '%s://%s/repository/%s' % (app.config['PREFERRED_URL_SCHEME'], app.config['SERVER_HOSTNAME'], repo_string) diff --git a/endpoints/notificationmethod.py b/endpoints/notificationmethod.py index 0d43498f2..d7085f1f0 100644 --- a/endpoints/notificationmethod.py +++ b/endpoints/notificationmethod.py @@ -40,7 +40,7 @@ class NotificationMethod(object): Validates that the notification can be created with the given data. Throws a CannotValidateNotificationMethodException on failure. """ - raise NotImplementedError + raise NotImplementedError def perform(self, notification, event_handler, notification_data): """ @@ -70,7 +70,7 @@ class QuayNotificationMethod(NotificationMethod): status, err_message, target_users = self.find_targets(repository, config_data) if err_message: raise CannotValidateNotificationMethodException(err_message) - + def find_targets(self, repository, config_data): target_info = config_data['target'] @@ -100,7 +100,7 @@ class QuayNotificationMethod(NotificationMethod): except model.InvalidTeamException: # Probably deleted. return (True, 'Unknown team %s' % target_info['name'], None) - + # Lookup the team's members return (True, None, model.get_organization_team_members(team.id)) @@ -194,7 +194,7 @@ class WebhookMethod(NotificationMethod): class FlowdockMethod(NotificationMethod): """ Method for sending notifications to Flowdock via the Team Inbox API: - https://www.flowdock.com/api/team-inbox + https://www.flowdock.com/api/team-inbox """ @classmethod def method_name(cls): @@ -288,7 +288,7 @@ class HipchatMethod(NotificationMethod): 'color': color, 'message': event_handler.get_message(notification_data['event_data'], notification_data), 'notify': level == 'error', - 'message_format': 'html', + 'message_format': 'html', } try: diff --git a/endpoints/trackhelper.py b/endpoints/trackhelper.py index a92955708..d26db7e7e 100644 --- a/endpoints/trackhelper.py +++ b/endpoints/trackhelper.py @@ -59,4 +59,4 @@ def track_and_log(event_name, repo, **kwargs): model.log_action(event_name, namespace, performer=get_authenticated_user(), ip=request.remote_addr, metadata=metadata, - repository=repo) \ No newline at end of file + repository=repo) diff --git a/endpoints/trigger.py b/endpoints/trigger.py index ec4434858..fdfde7000 100644 --- a/endpoints/trigger.py +++ b/endpoints/trigger.py @@ -100,7 +100,7 @@ class BuildTrigger(object): raise NotImplementedError def activate(self, trigger_uuid, standard_webhook_url, auth_token, config): - """ + """ Activates the trigger for the service, with the given new configuration. Returns new configuration that should be stored if successful. """ @@ -246,7 +246,7 @@ class GithubBuildTrigger(BuildTrigger): gh_client = self._get_client(auth_token) source = config['build_source'] - try: + try: repo = gh_client.get_repo(source) # Find the first matching branch. @@ -381,7 +381,7 @@ class GithubBuildTrigger(BuildTrigger): raise SkipRequestException() if should_skip_commit(commit_message): - raise SkipRequestException() + raise SkipRequestException() short_sha = GithubBuildTrigger.get_display_name(commit_sha) @@ -419,7 +419,7 @@ class GithubBuildTrigger(BuildTrigger): branches = self.list_field_values(auth_token, config, 'branch_name') tags = self.list_field_values(auth_token, config, 'tag_name') - return ([{'kind': 'branch', 'name': b} for b in branches] + + return ([{'kind': 'branch', 'name': b} for b in branches] + [{'kind': 'tag', 'name': tag} for tag in tags]) if field_name == 'tag_name': diff --git a/endpoints/verbs.py b/endpoints/verbs.py index c2dfa17a6..f0aef83c4 100644 --- a/endpoints/verbs.py +++ b/endpoints/verbs.py @@ -40,7 +40,7 @@ def _open_stream(namespace, repository, tag, synthetic_image_id, image_json, ima current_image_path = store.image_layer_path(current_image_entry.storage.uuid) current_image_stream = store.stream_read_file(current_image_entry.storage.locations, current_image_path) - + current_image_id = current_image_entry.id logger.debug('Returning image layer %s: %s' % (current_image_id, current_image_path)) yield current_image_stream @@ -56,7 +56,7 @@ def _write_synthetic_image_to_storage(linked_storage_uuid, linked_locations, que def handle_exception(ex): logger.debug('Exception when building squashed image %s: %s', linked_storage_uuid, ex) - + with database.UseThenDisconnect(app.config): model.delete_derived_storage_by_uuid(linked_storage_uuid) diff --git a/endpoints/web.py b/endpoints/web.py index f957e2a97..7fcb09daa 100644 --- a/endpoints/web.py +++ b/endpoints/web.py @@ -234,7 +234,7 @@ def receipt(): invoice = stripe.Invoice.retrieve(invoice_id) if invoice: user_or_org = model.get_user_or_org_by_customer_id(invoice.customer) - + if user_or_org: if user_or_org.organization: admin_org = AdministerOrganizationPermission(user_or_org.username) @@ -244,9 +244,9 @@ def receipt(): else: if not user_or_org.username == current_user.db_user().username: abort(404) - return + return - file_data = renderInvoiceToPdf(invoice, user_or_org) + file_data = renderInvoiceToPdf(invoice, user_or_org) return Response(file_data, mimetype="application/pdf", headers={"Content-Disposition": "attachment;filename=receipt.pdf"}) @@ -263,7 +263,7 @@ def confirm_repo_email(): record = model.confirm_email_authorization_for_repo(code) except model.DataModelException as ex: return render_page_template('confirmerror.html', error_message=ex.message) - + message = """ Your E-mail address has been authorized to receive notifications for repository %s/%s. @@ -285,13 +285,13 @@ def confirm_email(): user, new_email, old_email = model.confirm_user_email(code) except model.DataModelException as ex: return render_page_template('confirmerror.html', error_message=ex.message) - + if new_email: send_email_changed(user.username, old_email, new_email) common_login(user) - return redirect(url_for('web.user', tab='email') + return redirect(url_for('web.user', tab='email') if new_email else url_for('web.index')) diff --git a/endpoints/webhooks.py b/endpoints/webhooks.py index 24d8edf3d..2a8627100 100644 --- a/endpoints/webhooks.py +++ b/endpoints/webhooks.py @@ -72,7 +72,7 @@ def stripe_webhook(): @process_auth def build_trigger_webhook(trigger_uuid, **kwargs): logger.debug('Webhook received with uuid %s', trigger_uuid) - + try: trigger = model.get_build_trigger(trigger_uuid) except model.InvalidBuildTriggerException: diff --git a/events/build_failure.html b/events/build_failure.html index cb93ebff4..7551a467a 100644 --- a/events/build_failure.html +++ b/events/build_failure.html @@ -1,2 +1,2 @@ -Build failed for repository -{{ event_data.repository | repository_reference }} ({{ event_data.build_id }}): {{ event_data.error_message }} \ No newline at end of file +Build failed for repository +{{ event_data.repository | repository_reference }} ({{ event_data.build_id }}): {{ event_data.error_message }} diff --git a/events/build_start.html b/events/build_start.html index 81a0c7fd2..19c9efbc8 100644 --- a/events/build_start.html +++ b/events/build_start.html @@ -1,2 +1,2 @@ -Build started for repository +Build started for repository {{ event_data.repository | repository_reference }} ({{ event_data.build_id }}) diff --git a/events/build_success.html b/events/build_success.html index aee961326..6ecfa6a7b 100644 --- a/events/build_success.html +++ b/events/build_success.html @@ -1,2 +1,2 @@ -Build completed for repository -{{ event_data.repository | repository_reference }} ({{ event_data.build_id }}) \ No newline at end of file +Build completed for repository +{{ event_data.repository | repository_reference }} ({{ event_data.build_id }}) diff --git a/events/repo_push.html b/events/repo_push.html index 0c531d909..c8674c82f 100644 --- a/events/repo_push.html +++ b/events/repo_push.html @@ -1,7 +1,7 @@ {% if notification_data.performer_data.entity_name %} {{ notification_data.performer_data.entity_name | user_reference }} pushed {% else %} -Push of +Push of {% endif %} {% if event_data.updated_tags %} @@ -9,4 +9,4 @@ Push of {% for tag in event_data.updated_tags %}{%if loop.index > 1 %}, {% endif %}{{ (event_data.repository, tag) | repository_tag_reference }}{% endfor %} in {% endif %} - repository {{ event_data.repository | repository_reference }} \ No newline at end of file + repository {{ event_data.repository | repository_reference }} diff --git a/external_libraries.py b/external_libraries.py index 8f3de73a1..febf9abb1 100644 --- a/external_libraries.py +++ b/external_libraries.py @@ -52,7 +52,7 @@ def format_local_name(url): filename = filename + '.css' else: filename = filename + '.js' - + return filename @@ -71,7 +71,7 @@ if __name__ == '__main__': for url in EXTERNAL_FONTS: print 'Downloading %s' % url response = urllib2.urlopen('https://' + url) - + filename = os.path.basename(url).split('?')[0] with open('static/fonts/' + filename, "wb") as local_file: local_file.write(response.read()) diff --git a/features/__init__.py b/features/__init__.py index 9318a9b4a..b5822681e 100644 --- a/features/__init__.py +++ b/features/__init__.py @@ -28,4 +28,4 @@ class FeatureNameValue(object): def __nonzero__(self): return self.value.__nonzero__() - + diff --git a/grunt/Gruntfile.js b/grunt/Gruntfile.js index 3799ebc74..526252bd1 100644 --- a/grunt/Gruntfile.js +++ b/grunt/Gruntfile.js @@ -40,7 +40,7 @@ module.exports = function(grunt) { sourceMap: true, sourceMapName: '../static/dist/<%= pkg.name %>.min.map' }, - js_min: { + js_min: { files: { '../static/dist/<%= pkg.name %>.min.js': ['../static/dist/<%= pkg.name %>.js'] } @@ -78,4 +78,4 @@ module.exports = function(grunt) { // Default task(s). grunt.registerTask('default', ['ngtemplates', 'concat', 'cssmin', 'uglify']); -}; \ No newline at end of file +}; diff --git a/health/healthcheck.py b/health/healthcheck.py index 69d389e89..dc0ae7e6f 100644 --- a/health/healthcheck.py +++ b/health/healthcheck.py @@ -12,7 +12,7 @@ class HealthCheck(object): Conducts any custom healthcheck work, returning a dict representing the HealthCheck output and a boolean indicating whether the instance is healthy. """ - raise NotImplementedError + raise NotImplementedError @classmethod def get_check(cls, name, parameters): @@ -44,12 +44,12 @@ class ProductionHealthCheck(HealthCheck): def __init__(self, access_key, secret_key): self.access_key = access_key self.secret_key = secret_key - + @classmethod def check_name(cls): return 'ProductionHealthCheck' - def conduct_healthcheck(self, db_healthy, buildlogs_healthy): + def conduct_healthcheck(self, db_healthy, buildlogs_healthy): data = { 'db_healthy': db_healthy, 'buildlogs_healthy': buildlogs_healthy @@ -81,4 +81,4 @@ class ProductionHealthCheck(HealthCheck): # requests once RDS comes back up. return (data, not is_rds_working) - return (data, db_healthy) \ No newline at end of file + return (data, db_healthy) diff --git a/initdb.py b/initdb.py index e060b08bc..74199d024 100644 --- a/initdb.py +++ b/initdb.py @@ -28,7 +28,7 @@ SAMPLE_CMDS = [["/bin/bash"], ["/bin/sh", "-c", "sed -i 's/#\\(force_color_prompt\\)/\\1/' /etc/skel/.bashrc"], ["/bin/sh", "-c", "#(nop) EXPOSE [8080]"], - ["/bin/sh", "-c", + ["/bin/sh", "-c", "#(nop) MAINTAINER Jake Moshenko "], None] @@ -152,7 +152,7 @@ def setup_database_for_testing(testcase): global db_initialized_for_testing if not db_initialized_for_testing: - logger.debug('Setting up DB for testing.') + logger.debug('Setting up DB for testing.') # Setup the database. wipe_database() @@ -191,7 +191,7 @@ def initialize_database(): LoginService.create(name='ldap') BuildTriggerService.create(name='github') - + LogEntryKind.create(name='account_change_plan') LogEntryKind.create(name='account_change_cc') LogEntryKind.create(name='account_change_password') @@ -231,7 +231,7 @@ def initialize_database(): LogEntryKind.create(name='create_prototype_permission') LogEntryKind.create(name='modify_prototype_permission') LogEntryKind.create(name='delete_prototype_permission') - + LogEntryKind.create(name='setup_repo_trigger') LogEntryKind.create(name='delete_repo_trigger') @@ -498,7 +498,7 @@ def populate_database(): week_ago = today - timedelta(6) six_ago = today - timedelta(5) four_ago = today - timedelta(4) - + model.log_action('org_create_team', org.username, performer=new_user_1, timestamp=week_ago, metadata={'team': 'readers'}) diff --git a/requirements-nover.txt b/requirements-nover.txt index 262e0594d..741efe889 100644 --- a/requirements-nover.txt +++ b/requirements-nover.txt @@ -36,4 +36,4 @@ psycopg2 pyyaml git+https://github.com/DevTable/aniso8601-fake.git git+https://github.com/DevTable/anunidecode.git -gipc \ No newline at end of file +gipc diff --git a/screenshots/README.md b/screenshots/README.md index 2903bdd70..5c74ce6b9 100644 --- a/screenshots/README.md +++ b/screenshots/README.md @@ -8,4 +8,4 @@ debug run (i.e. hit localhost): ``` casperjs screenshots.js --d -``` \ No newline at end of file +``` diff --git a/static/css/quay.css b/static/css/quay.css index 25934010b..415628dc5 100644 --- a/static/css/quay.css +++ b/static/css/quay.css @@ -92,7 +92,7 @@ .co-m-navbar { background-color: white; margin: 0; - padding-left: 10px; + padding-left: 10px; } .co-fx-box-shadow { @@ -185,7 +185,7 @@ nav.navbar-default .navbar-nav>li>a.active { top: 14px; left: 0px; - width: 12px; + width: 12px; height: 12px; display: inline-block; border-radius: 50%; @@ -619,7 +619,7 @@ i.toggle-icon:hover { .logs-view-element .log .log-description code { max-width: 300px; - display: inline-block; + display: inline-block; vertical-align: middle; overflow: hidden; text-overflow: ellipsis; @@ -636,7 +636,7 @@ i.toggle-icon:hover { .billing-options-element .current-card .no-card-outline { - display: inline-block; + display: inline-block; width: 73px; height: 44px; vertical-align: middle; @@ -789,17 +789,17 @@ i.toggle-icon:hover { -webkit-animation-fill-mode: forwards; } -@-moz-keyframes scaleup { +@-moz-keyframes scaleup { 0% { -moz-transform: scale(0); } 100% { -moz-transform: scale(1); } } -@-webkit-keyframes scaleup { +@-webkit-keyframes scaleup { 0% { -webkit-transform: scale(0); } 100% { -webkit-transform: scale(1); } } -@keyframes scaleup { +@keyframes scaleup { 0% { transform: scale(0); } 100% { transform: scale(1); } } @@ -997,7 +997,7 @@ i.toggle-icon:hover { float: right; vertical-align: middle; font-size: 20px; -} +} .accordion-toggle { cursor: pointer; @@ -1340,7 +1340,7 @@ i.toggle-icon:hover { bottom: 0px; right: 20px; font-size: 12px; - color: #aaa; + color: #aaa; } .plans-list .plan .count { @@ -2379,7 +2379,7 @@ p.editable:hover i { border-radius: 4px; } -.clipboard-copied-message { +.clipboard-copied-message { -webkit-animation: fadeOut 4s ease-in-out 0s 1 forwards; -moz-animation: fadeOut 4s ease-in-out 0s 1 forwards; -ms-animation: fadeOut 4s ease-in-out 0s 1 forwards; @@ -3167,7 +3167,7 @@ p.editable:hover i { } .usage-caption { - display: inline-block; + display: inline-block; color: #aaa; font-size: 26px; margin-left: 10px; @@ -3257,7 +3257,7 @@ p.editable:hover i { margin-right: 10px; } -.org-view .highlight .team-title { +.org-view .highlight .team-title { animation: highlighttemp 1s 2; animation-timing-function: ease-in-out; animation-direction: alternate; @@ -3271,22 +3271,22 @@ p.editable:hover i { -webkit-animation-direction: alternate; } -@-moz-keyframes highlighttemp { +@-moz-keyframes highlighttemp { 0% { background-color: white; } 100% { background-color: rgba(92, 184, 92, 0.36); } } -@-webkit-keyframes highlighttemp { +@-webkit-keyframes highlighttemp { 0% { background-color: white; } 100% { background-color: rgba(92, 184, 92, 0.36); } } -@keyframes highlighttemp { +@keyframes highlighttemp { 0% { background-color: white; } 100% { background-color: rgba(92, 184, 92, 0.36); } } -.org-view .team-title { +.org-view .team-title { font-size: 20px; text-transform: none; padding: 4px; @@ -4626,7 +4626,7 @@ have a fixed width and height (but it's not required). .tour-section.tour-header { margin-top: 40px; margin-bottom: 40px; -} +} .tour-section.tour-header .tour-section-title { text-align: center; @@ -4735,13 +4735,13 @@ have a fixed width and height (but it's not required). color: #888; } -.testimonial .speaker-info .speaker-title a { +.testimonial .speaker-info .speaker-title a { text-decoration: none; color: #888; } .learn-more { - float: right; + float: right; font-size: 22px; } @@ -4775,7 +4775,7 @@ i.slack-icon { .external-notification-view-element { margin: 10px; - padding: 6px; + padding: 6px; border: 1px solid #eee; border-radius: 6px; } @@ -4871,4 +4871,4 @@ i.slack-icon { #startTriggerDialog #runForm .field-title { width: 120px; padding-right: 10px; -} \ No newline at end of file +} diff --git a/static/directives/angular-tour-ui.html b/static/directives/angular-tour-ui.html index 4f4102162..d2fc3ed9d 100644 --- a/static/directives/angular-tour-ui.html +++ b/static/directives/angular-tour-ui.html @@ -1,7 +1,7 @@
-
+

{{ tour.title }}

diff --git a/static/directives/application-manager.html b/static/directives/application-manager.html index df870d7a5..824fd36f7 100644 --- a/static/directives/application-manager.html +++ b/static/directives/application-manager.html @@ -13,7 +13,7 @@ Application Name Application URI - + {{ app.name }} {{ app.application_uri }} diff --git a/static/directives/billing-invoices.html b/static/directives/billing-invoices.html index 2e2bfd469..e022fef03 100644 --- a/static/directives/billing-invoices.html +++ b/static/directives/billing-invoices.html @@ -15,7 +15,7 @@ Status - + {{ invoice.date * 1000 | date:'medium' }} diff --git a/static/directives/billing-options.html b/static/directives/billing-options.html index 374715a2f..47b1d9c28 100644 --- a/static/directives/billing-options.html +++ b/static/directives/billing-options.html @@ -1,4 +1,4 @@ -
+
diff --git a/static/directives/build-log-error.html b/static/directives/build-log-error.html index 13b399bb9..1b27fb447 100644 --- a/static/directives/build-log-error.html +++ b/static/directives/build-log-error.html @@ -9,7 +9,7 @@ - +
Note: The credentials {{ getLocalPullInfo().login.username }} for registry {{ getLocalPullInfo().login.registry }} cannot diff --git a/static/directives/create-external-notification-dialog.html b/static/directives/create-external-notification-dialog.html index bf0c5da03..650862690 100644 --- a/static/directives/create-external-notification-dialog.html +++ b/static/directives/create-external-notification-dialog.html @@ -37,7 +37,7 @@ handle-item-selected="handleEventSelected(datum)" clear-value="clearCounter"> - +
+
- JSON metadata representing the event will be POSTed to the URL. + JSON metadata representing the event will be POSTed to the URL.

- The contents for each event can be found in the user guide: + The contents for each event can be found in the user guide: http://docs.quay.io/guides/notifications.html @@ -118,7 +118,7 @@
- + - +
+
diff --git a/static/directives/entity-reference.html b/static/directives/entity-reference.html index ea65db875..1406b632f 100644 --- a/static/directives/entity-reference.html +++ b/static/directives/entity-reference.html @@ -1,6 +1,6 @@ - + {{entity.name}} {{entity.name}} diff --git a/static/directives/entity-search.html b/static/directives/entity-search.html index 63abb1528..80114df88 100644 --- a/static/directives/entity-search.html +++ b/static/directives/entity-search.html @@ -34,22 +34,22 @@ Robot accounts are not permitted - +
  • {{ team.name }}
  • - + - +
  • {{ robot.name }} - +
  • - +
  • diff --git a/static/directives/external-login-button.html b/static/directives/external-login-button.html index 1afe0c71d..10701f941 100644 --- a/static/directives/external-login-button.html +++ b/static/directives/external-login-button.html @@ -1,22 +1,22 @@
  • - +
    Issue A diff --git a/static/directives/header-bar.html b/static/directives/header-bar.html index fe154341f..748948b1d 100644 --- a/static/directives/header-bar.html +++ b/static/directives/header-bar.html @@ -19,15 +19,15 @@
  • Organizations
  • - +
    - +
    -
    +
    -
    +
    Showing {{(logs | visibleLogFilter:kindsAllowed | filter:search | limitTo:150).length}} of {{(logs | visibleLogFilter:kindsAllowed | filter:search).length}} matching logs
    -
    +
    -
    - +
    +
    @@ -45,7 +45,7 @@ - +
    Date/Time User/Token/App
    @@ -54,7 +54,7 @@ {{ log.datetime }} - +
    @@ -64,7 +64,7 @@
    - + diff --git a/static/directives/manual-trigger-build-dialog.html b/static/directives/manual-trigger-build-dialog.html index e82879e8a..a5eb0dce5 100644 --- a/static/directives/manual-trigger-build-dialog.html +++ b/static/directives/manual-trigger-build-dialog.html @@ -8,7 +8,7 @@ @@ -108,7 +108,7 @@
    - diff --git a/static/img/500/background.svg b/static/img/500/background.svg index 711fc05c0..e3bba7bd5 100644 --- a/static/img/500/background.svg +++ b/static/img/500/background.svg @@ -22,7 +22,7 @@ - - - diff --git a/static/js/app.js b/static/js/app.js index ac9cff1c2..26c341daa 100644 --- a/static/js/app.js +++ b/static/js/app.js @@ -2,7 +2,7 @@ var TEAM_PATTERN = '^[a-zA-Z][a-zA-Z0-9]+$'; var ROBOT_PATTERN = '^[a-zA-Z][a-zA-Z0-9]{3,29}$'; var USER_PATTERN = '^[a-z0-9_]{4,30}$'; -$.fn.clipboardCopy = function() { +$.fn.clipboardCopy = function() { if (zeroClipboardSupported) { (new ZeroClipboard($(this))); return true; @@ -18,7 +18,7 @@ ZeroClipboard.config({ }); ZeroClipboard.on("error", function(e) { - zeroClipboardSupported = false; + zeroClipboardSupported = false; }); ZeroClipboard.on('aftercopy', function(e) { @@ -68,7 +68,7 @@ function clickElement(el){ function getFirstTextLine(commentString) { if (!commentString) { return ''; } - + var lines = commentString.split('\n'); var MARKDOWN_CHARS = { '#': true, @@ -114,7 +114,7 @@ function createOrganizationTeam(ApiService, orgname, teamname, callback) { 'orgname': orgname, 'teamname': teamname }; - + ApiService.updateOrganizationTeam(data, params) .then(callback, ApiService.errorDisplay('Cannot create team')); } @@ -207,7 +207,7 @@ quayApp = angular.module('quay', quayDependencies, function($provide, cfpLoading that.showAdditionalEntries_(); }, 10); }; - + _ViewArray.prototype.stopTimer_ = function() { if (this.timerRef_) { $interval.cancel(this.timerRef_); @@ -287,7 +287,7 @@ quayApp = angular.module('quay', quayDependencies, function($provide, cfpLoading that.call_(); }, this.sleeptime_) }; - + var service = { 'create': function(scope, requester, opt_sleeptime) { return new _PollChannel(scope, requester, opt_sleeptime); @@ -308,7 +308,7 @@ quayApp = angular.module('quay', quayDependencies, function($provide, cfpLoading dataFileService.tryAsZip_ = function(buf, success, failure) { var zip = null; var zipFiles = null; - try { + try { var zip = new JSZip(buf); zipFiles = zip.files; } catch (e) { @@ -392,7 +392,7 @@ quayApp = angular.module('quay', quayDependencies, function($provide, cfpLoading success(processed); break; } - }); + }); }; dataFileService.blobToString = function(blob, callback) { @@ -463,7 +463,7 @@ quayApp = angular.module('quay', quayDependencies, function($provide, cfpLoading $provide.factory('UIService', [function() { var uiService = {}; - + uiService.hidePopover = function(elem) { var popover = $(elem).data('bs.popover'); if (popover) { @@ -483,7 +483,7 @@ quayApp = angular.module('quay', quayDependencies, function($provide, cfpLoading popover.show(); }, 500); }; - + uiService.showFormError = function(elem, result) { var message = result.data['message'] || result.data['error_description'] || ''; if (message) { @@ -492,7 +492,7 @@ quayApp = angular.module('quay', quayDependencies, function($provide, cfpLoading uiService.hidePopover(elem); } }; - + return uiService; }]); @@ -511,14 +511,14 @@ quayApp = angular.module('quay', quayDependencies, function($provide, cfpLoading .replace(/>/g, ">") .replace(/"/g, """) .replace(/'/g, "'"); - + return adjusted; }; - + utilService.textToSafeHtml = function(text) { return $sanitize(utilService.escapeHtmlString(text)); }; - + return utilService; }]); @@ -579,7 +579,7 @@ quayApp = angular.module('quay', quayDependencies, function($provide, cfpLoading }, 1000); } }; - + var pingUrlInternal = function($scope, url, callback) { var path = url + '?cb=' + (Math.random() * 100); var start = new Date(); @@ -606,7 +606,7 @@ quayApp = angular.module('quay', quayDependencies, function($provide, cfpLoading pingService.pingUrl = function($scope, url, callback) { if (pingCache[url]) { - invokeCallback($scope, pingCache[url]['pings'], callback); + invokeCallback($scope, pingCache[url]['pings'], callback); return; } @@ -616,12 +616,12 @@ quayApp = angular.module('quay', quayDependencies, function($provide, cfpLoading pingUrlInternal($scope, url, callback); }, 1000); }; - + return pingService; }]); - $provide.factory('TriggerService', ['UtilService', '$sanitize', 'KeyService', + $provide.factory('TriggerService', ['UtilService', '$sanitize', 'KeyService', function(UtilService, $sanitize, KeyService) { var triggerService = {}; @@ -644,13 +644,13 @@ quayApp = angular.module('quay', quayDependencies, function($provide, cfpLoading ], 'get_redirect_url': function(namespace, repository) { - var redirect_uri = KeyService['githubRedirectUri'] + '/trigger/' + + var redirect_uri = KeyService['githubRedirectUri'] + '/trigger/' + namespace + '/' + repository; var authorize_url = KeyService['githubTriggerAuthorizeUrl']; var client_id = KeyService['githubTriggerClientId']; - return authorize_url + 'client_id=' + client_id + + return authorize_url + 'client_id=' + client_id + '&scope=repo,user:email&redirect_uri=' + redirect_uri; } } @@ -759,7 +759,7 @@ quayApp = angular.module('quay', quayDependencies, function($provide, cfpLoading if (typeof description != 'string') { description = description(metadata); } - + for (var key in metadata) { if (metadata.hasOwnProperty(key)) { var value = metadata[key] != null ? metadata[key] : '(Unknown)'; @@ -808,7 +808,7 @@ quayApp = angular.module('quay', quayDependencies, function($provide, cfpLoading if (command.length > 2 && command[0] == '/bin/sh' && command[1] == '-c') { return command[2]; } - + return command.join(' '); }; @@ -839,7 +839,7 @@ quayApp = angular.module('quay', quayDependencies, function($provide, cfpLoading features.hasFeature = function(name) { return !!features.getFeature(name); }; - + features.matchesFeatures = function(list) { for (var i = 0; i < list.length; ++i) { var value = features.getFeature(list[i]); @@ -983,7 +983,7 @@ quayApp = angular.module('quay', quayDependencies, function($provide, cfpLoading if (userRelatedResource) { var operations = userRelatedResource['operations']; for (var i = 0; i < operations.length; ++i) { - var operation = operations[i]; + var operation = operations[i]; if (operation['method'].toLowerCase() == method) { return operation['nickname']; } @@ -997,7 +997,7 @@ quayApp = angular.module('quay', quayDependencies, function($provide, cfpLoading var name = endpointResource['name']; var operations = endpointResource['operations']; for (var i = 0; i < operations.length; ++i) { - var operation = operations[i]; + var operation = operations[i]; buildMethodsForOperation(operation, endpointResource, resourceMap); } }; @@ -1005,7 +1005,7 @@ quayApp = angular.module('quay', quayDependencies, function($provide, cfpLoading var freshLoginFailCheck = function(opName, opArgs) { return function(resp) { var deferred = $q.defer(); - + // If the error is a fresh login required, show the dialog. if (resp.status == 401 && resp.data['error_type'] == 'fresh_login_required') { var verifyNow = function() { @@ -1029,12 +1029,12 @@ quayApp = angular.module('quay', quayDependencies, function($provide, cfpLoading deferred.reject({'data': {'message': 'Invalid verification credentials'}}); }); }; - + var box = bootbox.dialog({ "message": 'It has been more than a few minutes since you last logged in, ' + - 'so please verify your password to perform this sensitive operation:' + + 'so please verify your password to perform this sensitive operation:' + '
    ' + - '' + + '' + '
    ', "title": 'Please Verify', "buttons": { @@ -1057,7 +1057,7 @@ quayApp = angular.module('quay', quayDependencies, function($provide, cfpLoading box.find("input").focus(); box.find("form").submit(function() { if (!$('#freshPassword').val()) { return; } - + box.modal('hide'); verifyNow(); }); @@ -1086,7 +1086,7 @@ quayApp = angular.module('quay', quayDependencies, function($provide, cfpLoading 'ignoreLoadingBar': true }); } - + var opObj = one['custom' + method.toUpperCase()](opt_options); // If the operation requires_fresh_login, then add a specialized error handler that @@ -1177,7 +1177,7 @@ quayApp = angular.module('quay', quayDependencies, function($provide, cfpLoading return apiService; }]); - + $provide.factory('CookieService', ['$cookies', '$cookieStore', function($cookies, $cookieStore) { var cookieService = {}; cookieService.putPermanent = function(name, value) { @@ -1220,7 +1220,7 @@ quayApp = angular.module('quay', quayDependencies, function($provide, cfpLoading scope.$watch(function () { return userService.currentUser(); }, function (currentUser) { scope.user = currentUser; if (opt_callback) { - opt_callback(currentUser); + opt_callback(currentUser); } }, true); }; @@ -1274,7 +1274,7 @@ quayApp = angular.module('quay', quayDependencies, function($provide, cfpLoading ApiService.getLoggedInUser().then(function(loadedUser) { handleUserResponse(loadedUser); }, function() { - handleUserResponse({'anonymous': true}); + handleUserResponse({'anonymous': true}); }); }; @@ -1311,7 +1311,7 @@ quayApp = angular.module('quay', quayDependencies, function($provide, cfpLoading var org = userService.getOrganization(namespace); return !!org; }; - + userService.currentUser = function() { return userResponse; }; @@ -1338,22 +1338,22 @@ quayApp = angular.module('quay', quayDependencies, function($provide, cfpLoading if (Features.BUILD_SUPPORT) { var buildEvents = [ - { + { 'id': 'build_queued', 'title': 'Dockerfile Build Queued', 'icon': 'fa-tasks' }, - { + { 'id': 'build_start', 'title': 'Dockerfile Build Started', 'icon': 'fa-circle-o-notch' }, - { + { 'id': 'build_success', 'title': 'Dockerfile Build Successfully Completed', 'icon': 'fa-check-circle-o' }, - { + { 'id': 'build_failure', 'title': 'Dockerfile Build Failed', 'icon': 'fa-times-circle-o' @@ -1377,7 +1377,7 @@ quayApp = angular.module('quay', quayDependencies, function($provide, cfpLoading } ] }, - { + { 'id': 'email', 'title': 'E-mail', 'icon': 'fa-envelope', @@ -1613,7 +1613,7 @@ quayApp = angular.module('quay', quayDependencies, function($provide, cfpLoading var params = { 'uuid': notification.id }; - + ApiService.updateUserNotification(notification, params, function() { notificationService.update(); }, ApiService.errorDisplay('Could not update notification')); @@ -1763,7 +1763,7 @@ quayApp = angular.module('quay', quayDependencies, function($provide, cfpLoading return keyService; }]); - + $provide.factory('PlanService', ['KeyService', 'UserService', 'CookieService', 'ApiService', 'Features', 'Config', function(KeyService, UserService, CookieService, ApiService, Features, Config) { var plans = null; @@ -1843,7 +1843,7 @@ quayApp = angular.module('quay', quayDependencies, function($provide, cfpLoading CookieService.clear('quay.notedplan'); return planId; }; - + planService.handleCardError = function(resp) { if (!planService.isCardError(resp)) { return; } @@ -1903,14 +1903,14 @@ quayApp = angular.module('quay', quayDependencies, function($provide, cfpLoading planService.getPlanIncludingDeprecated = function(planId, callback) { planService.verifyLoaded(function() { - if (planDict[planId]) { + if (planDict[planId]) { callback(planDict[planId]); } }); }; planService.getMinimumPlan = function(privateCount, isBusiness, callback) { - planService.getPlans(function(plans) { + planService.getPlans(function(plans) { for (var i = 0; i < plans.length; i++) { var plan = plans[i]; if (plan.privateRepos >= privateCount) { @@ -1976,7 +1976,7 @@ quayApp = angular.module('quay', quayDependencies, function($provide, cfpLoading planService.showSubscribeDialog($scope, orgname, planId, callbacks, title, /* async */true); return; } - + previousSubscribeFailure = false; planService.setSubscription(orgname, planId, callbacks['success'], function(resp) { @@ -1999,11 +1999,11 @@ quayApp = angular.module('quay', quayDependencies, function($provide, cfpLoading var submitToken = function(token) { if (submitted) { return; } submitted = true; - $scope.$apply(function() { + $scope.$apply(function() { if (callbacks['started']) { callbacks['started'](); } - + var cardInfo = { 'token': token.id }; @@ -2070,7 +2070,7 @@ quayApp = angular.module('quay', quayDependencies, function($provide, cfpLoading "className": "btn-default" } } - }); + }); return; } @@ -2121,7 +2121,7 @@ quayApp = angular.module('quay', quayDependencies, function($provide, cfpLoading return { require: 'ngModel', link: function(scope, elem, attrs, ctrl) { - scope.$watch(function() { + scope.$watch(function() { return $parse(attrs.match)(scope) === ctrl.$modelValue; }, function(currentValue) { ctrl.$setValidity('mismatch', currentValue); @@ -2216,7 +2216,7 @@ quayApp = angular.module('quay', quayDependencies, function($provide, cfpLoading if (window.__config && window.__config.MIXPANEL_KEY) { quayApp.config(['$analyticsProvider', function($analyticsProvider) { - $analyticsProvider.virtualPageviews(true); + $analyticsProvider.virtualPageviews(true); }]); } @@ -2332,7 +2332,7 @@ quayApp.directive('quayClasses', function(Features, Config) { priority: 580, restrict: 'A', link: function($scope, $element, $attr, ctrl, $transclude) { - + // Borrowed from ngClass. function flattenClasses(classVal) { if(angular.isArray(classVal)) { @@ -2346,10 +2346,10 @@ quayApp.directive('quayClasses', function(Features, Config) { }); return classes.join(' '); } - + return classVal; } - + function removeClass(classVal) { $attr.$removeClass(flattenClasses(classVal)); } @@ -2417,7 +2417,7 @@ quayApp.directive('quayInclude', function($compile, $templateCache, $http, Featu if (!templatePath) { return; } - + var promise = getTemplate(templatePath).success(function(html) { $element.html(html); }).then(function (response) { @@ -2496,7 +2496,7 @@ quayApp.directive('applicationInfo', function () { 'application': '=application' }, controller: function($scope, $element, ApiService) { - + } }; return directiveDefinitionObject; @@ -2573,7 +2573,7 @@ quayApp.directive('repoBreadcrumb', function () { 'subsection': '=subsection', 'subsectionIcon': '=subsectionIcon' }, - controller: function($scope, $element) { + controller: function($scope, $element) { } }; return directiveDefinitionObject; @@ -2587,7 +2587,7 @@ quayApp.directive('focusablePopoverContent', ['$timeout', '$popover', function ( var hide = function() { $body.off('click'); - if (!scope) { return; } + if (!scope) { return; } scope.$apply(function() { if (!scope) { return; } scope.$hide(); @@ -2595,7 +2595,7 @@ quayApp.directive('focusablePopoverContent', ['$timeout', '$popover', function ( }; scope.$on('$destroy', function() { - $body.off('click'); + $body.off('click'); }); $timeout(function() { @@ -2647,7 +2647,7 @@ quayApp.directive('copyBox', function () { var number = $rootScope.__copyBoxIdCounter || 0; $rootScope.__copyBoxIdCounter = number + 1; $scope.inputId = "copy-box-input-" + number; - + var button = $($element).find('.copy-icon'); var input = $($element).find('input'); @@ -2728,7 +2728,7 @@ quayApp.directive('externalLoginButton', function () { $scope.signInStarted({'service': service}); var url = KeyService.getExternalLoginUrl(service, $scope.action || 'login'); - + // Save the redirect URL in a cookie so that we can redirect back after the service returns to us. var redirectURL = $scope.redirectUrl || window.location.toString(); CookieService.putPermanent('quay.redirectAfterLoad', redirectURL); @@ -2826,7 +2826,7 @@ quayApp.directive('signinForm', function () { $scope.cancelInterval(); $scope.tryAgainSoon = result.headers('Retry-After'); - $scope.tryAgainInterval = $interval(function() { + $scope.tryAgainInterval = $interval(function() { $scope.tryAgainSoon--; if ($scope.tryAgainSoon <= 0) { $scope.cancelInterval(); @@ -2856,10 +2856,10 @@ quayApp.directive('signupForm', function () { 'userRegistered': '&userRegistered' }, - controller: function($scope, $location, $timeout, ApiService, KeyService, UserService, Config, UIService) { + controller: function($scope, $location, $timeout, ApiService, KeyService, UserService, Config, UIService) { $('.form-signup').popover(); - $scope.awaitingConfirmation = false; + $scope.awaitingConfirmation = false; $scope.registering = false; $scope.register = function() { @@ -2873,7 +2873,7 @@ quayApp.directive('signupForm', function () { ApiService.createNewUser($scope.newUser).then(function(resp) { $scope.registering = false; $scope.awaitingConfirmation = !!resp['awaiting_verification']; - + if (Config.MIXPANEL_KEY) { mixpanel.alias($scope.newUser.username); } @@ -3017,7 +3017,7 @@ quayApp.directive('dockerAuthDialog', function (Config) { $('#dockerauthmodal').modal('hide'); return; } - + $('#copyClipboard').clipboardCopy(); $('#dockerauthmodal').modal({}); }; @@ -3048,7 +3048,7 @@ quayApp.filter('regex', function() { if (m && m[0].length == input[i].length) { out.push(input[i]); } - } + } return out; }; }); @@ -3077,7 +3077,7 @@ quayApp.filter('visibleLogFilter', function () { if (!allowed) { return logs; } - + var filtered = []; angular.forEach(logs, function (log) { if (allowed[log.kind]) { @@ -3118,7 +3118,7 @@ quayApp.directive('billingInvoices', function () { if (!$scope.makevisible || !isValid) { return; } - + $scope.loading = true; ApiService.listInvoices($scope.organization).then(function(resp) { @@ -3159,7 +3159,7 @@ quayApp.directive('logsView', function () { $scope.kindsAllowed = null; $scope.chartVisible = true; $scope.logsPath = ''; - + var datetime = new Date(); $scope.logStartDate = new Date(datetime.getUTCFullYear(), datetime.getUTCMonth(), datetime.getUTCDate() - 7); $scope.logEndDate = new Date(datetime.getUTCFullYear(), datetime.getUTCMonth(), datetime.getUTCDate()); @@ -3270,7 +3270,7 @@ quayApp.directive('logsView', function () { return 'Create default permission: {role} for {delegate_team}' + defaultPermSuffix(metadata); } }, - 'modify_prototype_permission': function(metadata) { + 'modify_prototype_permission': function(metadata) { if (metadata.delegate_user) { return 'Modify default permission: {role} (from {original_role}) for {delegate_user}' + defaultPermSuffix(metadata); } else if (metadata.delegate_team) { @@ -3443,7 +3443,7 @@ quayApp.directive('logsView', function () { return $scope.chart.getColor(kind); }; - $scope.getDescription = function(log) { + $scope.getDescription = function(log) { log.metadata['_ip'] = log.ip ? log.ip : null; return StringBuilderService.buildString(logDescriptions[log.kind] || log.kind, log.metadata); }; @@ -3473,10 +3473,10 @@ quayApp.directive('applicationManager', function () { 'organization': '=organization', 'makevisible': '=makevisible' }, - controller: function($scope, $element, ApiService) { + controller: function($scope, $element, ApiService) { $scope.loading = false; $scope.applications = []; - + $scope.createApplication = function(appName) { if (!appName) { return; } @@ -3553,7 +3553,7 @@ quayApp.directive('robotsManager', function () { $scope.shownRobot = info; $scope.showRobotCounter++; }; - + $scope.findRobotIndexByName = function(name) { for (var i = 0; i < $scope.robots.length; ++i) { if ($scope.robots[i].name == name) { @@ -3943,13 +3943,13 @@ quayApp.directive('repoSearch', function () { $scope.$watch( function () { return UserService.currentUser(); }, function (currentUser) { ++searchToken; }, true); - + var repoHound = new Bloodhound({ name: 'repositories', remote: { url: '/api/v1/find/repository?query=%QUERY', replace: function (url, uriEncodedQuery) { - url = url.replace('%QUERY', uriEncodedQuery); + url = url.replace('%QUERY', uriEncodedQuery); url += '&cb=' + searchToken; return url; }, @@ -3966,8 +3966,8 @@ quayApp.directive('repoSearch', function () { return datums; } }, - datumTokenizer: function(d) { - return Bloodhound.tokenizers.whitespace(d.val); + datumTokenizer: function(d) { + return Bloodhound.tokenizers.whitespace(d.val); }, queryTokenizer: Bloodhound.tokenizers.whitespace }); @@ -3975,7 +3975,7 @@ quayApp.directive('repoSearch', function () { var element = $($element[0].childNodes[0]); element.typeahead({ 'highlight': true }, { - source: repoHound.ttAdapter(), + source: repoHound.ttAdapter(), templates: { 'suggestion': function (datum) { template = '
    '; @@ -4015,23 +4015,23 @@ quayApp.directive('headerBar', function () { }, controller: function($scope, $element, $location, UserService, PlanService, ApiService, NotificationService) { $scope.notificationService = NotificationService; - + // Monitor any user changes and place the current user into the scope. UserService.updateUserIn($scope); - + $scope.signout = function() { ApiService.logout().then(function() { UserService.load(); $location.path('/'); }); }; - + $scope.appLinkTarget = function() { if ($("div[ng-view]").length === 0) { return "_self"; } return ""; - }; + }; } }; return directiveDefinitionObject; @@ -4101,7 +4101,7 @@ quayApp.directive('entitySearch', function () { // Reset the cached teams and robots. $scope.teams = null; $scope.robots = null; - + // Load the organization's teams (if applicable). if ($scope.isOrganization && isSupported('team')) { // Note: We load the org here again so that we always have the fully up-to-date @@ -4129,7 +4129,7 @@ quayApp.directive('entitySearch', function () { bootbox.prompt('Enter the name of the new team', function(teamname) { if (!teamname) { return; } - + var regex = new RegExp(TEAM_PATTERN); if (!regex.test(teamname)) { bootbox.alert('Invalid team name'); @@ -4139,7 +4139,7 @@ quayApp.directive('entitySearch', function () { createOrganizationTeam(ApiService, $scope.namespace, teamname, function(created) { $scope.setEntity(created.name, 'team', false); $scope.teams[teamname] = created; - }); + }); }); }; @@ -4158,7 +4158,7 @@ quayApp.directive('entitySearch', function () { createRobotAccount(ApiService, $scope.isOrganization, $scope.namespace, robotname, function(created) { $scope.setEntity(created.name, 'user', true); $scope.robots.push(created); - }); + }); }); }; @@ -4252,8 +4252,8 @@ quayApp.directive('entitySearch', function () { return datums; } }, - datumTokenizer: function(d) { - return Bloodhound.tokenizers.whitespace(d.val); + datumTokenizer: function(d) { + return Bloodhound.tokenizers.whitespace(d.val); }, queryTokenizer: Bloodhound.tokenizers.whitespace }); @@ -4294,7 +4294,7 @@ quayApp.directive('entitySearch', function () { var class_string = ''; for (var i = 0; i < classes.length; ++i) { - if (i > 0) { + if (i > 0) { if (i == classes.length - 1) { class_string += ' or '; } else { @@ -4309,17 +4309,17 @@ quayApp.directive('entitySearch', function () { } return null; - }, + }, 'suggestion': function (datum) { template = '
    '; if (datum.entity.kind == 'user' && !datum.entity.is_robot) { template += ''; } else if (datum.entity.kind == 'user' && datum.entity.is_robot) { - template += ''; + template += ''; } else if (datum.entity.kind == 'team') { template += ''; } else if (datum.entity.kind == 'org') { - template += ''; } @@ -4361,7 +4361,7 @@ quayApp.directive('entitySearch', function () { if (!input) { return; } $(input).typeahead('val', ''); - $scope.clearEntityInternal(); + $scope.clearEntityInternal(); }); $scope.$watch('placeholder', function(title) { @@ -4411,7 +4411,7 @@ quayApp.directive('roleGroup', function () { controller: function($scope, $element) { $scope.setRole = function(role) { if ($scope.currentRole == role) { return; } - if ($scope.roleChanged) { + if ($scope.roleChanged) { $scope.roleChanged({'role': role}); } else { $scope.currentRole = role; @@ -4490,10 +4490,10 @@ quayApp.directive('billingOptions', function () { 'diners club': 'diners', 'discover': 'discover', 'jcb': 'jcb', - 'mastercard': 'mastercard', + 'mastercard': 'mastercard', 'visa': 'visa' }; - + kind = supported[kind] || 'credit'; return kind + '.png'; }; @@ -4525,7 +4525,7 @@ quayApp.directive('billingOptions', function () { save(); } }; - + $scope.$watch('invoice_email', checkSave); $scope.$watch('organization', update); $scope.$watch('user', update); @@ -4534,7 +4534,7 @@ quayApp.directive('billingOptions', function () { return directiveDefinitionObject; }); - + quayApp.directive('planManager', function () { var directiveDefinitionObject = { priority: 0, @@ -4550,7 +4550,7 @@ quayApp.directive('planManager', function () { }, controller: function($scope, $element, PlanService, ApiService) { $scope.isExistingCustomer = false; - + $scope.parseDate = function(timestamp) { return new Date(timestamp * 1000); }; @@ -4576,7 +4576,7 @@ quayApp.directive('planManager', function () { 'opened': function() { $scope.planChanging = true; }, 'closed': function() { $scope.planChanging = false; }, 'success': subscribedToPlan, - 'failure': function(resp) { + 'failure': function(resp) { $scope.planChanging = false; } }; @@ -4595,7 +4595,7 @@ quayApp.directive('planManager', function () { PlanService.getPlanIncludingDeprecated(sub.plan, function(subscribedPlan) { $scope.subscribedPlan = subscribedPlan; $scope.planUsagePercent = sub.usedPrivateRepos * 100 / $scope.subscribedPlan.privateRepos; - + if ($scope.planChanged) { $scope.planChanged({ 'plan': subscribedPlan }); } @@ -4623,7 +4623,7 @@ quayApp.directive('planManager', function () { PlanService.verifyLoaded(function(plans) { $scope.plans = plans; update(); - + if ($scope.readyForPlan) { var planRequested = $scope.readyForPlan(); if (planRequested && planRequested != PlanService.getFreePlan()) { @@ -4689,7 +4689,7 @@ quayApp.directive('namespaceSelector', function () { namespaceObj = $scope.namespaces[$scope.user.username]; } - var newNamespace = namespaceObj.name || namespaceObj.username; + var newNamespace = namespaceObj.name || namespaceObj.username; $scope.namespaceObj = namespaceObj; $scope.namespace = newNamespace; @@ -4774,7 +4774,7 @@ quayApp.directive('buildLogError', function () { var repo = repo_and_tag.substring(0, tagIndex); localInfo['repo_url'] = repo_url; - localInfo['repo'] = repo; + localInfo['repo'] = repo; localInfo['isLocal'] = repo_url.indexOf(Config.SERVER_HOSTNAME + '/') == 0; } @@ -4953,7 +4953,7 @@ quayApp.directive('dropdownSelect', function ($compile) { // Setup lookahead. var input = $($element).find('.lookahead-input'); - + $scope.$watch('clearValue', function(cv) { if (cv) { $scope.selectedItem = null; @@ -4997,7 +4997,7 @@ quayApp.directive('dropdownSelect', function ($compile) { datumTokenizer: function(d) { return Bloodhound.tokenizers.whitespace(d.val || d.value || ''); }, - queryTokenizer: Bloodhound.tokenizers.whitespace + queryTokenizer: Bloodhound.tokenizers.whitespace }); dropdownHound.initialize(); @@ -5040,7 +5040,7 @@ quayApp.directive('dropdownSelect', function ($compile) { var iconContainer = element.find('div.dropdown-select-icon-transclude'); var menuContainer = element.find('div.dropdown-select-menu-transclude'); - + angular.forEach(transcludedElements, function(elem) { if (angular.element(elem).hasClass('dropdown-select-icon')) { iconContainer.append(elem); @@ -5049,7 +5049,7 @@ quayApp.directive('dropdownSelect', function ($compile) { } }); - transcludedBlock.remove(); + transcludedBlock.remove(); } }; return directiveDefinitionObject; @@ -5213,7 +5213,7 @@ quayApp.directive('setupTriggerDialog', function () { $scope.currentView = 'analyzed'; return; } - + var params = { 'repository': $scope.repository.namespace + '/' + $scope.repository.name, 'trigger_uuid': $scope.trigger.id @@ -5332,7 +5332,7 @@ quayApp.directive('triggerSetupGithub', function () { if ($scope.isMatching(kind, name, $scope.state.branchTagFilter)) { return; } - + var newFilter = kind + '/' + name; var existing = $scope.state.branchTagFilter; if (existing) { @@ -5376,7 +5376,7 @@ quayApp.directive('triggerSetupGithub', function () { if (ref.kind == 'branch') { $scope.branchNames.push(ref.name); } else { - $scope.tagNames.push(ref.name); + $scope.tagNames.push(ref.name); } } @@ -5410,9 +5410,9 @@ quayApp.directive('triggerSetupGithub', function () { } callback(); - }, ApiService.errorDisplay('Cannot load locations')); + }, ApiService.errorDisplay('Cannot load locations')); } - + $scope.handleLocationInput = function(location) { $scope.state.isInvalidLocation = $scope.locations.indexOf(location) < 0; $scope.trigger['config']['subdir'] = location || ''; @@ -5429,7 +5429,7 @@ quayApp.directive('triggerSetupGithub', function () { $scope.trigger['config']['subdir'] = location || ''; $scope.trigger.$ready = true; }; - + $scope.selectRepo = function(repo, org) { $scope.state.currentRepo = { 'repo': repo, @@ -5455,7 +5455,7 @@ quayApp.directive('triggerSetupGithub', function () { }; }; - var setupTypeahead = function() { + var setupTypeahead = function() { var repos = []; for (var i = 0; i < $scope.orgs.length; ++i) { var org = $scope.orgs[i]; @@ -5483,7 +5483,7 @@ quayApp.directive('triggerSetupGithub', function () { }; $scope.$watch('state.currentRepo', function(repo) { - if (repo) { + if (repo) { $scope.selectRepoInternal(repo); } }); @@ -5519,7 +5519,7 @@ quayApp.directive('buildLogCommand', function () { if (colon <= 0) { return ''; } - + return $.trim(fullTitle.substring(colon + 1)); }; } @@ -5543,7 +5543,7 @@ quayApp.directive('dockerfileCommand', function () { 'quay.io': function(pieces) { var rnamespace = pieces[pieces.length - 2]; var rname = pieces[pieces.length - 1].split(':')[0]; - return '/repository/' + rnamespace + '/' + rname + '/'; + return '/repository/' + rnamespace + '/' + rname + '/'; }, '': function(pieces) { @@ -5562,11 +5562,11 @@ quayApp.directive('dockerfileCommand', function () { if (!registryHandlers[registry]) { return title; } - + return ' ' + title + ''; } }; - + $scope.getCommandKind = function(title) { var space = title.indexOf(' '); return title.substring(0, space); @@ -5577,17 +5577,17 @@ quayApp.directive('dockerfileCommand', function () { if (space <= 0) { return UtilService.textToSafeHtml(title); } - + var kind = $scope.getCommandKind(title); var sanitized = UtilService.textToSafeHtml(title.substring(space + 1)); - + var handler = kindHandlers[kind || '']; if (handler) { return handler(sanitized); } else { return sanitized; } - }; + }; } }; return directiveDefinitionObject; @@ -5667,7 +5667,7 @@ quayApp.directive('buildMessage', function () { case 'starting': case 'initializing': return 'Starting Dockerfile build'; - + case 'waiting': return 'Waiting for available build worker'; @@ -5676,16 +5676,16 @@ quayApp.directive('buildMessage', function () { case 'pulling': return 'Pulling base image'; - + case 'building': return 'Building image from Dockerfile'; - + case 'pushing': return 'Pushing image built from Dockerfile'; - + case 'complete': return 'Dockerfile build completed and pushed'; - + case 'error': return 'Dockerfile build failed'; } @@ -5733,7 +5733,7 @@ quayApp.directive('buildProgress', function () { return 0; break; } - + return -1; }; } @@ -5782,7 +5782,7 @@ quayApp.directive('externalNotificationView', function () { "className": "btn-primary" } } - }); + }); }); }; @@ -5821,7 +5821,7 @@ quayApp.directive('createExternalNotificationDialog', function () { $scope.events = ExternalNotificationData.getSupportedEvents(); $scope.methods = ExternalNotificationData.getSupportedMethods(); - + $scope.setEvent = function(event) { $scope.currentEvent = event; }; @@ -5878,7 +5878,7 @@ quayApp.directive('createExternalNotificationDialog', function () { $scope.handleEmailCheck = function(isAuthorized) { if (isAuthorized) { $scope.performCreateNotification(); - return; + return; } if ($scope.status == 'authorizing-email-sent') { @@ -5929,7 +5929,7 @@ quayApp.directive('createExternalNotificationDialog', function () { $scope.unauthorizedEmail = false; $('#createNotificationModal').modal({}); } - }); + }); } }; return directiveDefinitionObject; @@ -6060,7 +6060,7 @@ quayApp.directive('notificationView', function () { } else { var parts = url.split('?') $location.path(parts[0]); - + if (parts.length > 1) { $location.search(parts[1]); } @@ -6123,7 +6123,7 @@ quayApp.directive('dockerfileBuildDialog', function () { $scope.errorMessage = null; $scope.startCounter++; }; - + $scope.$watch('showNow', function(sn) { if (sn && $scope.repository) { $('#dockerfilebuildModal').modal({}); @@ -6281,11 +6281,11 @@ quayApp.directive('dockerfileBuildForm', function () { }; request.send(file); }; - + var startFileUpload = function(repo) { $scope.uploading = true; $scope.uploading_progress = 0; - + var uploader = $('#file-drop')[0]; if (uploader.files.length == 0) { handleMissingFile(); @@ -6295,18 +6295,18 @@ quayApp.directive('dockerfileBuildForm', function () { var file = uploader.files[0]; $scope.upload_file = file.name; - + var mimeType = file.type || 'application/octet-stream'; var data = { 'mimeType': mimeType }; - + var getUploadUrl = ApiService.getFiledropUrl(data).then(function(resp) { conductUpload(file, resp.url, resp.file_id, mimeType); }, function() { handleUploadFailed('Could not retrieve upload URL'); }); - }; + }; $scope.$watch('internal.hasDockerfile', function(d) { $scope.hasDockerfile = d; @@ -6451,12 +6451,12 @@ quayApp.directive('tagSpecificImagesView', function () { if (image.ancestors.length > 1) { classes += 'child '; } - + var currentTag = $scope.repository.tags[$scope.tag]; if (image.id == currentTag.image_id) { classes += 'tag-image '; } - + return classes; }; @@ -6475,7 +6475,7 @@ quayApp.directive('tagSpecificImagesView', function () { if (!tag_image) { return; } - + callback(tag_image); var ancestors = tag_image.ancestors.split('/').reverse(); @@ -6485,7 +6485,7 @@ quayApp.directive('tagSpecificImagesView', function () { if (image == opt_cutoff) { return; } - + callback(image); } } @@ -6502,7 +6502,7 @@ quayApp.directive('tagSpecificImagesView', function () { $scope.tagSpecificImages = []; return; } - + var getIdsForTag = function(currentTag) { var ids = {}; forAllTagImages(currentTag, function(image) { @@ -6530,7 +6530,7 @@ quayApp.directive('tagSpecificImagesView', function () { images.push(image); } } - + images.sort(function(a, b) { var result = new Date(b.created) - new Date(a.created); if (result != 0) { @@ -6600,7 +6600,7 @@ quayApp.directive('ngVisible', function () { quayApp.config( [ '$compileProvider', function( $compileProvider ) - { + { $compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|ftp|mailto|tel|irc):/); } ]); @@ -6681,11 +6681,11 @@ quayApp.run(['$location', '$rootScope', 'Restangular', 'UserService', 'PlanServi if (!description) { description = 'Hosted private docker repositories. Includes full user management and history. Free for public repositories.'; } - + // Note: We set the content of the description tag manually here rather than using Angular binding // because we need the tag to have a default description that is not of the form "{{ description }}", // we read by tools that do not properly invoke the Angular code. - $('#descriptionTag').attr('content', description); + $('#descriptionTag').attr('content', description); }); $rootScope.$on('$routeUpdate', function(){ @@ -6738,8 +6738,8 @@ quayApp.run(['$location', '$rootScope', 'Restangular', 'UserService', 'PlanServi $location.search(newSearch); }); - - e.preventDefault(); + + e.preventDefault(); }); if (activeTab) { diff --git a/static/js/controllers.js b/static/js/controllers.js index c8a8cc433..4a5a20622 100644 --- a/static/js/controllers.js +++ b/static/js/controllers.js @@ -59,13 +59,13 @@ function PlansCtrl($scope, $location, UserService, PlanService, $routeParams) { $scope.signedIn = function() { $('#signinModal').modal('hide'); - PlanService.handleNotedPlan(); + PlanService.handleNotedPlan(); }; - + $scope.buyNow = function(plan) { PlanService.notePlan(plan); if ($scope.user && !$scope.user.anonymous) { - PlanService.handleNotedPlan(); + PlanService.handleNotedPlan(); } else { $('#signinModal').modal({}); } @@ -77,7 +77,7 @@ function PlansCtrl($scope, $location, UserService, PlanService, $routeParams) { if ($scope && $routeParams['trial-plan']) { $scope.buyNow($routeParams['trial-plan']); - } + } }, /* include the personal plan */ true); } @@ -94,7 +94,7 @@ function TutorialCtrl($scope, AngularTour, AngularTourSignals, UserService, Conf 'steps': [ { 'title': 'Welcome to the ' + Config.REGISTRY_TITLE_SHORT + ' tutorial!', - 'templateUrl': '/static/tutorial/welcome.html' + 'templateUrl': '/static/tutorial/welcome.html' }, { 'title': 'Sign in to get started', @@ -235,7 +235,7 @@ function RepoListCtrl($scope, $sanitize, Restangular, UserService, ApiService) { $scope.namespace = null; $scope.page = 1; $scope.publicPageCount = null; - + // Monitor changes in the user. UserService.updateUserIn($scope, function() { loadMyRepos($scope.namespace); @@ -269,7 +269,7 @@ function RepoListCtrl($scope, $sanitize, Restangular, UserService, ApiService) { } var options = {'public': false, 'sort': true, 'namespace': namespace}; - + $scope.user_repositories = ApiService.listReposAsResource().withOptions(options).get(function(resp) { return resp.repositories; }); @@ -318,7 +318,7 @@ function LandingCtrl($scope, UserService, ApiService, Features, Config) { if (namespace == $scope.user.username) { return true; } - + if ($scope.user.organizations) { for (var i = 0; i < $scope.user.organizations.length; ++i) { var org = $scope.user.organizations[i]; @@ -483,7 +483,7 @@ function RepoCtrl($scope, $sanitize, Restangular, ImageMetadataService, ApiServi $scope.currentPullCommand = $scope.pullCommands[0]; }; - + $scope.showNewBuildDialog = function() { $scope.buildDialogShowCounter++; }; @@ -655,7 +655,7 @@ function RepoCtrl($scope, $sanitize, Restangular, ImageMetadataService, ApiServi $scope.setImage = function(imageId, opt_updateURL) { if (!$scope.images) { return; } - + var image = null; for (var i = 0; i < $scope.images.length; ++i) { var currentImage = $scope.images[i]; @@ -691,7 +691,7 @@ function RepoCtrl($scope, $sanitize, Restangular, ImageMetadataService, ApiServi // We must find a good default. for (tagName in repo.tags) { if (!proposedTag || tagName == 'latest') { - proposedTag = repo.tags[tagName]; + proposedTag = repo.tags[tagName]; } } } @@ -702,7 +702,7 @@ function RepoCtrl($scope, $sanitize, Restangular, ImageMetadataService, ApiServi if ($scope.tree) { $scope.tree.setTag(proposedTag.name); - } + } if (opt_updateURL) { $location.search('image', null); @@ -871,7 +871,7 @@ function RepoCtrl($scope, $sanitize, Restangular, ImageMetadataService, ApiServi }; var listImages = function() { - var params = {'repository': namespace + '/' + name}; + var params = {'repository': namespace + '/' + name}; $scope.imageHistory = ApiService.listRepositoryImagesAsResource(params).get(function(resp) { $scope.images = resp.images; $scope.specificImages = []; @@ -971,7 +971,7 @@ function BuildPackageCtrl($scope, Restangular, ApiService, DataFileService, $rou return dockerfilePath; }; - var processBuildPack = function(uint8array) { + var processBuildPack = function(uint8array) { var archiveread = function(files) { var getpath = function(file) { return file.path; @@ -1056,7 +1056,7 @@ function BuildPackageCtrl($scope, Restangular, ApiService, DataFileService, $rou $scope.accessDenied = true; return; } - + $rootScope.title = 'Repository Build Pack - ' + resp['display_name']; $scope.repobuild = resp; $scope.repo = { @@ -1115,7 +1115,7 @@ function RepoBuildCtrl($scope, Restangular, ApiService, $routeParams, $rootScope $('#confirmRestartBuildModal').modal('hide'); var subdirectory = ''; - if (build['job_config']) { + if (build['job_config']) { subdirectory = build['job_config']['build_subdir'] || ''; } @@ -1159,7 +1159,7 @@ function RepoBuildCtrl($scope, Restangular, ApiService, $routeParams, $rootScope $scope.processANSI = function(message, container) { var filter = container.logs._filter = (container.logs._filter || ansi2html.create()); - + // Note: order is important here. var setup = filter.getSetupHtml(); var stream = filter.addInputToStream(message); @@ -1194,7 +1194,7 @@ function RepoBuildCtrl($scope, Restangular, ApiService, $routeParams, $rootScope if ($scope.pollChannel) { $scope.pollChannel.stop(); } - + // Create a new channel for polling the build status and logs. var conductStatusAndLogRequest = function(callback) { getBuildStatusAndLogs(build, callback); @@ -1230,7 +1230,7 @@ function RepoBuildCtrl($scope, Restangular, ApiService, $routeParams, $rootScope return endIndex; }; - var getBuildStatusAndLogs = function(build, callback) { + var getBuildStatusAndLogs = function(build, callback) { var params = { 'repository': namespace + '/' + name, 'build_uuid': build.id @@ -1238,7 +1238,7 @@ function RepoBuildCtrl($scope, Restangular, ApiService, $routeParams, $rootScope ApiService.getRepoBuildStatus(null, params, true).then(function(resp) { if (build != $scope.currentBuild) { callback(false); return; } - + // Note: We use extend here rather than replacing as Angular is depending on the // root build object to remain the same object. var matchingBuilds = $.grep($scope.builds, function(elem) { @@ -1258,9 +1258,9 @@ function RepoBuildCtrl($scope, Restangular, ApiService, $routeParams, $rootScope 'start': $scope.logStartIndex }; - ApiService.getRepoBuildLogsAsResource(params, true).withOptions(options).get(function(resp) { + ApiService.getRepoBuildLogsAsResource(params, true).withOptions(options).get(function(resp) { if (build != $scope.currentBuild) { callback(false); return; } - + // Process the logs we've received. $scope.logStartIndex = processLogs(resp['logs'], resp['start'], resp['total']); @@ -1323,7 +1323,7 @@ function RepoBuildCtrl($scope, Restangular, ApiService, $routeParams, $rootScope fetchRepository(); } -function RepoAdminCtrl($scope, Restangular, ApiService, KeyService, TriggerService, $routeParams, +function RepoAdminCtrl($scope, Restangular, ApiService, KeyService, TriggerService, $routeParams, $rootScope, $location, UserService, Config, Features, ExternalNotificationData) { var namespace = $routeParams.namespace; @@ -1335,7 +1335,7 @@ function RepoAdminCtrl($scope, Restangular, ApiService, KeyService, TriggerServi $scope.permissions = {'team': [], 'user': [], 'loading': 2}; $scope.logsShown = 0; $scope.deleting = false; - + $scope.permissionCache = {}; $scope.showTriggerSetupCounter = 0; @@ -1436,7 +1436,7 @@ function RepoAdminCtrl($scope, Restangular, ApiService, KeyService, TriggerServi var permission = $scope.permissions[kind][entityName]; var currentRole = permission.role; permission.role = role; - + var permissionPut = Restangular.one(getRestUrl('repository', namespace, name, 'permissions', kind, entityName)); permissionPut.customPUT(permission).then(function() {}, function(resp) { $scope.permissions[kind][entityName] = {'role': currentRole}; @@ -1534,7 +1534,7 @@ function RepoAdminCtrl($scope, Restangular, ApiService, KeyService, TriggerServi $scope.deleting = true; ApiService.deleteRepository(null, params).then(function() { $scope.repo = null; - + setTimeout(function() { document.location = '/repository/'; }, 1000); @@ -1545,7 +1545,7 @@ function RepoAdminCtrl($scope, Restangular, ApiService, KeyService, TriggerServi }; $scope.showNewNotificationCounter = 0; - + $scope.showNewNotificationDialog = function() { $scope.showNewNotificationCounter++; }; @@ -1629,7 +1629,7 @@ function RepoAdminCtrl($scope, Restangular, ApiService, KeyService, TriggerServi }; $scope.showManualBuildDialog = 0; - + $scope.startTrigger = function(trigger, opt_custom) { var parameters = TriggerService.getRunParameters(trigger.service); if (parameters.length && !opt_custom) { @@ -1767,7 +1767,7 @@ function UserAdminCtrl($scope, $timeout, $location, ApiService, PlanService, Use $scope.invoicesShown = 0; $scope.USER_PATTERN = USER_PATTERN; - + $scope.loadAuthedApps = function() { if ($scope.authorizedApps) { return; } @@ -1810,7 +1810,7 @@ function UserAdminCtrl($scope, $timeout, $location, ApiService, PlanService, Use $scope.orgPlans = plans; }); } - + $scope.convertStep = 1; }; @@ -1858,7 +1858,7 @@ function UserAdminCtrl($scope, $timeout, $location, ApiService, PlanService, Use }, function(result) { $scope.updatingUser = false; UIService.showFormError('#changeUsernameForm', result); - }); + }); }; $scope.changeEmail = function() { @@ -1903,7 +1903,7 @@ function UserAdminCtrl($scope, $timeout, $location, ApiService, PlanService, Use UserService.load(); }, function(result) { $scope.updatingUser = false; - UIService.showFormError('#changePasswordForm', result); + UIService.showFormError('#changePasswordForm', result); }); }; @@ -1920,7 +1920,7 @@ function UserAdminCtrl($scope, $timeout, $location, ApiService, PlanService, Use }; } -function ImageViewCtrl($scope, $routeParams, $rootScope, $timeout, ApiService, ImageMetadataService) { +function ImageViewCtrl($scope, $routeParams, $rootScope, $timeout, ApiService, ImageMetadataService) { var namespace = $routeParams.namespace; var name = $routeParams.name; var imageid = $routeParams.image; @@ -1944,7 +1944,7 @@ function ImageViewCtrl($scope, $routeParams, $rootScope, $timeout, ApiService, I if (index < 0) { return ''; } - + return filepath.substr(0, index).split('/'); }; @@ -1967,10 +1967,10 @@ function ImageViewCtrl($scope, $routeParams, $rootScope, $timeout, ApiService, I $scope.search['$'] = filter; document.getElementById('change-filter').value = filter; }; - + $scope.initializeTree = function() { if ($scope.tree) { return; } - + $scope.tree = new ImageFileChangeTree($scope.image, $scope.combinedChanges); $timeout(function() { $scope.tree.draw('changes-tree-container'); @@ -1990,7 +1990,7 @@ function ImageViewCtrl($scope, $routeParams, $rootScope, $timeout, ApiService, I var fetchImage = function() { var params = { 'repository': namespace + '/' + name, - 'image_id': imageid + 'image_id': imageid }; $scope.image = ApiService.getImageAsResource(params).get(function(image) { @@ -2015,14 +2015,14 @@ function ImageViewCtrl($scope, $routeParams, $rootScope, $timeout, ApiService, I var fetchChanges = function() { var params = { 'repository': namespace + '/' + name, - 'image_id': imageid + 'image_id': imageid }; ApiService.getImageChanges(null, params).then(function(changes) { var combinedChanges = []; var addCombinedChanges = function(c, kind) { for (var i = 0; i < c.length; ++i) { - combinedChanges.push({ + combinedChanges.push({ 'kind': kind, 'file': c[i] }); @@ -2066,7 +2066,7 @@ function NewRepoCtrl($scope, $location, $http, $timeout, UserService, ApiService $scope.$watch('repo.namespace', function(namespace) { // Note: Can initially be undefined. if (!namespace) { return; } - + var isUserNamespace = (namespace == $scope.user.username); $scope.planRequired = null; @@ -2103,7 +2103,7 @@ function NewRepoCtrl($scope, $location, $http, $timeout, UserService, ApiService } } }); - + return true; }; @@ -2176,7 +2176,7 @@ function NewRepoCtrl($scope, $location, $http, $timeout, UserService, ApiService var isUserNamespace = $scope.isUserNamespace; ApiService.getPrivateAllowed(isUserNamespace ? null : $scope.repo.namespace).then(function(resp) { $scope.checkingPlan = false; - + if (resp['privateAllowed']) { $scope.planRequired = null; return; @@ -2218,8 +2218,8 @@ function OrgViewCtrl($rootScope, $scope, ApiService, $routeParams) { { 'id': 'creator', 'title': 'Creator', 'kind': 'success' }, { 'id': 'admin', 'title': 'Admin', 'kind': 'primary' } ]; - - $scope.setRole = function(role, teamname) { + + $scope.setRole = function(role, teamname) { var previousRole = $scope.organization.teams[teamname].role; $scope.organization.teams[teamname].role = role; @@ -2231,7 +2231,7 @@ function OrgViewCtrl($rootScope, $scope, ApiService, $routeParams) { var data = $scope.organization.teams[teamname]; ApiService.updateOrganizationTeam(data, params).then(function(resp) { - }, function(resp) { + }, function(resp) { $scope.organization.teams[teamname].role = previousRole; $scope.roleError = resp.data || ''; $('#cannotChangeTeamModal').modal({}); @@ -2306,7 +2306,7 @@ function OrgAdminCtrl($rootScope, $scope, $timeout, Restangular, $routeParams, U PlanService.getPlans(function(plans) { $scope.plans = plans; $scope.plan_map = {}; - + for (var i = 0; i < plans.length; ++i) { $scope.plan_map[plans[i].stripeId] = plans[i]; } @@ -2321,7 +2321,7 @@ function OrgAdminCtrl($rootScope, $scope, $timeout, Restangular, $routeParams, U $scope.invoicesShown = 0; $scope.applicationsShown = 0; $scope.changingOrganization = false; - + $scope.loadLogs = function() { $scope.logsShown++; }; @@ -2444,7 +2444,7 @@ function TeamViewCtrl($rootScope, $scope, $timeout, Features, Restangular, ApiSe $scope.addNewMember = function(member) { if (!member || $scope.memberMap[member.name]) { return; } - + var params = { 'orgname': orgname, 'teamname': teamname, @@ -2539,7 +2539,7 @@ function TeamViewCtrl($rootScope, $scope, $timeout, Features, Restangular, ApiSe $scope.membersResource = ApiService.getOrganizationTeamMembersAsResource(params).get(function(resp) { $scope.members = resp.members; $scope.canEditMembers = resp.can_edit; - + $('.info-icon').popover({ 'trigger': 'hover', 'html': true @@ -2687,7 +2687,7 @@ function OrgMemberLogsCtrl($scope, $routeParams, $rootScope, $timeout, Restangul }); return resp.member; - }); + }); }; // Load the org info and the member info. @@ -2783,7 +2783,7 @@ function ManageApplicationCtrl($scope, $routeParams, $rootScope, $location, $tim ' under organization ' + $scope.orgname; return resp; - }); + }); }; diff --git a/static/js/graphing.js b/static/js/graphing.js index 97459654c..c7f059991 100644 --- a/static/js/graphing.js +++ b/static/js/graphing.js @@ -8,8 +8,8 @@ throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable"); } - var aArgs = Array.prototype.slice.call(arguments, 1), - fToBind = this, + var aArgs = Array.prototype.slice.call(arguments, 1), + fToBind = this, fNOP = function () {}, fBound = function () { return fToBind.apply(this instanceof fNOP && oThis @@ -156,7 +156,7 @@ ImageHistoryTree.prototype.updateDimensions_ = function() { document.getElementById(container).style.maxHeight = (viewportHeight - boundingBox.top - 150) + 'px'; this.setupOverscroll_(); - + // Update the tree. var rootSvg = this.rootSvg_; var tree = this.tree_; @@ -188,7 +188,7 @@ ImageHistoryTree.prototype.draw = function(container) { // Save the container. this.container_ = container; - + if (!$('#' + container)[0]) { this.container_ = null; return; @@ -237,7 +237,7 @@ ImageHistoryTree.prototype.draw = function(container) { if (d.image.command && d.image.command.length) { html += '' + formatCommand(d.image) + ''; } - html += '' + formatTime(d.image.created) + ''; + html += '' + formatTime(d.image.created) + ''; var tags = d.tags || []; html += ''; @@ -438,7 +438,7 @@ ImageHistoryTree.prototype.buildRoot_ = function() { var ancestors = this.getAncestors_(image); var immediateParent = ancestors[ancestors.length - 1]; var parent = imageByDockerId[immediateParent]; - if (parent) { + if (parent) { // Add a reference to the parent. This makes walking the tree later easier. imageNode.parent = parent; parent.children.push(imageNode); @@ -612,12 +612,12 @@ ImageHistoryTree.prototype.setTag_ = function(tagName) { } var imageByDockerId = this.imageByDockerId_; - + // Save the current tag. var previousTagName = this.currentTag_; this.currentTag_ = tagName; this.currentImage_ = null; - + // Update the path. var tagImage = this.findImage_(function(image) { return image.tags.indexOf(tagName || '(no tag specified)') >= 0; @@ -716,7 +716,7 @@ ImageHistoryTree.prototype.update_ = function(source) { .attr("r", 1e-6) .style("fill", function(d) { return d._children ? "lightsteelblue" : "#fff"; }) .on("click", function(d) { that.toggle_(d); that.update_(d); }); - + // Create the group that will contain the node name and its tags. var g = nodeEnter.append("svg:g").style("fill-opacity", 1e-6); @@ -756,7 +756,7 @@ ImageHistoryTree.prototype.update_ = function(source) { .attr("y", 12) .attr("width", 110) .attr("height", DEPTH_HEIGHT - 20); - + // Add the tags container. fo.append('xhtml:div') .attr("class", "tags") @@ -949,7 +949,7 @@ function FileTreeBase() { * Counter for creating unique IDs. */ this.idCounter_ = 0; - + /** * Map from file path to associated tree node. */ @@ -1017,7 +1017,7 @@ FileTreeBase.prototype.updateDimensions_ = function() { this.barWidth_ = dimensions.bw; this.barHeight_ = dimensions.bh; - + return dimensions; }; @@ -1044,11 +1044,11 @@ FileTreeBase.prototype.dispose = function() { * Draws the tree. */ FileTreeBase.prototype.draw = function(container) { - this.container_ = container; - + this.container_ = container; + var dimensions = this.calculateDimensions_(container); if (!dimensions) { return; } - + var w = dimensions.w; var h = dimensions.h; var m = dimensions.m; @@ -1169,7 +1169,7 @@ FileTreeBase.prototype.getContainerHeight_ = function() { if (!dimensions) { return; } var barHeight = this.barHeight_; - var height = (this.getVisibleCount_(this.root_) * (barHeight + 2)); + var height = (this.getVisibleCount_(this.root_) * (barHeight + 2)); return height + dimensions.m[0] + dimensions.m[2]; }; @@ -1206,16 +1206,16 @@ FileTreeBase.prototype.update_ = function(source) { // Compute the flattened node list. var nodes = tree.nodes(this.root_); - + // Compute the "layout". nodes.forEach(function(n, i) { n.x = i * barHeight; }); - + // Update the nodes... var node = vis.selectAll("g.node") .data(nodes, function(d) { return d.id || (d.id = that.idCounter_++); }); - + var nodeEnter = node.enter().append("svg:g") .attr("class", function(d) { return "node " + (d.kind ? d.kind : 'folder'); @@ -1241,7 +1241,7 @@ FileTreeBase.prototype.update_ = function(source) { that.toggle_(d); that.update_(source); }); - + nodeEnter.append("svg:text") .attr("dy", 3.5) .attr("dx", 5.5 + 18) @@ -1261,7 +1261,7 @@ FileTreeBase.prototype.update_ = function(source) { .duration(duration) .attr("transform", function(d) { return "translate(" + d.y + "," + d.x + ")"; }) .style("opacity", 1); - + node.transition() .duration(duration) // TODO: reenable for full animation @@ -1281,7 +1281,7 @@ FileTreeBase.prototype.update_ = function(source) { node.select('.fo') .attr("x", function(d) { return d.kind ? barWidth - 18 : 0; }) .attr("y", -10) - + node.select('.node-icon') .html(function(d) { if (!d.kind) { @@ -1291,7 +1291,7 @@ FileTreeBase.prototype.update_ = function(source) { return that.determineIcon(d); }); - + // Transition exiting nodes to the parent's new position. node.exit().transition() .duration(duration) @@ -1299,11 +1299,11 @@ FileTreeBase.prototype.update_ = function(source) { // .attr("transform", function(d) { return "translate(" + source.y + "," + source.x + ")"; }) .style("opacity", 1e-6) .remove(); - + // Update the links... var link = vis.selectAll("path.link") .data(tree.links(nodes), function(d) { return d.target.id; }); - + // Enter any new links at the parent's previous position. link.enter().insert("svg:path", "g") .attr("class", "link") @@ -1314,7 +1314,7 @@ FileTreeBase.prototype.update_ = function(source) { .transition() .duration(duration) .attr("d", diagonal); - + // Transition links to their new position. link.transition() .duration(duration) @@ -1323,7 +1323,7 @@ FileTreeBase.prototype.update_ = function(source) { var t = d.target; return diagonal({source: s, target: t}); }); - + // Transition exiting nodes to the parent's new position. link.exit().transition() .duration(duration) @@ -1332,7 +1332,7 @@ FileTreeBase.prototype.update_ = function(source) { return diagonal({source: o, target: o}); }) .remove(); - + // Stash the old positions for transition. nodes.forEach(function(d) { d.x0 = d.x; @@ -1363,11 +1363,11 @@ function ImageFileChangeTree(image, changes) { * The parent image. */ this.image_ = image; - + /** * The changes being drawn. */ - this.changes_ = changes; + this.changes_ = changes; } $.extend(ImageFileChangeTree.prototype, FileTreeBase.prototype); @@ -1393,7 +1393,7 @@ ImageFileChangeTree.prototype.determineIcon = function(d) { 'removed': 'minus-square', 'changed': 'pencil-square' }; - + return ''; }; @@ -1526,7 +1526,7 @@ UsageChart.prototype.drawInternal_ = function() { // Update the text. this.text_.text(this.count_ + ' / ' + this.total_); } - + this.drawn_ = true; }; @@ -1610,7 +1610,7 @@ LogUsageChart.prototype.buildData_ = function(logs) { } this.entries_ = map; - + // Build the data itself. We create a single entry for each possible kind of data, and then add (x, y) pairs // for the number of times that kind of event occurred on a particular day. var dataArray = []; @@ -1626,7 +1626,7 @@ LogUsageChart.prototype.buildData_ = function(logs) { dataMap[key] = found; dataArray.push(found); } - + found.values.push({ 'x': entry.adjusted, 'y': entry.count @@ -1666,7 +1666,7 @@ LogUsageChart.prototype.buildData_ = function(logs) { return a['x'].getDate() - b['x'].getDate(); }); } - + return this.data_ = dataArray; }; @@ -1750,7 +1750,7 @@ LogUsageChart.prototype.handleStateChange_ = function(e) { allowed[this.data_[i].kind] = true; } } - + $(this).trigger({ 'type': 'filteringChanged', 'allowed': allowed @@ -1802,7 +1802,7 @@ LogUsageChart.prototype.draw = function(container, logData, startDate, endDate) } chart.xDomain(domain); - + // Finish setting up the chart. chart.xAxis .tickFormat(d3.time.format("%m/%d")); @@ -1822,4 +1822,4 @@ LogUsageChart.prototype.draw = function(container, logData, startDate, endDate) chart.dispatch.on('stateChange', function(e) { that.handleStateChange_(e); }); return that.chart_ = chart; }); -}; \ No newline at end of file +}; diff --git a/static/js/tour.js b/static/js/tour.js index fb1a8189b..c50d45379 100644 --- a/static/js/tour.js +++ b/static/js/tour.js @@ -1,9 +1,9 @@ angular.module("angular-tour", []) .provider('AngularTour', function() { - this.$get = ['$document', '$rootScope', '$compile', '$location', function($document, $rootScope, $compile, $location) { + this.$get = ['$document', '$rootScope', '$compile', '$location', function($document, $rootScope, $compile, $location) { $rootScope.angular_tour_current = null; - function _start(tour, opt_stepIndex, opt_existingScope) { + function _start(tour, opt_stepIndex, opt_existingScope) { tour.initialStep = opt_stepIndex || tour.initialStep || 0; tour.tourScope = opt_existingScope || null; $rootScope.angular_tour_current = tour; @@ -128,7 +128,7 @@ angular.module("angular-tour", []) speed: 400, color: '#333', animate: true, - easing: 'linear', + easing: 'linear', exitEvent: 'mouseenter', exitEventAppliesToElement: true, paddingX: 1, @@ -214,9 +214,9 @@ angular.module("angular-tour", []) // to transition it to an overlay tour. if ($scope.inline) { var counter = 0; - var unbind = $rootScope.$watch(function() { - return $location.path(); - }, function(location) { + var unbind = $rootScope.$watch(function() { + return $location.path(); + }, function(location) { // Since this callback fires for the first page display, we only unbind it // after the second call. if (counter == 1) { @@ -249,7 +249,7 @@ angular.module("angular-tour", []) return $location.path() == tourScope._replaceData(locationPath); }; }; - + // Signal: When an element is found in the page's DOM. signals.elementAvaliable = function(elementPath) { return function(tourScope) { diff --git a/static/js/untar.js b/static/js/untar.js index 02c0f6c07..79f280108 100644 --- a/static/js/untar.js +++ b/static/js/untar.js @@ -387,7 +387,7 @@ if (!Array.prototype.some) { /* * Extract data from an input. - * + * * @param data The data, in Uint8Array form. */ function Untar(data) { @@ -403,7 +403,7 @@ if (!Array.prototype.some) { 'files': [] }); }; - + window.Untar = Untar; - -})(); \ No newline at end of file + +})(); diff --git a/static/partials/about.html b/static/partials/about.html index 7b068e45c..a56ee968a 100644 --- a/static/partials/about.html +++ b/static/partials/about.html @@ -55,7 +55,7 @@

    Jacob Moshenko
    - Co-Founder

    + Co-Founder
    diff --git a/static/partials/confirm-invite.html b/static/partials/confirm-invite.html index e3d883e53..807ca4540 100644 --- a/static/partials/confirm-invite.html +++ b/static/partials/confirm-invite.html @@ -4,7 +4,7 @@
    -
    +
    {{ invalid }} diff --git a/static/partials/contact.html b/static/partials/contact.html index df988f9d8..8a50b0412 100644 --- a/static/partials/contact.html +++ b/static/partials/contact.html @@ -22,4 +22,4 @@

    {{ getTitle(info) }}

    -
    \ No newline at end of file +
    diff --git a/static/partials/guide.html b/static/partials/guide.html index e671b6302..ae429e3b8 100644 --- a/static/partials/guide.html +++ b/static/partials/guide.html @@ -1,5 +1,5 @@

    Redirecting...

    - If this page does not redirect, please click here. + If this page does not redirect, please click here.
    diff --git a/static/partials/image-view.html b/static/partials/image-view.html index 0ad7ce748..da2bd8140 100644 --- a/static/partials/image-view.html +++ b/static/partials/image-view.html @@ -2,7 +2,7 @@
    -

    +

    @@ -49,14 +49,14 @@
    -
    +
    Showing {{(combinedChanges | filter:search | limitTo:50).length}} of {{(combinedChanges | filter:search).length}} results
    -
    +
    -
    +
    @@ -77,6 +77,6 @@
    -
    +
    diff --git a/static/partials/landing-normal.html b/static/partials/landing-normal.html index 6b9b6e42e..6ad95f113 100644 --- a/static/partials/landing-normal.html +++ b/static/partials/landing-normal.html @@ -9,10 +9,10 @@ Quay.io is now part of CoreOS! Read the blog post.
    - +
    -
    +
    @@ -174,7 +174,7 @@
    - Quay.io has become an essential part of our infrastructure as we move to Docker-based deploys. + Quay.io has become an essential part of our infrastructure as we move to Docker-based deploys. The support and service that the Quay.io team provides is phenomenal. We couldn't do it without them!
    @@ -203,7 +203,7 @@ message-date="April 1, 2014"> Pushing Dockerfile changes to Github and having @quayio build the @docker image/container for you is extremely awesome. -
    +
  • @@ -246,7 +246,7 @@ - +

  • @@ -269,7 +269,7 @@
    - +
    diff --git a/static/partials/landing.html b/static/partials/landing.html index a03190263..719d1a9cb 100644 --- a/static/partials/landing.html +++ b/static/partials/landing.html @@ -1,3 +1,3 @@
    -
    \ No newline at end of file +
    diff --git a/static/partials/manage-application.html b/static/partials/manage-application.html index aaae745b8..0c6f11427 100644 --- a/static/partials/manage-application.html +++ b/static/partials/manage-application.html @@ -10,7 +10,7 @@

    {{ application.name || '(Untitled)' }}

    - + {{ organization.name }}

    @@ -22,13 +22,13 @@ Warning: There is no OAuth Redirect setup for this application. Please enter it in the Settings tab.
    - +
    diff --git a/static/partials/new-organization.html b/static/partials/new-organization.html index 0de90293f..0450e1ab5 100644 --- a/static/partials/new-organization.html +++ b/static/partials/new-organization.html @@ -3,7 +3,7 @@
    - +

    Create Organization

    @@ -67,9 +67,9 @@
    Choose your organization's plan -
    +
    - +