From 9cb593f5bce705b6cf54a62f86409d04eab697ed Mon Sep 17 00:00:00 2001 From: jlukic Date: Thu, 11 Jun 2015 16:07:35 -0400 Subject: [PATCH] Style updates --- server/documents/behaviors/api.html.eco | 12 +- .../documents/behaviors/visibility.html.eco | 17 +- .../documents/collections/breadcrumb.html.eco | 6 +- server/documents/introduction/new.html.eco | 173 +++++++++++++++--- server/documents/modules/sticky.html.eco | 67 ++++++- server/documents/views/card.html.eco | 27 ++- server/files/javascript/intro.js | 61 ++++++ server/files/javascript/sticky.js | 6 +- server/files/stylesheets/docs.css | 62 ++++++- 9 files changed, 374 insertions(+), 57 deletions(-) diff --git a/server/documents/behaviors/api.html.eco b/server/documents/behaviors/api.html.eco index 86dbaee81..1720075c4 100755 --- a/server/documents/behaviors/api.html.eco +++ b/server/documents/behaviors/api.html.eco @@ -930,6 +930,12 @@ type : 'UI Behavior' Variables to use for replacement + + encodeUrlData + true + Where url data should be encoded with encodeURIComponent before being added to URL. + + mockResponse false @@ -997,7 +1003,7 @@ type : 'UI Behavior' onSuccess(response, element) state context - Callback on response object that passed successTest + Callback after successful response, JSON response must pass successTest onComplete(response, element) @@ -1007,7 +1013,7 @@ type : 'UI Behavior' onFailure(response, element) state context - Callback on response object that fails successTest + Callback on failed response, or JSON response that fails successTest onError(errorMessage, element) @@ -1017,7 +1023,7 @@ type : 'UI Behavior' onAbort(errorMessage, element) state context - Callback on abort caused by user clicking a link or manually cancelling request + Callback on abort caused by user clicking a link or manually cancelling request. diff --git a/server/documents/behaviors/visibility.html.eco b/server/documents/behaviors/visibility.html.eco index 20f798b1b..9f450c592 100644 --- a/server/documents/behaviors/visibility.html.eco +++ b/server/documents/behaviors/visibility.html.eco @@ -649,11 +649,7 @@ type : 'UI Behavior' transition: all 0.5s ease; background: transparent; } - .visibility.example .fixed.overlay + .placeholder { - display: none; - } - - /* fixed */ + /* change style */ .visibility.example .fixed.overlay { position: fixed; padding: 1em; @@ -670,28 +666,17 @@ type : 'UI Behavior' Option 3 -
-
-
-
-
-
-
-
-
-
-
diff --git a/server/documents/collections/breadcrumb.html.eco b/server/documents/collections/breadcrumb.html.eco index 815c27f46..38f42b22e 100755 --- a/server/documents/collections/breadcrumb.html.eco +++ b/server/documents/collections/breadcrumb.html.eco @@ -36,11 +36,11 @@ themes : ['Default']
- diff --git a/server/documents/introduction/new.html.eco b/server/documents/introduction/new.html.eco index 31e708ae7..8054ecc0f 100644 --- a/server/documents/introduction/new.html.eco +++ b/server/documents/introduction/new.html.eco @@ -59,8 +59,8 @@ type : 'Introduction'
-

Evenly Divided

-

The new equal width grid variation adjusts column widths automatically to split their container evenly without having to specify a column count.

+

Automatic Columns

+

The new equal width grid variation adjusts column widths automatically to split their container evenly without having to manually specify a column count.

@@ -119,7 +119,8 @@ type : 'Introduction'
+
+
+
+
14h
+ Elliot +
+
+ +
+
+ + + 17 likes + + + 3 comments +
+
+
+ + +
+
+
+

Cards

diff --git a/server/files/javascript/intro.js b/server/files/javascript/intro.js index d5e8caf93..ce7dbcbd4 100644 --- a/server/files/javascript/intro.js +++ b/server/files/javascript/intro.js @@ -57,6 +57,67 @@ semantic.intro.ready = function() { } }) ; + $('.external.example .ui.search') + .search({ + type : 'category', + minCharacters : 3, + apiSettings : { + onFailure: function() { + $(this).search('display message', 'Hold off a few minutes
GitHub rate limit exceeded for anonymous search.'); + }, + onResponse: function(githubResponse) { + var + response = { + results : {} + } + ; + if(githubResponse.items.length === 0) { + // no results + return response; + } + $.each(githubResponse.items, function(index, item) { + var + language = item.language || 'Unknown', + maxLength = 200, + description + ; + if(index >= 8) { + // only show 8 results + return false; + } + // Create new language category + if(response.results[language] === undefined) { + response.results[language] = { + name : language, + results : [] + }; + } + description = (item.description < maxLength) + ? item.description + : item.description.substr(0, maxLength) + '...' + ; + description = $.fn.search.settings.templates.escape(description); + // Add result to category + response.results[language].results.push({ + title : item.name, + description : description, + url : item.html_url + }); + }); + return response; + }, + url: '//api.github.com/search/repositories?q={query}' + } + }) + ; + + // visiblity + $('.visibility.example .overlay') + .visibility({ + type : 'fixed', + offset : 15 // give some space from top of screen + }) + ; // menu diff --git a/server/files/javascript/sticky.js b/server/files/javascript/sticky.js index bc23790d1..8108c1b44 100644 --- a/server/files/javascript/sticky.js +++ b/server/files/javascript/sticky.js @@ -24,7 +24,7 @@ semantic.sticky.ready = function() { $sticky .sticky({ context: $context, - offset: 50, + offset: 15, pushing: true }) ; @@ -41,7 +41,7 @@ semantic.sticky.ready = function() { $inlineSticky .sticky({ context: $context, - offset: 39 + offset: 15 }) ; } @@ -57,7 +57,7 @@ semantic.sticky.ready = function() { $sticky .sticky({ context: $context, - offset: 75 + offset: 15 }) ; }) diff --git a/server/files/stylesheets/docs.css b/server/files/stylesheets/docs.css index 64a2c3afc..fcab630cc 100755 --- a/server/files/stylesheets/docs.css +++ b/server/files/stylesheets/docs.css @@ -68,9 +68,10 @@ code { border-radius: 3px; display: inline-block; font-family: "Monaco","Menlo","Ubuntu Mono","Consolas","source-code-pro",monospace; - font-size: 0.85714em; + font-size: 0.875em; font-weight: bold; - padding: 0px 5px; + margin-top: -3px; + padding: 3px 6px; vertical-align: baseline; } pre code { @@ -430,6 +431,63 @@ pre code { color: rgba(0, 0, 0, 0.8); } +/* Link Styles */ +#example .main.container > p a, +#example .main.container > .tab > p a, +#example .main.container .example > .ignored a, +#example .main.container .example > p a { + display: inline-block; + position: relative; + overflow: hidden; + vertical-align: top; + z-index: 2; + -webkit-transition: color 0.2s; + transition: color 0.2s; +} +#example .main.container > p a > code, +#example .main.container > .tab > p a > code, +#example .main.container .example > .ignored a > code, +#example .main.container .example > p a > code { + background-color: rgba(0, 50, 100, 0.08); +} +#example .main.container > p a:before, +#example .main.container > .tab > p a:before, +#example .main.container .example > .ignored a:before, +#example .main.container .example > p a:before { + position: absolute; + top: 0; + left: 0; + z-index: -1; + width: 100%; + height: 100%; + background-color: #4183C4; + content: ''; + -webkit-transition: all 0.2s; + transition: all 0.2s; + -webkit-transform: translateY(95%) scaleX(0); + transform: translateY(95%) scaleX(0); +} + +/* Hover */ +#example .main.container > p a:hover > code, +#example .main.container > .tab > p a:hover > code, +#example .main.container .example > .ignored a:hover > code, +#example .main.container .example > p a:hover > code { + background-color: rgba(0, 50, 100, 0.12); +} +#example .main.container > p a:hover:before, +#example .main.container > p a:focus:before, +#example .main.container > .tab > p a:hover:before, +#example .main.container > .tab > p a:focus:before, +#example .main.container .example > .ignored a:hover:before, +#example .main.container .example > .ignored a:focus:before, +#example .main.container .example > p a:hover:before, +#example .main.container .example > p a:focus:before { + background-color: #2C76BF; + -webkit-transform: translateY(95%) scaleX(1); + transform: translateY(95%) scaleX(1); +} + #example .ui.ad { max-width: 100%; }