Dropdown Menus Enhancement
+Enhancing functionality of dropdown menus.
+diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3a8b672 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +.idea +.grunt +node_modules +/package-lock.json diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..2fdbccb --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "bootstrap"] + path = bootstrap + url = https://github.com/twbs/bootstrap.git diff --git a/Gruntfile.js b/Gruntfile.js new file mode 100644 index 0000000..3b0b3be --- /dev/null +++ b/Gruntfile.js @@ -0,0 +1,52 @@ +module.exports = function (grunt) { + 'use strict'; + + // Force use of Unix newlines + grunt.util.linefeed = '\n'; + + grunt.initConfig({ + + 'clean': { + 'dist': ['dist'] + }, + + 'copy': { + 'js': { + 'src': 'js/*', + 'dest': 'dist/' + } + }, + + 'less': { + compileCore: { + options: { + }, + files: { + 'dist/css/dropdowns-enhancement.css': 'less/dropdowns-enhancement.less' + } + }, + minify: { + options: { + cleancss: true + }, + files: { + 'dist/css/dropdowns-enhancement.min.css': 'dist/css/dropdowns-enhancement.css' + } + } + }, + + 'gh-pages': { + options: { + base: 'docs', + message: 'Auto-generated gh-pages' + }, + src: '**/*' + } + }); + + // These plugins provide necessary tasks. + require('load-grunt-tasks')(grunt, {scope: 'devDependencies'}); + + grunt.registerTask('dist', ['clean', 'copy', 'less']); + grunt.registerTask('pages', 'gh-pages'); +}; \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..ab79257 --- /dev/null +++ b/README.md @@ -0,0 +1,12 @@ +Bootstrap Dropdown Menus Enhancement v3.1.1 +=============================== + +Enhancing functionality of dropdown menus. +Added the following improvements: + +* Sub-Menus +* Support for radio and checkboxes +* Positioning of menus +* Bullet for menus + +For demo and docs visit [http://behigh.github.io/bootstrap_dropdowns_enhancement/](http://behigh.github.io/bootstrap_dropdowns_enhancement/) diff --git a/bootstrap b/bootstrap new file mode 160000 index 0000000..573ad10 --- /dev/null +++ b/bootstrap @@ -0,0 +1 @@ +Subproject commit 573ad10a9dba52e4a6f059e63b667f4034ad2b39 diff --git a/dist/css/dropdowns-enhancement.css b/dist/css/dropdowns-enhancement.css new file mode 100644 index 0000000..3816a7d --- /dev/null +++ b/dist/css/dropdowns-enhancement.css @@ -0,0 +1,294 @@ +.dropdown-menu > li > label { + display: block; + padding: 3px 20px; + clear: both; + font-weight: normal; + line-height: 1.42857143; + color: #333333; + white-space: nowrap; +} +.dropdown-menu > li > label:hover, +.dropdown-menu > li > label:focus { + text-decoration: none; + color: #262626; + background-color: #f5f5f5; +} +.dropdown-menu > li > input:checked ~ label, +.dropdown-menu > li > input:checked ~ label:hover, +.dropdown-menu > li > input:checked ~ label:focus, +.dropdown-menu > .active > label, +.dropdown-menu > .active > label:hover, +.dropdown-menu > .active > label:focus { + color: #ffffff; + text-decoration: none; + outline: 0; + background-color: #428bca; +} +.dropdown-menu > li > input[disabled] ~ label, +.dropdown-menu > li > input[disabled] ~ label:hover, +.dropdown-menu > li > input[disabled] ~ label:focus, +.dropdown-menu > .disabled > label, +.dropdown-menu > .disabled > label:hover, +.dropdown-menu > .disabled > label:focus { + color: #999999; +} +.dropdown-menu > li > input[disabled] ~ label:hover, +.dropdown-menu > li > input[disabled] ~ label:focus, +.dropdown-menu > .disabled > label:hover, +.dropdown-menu > .disabled > label:focus { + text-decoration: none; + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); + cursor: not-allowed; +} +.dropdown-menu > li > label { + margin-bottom: 0; + cursor: pointer; +} +.dropdown-menu > li > input[type="radio"], +.dropdown-menu > li > input[type="checkbox"] { + display: none; + position: absolute; + top: -9999em; + left: -9999em; +} +.dropdown-menu > li > label:focus, +.dropdown-menu > li > input:focus ~ label { + outline: thin dotted; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; +} +.dropdown-menu.pull-right { + right: 0; + left: auto; +} +.dropdown-menu.pull-top { + bottom: 100%; + top: auto; + margin: 0 0 2px; + -webkit-box-shadow: 0 -6px 12px rgba(0, 0, 0, 0.175); + box-shadow: 0 -6px 12px rgba(0, 0, 0, 0.175); +} +.dropdown-menu.pull-center { + right: 50%; + left: auto; +} +.dropdown-menu.pull-middle { + right: 100%; + margin: 0 2px 0 0; + box-shadow: -5px 0 10px rgba(0, 0, 0, 0.2); + left: auto; +} +.dropdown-menu.pull-middle.pull-right { + right: auto; + left: 100%; + margin: 0 0 0 2px; + box-shadow: 5px 0 10px rgba(0, 0, 0, 0.2); +} +.dropdown-menu.pull-middle.pull-center { + right: 50%; + margin: 0; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); +} +.dropdown-menu.bullet { + margin-top: 8px; +} +.dropdown-menu.bullet:before { + width: 0; + height: 0; + content: ''; + display: inline-block; + position: absolute; + border-color: transparent; + border-style: solid; + -webkit-transform: rotate(360deg); + border-width: 0 7px 7px; + border-bottom-color: #cccccc; + border-bottom-color: rgba(0, 0, 0, 0.15); + top: -7px; + left: 9px; +} +.dropdown-menu.bullet:after { + width: 0; + height: 0; + content: ''; + display: inline-block; + position: absolute; + border-color: transparent; + border-style: solid; + -webkit-transform: rotate(360deg); + border-width: 0 6px 6px; + border-bottom-color: #ffffff; + top: -6px; + left: 10px; +} +.dropdown-menu.bullet.pull-right:before { + left: auto; + right: 9px; +} +.dropdown-menu.bullet.pull-right:after { + left: auto; + right: 10px; +} +.dropdown-menu.bullet.pull-top { + margin-top: 0; + margin-bottom: 8px; +} +.dropdown-menu.bullet.pull-top:before { + top: auto; + bottom: -7px; + border-bottom-width: 0; + border-top-width: 7px; + border-top-color: #cccccc; + border-top-color: rgba(0, 0, 0, 0.15); +} +.dropdown-menu.bullet.pull-top:after { + top: auto; + bottom: -6px; + border-bottom: none; + border-top-width: 6px; + border-top-color: #ffffff; +} +.dropdown-menu.bullet.pull-center:before { + left: auto; + right: 50%; + margin-right: -7px; +} +.dropdown-menu.bullet.pull-center:after { + left: auto; + right: 50%; + margin-right: -6px; +} +.dropdown-menu.bullet.pull-middle { + margin-right: 8px; +} +.dropdown-menu.bullet.pull-middle:before { + top: 50%; + left: 100%; + right: auto; + margin-top: -7px; + border-right-width: 0; + border-bottom-color: transparent; + border-top-width: 7px; + border-left-color: #cccccc; + border-left-color: rgba(0, 0, 0, 0.15); +} +.dropdown-menu.bullet.pull-middle:after { + top: 50%; + left: 100%; + right: auto; + margin-top: -6px; + border-right-width: 0; + border-bottom-color: transparent; + border-top-width: 6px; + border-left-color: #ffffff; +} +.dropdown-menu.bullet.pull-middle.pull-right { + margin-right: 0; + margin-left: 8px; +} +.dropdown-menu.bullet.pull-middle.pull-right:before { + left: -7px; + border-left-width: 0; + border-right-width: 7px; + border-right-color: #cccccc; + border-right-color: rgba(0, 0, 0, 0.15); +} +.dropdown-menu.bullet.pull-middle.pull-right:after { + left: -6px; + border-left-width: 0; + border-right-width: 6px; + border-right-color: #ffffff; +} +.dropdown-menu.bullet.pull-middle.pull-center { + margin-left: 0; + margin-right: 0; +} +.dropdown-menu.bullet.pull-middle.pull-center:before { + border: none; + display: none; +} +.dropdown-menu.bullet.pull-middle.pull-center:after { + border: none; + display: none; +} +.dropdown-submenu { + position: relative; +} +.dropdown-submenu > .dropdown-menu { + top: 0; + left: 100%; + margin-top: -6px; + margin-left: -1px; + border-top-left-radius: 0; +} +.dropdown-submenu > a:before { + display: block; + float: right; + width: 0; + height: 0; + content: ""; + margin-top: 6px; + margin-right: -8px; + border-width: 4px 0 4px 4px; + border-style: solid; + border-left-style: dashed; + border-top-color: transparent; + border-bottom-color: transparent; +} +@media (max-width: 767px) { + .navbar-nav .dropdown-submenu > a:before { + margin-top: 8px; + border-color: inherit; + border-style: solid; + border-width: 4px 4px 0; + border-left-color: transparent; + border-right-color: transparent; + } + .navbar-nav .dropdown-submenu > a { + padding-left: 40px; + } + .navbar-nav > .open > .dropdown-menu > .dropdown-submenu > .dropdown-menu > li > a, + .navbar-nav > .open > .dropdown-menu > .dropdown-submenu > .dropdown-menu > li > label { + padding-left: 35px; + } + .navbar-nav > .open > .dropdown-menu > .dropdown-submenu > .dropdown-menu > li > .dropdown-menu > li > a, + .navbar-nav > .open > .dropdown-menu > .dropdown-submenu > .dropdown-menu > li > .dropdown-menu > li > label { + padding-left: 45px; + } + .navbar-nav > .open > .dropdown-menu > .dropdown-submenu > .dropdown-menu > li > .dropdown-menu > li > .dropdown-menu > li > a, + .navbar-nav > .open > .dropdown-menu > .dropdown-submenu > .dropdown-menu > li > .dropdown-menu > li > .dropdown-menu > li > label { + padding-left: 55px; + } + .navbar-nav > .open > .dropdown-menu > .dropdown-submenu > .dropdown-menu > li > .dropdown-menu > li > .dropdown-menu > li > .dropdown-menu > li > a, + .navbar-nav > .open > .dropdown-menu > .dropdown-submenu > .dropdown-menu > li > .dropdown-menu > li > .dropdown-menu > li > .dropdown-menu > li > label { + padding-left: 65px; + } + .navbar-nav > .open > .dropdown-menu > .dropdown-submenu > .dropdown-menu > li > .dropdown-menu > li > .dropdown-menu > li > .dropdown-menu > li > .dropdown-menu > li > a, + .navbar-nav > .open > .dropdown-menu > .dropdown-submenu > .dropdown-menu > li > .dropdown-menu > li > .dropdown-menu > li > .dropdown-menu > li > .dropdown-menu > li > label { + padding-left: 75px; + } +} +.navbar-default .navbar-nav .open > .dropdown-menu > .dropdown-submenu.open > a, +.navbar-default .navbar-nav .open > .dropdown-menu > .dropdown-submenu.open > a:hover, +.navbar-default .navbar-nav .open > .dropdown-menu > .dropdown-submenu.open > a:focus { + background-color: #e7e7e7; + color: #555555; +} +@media (max-width: 767px) { + .navbar-default .navbar-nav .open > .dropdown-menu > .dropdown-submenu.open > a:before { + border-top-color: #555555; + } +} +.navbar-inverse .navbar-nav .open > .dropdown-menu > .dropdown-submenu.open > a, +.navbar-inverse .navbar-nav .open > .dropdown-menu > .dropdown-submenu.open > a:hover, +.navbar-inverse .navbar-nav .open > .dropdown-menu > .dropdown-submenu.open > a:focus { + background-color: #080808; + color: #ffffff; +} +@media (max-width: 767px) { + .navbar-inverse .navbar-nav .open > .dropdown-menu > .dropdown-submenu.open > a:before { + border-top-color: #ffffff; + } +} diff --git a/dist/css/dropdowns-enhancement.min.css b/dist/css/dropdowns-enhancement.min.css new file mode 100644 index 0000000..8ac4d71 --- /dev/null +++ b/dist/css/dropdowns-enhancement.min.css @@ -0,0 +1 @@ +.dropdown-menu>li>label{display:block;padding:3px 20px;clear:both;font-weight:400;line-height:1.42857143;color:#333;white-space:nowrap}.dropdown-menu>li>label:hover,.dropdown-menu>li>label:focus{text-decoration:none;color:#262626;background-color:#f5f5f5}.dropdown-menu>li>input:checked~label,.dropdown-menu>li>input:checked~label:hover,.dropdown-menu>li>input:checked~label:focus,.dropdown-menu>.active>label,.dropdown-menu>.active>label:hover,.dropdown-menu>.active>label:focus{color:#fff;text-decoration:none;outline:0;background-color:#428bca}.dropdown-menu>li>input[disabled]~label,.dropdown-menu>li>input[disabled]~label:hover,.dropdown-menu>li>input[disabled]~label:focus,.dropdown-menu>.disabled>label,.dropdown-menu>.disabled>label:hover,.dropdown-menu>.disabled>label:focus{color:#999}.dropdown-menu>li>input[disabled]~label:hover,.dropdown-menu>li>input[disabled]~label:focus,.dropdown-menu>.disabled>label:hover,.dropdown-menu>.disabled>label:focus{text-decoration:none;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);cursor:not-allowed}.dropdown-menu>li>label{margin-bottom:0;cursor:pointer}.dropdown-menu>li>input[type=radio],.dropdown-menu>li>input[type=checkbox]{display:none;position:absolute;top:-9999em;left:-9999em}.dropdown-menu>li>label:focus,.dropdown-menu>li>input:focus~label{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu.pull-top{bottom:100%;top:auto;margin:0 0 2px;-webkit-box-shadow:0 -6px 12px rgba(0,0,0,.175);box-shadow:0 -6px 12px rgba(0,0,0,.175)}.dropdown-menu.pull-center{right:50%;left:auto}.dropdown-menu.pull-middle{right:100%;margin:0 2px 0 0;box-shadow:-5px 0 10px rgba(0,0,0,.2);left:auto}.dropdown-menu.pull-middle.pull-right{right:auto;left:100%;margin:0 0 0 2px;box-shadow:5px 0 10px rgba(0,0,0,.2)}.dropdown-menu.pull-middle.pull-center{right:50%;margin:0;box-shadow:0 0 10px rgba(0,0,0,.2)}.dropdown-menu.bullet{margin-top:8px}.dropdown-menu.bullet:before{width:0;height:0;content:'';display:inline-block;position:absolute;border-color:transparent;border-style:solid;-webkit-transform:rotate(360deg);border-width:0 7px 7px;border-bottom-color:#ccc;border-bottom-color:rgba(0,0,0,.15);top:-7px;left:9px}.dropdown-menu.bullet:after{width:0;height:0;content:'';display:inline-block;position:absolute;border-color:transparent;border-style:solid;-webkit-transform:rotate(360deg);border-width:0 6px 6px;border-bottom-color:#fff;top:-6px;left:10px}.dropdown-menu.bullet.pull-right:before{left:auto;right:9px}.dropdown-menu.bullet.pull-right:after{left:auto;right:10px}.dropdown-menu.bullet.pull-top{margin-top:0;margin-bottom:8px}.dropdown-menu.bullet.pull-top:before{top:auto;bottom:-7px;border-bottom-width:0;border-top-width:7px;border-top-color:#ccc;border-top-color:rgba(0,0,0,.15)}.dropdown-menu.bullet.pull-top:after{top:auto;bottom:-6px;border-bottom:0;border-top-width:6px;border-top-color:#fff}.dropdown-menu.bullet.pull-center:before{left:auto;right:50%;margin-right:-7px}.dropdown-menu.bullet.pull-center:after{left:auto;right:50%;margin-right:-6px}.dropdown-menu.bullet.pull-middle{margin-right:8px}.dropdown-menu.bullet.pull-middle:before{top:50%;left:100%;right:auto;margin-top:-7px;border-right-width:0;border-bottom-color:transparent;border-top-width:7px;border-left-color:#ccc;border-left-color:rgba(0,0,0,.15)}.dropdown-menu.bullet.pull-middle:after{top:50%;left:100%;right:auto;margin-top:-6px;border-right-width:0;border-bottom-color:transparent;border-top-width:6px;border-left-color:#fff}.dropdown-menu.bullet.pull-middle.pull-right{margin-right:0;margin-left:8px}.dropdown-menu.bullet.pull-middle.pull-right:before{left:-7px;border-left-width:0;border-right-width:7px;border-right-color:#ccc;border-right-color:rgba(0,0,0,.15)}.dropdown-menu.bullet.pull-middle.pull-right:after{left:-6px;border-left-width:0;border-right-width:6px;border-right-color:#fff}.dropdown-menu.bullet.pull-middle.pull-center{margin-left:0;margin-right:0}.dropdown-menu.bullet.pull-middle.pull-center:before{border:0;display:none}.dropdown-menu.bullet.pull-middle.pull-center:after{border:0;display:none}.dropdown-submenu{position:relative}.dropdown-submenu>.dropdown-menu{top:0;left:100%;margin-top:-6px;margin-left:-1px;border-top-left-radius:0}.dropdown-submenu>a:before{display:block;float:right;width:0;height:0;content:"";margin-top:6px;margin-right:-8px;border-width:4px 0 4px 4px;border-style:solid;border-left-style:dashed;border-top-color:transparent;border-bottom-color:transparent}@media (max-width:767px){.navbar-nav .dropdown-submenu>a:before{margin-top:8px;border-color:inherit;border-style:solid;border-width:4px 4px 0;border-left-color:transparent;border-right-color:transparent}.navbar-nav .dropdown-submenu>a{padding-left:40px}.navbar-nav>.open>.dropdown-menu>.dropdown-submenu>.dropdown-menu>li>a,.navbar-nav>.open>.dropdown-menu>.dropdown-submenu>.dropdown-menu>li>label{padding-left:35px}.navbar-nav>.open>.dropdown-menu>.dropdown-submenu>.dropdown-menu>li>.dropdown-menu>li>a,.navbar-nav>.open>.dropdown-menu>.dropdown-submenu>.dropdown-menu>li>.dropdown-menu>li>label{padding-left:45px}.navbar-nav>.open>.dropdown-menu>.dropdown-submenu>.dropdown-menu>li>.dropdown-menu>li>.dropdown-menu>li>a,.navbar-nav>.open>.dropdown-menu>.dropdown-submenu>.dropdown-menu>li>.dropdown-menu>li>.dropdown-menu>li>label{padding-left:55px}.navbar-nav>.open>.dropdown-menu>.dropdown-submenu>.dropdown-menu>li>.dropdown-menu>li>.dropdown-menu>li>.dropdown-menu>li>a,.navbar-nav>.open>.dropdown-menu>.dropdown-submenu>.dropdown-menu>li>.dropdown-menu>li>.dropdown-menu>li>.dropdown-menu>li>label{padding-left:65px}.navbar-nav>.open>.dropdown-menu>.dropdown-submenu>.dropdown-menu>li>.dropdown-menu>li>.dropdown-menu>li>.dropdown-menu>li>.dropdown-menu>li>a,.navbar-nav>.open>.dropdown-menu>.dropdown-submenu>.dropdown-menu>li>.dropdown-menu>li>.dropdown-menu>li>.dropdown-menu>li>.dropdown-menu>li>label{padding-left:75px}}.navbar-default .navbar-nav .open>.dropdown-menu>.dropdown-submenu.open>a,.navbar-default .navbar-nav .open>.dropdown-menu>.dropdown-submenu.open>a:hover,.navbar-default .navbar-nav .open>.dropdown-menu>.dropdown-submenu.open>a:focus{background-color:#e7e7e7;color:#555}@media (max-width:767px){.navbar-default .navbar-nav .open>.dropdown-menu>.dropdown-submenu.open>a:before{border-top-color:#555}}.navbar-inverse .navbar-nav .open>.dropdown-menu>.dropdown-submenu.open>a,.navbar-inverse .navbar-nav .open>.dropdown-menu>.dropdown-submenu.open>a:hover,.navbar-inverse .navbar-nav .open>.dropdown-menu>.dropdown-submenu.open>a:focus{background-color:#080808;color:#fff}@media (max-width:767px){.navbar-inverse .navbar-nav .open>.dropdown-menu>.dropdown-submenu.open>a:before{border-top-color:#fff}} \ No newline at end of file diff --git a/dist/js/dropdowns-enhancement.js b/dist/js/dropdowns-enhancement.js new file mode 100644 index 0000000..3e44c93 --- /dev/null +++ b/dist/js/dropdowns-enhancement.js @@ -0,0 +1,276 @@ +/* ======================================================================== + * Bootstrap Dropdowns Enhancement: dropdowns-enhancement.js v3.1.1 (Beta 1) + * http://behigh.github.io/bootstrap_dropdowns_enhancement/ + * ======================================================================== + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * ======================================================================== */ + +(function($) { + "use strict"; + + var toggle = '[data-toggle="dropdown"]', + disabled = '.disabled, :disabled', + backdrop = '.dropdown-backdrop', + menuClass = 'dropdown-menu', + subMenuClass = 'dropdown-submenu', + namespace = '.bs.dropdown.data-api', + eventNamespace = '.bs.dropdown', + openClass = 'open', + touchSupport = 'ontouchstart' in document.documentElement, + opened; + + + function Dropdown(element) { + $(element).on('click' + eventNamespace, this.toggle) + } + + var proto = Dropdown.prototype; + + proto.toggle = function(event) { + var $element = $(this); + + if ($element.is(disabled)) return; + + var $parent = getParent($element); + var isActive = $parent.hasClass(openClass); + var isSubMenu = $parent.hasClass(subMenuClass); + var menuTree = isSubMenu ? getSubMenuParents($parent) : null; + + closeOpened(event, menuTree); + + if (!isActive) { + if (!menuTree) + menuTree = [$parent]; + + if (touchSupport && !$parent.closest('.navbar-nav').length && !menuTree[0].find(backdrop).length) { + // if mobile we use a backdrop because click events don't delegate + $('
').appendTo(menuTree[0]).on('click', closeOpened) + } + + for (var i = 0, s = menuTree.length; i < s; i++) { + if (!menuTree[i].hasClass(openClass)) { + menuTree[i].addClass(openClass); + positioning(menuTree[i].children('.' + menuClass), menuTree[i]); + } + } + opened = menuTree[0]; + } + + return false; + }; + + proto.keydown = function (e) { + if (!/(38|40|27)/.test(e.keyCode)) return; + + var $this = $(this); + + e.preventDefault(); + e.stopPropagation(); + + if ($this.is('.disabled, :disabled')) return; + + var $parent = getParent($this); + var isActive = $parent.hasClass('open'); + + if (!isActive || (isActive && e.keyCode == 27)) { + if (e.which == 27) $parent.find(toggle).trigger('focus'); + return $this.trigger('click') + } + + var desc = ' li:not(.divider):visible a'; + var desc1 = 'li:not(.divider):visible > input:not(disabled) ~ label'; + var $items = $parent.find(desc1 + ', ' + '[role="menu"]' + desc + ', [role="listbox"]' + desc); + + if (!$items.length) return; + + var index = $items.index($items.filter(':focus')); + + if (e.keyCode == 38 && index > 0) index--; // up + if (e.keyCode == 40 && index < $items.length - 1) index++; // down + if (!~index) index = 0; + + $items.eq(index).trigger('focus') + }; + + proto.change = function (e) { + + var + $parent, + $menu, + $toggle, + selector, + text = '', + $items, + maxItems, + maxText; + + $menu = $(this).closest('.' + menuClass); + + $toggle = $menu.parent().find('[data-label-placement]'); + + if (!$toggle || !$toggle.length) { + $toggle = $menu.parent().find(toggle); + } + + if (!$toggle || !$toggle.length || $toggle.data('placeholder') === false) + return; // do nothing, no control + + ($toggle.data('placeholder') == undefined && $toggle.data('placeholder', $.trim($toggle.text()))); + text = $.data($toggle[0], 'placeholder'); + + maxItems = parseInt($toggle.data('maxItems')); + if (isNaN(maxItems)) { + maxItems = 3; + } + + (!(maxText = $toggle.data('maxText')) && (maxText = '%s selected')); + + $items = $menu.find('li > input:checked'); + + if ($items.length) { + text = []; + $items.each(function () { + var str = $(this).parent().find('label').eq(0), + label = str.find('.data-label'); + + if (label.length) { + var p = $(''); + p.append(label.clone()); + str = p.html(); + } + else { + str = str.html(); + } + + + str && text.push($.trim(str)); + }); + + text = text.length > maxItems ? maxText.replace('%s', text.length) : text.join(', '); + } + + var caret = $toggle.find('.caret'); + + $toggle.html(text || ' '); + if (caret.length) + $toggle.append(' ') && caret.appendTo($toggle); + + }; + + function positioning($menu, $control) { + if ($menu.hasClass('pull-center')) { + $menu.css('margin-right', $menu.outerWidth() / -2); + } + + if ($menu.hasClass('pull-middle')) { + $menu.css('margin-top', ($menu.outerHeight() / -2) - ($control.outerHeight() / 2)); + } + } + + function closeOpened(event, menuTree) { + if (opened) { + + if (!menuTree) { + menuTree = [opened]; + } + + var parent; + + if (opened[0] !== menuTree[0][0]) { + parent = opened; + } else { + parent = menuTree[menuTree.length - 1]; + if (parent.parent().hasClass(menuClass)) { + parent = parent.parent(); + } + } + + parent.find('.' + openClass).removeClass(openClass); + + if (parent.hasClass(openClass)) + parent.removeClass(openClass); + + if (parent === opened) { + opened = null; + $(backdrop).remove(); + } + } + } + + function getSubMenuParents($submenu) { + var result = [$submenu]; + var $parent; + while (!$parent || $parent.hasClass(subMenuClass)) { + $parent = ($parent || $submenu).parent(); + if ($parent.hasClass(menuClass)) { + $parent = $parent.parent(); + } + if ($parent.children(toggle)) { + result.unshift($parent); + } + } + return result; + } + + function getParent($this) { + var selector = $this.attr('data-target'); + + if (!selector) { + selector = $this.attr('href'); + selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, ''); //strip for ie7 + } + + var $parent = selector && $(selector); + + return $parent && $parent.length ? $parent : $this.parent() + } + + // DROPDOWN PLUGIN DEFINITION + // ========================== + + var old = $.fn.dropdown; + + $.fn.dropdown = function (option) { + return this.each(function () { + var $this = $(this); + var data = $this.data('bs.dropdown'); + + if (!data) $this.data('bs.dropdown', (data = new Dropdown(this))); + if (typeof option == 'string') data[option].call($this); + }) + }; + + $.fn.dropdown.Constructor = Dropdown; + + $.fn.dropdown.clearMenus = function(e) { + $(backdrop).remove(); + $('.' + openClass + ' ' + toggle).each(function () { + var $parent = getParent($(this)); + var relatedTarget = { relatedTarget: this }; + if (!$parent.hasClass('open')) return; + $parent.trigger(e = $.Event('hide' + eventNamespace, relatedTarget)); + if (e.isDefaultPrevented()) return; + $parent.removeClass('open').trigger('hidden' + eventNamespace, relatedTarget); + }); + return this; + }; + + + // DROPDOWN NO CONFLICT + // ==================== + + $.fn.dropdown.noConflict = function () { + $.fn.dropdown = old; + return this + }; + + + $(document).off(namespace) + .on('click' + namespace, closeOpened) + .on('click' + namespace, toggle, proto.toggle) + .on('click' + namespace, '.dropdown-menu > li > input[type="checkbox"] ~ label, .dropdown-menu > li > input[type="checkbox"], .dropdown-menu.noclose > li', function (e) { + e.stopPropagation() + }) + .on('change' + namespace, '.dropdown-menu > li > input[type="checkbox"], .dropdown-menu > li > input[type="radio"]', proto.change) + .on('keydown' + namespace, toggle + ', [role="menu"], [role="listbox"]', proto.keydown) +}(jQuery)); \ No newline at end of file diff --git a/docs/css/dropdowns-enhancement.css b/docs/css/dropdowns-enhancement.css new file mode 100644 index 0000000..3816a7d --- /dev/null +++ b/docs/css/dropdowns-enhancement.css @@ -0,0 +1,294 @@ +.dropdown-menu > li > label { + display: block; + padding: 3px 20px; + clear: both; + font-weight: normal; + line-height: 1.42857143; + color: #333333; + white-space: nowrap; +} +.dropdown-menu > li > label:hover, +.dropdown-menu > li > label:focus { + text-decoration: none; + color: #262626; + background-color: #f5f5f5; +} +.dropdown-menu > li > input:checked ~ label, +.dropdown-menu > li > input:checked ~ label:hover, +.dropdown-menu > li > input:checked ~ label:focus, +.dropdown-menu > .active > label, +.dropdown-menu > .active > label:hover, +.dropdown-menu > .active > label:focus { + color: #ffffff; + text-decoration: none; + outline: 0; + background-color: #428bca; +} +.dropdown-menu > li > input[disabled] ~ label, +.dropdown-menu > li > input[disabled] ~ label:hover, +.dropdown-menu > li > input[disabled] ~ label:focus, +.dropdown-menu > .disabled > label, +.dropdown-menu > .disabled > label:hover, +.dropdown-menu > .disabled > label:focus { + color: #999999; +} +.dropdown-menu > li > input[disabled] ~ label:hover, +.dropdown-menu > li > input[disabled] ~ label:focus, +.dropdown-menu > .disabled > label:hover, +.dropdown-menu > .disabled > label:focus { + text-decoration: none; + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); + cursor: not-allowed; +} +.dropdown-menu > li > label { + margin-bottom: 0; + cursor: pointer; +} +.dropdown-menu > li > input[type="radio"], +.dropdown-menu > li > input[type="checkbox"] { + display: none; + position: absolute; + top: -9999em; + left: -9999em; +} +.dropdown-menu > li > label:focus, +.dropdown-menu > li > input:focus ~ label { + outline: thin dotted; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; +} +.dropdown-menu.pull-right { + right: 0; + left: auto; +} +.dropdown-menu.pull-top { + bottom: 100%; + top: auto; + margin: 0 0 2px; + -webkit-box-shadow: 0 -6px 12px rgba(0, 0, 0, 0.175); + box-shadow: 0 -6px 12px rgba(0, 0, 0, 0.175); +} +.dropdown-menu.pull-center { + right: 50%; + left: auto; +} +.dropdown-menu.pull-middle { + right: 100%; + margin: 0 2px 0 0; + box-shadow: -5px 0 10px rgba(0, 0, 0, 0.2); + left: auto; +} +.dropdown-menu.pull-middle.pull-right { + right: auto; + left: 100%; + margin: 0 0 0 2px; + box-shadow: 5px 0 10px rgba(0, 0, 0, 0.2); +} +.dropdown-menu.pull-middle.pull-center { + right: 50%; + margin: 0; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); +} +.dropdown-menu.bullet { + margin-top: 8px; +} +.dropdown-menu.bullet:before { + width: 0; + height: 0; + content: ''; + display: inline-block; + position: absolute; + border-color: transparent; + border-style: solid; + -webkit-transform: rotate(360deg); + border-width: 0 7px 7px; + border-bottom-color: #cccccc; + border-bottom-color: rgba(0, 0, 0, 0.15); + top: -7px; + left: 9px; +} +.dropdown-menu.bullet:after { + width: 0; + height: 0; + content: ''; + display: inline-block; + position: absolute; + border-color: transparent; + border-style: solid; + -webkit-transform: rotate(360deg); + border-width: 0 6px 6px; + border-bottom-color: #ffffff; + top: -6px; + left: 10px; +} +.dropdown-menu.bullet.pull-right:before { + left: auto; + right: 9px; +} +.dropdown-menu.bullet.pull-right:after { + left: auto; + right: 10px; +} +.dropdown-menu.bullet.pull-top { + margin-top: 0; + margin-bottom: 8px; +} +.dropdown-menu.bullet.pull-top:before { + top: auto; + bottom: -7px; + border-bottom-width: 0; + border-top-width: 7px; + border-top-color: #cccccc; + border-top-color: rgba(0, 0, 0, 0.15); +} +.dropdown-menu.bullet.pull-top:after { + top: auto; + bottom: -6px; + border-bottom: none; + border-top-width: 6px; + border-top-color: #ffffff; +} +.dropdown-menu.bullet.pull-center:before { + left: auto; + right: 50%; + margin-right: -7px; +} +.dropdown-menu.bullet.pull-center:after { + left: auto; + right: 50%; + margin-right: -6px; +} +.dropdown-menu.bullet.pull-middle { + margin-right: 8px; +} +.dropdown-menu.bullet.pull-middle:before { + top: 50%; + left: 100%; + right: auto; + margin-top: -7px; + border-right-width: 0; + border-bottom-color: transparent; + border-top-width: 7px; + border-left-color: #cccccc; + border-left-color: rgba(0, 0, 0, 0.15); +} +.dropdown-menu.bullet.pull-middle:after { + top: 50%; + left: 100%; + right: auto; + margin-top: -6px; + border-right-width: 0; + border-bottom-color: transparent; + border-top-width: 6px; + border-left-color: #ffffff; +} +.dropdown-menu.bullet.pull-middle.pull-right { + margin-right: 0; + margin-left: 8px; +} +.dropdown-menu.bullet.pull-middle.pull-right:before { + left: -7px; + border-left-width: 0; + border-right-width: 7px; + border-right-color: #cccccc; + border-right-color: rgba(0, 0, 0, 0.15); +} +.dropdown-menu.bullet.pull-middle.pull-right:after { + left: -6px; + border-left-width: 0; + border-right-width: 6px; + border-right-color: #ffffff; +} +.dropdown-menu.bullet.pull-middle.pull-center { + margin-left: 0; + margin-right: 0; +} +.dropdown-menu.bullet.pull-middle.pull-center:before { + border: none; + display: none; +} +.dropdown-menu.bullet.pull-middle.pull-center:after { + border: none; + display: none; +} +.dropdown-submenu { + position: relative; +} +.dropdown-submenu > .dropdown-menu { + top: 0; + left: 100%; + margin-top: -6px; + margin-left: -1px; + border-top-left-radius: 0; +} +.dropdown-submenu > a:before { + display: block; + float: right; + width: 0; + height: 0; + content: ""; + margin-top: 6px; + margin-right: -8px; + border-width: 4px 0 4px 4px; + border-style: solid; + border-left-style: dashed; + border-top-color: transparent; + border-bottom-color: transparent; +} +@media (max-width: 767px) { + .navbar-nav .dropdown-submenu > a:before { + margin-top: 8px; + border-color: inherit; + border-style: solid; + border-width: 4px 4px 0; + border-left-color: transparent; + border-right-color: transparent; + } + .navbar-nav .dropdown-submenu > a { + padding-left: 40px; + } + .navbar-nav > .open > .dropdown-menu > .dropdown-submenu > .dropdown-menu > li > a, + .navbar-nav > .open > .dropdown-menu > .dropdown-submenu > .dropdown-menu > li > label { + padding-left: 35px; + } + .navbar-nav > .open > .dropdown-menu > .dropdown-submenu > .dropdown-menu > li > .dropdown-menu > li > a, + .navbar-nav > .open > .dropdown-menu > .dropdown-submenu > .dropdown-menu > li > .dropdown-menu > li > label { + padding-left: 45px; + } + .navbar-nav > .open > .dropdown-menu > .dropdown-submenu > .dropdown-menu > li > .dropdown-menu > li > .dropdown-menu > li > a, + .navbar-nav > .open > .dropdown-menu > .dropdown-submenu > .dropdown-menu > li > .dropdown-menu > li > .dropdown-menu > li > label { + padding-left: 55px; + } + .navbar-nav > .open > .dropdown-menu > .dropdown-submenu > .dropdown-menu > li > .dropdown-menu > li > .dropdown-menu > li > .dropdown-menu > li > a, + .navbar-nav > .open > .dropdown-menu > .dropdown-submenu > .dropdown-menu > li > .dropdown-menu > li > .dropdown-menu > li > .dropdown-menu > li > label { + padding-left: 65px; + } + .navbar-nav > .open > .dropdown-menu > .dropdown-submenu > .dropdown-menu > li > .dropdown-menu > li > .dropdown-menu > li > .dropdown-menu > li > .dropdown-menu > li > a, + .navbar-nav > .open > .dropdown-menu > .dropdown-submenu > .dropdown-menu > li > .dropdown-menu > li > .dropdown-menu > li > .dropdown-menu > li > .dropdown-menu > li > label { + padding-left: 75px; + } +} +.navbar-default .navbar-nav .open > .dropdown-menu > .dropdown-submenu.open > a, +.navbar-default .navbar-nav .open > .dropdown-menu > .dropdown-submenu.open > a:hover, +.navbar-default .navbar-nav .open > .dropdown-menu > .dropdown-submenu.open > a:focus { + background-color: #e7e7e7; + color: #555555; +} +@media (max-width: 767px) { + .navbar-default .navbar-nav .open > .dropdown-menu > .dropdown-submenu.open > a:before { + border-top-color: #555555; + } +} +.navbar-inverse .navbar-nav .open > .dropdown-menu > .dropdown-submenu.open > a, +.navbar-inverse .navbar-nav .open > .dropdown-menu > .dropdown-submenu.open > a:hover, +.navbar-inverse .navbar-nav .open > .dropdown-menu > .dropdown-submenu.open > a:focus { + background-color: #080808; + color: #ffffff; +} +@media (max-width: 767px) { + .navbar-inverse .navbar-nav .open > .dropdown-menu > .dropdown-submenu.open > a:before { + border-top-color: #ffffff; + } +} diff --git a/docs/css/fonts.css b/docs/css/fonts.css new file mode 100644 index 0000000..d020629 --- /dev/null +++ b/docs/css/fonts.css @@ -0,0 +1,5 @@ +@font-face { + font-family: 'Glyphicons Halflings'; + src: url('../fonts/glyphicons-halflings-regular.eot'); + src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('../fonts/glyphicons-halflings-regular.woff') format('woff'), url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('../fonts/glyphicons-halflings-regular.svg#glyphicons-halflings-regular') format('svg'); +} diff --git a/docs/fonts/glyphicons-halflings-regular.eot b/docs/fonts/glyphicons-halflings-regular.eot new file mode 100644 index 0000000..4a4ca86 Binary files /dev/null and b/docs/fonts/glyphicons-halflings-regular.eot differ diff --git a/docs/fonts/glyphicons-halflings-regular.svg b/docs/fonts/glyphicons-halflings-regular.svg new file mode 100644 index 0000000..e3e2dc7 --- /dev/null +++ b/docs/fonts/glyphicons-halflings-regular.svg @@ -0,0 +1,229 @@ + + + \ No newline at end of file diff --git a/docs/fonts/glyphicons-halflings-regular.ttf b/docs/fonts/glyphicons-halflings-regular.ttf new file mode 100644 index 0000000..67fa00b Binary files /dev/null and b/docs/fonts/glyphicons-halflings-regular.ttf differ diff --git a/docs/fonts/glyphicons-halflings-regular.woff b/docs/fonts/glyphicons-halflings-regular.woff new file mode 100644 index 0000000..8c54182 Binary files /dev/null and b/docs/fonts/glyphicons-halflings-regular.woff differ diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..73e5126 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,973 @@ + + + + + + + + + + +Enhancing functionality of dropdown menus.
+Added the following improvements:
+To start using the improvements you need to include a modified dropdown-enhancement.js and dropdown-enhancement.css file.
+Important dropdown-enhancement.css only have enhancement rules and depends entirely on the original style of Bootstrap dropdowns.
For more information, see the examples below.
+dropdown-enhancement.js does not depend on the original dropdown.js. It adds support for sub-menu, radio and checkboxes, and centering menus that can not be is achieved by means of css.
Has been improved close menu function. It only closes menus opened by the module, also considers the submenus. Function clearMenus (close all menus) been preserved and made public. Available as $.fn.dropdown.clearMenus.
Dropdown Events are not available at the moment.
+Important You do not need to include the original Bootstrap dropdown.js
+ If you like my work, please buy me a beer. +
+ + +Enable sub-menu functionality.
+Add class .dropdown-submenu to items with sub-menu.
Resize window to view effect.
+The only thing that is required for proper operation, is to comply with certain markup conditions. Input
+ elements should be located outside of the label and label must have a correct for attribute.
+
+<div class="btn-group">
+ <button data-toggle="dropdown" class="btn btn-default dropdown-toggle">Checked option <span class="caret"></span></button>
+ <ul class="dropdown-menu">
+ <li><input type="radio" id="ID" name="NAME" value="VALUE"><label for="ID">Label</label></li>
+ <!-- Other items -->
+ </ul>
+</div>
+
+
+ Do not close the menu on click on radio add class .noclose.
+
+<div class="btn-group">
+ <button data-toggle="dropdown" class="btn btn-default dropdown-toggle">Checked option <span class="caret"></span></button>
+ <ul class="dropdown-menu noclose">
+ <li><input type="radio" id="ID" name="NAME" value="VALUE"><label for="ID">Label</label></li>
+ <!-- Other items -->
+ </ul>
+</div>
+
+
+ Use html5 attribute data-placeholder to specify a default label. Uncheck checkbox in example bellow
+ to see effect.
+
+<div class="btn-group">
+ <button data-toggle="dropdown" class="btn dropdown-toggle" data-placeholder="Please select">Checked option <span class="caret"></span></button>
+ <ul class="dropdown-menu">
+ <li><input type="checkbox" id="ID"><label for="ID" name="NAME" value="VALUE">Label</label></li>
+ <!-- Other items -->
+ </ul>
+</div>
+
+
+ Using html5 attribute data-label-placement you can specify the container for label. See examples
+ below.
+
+<div class="btn-group">
+ <button class="btn btn-primary" data-label-placement>Checked option</button>
+ <button data-toggle="dropdown" class="btn btn-primary dropdown-toggle"><span class="caret"></span></button>
+ <ul class="dropdown-menu">
+ <li><input type="checkbox" id="ID" name="NAME" value="VALUE"><label for="ID">Label</label></li>
+ <!-- Other items -->
+ </ul>
+</div>
+
+
+ Set data-placeholder="false" to disable label replacement. See examples below.
+
+<div class="btn-group">
+ <button class="btn btn-primary">Checked option</button>
+ <button data-toggle="dropdown" class="btn btn-primary dropdown-toggle" data-placeholder="false"><span class="caret"></span></button>
+ <ul class="dropdown-menu">
+ <li><input type="checkbox" id="ID" name="NAME" value="VALUE"><label for="ID">Label</label></li>
+ <!-- Other items -->
+ </ul>
+</div>
+
+
+ Add class .data-label to desired element.
+
+<div class="btn-group">
+ <button data-toggle="dropdown" class="btn dropdown-toggle">Checked option <span class="caret"></span></button>
+ <ul class="dropdown-menu">
+ <li><input type="radio" id="ID" name="NAME" value="VALUE"><label for="ID"><span class="data-label">Label</span> Other text</label></li>
+ <!-- Other items -->
+ </ul>
+</div>
+
+
+ Use extra classes for advanced positioning of dropdown menus. Classes: .pull-top, .pull-right
.pull-right.pull-top.pull-top.pull-rightThis classes use a small piece of javascript for correct positioning. Classes: .pull-center, .pull-middle
.pull-center.pull-center.pull-top.pull-middle.pull-middle.pull-right".pull-middle.pull-center"To add bullet just add class .bullet to the dropdown menu, .pull-right
.bullet.bullet.pull-right.bullet.pull-top.bullet.pull-top.pull-right.bullet.pull-center.bullet.pull-center.pull-top.bullet.pull-middle.bullet.pull-middle.pull-right".bullet Ignored.pull-middle.pull-center"
+
+
+
+
+
+Enhancing functionality of dropdown menus.
+Added the following improvements:
+To start using the improvements you need to include a modified + dropdown.js + and + dropdown.css file.
+For more information, see the examples below.
+Looking for Bootstrap v3?
+ +The only thing that is required for proper operation, is to comply with certain markup conditions. Input
+ elements should be located outside of the label and label must have a correct for attribute.
+<div class="btn-group"> + <button data-toggle="dropdown" class="btn dropdown-toggle">Checked option <span class="caret"></span></button> + <ul class="dropdown-menu"> + <li><input type="radio" id="ID" name="NAME" value="VALUE"><label for="ID">Label</label></li> + <!-- Other items --> + </ul> +</div> ++ +
Do not close the menu on click on radio add class .noclose.
+<div class="btn-group"> + <button data-toggle="dropdown" class="btn dropdown-toggle">Checked option <span class="caret"></span></button> + <ul class="dropdown-menu noclose"> + <li><input type="radio" id="ID" name="NAME" value="VALUE"><label for="ID">Label</label></li> + <!-- Other items --> + </ul> +</div> ++ + +
Use html5 attribute data-placeholder to specify a default label. Uncheck checkbox in example bellow
+ to see effect.
+<div class="btn-group"> + <button data-toggle="dropdown" class="btn dropdown-toggle" data-placeholder="Please select">Checked option <span class="caret"></span></button> + <ul class="dropdown-menu"> + <li><input type="checkbox" id="ID"><label for="ID" name="NAME" value="VALUE">Label</label></li> + <!-- Other items --> + </ul> +</div> ++ +
Using html5 attribute data-label-placement you can specify the container for label. See examples
+ below.
+<div class="btn-group"> + <button class="btn btn-primary" data-label-placement>Checked option</button> + <button data-toggle="dropdown" class="btn btn-primary dropdown-toggle"><span class="caret"></span></button> + <ul class="dropdown-menu"> + <li><input type="checkbox" id="ID" name="NAME" value="VALUE"><label for="ID">Label</label></li> + <!-- Other items --> + </ul> +</div> ++ +
Set data-placeholder="false" to disable label replacement. See examples below.
+<div class="btn-group"> + <button class="btn btn-primary">Checked option</button> + <button data-toggle="dropdown" class="btn btn-primary dropdown-toggle" data-placeholder="false"><span class="caret"></span></button> + <ul class="dropdown-menu"> + <li><input type="checkbox" id="ID" name="NAME" value="VALUE"><label for="ID">Label</label></li> + <!-- Other items --> + </ul> +</div> ++ +
Add class .data-label to desired element.
+<div class="btn-group"> + <button data-toggle="dropdown" class="btn dropdown-toggle">Checked option <span class="caret"></span></button> + <ul class="dropdown-menu"> + <li><input type="radio" id="ID" name="NAME" value="VALUE"><label for="ID"><span class="data-label">Label</span> Other text</label></li> + <!-- Other items --> + </ul> +</div> ++ +
Use extra classes for advanced positioning of dropdown menus. Classes: .pull-top,
+ .pull-right
.pull-right.pull-top.pull-top.pull-rightThis classes use a small piece of javascript for correct positioning. Classes: .pull-center, .pull-middle
+
.pull-center.pull-center.pull-top.pull-middle.pull-middle.pull-right".pull-middle.pull-center"To add bullet just add class .bullet to the dropdown menu,
+ .pull-right
.bullet.bullet.pull-right.bullet.pull-top.bullet.pull-top.pull-right.bullet.pull-center.bullet.pull-center.pull-top.bullet.pull-middle.bullet.pull-middle.pull-right".bullet Ignored.pull-middle.pull-center"This automatic page generator is the easiest way to create beautiful pages for all of your projects. Author your page content here using GitHub Flavored Markdown, select a template crafted by a designer, and publish. After your page is generated, you can check out the new branch:
- -$ cd your_repo_root/repo_name
-$ git fetch origin
-$ git checkout gh-pages
-
-
-If you're using the GitHub for Mac, simply sync your repository and you'll see the new branch.
- -We've crafted some handsome templates for you to use. Go ahead and continue to layouts to browse through them. You can easily go back to edit your page before publishing. After publishing your page, you can revisit the page generator and switch to another theme. Your Page content will be preserved if it remained markdown format.
- -If you prefer to not use the automatic generator, push a branch named gh-pages to your repository to create a page manually. In addition to supporting regular HTML content, GitHub Pages support Jekyll, a simple, blog aware static site generator written by our own Tom Preston-Werner. Jekyll makes it easy to create site-wide headers and footers without having to copy them across every page. It also offers intelligent blog support and other advanced templating features.
You can @mention a GitHub username to generate a link to their profile. The resulting <a> element will link to the contributor's GitHub Profile. For example: In 2007, Chris Wanstrath (@defunkt), PJ Hyett (@pjhyett), and Tom Preston-Werner (@mojombo) founded GitHub.
Having trouble with Pages? Check out the documentation at http://help.github.com/pages or contact support@github.com and we’ll help you sort it out.
-