summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Schatz <jacobschatz@Jacobs-MBP.fios-router.home>2016-04-01 09:17:12 -0400
committerJacob Schatz <jacobschatz@Jacobs-MBP.fios-router.home>2016-04-01 09:17:12 -0400
commit5e1432b90a4105758fa523be479927c4058b39a5 (patch)
tree4f8dfaafc586874b14ba7b505caee7dff3a0fa46
parentde1c81645c6aa29acc1aceafa123a861f822ee49 (diff)
downloadgitlab-ce-5e1432b90a4105758fa523be479927c4058b39a5.tar.gz
Adds Konami Code to Gitlabapril
-rw-r--r--app/assets/javascripts/application.js.coffee30
1 files changed, 30 insertions, 0 deletions
diff --git a/app/assets/javascripts/application.js.coffee b/app/assets/javascripts/application.js.coffee
index f01c67e9474..6e58ecb208c 100644
--- a/app/assets/javascripts/application.js.coffee
+++ b/app/assets/javascripts/application.js.coffee
@@ -153,6 +153,36 @@ $ ->
container: 'body'
)
+ # Konami Code
+ codeSoFar = ''
+ cleared = false
+ $headerLogo = $('.header-logo')
+ $headerLogo.empty()
+ $headerLogo.css('margin-left','5px').css('margin-top','5px')
+ dirs = ['up','down','left','right']
+ konTempl = '<a href="#" class="btn btn-xs kon-code" style="width:20px;height:20px;font-size:10px;padding:1px;margin:2px;"><i data-dir="{{dir}}" class="fa fa-arrow-{{dir}}" style="color:black"></i></a>'
+ $headerLogo = $('.header-logo')
+ dirs.forEach((dir) -> $headerLogo.append(konTempl.replace(/{{dir}}/g,dir)))
+
+ $('.kon-code').on('click', (e) ->
+ e.preventDefault()
+ cleared = true
+ dir = $(this).find('i').attr('data-dir')
+ codeSoFar += dir
+ match = 'upupdowndownleftrightleftright'
+ if codeSoFar is match
+ codeSoFar = ''
+ $('body').css('-webkit-transform:','rotate(180deg)').css('transform','rotate(180deg)')
+ )
+
+ setInterval(->
+ if not cleared
+ codeSoFar = ''
+ cleared = false
+ , 2000)
+
+ # End Konami Code
+
$('.page-with-sidebar').tooltip(
selector: '.sidebar-collapsed .nav-sidebar a, .sidebar-collapsed a.sidebar-user'
placement: 'right'