diff --git a/_config.yml b/_config.yml index 09559bcba..0109e3b94 100644 --- a/_config.yml +++ b/_config.yml @@ -73,6 +73,12 @@ defaults: type: "posts" values: layout: "news" + - + scope: + path: "javascripts" + type: "pages" + values: + layout: "none" kramdown: toc_levels: "2,3" diff --git a/_data/platform-attributes.json b/_data/platform-attributes.json new file mode 100644 index 000000000..26dbab6e4 --- /dev/null +++ b/_data/platform-attributes.json @@ -0,0 +1,53 @@ +{ + "client-platform": { + "values": { + "android": { + "title": "Android", + "uaPlatform": "Android" + }, + "osx": { + "title": "OS X", + "uaPlatform": "Mac OS" + }, + "ubuntu": { + "title": "Ubuntu", + "uaPlatform": "Ubuntu" + }, + "windows": { + "title": "Windows", + "uaPlatform": "Windows" + } + }, + "autodetectFunction": "autodetectClientPlatform" + }, + "client-windows-version": { + "values": { + "win7": { + "title": "Windows 7", + "uaVersion": "7" + }, + "win8": { + "title": "Windows 8", + "uaVersion": "8" + }, + "win10": { + "title": "Windows 10", + "uaVersion": "10" + } + }, + "autodetectFunction": "autodetectClientWindowsVersion" + }, + "ev3dev-hardware-platform": { + "values": { + "ev3": { + "title": "EV3 Brick" + }, + "brickpi": { + "title": "BrickPi" + }, + "pistorms": { + "title": "PiStorms" + } + } + } +} \ No newline at end of file diff --git a/_includes/head.html b/_includes/head.html index ed50fedb0..d36aaf907 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -25,10 +25,10 @@ - - - - + + + + @@ -36,6 +36,7 @@ + diff --git a/_layouts/none.html b/_layouts/none.html new file mode 100644 index 000000000..e0f6bfe54 --- /dev/null +++ b/_layouts/none.html @@ -0,0 +1,5 @@ +--- + +--- + +{{ content }} \ No newline at end of file diff --git a/docs/tutorials/platform-test-page.md b/docs/tutorials/platform-test-page.md new file mode 100644 index 000000000..84844483a --- /dev/null +++ b/docs/tutorials/platform-test-page.md @@ -0,0 +1,43 @@ +--- +title: Platform test page +subject: Website +--- + +This is a test page. + +* {: data-platform-attribute-value-id="android"} + 1. This is the first step for Android. + + 2. This is the second step for Android. + +* {: data-platform-attribute-value-id="osx"} + + 1. Another step! This one's for Mac. + + 2. ...And another for Mac. + +* {: data-platform-attribute-value-id="ubuntu"} + + 1. Even more steps! Now featuring 100% more Ubuntu. + + 2. Steps continued. + +* {: data-platform-attribute-value-id="windows"} + * {: data-platform-attribute-value-id="win7"} This is for Windows 7! + + * {: data-platform-attribute-value-id="win8"} This is for Windows 8! + + * {: data-platform-attribute-value-id="win10"} This is for Windows 10! + {: data-platform-select-list-attribute="client-windows-version"} +{: data-platform-select-list-attribute="client-platform" } + +* {: data-platform-attribute-value-id="ev3"} + On the EV3, do a thing in this specific way. + +* {: data-platform-attribute-value-id="brickpi"} + The BrickPi is a little different. You actually need to do this other thing. + +* {: data-platform-attribute-value-id="pistorms"} + The PiStorms doesn't support this portion of the functionality. + You need to take this into consideration. +{: data-platform-select-list-attribute="ev3dev-hardware-platform" } \ No newline at end of file diff --git a/javascripts/jquery.getUrlParam.js b/javascripts/libs/jquery.getUrlParam.js similarity index 100% rename from javascripts/jquery.getUrlParam.js rename to javascripts/libs/jquery.getUrlParam.js diff --git a/javascripts/jquery.loadTemplate-1.4.4.min.js b/javascripts/libs/jquery.loadTemplate-1.4.4.min.js similarity index 100% rename from javascripts/jquery.loadTemplate-1.4.4.min.js rename to javascripts/libs/jquery.loadTemplate-1.4.4.min.js diff --git a/javascripts/respond.js b/javascripts/libs/respond.js similarity index 100% rename from javascripts/respond.js rename to javascripts/libs/respond.js diff --git a/javascripts/libs/ua-parser.min.js b/javascripts/libs/ua-parser.min.js new file mode 100644 index 000000000..faf7e19b7 --- /dev/null +++ b/javascripts/libs/ua-parser.min.js @@ -0,0 +1,8 @@ +/** + * UAParser.js v0.7.10 + * Lightweight JavaScript-based User-Agent string parser + * https://github.com/faisalman/ua-parser-js + * + * Copyright © 2012-2015 Faisal Salman + * Dual licensed under GPLv2 & MIT + */(function(e,t){"use strict";var n="0.7.10",r="",i="?",s="function",o="undefined",u="object",a="string",f="major",l="model",c="name",h="type",p="vendor",d="version",v="architecture",m="console",g="mobile",y="tablet",b="smarttv",w="wearable",E="embedded",S={extend:function(e,t){for(var n in t)"browser cpu device engine os".indexOf(n)!==-1&&t[n].length%2===0&&(e[n]=t[n].concat(e[n]));return e},has:function(e,t){return typeof e=="string"?t.toLowerCase().indexOf(e.toLowerCase())!==-1:!1},lowerize:function(e){return e.toLowerCase()},major:function(e){return typeof e===a?e.split(".")[0]:t}},x={rgx:function(){var e,n=0,r,i,a,f,l,c,h=arguments;while(n0?f.length==2?typeof f[1]==s?e[f[0]]=f[1].call(this,c):e[f[0]]=f[1]:f.length==3?typeof f[1]===s&&(!f[1].exec||!f[1].test)?e[f[0]]=c?f[1].call(this,c,f[2]):t:e[f[0]]=c?c.replace(f[1],f[2]):t:f.length==4&&(e[f[0]]=c?f[3].call(this,c.replace(f[1],f[2])):t):e[f]=c?c:t}n+=2}return e},str:function(e,n){for(var r in n)if(typeof n[r]===u&&n[r].length>0){for(var s=0;s') + .data('target-platform-attribute-name', platformAttributeId); + $platNav.insertAfter($('.page-header')); + } + else if ($platNav.children().filter(getFilterByData('platform-attribute-value-id', newAttributeValueId)).length > 0) { + // If there are any pills that have already been created for this value, we are done + return; + } + + var $pillItem = $('
  • ') + .data('platform-attribute-value-id', newAttributeValueId) + .addClass('platform-select-link'); + + + var platformAttributeMetadata = platformAttributes[platformAttributeId]; + var newAttributeValueMetadata = platformAttributeMetadata.values[newAttributeValueId]; + $('').text(newAttributeValueMetadata.title).appendTo($pillItem); + + $pillItem.click(function () { + switchSelectedPlatformAttribute(platformAttributeId, newAttributeValueId); + }) + + $platNav.append($pillItem); +} + +function addNestedPlatformNavItem(platformAttributeId, newAttributeValueId, parentAttributeId, parentAttributeValueId) { + addPlatformNavItem(parentAttributeId, parentAttributeValueId); + + // TODO: Use dividers to handle multiple nested attributes + // ...or at least blow up loudly + + var $parentPillLi = $('.platform-attribute-select-group') + .filter(getFilterByData('target-platform-attribute-name', parentAttributeId)) + .children() + .filter(getFilterByData('platform-attribute-value-id', parentAttributeValueId)); + + var $selectGroupDropdown = $parentPillLi.children('ul.platform-nested-select-group'); + + if ($selectGroupDropdown.length <= 0) { + $parentPillLi.addClass('dropdown'); + + var $parentLinkAnchor = $parentPillLi.children('a') + .addClass('dropdown-toggle') + .attr('data-toggle', 'dropdown') + .attr('role', 'button') + .append(''); + + $selectGroupDropdown = $('