Merge pull request #2776 from PeterDaveHello/uikit_v2.4.0

add uikit v2.4.0
This commit is contained in:
Pete Cooper
2014-03-07 11:09:17 +00:00
67 changed files with 27026 additions and 1 deletions
@@ -0,0 +1,118 @@
/*! UIkit 2.4.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
/* ========================================================================
Addon: Datepicker
========================================================================== */
/*
* Reset dropdown width
*/
.uk-datepicker {
width: auto;
}
/* Sub-object: `uk-datepicker-nav`
========================================================================== */
.uk-datepicker-nav {
margin-bottom: 15px;
text-align: center;
line-height: 20px;
}
/*
* Micro clearfix
*/
.uk-datepicker-nav:before,
.uk-datepicker-nav:after {
content: " ";
display: table;
}
.uk-datepicker-nav:after {
clear: both;
}
/*
* Previous and next navigation
*/
.uk-datepicker-nav a {
color: #444444;
text-decoration: none;
}
.uk-datepicker-nav a:hover {
color: #444444;
}
.uk-datepicker-previous {
float: left;
}
.uk-datepicker-next {
float: right;
}
.uk-datepicker-previous:after,
.uk-datepicker-next:after {
width: 20px;
font-family: FontAwesome;
}
.uk-datepicker-previous:after {
content: "\f053";
}
.uk-datepicker-next:after {
content: "\f054";
}
/* Sub-object: `uk-datepicker-heading`
========================================================================== */
/* Sub-object: `uk-datepicker-table`
========================================================================== */
/* Block element behavior */
.uk-datepicker-table {
width: 100%;
}
.uk-datepicker-table th,
.uk-datepicker-table td {
padding: 2px;
}
.uk-datepicker-table th {
font-size: 12px;
}
/*
* Item
*/
.uk-datepicker-table a {
display: block;
width: 26px;
line-height: 24px;
text-align: center;
color: #444444;
text-decoration: none;
border: 1px solid transparent;
border-radius: 4px;
}
/*
* Sub-object: `uk-datepicker-table-muted`
*/
a.uk-datepicker-table-muted {
color: #999999;
}
/*
* Hover
* 1. Apply hover style also to focus state
* 2. Remove default focus style
*/
.uk-datepicker-table a:hover,
.uk-datepicker-table a:focus {
background-color: #fafafa;
color: #444444;
/* 2 */
outline: none;
border-color: rgba(0, 0, 0, 0.16);
text-shadow: 0 1px 0 #ffffff;
}
/* OnClick */
.uk-datepicker-table a:active {
background-color: #eeeeee;
color: #444444;
}
/*
* Active
*/
.uk-datepicker-table a.uk-active {
background: #00a8e6;
color: #ffffff;
box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.05);
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.1);
}
@@ -0,0 +1,3 @@
/*! UIkit 2.4.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
.uk-datepicker{width:auto}.uk-datepicker-nav{margin-bottom:15px;text-align:center;line-height:20px}.uk-datepicker-nav:before,.uk-datepicker-nav:after{content:" ";display:table}.uk-datepicker-nav:after{clear:both}.uk-datepicker-nav a{color:#444;text-decoration:none}.uk-datepicker-nav a:hover{color:#444}.uk-datepicker-previous{float:left}.uk-datepicker-next{float:right}.uk-datepicker-previous:after,.uk-datepicker-next:after{width:20px;font-family:FontAwesome}.uk-datepicker-previous:after{content:"\f053"}.uk-datepicker-next:after{content:"\f054"}.uk-datepicker-table{width:100%}.uk-datepicker-table th,.uk-datepicker-table td{padding:2px}.uk-datepicker-table th{font-size:12px}.uk-datepicker-table a{display:block;width:26px;line-height:24px;text-align:center;color:#444;text-decoration:none;border:1px solid transparent;border-radius:4px}a.uk-datepicker-table-muted{color:#999}.uk-datepicker-table a:hover,.uk-datepicker-table a:focus{background-color:#fafafa;color:#444;outline:0;border-color:rgba(0,0,0,.16);text-shadow:0 1px 0 #fff}.uk-datepicker-table a:active{background-color:#eee;color:#444}.uk-datepicker-table a.uk-active{background:#00a8e6;color:#fff;box-shadow:inset 0 0 5px rgba(0,0,0,.05);text-shadow:0 -1px 0 rgba(0,0,0,.1)}
@@ -0,0 +1,112 @@
/*! UIkit 2.4.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
/* ========================================================================
Addon: Datepicker
========================================================================== */
/*
* Reset dropdown width
*/
.uk-datepicker {
width: auto;
}
/* Sub-object: `uk-datepicker-nav`
========================================================================== */
.uk-datepicker-nav {
margin-bottom: 15px;
text-align: center;
line-height: 20px;
}
/*
* Micro clearfix
*/
.uk-datepicker-nav:before,
.uk-datepicker-nav:after {
content: " ";
display: table;
}
.uk-datepicker-nav:after {
clear: both;
}
/*
* Previous and next navigation
*/
.uk-datepicker-nav a {
color: #444444;
text-decoration: none;
}
.uk-datepicker-nav a:hover {
color: #444444;
}
.uk-datepicker-previous {
float: left;
}
.uk-datepicker-next {
float: right;
}
.uk-datepicker-previous:after,
.uk-datepicker-next:after {
width: 20px;
font-family: FontAwesome;
}
.uk-datepicker-previous:after {
content: "\f053";
}
.uk-datepicker-next:after {
content: "\f054";
}
/* Sub-object: `uk-datepicker-heading`
========================================================================== */
/* Sub-object: `uk-datepicker-table`
========================================================================== */
/* Block element behavior */
.uk-datepicker-table {
width: 100%;
}
.uk-datepicker-table th,
.uk-datepicker-table td {
padding: 2px;
}
.uk-datepicker-table th {
font-size: 12px;
}
/*
* Item
*/
.uk-datepicker-table a {
display: block;
width: 26px;
line-height: 24px;
text-align: center;
color: #444444;
text-decoration: none;
}
/*
* Sub-object: `uk-datepicker-table-muted`
*/
a.uk-datepicker-table-muted {
color: #999999;
}
/*
* Hover
* 1. Apply hover style also to focus state
* 2. Remove default focus style
*/
.uk-datepicker-table a:hover,
.uk-datepicker-table a:focus {
background-color: #dddddd;
color: #444444;
/* 2 */
outline: none;
}
/* OnClick */
.uk-datepicker-table a:active {
background-color: #cccccc;
color: #444444;
}
/*
* Active
*/
.uk-datepicker-table a.uk-active {
background: #00a8e6;
color: #ffffff;
}
@@ -0,0 +1,128 @@
/*! UIkit 2.4.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
/* ========================================================================
Addon: Datepicker
========================================================================== */
/*
* Reset dropdown width
*/
.uk-datepicker {
width: auto;
}
/* Sub-object: `uk-datepicker-nav`
========================================================================== */
.uk-datepicker-nav {
margin-bottom: 15px;
text-align: center;
line-height: 20px;
}
/*
* Micro clearfix
*/
.uk-datepicker-nav:before,
.uk-datepicker-nav:after {
content: " ";
display: table;
}
.uk-datepicker-nav:after {
clear: both;
}
/*
* Previous and next navigation
*/
.uk-datepicker-nav a {
color: #444444;
text-decoration: none;
}
.uk-datepicker-nav a:hover {
color: #444444;
}
.uk-datepicker-previous {
float: left;
}
.uk-datepicker-next {
float: right;
}
.uk-datepicker-previous:after,
.uk-datepicker-next:after {
width: 20px;
font-family: FontAwesome;
}
.uk-datepicker-previous:after {
content: "\f053";
}
.uk-datepicker-next:after {
content: "\f054";
}
/* Sub-object: `uk-datepicker-heading`
========================================================================== */
/* Sub-object: `uk-datepicker-table`
========================================================================== */
/* Block element behavior */
.uk-datepicker-table {
width: 100%;
}
.uk-datepicker-table th,
.uk-datepicker-table td {
padding: 2px;
}
.uk-datepicker-table th {
font-size: 12px;
}
/*
* Item
*/
.uk-datepicker-table a {
display: block;
width: 26px;
line-height: 24px;
text-align: center;
color: #444444;
text-decoration: none;
border: 1px solid transparent;
border-radius: 4px;
background-origin: border-box;
}
/*
* Sub-object: `uk-datepicker-table-muted`
*/
a.uk-datepicker-table-muted {
color: #999999;
}
/*
* Hover
* 1. Apply hover style also to focus state
* 2. Remove default focus style
*/
.uk-datepicker-table a:hover,
.uk-datepicker-table a:focus {
background-color: #fafafa;
color: #444444;
/* 2 */
outline: none;
border-color: rgba(0, 0, 0, 0.2);
border-bottom-color: rgba(0, 0, 0, 0.3);
text-shadow: 0 1px 0 #ffffff;
}
/* OnClick */
.uk-datepicker-table a:active {
background-color: #f5f5f5;
color: #444444;
border-color: rgba(0, 0, 0, 0.2);
border-top-color: rgba(0, 0, 0, 0.3);
background-image: none;
box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}
/*
* Active
*/
.uk-datepicker-table a.uk-active {
background: #009dd8;
color: #ffffff;
border: 1px solid rgba(0, 0, 0, 0.2);
border-bottom-color: rgba(0, 0, 0, 0.4);
background-origin: border-box;
background-image: -webkit-linear-gradient(top, #00b4f5, #008dc5);
background-image: linear-gradient(to bottom, #00b4f5, #008dc5);
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2);
}
@@ -0,0 +1,3 @@
/*! UIkit 2.4.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
.uk-datepicker{width:auto}.uk-datepicker-nav{margin-bottom:15px;text-align:center;line-height:20px}.uk-datepicker-nav:before,.uk-datepicker-nav:after{content:" ";display:table}.uk-datepicker-nav:after{clear:both}.uk-datepicker-nav a{color:#444;text-decoration:none}.uk-datepicker-nav a:hover{color:#444}.uk-datepicker-previous{float:left}.uk-datepicker-next{float:right}.uk-datepicker-previous:after,.uk-datepicker-next:after{width:20px;font-family:FontAwesome}.uk-datepicker-previous:after{content:"\f053"}.uk-datepicker-next:after{content:"\f054"}.uk-datepicker-table{width:100%}.uk-datepicker-table th,.uk-datepicker-table td{padding:2px}.uk-datepicker-table th{font-size:12px}.uk-datepicker-table a{display:block;width:26px;line-height:24px;text-align:center;color:#444;text-decoration:none;border:1px solid transparent;border-radius:4px;background-origin:border-box}a.uk-datepicker-table-muted{color:#999}.uk-datepicker-table a:hover,.uk-datepicker-table a:focus{background-color:#fafafa;color:#444;outline:0;border-color:rgba(0,0,0,.2);border-bottom-color:rgba(0,0,0,.3);text-shadow:0 1px 0 #fff}.uk-datepicker-table a:active{background-color:#f5f5f5;color:#444;border-color:rgba(0,0,0,.2);border-top-color:rgba(0,0,0,.3);background-image:none;box-shadow:inset 0 2px 4px rgba(0,0,0,.1)}.uk-datepicker-table a.uk-active{background:#009dd8;color:#fff;border:1px solid rgba(0,0,0,.2);border-bottom-color:rgba(0,0,0,.4);background-origin:border-box;background-image:-webkit-linear-gradient(top,#00b4f5,#008dc5);background-image:linear-gradient(to bottom,#00b4f5,#008dc5);text-shadow:0 -1px 0 rgba(0,0,0,.2)}
File diff suppressed because one or more lines are too long
@@ -0,0 +1,3 @@
/*! UIkit 2.4.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
.uk-datepicker{width:auto}.uk-datepicker-nav{margin-bottom:15px;text-align:center;line-height:20px}.uk-datepicker-nav:before,.uk-datepicker-nav:after{content:" ";display:table}.uk-datepicker-nav:after{clear:both}.uk-datepicker-nav a{color:#444;text-decoration:none}.uk-datepicker-nav a:hover{color:#444}.uk-datepicker-previous{float:left}.uk-datepicker-next{float:right}.uk-datepicker-previous:after,.uk-datepicker-next:after{width:20px;font-family:FontAwesome}.uk-datepicker-previous:after{content:"\f053"}.uk-datepicker-next:after{content:"\f054"}.uk-datepicker-table{width:100%}.uk-datepicker-table th,.uk-datepicker-table td{padding:2px}.uk-datepicker-table th{font-size:12px}.uk-datepicker-table a{display:block;width:26px;line-height:24px;text-align:center;color:#444;text-decoration:none}a.uk-datepicker-table-muted{color:#999}.uk-datepicker-table a:hover,.uk-datepicker-table a:focus{background-color:#ddd;color:#444;outline:0}.uk-datepicker-table a:active{background-color:#ccc;color:#444}.uk-datepicker-table a.uk-active{background:#00a8e6;color:#fff}
File diff suppressed because one or more lines are too long
@@ -0,0 +1,28 @@
/*! UIkit 2.4.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
/* ========================================================================
Addon: Form file
========================================================================== */
.uk-form-file {
position: relative;
display: inline-block;
vertical-align: middle;
overflow: hidden;
}
/*
* 1. Required for Firefox
* 2. Required for the cursor
*/
.uk-form-file input[type="file"] {
position: absolute;
top: 0;
bottom: 0;
z-index: 1;
width: 100%;
opacity: 0;
cursor: pointer;
/* 1 */
left: 0;
/* 2 */
font-size: 50px;
}
@@ -0,0 +1,53 @@
/*! UIkit 2.4.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
(function(addon) {
if (typeof define == "function" && define.amd) { // AMD
define("uikit-form-file", ["uikit"], function(){
return jQuery.UIkit.formfile ? jQuery.UIkit.formfile : addon(window, window.jQuery, window.jQuery.UIkit);
});
}
if(window && window.jQuery && window.jQuery.UIkit) {
addon(window, window.jQuery, window.jQuery.UIkit);
}
})(function(global, $, UI){
var FormFile = function(element, options) {
var $this = this, $element = $(element);
if($element.data("formfile")) return;
this.options = $.extend({}, FormFile.defaults, options);
this.element = $element;
this.input = this.element.find("input[type='text']:first");
this.file = this.element.find("input[type='file']:first");
this.file.on("change", function(){
$this.input.val(this.value.replace(/^.*[\/\\]/g, ''));
});
this.element.data("formfile", this);
};
FormFile.defaults = {};
UI["formfile"] = FormFile;
// init code
$(document).on("click.formfile.uikit", "[data-uk-form-file]", function(e) {
var ele = $(this);
if (!ele.data("formfile")) {
var obj = new FormFile(ele, UI.Utils.options(ele.attr("data-uk-form-file")));
ele.trigger("click");
}
});
return FormFile;
});
@@ -0,0 +1,3 @@
/*! UIkit 2.4.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
.uk-form-file{position:relative;display:inline-block;vertical-align:middle;overflow:hidden}.uk-form-file input[type=file]{position:absolute;top:0;bottom:0;z-index:1;width:100%;opacity:0;cursor:pointer;left:0;font-size:50px}
@@ -0,0 +1,3 @@
/*! UIkit 2.4.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
(function(t){"function"==typeof define&&define.amd&&define("uikit-form-file",["uikit"],function(){return jQuery.UIkit.formfile?jQuery.UIkit.formfile:t(window,window.jQuery,window.jQuery.UIkit)}),window&&window.jQuery&&window.jQuery.UIkit&&t(window,window.jQuery,window.jQuery.UIkit)})(function(t,e,n){var i=function(t,n){var s=this,o=e(t);o.data("formfile")||(this.options=e.extend({},i.defaults,n),this.element=o,this.input=this.element.find("input[type='text']:first"),this.file=this.element.find("input[type='file']:first"),this.file.on("change",function(){s.input.val(this.value.replace(/^.*[\/\\]/g,""))}),this.element.data("formfile",this))};return i.defaults={},n.formfile=i,e(document).on("click.formfile.uikit","[data-uk-form-file]",function(){var t=e(this);t.data("formfile")||(new i(t,n.Utils.options(t.attr("data-uk-form-file"))),t.trigger("click"))}),i});
@@ -0,0 +1,27 @@
/*! UIkit 2.4.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
/* ========================================================================
Addon: Form password
========================================================================== */
.uk-form-password {
position: relative;
display: inline-block;
max-width: 100%;
}
.uk-form-password-toggle {
display: block;
position: absolute;
top: 50%;
right: 10px;
margin-top: -6px;
font-size: 13px;
line-height: 13px;
color: #999999;
}
.uk-form-password-toggle:hover {
color: #999999;
text-decoration: none;
}
.uk-form-password > input {
padding-right: 50px !important;
}
@@ -0,0 +1,3 @@
/*! UIkit 2.4.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
.uk-form-password{position:relative;display:inline-block;max-width:100%}.uk-form-password-toggle{display:block;position:absolute;top:50%;right:10px;margin-top:-6px;font-size:13px;line-height:13px;color:#999}.uk-form-password-toggle:hover{color:#999;text-decoration:none}.uk-form-password>input{padding-right:50px!important}
@@ -0,0 +1,27 @@
/*! UIkit 2.4.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
/* ========================================================================
Addon: Form password
========================================================================== */
.uk-form-password {
position: relative;
display: inline-block;
max-width: 100%;
}
.uk-form-password-toggle {
display: block;
position: absolute;
top: 50%;
right: 10px;
margin-top: -6px;
font-size: 13px;
line-height: 13px;
color: #999999;
}
.uk-form-password-toggle:hover {
color: #999999;
text-decoration: none;
}
.uk-form-password > input {
padding-right: 50px !important;
}
@@ -0,0 +1,27 @@
/*! UIkit 2.4.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
/* ========================================================================
Addon: Form password
========================================================================== */
.uk-form-password {
position: relative;
display: inline-block;
max-width: 100%;
}
.uk-form-password-toggle {
display: block;
position: absolute;
top: 50%;
right: 10px;
margin-top: -6px;
font-size: 13px;
line-height: 13px;
color: #999999;
}
.uk-form-password-toggle:hover {
color: #999999;
text-decoration: none;
}
.uk-form-password > input {
padding-right: 50px !important;
}
@@ -0,0 +1,3 @@
/*! UIkit 2.4.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
.uk-form-password{position:relative;display:inline-block;max-width:100%}.uk-form-password-toggle{display:block;position:absolute;top:50%;right:10px;margin-top:-6px;font-size:13px;line-height:13px;color:#999}.uk-form-password-toggle:hover{color:#999;text-decoration:none}.uk-form-password>input{padding-right:50px!important}
@@ -0,0 +1,64 @@
/*! UIkit 2.4.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
(function(addon) {
if (typeof define == "function" && define.amd) { // AMD
define("uikit-form-password", ["uikit"], function(){
return jQuery.UIkit.formPassword ? jQuery.UIkit.formPassword : addon(window, window.jQuery, window.jQuery.UIkit);
});
}
if(window && window.jQuery && window.jQuery.UIkit) {
addon(window, window.jQuery, window.jQuery.UIkit);
}
})(function(global, $, UI){
var FormPassword = function(element, options) {
var $this = this, $element = $(element);
if($element.data("formPassword")) return;
this.options = $.extend({}, FormPassword.defaults, options);
this.element = $element.on("click", function(e) {
e.preventDefault();
if($this.input.length) {
var type = $this.input.attr("type");
$this.input.attr("type", type=="text" ? "password":"text");
$this.element.text($this.options[type=="text" ? "lblShow":"lblHide"]);
}
});
$this.input = this.element.next("input").length ? this.element.next("input") : this.element.prev("input");
$this.element.text(this.options[$this.input.is("[type='password']") ? "lblShow":"lblHide"]);
this.element.data("formPassword", this);
};
FormPassword.defaults = {
"lblShow": "Show",
"lblHide": "Hide"
};
UI["formPassword"] = FormPassword;
// init code
$(document).on("click.formpassword.uikit", "[data-uk-form-password]", function(e) {
var ele = $(this);
if (!ele.data("formPassword")) {
e.preventDefault();
var obj = new FormPassword(ele, UI.Utils.options(ele.attr("data-uk-form-password")));
ele.trigger("click");
}
});
return FormPassword;
});
@@ -0,0 +1,3 @@
/*! UIkit 2.4.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
.uk-form-password{position:relative;display:inline-block;max-width:100%}.uk-form-password-toggle{display:block;position:absolute;top:50%;right:10px;margin-top:-6px;font-size:13px;line-height:13px;color:#999}.uk-form-password-toggle:hover{color:#999;text-decoration:none}.uk-form-password>input{padding-right:50px!important}
@@ -0,0 +1,3 @@
/*! UIkit 2.4.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
(function(t){"function"==typeof define&&define.amd&&define("uikit-form-password",["uikit"],function(){return jQuery.UIkit.formPassword?jQuery.UIkit.formPassword:t(window,window.jQuery,window.jQuery.UIkit)}),window&&window.jQuery&&window.jQuery.UIkit&&t(window,window.jQuery,window.jQuery.UIkit)})(function(t,e,n){var i=function(t,n){var s=this,o=e(t);o.data("formPassword")||(this.options=e.extend({},i.defaults,n),this.element=o.on("click",function(t){if(t.preventDefault(),s.input.length){var e=s.input.attr("type");s.input.attr("type","text"==e?"password":"text"),s.element.text(s.options["text"==e?"lblShow":"lblHide"])}}),s.input=this.element.next("input").length?this.element.next("input"):this.element.prev("input"),s.element.text(this.options[s.input.is("[type='password']")?"lblShow":"lblHide"]),this.element.data("formPassword",this))};return i.defaults={lblShow:"Show",lblHide:"Hide"},n.formPassword=i,e(document).on("click.formpassword.uikit","[data-uk-form-password]",function(t){var s=e(this);s.data("formPassword")||(t.preventDefault(),new i(s,n.Utils.options(s.attr("data-uk-form-password"))),s.trigger("click"))}),i});
@@ -0,0 +1,216 @@
/*! UIkit 2.4.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
/* ========================================================================
Addon: Markdownarea
========================================================================== */
/* Sub-object `uk-markdownarea-navbar`
========================================================================== */
.uk-markdownarea-navbar {
background: #f5f5f5;
border: 1px solid rgba(0, 0, 0, 0.06);
border-top-left-radius: 4px;
border-top-right-radius: 4px;
}
/*
* Micro clearfix
*/
.uk-markdownarea-navbar:before,
.uk-markdownarea-navbar:after {
content: " ";
display: table;
}
.uk-markdownarea-navbar:after {
clear: both;
}
/* Sub-object `uk-markdownarea-navbar-nav`
========================================================================== */
.uk-markdownarea-navbar-nav {
margin: 0;
padding: 0;
list-style: none;
float: left;
}
.uk-markdownarea-navbar-nav > li {
float: left;
}
/*
* 1. Dimensions
* 2. Style
*/
.uk-markdownarea-navbar-nav > li > a {
display: block;
-moz-box-sizing: border-box;
box-sizing: border-box;
text-decoration: none;
/* 1 */
height: 41px;
padding: 0 15px;
line-height: 40px;
/* 2 */
color: #444444;
font-size: 11px;
cursor: pointer;
margin-top: -1px;
margin-left: -1px;
border: 1px solid transparent;
border-bottom-width: 0;
text-shadow: 0 1px 0 #ffffff;
}
/*
* Hover
* 1. Apply hover style also to focus state
* 2. Remove default focus style
*/
.uk-markdownarea-navbar-nav > li:hover > a,
.uk-markdownarea-navbar-nav > li > a:focus {
background-color: #fafafa;
color: #444444;
outline: none;
/* 2 */
position: relative;
z-index: 1;
border-left-color: rgba(0, 0, 0, 0.1);
border-right-color: rgba(0, 0, 0, 0.1);
border-top-color: rgba(0, 0, 0, 0.1);
}
/* OnClick */
.uk-markdownarea-navbar-nav > li > a:active {
background-color: #eeeeee;
color: #444444;
border-left-color: rgba(0, 0, 0, 0.1);
border-right-color: rgba(0, 0, 0, 0.1);
border-top-color: rgba(0, 0, 0, 0.2);
}
/* Active */
.uk-markdownarea-navbar-nav > li.uk-active > a {
background-color: #fafafa;
color: #444444;
border-left-color: rgba(0, 0, 0, 0.1);
border-right-color: rgba(0, 0, 0, 0.1);
border-top-color: rgba(0, 0, 0, 0.1);
}
/* Sub-object: `uk-markdownarea-navbar-flip`
========================================================================== */
.uk-markdownarea-navbar-flip {
float: right;
}
/* Sub-object for special buttons
========================================================================== */
[data-mode='split'] .uk-markdown-button-markdown,
[data-mode='split'] .uk-markdown-button-preview {
display: none;
}
/* Sub-object `uk-markdownarea-content`
========================================================================== */
.uk-markdownarea-content {
border-left: 1px solid #dddddd;
border-right: 1px solid #dddddd;
border-bottom: 1px solid #dddddd;
background: #ffffff;
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
}
/*
* Micro clearfix
*/
.uk-markdownarea-content:before,
.uk-markdownarea-content:after {
content: " ";
display: table;
}
.uk-markdownarea-content:after {
clear: both;
}
/* Modifier `uk-markdownarea-fullscreen`
========================================================================== */
.uk-markdownarea-fullscreen {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 990;
}
.uk-markdownarea-fullscreen .uk-markdownarea-content {
position: absolute;
top: 41px;
left: 0;
right: 0;
bottom: 0;
}
.uk-markdownarea-fullscreen .uk-icon-expand:before {
content: "\f066";
}
/* Sub-objects `uk-markdownarea-code` and `uk-markdownarea-preview`
========================================================================== */
.uk-markdownarea-code,
.uk-markdownarea-preview {
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.uk-markdownarea-preview {
padding: 20px;
overflow-y: scroll;
}
/*
* Tab view
*/
[data-mode='tab'][data-active-tab='code'] .uk-markdownarea-preview,
[data-mode='tab'][data-active-tab='preview'] .uk-markdownarea-code {
display: none;
}
/*
* Split view
*/
[data-mode='split'] .uk-markdownarea-code,
[data-mode='split'] .uk-markdownarea-preview {
float: left;
width: 50%;
}
[data-mode='split'] .uk-markdownarea-code {
border-right: 1px solid #eeeeee;
}
/* CodeMirror modifications
========================================================================== */
.uk-markdownarea .CodeMirror {
padding: 10px;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
/*
* Apply same `border-radius` as `uk-markdownarea-navbar`
*/
.uk-markdownarea-navbar-nav:first-child > li:first-child > a {
border-top-left-radius: 4px;
}
/*
* Sub-modifier `uk-markdownarea-navbar-flip`
*/
/* Collapse border */
.uk-markdownarea-navbar-flip .uk-markdownarea-navbar-nav > li > a {
margin-left: 0;
margin-right: -1px;
}
/* Apply same `border-radius` as `uk-markdownarea-navbar` */
.uk-markdownarea-navbar-flip .uk-markdownarea-navbar-nav:first-child > li:first-child > a {
border-top-left-radius: 0;
}
.uk-markdownarea-navbar-flip .uk-markdownarea-navbar-nav:last-child > li:last-child > a {
border-top-right-radius: 4px;
}
/*
* Sub-modifier `uk-markdownarea-fullscreen`
*/
.uk-markdownarea-fullscreen .uk-markdownarea-navbar {
border-top: none;
border-left: none;
border-right: none;
border-radius: 0;
}
.uk-markdownarea-fullscreen .uk-markdownarea-content {
border: none;
border-radius: 0;
}
.uk-markdownarea-fullscreen .uk-markdownarea-navbar-nav > li > a {
border-radius: 0 !important;
}
@@ -0,0 +1,3 @@
/*! UIkit 2.4.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
.uk-markdownarea-navbar{background:#f5f5f5;border:1px solid rgba(0,0,0,.06);border-top-left-radius:4px;border-top-right-radius:4px}.uk-markdownarea-navbar:before,.uk-markdownarea-navbar:after{content:" ";display:table}.uk-markdownarea-navbar:after{clear:both}.uk-markdownarea-navbar-nav{margin:0;padding:0;list-style:none;float:left}.uk-markdownarea-navbar-nav>li{float:left}.uk-markdownarea-navbar-nav>li>a{display:block;-moz-box-sizing:border-box;box-sizing:border-box;text-decoration:none;height:41px;padding:0 15px;line-height:40px;color:#444;font-size:11px;cursor:pointer;margin-top:-1px;margin-left:-1px;border:1px solid transparent;border-bottom-width:0;text-shadow:0 1px 0 #fff}.uk-markdownarea-navbar-nav>li:hover>a,.uk-markdownarea-navbar-nav>li>a:focus{background-color:#fafafa;color:#444;outline:0;position:relative;z-index:1;border-left-color:rgba(0,0,0,.1);border-right-color:rgba(0,0,0,.1);border-top-color:rgba(0,0,0,.1)}.uk-markdownarea-navbar-nav>li>a:active{background-color:#eee;color:#444;border-left-color:rgba(0,0,0,.1);border-right-color:rgba(0,0,0,.1);border-top-color:rgba(0,0,0,.2)}.uk-markdownarea-navbar-nav>li.uk-active>a{background-color:#fafafa;color:#444;border-left-color:rgba(0,0,0,.1);border-right-color:rgba(0,0,0,.1);border-top-color:rgba(0,0,0,.1)}.uk-markdownarea-navbar-flip{float:right}[data-mode=split] .uk-markdown-button-markdown,[data-mode=split] .uk-markdown-button-preview{display:none}.uk-markdownarea-content{border-left:1px solid #ddd;border-right:1px solid #ddd;border-bottom:1px solid #ddd;background:#fff;border-bottom-left-radius:4px;border-bottom-right-radius:4px}.uk-markdownarea-content:before,.uk-markdownarea-content:after{content:" ";display:table}.uk-markdownarea-content:after{clear:both}.uk-markdownarea-fullscreen{position:fixed;top:0;left:0;right:0;bottom:0;z-index:990}.uk-markdownarea-fullscreen .uk-markdownarea-content{position:absolute;top:41px;left:0;right:0;bottom:0}.uk-markdownarea-fullscreen .uk-icon-expand:before{content:"\f066"}.uk-markdownarea-code,.uk-markdownarea-preview{-moz-box-sizing:border-box;box-sizing:border-box}.uk-markdownarea-preview{padding:20px;overflow-y:scroll}[data-mode=tab][data-active-tab=code] .uk-markdownarea-preview,[data-mode=tab][data-active-tab=preview] .uk-markdownarea-code{display:none}[data-mode=split] .uk-markdownarea-code,[data-mode=split] .uk-markdownarea-preview{float:left;width:50%}[data-mode=split] .uk-markdownarea-code{border-right:1px solid #eee}.uk-markdownarea .CodeMirror{padding:10px;-moz-box-sizing:border-box;box-sizing:border-box}.uk-markdownarea-navbar-nav:first-child>li:first-child>a{border-top-left-radius:4px}.uk-markdownarea-navbar-flip .uk-markdownarea-navbar-nav>li>a{margin-left:0;margin-right:-1px}.uk-markdownarea-navbar-flip .uk-markdownarea-navbar-nav:first-child>li:first-child>a{border-top-left-radius:0}.uk-markdownarea-navbar-flip .uk-markdownarea-navbar-nav:last-child>li:last-child>a{border-top-right-radius:4px}.uk-markdownarea-fullscreen .uk-markdownarea-navbar{border-top:0;border-left:0;border-right:0;border-radius:0}.uk-markdownarea-fullscreen .uk-markdownarea-content{border:0;border-radius:0}.uk-markdownarea-fullscreen .uk-markdownarea-navbar-nav>li>a{border-radius:0!important}
@@ -0,0 +1,158 @@
/*! UIkit 2.4.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
/* ========================================================================
Addon: Markdownarea
========================================================================== */
/* Sub-object `uk-markdownarea-navbar`
========================================================================== */
.uk-markdownarea-navbar {
background: #eeeeee;
}
/*
* Micro clearfix
*/
.uk-markdownarea-navbar:before,
.uk-markdownarea-navbar:after {
content: " ";
display: table;
}
.uk-markdownarea-navbar:after {
clear: both;
}
/* Sub-object `uk-markdownarea-navbar-nav`
========================================================================== */
.uk-markdownarea-navbar-nav {
margin: 0;
padding: 0;
list-style: none;
float: left;
}
.uk-markdownarea-navbar-nav > li {
float: left;
}
/*
* 1. Dimensions
* 2. Style
*/
.uk-markdownarea-navbar-nav > li > a {
display: block;
-moz-box-sizing: border-box;
box-sizing: border-box;
text-decoration: none;
/* 1 */
height: 40px;
padding: 0 15px;
line-height: 40px;
/* 2 */
color: #444444;
font-size: 11px;
cursor: pointer;
}
/*
* Hover
* 1. Apply hover style also to focus state
* 2. Remove default focus style
*/
.uk-markdownarea-navbar-nav > li:hover > a,
.uk-markdownarea-navbar-nav > li > a:focus {
background-color: #f5f5f5;
color: #444444;
outline: none;
/* 2 */
}
/* OnClick */
.uk-markdownarea-navbar-nav > li > a:active {
background-color: #dddddd;
color: #444444;
}
/* Active */
.uk-markdownarea-navbar-nav > li.uk-active > a {
background-color: #f5f5f5;
color: #444444;
}
/* Sub-object: `uk-markdownarea-navbar-flip`
========================================================================== */
.uk-markdownarea-navbar-flip {
float: right;
}
/* Sub-object for special buttons
========================================================================== */
[data-mode='split'] .uk-markdown-button-markdown,
[data-mode='split'] .uk-markdown-button-preview {
display: none;
}
/* Sub-object `uk-markdownarea-content`
========================================================================== */
.uk-markdownarea-content {
border-left: 1px solid #dddddd;
border-right: 1px solid #dddddd;
border-bottom: 1px solid #dddddd;
background: #ffffff;
}
/*
* Micro clearfix
*/
.uk-markdownarea-content:before,
.uk-markdownarea-content:after {
content: " ";
display: table;
}
.uk-markdownarea-content:after {
clear: both;
}
/* Modifier `uk-markdownarea-fullscreen`
========================================================================== */
.uk-markdownarea-fullscreen {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 990;
}
.uk-markdownarea-fullscreen .uk-markdownarea-content {
position: absolute;
top: 40px;
left: 0;
right: 0;
bottom: 0;
}
.uk-markdownarea-fullscreen .uk-icon-expand:before {
content: "\f066";
}
/* Sub-objects `uk-markdownarea-code` and `uk-markdownarea-preview`
========================================================================== */
.uk-markdownarea-code,
.uk-markdownarea-preview {
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.uk-markdownarea-preview {
padding: 20px;
overflow-y: scroll;
}
/*
* Tab view
*/
[data-mode='tab'][data-active-tab='code'] .uk-markdownarea-preview,
[data-mode='tab'][data-active-tab='preview'] .uk-markdownarea-code {
display: none;
}
/*
* Split view
*/
[data-mode='split'] .uk-markdownarea-code,
[data-mode='split'] .uk-markdownarea-preview {
float: left;
width: 50%;
}
[data-mode='split'] .uk-markdownarea-code {
border-right: 1px solid #eeeeee;
}
/* CodeMirror modifications
========================================================================== */
.uk-markdownarea .CodeMirror {
padding: 10px;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
@@ -0,0 +1,223 @@
/*! UIkit 2.4.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
/* ========================================================================
Addon: Markdownarea
========================================================================== */
/* Sub-object `uk-markdownarea-navbar`
========================================================================== */
.uk-markdownarea-navbar {
background: #f7f7f7;
border: 1px solid rgba(0, 0, 0, 0.1);
border-bottom-color: rgba(0, 0, 0, 0.2);
border-top-left-radius: 4px;
border-top-right-radius: 4px;
background-origin: border-box;
background-image: -webkit-linear-gradient(top, #ffffff, #eeeeee);
background-image: linear-gradient(to bottom, #ffffff, #eeeeee);
}
/*
* Micro clearfix
*/
.uk-markdownarea-navbar:before,
.uk-markdownarea-navbar:after {
content: " ";
display: table;
}
.uk-markdownarea-navbar:after {
clear: both;
}
/* Sub-object `uk-markdownarea-navbar-nav`
========================================================================== */
.uk-markdownarea-navbar-nav {
margin: 0;
padding: 0;
list-style: none;
float: left;
}
.uk-markdownarea-navbar-nav > li {
float: left;
}
/*
* 1. Dimensions
* 2. Style
*/
.uk-markdownarea-navbar-nav > li > a {
display: block;
-moz-box-sizing: border-box;
box-sizing: border-box;
text-decoration: none;
/* 1 */
height: 41px;
padding: 0 15px;
line-height: 40px;
/* 2 */
color: #444444;
font-size: 11px;
cursor: pointer;
margin-top: -1px;
margin-left: -1px;
border: 1px solid transparent;
border-bottom-width: 0;
text-shadow: 0 1px 0 #ffffff;
}
/*
* Hover
* 1. Apply hover style also to focus state
* 2. Remove default focus style
*/
.uk-markdownarea-navbar-nav > li:hover > a,
.uk-markdownarea-navbar-nav > li > a:focus {
background-color: transparent;
color: #444444;
outline: none;
/* 2 */
position: relative;
z-index: 1;
border-left-color: rgba(0, 0, 0, 0.1);
border-right-color: rgba(0, 0, 0, 0.1);
border-top-color: rgba(0, 0, 0, 0.1);
box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}
/* OnClick */
.uk-markdownarea-navbar-nav > li > a:active {
background-color: #f5f5f5;
color: #444444;
border-left-color: rgba(0, 0, 0, 0.1);
border-right-color: rgba(0, 0, 0, 0.1);
border-top-color: rgba(0, 0, 0, 0.2);
box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}
/* Active */
.uk-markdownarea-navbar-nav > li.uk-active > a {
background-color: #fafafa;
color: #444444;
border-left-color: rgba(0, 0, 0, 0.1);
border-right-color: rgba(0, 0, 0, 0.1);
border-top-color: rgba(0, 0, 0, 0.2);
box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}
/* Sub-object: `uk-markdownarea-navbar-flip`
========================================================================== */
.uk-markdownarea-navbar-flip {
float: right;
}
/* Sub-object for special buttons
========================================================================== */
[data-mode='split'] .uk-markdown-button-markdown,
[data-mode='split'] .uk-markdown-button-preview {
display: none;
}
/* Sub-object `uk-markdownarea-content`
========================================================================== */
.uk-markdownarea-content {
border-left: 1px solid #dddddd;
border-right: 1px solid #dddddd;
border-bottom: 1px solid #dddddd;
background: #ffffff;
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
}
/*
* Micro clearfix
*/
.uk-markdownarea-content:before,
.uk-markdownarea-content:after {
content: " ";
display: table;
}
.uk-markdownarea-content:after {
clear: both;
}
/* Modifier `uk-markdownarea-fullscreen`
========================================================================== */
.uk-markdownarea-fullscreen {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 990;
}
.uk-markdownarea-fullscreen .uk-markdownarea-content {
position: absolute;
top: 41px;
left: 0;
right: 0;
bottom: 0;
}
.uk-markdownarea-fullscreen .uk-icon-expand:before {
content: "\f066";
}
/* Sub-objects `uk-markdownarea-code` and `uk-markdownarea-preview`
========================================================================== */
.uk-markdownarea-code,
.uk-markdownarea-preview {
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.uk-markdownarea-preview {
padding: 20px;
overflow-y: scroll;
}
/*
* Tab view
*/
[data-mode='tab'][data-active-tab='code'] .uk-markdownarea-preview,
[data-mode='tab'][data-active-tab='preview'] .uk-markdownarea-code {
display: none;
}
/*
* Split view
*/
[data-mode='split'] .uk-markdownarea-code,
[data-mode='split'] .uk-markdownarea-preview {
float: left;
width: 50%;
}
[data-mode='split'] .uk-markdownarea-code {
border-right: 1px solid #eeeeee;
}
/* CodeMirror modifications
========================================================================== */
.uk-markdownarea .CodeMirror {
padding: 10px;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
/*
* Apply same `border-radius` as `uk-markdownarea-navbar`
*/
.uk-markdownarea-navbar-nav:first-child > li:first-child > a {
border-top-left-radius: 4px;
}
/*
* Sub-modifier `uk-markdownarea-navbar-flip`
*/
/* Collapse border */
.uk-markdownarea-navbar-flip .uk-markdownarea-navbar-nav > li > a {
margin-left: 0;
margin-right: -1px;
}
/* Apply same `border-radius` as `uk-markdownarea-navbar` */
.uk-markdownarea-navbar-flip .uk-markdownarea-navbar-nav:first-child > li:first-child > a {
border-top-left-radius: 0;
}
.uk-markdownarea-navbar-flip .uk-markdownarea-navbar-nav:last-child > li:last-child > a {
border-top-right-radius: 4px;
}
/*
* Sub-modifier `uk-markdownarea-fullscreen`
*/
.uk-markdownarea-fullscreen .uk-markdownarea-navbar {
border-top: none;
border-left: none;
border-right: none;
border-radius: 0;
}
.uk-markdownarea-fullscreen .uk-markdownarea-content {
border: none;
border-radius: 0;
}
.uk-markdownarea-fullscreen .uk-markdownarea-navbar-nav > li > a {
border-radius: 0 !important;
}
@@ -0,0 +1,3 @@
/*! UIkit 2.4.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
.uk-markdownarea-navbar{background:#f7f7f7;border:1px solid rgba(0,0,0,.1);border-bottom-color:rgba(0,0,0,.2);border-top-left-radius:4px;border-top-right-radius:4px;background-origin:border-box;background-image:-webkit-linear-gradient(top,#fff,#eee);background-image:linear-gradient(to bottom,#fff,#eee)}.uk-markdownarea-navbar:before,.uk-markdownarea-navbar:after{content:" ";display:table}.uk-markdownarea-navbar:after{clear:both}.uk-markdownarea-navbar-nav{margin:0;padding:0;list-style:none;float:left}.uk-markdownarea-navbar-nav>li{float:left}.uk-markdownarea-navbar-nav>li>a{display:block;-moz-box-sizing:border-box;box-sizing:border-box;text-decoration:none;height:41px;padding:0 15px;line-height:40px;color:#444;font-size:11px;cursor:pointer;margin-top:-1px;margin-left:-1px;border:1px solid transparent;border-bottom-width:0;text-shadow:0 1px 0 #fff}.uk-markdownarea-navbar-nav>li:hover>a,.uk-markdownarea-navbar-nav>li>a:focus{background-color:transparent;color:#444;outline:0;position:relative;z-index:1;border-left-color:rgba(0,0,0,.1);border-right-color:rgba(0,0,0,.1);border-top-color:rgba(0,0,0,.1);box-shadow:inset 0 2px 4px rgba(0,0,0,.1)}.uk-markdownarea-navbar-nav>li>a:active{background-color:#f5f5f5;color:#444;border-left-color:rgba(0,0,0,.1);border-right-color:rgba(0,0,0,.1);border-top-color:rgba(0,0,0,.2);box-shadow:inset 0 2px 4px rgba(0,0,0,.1)}.uk-markdownarea-navbar-nav>li.uk-active>a{background-color:#fafafa;color:#444;border-left-color:rgba(0,0,0,.1);border-right-color:rgba(0,0,0,.1);border-top-color:rgba(0,0,0,.2);box-shadow:inset 0 2px 4px rgba(0,0,0,.1)}.uk-markdownarea-navbar-flip{float:right}[data-mode=split] .uk-markdown-button-markdown,[data-mode=split] .uk-markdown-button-preview{display:none}.uk-markdownarea-content{border-left:1px solid #ddd;border-right:1px solid #ddd;border-bottom:1px solid #ddd;background:#fff;border-bottom-left-radius:4px;border-bottom-right-radius:4px}.uk-markdownarea-content:before,.uk-markdownarea-content:after{content:" ";display:table}.uk-markdownarea-content:after{clear:both}.uk-markdownarea-fullscreen{position:fixed;top:0;left:0;right:0;bottom:0;z-index:990}.uk-markdownarea-fullscreen .uk-markdownarea-content{position:absolute;top:41px;left:0;right:0;bottom:0}.uk-markdownarea-fullscreen .uk-icon-expand:before{content:"\f066"}.uk-markdownarea-code,.uk-markdownarea-preview{-moz-box-sizing:border-box;box-sizing:border-box}.uk-markdownarea-preview{padding:20px;overflow-y:scroll}[data-mode=tab][data-active-tab=code] .uk-markdownarea-preview,[data-mode=tab][data-active-tab=preview] .uk-markdownarea-code{display:none}[data-mode=split] .uk-markdownarea-code,[data-mode=split] .uk-markdownarea-preview{float:left;width:50%}[data-mode=split] .uk-markdownarea-code{border-right:1px solid #eee}.uk-markdownarea .CodeMirror{padding:10px;-moz-box-sizing:border-box;box-sizing:border-box}.uk-markdownarea-navbar-nav:first-child>li:first-child>a{border-top-left-radius:4px}.uk-markdownarea-navbar-flip .uk-markdownarea-navbar-nav>li>a{margin-left:0;margin-right:-1px}.uk-markdownarea-navbar-flip .uk-markdownarea-navbar-nav:first-child>li:first-child>a{border-top-left-radius:0}.uk-markdownarea-navbar-flip .uk-markdownarea-navbar-nav:last-child>li:last-child>a{border-top-right-radius:4px}.uk-markdownarea-fullscreen .uk-markdownarea-navbar{border-top:0;border-left:0;border-right:0;border-radius:0}.uk-markdownarea-fullscreen .uk-markdownarea-content{border:0;border-radius:0}.uk-markdownarea-fullscreen .uk-markdownarea-navbar-nav>li>a{border-radius:0!important}
@@ -0,0 +1,415 @@
/*! UIkit 2.4.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
(function(addon) {
if (typeof define == "function" && define.amd) { // AMD
define("uikit-markdownarea", ["uikit"], function(){
return jQuery.UIkit.markdownarea ? jQuery.UIkit.markdownarea : addon(window, window.jQuery, window.jQuery.UIkit);
});
}
if(window && window.jQuery && window.jQuery.UIkit) {
addon(window, window.jQuery, window.jQuery.UIkit);
}
})(function(global, $, UI){
var Markdownarea = function(element, options){
var $element = $(element);
if($element.data("markdownarea")) return;
this.element = $element;
this.options = $.extend({}, Markdownarea.defaults, options);
this.marked = this.options.marked || marked;
this.CodeMirror = this.options.CodeMirror || CodeMirror;
this.marked.setOptions({
gfm: true,
tables: true,
breaks: true,
pedantic: false,
sanitize: false,
smartLists: true,
smartypants: false,
langPrefix: 'lang-'
});
this.init();
this.element.data("markdownarea", this);
};
$.extend(Markdownarea.prototype, {
init: function(){
var $this = this, tpl = Markdownarea.template;
tpl = tpl.replace(/\{\:lblPreview\}/g, this.options.lblPreview);
tpl = tpl.replace(/\{\:lblCodeview\}/g, this.options.lblCodeview);
this.markdownarea = $(tpl);
this.content = this.markdownarea.find(".uk-markdownarea-content");
this.toolbar = this.markdownarea.find(".uk-markdownarea-toolbar");
this.preview = this.markdownarea.find(".uk-markdownarea-preview").children().eq(0);
this.code = this.markdownarea.find(".uk-markdownarea-code");
this.element.before(this.markdownarea).appendTo(this.code);
this.editor = this.CodeMirror.fromTextArea(this.element[0], this.options.codemirror);
this.editor.markdownarea = this;
this.editor.on("change", (function(){
var render = function(){
var value = $this.editor.getValue();
$this.currentvalue = String(value);
$this.element.trigger("markdownarea-before", [$this]);
$this.applyPlugins();
$this.marked($this.currentvalue, function (err, markdown) {
if (err) throw err;
$this.preview.html(markdown);
$this.element.val($this.currentvalue).trigger("markdownarea-update", [$this]);
});
};
render();
return UI.Utils.debounce(render, 150);
})());
this.code.find(".CodeMirror").css("height", this.options.height);
this._buildtoolbar();
this.fit();
$(window).on("resize", UI.Utils.debounce(function(){
$this.fit();
}, 200));
var previewContainer = $this.preview.parent(),
codeContent = this.code.find('.CodeMirror-sizer'),
codeScroll = this.code.find('.CodeMirror-scroll').on('scroll',UI.Utils.debounce(function() {
if($this.markdownarea.attr("data-mode")=="tab") return;
// calc position
var codeHeight = codeContent.height() - codeScroll.height(),
previewHeight = previewContainer[0].scrollHeight - previewContainer.height(),
ratio = previewHeight / codeHeight,
previewPostition = codeScroll.scrollTop() * ratio;
// apply new scroll
previewContainer.scrollTop(previewPostition);
}, 10));
this.markdownarea.on("click", ".uk-markdown-button-markdown, .uk-markdown-button-preview", function(e){
e.preventDefault();
if($this.markdownarea.attr("data-mode")=="tab") {
$this.markdownarea.find(".uk-markdown-button-markdown, .uk-markdown-button-preview").removeClass("uk-active").filter(this).addClass("uk-active");
$this.activetab = $(this).hasClass("uk-markdown-button-markdown") ? "code":"preview";
$this.markdownarea.attr("data-active-tab", $this.activetab);
}
});
this.preview.parent().css("height", this.code.height());
},
applyPlugins: function(){
var $this = this,
plugins = Object.keys(Markdownarea.plugins),
plgs = Markdownarea.plugins;
this.markers = {};
if(plugins.length) {
var lines = this.currentvalue.split("\n");
plugins.forEach(function(name){
this.markers[name] = [];
}, this);
for(var line=0,max=lines.length;line<max;line++) {
(function(line){
plugins.forEach(function(name){
var i = 0;
lines[line] = lines[line].replace(plgs[name].identifier, function(){
var replacement = plgs[name].cb({
"area" : $this,
"found": arguments,
"line" : line,
"pos" : i++,
"uid" : [name, line, i, (new Date().getTime())+"RAND"+(Math.ceil(Math.random() *100000))].join('-'),
"replace": function(strwith){
var src = this.area.editor.getLine(this.line),
start = src.indexOf(this.found[0]);
end = this.found[0].length;
this.area.editor.replaceRange(strwith, {"line": this.line, "ch":start}, {"line": this.line, "ch":end} );
}
});
return replacement;
});
});
})(line);
}
this.currentvalue = lines.join("\n");
}
},
_buildtoolbar: function(){
if(!(this.options.toolbar && this.options.toolbar.length)) return;
var $this = this, bar = [];
this.options.toolbar.forEach(function(cmd){
if(Markdownarea.commands[cmd]) {
var title = Markdownarea.commands[cmd].title ? Markdownarea.commands[cmd].title : cmd;
bar.push('<li><a data-markdownarea-cmd="'+cmd+'" title="'+title+'" data-uk-tooltip>'+Markdownarea.commands[cmd].label+'</a></li>');
if(Markdownarea.commands[cmd].shortcut) {
$this.registerShortcut(Markdownarea.commands[cmd].shortcut, Markdownarea.commands[cmd].action);
}
}
});
this.toolbar.html(bar.join("\n"));
this.markdownarea.on("click", "a[data-markdownarea-cmd]", function(){
var cmd = $(this).data("markdownareaCmd");
if(cmd && Markdownarea.commands[cmd] && (!$this.activetab || $this.activetab=="code" || cmd=="fullscreen")) {
Markdownarea.commands[cmd].action.apply($this, [$this.editor])
}
});
},
fit: function() {
var mode = this.options.mode;
if(mode=="split" && this.markdownarea.width() < this.options.maxsplitsize) {
mode = "tab";
}
if(mode=="tab") {
if(!this.activetab) {
this.activetab = "code";
this.markdownarea.attr("data-active-tab", this.activetab);
}
this.markdownarea.find(".uk-markdown-button-markdown, .uk-markdown-button-preview").removeClass("uk-active")
.filter(this.activetab=="code" ? '.uk-markdown-button-markdown':'.uk-markdown-button-preview').addClass("uk-active");
}
this.editor.refresh();
this.preview.parent().css("height", this.code.height());
this.markdownarea.attr("data-mode", mode);
},
registerShortcut: function(combination, callback){
var $this = this;
combination = $.isArray(combination) ? combination : [combination];
for(var i=0,max=combination.length;i < max;i++) {
var map = {};
map[combination[i]] = function(){
callback.apply($this, [$this.editor]);
};
$this.editor.addKeyMap(map);
}
}
});
//jQuery plugin
$.fn.markdownarea = function(options){
return this.each(function(){
var ele = $(this);
if(!ele.data("markdownarea")) {
var obj = new Markdownarea(ele, options);
}
});
};
var baseReplacer = function(replace, editor){
var text = editor.getSelection(),
markdown = replace.replace('$1', text);
editor.replaceSelection(markdown, 'end');
};
Markdownarea.commands = {
"fullscreen": {
"title" : 'Fullscreen',
"label" : '<i class="uk-icon-expand"></i>',
"action" : function(editor){
editor.markdownarea.markdownarea.toggleClass("uk-markdownarea-fullscreen");
var wrap = editor.getWrapperElement();
if(editor.markdownarea.markdownarea.hasClass("uk-markdownarea-fullscreen")) {
editor.state.fullScreenRestore = {scrollTop: window.pageYOffset, scrollLeft: window.pageXOffset, width: wrap.style.width, height: wrap.style.height};
wrap.style.width = "";
wrap.style.height = editor.markdownarea.content.height()+"px";
document.documentElement.style.overflow = "hidden";
} else {
document.documentElement.style.overflow = "";
var info = editor.state.fullScreenRestore;
wrap.style.width = info.width; wrap.style.height = info.height;
window.scrollTo(info.scrollLeft, info.scrollTop);
}
editor.refresh();
editor.markdownarea.preview.parent().css("height", editor.markdownarea.code.height());
}
},
"bold" : {
"title" : "Bold",
"label" : '<i class="uk-icon-bold"></i>',
"shortcut": ['Ctrl-B', 'Cmd-B'],
"action" : function(editor){
baseReplacer("**$1**", editor);
}
},
"italic" : {
"title" : "Italic",
"label" : '<i class="uk-icon-italic"></i>',
"action" : function(editor){
baseReplacer("*$1*", editor);
}
},
"strike" : {
"title" : "Strikethrough",
"label" : '<i class="uk-icon-strikethrough"></i>',
"action" : function(editor){
baseReplacer("~~$1~~", editor);
}
},
"blockquote" : {
"title" : "Blockquote",
"label" : '<i class="uk-icon-quote-right"></i>',
"action" : function(editor){
baseReplacer("> $1", editor);
}
},
"link" : {
"title" : "Link",
"label" : '<i class="uk-icon-link"></i>',
"action" : function(editor){
baseReplacer("[$1](http://)", editor);
}
},
"picture" : {
"title" : "Picture",
"label" : '<i class="uk-icon-picture-o"></i>',
"action" : function(editor){
baseReplacer("![$1](http://)", editor);
}
},
"listUl" : {
"title" : "Unordered List",
"label" : '<i class="uk-icon-list-ul"></i>',
"action" : function(editor){
baseReplacer("* $1", editor);
}
},
"listOl" : {
"title" : "Ordered List",
"label" : '<i class="uk-icon-list-ol"></i>',
"action" : function(editor){
baseReplacer("1. $1", editor);
}
}
}
Markdownarea.defaults = {
"mode" : "split",
"height" : 500,
"maxsplitsize" : 1000,
"codemirror" : { mode: 'gfm', tabMode: 'indent', tabindex: "2", lineWrapping: true, dragDrop: false },
"toolbar" : [ "bold", "italic", "strike", "link", "picture", "blockquote", "listUl", "listOl" ],
"lblPreview" : "Preview",
"lblCodeview" : "Markdown"
};
Markdownarea.template = '<div class="uk-markdownarea uk-clearfix" data-mode="split">' +
'<div class="uk-markdownarea-navbar">' +
'<ul class="uk-markdownarea-navbar-nav uk-markdownarea-toolbar"></ul>' +
'<div class="uk-markdownarea-navbar-flip">' +
'<ul class="uk-markdownarea-navbar-nav">' +
'<li class="uk-markdown-button-markdown"><a>{:lblCodeview}</a></li>' +
'<li class="uk-markdown-button-preview"><a>{:lblPreview}</a></li>' +
'<li><a data-markdownarea-cmd="fullscreen"><i class="uk-icon-expand"></i></a></li>' +
'</ul>' +
'</div>' +
'</div>' +
'<div class="uk-markdownarea-content">' +
'<div class="uk-markdownarea-code"></div>' +
'<div class="uk-markdownarea-preview"><div></div></div>' +
'</div>' +
'</div>';
Markdownarea.plugins = {};
Markdownarea.addPlugin = function(name, identifier, callback) {
Markdownarea.plugins[name] = {"identifier":identifier, "cb":callback};
};
UI["markdownarea"] = Markdownarea;
// init code
$(function() {
$("textarea[data-uk-markdownarea]").each(function() {
var area = $(this), obj;
if (!area.data("markdownarea")) {
obj = new Markdownarea(area, UI.Utils.options(area.attr("data-uk-markdownarea")));
}
});
});
return Markdownarea;
});
@@ -0,0 +1,3 @@
/*! UIkit 2.4.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
.uk-markdownarea-navbar{background:#eee}.uk-markdownarea-navbar:before,.uk-markdownarea-navbar:after{content:" ";display:table}.uk-markdownarea-navbar:after{clear:both}.uk-markdownarea-navbar-nav{margin:0;padding:0;list-style:none;float:left}.uk-markdownarea-navbar-nav>li{float:left}.uk-markdownarea-navbar-nav>li>a{display:block;-moz-box-sizing:border-box;box-sizing:border-box;text-decoration:none;height:40px;padding:0 15px;line-height:40px;color:#444;font-size:11px;cursor:pointer}.uk-markdownarea-navbar-nav>li:hover>a,.uk-markdownarea-navbar-nav>li>a:focus{background-color:#f5f5f5;color:#444;outline:0}.uk-markdownarea-navbar-nav>li>a:active{background-color:#ddd;color:#444}.uk-markdownarea-navbar-nav>li.uk-active>a{background-color:#f5f5f5;color:#444}.uk-markdownarea-navbar-flip{float:right}[data-mode=split] .uk-markdown-button-markdown,[data-mode=split] .uk-markdown-button-preview{display:none}.uk-markdownarea-content{border-left:1px solid #ddd;border-right:1px solid #ddd;border-bottom:1px solid #ddd;background:#fff}.uk-markdownarea-content:before,.uk-markdownarea-content:after{content:" ";display:table}.uk-markdownarea-content:after{clear:both}.uk-markdownarea-fullscreen{position:fixed;top:0;left:0;right:0;bottom:0;z-index:990}.uk-markdownarea-fullscreen .uk-markdownarea-content{position:absolute;top:40px;left:0;right:0;bottom:0}.uk-markdownarea-fullscreen .uk-icon-expand:before{content:"\f066"}.uk-markdownarea-code,.uk-markdownarea-preview{-moz-box-sizing:border-box;box-sizing:border-box}.uk-markdownarea-preview{padding:20px;overflow-y:scroll}[data-mode=tab][data-active-tab=code] .uk-markdownarea-preview,[data-mode=tab][data-active-tab=preview] .uk-markdownarea-code{display:none}[data-mode=split] .uk-markdownarea-code,[data-mode=split] .uk-markdownarea-preview{float:left;width:50%}[data-mode=split] .uk-markdownarea-code{border-right:1px solid #eee}.uk-markdownarea .CodeMirror{padding:10px;-moz-box-sizing:border-box;box-sizing:border-box}
File diff suppressed because one or more lines are too long
@@ -0,0 +1,100 @@
/*! UIkit 2.4.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
/* ========================================================================
Addon: Notify
========================================================================== */
/*
* Message container for positioning
*/
.uk-notify {
position: fixed;
top: 10px;
left: 10px;
z-index: 1040;
-moz-box-sizing: border-box;
box-sizing: border-box;
width: 350px;
}
/* Position modifiers
========================================================================== */
.uk-notify-top-right,
.uk-notify-bottom-right {
left: auto;
right: 10px;
}
.uk-notify-top-center,
.uk-notify-bottom-center {
left: 50%;
margin-left: -175px;
}
.uk-notify-bottom-left,
.uk-notify-bottom-right,
.uk-notify-bottom-center {
top: auto;
bottom: 10px;
}
/* Responsiveness
========================================================================== */
/* Phones portrait and smaller */
@media (max-width: 479px) {
/*
* Fit in small screen
*/
.uk-notify {
left: 10px;
right: 10px;
width: auto;
margin: 0;
}
}
/* Sub-object: `uk-notify-message`
========================================================================== */
.uk-notify-message {
position: relative;
margin-bottom: 10px;
padding: 15px;
background: #444444;
color: #ffffff;
font-size: 16px;
line-height: 22px;
cursor: pointer;
border: 1px solid #444444;
border-radius: 4px;
}
/* Close in notify
========================================================================== */
.uk-notify-message > .uk-close {
visibility: hidden;
float: right;
}
.uk-notify-message:hover > .uk-close {
visibility: visible;
}
/* Modifier: `uk-alert-info`
========================================================================== */
.uk-notify-message-primary {
background: #ebf7fd;
color: #2d7091;
border-color: rgba(45, 112, 145, 0.3);
}
/* Modifier: `uk-alert-success`
========================================================================== */
.uk-notify-message-success {
background: #f2fae3;
color: #659f13;
border-color: rgba(101, 159, 19, 0.3);
}
/* Modifier: `uk-notify-message-warning`
========================================================================== */
.uk-notify-message-warning {
background: #fffceb;
color: #e28327;
border-color: rgba(226, 131, 39, 0.3);
}
/* Modifier: `uk-notify-message-danger`
========================================================================== */
.uk-notify-message-danger {
background: #fff1f0;
color: #d85030;
border-color: rgba(216, 80, 48, 0.3);
}
@@ -0,0 +1,3 @@
/*! UIkit 2.4.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
.uk-notify{position:fixed;top:10px;left:10px;z-index:1040;-moz-box-sizing:border-box;box-sizing:border-box;width:350px}.uk-notify-top-right,.uk-notify-bottom-right{left:auto;right:10px}.uk-notify-top-center,.uk-notify-bottom-center{left:50%;margin-left:-175px}.uk-notify-bottom-left,.uk-notify-bottom-right,.uk-notify-bottom-center{top:auto;bottom:10px}@media (max-width:479px){.uk-notify{left:10px;right:10px;width:auto;margin:0}}.uk-notify-message{position:relative;margin-bottom:10px;padding:15px;background:#444;color:#fff;font-size:16px;line-height:22px;cursor:pointer;border:1px solid #444;border-radius:4px}.uk-notify-message>.uk-close{visibility:hidden;float:right}.uk-notify-message:hover>.uk-close{visibility:visible}.uk-notify-message-primary{background:#ebf7fd;color:#2d7091;border-color:rgba(45,112,145,.3)}.uk-notify-message-success{background:#f2fae3;color:#659f13;border-color:rgba(101,159,19,.3)}.uk-notify-message-warning{background:#fffceb;color:#e28327;border-color:rgba(226,131,39,.3)}.uk-notify-message-danger{background:#fff1f0;color:#d85030;border-color:rgba(216,80,48,.3)}
@@ -0,0 +1,94 @@
/*! UIkit 2.4.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
/* ========================================================================
Addon: Notify
========================================================================== */
/*
* Message container for positioning
*/
.uk-notify {
position: fixed;
top: 10px;
left: 10px;
z-index: 1040;
-moz-box-sizing: border-box;
box-sizing: border-box;
width: 350px;
}
/* Position modifiers
========================================================================== */
.uk-notify-top-right,
.uk-notify-bottom-right {
left: auto;
right: 10px;
}
.uk-notify-top-center,
.uk-notify-bottom-center {
left: 50%;
margin-left: -175px;
}
.uk-notify-bottom-left,
.uk-notify-bottom-right,
.uk-notify-bottom-center {
top: auto;
bottom: 10px;
}
/* Responsiveness
========================================================================== */
/* Phones portrait and smaller */
@media (max-width: 479px) {
/*
* Fit in small screen
*/
.uk-notify {
left: 10px;
right: 10px;
width: auto;
margin: 0;
}
}
/* Sub-object: `uk-notify-message`
========================================================================== */
.uk-notify-message {
position: relative;
margin-bottom: 10px;
padding: 15px;
background: #444444;
color: #ffffff;
font-size: 16px;
line-height: 22px;
cursor: pointer;
}
/* Close in notify
========================================================================== */
.uk-notify-message > .uk-close {
visibility: hidden;
float: right;
}
.uk-notify-message:hover > .uk-close {
visibility: visible;
}
/* Modifier: `uk-alert-info`
========================================================================== */
.uk-notify-message-primary {
background: #ebf7fd;
color: #2d7091;
}
/* Modifier: `uk-alert-success`
========================================================================== */
.uk-notify-message-success {
background: #f2fae3;
color: #659f13;
}
/* Modifier: `uk-notify-message-warning`
========================================================================== */
.uk-notify-message-warning {
background: #fffceb;
color: #e28327;
}
/* Modifier: `uk-notify-message-danger`
========================================================================== */
.uk-notify-message-danger {
background: #fff1f0;
color: #d85030;
}
@@ -0,0 +1,100 @@
/*! UIkit 2.4.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
/* ========================================================================
Addon: Notify
========================================================================== */
/*
* Message container for positioning
*/
.uk-notify {
position: fixed;
top: 10px;
left: 10px;
z-index: 1040;
-moz-box-sizing: border-box;
box-sizing: border-box;
width: 350px;
}
/* Position modifiers
========================================================================== */
.uk-notify-top-right,
.uk-notify-bottom-right {
left: auto;
right: 10px;
}
.uk-notify-top-center,
.uk-notify-bottom-center {
left: 50%;
margin-left: -175px;
}
.uk-notify-bottom-left,
.uk-notify-bottom-right,
.uk-notify-bottom-center {
top: auto;
bottom: 10px;
}
/* Responsiveness
========================================================================== */
/* Phones portrait and smaller */
@media (max-width: 479px) {
/*
* Fit in small screen
*/
.uk-notify {
left: 10px;
right: 10px;
width: auto;
margin: 0;
}
}
/* Sub-object: `uk-notify-message`
========================================================================== */
.uk-notify-message {
position: relative;
margin-bottom: 10px;
padding: 15px;
background: #444444;
color: #ffffff;
font-size: 16px;
line-height: 22px;
cursor: pointer;
border: 1px solid #444444;
border-radius: 4px;
}
/* Close in notify
========================================================================== */
.uk-notify-message > .uk-close {
visibility: hidden;
float: right;
}
.uk-notify-message:hover > .uk-close {
visibility: visible;
}
/* Modifier: `uk-alert-info`
========================================================================== */
.uk-notify-message-primary {
background: #ebf7fd;
color: #2d7091;
border-color: rgba(45, 112, 145, 0.3);
}
/* Modifier: `uk-alert-success`
========================================================================== */
.uk-notify-message-success {
background: #f2fae3;
color: #659f13;
border-color: rgba(101, 159, 19, 0.3);
}
/* Modifier: `uk-notify-message-warning`
========================================================================== */
.uk-notify-message-warning {
background: #fffceb;
color: #e28327;
border-color: rgba(226, 131, 39, 0.3);
}
/* Modifier: `uk-notify-message-danger`
========================================================================== */
.uk-notify-message-danger {
background: #fff1f0;
color: #d85030;
border-color: rgba(216, 80, 48, 0.3);
}
@@ -0,0 +1,3 @@
/*! UIkit 2.4.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
.uk-notify{position:fixed;top:10px;left:10px;z-index:1040;-moz-box-sizing:border-box;box-sizing:border-box;width:350px}.uk-notify-top-right,.uk-notify-bottom-right{left:auto;right:10px}.uk-notify-top-center,.uk-notify-bottom-center{left:50%;margin-left:-175px}.uk-notify-bottom-left,.uk-notify-bottom-right,.uk-notify-bottom-center{top:auto;bottom:10px}@media (max-width:479px){.uk-notify{left:10px;right:10px;width:auto;margin:0}}.uk-notify-message{position:relative;margin-bottom:10px;padding:15px;background:#444;color:#fff;font-size:16px;line-height:22px;cursor:pointer;border:1px solid #444;border-radius:4px}.uk-notify-message>.uk-close{visibility:hidden;float:right}.uk-notify-message:hover>.uk-close{visibility:visible}.uk-notify-message-primary{background:#ebf7fd;color:#2d7091;border-color:rgba(45,112,145,.3)}.uk-notify-message-success{background:#f2fae3;color:#659f13;border-color:rgba(101,159,19,.3)}.uk-notify-message-warning{background:#fffceb;color:#e28327;border-color:rgba(226,131,39,.3)}.uk-notify-message-danger{background:#fff1f0;color:#d85030;border-color:rgba(216,80,48,.3)}
@@ -0,0 +1,177 @@
/*! UIkit 2.4.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
(function(addon) {
if (typeof define == "function" && define.amd) { // AMD
define("uikit-notify", ["uikit"], function(){
return jQuery.UIkit.notify ? jQuery.UIkit.notify : addon(window, window.jQuery, window.jQuery.UIkit);
});
}
if(window && window.jQuery && window.jQuery.UIkit) {
addon(window, window.jQuery, window.jQuery.UIkit);
}
})(function(global, $, UI){
var containers = {},
messages = {},
notify = function(options){
if ($.type(options) == 'string') {
options = { message: options };
}
if (arguments[1]) {
options = $.extend(options, $.type(arguments[1]) == 'string' ? {status:arguments[1]} : arguments[1]);
}
return (new Message(options)).show();
},
closeAll = function(group, instantly){
if(group) {
for(var id in messages) { if(group===messages[id].group) messages[id].close(instantly); }
} else {
for(var id in messages) { messages[id].close(instantly); }
}
};
var Message = function(options){
var $this = this;
this.options = $.extend({}, Message.defaults, options);
this.uuid = "ID"+(new Date().getTime())+"RAND"+(Math.ceil(Math.random() * 100000));
this.element = $([
'<div class="uk-notify-message">',
'<a class="uk-close"></a>',
'<div>'+this.options.message+'</div>',
'</div>'
].join('')).data("notifyMessage", this);
// status
if (this.options.status) {
this.element.addClass('uk-notify-message-'+this.options.status);
this.currentstatus = this.options.status;
}
this.group = this.options.group;
messages[this.uuid] = this;
if(!containers[this.options.pos]) {
containers[this.options.pos] = $('<div class="uk-notify uk-notify-'+this.options.pos+'"></div>').appendTo('body').on("click", ".uk-notify-message", function(){
$(this).data("notifyMessage").close();
});
}
};
$.extend(Message.prototype, {
uuid: false,
element: false,
timout: false,
currentstatus: "",
group: false,
show: function() {
if (this.element.is(":visible")) return;
var $this = this;
containers[this.options.pos].show().prepend(this.element);
var marginbottom = parseInt(this.element.css("margin-bottom"), 10);
this.element.css({"opacity":0, "margin-top": -1*this.element.outerHeight(), "margin-bottom":0}).animate({"opacity":1, "margin-top": 0, "margin-bottom":marginbottom}, function(){
if ($this.options.timeout) {
var closefn = function(){ $this.close(); };
$this.timeout = setTimeout(closefn, $this.options.timeout);
$this.element.hover(
function() { clearTimeout($this.timeout); },
function() { $this.timeout = setTimeout(closefn, $this.options.timeout); }
);
}
});
return this;
},
close: function(instantly) {
var $this = this,
finalize = function(){
$this.element.remove();
if(!containers[$this.options.pos].children().length) {
containers[$this.options.pos].hide();
}
delete messages[$this.uuid];
};
if(this.timeout) clearTimeout(this.timeout);
if(instantly) {
finalize();
} else {
this.element.animate({"opacity":0, "margin-top": -1* this.element.outerHeight(), "margin-bottom":0}, function(){
finalize();
});
}
},
content: function(html){
var container = this.element.find(">div");
if(!html) {
return container.html();
}
container.html(html);
return this;
},
status: function(status) {
if(!status) {
return this.currentstatus;
}
this.element.removeClass('uk-notify-message-'+this.currentstatus).addClass('uk-notify-message-'+status);
this.currentstatus = status;
return this;
}
});
Message.defaults = {
message: "",
status: "",
timeout: 5000,
group: null,
pos: 'top-center'
};
UI["notify"] = notify;
UI["notify"].message = Message;
UI["notify"].closeAll = closeAll;
return notify;
});
+3
View File
@@ -0,0 +1,3 @@
/*! UIkit 2.4.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
.uk-notify{position:fixed;top:10px;left:10px;z-index:1040;-moz-box-sizing:border-box;box-sizing:border-box;width:350px}.uk-notify-top-right,.uk-notify-bottom-right{left:auto;right:10px}.uk-notify-top-center,.uk-notify-bottom-center{left:50%;margin-left:-175px}.uk-notify-bottom-left,.uk-notify-bottom-right,.uk-notify-bottom-center{top:auto;bottom:10px}@media (max-width:479px){.uk-notify{left:10px;right:10px;width:auto;margin:0}}.uk-notify-message{position:relative;margin-bottom:10px;padding:15px;background:#444;color:#fff;font-size:16px;line-height:22px;cursor:pointer}.uk-notify-message>.uk-close{visibility:hidden;float:right}.uk-notify-message:hover>.uk-close{visibility:visible}.uk-notify-message-primary{background:#ebf7fd;color:#2d7091}.uk-notify-message-success{background:#f2fae3;color:#659f13}.uk-notify-message-warning{background:#fffceb;color:#e28327}.uk-notify-message-danger{background:#fff1f0;color:#d85030}
+3
View File
@@ -0,0 +1,3 @@
/*! UIkit 2.4.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
(function(t){"function"==typeof define&&define.amd&&define("uikit-notify",["uikit"],function(){return jQuery.UIkit.notify?jQuery.UIkit.notify:t(window,window.jQuery,window.jQuery.UIkit)}),window&&window.jQuery&&window.jQuery.UIkit&&t(window,window.jQuery,window.jQuery.UIkit)})(function(t,e,n){var i={},s={},o=function(t){return"string"==e.type(t)&&(t={message:t}),arguments[1]&&(t=e.extend(t,"string"==e.type(arguments[1])?{status:arguments[1]}:arguments[1])),new r(t).show()},a=function(t,e){if(t)for(var n in s)t===s[n].group&&s[n].close(e);else for(var n in s)s[n].close(e)},r=function(t){this.options=e.extend({},r.defaults,t),this.uuid="ID"+(new Date).getTime()+"RAND"+Math.ceil(1e5*Math.random()),this.element=e(['<div class="uk-notify-message">','<a class="uk-close"></a>',"<div>"+this.options.message+"</div>","</div>"].join("")).data("notifyMessage",this),this.options.status&&(this.element.addClass("uk-notify-message-"+this.options.status),this.currentstatus=this.options.status),this.group=this.options.group,s[this.uuid]=this,i[this.options.pos]||(i[this.options.pos]=e('<div class="uk-notify uk-notify-'+this.options.pos+'"></div>').appendTo("body").on("click",".uk-notify-message",function(){e(this).data("notifyMessage").close()}))};return e.extend(r.prototype,{uuid:!1,element:!1,timout:!1,currentstatus:"",group:!1,show:function(){if(!this.element.is(":visible")){var t=this;i[this.options.pos].show().prepend(this.element);var e=parseInt(this.element.css("margin-bottom"),10);return this.element.css({opacity:0,"margin-top":-1*this.element.outerHeight(),"margin-bottom":0}).animate({opacity:1,"margin-top":0,"margin-bottom":e},function(){if(t.options.timeout){var e=function(){t.close()};t.timeout=setTimeout(e,t.options.timeout),t.element.hover(function(){clearTimeout(t.timeout)},function(){t.timeout=setTimeout(e,t.options.timeout)})}}),this}},close:function(t){var e=this,n=function(){e.element.remove(),i[e.options.pos].children().length||i[e.options.pos].hide(),delete s[e.uuid]};this.timeout&&clearTimeout(this.timeout),t?n():this.element.animate({opacity:0,"margin-top":-1*this.element.outerHeight(),"margin-bottom":0},function(){n()})},content:function(t){var e=this.element.find(">div");return t?(e.html(t),this):e.html()},status:function(t){return t?(this.element.removeClass("uk-notify-message-"+this.currentstatus).addClass("uk-notify-message-"+t),this.currentstatus=t,this):this.currentstatus}}),r.defaults={message:"",status:"",timeout:5e3,group:null,pos:"top-center"},n.notify=o,n.notify.message=r,n.notify.closeAll=a,o});
@@ -0,0 +1,104 @@
/*! UIkit 2.4.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
/* ========================================================================
Addon: Sortable
========================================================================== */
.uk-sortable {
padding: 0;
list-style: none;
}
/* Sub-object `uk-sortable-list`
========================================================================== */
.uk-sortable-list {
margin: 0;
padding-left: 40px;
list-style: none;
}
/* Sub-modifier `uk-sortable-list-dragged`
========================================================================== */
.uk-sortable-list-dragged {
position: absolute;
z-index: 1050;
padding-left: 0;
pointer-events: none;
}
/* Sub-object `uk-sortable-item`
========================================================================== */
.uk-sortable-item {
margin-bottom: 10px;
padding: 5px;
background: #f5f5f5;
border-radius: 4px;
border: 1px solid rgba(0, 0, 0, 0.06);
text-shadow: 0 1px 0 #ffffff;
}
/* Sub-object `uk-sortable-placeholder`
* The placeholder which marks the drop area
========================================================================== */
.uk-sortable-placeholder {
-moz-box-sizing: border-box;
box-sizing: border-box;
margin-bottom: 10px;
border: 1px dashed #dddddd;
}
/* Sub-object `uk-sortable-empty`
* The style of an empty list
========================================================================== */
.uk-sortable-empty {
min-height: 40px;
}
/* Sub-object `uk-sortable-handle`
========================================================================== */
.uk-sortable-handle {
display: inline-block;
font-size: 18px;
color: #dddddd;
}
/* Hover */
.uk-sortable-handle:hover {
cursor: move;
}
/* Icon */
.uk-sortable-handle:after {
content: "\f0c9";
font-family: FontAwesome;
}
/* Sub-object `uk-sortable-moving`
========================================================================== */
.uk-sortable-moving,
.uk-sortable-moving * {
cursor: move;
}
/* Sub-object `[data-action='toggle']`
========================================================================== */
/* Hidden by default */
[data-sortable-action='toggle'] {
display: inline-block;
color: #999999;
visibility: hidden;
}
/* Hover */
[data-sortable-action='toggle']:hover {
color: #444444;
cursor: pointer;
}
/* Icon */
[data-sortable-action='toggle']:after {
content: "\f147";
font-family: FontAwesome;
}
/*
* Show if nested
*/
.uk-parent > .uk-sortable-item [data-sortable-action='toggle'] {
visibility: visible;
}
/*
* Collapsed
*/
.uk-collapsed > .uk-sortable-item [data-sortable-action='toggle']:after {
content: "\f196";
}
.uk-collapsed .uk-sortable-list {
display: none;
}
@@ -0,0 +1,3 @@
/*! UIkit 2.4.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
.uk-sortable{padding:0;list-style:none}.uk-sortable-list{margin:0;padding-left:40px;list-style:none}.uk-sortable-list-dragged{position:absolute;z-index:1050;padding-left:0;pointer-events:none}.uk-sortable-item{margin-bottom:10px;padding:5px;background:#f5f5f5;border-radius:4px;border:1px solid rgba(0,0,0,.06);text-shadow:0 1px 0 #fff}.uk-sortable-placeholder{-moz-box-sizing:border-box;box-sizing:border-box;margin-bottom:10px;border:1px dashed #ddd}.uk-sortable-empty{min-height:40px}.uk-sortable-handle{display:inline-block;font-size:18px;color:#ddd}.uk-sortable-handle:hover{cursor:move}.uk-sortable-handle:after{content:"\f0c9";font-family:FontAwesome}.uk-sortable-moving,.uk-sortable-moving *{cursor:move}[data-sortable-action=toggle]{display:inline-block;color:#999;visibility:hidden}[data-sortable-action=toggle]:hover{color:#444;cursor:pointer}[data-sortable-action=toggle]:after{content:"\f147";font-family:FontAwesome}.uk-parent>.uk-sortable-item [data-sortable-action=toggle]{visibility:visible}.uk-collapsed>.uk-sortable-item [data-sortable-action=toggle]:after{content:"\f196"}.uk-collapsed .uk-sortable-list{display:none}
@@ -0,0 +1,101 @@
/*! UIkit 2.4.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
/* ========================================================================
Addon: Sortable
========================================================================== */
.uk-sortable {
padding: 0;
list-style: none;
}
/* Sub-object `uk-sortable-list`
========================================================================== */
.uk-sortable-list {
margin: 0;
padding-left: 40px;
list-style: none;
}
/* Sub-modifier `uk-sortable-list-dragged`
========================================================================== */
.uk-sortable-list-dragged {
position: absolute;
z-index: 1050;
padding-left: 0;
pointer-events: none;
}
/* Sub-object `uk-sortable-item`
========================================================================== */
.uk-sortable-item {
margin-bottom: 10px;
padding: 5px;
background: #f5f5f5;
}
/* Sub-object `uk-sortable-placeholder`
* The placeholder which marks the drop area
========================================================================== */
.uk-sortable-placeholder {
-moz-box-sizing: border-box;
box-sizing: border-box;
margin-bottom: 10px;
border: 1px dashed #dddddd;
}
/* Sub-object `uk-sortable-empty`
* The style of an empty list
========================================================================== */
.uk-sortable-empty {
min-height: 40px;
}
/* Sub-object `uk-sortable-handle`
========================================================================== */
.uk-sortable-handle {
display: inline-block;
font-size: 18px;
color: #dddddd;
}
/* Hover */
.uk-sortable-handle:hover {
cursor: move;
}
/* Icon */
.uk-sortable-handle:after {
content: "\f0c9";
font-family: FontAwesome;
}
/* Sub-object `uk-sortable-moving`
========================================================================== */
.uk-sortable-moving,
.uk-sortable-moving * {
cursor: move;
}
/* Sub-object `[data-action='toggle']`
========================================================================== */
/* Hidden by default */
[data-sortable-action='toggle'] {
display: inline-block;
color: #999999;
visibility: hidden;
}
/* Hover */
[data-sortable-action='toggle']:hover {
color: #444444;
cursor: pointer;
}
/* Icon */
[data-sortable-action='toggle']:after {
content: "\f147";
font-family: FontAwesome;
}
/*
* Show if nested
*/
.uk-parent > .uk-sortable-item [data-sortable-action='toggle'] {
visibility: visible;
}
/*
* Collapsed
*/
.uk-collapsed > .uk-sortable-item [data-sortable-action='toggle']:after {
content: "\f196";
}
.uk-collapsed .uk-sortable-list {
display: none;
}
@@ -0,0 +1,108 @@
/*! UIkit 2.4.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
/* ========================================================================
Addon: Sortable
========================================================================== */
.uk-sortable {
padding: 0;
list-style: none;
}
/* Sub-object `uk-sortable-list`
========================================================================== */
.uk-sortable-list {
margin: 0;
padding-left: 40px;
list-style: none;
}
/* Sub-modifier `uk-sortable-list-dragged`
========================================================================== */
.uk-sortable-list-dragged {
position: absolute;
z-index: 1050;
padding-left: 0;
pointer-events: none;
}
/* Sub-object `uk-sortable-item`
========================================================================== */
.uk-sortable-item {
margin-bottom: 10px;
padding: 5px;
background: #f7f7f7;
border-radius: 4px;
border: 1px solid rgba(0, 0, 0, 0.2);
border-bottom-color: rgba(0, 0, 0, 0.3);
background-origin: border-box;
background-image: -webkit-linear-gradient(top, #ffffff, #eeeeee);
background-image: linear-gradient(to bottom, #ffffff, #eeeeee);
text-shadow: 0 1px 0 #ffffff;
}
/* Sub-object `uk-sortable-placeholder`
* The placeholder which marks the drop area
========================================================================== */
.uk-sortable-placeholder {
-moz-box-sizing: border-box;
box-sizing: border-box;
margin-bottom: 10px;
border: 1px dashed #dddddd;
}
/* Sub-object `uk-sortable-empty`
* The style of an empty list
========================================================================== */
.uk-sortable-empty {
min-height: 40px;
}
/* Sub-object `uk-sortable-handle`
========================================================================== */
.uk-sortable-handle {
display: inline-block;
font-size: 18px;
color: #dddddd;
}
/* Hover */
.uk-sortable-handle:hover {
cursor: move;
}
/* Icon */
.uk-sortable-handle:after {
content: "\f0c9";
font-family: FontAwesome;
}
/* Sub-object `uk-sortable-moving`
========================================================================== */
.uk-sortable-moving,
.uk-sortable-moving * {
cursor: move;
}
/* Sub-object `[data-action='toggle']`
========================================================================== */
/* Hidden by default */
[data-sortable-action='toggle'] {
display: inline-block;
color: #999999;
visibility: hidden;
}
/* Hover */
[data-sortable-action='toggle']:hover {
color: #444444;
cursor: pointer;
}
/* Icon */
[data-sortable-action='toggle']:after {
content: "\f147";
font-family: FontAwesome;
}
/*
* Show if nested
*/
.uk-parent > .uk-sortable-item [data-sortable-action='toggle'] {
visibility: visible;
}
/*
* Collapsed
*/
.uk-collapsed > .uk-sortable-item [data-sortable-action='toggle']:after {
content: "\f196";
}
.uk-collapsed .uk-sortable-list {
display: none;
}
@@ -0,0 +1,3 @@
/*! UIkit 2.4.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
.uk-sortable{padding:0;list-style:none}.uk-sortable-list{margin:0;padding-left:40px;list-style:none}.uk-sortable-list-dragged{position:absolute;z-index:1050;padding-left:0;pointer-events:none}.uk-sortable-item{margin-bottom:10px;padding:5px;background:#f7f7f7;border-radius:4px;border:1px solid rgba(0,0,0,.2);border-bottom-color:rgba(0,0,0,.3);background-origin:border-box;background-image:-webkit-linear-gradient(top,#fff,#eee);background-image:linear-gradient(to bottom,#fff,#eee);text-shadow:0 1px 0 #fff}.uk-sortable-placeholder{-moz-box-sizing:border-box;box-sizing:border-box;margin-bottom:10px;border:1px dashed #ddd}.uk-sortable-empty{min-height:40px}.uk-sortable-handle{display:inline-block;font-size:18px;color:#ddd}.uk-sortable-handle:hover{cursor:move}.uk-sortable-handle:after{content:"\f0c9";font-family:FontAwesome}.uk-sortable-moving,.uk-sortable-moving *{cursor:move}[data-sortable-action=toggle]{display:inline-block;color:#999;visibility:hidden}[data-sortable-action=toggle]:hover{color:#444;cursor:pointer}[data-sortable-action=toggle]:after{content:"\f147";font-family:FontAwesome}.uk-parent>.uk-sortable-item [data-sortable-action=toggle]{visibility:visible}.uk-collapsed>.uk-sortable-item [data-sortable-action=toggle]:after{content:"\f196"}.uk-collapsed .uk-sortable-list{display:none}
@@ -0,0 +1,606 @@
/*! UIkit 2.4.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
/*
* Based on Nestable jQuery Plugin - Copyright (c) 2012 David Bushell - http://dbushell.com/
*/
(function(addon) {
if (typeof define == "function" && define.amd) { // AMD
define("uikit-sortable", ["uikit"], function(){
return jQuery.fn.uksortable ? jQuery.fn.uksortable : addon(window.jQuery, jQuery.UIkit, window, document);
});
}
if(window && window.jQuery && window.jQuery.UIkit) {
addon(window.jQuery, jQuery.UIkit, window, document);
}
})(function($, UI, window, document, undefined) {
var hasTouch = 'ontouchstart' in window,
html = $("html"),
touchedlists = [];
/**
* Detect CSS pointer-events property
* events are normally disabled on the dragging element to avoid conflicts
* https://github.com/ausi/Feature-detection-technique-for-pointer-events/blob/master/modernizr-pointerevents.js
*/
var hasPointerEvents = (function()
{
var el = document.createElement('div'),
docEl = document.documentElement;
if (!('pointerEvents' in el.style)) {
return false;
}
el.style.pointerEvents = 'auto';
el.style.pointerEvents = 'x';
docEl.appendChild(el);
var supports = window.getComputedStyle && window.getComputedStyle(el, '').pointerEvents === 'auto';
docEl.removeChild(el);
return !!supports;
})();
var eStart = hasTouch ? 'touchstart' : 'mousedown',
eMove = hasTouch ? 'touchmove' : 'mousemove',
eEnd = hasTouch ? 'touchend' : 'mouseup',
eCancel = hasTouch ? 'touchcancel' : 'mouseup';
function Plugin(element, options)
{
var $element = $(element);
if($element.data("uksortable")) return;
this.w = $(window);
this.el = $element;
this.options = $.extend({}, $.fn.uksortable.defaults, options);
this.tplempty = '<div class="' + this.options.emptyClass + '"/>';
this.el.find(">"+this.options.itemNodeName).addClass(this.options.listitemClass).end().find("ul:not(.ignore-list)").addClass(this.options.listClass).find(">li").addClass(this.options.listitemClass);
if(!this.el.children(this.options.itemNodeName).length) {
this.el.append(this.tplempty);
}
this.el.data("uksortable", this);
this.el.data("uksortable-id", "ID"+(new Date().getTime())+"RAND"+(Math.ceil(Math.random() *100000)));
this.init();
}
Plugin.prototype = {
init: function()
{
var list = this;
list.reset();
list.el.data('uksortable-group', this.options.group);
list.placeEl = $('<div class="' + list.options.placeClass + '"/>');
$.each(this.el.find(list.options.itemNodeName), function(k, el)
{
list.setParent($(el));
});
list.el.on('click', '[data-sortable-action]', function(e)
{
if (list.dragEl || (!hasTouch && e.button !== 0)) {
return;
}
e.preventDefault();
var target = $(e.currentTarget),
action = target.data('sortableAction'),
item = target.closest(list.options.itemNodeName);
if (action === 'collapse') {
list.collapseItem(item);
}
if (action === 'expand') {
list.expandItem(item);
}
if (action === 'toggle') {
list.toggleItem(item);
}
});
var onStartEvent = function(e)
{
var handle = $(e.target);
if (!handle.hasClass(list.options.handleClass)) {
if (handle.closest('.' + list.options.noDragClass).length) {
return;
}
handle = handle.closest('.' + list.options.handleClass);
}
if (!handle.length || list.dragEl || (!hasTouch && e.button !== 0) || (hasTouch && e.touches.length !== 1)) {
return;
}
e.preventDefault();
list.dragStart(hasTouch ? e.touches[0] : e);
};
var onMoveEvent = function(e)
{
if (list.dragEl) {
e.preventDefault();
list.dragMove(hasTouch ? e.touches[0] : e);
}
};
var onEndEvent = function(e)
{
if (list.dragEl) {
e.preventDefault();
list.dragStop(hasTouch ? e.touches[0] : e);
}
};
if (hasTouch) {
list.el[0].addEventListener(eStart, onStartEvent, false);
window.addEventListener(eMove, onMoveEvent, false);
window.addEventListener(eEnd, onEndEvent, false);
window.addEventListener(eCancel, onEndEvent, false);
} else {
list.el.on(eStart, onStartEvent);
list.w.on(eMove, onMoveEvent);
list.w.on(eEnd, onEndEvent);
}
},
serialize: function()
{
var data,
depth = 0,
list = this;
step = function(level, depth)
{
var array = [ ],
items = level.children(list.options.itemNodeName);
items.each(function()
{
var li = $(this),
item = $.extend({}, li.data()),
sub = li.children(list.options.listNodeName);
if (sub.length) {
item.children = step(sub, depth + 1);
}
array.push(item);
});
return array;
};
data = step(list.el, depth);
return data;
},
list: function(options)
{
var data = [],
list = this,
depth = 0,
options = $.extend({}, list.options, options),
step = function(level, depth, parent)
{
var items = level.children(options.itemNodeName);
items.each(function(index)
{
var li = $(this),
item = $.extend({parent_id: (parent ? parent : null), depth: depth, order: index}, li.data()),
sub = li.children(options.listNodeName);
data.push(item);
if (sub.length) {
step(sub, depth + 1, li.data(options.idProperty || 'id'));
}
});
};
step(list.el, depth);
return data;
},
reset: function()
{
this.mouse = {
offsetX : 0,
offsetY : 0,
startX : 0,
startY : 0,
lastX : 0,
lastY : 0,
nowX : 0,
nowY : 0,
distX : 0,
distY : 0,
dirAx : 0,
dirX : 0,
dirY : 0,
lastDirX : 0,
lastDirY : 0,
distAxX : 0,
distAxY : 0
};
this.moving = false;
this.dragEl = null;
this.dragRootEl = null;
this.dragDepth = 0;
this.hasNewRoot = false;
this.pointEl = null;
for(var i=0; i<touchedlists.length; i++) {
if(!touchedlists[i].children().length) {
touchedlists[i].append(this.tplempty);
}
}
touchedlists = [];
},
toggleItem: function(li) {
this[li.hasClass(this.options.collapsedClass) ? "expandItem":"collapseItem"](li);
},
expandItem: function(li)
{
li.removeClass(this.options.collapsedClass);
},
collapseItem: function(li)
{
var lists = li.children(this.options.listNodeName);
if (lists.length) {
li.addClass(this.options.collapsedClass);
}
},
expandAll: function()
{
var list = this;
list.el.find(list.options.itemNodeName).each(function()
{
list.expandItem($(this));
});
},
collapseAll: function()
{
var list = this;
list.el.find(list.options.itemNodeName).each(function()
{
list.collapseItem($(this));
});
},
setParent: function(li)
{
if (li.children(this.options.listNodeName).length) {
li.addClass("uk-parent");
}
},
unsetParent: function(li)
{
li.removeClass('uk-parent '+this.options.collapsedClass);
li.children(this.options.listNodeName).remove();
},
dragStart: function(e)
{
var mouse = this.mouse,
target = $(e.target),
dragItem = target.closest(this.options.itemNodeName),
offset = dragItem.offset();
this.placeEl.css('height', dragItem.height());
mouse.offsetX = e.pageX - offset.left;
mouse.offsetY = e.pageY - offset.top;
mouse.startX = mouse.lastX = offset.left;
mouse.startY = mouse.lastY = offset.top;
this.dragRootEl = this.el;
this.dragEl = $(document.createElement(this.options.listNodeName)).addClass(this.options.listClass + ' ' + this.options.dragClass);
this.dragEl.css('width', dragItem.width());
this.tmpDragOnSiblings = [dragItem[0].previousSibling, dragItem[0].nextSibling];
// fix for zepto.js
//dragItem.after(this.placeEl).detach().appendTo(this.dragEl);
dragItem.after(this.placeEl);
dragItem[0].parentNode.removeChild(dragItem[0]);
dragItem.appendTo(this.dragEl);
$(document.body).append(this.dragEl);
this.dragEl.css({
left : offset.left,
top : offset.top
});
// total depth of dragging item
var i, depth,
items = this.dragEl.find(this.options.itemNodeName);
for (i = 0; i < items.length; i++) {
depth = $(items[i]).parents(this.options.listNodeName).length;
if (depth > this.dragDepth) {
this.dragDepth = depth;
}
}
html.addClass(this.options.movingClass);
},
dragStop: function(e)
{
// fix for zepto.js
//this.placeEl.replaceWith(this.dragEl.children(this.options.itemNodeName + ':first').detach());
var el = this.dragEl.children(this.options.itemNodeName).first();
el[0].parentNode.removeChild(el[0]);
this.placeEl.replaceWith(el);
this.dragEl.remove();
if (this.tmpDragOnSiblings[0]!=el[0].previousSibling || this.tmpDragOnSiblings[0]!=el[0].previousSibling) {
this.el.trigger('sortable-change',[el, this.hasNewRoot ? "added":"moved"]);
if (this.hasNewRoot) {
this.dragRootEl.trigger('sortable-change', [el, "removed"]);
}
}
this.reset();
html.removeClass(this.options.movingClass);
},
dragMove: function(e)
{
var list, parent, prev, next, depth,
opt = this.options,
mouse = this.mouse;
this.dragEl.css({
left : e.pageX - mouse.offsetX,
top : e.pageY - mouse.offsetY
});
// mouse position last events
mouse.lastX = mouse.nowX;
mouse.lastY = mouse.nowY;
// mouse position this events
mouse.nowX = e.pageX;
mouse.nowY = e.pageY;
// distance mouse moved between events
mouse.distX = mouse.nowX - mouse.lastX;
mouse.distY = mouse.nowY - mouse.lastY;
// direction mouse was moving
mouse.lastDirX = mouse.dirX;
mouse.lastDirY = mouse.dirY;
// direction mouse is now moving (on both axis)
mouse.dirX = mouse.distX === 0 ? 0 : mouse.distX > 0 ? 1 : -1;
mouse.dirY = mouse.distY === 0 ? 0 : mouse.distY > 0 ? 1 : -1;
// axis mouse is now moving on
var newAx = Math.abs(mouse.distX) > Math.abs(mouse.distY) ? 1 : 0;
// do nothing on first move
if (!mouse.moving) {
mouse.dirAx = newAx;
mouse.moving = true;
return;
}
// calc distance moved on this axis (and direction)
if (mouse.dirAx !== newAx) {
mouse.distAxX = 0;
mouse.distAxY = 0;
} else {
mouse.distAxX += Math.abs(mouse.distX);
if (mouse.dirX !== 0 && mouse.dirX !== mouse.lastDirX) {
mouse.distAxX = 0;
}
mouse.distAxY += Math.abs(mouse.distY);
if (mouse.dirY !== 0 && mouse.dirY !== mouse.lastDirY) {
mouse.distAxY = 0;
}
}
mouse.dirAx = newAx;
/**
* move horizontal
*/
if (mouse.dirAx && mouse.distAxX >= opt.threshold) {
// reset move distance on x-axis for new phase
mouse.distAxX = 0;
prev = this.placeEl.prev(opt.itemNodeName);
// increase horizontal level if previous sibling exists and is not collapsed
if (mouse.distX > 0 && prev.length && !prev.hasClass(opt.collapsedClass)) {
// cannot increase level when item above is collapsed
list = prev.find(opt.listNodeName).last();
// check if depth limit has reached
depth = this.placeEl.parents(opt.listNodeName).length;
if (depth + this.dragDepth <= opt.maxDepth) {
// create new sub-level if one doesn't exist
if (!list.length) {
list = $('<' + opt.listNodeName + '/>').addClass(opt.listClass);
list.append(this.placeEl);
prev.append(list);
this.setParent(prev);
} else {
// else append to next level up
list = prev.children(opt.listNodeName).last();
list.append(this.placeEl);
}
}
}
// decrease horizontal level
if (mouse.distX < 0) {
// we can't decrease a level if an item preceeds the current one
next = this.placeEl.next(opt.itemNodeName);
if (!next.length) {
parent = this.placeEl.parent();
this.placeEl.closest(opt.itemNodeName).after(this.placeEl);
if (!parent.children().length) {
this.unsetParent(parent.parent());
}
}
}
}
var isEmpty = false;
// find list item under cursor
if (!hasPointerEvents) {
this.dragEl[0].style.visibility = 'hidden';
}
this.pointEl = $(document.elementFromPoint(e.pageX - document.body.scrollLeft, e.pageY - (window.pageYOffset || document.documentElement.scrollTop)));
if (!hasPointerEvents) {
this.dragEl[0].style.visibility = 'visible';
}
if (this.pointEl.hasClass(opt.handleClass)) {
this.pointEl = this.pointEl.closest(opt.itemNodeName);
} else {
var sortableitem = this.pointEl.closest('.'+opt.itemClass);
if(sortableitem.length) {
this.pointEl = sortableitem.closest(opt.itemNodeName);
}
}
if (this.pointEl.hasClass(opt.emptyClass)) {
isEmpty = true;
}
else if (this.pointEl.data('uksortable') && !this.pointEl.children().length) {
isEmpty = true;
this.pointEl = $(this.tplempty).appendTo(this.pointEl);
}
else if (!this.pointEl.length || !this.pointEl.hasClass(opt.listitemClass)) {
return;
}
// find parent list of item under cursor
var pointElRoot = this.el,
tmpRoot = this.pointEl.closest('.'+this.options.listBaseClass),
isNewRoot = pointElRoot[0] !== this.pointEl.closest('.'+this.options.listBaseClass)[0],
$newRoot = tmpRoot;
/**
* move vertical
*/
if (!mouse.dirAx || isNewRoot || isEmpty) {
// check if groups match if dragging over new root
if (isNewRoot && opt.group !== $newRoot.data('uksortable-group')) {
return;
} else {
touchedlists.push(pointElRoot);
}
// check depth limit
depth = this.dragDepth - 1 + this.pointEl.parents(opt.listNodeName).length;
if (depth > opt.maxDepth) {
return;
}
var before = e.pageY < (this.pointEl.offset().top + this.pointEl.height() / 2);
parent = this.placeEl.parent();
// if empty create new list to replace empty placeholder
if (isEmpty) {
this.pointEl.replaceWith(this.placeEl);
}
else if (before) {
this.pointEl.before(this.placeEl);
}
else {
this.pointEl.after(this.placeEl);
}
if (!parent.children().length) {
if(!parent.data("uksortable")) this.unsetParent(parent.parent());
}
if (!this.dragRootEl.find(opt.itemNodeName).length && !this.dragRootEl.children().length) {
this.dragRootEl.append(this.tplempty);
}
// parent root list has changed
if (isNewRoot) {
this.dragRootEl = tmpRoot;
this.hasNewRoot = this.el[0] !== this.dragRootEl[0];
}
}
}
};
$.fn.uksortable = function(params)
{
var lists = this,
retval = this;
lists.each(function()
{
var element = $(this),
plugin = element.data("uksortable");
if (!plugin) {
plugin = new Plugin(element, params);
} else {
if (typeof params === 'string' && typeof plugin[params] === 'function') {
retval = plugin[params]();
}
}
});
return retval || lists;
};
$.fn.uksortable.defaults = {
prefix : 'uk',
listNodeName : 'ul',
itemNodeName : 'li',
listBaseClass : '{prefix}-sortable',
listClass : '{prefix}-sortable-list',
listitemClass : '{prefix}-sortable-list-item',
itemClass : '{prefix}-sortable-item',
dragClass : '{prefix}-sortable-list-dragged',
movingClass : '{prefix}-sortable-moving',
handleClass : '{prefix}-sortable-handle',
collapsedClass : '{prefix}-collapsed',
placeClass : '{prefix}-sortable-placeholder',
noDragClass : '{prefix}-sortable-nodrag',
emptyClass : '{prefix}-sortable-empty',
group : 0,
maxDepth : 10,
threshold : 20
};
$(document).on("uk-domready", function(e) {
$("[data-uk-sortable]").each(function(){
var ele = $(this),
options = $.extend({}, $.fn.uksortable.defaults, UI.Utils.options(ele.attr("data-uk-sortable")));
Object.keys(options).forEach(function(key){
if(String(options[key]).indexOf('{prefix}')!=-1) {
options[key] = options[key].replace('{prefix}', options.prefix);
}
});
if(!ele.data("uksortable")) {
ele.uksortable(options);
}
});
});
return $.fn.uksortable;
});
@@ -0,0 +1,3 @@
/*! UIkit 2.4.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
.uk-sortable{padding:0;list-style:none}.uk-sortable-list{margin:0;padding-left:40px;list-style:none}.uk-sortable-list-dragged{position:absolute;z-index:1050;padding-left:0;pointer-events:none}.uk-sortable-item{margin-bottom:10px;padding:5px;background:#f5f5f5}.uk-sortable-placeholder{-moz-box-sizing:border-box;box-sizing:border-box;margin-bottom:10px;border:1px dashed #ddd}.uk-sortable-empty{min-height:40px}.uk-sortable-handle{display:inline-block;font-size:18px;color:#ddd}.uk-sortable-handle:hover{cursor:move}.uk-sortable-handle:after{content:"\f0c9";font-family:FontAwesome}.uk-sortable-moving,.uk-sortable-moving *{cursor:move}[data-sortable-action=toggle]{display:inline-block;color:#999;visibility:hidden}[data-sortable-action=toggle]:hover{color:#444;cursor:pointer}[data-sortable-action=toggle]:after{content:"\f147";font-family:FontAwesome}.uk-parent>.uk-sortable-item [data-sortable-action=toggle]{visibility:visible}.uk-collapsed>.uk-sortable-item [data-sortable-action=toggle]:after{content:"\f196"}.uk-collapsed .uk-sortable-list{display:none}
File diff suppressed because one or more lines are too long
@@ -0,0 +1,8 @@
/*! UIkit 2.4.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
/* ========================================================================
Addon: Sticky
========================================================================== */
.uk-sticky {
z-index: 980;
}
@@ -0,0 +1,3 @@
/*! UIkit 2.4.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
.uk-sticky{z-index:980}
@@ -0,0 +1,8 @@
/*! UIkit 2.4.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
/* ========================================================================
Addon: Sticky
========================================================================== */
.uk-sticky {
z-index: 980;
}
@@ -0,0 +1,8 @@
/*! UIkit 2.4.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
/* ========================================================================
Addon: Sticky
========================================================================== */
.uk-sticky {
z-index: 980;
}
@@ -0,0 +1,3 @@
/*! UIkit 2.4.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
.uk-sticky{z-index:980}
@@ -0,0 +1,148 @@
/*! UIkit 2.4.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
(function(addon) {
if (typeof define == "function" && define.amd) { // AMD
define("uikit-sticky", ["uikit"], function(){
return jQuery.fn.uksticky ? jQuery.fn.uksticky : addon(window, window.jQuery, window.jQuery.UIkit);
});
}
if(window && window.jQuery && window.jQuery.UIkit) {
addon(window, window.jQuery, window.jQuery.UIkit);
}
})(function(global, $, UI){
var defaults = {
top : 0,
bottom : 0,
clsactive : 'uk-active',
clswrapper : 'uk-sticky',
getWidthFrom : ''
},
$window = $(window),
$document = $(document),
sticked = [],
windowHeight = $window.height(),
scroller = function() {
var scrollTop = $window.scrollTop(),
documentHeight = $document.height(),
dwh = documentHeight - windowHeight,
extra = (scrollTop > dwh) ? dwh - scrollTop : 0;
for (var i = 0; i < sticked.length; i++) {
if(!sticked[i].stickyElement.is(":visible")) {
continue;
}
var s = sticked[i], elementTop = s.stickyWrapper.offset().top, etse = elementTop - s.top - extra;
if (scrollTop <= etse) {
if (s.currentTop !== null) {
s.stickyElement.css({"position":"", "top":"", "width":""}).parent().removeClass(s.clsactive);
s.currentTop = null;
}
} else {
var newTop = documentHeight - s.stickyElement.outerHeight() - s.top - s.bottom - scrollTop - extra;
newTop = newTop<0 ? newTop + s.top : s.top;
if (s.currentTop != newTop) {
s.stickyElement.css({"position": "fixed", "top": newTop, "width": s.stickyElement.width()});
if (typeof s.getWidthFrom !== 'undefined') {
s.stickyElement.css('width', $(s.getWidthFrom).width());
}
s.stickyElement.parent().addClass(s.clsactive);
s.currentTop = newTop;
}
}
}
},
resizer = function() {
windowHeight = $window.height();
},
methods = {
init: function(options) {
var o = $.extend({}, defaults, options);
return this.each(function() {
var stickyElement = $(this);
if(stickyElement.data("sticky")) return;
var stickyId = stickyElement.attr('id') || ("s"+Math.ceil(Math.random()*10000)),
wrapper = $('<div></div>').attr('id', 'sticky-'+stickyId).addClass(o.clswrapper);
stickyElement.wrapAll(wrapper);
if (stickyElement.css("float") == "right") {
stickyElement.css({"float":"none"}).parent().css({"float":"right"});
}
stickyElement.data("sticky", true);
var stickyWrapper = stickyElement.parent();
stickyWrapper.css('height', stickyElement.outerHeight());
sticked.push({
top: o.top,
bottom: o.bottom,
stickyElement: stickyElement,
currentTop: null,
stickyWrapper: stickyWrapper,
clsactive: o.clsactive,
getWidthFrom: o.getWidthFrom
});
});
},
update: scroller
};
// should be more efficient than using $window.scroll(scroller) and $window.resize(resizer):
window.addEventListener('scroll', scroller, false);
window.addEventListener('resize', resizer, false);
$.fn.uksticky = function(method) {
if (methods[method]) {
return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
} else if (typeof method === 'object' || !method ) {
return methods.init.apply( this, arguments );
} else {
$.error('Method ' + method + ' does not exist on jQuery.sticky');
}
};
$(document).on("uk-domready", function(e) {
setTimeout(function(){
scroller();
$("[data-uk-sticky]").each(function(){
var $ele = $(this);
if(!$ele.data("sticky")) $ele.uksticky(UI.Utils.options($ele.attr('data-uk-sticky')));
});
}, 0);
});
return $.fn.uksticky;
});
+3
View File
@@ -0,0 +1,3 @@
/*! UIkit 2.4.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
.uk-sticky{z-index:980}
+3
View File
@@ -0,0 +1,3 @@
/*! UIkit 2.4.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
(function(t){"function"==typeof define&&define.amd&&define("uikit-sticky",["uikit"],function(){return jQuery.fn.uksticky?jQuery.fn.uksticky:t(window,window.jQuery,window.jQuery.UIkit)}),window&&window.jQuery&&window.jQuery.UIkit&&t(window,window.jQuery,window.jQuery.UIkit)})(function(t,e,i){var n={top:0,bottom:0,clsactive:"uk-active",clswrapper:"uk-sticky",getWidthFrom:""},s=e(window),o=e(document),a=[],r=s.height(),l=function(){for(var t=s.scrollTop(),i=o.height(),n=i-r,l=t>n?n-t:0,u=0;a.length>u;u++)if(a[u].stickyElement.is(":visible")){var d=a[u],h=d.stickyWrapper.offset().top,c=h-d.top-l;if(c>=t)null!==d.currentTop&&(d.stickyElement.css({position:"",top:"",width:""}).parent().removeClass(d.clsactive),d.currentTop=null);else{var f=i-d.stickyElement.outerHeight()-d.top-d.bottom-t-l;f=0>f?f+d.top:d.top,d.currentTop!=f&&(d.stickyElement.css({position:"fixed",top:f,width:d.stickyElement.width()}),d.getWidthFrom!==void 0&&d.stickyElement.css("width",e(d.getWidthFrom).width()),d.stickyElement.parent().addClass(d.clsactive),d.currentTop=f)}}},u=function(){r=s.height()},d={init:function(t){var i=e.extend({},n,t);return this.each(function(){var t=e(this);if(!t.data("sticky")){var n=t.attr("id")||"s"+Math.ceil(1e4*Math.random()),s=e("<div></div>").attr("id","sticky-"+n).addClass(i.clswrapper);t.wrapAll(s),"right"==t.css("float")&&t.css({"float":"none"}).parent().css({"float":"right"}),t.data("sticky",!0);var o=t.parent();o.css("height",t.outerHeight()),a.push({top:i.top,bottom:i.bottom,stickyElement:t,currentTop:null,stickyWrapper:o,clsactive:i.clsactive,getWidthFrom:i.getWidthFrom})}})},update:l};return window.addEventListener("scroll",l,!1),window.addEventListener("resize",u,!1),e.fn.uksticky=function(t){return d[t]?d[t].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof t&&t?(e.error("Method "+t+" does not exist on jQuery.sticky"),void 0):d.init.apply(this,arguments)},e(document).on("uk-domready",function(){setTimeout(function(){l(),e("[data-uk-sticky]").each(function(){var t=e(this);t.data("sticky")||t.uksticky(i.Utils.options(t.attr("data-uk-sticky")))})},0)}),e.fn.uksticky});
@@ -0,0 +1,537 @@
/*! UIkit 2.4.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
/*
* Based on https://github.com/jdewit/bootstrap-timepicker
*/
(function(addon) {
if (typeof define == "function" && define.amd) { // AMD
define("uikit-timepicker", ["uikit"], function(){
return jQuery.UIkit.timepicker ? jQuery.UIkit.timepicker : addon(window, window.jQuery, window.jQuery.UIkit);
});
}
if(window && window.jQuery && window.jQuery.UIkit) {
addon(window, window.jQuery, window.jQuery.UIkit);
}
})(function(global, $, UI){
// Timepicker
var TimePicker = function(element, options) {
var $this = this, $element = $(element);
if($element.data("timepicker")) return;
this.$element = $element;
this.element = this.$element[0];
this.options = $.extend({}, TimePicker.defaults, options);
this.$element.on({
'focus.timepicker.uikit' : $.proxy(this.highlightUnit, this),
'click.timepicker.uikit' : $.proxy(this.highlightUnit, this),
'keydown.timepicker.uikit': $.proxy(this.onKeydown, this),
'blur.timepicker.uikit' : $.proxy(this.blurElement, this)
});
this.setDefaultTime(this.options.defaultTime);
this.element.data("timepicker", this);
};
TimePicker.defaults = {
defaultTime: 'current',
disableFocus: false,
minuteStep: 15,
secondStep: 15,
showSeconds: false,
showMeridian: false
};
$.extend(TimePicker.prototype, {
setDefaultTime: function(defaultTime){
if (!this.element.value) {
if (defaultTime === 'current') {
var d = new Date();
this.hour = d.getHours(),
this.minute = Math.floor(d.getMinutes() / this.options.minuteStep) * this.options.minuteStep,
this.second = Math.floor(d.getSeconds() / this.options.secondStep) * this.options.secondStep,
this.meridian = 'AM';
if (this.options.showMeridian) {
if (this.hour === 0) {
this.hour = 12;
} else if (this.hour >= 12) {
if (this.hour > 12) this.hour = this.hour - 12;
this.meridian = 'PM';
} else {
this.meridian = 'AM';
}
}
this.update();
} else if (defaultTime === false) {
this.hour = 0;
this.minute = 0;
this.second = 0;
this.meridian = 'AM';
} else {
this.setTime(defaultTime);
}
} else {
this.updateFromElementVal();
}
},
setTime: function(time) {
var arr, timeArray;
if (this.options.showMeridian) {
arr = time.split(' ');
timeArray = arr[0].split(':');
this.meridian = arr[1];
} else {
timeArray = time.split(':');
}
this.hour = parseInt(timeArray[0], 10);
this.minute = parseInt(timeArray[1], 10);
this.second = parseInt(timeArray[2], 10);
if (isNaN(this.hour)) this.hour = 0;
if (isNaN(this.minute)) this.minute = 0;
if (this.options.showMeridian) {
if (this.hour > 12) {
this.hour = 12;
} else if (this.hour < 1) {
this.hour = 12;
}
if (this.meridian === 'am' || this.meridian === 'a') {
this.meridian = 'AM';
} else if (this.meridian === 'pm' || this.meridian === 'p') {
this.meridian = 'PM';
}
if (this.meridian !== 'AM' && this.meridian !== 'PM') {
this.meridian = 'AM';
}
} else {
if (this.hour >= 24) {
this.hour = 23;
} else if (this.hour < 0) {
this.hour = 0;
}
}
if (this.minute < 0) {
this.minute = 0;
} else if (this.minute >= 60) {
this.minute = 59;
}
if (this.options.showSeconds) {
if (isNaN(this.second)) {
this.second = 0;
} else if (this.second < 0) {
this.second = 0;
} else if (this.second >= 60) {
this.second = 59;
}
}
this.update();
},
blurElement: function() {
this.highlightedUnit = undefined;
this.updateFromElementVal();
},
decrementHour: function() {
if (this.options.showMeridian) {
if (this.hour === 1) {
this.hour = 12;
} else if (this.hour === 12) {
this.hour--;
return this.toggleMeridian();
} else if (this.hour === 0) {
this.hour = 11;
return this.toggleMeridian();
} else {
this.hour--;
}
} else {
if (this.hour === 0) {
this.hour = 23;
} else {
this.hour--;
}
}
this.update();
},
decrementMinute: function(step) {
var newVal = (step) ? this.minute - step : this.minute - this.options.minuteStep;
if (newVal < 0) {
this.decrementHour();
this.minute = newVal + 60;
} else {
this.minute = newVal;
}
this.update();
},
decrementSecond: function() {
var newVal = this.second - this.options.secondStep;
if (newVal < 0) {
this.decrementMinute(true);
this.second = newVal + 60;
} else {
this.second = newVal;
}
this.update();
},
onKeydown: function(e) {
switch (e.keyCode) {
case 9: //tab
this.updateFromElementVal();
switch (this.highlightedUnit) {
case 'hour':
e.preventDefault();
this.highlightNextUnit();
break;
case 'minute':
if (this.options.showMeridian || this.options.showSeconds) {
e.preventDefault();
this.highlightNextUnit();
}
break;
case 'second':
if (this.options.showMeridian) {
e.preventDefault();
this.highlightNextUnit();
}
break;
}
break;
case 27: // escape
this.updateFromElementVal();
break;
case 37: // left arrow
e.preventDefault();
this.highlightPrevUnit();
this.updateFromElementVal();
break;
case 38: // up arrow
e.preventDefault();
switch (this.highlightedUnit) {
case 'hour':
this.incrementHour();
this.highlightHour();
break;
case 'minute':
this.incrementMinute();
this.highlightMinute();
break;
case 'second':
this.incrementSecond();
this.highlightSecond();
break;
case 'meridian':
this.toggleMeridian();
this.highlightMeridian();
break;
}
break;
case 39: // right arrow
e.preventDefault();
this.updateFromElementVal();
this.highlightNextUnit();
break;
case 40: // down arrow
e.preventDefault();
switch (this.highlightedUnit) {
case 'hour':
this.decrementHour();
this.highlightHour();
break;
case 'minute':
this.decrementMinute();
this.highlightMinute();
break;
case 'second':
this.decrementSecond();
this.highlightSecond();
break;
case 'meridian':
this.toggleMeridian();
this.highlightMeridian();
break;
}
break;
}
},
formatTime: function(hour, minute, second, meridian) {
hour = hour < 10 ? '0' + hour : hour;
minute = minute < 10 ? '0' + minute : minute;
second = second < 10 ? '0' + second : second;
return hour + ':' + minute + (this.options.showSeconds ? ':' + second : '') + (this.options.showMeridian ? ' ' + meridian : '');
},
getCursorPosition: function() {
if ('selectionStart' in this.element) {// Standard-compliant browsers
return this.element.selectionStart;
} else if (document.selection) {// IE fix
this.element.focus();
var sel = document.selection.createRange(),
selLen = document.selection.createRange().text.length;
sel.moveStart('character', - this.element.value.length);
return sel.text.length - selLen;
}
},
getTime: function() {
return this.formatTime(this.hour, this.minute, this.second, this.meridian);
},
highlightUnit: function() {
this.position = this.getCursorPosition();
if (this.position >= 0 && this.position <= 2) {
this.highlightHour();
} else if (this.position >= 3 && this.position <= 5) {
this.highlightMinute();
} else if (this.position >= 6 && this.position <= 8) {
if (this.options.showSeconds) {
this.highlightSecond();
} else {
this.highlightMeridian();
}
} else if (this.position >= 9 && this.position <= 11) {
this.highlightMeridian();
}
},
highlightNextUnit: function() {
switch (this.highlightedUnit) {
case 'hour':
this.highlightMinute();
break;
case 'minute':
if (this.options.showSeconds) {
this.highlightSecond();
} else if (this.options.showMeridian){
this.highlightMeridian();
} else {
this.highlightHour();
}
break;
case 'second':
if (this.options.showMeridian) {
this.highlightMeridian();
} else {
this.highlightHour();
}
break;
case 'meridian':
this.highlightHour();
break;
}
},
highlightPrevUnit: function() {
switch (this.highlightedUnit) {
case 'hour':
this.highlightMeridian();
break;
case 'minute':
this.highlightHour();
break;
case 'second':
this.highlightMinute();
break;
case 'meridian':
if (this.options.showSeconds) {
this.highlightSecond();
} else {
this.highlightMinute();
}
break;
}
},
highlightHour: function() {
var $element = this.element;
this.highlightedUnit = 'hour';
if ($element.setSelectionRange) {
setTimeout(function() {
$element.setSelectionRange(0,2);
}, 0);
}
},
highlightMinute: function() {
var $element = this.element;
this.highlightedUnit = 'minute';
if ($element.setSelectionRange) {
setTimeout(function() {
$element.setSelectionRange(3,5);
}, 0);
}
},
highlightSecond: function() {
var $element = this.element;
this.highlightedUnit = 'second';
if ($element.setSelectionRange) {
setTimeout(function() {
$element.setSelectionRange(6,8);
}, 0);
}
},
highlightMeridian: function() {
var $element = this.element;
this.highlightedUnit = 'meridian';
if ($element.setSelectionRange) {
if (this.options.showSeconds) {
setTimeout(function() {
$element.setSelectionRange(9,11);
}, 0);
} else {
setTimeout(function() {
$element.setSelectionRange(6,8);
}, 0);
}
}
},
incrementHour: function() {
if (this.options.showMeridian) {
if (this.hour === 11) {
this.hour++;
return this.toggleMeridian();
} else if (this.hour === 12) {
this.hour = 0;
}
}
if (this.hour === 23) {
this.hour = 0;
return;
}
this.hour++;
this.update();
},
incrementMinute: function(step) {
var newVal = step ? (this.minute + step) : (this.minute + this.options.minuteStep - (this.minute % this.options.minuteStep));
if (newVal > 59) {
this.incrementHour();
this.minute = newVal - 60;
} else {
this.minute = newVal;
}
this.update();
},
incrementSecond: function() {
var newVal = this.second + this.options.secondStep - (this.second % this.options.secondStep);
if (newVal > 59) {
this.incrementMinute(true);
this.second = newVal - 60;
} else {
this.second = newVal;
}
this.update();
},
remove: function() {
$('document').off('.timepicker.uikit');
delete this.$element.data().timepicker;
},
toggleMeridian: function() {
this.meridian = this.meridian === 'AM' ? 'PM' : 'AM';
this.update();
},
update: function() {
this.$element.trigger({
'type': 'changeTime.timepicker',
'time': {
'value': this.getTime(),
'hours': this.hour,
'minutes': this.minute,
'seconds': this.second,
'meridian': this.meridian
}
});
this.updateElement();
},
updateElement: function() {
this.$element.val(this.getTime()).trigger("change");
},
updateFromElementVal: function() {
if (this.element.value) this.setTime(this.element.value);
}
});
// init code
$(document).on("focus.timepicker.uikit", "[data-uk-timepicker]", function(e) {
var ele = $(this);
if (!ele.data("timepicker")) {
e.preventDefault();
var obj = new TimePicker(ele, UI.Utils.options(ele.attr("data-uk-timepicker")));
ele.trigger("focus");
}
});
UI["timepicker"] = TimePicker;
return TimePicker;
});
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -2,7 +2,7 @@
"name": "uikit",
"title": "UIkit",
"filename": "js/uikit.min.js",
"version": "2.3.1",
"version": "2.4.0",
"description": "UIkit is a lightweight and modular front-end framework for developing fast and powerful web interfaces.",
"homepage": "http://www.getuikit.com",
"author": {