diff --git a/.gitignore b/.gitignore index 4b6a7b1d4..547ad2481 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,7 @@ _testmain.go *.test bin/ .vagrant/ + + +website/npm-debug.log + diff --git a/website/source/Gruntfile.js b/website/source/Gruntfile.js index dafb62430..41f6d6660 100644 --- a/website/source/Gruntfile.js +++ b/website/source/Gruntfile.js @@ -3,17 +3,24 @@ module.exports = function(grunt) { // Configuration goes here grunt.initConfig({ + less: { + development:{ + files: { + "stylesheets/main.css": "stylesheets/main.less" + } + } + }, + concat: { options: { separator: ';' }, - site: { - src: [ + src: [ 'javascripts/app/app.js', 'javascripts/app/util.js', - 'javascripts/app/home.js', - 'javascripts/app/nodes.js' + 'javascripts/app/homepage.js' + ], dest: 'javascripts/app/deploy/site.js' @@ -23,12 +30,16 @@ module.exports = function(grunt) { uglify: { app: { files: { - 'javascripts/app/deploy/site.min.js': ['javascripts/app/deploy/site.js'] + 'javascripts/app/deploy/site.min.js': ['javascripts/app/deploy/site.js'] } } }, watch: { + less: { + files: 'stylesheets/*.less', + tasks: ['less'] + }, js: { files: 'javascripts/app/*.js', tasks: ['concat', 'uglify'] @@ -37,8 +48,8 @@ module.exports = function(grunt) { }); - // Load plugins here + grunt.loadNpmTasks('grunt-contrib-less'); grunt.loadNpmTasks('grunt-contrib-clean'); grunt.loadNpmTasks('grunt-contrib-concat'); grunt.loadNpmTasks('grunt-contrib-connect'); @@ -51,6 +62,8 @@ module.exports = function(grunt) { grunt.registerTask('dist-js', ['concat', 'uglify']); // Full distribution task. - grunt.registerTask('dist', ['dist-js']); + grunt.registerTask('dist', ['dist-js']); -}; \ No newline at end of file + grunt.registerTask('default', ['watch']); + +}; diff --git a/website/source/images/consul-footer-logo.png b/website/source/images/consul-footer-logo.png new file mode 100644 index 000000000..9076ea233 --- /dev/null +++ b/website/source/images/consul-footer-logo.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:925cbab49fdf26b39935659e44bc57d81ae987157dfb2dbb72190dc6c663502e +size 23896 diff --git a/website/source/images/consul-footer-logo@2x.png b/website/source/images/consul-footer-logo@2x.png new file mode 100644 index 000000000..2475ad0a6 --- /dev/null +++ b/website/source/images/consul-footer-logo@2x.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3afe2aca6bdf43a1c318f1e4ccacc4feb980dc4fb752880e5da32122f3d67483 +size 63691 diff --git a/website/source/images/consul-header-logo.png b/website/source/images/consul-header-logo.png new file mode 100644 index 000000000..bb8ee96cd --- /dev/null +++ b/website/source/images/consul-header-logo.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9e9531ca6a6088b417bdb58e8d1cc5c807a37f816bcffb37c058092a4d5c29a6 +size 3447 diff --git a/website/source/images/consul-header-logo@2x.png b/website/source/images/consul-header-logo@2x.png new file mode 100644 index 000000000..01184d46a --- /dev/null +++ b/website/source/images/consul-header-logo@2x.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:44c70d7c197b4b921a67bcf095939453ffc03e5bacca54905eb1f04cbceaf03c +size 7224 diff --git a/website/source/images/consul-hero-logo.png b/website/source/images/consul-hero-logo.png new file mode 100644 index 000000000..a89cd90bd --- /dev/null +++ b/website/source/images/consul-hero-logo.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1126f257fe88e3c7a302ae1f99f10dcb7c4139e14e950f61767b74af3ea12194 +size 16172 diff --git a/website/source/images/consul-hero-logo@2x.png b/website/source/images/consul-hero-logo@2x.png new file mode 100644 index 000000000..e2b1aab72 --- /dev/null +++ b/website/source/images/consul-hero-logo@2x.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:60be268b70ce9f0143edddaa1af078e8cd9a76880bd4727ecf83c9a8277a8a07 +size 45941 diff --git a/website/source/images/custom-event-icon.png b/website/source/images/custom-event-icon.png deleted file mode 100644 index eba7431d7..000000000 --- a/website/source/images/custom-event-icon.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9bf47617355628371d4aedf7c33a525ddd34332c6396ea66709ab5f0f71768cc -size 7352 diff --git a/website/source/images/custom-event-icon@2x.png b/website/source/images/custom-event-icon@2x.png deleted file mode 100644 index a606796bc..000000000 --- a/website/source/images/custom-event-icon@2x.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:531e6023a2620fb3c7c8b55950c8751e751eec14d2dd9812f9d54159dd5b6547 -size 15266 diff --git a/website/source/images/failure-detect-icon.png b/website/source/images/failure-detect-icon.png deleted file mode 100644 index 0f26388c0..000000000 --- a/website/source/images/failure-detect-icon.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:1607587d54335f19bd6d009bfa204ecc1f9c67cda15c38b5f72f8eac89f64137 -size 13105 diff --git a/website/source/images/failure-detect-icon@2x.png b/website/source/images/failure-detect-icon@2x.png deleted file mode 100644 index 3e01e75d9..000000000 --- a/website/source/images/failure-detect-icon@2x.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9f90077e3772b7e81df06d9163787fc9645961a7ed6711422c27b8375eade272 -size 28602 diff --git a/website/source/images/feature-config.png b/website/source/images/feature-config.png new file mode 100644 index 000000000..8e1a1e86e --- /dev/null +++ b/website/source/images/feature-config.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9a8a707178ee66e8c653dde180699854343f481e6c3933a3ad23ed5833fce24d +size 4842 diff --git a/website/source/images/feature-config@2x.png b/website/source/images/feature-config@2x.png new file mode 100644 index 000000000..c8940eb9d --- /dev/null +++ b/website/source/images/feature-config@2x.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:aa1ec6dcc12afc0f565ab965dac307b37cfc00e29d26bedf657fa52ae98dc7c0 +size 8970 diff --git a/website/source/images/feature-discovery.png b/website/source/images/feature-discovery.png new file mode 100644 index 000000000..d1bd2e7dd --- /dev/null +++ b/website/source/images/feature-discovery.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e1f04e5d9476356204f854cd6d47fe46392d1b139a7deae34c63d1fbe51a0b5e +size 16346 diff --git a/website/source/images/feature-discovery@2x.png b/website/source/images/feature-discovery@2x.png new file mode 100644 index 000000000..d7db22b69 --- /dev/null +++ b/website/source/images/feature-discovery@2x.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c6eeb51ef1b15bca257001dbbcd34e135e2dff72b42ab6fa55674812857d22f2 +size 35898 diff --git a/website/source/images/feature-health.png b/website/source/images/feature-health.png new file mode 100644 index 000000000..99d24049b --- /dev/null +++ b/website/source/images/feature-health.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:631a43acd4a810d17ea5328eaca67305925cac13c404aa6a64db3b63d5efde73 +size 8370 diff --git a/website/source/images/feature-health@2x.png b/website/source/images/feature-health@2x.png new file mode 100644 index 000000000..c019716ee --- /dev/null +++ b/website/source/images/feature-health@2x.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d3f2213457f64b5dfa731efaa254bfd5de81aeb48dcb70769ca6b999817bc9ef +size 18166 diff --git a/website/source/images/feature-multi.png b/website/source/images/feature-multi.png new file mode 100644 index 000000000..800b8dac9 --- /dev/null +++ b/website/source/images/feature-multi.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a24572d10d7e37f7c78055b3df1e195d12a205a74251e575fb7f4ac69cc5ad82 +size 16130 diff --git a/website/source/images/feature-multi@2x.png b/website/source/images/feature-multi@2x.png new file mode 100644 index 000000000..aab96833f --- /dev/null +++ b/website/source/images/feature-multi@2x.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1a3231807cbd18855fc569f7e83c8c5c6c6035cb83dd234c28d751414c44859f +size 32654 diff --git a/website/source/images/footer-hashicorp-logo.png b/website/source/images/footer-hashicorp-logo.png new file mode 100644 index 000000000..e35c7af44 --- /dev/null +++ b/website/source/images/footer-hashicorp-logo.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9d40ad873a0369460c62a8f54775b8a9d025bc4575f9509ed5cf489e06c94055 +size 2033 diff --git a/website/source/images/footer-hashicorp-logo@2x.png b/website/source/images/footer-hashicorp-logo@2x.png new file mode 100644 index 000000000..939c423ff --- /dev/null +++ b/website/source/images/footer-hashicorp-logo@2x.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:29348ffc14cdec04d32e36c8945dcafedbf6d5a360dcb26481a31dc5771fd289 +size 3292 diff --git a/website/source/images/footer-pattern.jpg b/website/source/images/footer-pattern.jpg deleted file mode 100644 index 98b0778f4..000000000 --- a/website/source/images/footer-pattern.jpg +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7d069632407170be64a8f8fadba42a77f1929cb1b40569b4dedc63377fb91f0b -size 6678 diff --git a/website/source/images/gossip-proto-icon.png b/website/source/images/gossip-proto-icon.png deleted file mode 100644 index 518ef1c2e..000000000 --- a/website/source/images/gossip-proto-icon.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:1f9e977a93115b48ce8f7dcb7265849bc4446e361a78bc92e4c424ebb1de0136 -size 11808 diff --git a/website/source/images/gossip-proto-icon@2x.png b/website/source/images/gossip-proto-icon@2x.png deleted file mode 100644 index 6dde5ea0c..000000000 --- a/website/source/images/gossip-proto-icon@2x.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7720cb681faf8bda6ae65c523fb9f4db663027bb711815d139bc3b1b4fd11df5 -size 26787 diff --git a/website/source/images/hashi-logo-s.png b/website/source/images/hashi-logo-s.png deleted file mode 100644 index 269fd4c93..000000000 --- a/website/source/images/hashi-logo-s.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b87f6715de2b6f6d0b22bfc39385aaec2db62f0ca5c5fd7852771bd516e88269 -size 396 diff --git a/website/source/images/hero-dots-below.png b/website/source/images/hero-dots-below.png new file mode 100644 index 000000000..c2930d446 --- /dev/null +++ b/website/source/images/hero-dots-below.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a90cd024397fcacd81750f4416fdda6535875f152f0d1b28de297db9c57ccf4f +size 83006 diff --git a/website/source/images/hero-dots-below@2x.png b/website/source/images/hero-dots-below@2x.png new file mode 100644 index 000000000..da899cdf1 --- /dev/null +++ b/website/source/images/hero-dots-below@2x.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:67eca3efb68b610e9ae03689408603079752b89c4399c24cbb3c977bf728e47d +size 244588 diff --git a/website/source/images/hero-dots.png b/website/source/images/hero-dots.png new file mode 100644 index 000000000..d5ad4aac5 --- /dev/null +++ b/website/source/images/hero-dots.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2bc8b2c675d6007b82a2cc0668d975ec714871a94b243fc731ae909aeeb6420b +size 139406 diff --git a/website/source/images/hero-dots@2x.png b/website/source/images/hero-dots@2x.png new file mode 100644 index 000000000..5299344f4 --- /dev/null +++ b/website/source/images/hero-dots@2x.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c1978a971dd318cc30d316cdc3430c95fb4b8cfc5486e9ee2641b9b3aa7eea5a +size 416797 diff --git a/website/source/images/icon-download-purple.png b/website/source/images/icon-download-purple.png new file mode 100644 index 000000000..85cdbbd24 --- /dev/null +++ b/website/source/images/icon-download-purple.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cab20727ef136ef82f97086b07d65a526900c2331b7c18782b9f1b5d25482c2a +size 1561 diff --git a/website/source/images/icon-download-purple@2x.png b/website/source/images/icon-download-purple@2x.png new file mode 100644 index 000000000..4f1bd5f5a --- /dev/null +++ b/website/source/images/icon-download-purple@2x.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f357f775dea6e68531f61d0187775192d97bb06fa1058787e5d7affdc92b03fa +size 3334 diff --git a/website/source/images/icon-download.png b/website/source/images/icon-download.png new file mode 100644 index 000000000..9b34ee354 --- /dev/null +++ b/website/source/images/icon-download.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:01b773ad98d075f3d691602c4550c1f5b0d012944685220025e6d98fe8538c79 +size 375 diff --git a/website/source/images/icon-download@2x.png b/website/source/images/icon-download@2x.png new file mode 100644 index 000000000..9fed97057 --- /dev/null +++ b/website/source/images/icon-download@2x.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:651cb5d433120e74e4ba29195fbdc08a73ae041669a7d62f155864c936fb6844 +size 876 diff --git a/website/source/images/icon-github-purple.png b/website/source/images/icon-github-purple.png new file mode 100644 index 000000000..128df7689 --- /dev/null +++ b/website/source/images/icon-github-purple.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c66a194e1c0b87e03ee4a64cd37045c1aaf17581dd6a6adadc7faa5186b03b3d +size 1871 diff --git a/website/source/images/icon-github-purple@2x.png b/website/source/images/icon-github-purple@2x.png new file mode 100644 index 000000000..d53071af5 --- /dev/null +++ b/website/source/images/icon-github-purple@2x.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:015770b8ba18070cab93b1ab5b623f99fc6fc7fa0ceac1022a4b42c8adf79326 +size 3974 diff --git a/website/source/images/icon-github.png b/website/source/images/icon-github.png new file mode 100644 index 000000000..d013c05c2 --- /dev/null +++ b/website/source/images/icon-github.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:038a49ec5f71f81855d3b43c86f569560b453f3f12617f5734b29cf66245ceb4 +size 490 diff --git a/website/source/images/icon-github@2x.png b/website/source/images/icon-github@2x.png new file mode 100644 index 000000000..f6e3fbe6d --- /dev/null +++ b/website/source/images/icon-github@2x.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f89acd97510bd208d45dd5bec4fc4790df533e26d85f5c43f4f5cccf493b4eee +size 1023 diff --git a/website/source/images/logo-circle-logo.png b/website/source/images/logo-circle-logo.png deleted file mode 100644 index 5484a8f80..000000000 --- a/website/source/images/logo-circle-logo.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:2d1d7840341f3adea3c5edf60ab65b88abd453086cdd0784f079715536ed1d3f -size 43759 diff --git a/website/source/images/logo-circle-logo@2x.png b/website/source/images/logo-circle-logo@2x.png deleted file mode 100644 index 35a8b5f44..000000000 --- a/website/source/images/logo-circle-logo@2x.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8c704d77314e057b0192d01dcfd48e7a404b17589c1aa1b6c964d95b127a0d38 -size 83243 diff --git a/website/source/images/logo-type-medium.png b/website/source/images/logo-type-medium.png deleted file mode 100644 index ca8687ae2..000000000 --- a/website/source/images/logo-type-medium.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e329ec5f53fb08ede1378762a35c5eb3ec34af6e4d9d17b961bfdd18a2f01b0a -size 2876 diff --git a/website/source/images/logo-type-medium@2x.png b/website/source/images/logo-type-medium@2x.png deleted file mode 100644 index 0f80b41bb..000000000 --- a/website/source/images/logo-type-medium@2x.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a4921733ac0c771391e75eda6233521395f40fbecd1be0ce16915a55463b5472 -size 4730 diff --git a/website/source/images/logo-type-small.png b/website/source/images/logo-type-small.png deleted file mode 100644 index 431d41fb5..000000000 --- a/website/source/images/logo-type-small.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4bcd283a2e7554448229d62ac44b54541ef8798ca6604d3b01e5ed7acc728bab -size 1533 diff --git a/website/source/images/logo-type-small@2x.png b/website/source/images/logo-type-small@2x.png deleted file mode 100644 index c3f3f0ded..000000000 --- a/website/source/images/logo-type-small@2x.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8633aadade0e8d156cc5dd85a930f593467ba5a6c95543c3a86862fb6e787682 -size 2681 diff --git a/website/source/images/nav-dotpipes.png b/website/source/images/nav-dotpipes.png new file mode 100644 index 000000000..79d33f856 --- /dev/null +++ b/website/source/images/nav-dotpipes.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c1e015bac38aca182ade2a109b9b215beabad45431e680f92b56dc7d789604fb +size 248 diff --git a/website/source/images/nav-dotpipes@2x.png b/website/source/images/nav-dotpipes@2x.png new file mode 100644 index 000000000..b957f1c15 --- /dev/null +++ b/website/source/images/nav-dotpipes@2x.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ca8751e24babf0fc7a220ee0cb7d5f95613e4ef72c9fe10db5eadfc771e227a6 +size 465 diff --git a/website/source/images/node-hero-pattern.jpg b/website/source/images/node-hero-pattern.jpg deleted file mode 100644 index 5806e47f0..000000000 --- a/website/source/images/node-hero-pattern.jpg +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b071f81c8af33a2cf2b5d9083556bbb0bdd08257ab271ef90afbfd69948c75c7 -size 5855 diff --git a/website/source/images/node-hero-pattern@2x.jpg b/website/source/images/node-hero-pattern@2x.jpg deleted file mode 100644 index a09eeb7cb..000000000 --- a/website/source/images/node-hero-pattern@2x.jpg +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e05650a4d09ca20752ad4d3ef57168d15fd85eecc7027254e9051e15e62bf702 -size 13730 diff --git a/website/source/index.html.erb b/website/source/index.html.erb index b521794ba..e25c73553 100644 --- a/website/source/index.html.erb +++ b/website/source/index.html.erb @@ -1,43 +1,71 @@ -
-
- -
-

Consul is a decentralized solution for service discovery and orchestration that is lightweight, highly available, and fault tolerant.

-
- +
+
+
+
+

Create and configure lightweight, reproducible, and portable development environments.

+
+ + +
+
- -
-
- + +
+
+
+
+ +
+
+

Service Discovery

+

Consul makes it simple for services to register themselves, and to discover other service

+
+
-
-

Gossip-based Membership

-

Consul relies on an efficient and lightweight gossip protocol to communicate with nodes. The Serf agents periodically exchange messages with each other in much the same way that a zombie apocalypse would occur: it starts with one zombie but soon infects everyone. In practice, the gossip is very fast and extremely efficient.

+
+
+
+ +
+
+

Failure Detection

+

Pairing service discovery with health checking prevents routing requests to unhealthy hosts, and enables services to easily provide circuit breakers.

+
+
-
-
-

Failure Detection

-

Consul is able to quickly detect failed members and notify the rest of the cluster. This failure detection is built into the heart of the gossip protocol used by Serf. Like humans in a zombie apocalypse, everybody checks their peers for infection and quickly alerts the other living humans. Serf relies on a random probing technique which is proven to efficiently scale to clusters of any size.

+ +
+
+
+
+ +
+
+

Multi Datacenter

+

Consul scales to multiple datacenters out of the box, with no complicated configuration.

+
+
-
- -
-
-
-
- -
-
-

Custom Events

-

In addition to managing membership, Consul can broadcast custom events. These can be used to trigger deploys, restart processes, spread tales of human heroism, and anything else you may want. The event system is flexible and lightweight, making it easy for application developers and sysadmins alike to leverage.

+
+
+
+ +
+
+

Shared Configuration

+

Store hierarchical key/value configuration data for services.

+
+
+
diff --git a/website/source/javascripts/app/app.js b/website/source/javascripts/app/app.js index 75d3896c0..c75c3614e 100644 --- a/website/source/javascripts/app/app.js +++ b/website/source/javascripts/app/app.js @@ -1,25 +1,20 @@ // -// home.js +// app.js // -var Serf = (function() { +var APP = (function() { function initialize (){ - Serf.Util.runIfClassNamePresent('page-home', initHome); + APP.Utils.runIfClassNamePresent('page-home', initHome); } function initHome() { - if(!Serf.Util.isMobile){ - Serf.Nodes.init(); - }else{ - Serf.Home.mobileHero(); - } - + APP.Homepage.init(); } - + //api return { initialize: initialize } -})(); \ No newline at end of file +})(); diff --git a/website/source/javascripts/app/deploy/site.js b/website/source/javascripts/app/deploy/site.js index c5ece5b0c..50f04f090 100644 --- a/website/source/javascripts/app/deploy/site.js +++ b/website/source/javascripts/app/deploy/site.js @@ -1,239 +1,97 @@ // -// home.js +// app.js // -var Serf = (function() { +var APP = (function() { function initialize (){ - Serf.Util.runIfClassNamePresent('page-home', initHome); + APP.Utils.runIfClassNamePresent('page-home', initHome); } function initHome() { - if(!Serf.Util.isMobile){ - Serf.Nodes.init(); - }else{ - Serf.Home.mobileHero(); - } - + APP.Homepage.init(); } - + //api return { initialize: initialize } -})();// +})(); +;// // util.js // -var Serf = Serf || {}; - -(function () { +var APP = APP || {}; +APP.Utils = (function () { + return { //check for mobile user agents - var isMobile = (function(){ - if( navigator.userAgent.match(/Android/i) - || navigator.userAgent.match(/webOS/i) - || navigator.userAgent.match(/iPhone/i) - //|| navigator.userAgent.match(/iPad/i) - || navigator.userAgent.match(/iPod/i) - || navigator.userAgent.match(/BlackBerry/i) - || navigator.userAgent.match(/Windows Phone/i) - ){ - return true; - } - else { - return false; - } - })() + isMobile : (function(){ + if( navigator.userAgent.match(/Android/i) + || navigator.userAgent.match(/webOS/i) + || navigator.userAgent.match(/iPhone/i) + //|| navigator.userAgent.match(/iPad/i) + || navigator.userAgent.match(/iPod/i) + || navigator.userAgent.match(/BlackBerry/i) + || navigator.userAgent.match(/Windows Phone/i) + ){ + return true; + } + else { + return false; + } + })(), - // calls the given function if the given classname is found - function runIfClassNamePresent(selector, initFunction) { - var elms = document.getElementsByClassName(selector); - if (elms.length > 0) { - initFunction(); - } - } - - Serf.Util = {}; - Serf.Util.isMobile = isMobile; - Serf.Util.runIfClassNamePresent = runIfClassNamePresent; - -})();// -// home.js -// -var Serf = Serf || {}; - -(function () { - - // calls the given function if the given classname is found - function mobileHero() { - var jumbo = document.getElementById('jumbotron'); - jumbo.className = jumbo.className + ' mobile-hero'; - } - - Serf.Home = {}; - Serf.Home.mobileHero = mobileHero; - -})();// -// node.js -// animation on the home page -// - -var Serf = Serf || {}; - -(function () { - - var width = 1400, - height = 490, - border = 50, - numberNodes = 128, - linkGroup = 0; - //nodeLinks = []; - - var nodes = []; - for (i=0; i 0) { + initFunction(); + } + } } - var fill = d3.scale.category20(); +}());;//homepage.js - var force = d3.layout.force() - .size([width, height]) - .nodes(nodes) - .linkDistance(60) - .charge(-1) - .gravity(0.0004) - .on("tick", tick); +var APP = APP || {}; - var svg = d3.select("#jumbotron").append("svg") - .attr('id', 'node-canvas') - .attr("width", width) - .attr("height", height) +(function () { + APP.Homepage = (function () { + return { - //set left value after adding to dom - resize(); + ui : null, - svg.append("rect") - .attr("width", width) - .attr("height", height); + init: function () { + var _this = this; - var nodes = force.nodes(), - links = force.links(), - node = svg.selectAll(".node"), - link = svg.selectAll(".link"); + //cache elements + this.ui = { + $doc: $(window), + $hero: $('#jumbotron'), + $pagination: null + } + + this.addEventListeners(); - var cursor = svg.append("circle") - .attr("r", 30) - .attr("transform", "translate(-100,-100)") - .attr("class", "cursor"); + }, + addEventListeners: function(){ + var _this = this; - function createLink(index) { - var node = nodes[index]; - var nodeSelected = svg.select("#id_" + node.index).classed("active linkgroup_"+ linkGroup, true); + if(APP.Utils.isMobile) + return; + + _this.ui.$doc.scroll(function() { + var top = _this.ui.$doc.scrollTop(), + speedAdj = (top*0.8), + speedAdjOffset = speedAdj - top; - var distMap = {}; - var distances = []; - - for (var i=0; i0&&b()}}}();var APP=APP||{};!function(){APP.Homepage=function(){return{ui:null,init:function(){this.ui={$doc:$(window),$hero:$("#jumbotron"),$pagination:null},this.addEventListeners()},addEventListeners:function(){var a=this;APP.Utils.isMobile||a.ui.$doc.scroll(function(){var b=a.ui.$doc.scrollTop(),c=.8*b,d=c-b;a.ui.$hero.css("webkitTransform","translate(0, "+c+"px)"),a.ui.$hero.find(".container").css("webkitTransform","translate(0, "+d+"px)")})}}}()}(jQuery,this); \ No newline at end of file diff --git a/website/source/javascripts/app/home.js b/website/source/javascripts/app/home.js deleted file mode 100644 index 50103e327..000000000 --- a/website/source/javascripts/app/home.js +++ /dev/null @@ -1,17 +0,0 @@ -// -// home.js -// -var Serf = Serf || {}; - -(function () { - - // calls the given function if the given classname is found - function mobileHero() { - var jumbo = document.getElementById('jumbotron'); - jumbo.className = jumbo.className + ' mobile-hero'; - } - - Serf.Home = {}; - Serf.Home.mobileHero = mobileHero; - -})(); \ No newline at end of file diff --git a/website/source/javascripts/app/homepage.js b/website/source/javascripts/app/homepage.js new file mode 100644 index 000000000..ff6683947 --- /dev/null +++ b/website/source/javascripts/app/homepage.js @@ -0,0 +1,45 @@ +//homepage.js + +var APP = APP || {}; + +(function () { + APP.Homepage = (function () { + return { + + ui : null, + + init: function () { + var _this = this; + + //cache elements + this.ui = { + $doc: $(window), + $hero: $('#jumbotron'), + $pagination: null + } + + this.addEventListeners(); + + }, + + addEventListeners: function(){ + var _this = this; + + if(APP.Utils.isMobile) + return; + + _this.ui.$doc.scroll(function() { + var top = _this.ui.$doc.scrollTop(), + speedAdj = (top*0.8), + speedAdjOffset = speedAdj - top; + + _this.ui.$hero.css('webkitTransform', 'translate(0, '+ speedAdj +'px)'); + _this.ui.$hero.find('.container').css('webkitTransform', 'translate(0, '+ speedAdjOffset +'px)'); + //_this.ui.$pagination.css('webkitTransform', 'translate(0, '+ speedAdjOffset +'px)'); + }) + } + } + }()); + +}(jQuery, this)); + diff --git a/website/source/javascripts/app/nodes.js b/website/source/javascripts/app/nodes.js deleted file mode 100644 index 803d9093a..000000000 --- a/website/source/javascripts/app/nodes.js +++ /dev/null @@ -1,163 +0,0 @@ -// -// node.js -// animation on the home page -// - -var Serf = Serf || {}; - -(function () { - - var width = 1400, - height = 490, - border = 50, - numberNodes = 128, - linkGroup = 0; - //nodeLinks = []; - - var nodes = []; - for (i=0; i 0) { - initFunction(); - } - } + runIfClassNamePresent: function(selector, initFunction) { + var elms = document.getElementsByClassName(selector); + if (elms.length > 0) { + initFunction(); + } + } + } - Serf.Util = {}; - Serf.Util.isMobile = isMobile; - Serf.Util.runIfClassNamePresent = runIfClassNamePresent; - -})(); \ No newline at end of file +}()); \ No newline at end of file diff --git a/website/source/javascripts/bootstrap.min.js b/website/source/javascripts/lib/_old/bootstrap.min.js similarity index 100% rename from website/source/javascripts/bootstrap.min.js rename to website/source/javascripts/lib/_old/bootstrap.min.js diff --git a/website/source/javascripts/lib/bootstrap.js b/website/source/javascripts/lib/bootstrap.js new file mode 100644 index 000000000..8ae571b6d --- /dev/null +++ b/website/source/javascripts/lib/bootstrap.js @@ -0,0 +1,1951 @@ +/*! + * Bootstrap v3.1.1 (http://getbootstrap.com) + * Copyright 2011-2014 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + */ + +if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript requires jQuery') } + +/* ======================================================================== + * Bootstrap: transition.js v3.1.1 + * http://getbootstrap.com/javascript/#transitions + * ======================================================================== + * Copyright 2011-2014 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * ======================================================================== */ + + ++function ($) { + 'use strict'; + + // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/) + // ============================================================ + + function transitionEnd() { + var el = document.createElement('bootstrap') + + var transEndEventNames = { + 'WebkitTransition' : 'webkitTransitionEnd', + 'MozTransition' : 'transitionend', + 'OTransition' : 'oTransitionEnd otransitionend', + 'transition' : 'transitionend' + } + + for (var name in transEndEventNames) { + if (el.style[name] !== undefined) { + return { end: transEndEventNames[name] } + } + } + + return false // explicit for ie8 ( ._.) + } + + // http://blog.alexmaccaw.com/css-transitions + $.fn.emulateTransitionEnd = function (duration) { + var called = false, $el = this + $(this).one($.support.transition.end, function () { called = true }) + var callback = function () { if (!called) $($el).trigger($.support.transition.end) } + setTimeout(callback, duration) + return this + } + + $(function () { + $.support.transition = transitionEnd() + }) + +}(jQuery); + +/* ======================================================================== + * Bootstrap: alert.js v3.1.1 + * http://getbootstrap.com/javascript/#alerts + * ======================================================================== + * Copyright 2011-2014 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * ======================================================================== */ + + ++function ($) { + 'use strict'; + + // ALERT CLASS DEFINITION + // ====================== + + var dismiss = '[data-dismiss="alert"]' + var Alert = function (el) { + $(el).on('click', dismiss, this.close) + } + + Alert.prototype.close = function (e) { + var $this = $(this) + var selector = $this.attr('data-target') + + if (!selector) { + selector = $this.attr('href') + selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 + } + + var $parent = $(selector) + + if (e) e.preventDefault() + + if (!$parent.length) { + $parent = $this.hasClass('alert') ? $this : $this.parent() + } + + $parent.trigger(e = $.Event('close.bs.alert')) + + if (e.isDefaultPrevented()) return + + $parent.removeClass('in') + + function removeElement() { + $parent.trigger('closed.bs.alert').remove() + } + + $.support.transition && $parent.hasClass('fade') ? + $parent + .one($.support.transition.end, removeElement) + .emulateTransitionEnd(150) : + removeElement() + } + + + // ALERT PLUGIN DEFINITION + // ======================= + + var old = $.fn.alert + + $.fn.alert = function (option) { + return this.each(function () { + var $this = $(this) + var data = $this.data('bs.alert') + + if (!data) $this.data('bs.alert', (data = new Alert(this))) + if (typeof option == 'string') data[option].call($this) + }) + } + + $.fn.alert.Constructor = Alert + + + // ALERT NO CONFLICT + // ================= + + $.fn.alert.noConflict = function () { + $.fn.alert = old + return this + } + + + // ALERT DATA-API + // ============== + + $(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close) + +}(jQuery); + +/* ======================================================================== + * Bootstrap: button.js v3.1.1 + * http://getbootstrap.com/javascript/#buttons + * ======================================================================== + * Copyright 2011-2014 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * ======================================================================== */ + + ++function ($) { + 'use strict'; + + // BUTTON PUBLIC CLASS DEFINITION + // ============================== + + var Button = function (element, options) { + this.$element = $(element) + this.options = $.extend({}, Button.DEFAULTS, options) + this.isLoading = false + } + + Button.DEFAULTS = { + loadingText: 'loading...' + } + + Button.prototype.setState = function (state) { + var d = 'disabled' + var $el = this.$element + var val = $el.is('input') ? 'val' : 'html' + var data = $el.data() + + state = state + 'Text' + + if (!data.resetText) $el.data('resetText', $el[val]()) + + $el[val](data[state] || this.options[state]) + + // push to event loop to allow forms to submit + setTimeout($.proxy(function () { + if (state == 'loadingText') { + this.isLoading = true + $el.addClass(d).attr(d, d) + } else if (this.isLoading) { + this.isLoading = false + $el.removeClass(d).removeAttr(d) + } + }, this), 0) + } + + Button.prototype.toggle = function () { + var changed = true + var $parent = this.$element.closest('[data-toggle="buttons"]') + + if ($parent.length) { + var $input = this.$element.find('input') + if ($input.prop('type') == 'radio') { + if ($input.prop('checked') && this.$element.hasClass('active')) changed = false + else $parent.find('.active').removeClass('active') + } + if (changed) $input.prop('checked', !this.$element.hasClass('active')).trigger('change') + } + + if (changed) this.$element.toggleClass('active') + } + + + // BUTTON PLUGIN DEFINITION + // ======================== + + var old = $.fn.button + + $.fn.button = function (option) { + return this.each(function () { + var $this = $(this) + var data = $this.data('bs.button') + var options = typeof option == 'object' && option + + if (!data) $this.data('bs.button', (data = new Button(this, options))) + + if (option == 'toggle') data.toggle() + else if (option) data.setState(option) + }) + } + + $.fn.button.Constructor = Button + + + // BUTTON NO CONFLICT + // ================== + + $.fn.button.noConflict = function () { + $.fn.button = old + return this + } + + + // BUTTON DATA-API + // =============== + + $(document).on('click.bs.button.data-api', '[data-toggle^=button]', function (e) { + var $btn = $(e.target) + if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn') + $btn.button('toggle') + e.preventDefault() + }) + +}(jQuery); + +/* ======================================================================== + * Bootstrap: carousel.js v3.1.1 + * http://getbootstrap.com/javascript/#carousel + * ======================================================================== + * Copyright 2011-2014 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * ======================================================================== */ + + ++function ($) { + 'use strict'; + + // CAROUSEL CLASS DEFINITION + // ========================= + + var Carousel = function (element, options) { + this.$element = $(element) + this.$indicators = this.$element.find('.carousel-indicators') + this.options = options + this.paused = + this.sliding = + this.interval = + this.$active = + this.$items = null + + this.options.pause == 'hover' && this.$element + .on('mouseenter', $.proxy(this.pause, this)) + .on('mouseleave', $.proxy(this.cycle, this)) + } + + Carousel.DEFAULTS = { + interval: 5000, + pause: 'hover', + wrap: true + } + + Carousel.prototype.cycle = function (e) { + e || (this.paused = false) + + this.interval && clearInterval(this.interval) + + this.options.interval + && !this.paused + && (this.interval = setInterval($.proxy(this.next, this), this.options.interval)) + + return this + } + + Carousel.prototype.getActiveIndex = function () { + this.$active = this.$element.find('.item.active') + this.$items = this.$active.parent().children() + + return this.$items.index(this.$active) + } + + Carousel.prototype.to = function (pos) { + var that = this + var activeIndex = this.getActiveIndex() + + if (pos > (this.$items.length - 1) || pos < 0) return + + if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) + if (activeIndex == pos) return this.pause().cycle() + + return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos])) + } + + Carousel.prototype.pause = function (e) { + e || (this.paused = true) + + if (this.$element.find('.next, .prev').length && $.support.transition) { + this.$element.trigger($.support.transition.end) + this.cycle(true) + } + + this.interval = clearInterval(this.interval) + + return this + } + + Carousel.prototype.next = function () { + if (this.sliding) return + return this.slide('next') + } + + Carousel.prototype.prev = function () { + if (this.sliding) return + return this.slide('prev') + } + + Carousel.prototype.slide = function (type, next) { + var $active = this.$element.find('.item.active') + var $next = next || $active[type]() + var isCycling = this.interval + var direction = type == 'next' ? 'left' : 'right' + var fallback = type == 'next' ? 'first' : 'last' + var that = this + + if (!$next.length) { + if (!this.options.wrap) return + $next = this.$element.find('.item')[fallback]() + } + + if ($next.hasClass('active')) return this.sliding = false + + var e = $.Event('slide.bs.carousel', { relatedTarget: $next[0], direction: direction }) + this.$element.trigger(e) + if (e.isDefaultPrevented()) return + + this.sliding = true + + isCycling && this.pause() + + if (this.$indicators.length) { + this.$indicators.find('.active').removeClass('active') + this.$element.one('slid.bs.carousel', function () { + var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()]) + $nextIndicator && $nextIndicator.addClass('active') + }) + } + + if ($.support.transition && this.$element.hasClass('slide')) { + $next.addClass(type) + $next[0].offsetWidth // force reflow + $active.addClass(direction) + $next.addClass(direction) + $active + .one($.support.transition.end, function () { + $next.removeClass([type, direction].join(' ')).addClass('active') + $active.removeClass(['active', direction].join(' ')) + that.sliding = false + setTimeout(function () { that.$element.trigger('slid.bs.carousel') }, 0) + }) + .emulateTransitionEnd($active.css('transition-duration').slice(0, -1) * 1000) + } else { + $active.removeClass('active') + $next.addClass('active') + this.sliding = false + this.$element.trigger('slid.bs.carousel') + } + + isCycling && this.cycle() + + return this + } + + + // CAROUSEL PLUGIN DEFINITION + // ========================== + + var old = $.fn.carousel + + $.fn.carousel = function (option) { + return this.each(function () { + var $this = $(this) + var data = $this.data('bs.carousel') + var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option) + var action = typeof option == 'string' ? option : options.slide + + if (!data) $this.data('bs.carousel', (data = new Carousel(this, options))) + if (typeof option == 'number') data.to(option) + else if (action) data[action]() + else if (options.interval) data.pause().cycle() + }) + } + + $.fn.carousel.Constructor = Carousel + + + // CAROUSEL NO CONFLICT + // ==================== + + $.fn.carousel.noConflict = function () { + $.fn.carousel = old + return this + } + + + // CAROUSEL DATA-API + // ================= + + $(document).on('click.bs.carousel.data-api', '[data-slide], [data-slide-to]', function (e) { + var $this = $(this), href + var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7 + var options = $.extend({}, $target.data(), $this.data()) + var slideIndex = $this.attr('data-slide-to') + if (slideIndex) options.interval = false + + $target.carousel(options) + + if (slideIndex = $this.attr('data-slide-to')) { + $target.data('bs.carousel').to(slideIndex) + } + + e.preventDefault() + }) + + $(window).on('load', function () { + $('[data-ride="carousel"]').each(function () { + var $carousel = $(this) + $carousel.carousel($carousel.data()) + }) + }) + +}(jQuery); + +/* ======================================================================== + * Bootstrap: collapse.js v3.1.1 + * http://getbootstrap.com/javascript/#collapse + * ======================================================================== + * Copyright 2011-2014 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * ======================================================================== */ + + ++function ($) { + 'use strict'; + + // COLLAPSE PUBLIC CLASS DEFINITION + // ================================ + + var Collapse = function (element, options) { + this.$element = $(element) + this.options = $.extend({}, Collapse.DEFAULTS, options) + this.transitioning = null + + if (this.options.parent) this.$parent = $(this.options.parent) + if (this.options.toggle) this.toggle() + } + + Collapse.DEFAULTS = { + toggle: true + } + + Collapse.prototype.dimension = function () { + var hasWidth = this.$element.hasClass('width') + return hasWidth ? 'width' : 'height' + } + + Collapse.prototype.show = function () { + if (this.transitioning || this.$element.hasClass('in')) return + + var startEvent = $.Event('show.bs.collapse') + this.$element.trigger(startEvent) + if (startEvent.isDefaultPrevented()) return + + var actives = this.$parent && this.$parent.find('> .panel > .in') + + if (actives && actives.length) { + var hasData = actives.data('bs.collapse') + if (hasData && hasData.transitioning) return + actives.collapse('hide') + hasData || actives.data('bs.collapse', null) + } + + var dimension = this.dimension() + + this.$element + .removeClass('collapse') + .addClass('collapsing') + [dimension](0) + + this.transitioning = 1 + + var complete = function () { + this.$element + .removeClass('collapsing') + .addClass('collapse in') + [dimension]('auto') + this.transitioning = 0 + this.$element.trigger('shown.bs.collapse') + } + + if (!$.support.transition) return complete.call(this) + + var scrollSize = $.camelCase(['scroll', dimension].join('-')) + + this.$element + .one($.support.transition.end, $.proxy(complete, this)) + .emulateTransitionEnd(350) + [dimension](this.$element[0][scrollSize]) + } + + Collapse.prototype.hide = function () { + if (this.transitioning || !this.$element.hasClass('in')) return + + var startEvent = $.Event('hide.bs.collapse') + this.$element.trigger(startEvent) + if (startEvent.isDefaultPrevented()) return + + var dimension = this.dimension() + + this.$element + [dimension](this.$element[dimension]()) + [0].offsetHeight + + this.$element + .addClass('collapsing') + .removeClass('collapse') + .removeClass('in') + + this.transitioning = 1 + + var complete = function () { + this.transitioning = 0 + this.$element + .trigger('hidden.bs.collapse') + .removeClass('collapsing') + .addClass('collapse') + } + + if (!$.support.transition) return complete.call(this) + + this.$element + [dimension](0) + .one($.support.transition.end, $.proxy(complete, this)) + .emulateTransitionEnd(350) + } + + Collapse.prototype.toggle = function () { + this[this.$element.hasClass('in') ? 'hide' : 'show']() + } + + + // COLLAPSE PLUGIN DEFINITION + // ========================== + + var old = $.fn.collapse + + $.fn.collapse = function (option) { + return this.each(function () { + var $this = $(this) + var data = $this.data('bs.collapse') + var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option) + + if (!data && options.toggle && option == 'show') option = !option + if (!data) $this.data('bs.collapse', (data = new Collapse(this, options))) + if (typeof option == 'string') data[option]() + }) + } + + $.fn.collapse.Constructor = Collapse + + + // COLLAPSE NO CONFLICT + // ==================== + + $.fn.collapse.noConflict = function () { + $.fn.collapse = old + return this + } + + + // COLLAPSE DATA-API + // ================= + + $(document).on('click.bs.collapse.data-api', '[data-toggle=collapse]', function (e) { + var $this = $(this), href + var target = $this.attr('data-target') + || e.preventDefault() + || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7 + var $target = $(target) + var data = $target.data('bs.collapse') + var option = data ? 'toggle' : $this.data() + var parent = $this.attr('data-parent') + var $parent = parent && $(parent) + + if (!data || !data.transitioning) { + if ($parent) $parent.find('[data-toggle=collapse][data-parent="' + parent + '"]').not($this).addClass('collapsed') + $this[$target.hasClass('in') ? 'addClass' : 'removeClass']('collapsed') + } + + $target.collapse(option) + }) + +}(jQuery); + +/* ======================================================================== + * Bootstrap: dropdown.js v3.1.1 + * http://getbootstrap.com/javascript/#dropdowns + * ======================================================================== + * Copyright 2011-2014 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * ======================================================================== */ + + ++function ($) { + 'use strict'; + + // DROPDOWN CLASS DEFINITION + // ========================= + + var backdrop = '.dropdown-backdrop' + var toggle = '[data-toggle=dropdown]' + var Dropdown = function (element) { + $(element).on('click.bs.dropdown', this.toggle) + } + + Dropdown.prototype.toggle = function (e) { + var $this = $(this) + + if ($this.is('.disabled, :disabled')) return + + var $parent = getParent($this) + var isActive = $parent.hasClass('open') + + clearMenus() + + if (!isActive) { + if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) { + // if mobile we use a backdrop because click events don't delegate + $('
- + + diff --git a/website/source/layouts/_header.erb b/website/source/layouts/_header.erb index 74e7860ce..1e7a5b32a 100644 --- a/website/source/layouts/_header.erb +++ b/website/source/layouts/_header.erb @@ -7,15 +7,20 @@ -<%= current_page.data.page_title ? "#{current_page.data.page_title} - " : "" %>Serf +<%= current_page.data.page_title ? "#{current_page.data.page_title} - " : "" %>Consul <%= stylesheet_link_tag "bootstrap.min" %> <%= stylesheet_link_tag "main" %> - + + + + +