Commit inicial - WordPress Análisis de Precios Unitarios

- WordPress core y plugins
- Tema Twenty Twenty-Four configurado
- Plugin allow-unfiltered-html.php simplificado
- .gitignore configurado para excluir wp-config.php y uploads

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
root
2025-11-03 21:04:30 -06:00
commit a22573bf0b
24068 changed files with 4993111 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
/**
* Light Weight jQuery Accordions
*/
.factory-bootstrap-331 .factory-accordion {
margin: 0 0 30px;
border-top: 1px solid #DDD;
border-right: 1px solid #DDD;
border-left: 1px solid #DDD;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
}
.factory-bootstrap-331 .factory-accordion > h3 {
border-bottom: 1px solid #DDD;
cursor: pointer;
padding: 8px 15px;
margin: 0;
}
.factory-bootstrap-331 .factory-accordion > div {
display: none;
margin:0;
border-bottom: 1px solid #DDD;
}
.factory-bootstrap-331 .factory-accordion-item {
display: none;
}
.factory-bootstrap-331 .inner-factory-accordion-item {
padding: 10px 0;
}
.factory-bootstrap-331 .factory-accordion > h3.active:hover {
cursor: default;
}

View File

@@ -0,0 +1,48 @@
.factory-bootstrap-331 .btn-primary {
background: #e1a948;
border-color: #d39323;
color: white;
-webkit-box-shadow: inset 0 1px 0 #ecc88a, 0 1px 0 rgba(0, 0, 0, 0.15);
box-shadow: inset 0 1px 0 #ecc88a, 0 1px 0 rgba(0, 0, 0, 0.15);
}
.factory-bootstrap-331 .btn-primary:hover,
.factory-bootstrap-331 .btn-primary:focus {
background: #db9825;
border-color: #bd831f;
color: white;
-webkit-box-shadow: inset 0 1px 0 #e8be74, 0 1px 0 rgba(0, 0, 0, 0.15);
box-shadow: inset 0 1px 0 #e8be74, 0 1px 0 rgba(0, 0, 0, 0.15);
}
.factory-bootstrap-331 .btn-primary:active {
background: #db9825;
border-color: #bd831f;
color: white;
-webkit-box-shadow: inset 0 2px 5px -3px rgba(0, 0, 0, 0.5);
box-shadow: inset 0 2px 5px -3px rgba(0, 0, 0, 0.5);
}
.factory-bootstrap-331 .btn-primary[disabled],
.factory-bootstrap-331 .btn-primary:disabled {
color: #d1cdc7 !important;
background: #db9825 !important;
border-color: #bd831f !important;
text-shadow: none !important;
}
.factory-bootstrap-331 .btn-group .btn.active.value {
background-color: #e1a948;
-webkit-box-shadow: inset 0 1px 2px #d39323;
box-shadow: inset 0 1px 2px #d39323;
border-top: 1px solid #d39323;
border-bottom: 1px solid #d39323;
border-left: 1px solid #d39323;
}
.factory-bootstrap-331 .pagination > .active > a,
.factory-bootstrap-331 .pagination > .active > span,
.factory-bootstrap-331 .pagination > .active > a:hover,
.factory-bootstrap-331 .pagination > .active > span:hover,
.factory-bootstrap-331 .pagination > .active > a:focus,
.factory-bootstrap-331 .pagination > .active > span:focus {
background-color: #e1a948;
border-color: #d39323;
}

View File

@@ -0,0 +1,48 @@
.factory-bootstrap-331 .btn-primary {
background: #c7a589;
border-color: #b78a66;
color: white;
-webkit-box-shadow: inset 0 1px 0 #e0cdbd, 0 1px 0 rgba(0, 0, 0, 0.15);
box-shadow: inset 0 1px 0 #e0cdbd, 0 1px 0 rgba(0, 0, 0, 0.15);
}
.factory-bootstrap-331 .btn-primary:hover,
.factory-bootstrap-331 .btn-primary:focus {
background: #ba906d;
border-color: #ae7d55;
color: white;
-webkit-box-shadow: inset 0 1px 0 #d7bfac, 0 1px 0 rgba(0, 0, 0, 0.15);
box-shadow: inset 0 1px 0 #d7bfac, 0 1px 0 rgba(0, 0, 0, 0.15);
}
.factory-bootstrap-331 .btn-primary:active {
background: #ba906d;
border-color: #ae7d55;
color: white;
-webkit-box-shadow: inset 0 2px 5px -3px rgba(0, 0, 0, 0.5);
box-shadow: inset 0 2px 5px -3px rgba(0, 0, 0, 0.5);
}
.factory-bootstrap-331 .btn-primary[disabled],
.factory-bootstrap-331 .btn-primary:disabled {
color: #d1cbc7 !important;
background: #ba906d !important;
border-color: #ae7d55 !important;
text-shadow: none !important;
}
.factory-bootstrap-331 .btn-group .btn.active.value {
background-color: #c7a589;
-webkit-box-shadow: inset 0 1px 2px #b78a66;
box-shadow: inset 0 1px 2px #b78a66;
border-top: 1px solid #b78a66;
border-bottom: 1px solid #b78a66;
border-left: 1px solid #b78a66;
}
.factory-bootstrap-331 .pagination > .active > a,
.factory-bootstrap-331 .pagination > .active > span,
.factory-bootstrap-331 .pagination > .active > a:hover,
.factory-bootstrap-331 .pagination > .active > span:hover,
.factory-bootstrap-331 .pagination > .active > a:focus,
.factory-bootstrap-331 .pagination > .active > span:focus {
background-color: #c7a589;
border-color: #b78a66;
}

View File

@@ -0,0 +1,782 @@
/*!
* Datepicker for Bootstrap v1.5.0-dev (https://github.com/eternicode/bootstrap-datepicker)
*
* Copyright 2012 Stefan Petre
* Improvements by Andrew Rowls
* Licensed under the Apache License v2.0 (http://www.apache.org/licenses/LICENSE-2.0)
*/
.datepicker {
border-radius: 4px;
direction: ltr;
}
.datepicker-inline {
width: 220px;
}
.datepicker.datepicker-rtl {
direction: rtl;
}
.datepicker.datepicker-rtl table tr td span {
float: right;
}
.datepicker-dropdown {
top: 0;
left: 0;
}
.datepicker-dropdown:before {
content: '';
display: inline-block;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
border-bottom: 7px solid #ccc;
border-top: 0;
border-bottom-color: rgba(0, 0, 0, 0.2);
position: absolute;
}
.datepicker-dropdown:after {
content: '';
display: inline-block;
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-bottom: 6px solid #fff;
border-top: 0;
position: absolute;
}
.datepicker-dropdown.datepicker-orient-left:before {
left: 6px;
}
.datepicker-dropdown.datepicker-orient-left:after {
left: 7px;
}
.datepicker-dropdown.datepicker-orient-right:before {
right: 6px;
}
.datepicker-dropdown.datepicker-orient-right:after {
right: 7px;
}
.datepicker-dropdown.datepicker-orient-top:before {
top: -7px;
}
.datepicker-dropdown.datepicker-orient-top:after {
top: -6px;
}
.datepicker-dropdown.datepicker-orient-bottom:before {
bottom: -7px;
border-bottom: 0;
border-top: 7px solid #999;
}
.datepicker-dropdown.datepicker-orient-bottom:after {
bottom: -6px;
border-bottom: 0;
border-top: 6px solid #fff;
}
.datepicker > div {
display: none;
}
.datepicker.days .datepicker-days,
.datepicker.months .datepicker-months,
.datepicker.years .datepicker-years {
display: block;
}
.datepicker table {
margin: 0;
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.datepicker table tr td,
.datepicker table tr th {
text-align: center;
width: 30px;
height: 30px;
border-radius: 4px;
border: none;
}
.table-striped .datepicker table tr td,
.table-striped .datepicker table tr th {
background-color: transparent;
}
.datepicker table tr td.day:hover,
.datepicker table tr td.day.focused {
background: #eeeeee;
cursor: pointer;
}
.datepicker table tr td.old,
.datepicker table tr td.new {
color: #999999;
}
.datepicker table tr td.disabled,
.datepicker table tr td.disabled:hover {
background: none;
color: #999999;
cursor: default;
}
.datepicker table tr td.today,
.datepicker table tr td.today:hover,
.datepicker table tr td.today.disabled,
.datepicker table tr td.today.disabled:hover {
color: #000000;
background-color: #ffdb99;
border-color: #ffb733;
}
.datepicker table tr td.today:hover,
.datepicker table tr td.today:hover:hover,
.datepicker table tr td.today.disabled:hover,
.datepicker table tr td.today.disabled:hover:hover,
.datepicker table tr td.today:focus,
.datepicker table tr td.today:hover:focus,
.datepicker table tr td.today.disabled:focus,
.datepicker table tr td.today.disabled:hover:focus,
.datepicker table tr td.today:active,
.datepicker table tr td.today:hover:active,
.datepicker table tr td.today.disabled:active,
.datepicker table tr td.today.disabled:hover:active,
.datepicker table tr td.today.active,
.datepicker table tr td.today:hover.active,
.datepicker table tr td.today.disabled.active,
.datepicker table tr td.today.disabled:hover.active,
.open .dropdown-toggle.datepicker table tr td.today,
.open .dropdown-toggle.datepicker table tr td.today:hover,
.open .dropdown-toggle.datepicker table tr td.today.disabled,
.open .dropdown-toggle.datepicker table tr td.today.disabled:hover {
color: #000000;
background-color: #ffcd70;
border-color: #f59e00;
}
.datepicker table tr td.today:active,
.datepicker table tr td.today:hover:active,
.datepicker table tr td.today.disabled:active,
.datepicker table tr td.today.disabled:hover:active,
.datepicker table tr td.today.active,
.datepicker table tr td.today:hover.active,
.datepicker table tr td.today.disabled.active,
.datepicker table tr td.today.disabled:hover.active,
.open .dropdown-toggle.datepicker table tr td.today,
.open .dropdown-toggle.datepicker table tr td.today:hover,
.open .dropdown-toggle.datepicker table tr td.today.disabled,
.open .dropdown-toggle.datepicker table tr td.today.disabled:hover {
background-image: none;
}
.datepicker table tr td.today.disabled,
.datepicker table tr td.today:hover.disabled,
.datepicker table tr td.today.disabled.disabled,
.datepicker table tr td.today.disabled:hover.disabled,
.datepicker table tr td.today[disabled],
.datepicker table tr td.today:hover[disabled],
.datepicker table tr td.today.disabled[disabled],
.datepicker table tr td.today.disabled:hover[disabled],
fieldset[disabled] .datepicker table tr td.today,
fieldset[disabled] .datepicker table tr td.today:hover,
fieldset[disabled] .datepicker table tr td.today.disabled,
fieldset[disabled] .datepicker table tr td.today.disabled:hover,
.datepicker table tr td.today.disabled:hover,
.datepicker table tr td.today:hover.disabled:hover,
.datepicker table tr td.today.disabled.disabled:hover,
.datepicker table tr td.today.disabled:hover.disabled:hover,
.datepicker table tr td.today[disabled]:hover,
.datepicker table tr td.today:hover[disabled]:hover,
.datepicker table tr td.today.disabled[disabled]:hover,
.datepicker table tr td.today.disabled:hover[disabled]:hover,
fieldset[disabled] .datepicker table tr td.today:hover,
fieldset[disabled] .datepicker table tr td.today:hover:hover,
fieldset[disabled] .datepicker table tr td.today.disabled:hover,
fieldset[disabled] .datepicker table tr td.today.disabled:hover:hover,
.datepicker table tr td.today.disabled:focus,
.datepicker table tr td.today:hover.disabled:focus,
.datepicker table tr td.today.disabled.disabled:focus,
.datepicker table tr td.today.disabled:hover.disabled:focus,
.datepicker table tr td.today[disabled]:focus,
.datepicker table tr td.today:hover[disabled]:focus,
.datepicker table tr td.today.disabled[disabled]:focus,
.datepicker table tr td.today.disabled:hover[disabled]:focus,
fieldset[disabled] .datepicker table tr td.today:focus,
fieldset[disabled] .datepicker table tr td.today:hover:focus,
fieldset[disabled] .datepicker table tr td.today.disabled:focus,
fieldset[disabled] .datepicker table tr td.today.disabled:hover:focus,
.datepicker table tr td.today.disabled:active,
.datepicker table tr td.today:hover.disabled:active,
.datepicker table tr td.today.disabled.disabled:active,
.datepicker table tr td.today.disabled:hover.disabled:active,
.datepicker table tr td.today[disabled]:active,
.datepicker table tr td.today:hover[disabled]:active,
.datepicker table tr td.today.disabled[disabled]:active,
.datepicker table tr td.today.disabled:hover[disabled]:active,
fieldset[disabled] .datepicker table tr td.today:active,
fieldset[disabled] .datepicker table tr td.today:hover:active,
fieldset[disabled] .datepicker table tr td.today.disabled:active,
fieldset[disabled] .datepicker table tr td.today.disabled:hover:active,
.datepicker table tr td.today.disabled.active,
.datepicker table tr td.today:hover.disabled.active,
.datepicker table tr td.today.disabled.disabled.active,
.datepicker table tr td.today.disabled:hover.disabled.active,
.datepicker table tr td.today[disabled].active,
.datepicker table tr td.today:hover[disabled].active,
.datepicker table tr td.today.disabled[disabled].active,
.datepicker table tr td.today.disabled:hover[disabled].active,
fieldset[disabled] .datepicker table tr td.today.active,
fieldset[disabled] .datepicker table tr td.today:hover.active,
fieldset[disabled] .datepicker table tr td.today.disabled.active,
fieldset[disabled] .datepicker table tr td.today.disabled:hover.active {
background-color: #ffdb99;
border-color: #ffb733;
}
.datepicker table tr td.today:hover:hover {
color: #000;
}
.datepicker table tr td.today.active:hover {
color: #fff;
}
.datepicker table tr td.range,
.datepicker table tr td.range:hover,
.datepicker table tr td.range.disabled,
.datepicker table tr td.range.disabled:hover {
background: #eeeeee;
border-radius: 0;
}
.datepicker table tr td.range.today,
.datepicker table tr td.range.today:hover,
.datepicker table tr td.range.today.disabled,
.datepicker table tr td.range.today.disabled:hover {
color: #000000;
background-color: #f7ca77;
border-color: #f1a417;
border-radius: 0;
}
.datepicker table tr td.range.today:hover,
.datepicker table tr td.range.today:hover:hover,
.datepicker table tr td.range.today.disabled:hover,
.datepicker table tr td.range.today.disabled:hover:hover,
.datepicker table tr td.range.today:focus,
.datepicker table tr td.range.today:hover:focus,
.datepicker table tr td.range.today.disabled:focus,
.datepicker table tr td.range.today.disabled:hover:focus,
.datepicker table tr td.range.today:active,
.datepicker table tr td.range.today:hover:active,
.datepicker table tr td.range.today.disabled:active,
.datepicker table tr td.range.today.disabled:hover:active,
.datepicker table tr td.range.today.active,
.datepicker table tr td.range.today:hover.active,
.datepicker table tr td.range.today.disabled.active,
.datepicker table tr td.range.today.disabled:hover.active,
.open .dropdown-toggle.datepicker table tr td.range.today,
.open .dropdown-toggle.datepicker table tr td.range.today:hover,
.open .dropdown-toggle.datepicker table tr td.range.today.disabled,
.open .dropdown-toggle.datepicker table tr td.range.today.disabled:hover {
color: #000000;
background-color: #f4bb51;
border-color: #bf800c;
}
.datepicker table tr td.range.today:active,
.datepicker table tr td.range.today:hover:active,
.datepicker table tr td.range.today.disabled:active,
.datepicker table tr td.range.today.disabled:hover:active,
.datepicker table tr td.range.today.active,
.datepicker table tr td.range.today:hover.active,
.datepicker table tr td.range.today.disabled.active,
.datepicker table tr td.range.today.disabled:hover.active,
.open .dropdown-toggle.datepicker table tr td.range.today,
.open .dropdown-toggle.datepicker table tr td.range.today:hover,
.open .dropdown-toggle.datepicker table tr td.range.today.disabled,
.open .dropdown-toggle.datepicker table tr td.range.today.disabled:hover {
background-image: none;
}
.datepicker table tr td.range.today.disabled,
.datepicker table tr td.range.today:hover.disabled,
.datepicker table tr td.range.today.disabled.disabled,
.datepicker table tr td.range.today.disabled:hover.disabled,
.datepicker table tr td.range.today[disabled],
.datepicker table tr td.range.today:hover[disabled],
.datepicker table tr td.range.today.disabled[disabled],
.datepicker table tr td.range.today.disabled:hover[disabled],
fieldset[disabled] .datepicker table tr td.range.today,
fieldset[disabled] .datepicker table tr td.range.today:hover,
fieldset[disabled] .datepicker table tr td.range.today.disabled,
fieldset[disabled] .datepicker table tr td.range.today.disabled:hover,
.datepicker table tr td.range.today.disabled:hover,
.datepicker table tr td.range.today:hover.disabled:hover,
.datepicker table tr td.range.today.disabled.disabled:hover,
.datepicker table tr td.range.today.disabled:hover.disabled:hover,
.datepicker table tr td.range.today[disabled]:hover,
.datepicker table tr td.range.today:hover[disabled]:hover,
.datepicker table tr td.range.today.disabled[disabled]:hover,
.datepicker table tr td.range.today.disabled:hover[disabled]:hover,
fieldset[disabled] .datepicker table tr td.range.today:hover,
fieldset[disabled] .datepicker table tr td.range.today:hover:hover,
fieldset[disabled] .datepicker table tr td.range.today.disabled:hover,
fieldset[disabled] .datepicker table tr td.range.today.disabled:hover:hover,
.datepicker table tr td.range.today.disabled:focus,
.datepicker table tr td.range.today:hover.disabled:focus,
.datepicker table tr td.range.today.disabled.disabled:focus,
.datepicker table tr td.range.today.disabled:hover.disabled:focus,
.datepicker table tr td.range.today[disabled]:focus,
.datepicker table tr td.range.today:hover[disabled]:focus,
.datepicker table tr td.range.today.disabled[disabled]:focus,
.datepicker table tr td.range.today.disabled:hover[disabled]:focus,
fieldset[disabled] .datepicker table tr td.range.today:focus,
fieldset[disabled] .datepicker table tr td.range.today:hover:focus,
fieldset[disabled] .datepicker table tr td.range.today.disabled:focus,
fieldset[disabled] .datepicker table tr td.range.today.disabled:hover:focus,
.datepicker table tr td.range.today.disabled:active,
.datepicker table tr td.range.today:hover.disabled:active,
.datepicker table tr td.range.today.disabled.disabled:active,
.datepicker table tr td.range.today.disabled:hover.disabled:active,
.datepicker table tr td.range.today[disabled]:active,
.datepicker table tr td.range.today:hover[disabled]:active,
.datepicker table tr td.range.today.disabled[disabled]:active,
.datepicker table tr td.range.today.disabled:hover[disabled]:active,
fieldset[disabled] .datepicker table tr td.range.today:active,
fieldset[disabled] .datepicker table tr td.range.today:hover:active,
fieldset[disabled] .datepicker table tr td.range.today.disabled:active,
fieldset[disabled] .datepicker table tr td.range.today.disabled:hover:active,
.datepicker table tr td.range.today.disabled.active,
.datepicker table tr td.range.today:hover.disabled.active,
.datepicker table tr td.range.today.disabled.disabled.active,
.datepicker table tr td.range.today.disabled:hover.disabled.active,
.datepicker table tr td.range.today[disabled].active,
.datepicker table tr td.range.today:hover[disabled].active,
.datepicker table tr td.range.today.disabled[disabled].active,
.datepicker table tr td.range.today.disabled:hover[disabled].active,
fieldset[disabled] .datepicker table tr td.range.today.active,
fieldset[disabled] .datepicker table tr td.range.today:hover.active,
fieldset[disabled] .datepicker table tr td.range.today.disabled.active,
fieldset[disabled] .datepicker table tr td.range.today.disabled:hover.active {
background-color: #f7ca77;
border-color: #f1a417;
}
.datepicker table tr td.selected,
.datepicker table tr td.selected:hover,
.datepicker table tr td.selected.disabled,
.datepicker table tr td.selected.disabled:hover {
color: #ffffff;
background-color: #999999;
border-color: #555555;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
}
.datepicker table tr td.selected:hover,
.datepicker table tr td.selected:hover:hover,
.datepicker table tr td.selected.disabled:hover,
.datepicker table tr td.selected.disabled:hover:hover,
.datepicker table tr td.selected:focus,
.datepicker table tr td.selected:hover:focus,
.datepicker table tr td.selected.disabled:focus,
.datepicker table tr td.selected.disabled:hover:focus,
.datepicker table tr td.selected:active,
.datepicker table tr td.selected:hover:active,
.datepicker table tr td.selected.disabled:active,
.datepicker table tr td.selected.disabled:hover:active,
.datepicker table tr td.selected.active,
.datepicker table tr td.selected:hover.active,
.datepicker table tr td.selected.disabled.active,
.datepicker table tr td.selected.disabled:hover.active,
.open .dropdown-toggle.datepicker table tr td.selected,
.open .dropdown-toggle.datepicker table tr td.selected:hover,
.open .dropdown-toggle.datepicker table tr td.selected.disabled,
.open .dropdown-toggle.datepicker table tr td.selected.disabled:hover {
color: #ffffff;
background-color: #858585;
border-color: #373737;
}
.datepicker table tr td.selected:active,
.datepicker table tr td.selected:hover:active,
.datepicker table tr td.selected.disabled:active,
.datepicker table tr td.selected.disabled:hover:active,
.datepicker table tr td.selected.active,
.datepicker table tr td.selected:hover.active,
.datepicker table tr td.selected.disabled.active,
.datepicker table tr td.selected.disabled:hover.active,
.open .dropdown-toggle.datepicker table tr td.selected,
.open .dropdown-toggle.datepicker table tr td.selected:hover,
.open .dropdown-toggle.datepicker table tr td.selected.disabled,
.open .dropdown-toggle.datepicker table tr td.selected.disabled:hover {
background-image: none;
}
.datepicker table tr td.selected.disabled,
.datepicker table tr td.selected:hover.disabled,
.datepicker table tr td.selected.disabled.disabled,
.datepicker table tr td.selected.disabled:hover.disabled,
.datepicker table tr td.selected[disabled],
.datepicker table tr td.selected:hover[disabled],
.datepicker table tr td.selected.disabled[disabled],
.datepicker table tr td.selected.disabled:hover[disabled],
fieldset[disabled] .datepicker table tr td.selected,
fieldset[disabled] .datepicker table tr td.selected:hover,
fieldset[disabled] .datepicker table tr td.selected.disabled,
fieldset[disabled] .datepicker table tr td.selected.disabled:hover,
.datepicker table tr td.selected.disabled:hover,
.datepicker table tr td.selected:hover.disabled:hover,
.datepicker table tr td.selected.disabled.disabled:hover,
.datepicker table tr td.selected.disabled:hover.disabled:hover,
.datepicker table tr td.selected[disabled]:hover,
.datepicker table tr td.selected:hover[disabled]:hover,
.datepicker table tr td.selected.disabled[disabled]:hover,
.datepicker table tr td.selected.disabled:hover[disabled]:hover,
fieldset[disabled] .datepicker table tr td.selected:hover,
fieldset[disabled] .datepicker table tr td.selected:hover:hover,
fieldset[disabled] .datepicker table tr td.selected.disabled:hover,
fieldset[disabled] .datepicker table tr td.selected.disabled:hover:hover,
.datepicker table tr td.selected.disabled:focus,
.datepicker table tr td.selected:hover.disabled:focus,
.datepicker table tr td.selected.disabled.disabled:focus,
.datepicker table tr td.selected.disabled:hover.disabled:focus,
.datepicker table tr td.selected[disabled]:focus,
.datepicker table tr td.selected:hover[disabled]:focus,
.datepicker table tr td.selected.disabled[disabled]:focus,
.datepicker table tr td.selected.disabled:hover[disabled]:focus,
fieldset[disabled] .datepicker table tr td.selected:focus,
fieldset[disabled] .datepicker table tr td.selected:hover:focus,
fieldset[disabled] .datepicker table tr td.selected.disabled:focus,
fieldset[disabled] .datepicker table tr td.selected.disabled:hover:focus,
.datepicker table tr td.selected.disabled:active,
.datepicker table tr td.selected:hover.disabled:active,
.datepicker table tr td.selected.disabled.disabled:active,
.datepicker table tr td.selected.disabled:hover.disabled:active,
.datepicker table tr td.selected[disabled]:active,
.datepicker table tr td.selected:hover[disabled]:active,
.datepicker table tr td.selected.disabled[disabled]:active,
.datepicker table tr td.selected.disabled:hover[disabled]:active,
fieldset[disabled] .datepicker table tr td.selected:active,
fieldset[disabled] .datepicker table tr td.selected:hover:active,
fieldset[disabled] .datepicker table tr td.selected.disabled:active,
fieldset[disabled] .datepicker table tr td.selected.disabled:hover:active,
.datepicker table tr td.selected.disabled.active,
.datepicker table tr td.selected:hover.disabled.active,
.datepicker table tr td.selected.disabled.disabled.active,
.datepicker table tr td.selected.disabled:hover.disabled.active,
.datepicker table tr td.selected[disabled].active,
.datepicker table tr td.selected:hover[disabled].active,
.datepicker table tr td.selected.disabled[disabled].active,
.datepicker table tr td.selected.disabled:hover[disabled].active,
fieldset[disabled] .datepicker table tr td.selected.active,
fieldset[disabled] .datepicker table tr td.selected:hover.active,
fieldset[disabled] .datepicker table tr td.selected.disabled.active,
fieldset[disabled] .datepicker table tr td.selected.disabled:hover.active {
background-color: #999999;
border-color: #555555;
}
.datepicker table tr td.active,
.datepicker table tr td.active:hover,
.datepicker table tr td.active.disabled,
.datepicker table tr td.active.disabled:hover {
color: #ffffff;
background-color: #428bca;
border-color: #357ebd;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
}
.datepicker table tr td.active:hover,
.datepicker table tr td.active:hover:hover,
.datepicker table tr td.active.disabled:hover,
.datepicker table tr td.active.disabled:hover:hover,
.datepicker table tr td.active:focus,
.datepicker table tr td.active:hover:focus,
.datepicker table tr td.active.disabled:focus,
.datepicker table tr td.active.disabled:hover:focus,
.datepicker table tr td.active:active,
.datepicker table tr td.active:hover:active,
.datepicker table tr td.active.disabled:active,
.datepicker table tr td.active.disabled:hover:active,
.datepicker table tr td.active.active,
.datepicker table tr td.active:hover.active,
.datepicker table tr td.active.disabled.active,
.datepicker table tr td.active.disabled:hover.active,
.open .dropdown-toggle.datepicker table tr td.active,
.open .dropdown-toggle.datepicker table tr td.active:hover,
.open .dropdown-toggle.datepicker table tr td.active.disabled,
.open .dropdown-toggle.datepicker table tr td.active.disabled:hover {
color: #ffffff;
background-color: #3276b1;
border-color: #285e8e;
}
.datepicker table tr td.active:active,
.datepicker table tr td.active:hover:active,
.datepicker table tr td.active.disabled:active,
.datepicker table tr td.active.disabled:hover:active,
.datepicker table tr td.active.active,
.datepicker table tr td.active:hover.active,
.datepicker table tr td.active.disabled.active,
.datepicker table tr td.active.disabled:hover.active,
.open .dropdown-toggle.datepicker table tr td.active,
.open .dropdown-toggle.datepicker table tr td.active:hover,
.open .dropdown-toggle.datepicker table tr td.active.disabled,
.open .dropdown-toggle.datepicker table tr td.active.disabled:hover {
background-image: none;
}
.datepicker table tr td.active.disabled,
.datepicker table tr td.active:hover.disabled,
.datepicker table tr td.active.disabled.disabled,
.datepicker table tr td.active.disabled:hover.disabled,
.datepicker table tr td.active[disabled],
.datepicker table tr td.active:hover[disabled],
.datepicker table tr td.active.disabled[disabled],
.datepicker table tr td.active.disabled:hover[disabled],
fieldset[disabled] .datepicker table tr td.active,
fieldset[disabled] .datepicker table tr td.active:hover,
fieldset[disabled] .datepicker table tr td.active.disabled,
fieldset[disabled] .datepicker table tr td.active.disabled:hover,
.datepicker table tr td.active.disabled:hover,
.datepicker table tr td.active:hover.disabled:hover,
.datepicker table tr td.active.disabled.disabled:hover,
.datepicker table tr td.active.disabled:hover.disabled:hover,
.datepicker table tr td.active[disabled]:hover,
.datepicker table tr td.active:hover[disabled]:hover,
.datepicker table tr td.active.disabled[disabled]:hover,
.datepicker table tr td.active.disabled:hover[disabled]:hover,
fieldset[disabled] .datepicker table tr td.active:hover,
fieldset[disabled] .datepicker table tr td.active:hover:hover,
fieldset[disabled] .datepicker table tr td.active.disabled:hover,
fieldset[disabled] .datepicker table tr td.active.disabled:hover:hover,
.datepicker table tr td.active.disabled:focus,
.datepicker table tr td.active:hover.disabled:focus,
.datepicker table tr td.active.disabled.disabled:focus,
.datepicker table tr td.active.disabled:hover.disabled:focus,
.datepicker table tr td.active[disabled]:focus,
.datepicker table tr td.active:hover[disabled]:focus,
.datepicker table tr td.active.disabled[disabled]:focus,
.datepicker table tr td.active.disabled:hover[disabled]:focus,
fieldset[disabled] .datepicker table tr td.active:focus,
fieldset[disabled] .datepicker table tr td.active:hover:focus,
fieldset[disabled] .datepicker table tr td.active.disabled:focus,
fieldset[disabled] .datepicker table tr td.active.disabled:hover:focus,
.datepicker table tr td.active.disabled:active,
.datepicker table tr td.active:hover.disabled:active,
.datepicker table tr td.active.disabled.disabled:active,
.datepicker table tr td.active.disabled:hover.disabled:active,
.datepicker table tr td.active[disabled]:active,
.datepicker table tr td.active:hover[disabled]:active,
.datepicker table tr td.active.disabled[disabled]:active,
.datepicker table tr td.active.disabled:hover[disabled]:active,
fieldset[disabled] .datepicker table tr td.active:active,
fieldset[disabled] .datepicker table tr td.active:hover:active,
fieldset[disabled] .datepicker table tr td.active.disabled:active,
fieldset[disabled] .datepicker table tr td.active.disabled:hover:active,
.datepicker table tr td.active.disabled.active,
.datepicker table tr td.active:hover.disabled.active,
.datepicker table tr td.active.disabled.disabled.active,
.datepicker table tr td.active.disabled:hover.disabled.active,
.datepicker table tr td.active[disabled].active,
.datepicker table tr td.active:hover[disabled].active,
.datepicker table tr td.active.disabled[disabled].active,
.datepicker table tr td.active.disabled:hover[disabled].active,
fieldset[disabled] .datepicker table tr td.active.active,
fieldset[disabled] .datepicker table tr td.active:hover.active,
fieldset[disabled] .datepicker table tr td.active.disabled.active,
fieldset[disabled] .datepicker table tr td.active.disabled:hover.active {
background-color: #428bca;
border-color: #357ebd;
}
.datepicker table tr td span {
display: block;
width: 23%;
height: 54px;
line-height: 54px;
float: left;
margin: 1%;
cursor: pointer;
border-radius: 4px;
}
.datepicker table tr td span:hover {
background: #eeeeee;
}
.datepicker table tr td span.disabled,
.datepicker table tr td span.disabled:hover {
background: none;
color: #999999;
cursor: default;
}
.datepicker table tr td span.active,
.datepicker table tr td span.active:hover,
.datepicker table tr td span.active.disabled,
.datepicker table tr td span.active.disabled:hover {
color: #ffffff;
background-color: #428bca;
border-color: #357ebd;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
}
.datepicker table tr td span.active:hover,
.datepicker table tr td span.active:hover:hover,
.datepicker table tr td span.active.disabled:hover,
.datepicker table tr td span.active.disabled:hover:hover,
.datepicker table tr td span.active:focus,
.datepicker table tr td span.active:hover:focus,
.datepicker table tr td span.active.disabled:focus,
.datepicker table tr td span.active.disabled:hover:focus,
.datepicker table tr td span.active:active,
.datepicker table tr td span.active:hover:active,
.datepicker table tr td span.active.disabled:active,
.datepicker table tr td span.active.disabled:hover:active,
.datepicker table tr td span.active.active,
.datepicker table tr td span.active:hover.active,
.datepicker table tr td span.active.disabled.active,
.datepicker table tr td span.active.disabled:hover.active,
.open .dropdown-toggle.datepicker table tr td span.active,
.open .dropdown-toggle.datepicker table tr td span.active:hover,
.open .dropdown-toggle.datepicker table tr td span.active.disabled,
.open .dropdown-toggle.datepicker table tr td span.active.disabled:hover {
color: #ffffff;
background-color: #3276b1;
border-color: #285e8e;
}
.datepicker table tr td span.active:active,
.datepicker table tr td span.active:hover:active,
.datepicker table tr td span.active.disabled:active,
.datepicker table tr td span.active.disabled:hover:active,
.datepicker table tr td span.active.active,
.datepicker table tr td span.active:hover.active,
.datepicker table tr td span.active.disabled.active,
.datepicker table tr td span.active.disabled:hover.active,
.open .dropdown-toggle.datepicker table tr td span.active,
.open .dropdown-toggle.datepicker table tr td span.active:hover,
.open .dropdown-toggle.datepicker table tr td span.active.disabled,
.open .dropdown-toggle.datepicker table tr td span.active.disabled:hover {
background-image: none;
}
.datepicker table tr td span.active.disabled,
.datepicker table tr td span.active:hover.disabled,
.datepicker table tr td span.active.disabled.disabled,
.datepicker table tr td span.active.disabled:hover.disabled,
.datepicker table tr td span.active[disabled],
.datepicker table tr td span.active:hover[disabled],
.datepicker table tr td span.active.disabled[disabled],
.datepicker table tr td span.active.disabled:hover[disabled],
fieldset[disabled] .datepicker table tr td span.active,
fieldset[disabled] .datepicker table tr td span.active:hover,
fieldset[disabled] .datepicker table tr td span.active.disabled,
fieldset[disabled] .datepicker table tr td span.active.disabled:hover,
.datepicker table tr td span.active.disabled:hover,
.datepicker table tr td span.active:hover.disabled:hover,
.datepicker table tr td span.active.disabled.disabled:hover,
.datepicker table tr td span.active.disabled:hover.disabled:hover,
.datepicker table tr td span.active[disabled]:hover,
.datepicker table tr td span.active:hover[disabled]:hover,
.datepicker table tr td span.active.disabled[disabled]:hover,
.datepicker table tr td span.active.disabled:hover[disabled]:hover,
fieldset[disabled] .datepicker table tr td span.active:hover,
fieldset[disabled] .datepicker table tr td span.active:hover:hover,
fieldset[disabled] .datepicker table tr td span.active.disabled:hover,
fieldset[disabled] .datepicker table tr td span.active.disabled:hover:hover,
.datepicker table tr td span.active.disabled:focus,
.datepicker table tr td span.active:hover.disabled:focus,
.datepicker table tr td span.active.disabled.disabled:focus,
.datepicker table tr td span.active.disabled:hover.disabled:focus,
.datepicker table tr td span.active[disabled]:focus,
.datepicker table tr td span.active:hover[disabled]:focus,
.datepicker table tr td span.active.disabled[disabled]:focus,
.datepicker table tr td span.active.disabled:hover[disabled]:focus,
fieldset[disabled] .datepicker table tr td span.active:focus,
fieldset[disabled] .datepicker table tr td span.active:hover:focus,
fieldset[disabled] .datepicker table tr td span.active.disabled:focus,
fieldset[disabled] .datepicker table tr td span.active.disabled:hover:focus,
.datepicker table tr td span.active.disabled:active,
.datepicker table tr td span.active:hover.disabled:active,
.datepicker table tr td span.active.disabled.disabled:active,
.datepicker table tr td span.active.disabled:hover.disabled:active,
.datepicker table tr td span.active[disabled]:active,
.datepicker table tr td span.active:hover[disabled]:active,
.datepicker table tr td span.active.disabled[disabled]:active,
.datepicker table tr td span.active.disabled:hover[disabled]:active,
fieldset[disabled] .datepicker table tr td span.active:active,
fieldset[disabled] .datepicker table tr td span.active:hover:active,
fieldset[disabled] .datepicker table tr td span.active.disabled:active,
fieldset[disabled] .datepicker table tr td span.active.disabled:hover:active,
.datepicker table tr td span.active.disabled.active,
.datepicker table tr td span.active:hover.disabled.active,
.datepicker table tr td span.active.disabled.disabled.active,
.datepicker table tr td span.active.disabled:hover.disabled.active,
.datepicker table tr td span.active[disabled].active,
.datepicker table tr td span.active:hover[disabled].active,
.datepicker table tr td span.active.disabled[disabled].active,
.datepicker table tr td span.active.disabled:hover[disabled].active,
fieldset[disabled] .datepicker table tr td span.active.active,
fieldset[disabled] .datepicker table tr td span.active:hover.active,
fieldset[disabled] .datepicker table tr td span.active.disabled.active,
fieldset[disabled] .datepicker table tr td span.active.disabled:hover.active {
background-color: #428bca;
border-color: #357ebd;
}
.datepicker table tr td span.old,
.datepicker table tr td span.new {
color: #999999;
}
.datepicker .datepicker-switch {
width: 145px;
}
.datepicker thead tr:first-child th,
.datepicker tfoot tr th {
cursor: pointer;
}
.datepicker thead tr:first-child th:hover,
.datepicker tfoot tr th:hover {
background: #eeeeee;
}
.datepicker .cw {
font-size: 10px;
width: 12px;
padding: 0 2px 0 5px;
vertical-align: middle;
}
.datepicker thead tr:first-child .cw {
cursor: default;
background-color: transparent;
}
.input-group.date .input-group-addon {
cursor: pointer;
}
.input-daterange {
width: 100%;
}
.input-daterange input {
text-align: center;
}
.input-daterange input:first-child {
border-radius: 3px 0 0 3px;
}
.input-daterange input:last-child {
border-radius: 0 3px 3px 0;
}
.input-daterange .input-group-addon {
width: auto;
min-width: 16px;
padding: 4px 5px;
font-weight: normal;
line-height: 1.42857143;
text-align: center;
text-shadow: 0 1px 0 #fff;
vertical-align: middle;
background-color: #eeeeee;
border: solid #cccccc;
border-width: 1px 0;
margin-left: -5px;
margin-right: -5px;
}
.datepicker.dropdown-menu {
position: absolute;
top: 100%;
left: 0;
z-index: 1000;
float: left;
display: none;
min-width: 160px;
list-style: none;
background-color: #ffffff;
border: 1px solid #ccc;
border: 1px solid rgba(0, 0, 0, 0.2);
border-radius: 5px;
-webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
-moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
-webkit-background-clip: padding-box;
-moz-background-clip: padding;
background-clip: padding-box;
*border-right-width: 2px;
*border-bottom-width: 2px;
color: #333333;
font-size: 13px;
line-height: 1.42857143;
}
.datepicker.dropdown-menu th,
.datepicker.datepicker-inline th,
.datepicker.dropdown-menu td,
.datepicker.datepicker-inline td {
padding: 0px 5px;
}

View File

@@ -0,0 +1,48 @@
.factory-bootstrap-331 .btn-primary {
background: #a3b745;
border-color: #839237;
color: white;
-webkit-box-shadow: inset 0 1px 0 #c0cd7b, 0 1px 0 rgba(0, 0, 0, 0.15);
box-shadow: inset 0 1px 0 #c0cd7b, 0 1px 0 rgba(0, 0, 0, 0.15);
}
.factory-bootstrap-331 .btn-primary:hover,
.factory-bootstrap-331 .btn-primary:focus {
background: #89993a;
border-color: #727f30;
color: white;
-webkit-box-shadow: inset 0 1px 0 #b7c669, 0 1px 0 rgba(0, 0, 0, 0.15);
box-shadow: inset 0 1px 0 #b7c669, 0 1px 0 rgba(0, 0, 0, 0.15);
}
.factory-bootstrap-331 .btn-primary:active {
background: #89993a;
border-color: #727f30;
color: white;
-webkit-box-shadow: inset 0 2px 5px -3px rgba(0, 0, 0, 0.5);
box-shadow: inset 0 2px 5px -3px rgba(0, 0, 0, 0.5);
}
.factory-bootstrap-331 .btn-primary[disabled],
.factory-bootstrap-331 .btn-primary:disabled {
color: #cfd1c7 !important;
background: #89993a !important;
border-color: #727f30 !important;
text-shadow: none !important;
}
.factory-bootstrap-331 .btn-group .btn.active.value {
background-color: #a3b745;
-webkit-box-shadow: inset 0 1px 2px #839237;
box-shadow: inset 0 1px 2px #839237;
border-top: 1px solid #839237;
border-bottom: 1px solid #839237;
border-left: 1px solid #839237;
}
.factory-bootstrap-331 .pagination > .active > a,
.factory-bootstrap-331 .pagination > .active > span,
.factory-bootstrap-331 .pagination > .active > a:hover,
.factory-bootstrap-331 .pagination > .active > span:hover,
.factory-bootstrap-331 .pagination > .active > a:focus,
.factory-bootstrap-331 .pagination > .active > span:focus {
background-color: #a3b745;
border-color: #839237;
}

View File

@@ -0,0 +1,27 @@
/**
* Form Groups
*/
.factory-bootstrap-331 .factory-form-group .factory-legend {
padding: 9px 12px;
background-color: #f9f9f9;
}
.factory-bootstrap-331 .factory-form-group .factory-title {
font-weight: bold;
font-size: 14px;
line-height: 14px;
color: #555;
margin: 0px;
}
.factory-bootstrap-331 .factory-form-group .factory-hint {
margin: 0px;
font-size: 12px;
line-height: 16px;
margin-top: 6px;
}
.factory-bootstrap-331 .factory-form-group + .factory-form-group {
margin-top: 30px;
}
.factory-bootstrap-331 .factory-form-group legend + .control-group {
margin-top: 0px;
}

View File

@@ -0,0 +1,56 @@
/**
* Form Metaboxes
*/
.factory-form-metabox {
padding: 15px 10px 10px 10px;
}
.factory-form-metabox .control-group:last-child {
margin-bottom: 0px;
}
/**
* Side form metaboxes
*/
#side-sortables .factory-bootstrap-331 .control-label {
float: left;
width: 100%;
text-align: left;
position: relative;
top: 1px;
}
#side-sortables .factory-bootstrap-331 .control-icon {
float: left;
margin: 0 6px 0 0;
}
#side-sortables .factory-bootstrap-331 input
{
float: right;
position: relative;
top: -25px;
}
#side-sortables .factory-bootstrap-331 .help-block {
}
#side-sortables .factory-bootstrap-331 .col-sm-10 {
margin: 0px;
width: 100%;
}
#side-sortables .factory-bootstrap-331 .form-group {
float: none;
margin-top: 0px;
width: auto;
overflow: auto;
}
#side-sortables .factory-bootstrap-331 .form-group {
margin-bottom: 0px;
border-top: 1px solid #f7f7f7;
padding-top: 15px;
margin-top: 15px;
}
#side-sortables .factory-bootstrap-331 .form-group:first-child {
border-top: 0px;
padding-top: 0px;
margin-top: 0px;
}

View File

@@ -0,0 +1,48 @@
.factory-bootstrap-331 .btn-primary {
background: #04a4cc;
border-color: #037c9a;
color: white;
-webkit-box-shadow: inset 0 1px 0 #22cffb, 0 1px 0 rgba(0, 0, 0, 0.15);
box-shadow: inset 0 1px 0 #22cffb, 0 1px 0 rgba(0, 0, 0, 0.15);
}
.factory-bootstrap-331 .btn-primary:hover,
.factory-bootstrap-331 .btn-primary:focus {
background: #0384a4;
border-color: #036881;
color: white;
-webkit-box-shadow: inset 0 1px 0 #09cafa, 0 1px 0 rgba(0, 0, 0, 0.15);
box-shadow: inset 0 1px 0 #09cafa, 0 1px 0 rgba(0, 0, 0, 0.15);
}
.factory-bootstrap-331 .btn-primary:active {
background: #0384a4;
border-color: #036881;
color: white;
-webkit-box-shadow: inset 0 2px 5px -3px rgba(0, 0, 0, 0.5);
box-shadow: inset 0 2px 5px -3px rgba(0, 0, 0, 0.5);
}
.factory-bootstrap-331 .btn-primary[disabled],
.factory-bootstrap-331 .btn-primary:disabled {
color: #c7cfd1 !important;
background: #0384a4 !important;
border-color: #036881 !important;
text-shadow: none !important;
}
.factory-bootstrap-331 .btn-group .btn.active.value {
background-color: #04a4cc;
-webkit-box-shadow: inset 0 1px 2px #037c9a;
box-shadow: inset 0 1px 2px #037c9a;
border-top: 1px solid #037c9a;
border-bottom: 1px solid #037c9a;
border-left: 1px solid #037c9a;
}
.factory-bootstrap-331 .pagination > .active > a,
.factory-bootstrap-331 .pagination > .active > span,
.factory-bootstrap-331 .pagination > .active > a:hover,
.factory-bootstrap-331 .pagination > .active > span:hover,
.factory-bootstrap-331 .pagination > .active > a:focus,
.factory-bootstrap-331 .pagination > .active > span:focus {
background-color: #04a4cc;
border-color: #037c9a;
}

View File

@@ -0,0 +1,48 @@
.factory-bootstrap-331 .btn-primary {
background: #e14d43;
border-color: #d02a21;
color: white;
-webkit-box-shadow: inset 0 1px 0 #ec8a85, 0 1px 0 rgba(0, 0, 0, 0.15);
box-shadow: inset 0 1px 0 #ec8a85, 0 1px 0 rgba(0, 0, 0, 0.15);
}
.factory-bootstrap-331 .btn-primary:hover,
.factory-bootstrap-331 .btn-primary:focus {
background: #d92c23;
border-color: #ba251e;
color: white;
-webkit-box-shadow: inset 0 1px 0 #e8756f, 0 1px 0 rgba(0, 0, 0, 0.15);
box-shadow: inset 0 1px 0 #e8756f, 0 1px 0 rgba(0, 0, 0, 0.15);
}
.factory-bootstrap-331 .btn-primary:active {
background: #d92c23;
border-color: #ba251e;
color: white;
-webkit-box-shadow: inset 0 2px 5px -3px rgba(0, 0, 0, 0.5);
box-shadow: inset 0 2px 5px -3px rgba(0, 0, 0, 0.5);
}
.factory-bootstrap-331 .btn-primary[disabled],
.factory-bootstrap-331 .btn-primary:disabled {
color: #d1c7c7 !important;
background: #d92c23 !important;
border-color: #ba251e !important;
text-shadow: none !important;
}
.factory-bootstrap-331 .btn-group .btn.active.value {
background-color: #e14d43;
-webkit-box-shadow: inset 0 1px 2px #d02a21;
box-shadow: inset 0 1px 2px #d02a21;
border-top: 1px solid #d02a21;
border-bottom: 1px solid #d02a21;
border-left: 1px solid #d02a21;
}
.factory-bootstrap-331 .pagination > .active > a,
.factory-bootstrap-331 .pagination > .active > span,
.factory-bootstrap-331 .pagination > .active > a:hover,
.factory-bootstrap-331 .pagination > .active > span:hover,
.factory-bootstrap-331 .pagination > .active > a:focus,
.factory-bootstrap-331 .pagination > .active > span:focus {
background-color: #e14d43;
border-color: #d02a21;
}

View File

@@ -0,0 +1,48 @@
.factory-bootstrap-331 .btn-primary {
background: #9ebaa0;
border-color: #80a583;
color: white;
-webkit-box-shadow: inset 0 1px 0 #cbdacc, 0 1px 0 rgba(0, 0, 0, 0.15);
box-shadow: inset 0 1px 0 #cbdacc, 0 1px 0 rgba(0, 0, 0, 0.15);
}
.factory-bootstrap-331 .btn-primary:hover,
.factory-bootstrap-331 .btn-primary:focus {
background: #86a988;
border-color: #719a74;
color: white;
-webkit-box-shadow: inset 0 1px 0 #bccfbd, 0 1px 0 rgba(0, 0, 0, 0.15);
box-shadow: inset 0 1px 0 #bccfbd, 0 1px 0 rgba(0, 0, 0, 0.15);
}
.factory-bootstrap-331 .btn-primary:active {
background: #86a988;
border-color: #719a74;
color: white;
-webkit-box-shadow: inset 0 2px 5px -3px rgba(0, 0, 0, 0.5);
box-shadow: inset 0 2px 5px -3px rgba(0, 0, 0, 0.5);
}
.factory-bootstrap-331 .btn-primary[disabled],
.factory-bootstrap-331 .btn-primary:disabled {
color: #c7d1c8 !important;
background: #86a988 !important;
border-color: #719a74 !important;
text-shadow: none !important;
}
.factory-bootstrap-331 .btn-group .btn.active.value {
background-color: #9ebaa0;
-webkit-box-shadow: inset 0 1px 2px #80a583;
box-shadow: inset 0 1px 2px #80a583;
border-top: 1px solid #80a583;
border-bottom: 1px solid #80a583;
border-left: 1px solid #80a583;
}
.factory-bootstrap-331 .pagination > .active > a,
.factory-bootstrap-331 .pagination > .active > span,
.factory-bootstrap-331 .pagination > .active > a:hover,
.factory-bootstrap-331 .pagination > .active > span:hover,
.factory-bootstrap-331 .pagination > .active > a:focus,
.factory-bootstrap-331 .pagination > .active > span:focus {
background-color: #9ebaa0;
border-color: #80a583;
}

View File

@@ -0,0 +1,8 @@
/**
* Separator
*/
.factory-bootstrap-331 .factory-separator {
border-bottom: 1px solid #f9f9f9;
border-top: 1px solid #d1d1d1;
margin-bottom: 25px;
}

View File

@@ -0,0 +1,48 @@
.factory-bootstrap-331 .btn-primary {
background: #dd823b;
border-color: #c36822;
color: white;
-webkit-box-shadow: inset 0 1px 0 #e8ab7c, 0 1px 0 rgba(0, 0, 0, 0.15);
box-shadow: inset 0 1px 0 #e8ab7c, 0 1px 0 rgba(0, 0, 0, 0.15);
}
.factory-bootstrap-331 .btn-primary:hover,
.factory-bootstrap-331 .btn-primary:focus {
background: #cc6c23;
border-color: #ad5c1e;
color: white;
-webkit-box-shadow: inset 0 1px 0 #e59d66, 0 1px 0 rgba(0, 0, 0, 0.15);
box-shadow: inset 0 1px 0 #e59d66, 0 1px 0 rgba(0, 0, 0, 0.15);
}
.factory-bootstrap-331 .btn-primary:active {
background: #cc6c23;
border-color: #ad5c1e;
color: white;
-webkit-box-shadow: inset 0 2px 5px -3px rgba(0, 0, 0, 0.5);
box-shadow: inset 0 2px 5px -3px rgba(0, 0, 0, 0.5);
}
.factory-bootstrap-331 .btn-primary[disabled],
.factory-bootstrap-331 .btn-primary:disabled {
color: #d1cbc7 !important;
background: #cc6c23 !important;
border-color: #ad5c1e !important;
text-shadow: none !important;
}
.factory-bootstrap-331 .btn-group .btn.active.value {
background-color: #dd823b;
-webkit-box-shadow: inset 0 1px 2px #c36822;
box-shadow: inset 0 1px 2px #c36822;
border-top: 1px solid #c36822;
border-bottom: 1px solid #c36822;
border-left: 1px solid #c36822;
}
.factory-bootstrap-331 .pagination > .active > a,
.factory-bootstrap-331 .pagination > .active > span,
.factory-bootstrap-331 .pagination > .active > a:hover,
.factory-bootstrap-331 .pagination > .active > span:hover,
.factory-bootstrap-331 .pagination > .active > a:focus,
.factory-bootstrap-331 .pagination > .active > span:focus {
background-color: #dd823b;
border-color: #c36822;
}

View File

@@ -0,0 +1,97 @@
/**
* Tabs
*/
.factory-bootstrap-331 .factory-tab {
overflow: hidden;
margin-bottom: 25px;
}
.factory-bootstrap-331 .form-group {
overflow: hidden;
}
.factory-bootstrap-331 .factory-tab + .form-group {
margin-top: 30px;
}
.factory-bootstrap-331 .nav-tabs a {
text-decoration: none;
}
.factory-bootstrap-331 .factory-align-horizontal .nav-tabs {
border-bottom: 0px;
}
.factory-bootstrap-331 .factory-align-vertical .factory-headers {
float: left;
width: 150px;
}
.factory-bootstrap-331 .factory-align-vertical .factory-headers .nav-tabs {
border-bottom: 0px;
display: block;
margin: 0px;
-webkit-border-bottom-left-radius: 4px;
-moz-border-radius-bottomleft: 4px;
border-bottom-left-radius: 4px;
}
.factory-bootstrap-331 .factory-tab .factory-bodies {
background-color: #fff;
-webkit-border-radius: 0 3px 3px 3px;
-moz-border-radius: 0 3px 3px 3px;
border-radius: 0 3px 3px 3px;
border: 1px solid #DDD;
padding: 30px 15px 25px 10px;
}
.factory-bootstrap-331 .factory-align-vertical .factory-bodies {
min-height: 250px;
margin-left: 150px;
}
.factory-bootstrap-331 .factory-align-vertical .factory-bodies .actory-tab-item {
clear: both;
}
.factory-bootstrap-331 .form-horizontal .factory-align-vertical .form-group {
margin-left: -5px;
}
.factory-bootstrap-331 .factory-align-vertical .nav-tabs li {
float: none;
}
.factory-bootstrap-331 .factory-align-vertical .nav-tabs li a {
margin-right: -1px;
margin-bottom: 0px;
position: relative;
z-index: 10;
padding: 10px 0 9px 15px;
-webkit-border-radius: 3px;
-webkit-border-top-right-radius: 0px;
-webkit-border-bottom-right-radius: 0px;
-moz-border-radius: 3px;
-moz-border-radius-topright: 0px;
-moz-border-radius-bottomright: 0px;
border-radius: 3px;
border-top-right-radius: 0px;
border-bottom-right-radius: 0px;
}
.factory-bootstrap-331 .factory-align-vertical .nav-tabs > .active > a
{
border: 1px solid #DDD !important;
border-right: 1px solid #fff !important;
}
.factory-bootstrap-331 .factory-align-vertical .nav-tabs > li a:hover
{
color: #21759B;
z-index: 5;
border-color: transparent;
}
.factory-bootstrap-331 .factory-align-vertical .control-label {
width: 20%;
max-width: 140px;
}
.factory-bootstrap-331 .factory-align-vertical .factory-tab-item {
}
.factory-bootstrap-331 .factory-align-vertical .control-group {
width: 80%;
}
.factory-bootstrap-331 .factory-align-vertical .control-group input[type=text],
.factory-bootstrap-331 .factory-align-vertical .control-group textarea
{
width: 90%;
}

View File

@@ -0,0 +1,28 @@
/**
* WP Editor
*/
.factory-bootstrap-331 .wp-editor-wrap * {
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
}
.factory-bootstrap-331 .wp-editor-wrap .button,
.factory-bootstrap-331 .wp-editor-wrap textarea,
.factory-bootstrap-331 .wp-editor-wrap input {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.factory-bootstrap-331 .switch-tmce,
.factory-bootstrap-331 .switch-html {
color: #777;
}
.factory-bootstrap-331 .tmce-active .switch-tmce,
.factory-bootstrap-331 .html-active .switch-html {
color: #555;
}
.factory-bootstrap-331 .switch-tmce:hover,
.factory-bootstrap-331 .switch-html:hover {
color: #777;
}

View File

@@ -0,0 +1,96 @@
#side-sortables .factory-bootstrap-331 .factory-buttons-way {
float: right;
position: relative;
top: -25px;
left: 5px;
border: 3px solid #f9f9f9;
border-radius: 4px;
}
.factory-bootstrap-331 .factory-buttons-way {
border: 3px solid #f9f9f9;
border-radius: 4px;
}
.factory-bootstrap-331 .factory-buttons-way button {
padding-left: 10px;
padding-right: 10px;
}
.factory-bootstrap-331 .factory-buttons-way .factory-on.active {
text-shadow: none;
/* Fix for the issue #ticket-22381 */
color: #fff !important;
background-color: #33aad5;
-webkit-box-shadow: inset 0 1px 1px #0074a2;
box-shadow: inset 0 1px 3px #0074a2;
border-top: 1px solid #0074a2;
border-bottom: 1px solid #0074a2;
border-left: 1px solid #0074a2;
}
.factory-bootstrap-331 .factory-checkbox-tumbler-hint {
margin-top: 5px;
}
.factory-bootstrap-331 .factory-checkbox-tumbler-hint .factory-tumbler-content {
display: inline-block;
background-color: #ffffdd;
padding: 1px 5px;
}
.admin-color-light .factory-bootstrap-331 .factory-buttons-way .factory-on.active {
background-color: #04a4cc;
-webkit-box-shadow: inset 0 1px 2px #037c9a;
box-shadow: inset 0 1px 2px #037c9a;
border-top: 1px solid #037c9a;
border-bottom: 1px solid #037c9a;
border-left: 1px solid #037c9a;
}
.admin-color-blue .factory-bootstrap-331 .factory-buttons-way .factory-on.active {
background-color: #e1a948;
-webkit-box-shadow: inset 0 1px 2px #d39323;
box-shadow: inset 0 1px 2px #d39323;
border-top: 1px solid #d39323;
border-bottom: 1px solid #d39323;
border-left: 1px solid #d39323;
}
.admin-color-coffee .factory-bootstrap-331 .factory-buttons-way .factory-on.active {
background-color: #c7a589;
-webkit-box-shadow: inset 0 1px 2px #b78a66;
box-shadow: inset 0 1px 2px #b78a66;
border-top: 1px solid #b78a66;
border-bottom: 1px solid #b78a66;
border-left: 1px solid #b78a66;
}
.admin-color-ectoplasm .factory-bootstrap-331 .factory-buttons-way .factory-on.active {
background-color: #a3b745;
-webkit-box-shadow: inset 0 1px 2px #839237;
box-shadow: inset 0 1px 2px #839237;
border-top: 1px solid #839237;
border-bottom: 1px solid #839237;
border-left: 1px solid #839237;
}
.admin-color-midnight .factory-bootstrap-331 .factory-buttons-way .factory-on.active {
background-color: #e14d43;
-webkit-box-shadow: inset 0 1px 2px #d02a21;
box-shadow: inset 0 1px 2px #d02a21;
border-top: 1px solid #d02a21;
border-bottom: 1px solid #d02a21;
border-left: 1px solid #d02a21;
}
.admin-color-ocean .factory-bootstrap-331 .factory-buttons-way .factory-on.active {
background-color: #9ebaa0;
-webkit-box-shadow: inset 0 1px 2px #80a583;
box-shadow: inset 0 1px 2px #80a583;
border-top: 1px solid #80a583;
border-bottom: 1px solid #80a583;
border-left: 1px solid #80a583;
}
.admin-color-sunrise .factory-bootstrap-331 .factory-buttons-way .factory-on.active {
background-color: #dd823b;
-webkit-box-shadow: inset 0 1px 2px #c36822;
box-shadow: inset 0 1px 2px #c36822;
border-top: 1px solid #c36822;
border-bottom: 1px solid #c36822;
border-left: 1px solid #c36822;
}

View File

@@ -0,0 +1,24 @@
.factory-bootstrap-331 .factory-color-and-opacity .factory-preview-wrap {
}
.factory-bootstrap-331 .factory-control-row {
padding-left: 105px;
position: relative;
}
.factory-bootstrap-331 .factory-control-row .factory-color-wrap {
position: absolute;
left: 0px;
top: 0px;
}
.factory-bootstrap-331 .factory-control-row .factory-opacity-wrap {
width: 100%;
}
.factory-bootstrap-331 .factory-picker-target {
}
.factory-bootstrap-331 .iris-picker {
margin-top: 10px;
}

View File

@@ -0,0 +1,42 @@
.factory-bootstrap-331 .factory-color {
position: relative;
}
.factory-bootstrap-331 .factory-color .factory-color-hex {
width: auto;
display: inline-block;
width: 65px;
text-align: left;
vertical-align: top;
border-radius: 0px;
border-top-right-radius: 3px;
border-bottom-right-radius: 3px;
border-radius: 3px;
z-index: 1;
position: relative;
margin-left: 26px;
border-top-left-radius: 0px;
border-bottom-left-radius: 0px;
}
.factory-bootstrap-331 .factory-color .factory-pattern,
.factory-bootstrap-331 .factory-color .factory-background {
cursor: pointer;
}
.factory-bootstrap-331 .factory-color .factory-pattern,
.factory-bootstrap-331 .factory-color .factory-background {
height: 26px;
width: 26px;
position: absolute;
border-radius: 5px;
background: transparent url('../assets/images/color_picker_pattern.jpg') center center repeat;
-moz-box-sizing: border-box;
box-sizing: border-box;
border-bottom: 2px solid rgba(0,0,0,0.34);
z-index: 1;
border-top-right-radius: 0px !important;
border-bottom-right-radius: 0px !important;
}
.factory-bootstrap-331 .factory-color .factory-background {
z-index: 2;
border-radius: 3px;
}

View File

@@ -0,0 +1,92 @@
/**
* Dropdown As Buttons
*/
.factory-bootstrap-331 .factory-dropdown.factory-buttons-way .fa {
margin-right: 6px;
position: relative;
}
.factory-bootstrap-331 .factory-dropdown.factory-buttons-way {
border: 0px;
border-radius: 0px;
}
.factory-bootstrap-331 .factory-hints .factory-hint {
margin-top: 5px;
display: inline-block;
background-color: #ffffdd;
padding: 1px 5px;
}
.admin-color-light .factory-bootstrap-331 .factory-dropdown.factory-buttons-way .active {
background-color: #04a4cc;
-webkit-box-shadow: inset 0 1px 2px #037c9a;
box-shadow: inset 0 1px 2px #037c9a;
border-top: 1px solid #037c9a;
border-bottom: 1px solid #037c9a;
border-left: 1px solid #037c9a;
}
.admin-color-blue .factory-bootstrap-331 .factory-dropdown.factory-buttons-way .active {
background-color: #e1a948;
-webkit-box-shadow: inset 0 1px 2px #d39323;
box-shadow: inset 0 1px 2px #d39323;
border-top: 1px solid #d39323;
border-bottom: 1px solid #d39323;
border-left: 1px solid #d39323;
}
.admin-color-coffee .factory-bootstrap-331 .factory-dropdown.factory-buttons-way .active {
background-color: #c7a589;
-webkit-box-shadow: inset 0 1px 2px #b78a66;
box-shadow: inset 0 1px 2px #b78a66;
border-top: 1px solid #b78a66;
border-bottom: 1px solid #b78a66;
border-left: 1px solid #b78a66;
}
.admin-color-ectoplasm .factory-bootstrap-331 .factory-dropdown.factory-buttons-way .active {
background-color: #a3b745;
-webkit-box-shadow: inset 0 1px 2px #839237;
box-shadow: inset 0 1px 2px #839237;
border-top: 1px solid #839237;
border-bottom: 1px solid #839237;
border-left: 1px solid #839237;
}
.admin-color-midnight .factory-bootstrap-331 .factory-dropdown.factory-buttons-way .active {
background-color: #e14d43;
-webkit-box-shadow: inset 0 1px 2px #d02a21;
box-shadow: inset 0 1px 2px #d02a21;
border-top: 1px solid #d02a21;
border-bottom: 1px solid #d02a21;
border-left: 1px solid #d02a21;
}
.admin-color-ocean .factory-bootstrap-331 .factory-dropdown.factory-buttons-way .active {
background-color: #9ebaa0;
-webkit-box-shadow: inset 0 1px 2px #80a583;
box-shadow: inset 0 1px 2px #80a583;
border-top: 1px solid #80a583;
border-bottom: 1px solid #80a583;
border-left: 1px solid #80a583;
}
.admin-color-sunrise .factory-bootstrap-331 .factory-dropdown.factory-buttons-way .active {
background-color: #dd823b;
-webkit-box-shadow: inset 0 1px 2px #c36822;
box-shadow: inset 0 1px 2px #c36822;
border-top: 1px solid #c36822;
border-bottom: 1px solid #c36822;
border-left: 1px solid #c36822;
}
/**
* Dropdown As ddSlick
* http://designwithpc.com/plugins/ddslick
*/
.factory-bootstrap-331 .factory-dropdown.factory-ddslick-way .dd-select {
background-color: #fff !important;
}
.factory-bootstrap-331 .factory-dropdown.factory-ddslick-way label {
margin-bottom: 1px;
}
.factory-bootstrap-331 .factory-dropdown.factory-ddslick-way .dd-option,
.factory-bootstrap-331 .factory-dropdown.factory-ddslick-way .dd-selected {
padding: 8px 12px 8px 11px !important;
}

View File

@@ -0,0 +1,24 @@
.factory-bootstrap-331 .factory-font .factory-control-row {
padding:0;
vertical-align: top;
}
.factory-bootstrap-331 .factory-font .factory-color-wrap {
position:static;
display:inline-block;
vertical-align: top;
}
.factory-bootstrap-331 .factory-font .factory-size-wrap {
display:inline-block;
width: 70px;
vertical-align: top;
}
.factory-bootstrap-331 .iris-picker {
margin-top: 10px;
}
.factory-bootstrap-331 .factory-font .factory-family-wrap {
padding-bottom: 10px;
}
.factory-bootstrap-331 .factory-font .chosen-results {
max-height: 150px;
}

View File

@@ -0,0 +1,67 @@
.factory-bootstrap-331 .factory-list li input {
margin: 0 5px 0 0;
position: relative;
top: 1px;
outline: none !important;
}
.factory-bootstrap-331 .factory-list li span {
vertical-align: bottom;
line-height: 100%;
}
/* erorrs */
.factory-bootstrap-331 .factory-list .factory-error {
position: relative;
display: inline-block;
}
.factory-bootstrap-331 .factory-list .factory-error i {
color: #f47665;
margin: 0 7px 0 1px;
cursor: help;
}
.factory-bootstrap-331 .factory-list .factory-error-text {
display: none;
position: absolute;
width: 300px;
}
.factory-bootstrap-331 .factory-list .factory-error-text,
.factory-bootstrap-331 .factory-list-error {
background-color: rgba(0,0,0,0.8);
white-space: normal;
z-index: 10;
padding: 10px 12px 12px 12px;
font-weight: normal;
line-height: 150%;
border-radius: 4px;
color: #fff;
font-size: 13px;
margin-top: 2px;
}
.factory-bootstrap-331 .factory-list-error {
padding: 5px 10px;
max-width: 500px;
display: inline-block;
}
.factory-bootstrap-331 .factory-list-error i {
margin: 0 7px 0 1px;
}
.factory-bootstrap-331 .factory-list .factory-error-text a {
color: #fff;
font-weight: bold;
}
.factory-bootstrap-331 .factory-list .factory-has-error:hover .factory-error-text {
display: block;
}
.factory-bootstrap-331 .factory-list .factory-has-error {
cursor: default;
}
.opanda-connect-buttons .opanda-has-error .opanda-error {
display: inline-block;
}
.factory-bootstrap-331 .factory-checklist-way.factory-empty {
font-style: italic;
margin-top: 7px;
}

View File

@@ -0,0 +1,187 @@
/**
* Pattern Control
*
* @author Alex Kovalev <alex@byonepress.com>
* @author Paul Kashtanoff <paul@byonepress.com>
* @copyright (c) 2013-2014, OnePress Ltd
*
* @package factory-forms
* @since 3.1.0
*/
.factory-bootstrap-331 .factory-pattern .factory-pattern-controls {
vertical-align: middle;
}
/**
* Preview
*/
.factory-bootstrap-331 .factory-pattern .factory-preview-wrap {
display: inline-block;
vertical-align: middle;
}
.factory-bootstrap-331 .factory-pattern .factory-preview {
width: 100px;
height: 26px;
background:transparent url('../assets/images/color_picker_pattern.jpg') repeat;
border:0;
border-radius:3px;
cursor:pointer;
-moz-box-sizing: border-box;
box-sizing: border-box;
border-bottom: 2px solid rgba(0,0,0,0.34) !important;
position: relative;
}
.factory-bootstrap-331 .factory-pattern .factory-preview.factory-empty {
background:transparent url('../assets/images/color_picker_pattern.jpg') repeat !important;
}
/**
* Preview Arrow
*/
.factory-bootstrap-331 .factory-pattern .factory-preview span {
position:absolute;
top:0;
left:76px;
background: #111111;
width: 26px;
height: 26px;
border-radius:0 3px 3px 0;
-moz-border-radius:0 3px 3px 0;
-webkit-border-radius:0 3px 3px 0;
z-index:99;
border-bottom: 2px solid #000;
}
.factory-bootstrap-331 .factory-pattern .factory-preview span:hover {
background: #161616;
}
.factory-bootstrap-331 .factory-pattern .factory-preview span:after {
content: '';
width: 0;
height: 0;
border: transparent solid 5px;
border-top-color: #96a6a6;
position: absolute;
top: 10px;
right: 7px;
z-index: 1;
}
.factory-bootstrap-331 .factory-pattern.factory-patterns-panel-active .factory-preview span:after {
border-top-color: transparent;
border-bottom-color: #96a6a6;
top: 4px;
}
/**
* Color Picker
*/
.factory-bootstrap-331 .factory-pattern .factory-color-panel {
padding: 10px;
margin-top: 10px;
background: rgba(255,255,255,0.04);
border-radius: 3px;
display: none;
}
.factory-bootstrap-331 .factory-pattern.factory-color-panel-active .factory-color-panel {
display: block;
}
.factory-bootstrap-331 .factory-pattern .factory-color-label {
margin-right: 5px;
}
.factory-bootstrap-331 .factory-pattern .factory-color-label,
.factory-bootstrap-331 .factory-pattern .factory-color {
display: inline-block;
vertical-align: middle;
}
.factory-bootstrap-331 .factory-pattern .factory-color-panel .factory-hint {
margin-top: 7px;
}
/**
* Available Patterns
*/
.factory-bootstrap-331 .factory-pattern .factory-patterns-panel {
display: none;
margin-top: 10px;
padding: 2px 0 0;
border-top: 1px solid #272727;
overflow: visible;
}
.factory-bootstrap-331 .factory-pattern .factory-patterns-group {
clear: both;
padding: 2px 0 0;
border-bottom: 1px solid #272727;
padding-bottom: 10px;
}
.factory-bootstrap-331 .factory-pattern .factory-patterns-group-title {
margin-top: 10px;
}
.factory-bootstrap-331 .factory-pattern .factory-patterns-row {
padding-top: 10px;
}
.factory-bootstrap-331 .factory-pattern.factory-patterns-panel-active .factory-patterns-panel {
display: block;
}
.factory-bootstrap-331 .factory-pattern .factory-patterns-item,
.factory-bootstrap-331 .factory-pattern .factory-patterns-item div {
width: 46px;
height: 46px;
}
.factory-bootstrap-331 .factory-pattern .factory-patterns-item {
display: inline-block;
cursor: pointer;
position: relative;
vertical-align: top;
}
.factory-bootstrap-331 .factory-pattern .factory-patterns-item + .factory-patterns-item {
margin-left: 10px;
}
.factory-bootstrap-331 .factory-pattern .factory-patterns-item div {
position: absolute;
border-radius: 100%;
border: 4px solid #333;
}
.factory-bootstrap-331 .factory-pattern .factory-patterns-item:hover .factory-pattern-holder {
width: 64px;
height: 64px;
top: -10px;
left: -10px;
border: 1px solid #333;
z-index: 10;
}
.factory-bootstrap-331 .factory-pattern .factory-no-preview {
background: #2f2f2f;
line-height: 46px;
border-radius: 100%;
text-align: center;
font-size: 20px;
}
.factory-bootstrap-331 .factory-pattern .factory-no-preview:hover {
background: #333;
}
/**
* Control Buttons
*/
.factory-bootstrap-331 .factory-pattern .factory-button .fa {
font-size: 14px;
margin-right: 1px;
}
.factory-bootstrap-331 .factory-pattern .factory-button span {
position: relative;
top: -1px;
}
.factory-bootstrap-331 .factory-pattern .factory-button + .factory-button {
margin-left: 3px;
}
.factory-bootstrap-331 .factory-pattern .factory-change-color-btn {
margin-left: 5px;
}

View File

@@ -0,0 +1,32 @@
/**
* jQuery Control gropup holder
*/
.factory-control-group .factory-header {
margin-bottom: 7px;
display: block;
}
.factory-control-group-nav {
width:284px;
margin:10px 8px;
}
.factory-control-group-nav li{
display:inline-block;
padding:8px 15px;
margin:0;
background-color: #444;
color:#fff;
border-radius:2px;
-moz-border-radius:2px;
-webkit-border-radius:2px;
cursor:pointer;
}
.factory-control-group-nav li.current{
background-color: #222;
}
.factory-control-group-item {
display:none;
}
.factory-control-group-item.current {
display:block;
}

View File

@@ -0,0 +1,32 @@
/**
* More Link
*/
.factory-bootstrap-331 .factory-more-link-content {
border-top: 1px dashed #DDD;
padding-top: 25px;
width: 100%;
padding-right: 20px;
position: relative;
}
.factory-bootstrap-331 .factory-tab .factory-more-link-show {
display: inline-block;
text-decoration: none;
border-bottom: 1px dotted #21759b;
position: relative;
}
.factory-bootstrap-331 .factory-tab .factory-more-link-show:hover {
border-color: #d54e21;
}
.factory-bootstrap-331 .factory-tab .factory-more-link-hide {
position: absolute;
margin-top: -35px;
background-color: #fff;
padding: 0 5px;
right: 20px;
color: #bbb;
text-decoration: none;
}
.factory-bootstrap-331 .factory-tab .factory-more-link-hide:hover {
color: #999;
}

View File

@@ -0,0 +1,437 @@
/*!
Chosen, a Select Box Enhancer for jQuery and Prototype
by Patrick Filler for Harvest, http://getharvest.com
Version 1.1.0
Full source at https://github.com/harvesthq/chosen
Copyright (c) 2011 Harvest http://getharvest.com
MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
This file is generated by `grunt build`, do not edit it by hand.
*/
/* @group Base */
.chosen-container {
position: relative;
display: inline-block;
vertical-align: middle;
font-size: 13px;
zoom: 1;
*display: inline;
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
}
.chosen-container .chosen-drop {
position: absolute;
top: 100%;
left: -9999px;
z-index: 1010;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
width: 100%;
border: 1px solid #aaa;
border-top: 0;
background: #fff;
box-shadow: 0 4px 5px rgba(0, 0, 0, 0.15);
}
.chosen-container.chosen-with-drop .chosen-drop {
left: 0;
}
.chosen-container a {
cursor: pointer;
}
/* @end */
/* @group Single Chosen */
.chosen-container-single .chosen-single {
position: relative;
display: block;
overflow: hidden;
padding: 0 0 0 8px;
height: 23px;
border: 1px solid #aaa;
border-radius: 5px;
background-color: #fff;
background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #ffffff), color-stop(50%, #f6f6f6), color-stop(52%, #eeeeee), color-stop(100%, #f4f4f4));
background: -webkit-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
background: -moz-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
background: -o-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
background: linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
background-clip: padding-box;
box-shadow: 0 0 3px white inset, 0 1px 1px rgba(0, 0, 0, 0.1);
color: #444;
text-decoration: none;
white-space: nowrap;
line-height: 24px;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.chosen-container-single .chosen-default {
color: #999;
}
.chosen-container-single .chosen-single span {
display: block;
overflow: hidden;
margin-right: 26px;
text-overflow: ellipsis;
white-space: nowrap;
}
.chosen-container-single .chosen-single-with-deselect span {
margin-right: 38px;
}
.chosen-container-single .chosen-single abbr {
position: absolute;
top: 6px;
right: 26px;
display: block;
width: 12px;
height: 12px;
background: url('../assets/images/chosen-sprite.png') -42px 1px no-repeat;
font-size: 1px;
}
.chosen-container-single .chosen-single abbr:hover {
background-position: -42px -10px;
}
.chosen-container-single.chosen-disabled .chosen-single abbr:hover {
background-position: -42px -10px;
}
.chosen-container-single .chosen-single div {
position: absolute;
top: 0;
right: 0;
display: block;
width: 18px;
height: 100%;
}
.chosen-container-single .chosen-single div b {
display: block;
width: 100%;
height: 100%;
background: url('../assets/images/chosen-sprite.png') no-repeat 0px 2px;
}
.chosen-container-single .chosen-search {
position: relative;
z-index: 1010;
margin: 0;
padding: 3px 4px;
white-space: nowrap;
}
.chosen-container-single .chosen-search input[type="text"] {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
margin: 1px 0;
padding: 4px 20px 4px 5px;
width: 100%;
height: auto;
outline: 0;
border: 1px solid #aaa;
background: white url('../assets/images/chosen-sprite.png') no-repeat 100% -20px;
background: url('../assets/images/chosen-sprite.png') no-repeat 100% -20px;
font-size: 1em;
font-family: sans-serif;
line-height: normal;
border-radius: 0;
}
.chosen-container-single .chosen-drop {
margin-top: -1px;
border-radius: 0 0 4px 4px;
background-clip: padding-box;
}
.chosen-container-single.chosen-container-single-nosearch .chosen-search {
position: absolute;
left: -9999px;
}
/* @end */
/* @group Results */
.chosen-container .chosen-results {
position: relative;
overflow-x: hidden;
overflow-y: auto;
margin: 0 4px 4px 0;
padding: 0 0 0 4px;
max-height: 240px;
-webkit-overflow-scrolling: touch;
}
.chosen-container .chosen-results li {
display: none;
margin: 0;
padding: 5px 6px;
list-style: none;
line-height: 15px;
-webkit-touch-callout: none;
}
.chosen-container .chosen-results li.active-result {
display: list-item;
cursor: pointer;
}
.chosen-container .chosen-results li.disabled-result {
display: list-item;
color: #ccc;
cursor: default;
}
.chosen-container .chosen-results li.highlighted {
background-color: #3875d7;
background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #3875d7), color-stop(90%, #2a62bc));
background-image: -webkit-linear-gradient(#3875d7 20%, #2a62bc 90%);
background-image: -moz-linear-gradient(#3875d7 20%, #2a62bc 90%);
background-image: -o-linear-gradient(#3875d7 20%, #2a62bc 90%);
background-image: linear-gradient(#3875d7 20%, #2a62bc 90%);
color: #fff;
}
.chosen-container .chosen-results li.no-results {
display: list-item;
background: #f4f4f4;
}
.chosen-container .chosen-results li.group-result {
display: list-item;
font-weight: bold;
cursor: default;
}
.chosen-container .chosen-results li.group-option {
padding-left: 15px;
}
.chosen-container .chosen-results li em {
font-style: normal;
text-decoration: underline;
}
/* @end */
/* @group Multi Chosen */
.chosen-container-multi .chosen-choices {
position: relative;
overflow: hidden;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
margin: 0;
padding: 0;
width: 100%;
height: auto !important;
height: 1%;
border: 1px solid #aaa;
background-color: #fff;
background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff));
background-image: -webkit-linear-gradient(#eeeeee 1%, #ffffff 15%);
background-image: -moz-linear-gradient(#eeeeee 1%, #ffffff 15%);
background-image: -o-linear-gradient(#eeeeee 1%, #ffffff 15%);
background-image: linear-gradient(#eeeeee 1%, #ffffff 15%);
cursor: text;
}
.chosen-container-multi .chosen-choices li {
float: left;
list-style: none;
}
.chosen-container-multi .chosen-choices li.search-field {
margin: 0;
padding: 0;
white-space: nowrap;
}
.chosen-container-multi .chosen-choices li.search-field input[type="text"] {
margin: 1px 0;
padding: 5px;
height: 15px;
outline: 0;
border: 0 !important;
background: transparent !important;
box-shadow: none;
color: #666;
font-size: 100%;
font-family: sans-serif;
line-height: normal;
border-radius: 0;
}
.chosen-container-multi .chosen-choices li.search-field .default {
color: #999;
}
.chosen-container-multi .chosen-choices li.search-choice {
position: relative;
margin: 3px 0 3px 5px;
padding: 3px 20px 3px 5px;
border: 1px solid #aaa;
border-radius: 3px;
background-color: #e4e4e4;
background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eeeeee));
background-image: -webkit-linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
background-image: -moz-linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
background-image: -o-linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
background-image: linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
background-clip: padding-box;
box-shadow: 0 0 2px white inset, 0 1px 0 rgba(0, 0, 0, 0.05);
color: #333;
line-height: 13px;
cursor: default;
}
.chosen-container-multi .chosen-choices li.search-choice .search-choice-close {
position: absolute;
top: 4px;
right: 3px;
display: block;
width: 12px;
height: 12px;
background: url('../assets/images/chosen-sprite.png') -42px 1px no-repeat;
font-size: 1px;
}
.chosen-container-multi .chosen-choices li.search-choice .search-choice-close:hover {
background-position: -42px -10px;
}
.chosen-container-multi .chosen-choices li.search-choice-disabled {
padding-right: 5px;
border: 1px solid #ccc;
background-color: #e4e4e4;
background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eeeeee));
background-image: -webkit-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
background-image: -moz-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
background-image: -o-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
background-image: linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
color: #666;
}
.chosen-container-multi .chosen-choices li.search-choice-focus {
background: #d4d4d4;
}
.chosen-container-multi .chosen-choices li.search-choice-focus .search-choice-close {
background-position: -42px -10px;
}
.chosen-container-multi .chosen-results {
margin: 0;
padding: 0;
}
.chosen-container-multi .chosen-drop .result-selected {
display: list-item;
color: #ccc;
cursor: default;
}
/* @end */
/* @group Active */
.chosen-container-active .chosen-single {
border: 1px solid #5897fb;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}
.chosen-container-active.chosen-with-drop .chosen-single {
border: 1px solid #aaa;
-moz-border-radius-bottomright: 0;
border-bottom-right-radius: 0;
-moz-border-radius-bottomleft: 0;
border-bottom-left-radius: 0;
background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #eeeeee), color-stop(80%, #ffffff));
background-image: -webkit-linear-gradient(#eeeeee 20%, #ffffff 80%);
background-image: -moz-linear-gradient(#eeeeee 20%, #ffffff 80%);
background-image: -o-linear-gradient(#eeeeee 20%, #ffffff 80%);
background-image: linear-gradient(#eeeeee 20%, #ffffff 80%);
box-shadow: 0 1px 0 #fff inset;
}
.chosen-container-active.chosen-with-drop .chosen-single div {
border-left: none;
background: transparent;
}
.chosen-container-active.chosen-with-drop .chosen-single div b {
background-position: -18px 2px;
}
.chosen-container-active .chosen-choices {
border: 1px solid #5897fb;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}
.chosen-container-active .chosen-choices li.search-field input[type="text"] {
color: #111 !important;
}
/* @end */
/* @group Disabled Support */
.chosen-disabled {
opacity: 0.5 !important;
cursor: default;
}
.chosen-disabled .chosen-single {
cursor: default;
}
.chosen-disabled .chosen-choices .search-choice .search-choice-close {
cursor: default;
}
/* @end */
/* @group Right to Left */
.chosen-rtl {
text-align: right;
}
.chosen-rtl .chosen-single {
overflow: visible;
padding: 0 8px 0 0;
}
.chosen-rtl .chosen-single span {
margin-right: 0;
margin-left: 26px;
direction: rtl;
}
.chosen-rtl .chosen-single-with-deselect span {
margin-left: 38px;
}
.chosen-rtl .chosen-single div {
right: auto;
left: 3px;
}
.chosen-rtl .chosen-single abbr {
right: auto;
left: 26px;
}
.chosen-rtl .chosen-choices li {
float: right;
}
.chosen-rtl .chosen-choices li.search-field input[type="text"] {
direction: rtl;
}
.chosen-rtl .chosen-choices li.search-choice {
margin: 3px 5px 3px 0;
padding: 3px 5px 3px 19px;
}
.chosen-rtl .chosen-choices li.search-choice .search-choice-close {
right: auto;
left: 4px;
}
.chosen-rtl.chosen-container-single-nosearch .chosen-search,
.chosen-rtl .chosen-drop {
left: 9999px;
}
.chosen-rtl.chosen-container-single .chosen-results {
margin: 0 0 4px 4px;
padding: 0 4px 0 0;
}
.chosen-rtl .chosen-results li.group-option {
padding-right: 15px;
padding-left: 0;
}
.chosen-rtl.chosen-container-active.chosen-with-drop .chosen-single div {
border-right: none;
}
.chosen-rtl .chosen-search input[type="text"] {
padding: 4px 5px 4px 20px;
background: white url('../assets/images/chosen-sprite.png') no-repeat -30px -20px;
background: url('../assets/images/chosen-sprite.png') no-repeat -30px -20px;
direction: rtl;
}
.chosen-rtl.chosen-container-single .chosen-single div b {
background-position: 6px 2px;
}
.chosen-rtl.chosen-container-single.chosen-with-drop .chosen-single div b {
background-position: -12px 2px;
}
/* @end */
/* @group Retina compatibility */
@media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min-resolution: 144dpi) {
.chosen-rtl .chosen-search input[type="text"],
.chosen-container-single .chosen-single abbr,
.chosen-container-single .chosen-single div b,
.chosen-container-single .chosen-search input[type="text"],
.chosen-container-multi .chosen-choices .search-choice .search-choice-close,
.chosen-container .chosen-results-scroll-down span,
.chosen-container .chosen-results-scroll-up span {
background-image: url('../assets/images/chosen-sprite@2x.png') !important;
background-size: 52px 37px !important;
background-repeat: no-repeat !important;
}
}
/* @end */

View File

@@ -0,0 +1,134 @@
/**
* jQuery gradient generator
*/
.factory-bootstrap-331 .factory-gradient-picker-wrap {
margin-bottom:20px;
}
.factory-bootstrap-331 .gradientPicker-preview {
width: 100%;
height: 30px;
border-radius: 3px;
background:transparent url('../assets/images/color_picker_pattern.jpg') repeat;
}
.factory-bootstrap-331 .factory-color-picker-container {
display: none;
padding-top: 15px;
}
.factory-bootstrap-331 .factory-point,
.factory-bootstrap-331 .factory-point-color {
position: absolute;
width: 10px; height: 10px;
border:0;
font-size:0;
border-radius: 50% 50% 100% 100%;
-moz-border-radius: 50% 50% 100% 100%;
-webkit-border-radius: 50% 50% 100% 100%;
cursor: pointer;
overflow: hidden;
}
.factory-bootstrap-331 .factory-point-color {
border-radius: 0px;
}
.factory-bootstrap-331 .factory-point {
background: transparent url('../assets/images/color_picker_pattern.jpg') repeat;
}
.factory-bootstrap-331 .factory-current-point {
-ms-transform:rotate(180deg);
-webkit-transform:rotate(180deg);
transform:rotate(180deg);
}
.factory-bootstrap-331 .factory-points {
position: relative;
height: 10px;
width: 100%;
cursor: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAWCAYAAADAQbwGAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJ1JREFUeNq8VAEKwCAITOn%2FX3ZzTBCxUicTBsvsOO9EIKJhAwCe5H0H4xBvLQgOegV8yZ8AZwJHc8zKI4c53bk6IGNqMH3GCJuMlkeG4p4G1e5Lq1KXatmCM7AdrbLLq7FC0agycx7oXOmk8%2FY%2FPNjRR7s6ZFHFqY5AcasLFDPtpAC7WH7aNkxgO9gdLNv3oWdKiKXX7r8bu6rlJcAA9ZRfMt5oHoIAAAAASUVORK5CYII%3D') 5 0,pointer;
}
.factory-bootstrap-331 .gradientPicker-iris-wrap {
display:none;
position: absolute;
left:0; top:78px;
width: 212px;
height: 212px;
background:#111;
border:1px solid #222;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
z-index: 9999;
}
.factory-bootstrap-331 .gradientPicker-iris-wrap .iris-border, .factory-bootstrap-331 .gradientPicker-iris-wrap .iris-picker {
border:0;
background:#111;
}
/* Preset Gradients */
.factory-bootstrap-331 .gradientPicker-pallets {
padding: 8px 0px 3px 0px;
margin-bottom: 10px;
border-bottom: 1px solid #323232;
border-top: 1px solid #323232;
font-size: 0px;
line-height: 0px;
text-align: center;
}
.factory-bootstrap-331 .factory-preset-gradient,
.factory-bootstrap-331 .factory-secondary-color {
width: 22px;
height: 22px;
border-radius: 100%;
}
.factory-bootstrap-331 .factory-preset-gradient {
display:inline-block;
cursor: pointer;
margin-bottom: 3px;
position: relative;
}
.factory-bootstrap-331 .factory-preset-gradient:hover {
opacity: 0.9;
}
.factory-bootstrap-331 .factory-preset-gradient + .factory-preset-gradient {
margin-left: 5px;
}
.factory-bootstrap-331 .factory-secondary-color-wrap {
width: 11px;
height: 22px;
position: absolute;
overflow: hidden;
right: 0px;
}
.factory-bootstrap-331 .factory-secondary-color {
position: absolute;
left: -11px;
background-color: red;
}
.factory-bootstrap-331 .gradientPicker-filldirection {
width:200px;
margin-top:5px;
}
.factory-bootstrap-331 .gradientPicker-ptConfig .color-chooser {
float: left;
}
/**
* Color
*/
.factory-bootstrap-331 .factory-color-picker-container .factory-slider {
padding-left: 75px;
padding-right: 60px;
position: relative;
}
.factory-bootstrap-331 .factory-color-picker-container .factory-color-hex {
top: 0;
left: 0;
position: absolute;
width: 65px;
}

View File

@@ -0,0 +1 @@
.noUi-target,.noUi-target *{-webkit-touch-callout:none;-webkit-user-select:none;-ms-touch-action:none;-ms-user-select:none;-moz-user-select:none;-moz-box-sizing:border-box;box-sizing:border-box}.noUi-base{width:100%;height:100%;position:relative}.noUi-origin{position:absolute;right:0;top:0;left:0;bottom:0}.noUi-handle{position:relative;z-index:1}.noUi-stacking .noUi-handle{z-index:10}.noUi-stacking+.noUi-origin{*z-index:-1}.noUi-state-tap .noUi-origin{-webkit-transition:left .3s,top .3s;transition:left .3s,top .3s}.noUi-state-drag *{cursor:inherit!important}.noUi-horizontal{height:18px}.noUi-horizontal .noUi-handle{width:34px;height:28px;left:-17px;top:-6px}.noUi-horizontal.noUi-extended{padding:0 15px}.noUi-horizontal.noUi-extended .noUi-origin{right:-15px}.noUi-vertical{width:18px}.noUi-vertical .noUi-handle{width:28px;height:34px;left:-6px;top:-17px}.noUi-vertical.noUi-extended{padding:15px 0}.noUi-vertical.noUi-extended .noUi-origin{bottom:-15px}.noUi-background{background:#FAFAFA;box-shadow:inset 0 1px 1px #f0f0f0}.noUi-connect{background:#3FB8AF;box-shadow:inset 0 0 3px rgba(51,51,51,.45);-webkit-transition:background 450ms;transition:background 450ms}.noUi-origin{border-radius:2px}.noUi-target{border-radius:4px;border:1px solid #D3D3D3;box-shadow:inset 0 1px 1px #F0F0F0,0 3px 6px -5px #BBB}.noUi-target.noUi-connect{box-shadow:inset 0 0 3px rgba(51,51,51,.45),0 3px 6px -5px #BBB}.noUi-dragable{cursor:w-resize}.noUi-vertical .noUi-dragable{cursor:n-resize}.noUi-handle{border:1px solid #D9D9D9;border-radius:3px;background:#FFF;cursor:default;box-shadow:inset 0 0 1px #FFF,inset 0 1px 7px #EBEBEB,0 3px 6px -3px #BBB}.noUi-active{box-shadow:inset 0 0 1px #FFF,inset 0 1px 7px #DDD,0 3px 6px -3px #BBB}.noUi-handle:after,.noUi-handle:before{content:"";display:block;position:absolute;height:14px;width:1px;background:#E8E7E6;left:14px;top:6px}.noUi-handle:after{left:17px}.noUi-vertical .noUi-handle:after,.noUi-vertical .noUi-handle:before{width:14px;height:1px;left:6px;top:14px}.noUi-vertical .noUi-handle:after{top:17px}[disabled] .noUi-connect,[disabled].noUi-connect{background:#B8B8B8}[disabled] .noUi-handle{cursor:not-allowed}

View File

@@ -0,0 +1,109 @@
/**
* jQuery Paddings
*
* @uses plugin.nouislider
*/
.factory-bootstrap-331 .factory-paddings-editor {
padding-left: 135px;
height: 90px;
position: relative;
}
.factory-bootstrap-331 .factory-paddings-editor .factory-rectangle {
width: 120px;
height: 90px;
border-radius: 10px;
background-color: #a6b6b6;
position: relative;
overflow: hidden;
cursor: pointer;
-moz-box-sizing: content-box;
box-sizing: content-box;
position: absolute;
top: 0px;
left: 0px;
}
.factory-bootstrap-331 .factory-paddings-editor .factory-side {
width: 100%;
height: 100%;
position: absolute;
}
.factory-bootstrap-331 .factory-paddings-editor .factory-side-center {
width: 30px;
height: 30px;
border-radius: 100%;
background-color: #bac9c9;
position: absolute;
top: 30px;
left: 45px;
-moz-box-sizing: content-box;
box-sizing: content-box;
}
.factory-bootstrap-331 .factory-paddings-editor .factory-side-center:hover {
background-color: #c0cece;
}
.factory-bootstrap-331 .factory-paddings-editor .factory-side-center.factory-active {
background-color: #829595;
}
.factory-bootstrap-331 .factory-paddings-editor .factory-side-top {
height: 30px; /* = ( rectangle_height - center_button_height ) / 2 */
top: 0px;
left: 0px;
}
.factory-bootstrap-331 .factory-paddings-editor .factory-side-right {
width: 45px; /* = ( rectangle_width - center_button_width ) / 2 */
top: 0px;
right: 0px;
}
.factory-bootstrap-331 .factory-paddings-editor .factory-side-bottom {
height: 30px; /* = ( rectangle_height - center_button_height ) / 2 */
bottom: 0px;
left: 0px;
}
.factory-bootstrap-331 .factory-paddings-editor .factory-side-left {
width: 45px; /* = ( rectangle_width - center_button_width ) / 2 */
top: 0px;
left: 0px;
}
.factory-bootstrap-331 .factory-paddings-editor .factory-rectangle .factory-visible-value {
color: #1b1f1f;
background-color: rgba(255,255,255,0.3);
border-radius: 3px;
padding: 2px;
line-height: 13px;
display: inline-block;
}
.factory-bootstrap-331 .factory-paddings-editor .factory-rectangle .factory-side.factory-active .factory-visible-value {
background-color: rgba(255,255,255,0.3);
border-radius: 3px;
padding: 2px;
line-height: 13px;
display: inline-block;
}
.factory-bootstrap-331 .factory-paddings-editor .factory-visible-value em {
font-style: normal;
}
.factory-bootstrap-331 .factory-paddings-editor .factory-side-top,
.factory-bootstrap-331 .factory-paddings-editor .factory-side-bottom {
text-align: center;
line-height: 30px; /* = side_height */
}
.factory-bootstrap-331 .factory-paddings-editor .factory-side-left,
.factory-bootstrap-331 .factory-paddings-editor .factory-side-right {
line-height: 90px; /* = side_height */
text-align: center;
}
.factory-bootstrap-331 .factory-paddings-editor .factory-slider-container {
font-style: italic;
}
.factory-bootstrap-331 .factory-paddings-editor .factory-slider {
padding-right: 0px;
margin-top: 7px
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 646 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 872 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 244 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

View File

@@ -0,0 +1,49 @@
/**
* Light Weight jQuery Accordions
*/
;(function ( $, window, document, undefined ) {
"use strict"; // jshint ;_;
$.fn.factoryBootstrap331_accordion = function(){
return this.each(function () {
var $self = $(this);
var startAnimation = false;
$('.'+$self.attr('class')+' > div:first').show();
$('.'+$self.attr('class')+' > div:first')
.add('.'+$self.attr('class')+' > h3:first')
.addClass('active');
$('.'+$self.attr('class')+' > h3').on('click', function() {
var selfOn = $(this);
var target = selfOn.next();
if(!selfOn.hasClass('active') && !startAnimation){
startAnimation = true;
selfOn.parent().children('div').slideUp(500);
$('.'+$self.attr('class')+' > h3').removeClass('active');
selfOn.addClass('active');
target.addClass('active').slideDown({
duration: 500,
complete: function(){
startAnimation = false;
$self.trigger('shown.bs.accordion', [selfOn]);
},
progress: function() {
$self.trigger('progress.bs.accordion', [selfOn]);
}
});
}
return false;
});
});
}
$(function(){
$('.factory-bootstrap-331 .factory-accordion').factoryBootstrap331_accordion();
});
})( jQuery, window, document );

View File

@@ -0,0 +1,127 @@
/* ========================================================================
* Bootstrap: affix.js v3.0.3
* http://getbootstrap.com/javascript/#affix
* ========================================================================
* Copyright 2013 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ======================================================================== */
+function ($) { "use strict";
// AFFIX CLASS DEFINITION
// ======================
var Affix = function (element, options) {
this.options = $.extend({}, Affix.DEFAULTS, options)
this.$window = $(window)
.on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this))
.on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this))
this.$element = $(element)
this.affixed =
this.unpin = null
this.checkPosition()
}
Affix.RESET = 'affix affix-top affix-bottom'
Affix.DEFAULTS = {
offset: 0
}
Affix.prototype.checkPositionWithEventLoop = function () {
setTimeout($.proxy(this.checkPosition, this), 1)
}
Affix.prototype.checkPosition = function () {
if (!this.$element.is(':visible')) return
var scrollHeight = $(document).height()
var scrollTop = this.$window.scrollTop()
var position = this.$element.offset()
var offset = this.options.offset
var offsetTop = offset.top
var offsetBottom = offset.bottom
if (typeof offset != 'object') offsetBottom = offsetTop = offset
if (typeof offsetTop == 'function') offsetTop = offset.top()
if (typeof offsetBottom == 'function') offsetBottom = offset.bottom()
var affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ? false :
offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ? 'bottom' :
offsetTop != null && (scrollTop <= offsetTop) ? 'top' : false
if (this.affixed === affix) return
if (this.unpin) this.$element.css('top', '')
this.affixed = affix
this.unpin = affix == 'bottom' ? position.top - scrollTop : null
this.$element.removeClass(Affix.RESET).addClass('affix' + (affix ? '-' + affix : ''))
if (affix == 'bottom') {
this.$element.offset({ top: document.body.offsetHeight - offsetBottom - this.$element.height() })
}
}
// AFFIX PLUGIN DEFINITION
// =======================
var old = $.fn.affix
$.fn.affix = function (option) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.affix')
var options = typeof option == 'object' && option
if (!data) $this.data('bs.affix', (data = new Affix(this, options)))
if (typeof option == 'string') data[option]()
})
}
$.fn.affix.Constructor = Affix
// AFFIX NO CONFLICT
// =================
$.fn.affix.noConflict = function () {
$.fn.affix = old
return this
}
// AFFIX DATA-API
// ==============
$(window).on('load', function () {
$('[data-spy="affix"]').each(function () {
var $spy = $(this)
var data = $spy.data()
data.offset = data.offset || {}
if (data.offsetBottom) data.offset.bottom = data.offsetBottom
if (data.offsetTop) data.offset.top = data.offsetTop
$spy.affix(data)
})
})
}(jQuery);

View File

@@ -0,0 +1,98 @@
/* ========================================================================
* Bootstrap: alert.js v3.0.3
* http://getbootstrap.com/javascript/#alerts
* ========================================================================
* Copyright 2013 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ======================================================================== */
+function ($) { "use strict";
// ALERT CLASS DEFINITION
// ======================
var dismiss = '[data-dismiss="alert"]'
var Alert = function (el) {
$(el).on('click', dismiss, this.close)
}
Alert.prototype.close = function (e) {
var $this = $(this)
var selector = $this.attr('data-target')
if (!selector) {
selector = $this.attr('href')
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
}
var $parent = $(selector)
if (e) e.preventDefault()
if (!$parent.length) {
$parent = $this.hasClass('alert') ? $this : $this.parent()
}
$parent.trigger(e = $.Event('close.bs.alert'))
if (e.isDefaultPrevented()) return
$parent.removeClass('in')
function removeElement() {
$parent.trigger('closed.bs.alert').remove()
}
$.support.transition && $parent.hasClass('fade') ?
$parent
.one($.support.transition.end, removeElement)
.emulateTransitionEnd(150) :
removeElement()
}
// ALERT PLUGIN DEFINITION
// =======================
var old = $.fn.alert
$.fn.alert = function (option) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.alert')
if (!data) $this.data('bs.alert', (data = new Alert(this)))
if (typeof option == 'string') data[option].call($this)
})
}
$.fn.alert.Constructor = Alert
// ALERT NO CONFLICT
// =================
$.fn.alert.noConflict = function () {
$.fn.alert = old
return this
}
// ALERT DATA-API
// ==============
$(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close)
}(jQuery);

View File

@@ -0,0 +1,115 @@
/* ========================================================================
* Bootstrap: button.js v3.0.3
* http://getbootstrap.com/javascript/#buttons
* ========================================================================
* Copyright 2013 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ======================================================================== */
+function ($) { "use strict";
// BUTTON PUBLIC CLASS DEFINITION
// ==============================
var Button = function (element, options) {
this.$element = $(element)
this.options = $.extend({}, Button.DEFAULTS, options)
}
Button.DEFAULTS = {
loadingText: 'loading...'
}
Button.prototype.setState = function (state) {
var d = 'disabled'
var $el = this.$element
var val = $el.is('input') ? 'val' : 'html'
var data = $el.data()
state = state + 'Text'
if (!data.resetText) $el.data('resetText', $el[val]())
$el[val](data[state] || this.options[state])
// push to event loop to allow forms to submit
setTimeout(function () {
state == 'loadingText' ?
$el.addClass(d).attr(d, d) :
$el.removeClass(d).removeAttr(d);
}, 0)
}
Button.prototype.toggle = function () {
var $parent = this.$element.closest('[data-toggle="buttons"]')
var changed = true
if ($parent.length) {
var $input = this.$element.find('input')
if ($input.prop('type') === 'radio') {
// see if clicking on current one
if ($input.prop('checked') && this.$element.hasClass('active'))
changed = false
else
$parent.find('.active').removeClass('active')
}
if (changed) $input.prop('checked', !this.$element.hasClass('active')).trigger('change')
}
if (changed) this.$element.toggleClass('active')
}
// BUTTON PLUGIN DEFINITION
// ========================
var old = $.fn.button
$.fn.button = function (option) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.button')
var options = typeof option == 'object' && option
if (!data) $this.data('bs.button', (data = new Button(this, options)))
if (option == 'toggle') data.toggle()
else if (option) data.setState(option)
})
}
$.fn.button.Constructor = Button
// BUTTON NO CONFLICT
// ==================
$.fn.button.noConflict = function () {
$.fn.button = old
return this
}
// BUTTON DATA-API
// ===============
$(document).on('click.bs.button.data-api', '[data-toggle^=button]', function (e) {
var $btn = $(e.target)
if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
$btn.button('toggle')
e.preventDefault()
})
}(jQuery);

View File

@@ -0,0 +1,217 @@
/* ========================================================================
* Bootstrap: carousel.js v3.0.3
* http://getbootstrap.com/javascript/#carousel
* ========================================================================
* Copyright 2013 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ======================================================================== */
+function ($) { "use strict";
// CAROUSEL CLASS DEFINITION
// =========================
var Carousel = function (element, options) {
this.$element = $(element)
this.$indicators = this.$element.find('.carousel-indicators')
this.options = options
this.paused =
this.sliding =
this.interval =
this.$active =
this.$items = null
this.options.pause == 'hover' && this.$element
.on('mouseenter', $.proxy(this.pause, this))
.on('mouseleave', $.proxy(this.cycle, this))
}
Carousel.DEFAULTS = {
interval: 5000
, pause: 'hover'
, wrap: true
}
Carousel.prototype.cycle = function (e) {
e || (this.paused = false)
this.interval && clearInterval(this.interval)
this.options.interval
&& !this.paused
&& (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
return this
}
Carousel.prototype.getActiveIndex = function () {
this.$active = this.$element.find('.item.active')
this.$items = this.$active.parent().children()
return this.$items.index(this.$active)
}
Carousel.prototype.to = function (pos) {
var that = this
var activeIndex = this.getActiveIndex()
if (pos > (this.$items.length - 1) || pos < 0) return
if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) })
if (activeIndex == pos) return this.pause().cycle()
return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos]))
}
Carousel.prototype.pause = function (e) {
e || (this.paused = true)
if (this.$element.find('.next, .prev').length && $.support.transition.end) {
this.$element.trigger($.support.transition.end)
this.cycle(true)
}
this.interval = clearInterval(this.interval)
return this
}
Carousel.prototype.next = function () {
if (this.sliding) return
return this.slide('next')
}
Carousel.prototype.prev = function () {
if (this.sliding) return
return this.slide('prev')
}
Carousel.prototype.slide = function (type, next) {
var $active = this.$element.find('.item.active')
var $next = next || $active[type]()
var isCycling = this.interval
var direction = type == 'next' ? 'left' : 'right'
var fallback = type == 'next' ? 'first' : 'last'
var that = this
if (!$next.length) {
if (!this.options.wrap) return
$next = this.$element.find('.item')[fallback]()
}
this.sliding = true
isCycling && this.pause()
var e = $.Event('slide.bs.carousel', { relatedTarget: $next[0], direction: direction })
if ($next.hasClass('active')) return
if (this.$indicators.length) {
this.$indicators.find('.active').removeClass('active')
this.$element.one('slid.bs.carousel', function () {
var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()])
$nextIndicator && $nextIndicator.addClass('active')
})
}
if ($.support.transition && this.$element.hasClass('slide')) {
this.$element.trigger(e)
if (e.isDefaultPrevented()) return
$next.addClass(type)
$next[0].offsetWidth // force reflow
$active.addClass(direction)
$next.addClass(direction)
$active
.one($.support.transition.end, function () {
$next.removeClass([type, direction].join(' ')).addClass('active')
$active.removeClass(['active', direction].join(' '))
that.sliding = false
setTimeout(function () { that.$element.trigger('slid.bs.carousel') }, 0)
})
.emulateTransitionEnd(600)
} else {
this.$element.trigger(e)
if (e.isDefaultPrevented()) return
$active.removeClass('active')
$next.addClass('active')
this.sliding = false
this.$element.trigger('slid.bs.carousel')
}
isCycling && this.cycle()
return this
}
// CAROUSEL PLUGIN DEFINITION
// ==========================
var old = $.fn.carousel
$.fn.carousel = function (option) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.carousel')
var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option)
var action = typeof option == 'string' ? option : options.slide
if (!data) $this.data('bs.carousel', (data = new Carousel(this, options)))
if (typeof option == 'number') data.to(option)
else if (action) data[action]()
else if (options.interval) data.pause().cycle()
})
}
$.fn.carousel.Constructor = Carousel
// CAROUSEL NO CONFLICT
// ====================
$.fn.carousel.noConflict = function () {
$.fn.carousel = old
return this
}
// CAROUSEL DATA-API
// =================
$(document).on('click.bs.carousel.data-api', '[data-slide], [data-slide-to]', function (e) {
var $this = $(this), href
var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
var options = $.extend({}, $target.data(), $this.data())
var slideIndex = $this.attr('data-slide-to')
if (slideIndex) options.interval = false
$target.carousel(options)
if (slideIndex = $this.attr('data-slide-to')) {
$target.data('bs.carousel').to(slideIndex)
}
e.preventDefault()
})
$(window).on('load', function () {
$('[data-ride="carousel"]').each(function () {
var $carousel = $(this)
$carousel.carousel($carousel.data())
})
})
}(jQuery);

View File

@@ -0,0 +1,167 @@
/* ========================================================================
* Bootstrap: collapse.js v3.0.3
* http://getbootstrap.com/javascript/#collapse
* ========================================================================
* Copyright 2013 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ======================================================================== */
+function ($) { "use strict";
// COLLAPSE PUBLIC CLASS DEFINITION
// ================================
var Collapse = function (element, options) {
this.$element = $(element)
this.options = $.extend({}, Collapse.DEFAULTS, options)
this.transitioning = null
if (this.options.parent) this.$parent = $(this.options.parent)
if (this.options.toggle) this.toggle()
}
Collapse.DEFAULTS = {
toggle: true
}
Collapse.prototype.dimension = function () {
var hasWidth = this.$element.hasClass('width')
return hasWidth ? 'width' : 'height'
}
Collapse.prototype.show = function () {
if (this.transitioning || this.$element.hasClass('in')) return
var startEvent = $.Event('show.bs.collapse')
this.$element.trigger(startEvent)
if (startEvent.isDefaultPrevented()) return
var actives = this.$parent && this.$parent.find('> .panel > .in')
if (actives && actives.length) {
var hasData = actives.data('bs.collapse')
if (hasData && hasData.transitioning) return
actives.collapse('hide')
hasData || actives.data('bs.collapse', null)
}
var dimension = this.dimension()
this.$element
.removeClass('collapse')
.addClass('collapsing')
[dimension](0)
this.transitioning = 1
var complete = function () {
this.$element
.removeClass('collapsing')
.addClass('in')
[dimension]('auto')
this.transitioning = 0
this.$element.trigger('shown.bs.collapse')
}
if (!$.support.transition) return complete.call(this)
var scrollSize = $.camelCase(['scroll', dimension].join('-'))
this.$element
.one($.support.transition.end, $.proxy(complete, this))
.emulateTransitionEnd(350)
[dimension](this.$element[0][scrollSize])
}
Collapse.prototype.hide = function () {
if (this.transitioning || !this.$element.hasClass('in')) return
var startEvent = $.Event('hide.bs.collapse')
this.$element.trigger(startEvent)
if (startEvent.isDefaultPrevented()) return
var dimension = this.dimension()
this.$element
[dimension](this.$element[dimension]())
[0].offsetHeight
this.$element
.addClass('collapsing')
.removeClass('collapse')
.removeClass('in')
this.transitioning = 1
var complete = function () {
this.transitioning = 0
this.$element
.trigger('hidden.bs.collapse')
.removeClass('collapsing')
.addClass('collapse')
}
if (!$.support.transition) return complete.call(this)
this.$element
[dimension](0)
.one($.support.transition.end, $.proxy(complete, this))
.emulateTransitionEnd(350)
}
Collapse.prototype.toggle = function () {
this[this.$element.hasClass('in') ? 'hide' : 'show']()
}
// COLLAPSE PLUGIN DEFINITION
// ==========================
$.fn.factoryBootstrap331_collapse = function (option) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.collapse')
var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)
if (!data) $this.data('bs.collapse', (data = new Collapse(this, options)))
if (typeof option == 'string') data[option]()
})
}
$.fn.factoryBootstrap331_collapse.Constructor = Collapse
// COLLAPSE DATA-API
// =================
$(document).on('click.bs.collapse.data-api', '[data-toggle=factory-collapse]', function (e) {
var $this = $(this), href
var target = $this.attr('data-target')
|| e.preventDefault()
|| (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
var $target = $(target)
var data = $target.data('bs.collapse')
var option = data ? 'toggle' : $this.data()
var parent = $this.attr('data-parent')
var $parent = parent && $(parent)
if (!data || !data.transitioning) {
if ($parent) $parent.find('[data-toggle=factory-collapse][data-parent="' + parent + '"]').not($this).addClass('collapsed')
$this[$target.hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
}
$target.collapse(option)
})
}(jQuery);

View File

@@ -0,0 +1,143 @@
/* ========================================================================
* Bootstrap: dropdown.js v3.0.3
* http://getbootstrap.com/javascript/#dropdowns
* ========================================================================
* Copyright 2013 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ======================================================================== */
+function ($) { "use strict";
// DROPDOWN CLASS DEFINITION
// =========================
var backdrop = '.dropdown-backdrop'
var toggle = '[data-toggle=factory-dropdown]'
var Dropdown = function (element) {
$(element).on('click.bs.dropdown', this.toggle)
}
Dropdown.prototype.toggle = function (e) {
var $this = $(this)
if ($this.is('.disabled, :disabled')) return
var $parent = getParent($this)
var isActive = $parent.hasClass('open')
clearMenus()
if (!isActive) {
if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
// if mobile we use a backdrop because click events don't delegate
$('<div class="dropdown-backdrop"/>').insertAfter($(this)).on('click', clearMenus)
}
$parent.trigger(e = $.Event('show.bs.dropdown'))
if (e.isDefaultPrevented()) return
$parent
.toggleClass('open')
.trigger('shown.bs.dropdown')
$this.focus()
}
return false
}
Dropdown.prototype.keydown = function (e) {
if (!/(38|40|27)/.test(e.keyCode)) return
var $this = $(this)
e.preventDefault()
e.stopPropagation()
if ($this.is('.disabled, :disabled')) return
var $parent = getParent($this)
var isActive = $parent.hasClass('open')
if (!isActive || (isActive && e.keyCode == 27)) {
if (e.which == 27) $parent.find(toggle).focus()
return $this.click()
}
var $items = $('[role=menu] li:not(.divider):visible a', $parent)
if (!$items.length) return
var index = $items.index($items.filter(':focus'))
if (e.keyCode == 38 && index > 0) index-- // up
if (e.keyCode == 40 && index < $items.length - 1) index++ // down
if (!~index) index=0
$items.eq(index).focus()
}
function clearMenus() {
$(backdrop).remove()
$(toggle).each(function (e) {
var $parent = getParent($(this))
if (!$parent.hasClass('open')) return
$parent.trigger(e = $.Event('hide.bs.dropdown'))
if (e.isDefaultPrevented()) return
$parent.removeClass('open').trigger('hidden.bs.dropdown')
})
}
function getParent($this) {
var selector = $this.attr('data-target')
if (!selector) {
selector = $this.attr('href')
selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
}
var $parent = selector && $(selector)
return $parent && $parent.length ? $parent : $this.parent()
}
// DROPDOWN PLUGIN DEFINITION
// ==========================
$.fn.factoryBootstrap331_dropdown = function (option) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.dropdown')
if (!data) $this.data('bs.dropdown', (data = new Dropdown(this)))
if (typeof option == 'string') data[option].call($this)
})
}
$.fn.factoryBootstrap331_dropdown.Constructor = Dropdown
// APPLY TO STANDARD DROPDOWN ELEMENTS
// ===================================
$(document)
.on('click.bs.dropdown.data-api', clearMenus)
.on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
.on('click.bs.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
.on('keydown.bs.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
}(jQuery);

View File

@@ -0,0 +1,246 @@
/* ========================================================================
* Bootstrap: modal.js v3.0.3
* http://getbootstrap.com/javascript/#modals
* ========================================================================
* Copyright 2013 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ======================================================================== */
+function ($) { "use strict";
// MODAL CLASS DEFINITION
// ======================
var Modal = function (element, options) {
this.options = options
this.$element = $(element)
this.$backdrop =
this.isShown = null
if (this.options.remote) this.$element.load(this.options.remote)
}
Modal.DEFAULTS = {
backdrop: true
, keyboard: true
, show: true
}
Modal.prototype.toggle = function (_relatedTarget) {
return this[!this.isShown ? 'show' : 'hide'](_relatedTarget)
}
Modal.prototype.show = function (_relatedTarget) {
var that = this
var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })
this.$element.trigger(e)
if (this.isShown || e.isDefaultPrevented()) return
this.isShown = true
this.escape()
this.$element.on('click.dismiss.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
this.backdrop(function () {
var transition = $.support.transition && that.$element.hasClass('fade')
if (!that.$element.parent().length) {
that.$element.appendTo(document.body) // don't move modals dom position
}
that.$element.show()
if (transition) {
that.$element[0].offsetWidth // force reflow
}
that.$element
.addClass('in')
.attr('aria-hidden', false)
that.enforceFocus()
var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget })
transition ?
that.$element.find('.modal-dialog') // wait for modal to slide in
.one($.support.transition.end, function () {
that.$element.focus().trigger(e)
})
.emulateTransitionEnd(300) :
that.$element.focus().trigger(e)
})
}
Modal.prototype.hide = function (e) {
if (e) e.preventDefault()
e = $.Event('hide.bs.modal')
this.$element.trigger(e)
if (!this.isShown || e.isDefaultPrevented()) return
this.isShown = false
this.escape()
$(document).off('focusin.bs.modal')
this.$element
.removeClass('in')
.attr('aria-hidden', true)
.off('click.dismiss.modal')
$.support.transition && this.$element.hasClass('fade') ?
this.$element
.one($.support.transition.end, $.proxy(this.hideModal, this))
.emulateTransitionEnd(300) :
this.hideModal()
}
Modal.prototype.enforceFocus = function () {
$(document)
.off('focusin.bs.modal') // guard against infinite focus loop
.on('focusin.bs.modal', $.proxy(function (e) {
if (this.$element[0] !== e.target && !this.$element.has(e.target).length) {
this.$element.focus()
}
}, this))
}
Modal.prototype.escape = function () {
if (this.isShown && this.options.keyboard) {
this.$element.on('keyup.dismiss.bs.modal', $.proxy(function (e) {
e.which == 27 && this.hide();
}, this))
} else if (!this.isShown) {
this.$element.off('keyup.dismiss.bs.modal')
}
}
Modal.prototype.hideModal = function () {
var that = this
this.$element.hide()
this.backdrop(function () {
that.removeBackdrop()
that.$element.trigger('hidden.bs.modal')
})
}
Modal.prototype.removeBackdrop = function () {
this.$backdrop && this.$backdrop.remove()
this.$backdrop = null
}
Modal.prototype.backdrop = function (callback) {
var that = this
var animate = this.$element.hasClass('fade') ? 'fade' : ''
if (this.isShown && this.options.backdrop) {
var doAnimate = $.support.transition && animate
this.$backdrop = $('<div class="factory-bootstrap-331-modal-backdrop ' + animate + '" />')
.appendTo(document.body)
this.$element.on('click.dismiss.modal', $.proxy(function (e) {
if (e.target !== e.currentTarget) return
this.options.backdrop == 'static'
? this.$element[0].focus.call(this.$element[0])
: this.hide.call(this)
}, this))
if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
this.$backdrop.addClass('in')
if (!callback) return
doAnimate ?
this.$backdrop
.one($.support.transition.end, callback)
.emulateTransitionEnd(150) :
callback()
} else if (!this.isShown && this.$backdrop) {
this.$backdrop.removeClass('in')
$.support.transition && this.$element.hasClass('fade')?
this.$backdrop
.one($.support.transition.end, callback)
.emulateTransitionEnd(150) :
callback()
} else if (callback) {
callback()
}
}
// MODAL PLUGIN DEFINITION
// =======================
var old = $.fn.factoryBootstrap331_modal
$.fn.factoryBootstrap331_modal = function (option, _relatedTarget) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.modal')
var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option)
if (!data) $this.data('bs.modal', (data = new Modal(this, options)))
if (typeof option == 'string') data[option](_relatedTarget)
else if (options.show) data.show(_relatedTarget)
})
}
$.fn.factoryBootstrap331_modal.Constructor = Modal
// MODAL NO CONFLICT
// =================
$.fn.factoryBootstrap331_modal.noConflict = function () {
$.fn.factoryBootstrap331_modal = old
return this
}
// MODAL DATA-API
// ==============
$(document).on('click.bs.modal.data-api', '[data-toggle="factory-modal"]', function (e) {
var $this = $(this)
var href = $this.attr('href')
var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7
var option = $target.data('factory-modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
e.preventDefault()
$target
.factoryBootstrap331_modal(option, this)
.one('hide', function () {
$this.is(':visible') && $this.focus()
})
})
$(document)
.on('show.bs.modal', '.modal', function () { $(document.body).addClass('modal-open') })
.on('hidden.bs.modal', '.modal', function () { $(document.body).removeClass('modal-open') })
}(jQuery);

View File

@@ -0,0 +1,117 @@
/* ========================================================================
* Bootstrap: popover.js v3.0.3
* http://getbootstrap.com/javascript/#popovers
* ========================================================================
* Copyright 2013 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ======================================================================== */
+function ($) { "use strict";
// POPOVER PUBLIC CLASS DEFINITION
// ===============================
var Popover = function (element, options) {
this.init('popover', element, options)
}
if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js')
Popover.DEFAULTS = $.extend({} , $.fn.tooltip.Constructor.DEFAULTS, {
placement: 'right'
, trigger: 'click'
, content: ''
, template: '<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
})
// NOTE: POPOVER EXTENDS tooltip.js
// ================================
Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype)
Popover.prototype.constructor = Popover
Popover.prototype.getDefaults = function () {
return Popover.DEFAULTS
}
Popover.prototype.setContent = function () {
var $tip = this.tip()
var title = this.getTitle()
var content = this.getContent()
$tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
$tip.find('.popover-content')[this.options.html ? 'html' : 'text'](content)
$tip.removeClass('fade top bottom left right in')
// IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do
// this manually by checking the contents.
if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide()
}
Popover.prototype.hasContent = function () {
return this.getTitle() || this.getContent()
}
Popover.prototype.getContent = function () {
var $e = this.$element
var o = this.options
return $e.attr('data-content')
|| (typeof o.content == 'function' ?
o.content.call($e[0]) :
o.content)
}
Popover.prototype.arrow = function () {
return this.$arrow = this.$arrow || this.tip().find('.arrow')
}
Popover.prototype.tip = function () {
if (!this.$tip) this.$tip = $(this.options.template)
return this.$tip
}
// POPOVER PLUGIN DEFINITION
// =========================
var old = $.fn.popover
$.fn.popover = function (option) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.popover')
var options = typeof option == 'object' && option
if (!data) $this.data('bs.popover', (data = new Popover(this, options)))
if (typeof option == 'string') data[option]()
})
}
$.fn.popover.Constructor = Popover
// POPOVER NO CONFLICT
// ===================
$.fn.popover.noConflict = function () {
$.fn.popover = old
return this
}
}(jQuery);

View File

@@ -0,0 +1,158 @@
/* ========================================================================
* Bootstrap: scrollspy.js v3.0.3
* http://getbootstrap.com/javascript/#scrollspy
* ========================================================================
* Copyright 2013 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ======================================================================== */
+function ($) { "use strict";
// SCROLLSPY CLASS DEFINITION
// ==========================
function ScrollSpy(element, options) {
var href
var process = $.proxy(this.process, this)
this.$element = $(element).is('body') ? $(window) : $(element)
this.$body = $('body')
this.$scrollElement = this.$element.on('scroll.bs.scroll-spy.data-api', process)
this.options = $.extend({}, ScrollSpy.DEFAULTS, options)
this.selector = (this.options.target
|| ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
|| '') + ' .nav li > a'
this.offsets = $([])
this.targets = $([])
this.activeTarget = null
this.refresh()
this.process()
}
ScrollSpy.DEFAULTS = {
offset: 10
}
ScrollSpy.prototype.refresh = function () {
var offsetMethod = this.$element[0] == window ? 'offset' : 'position'
this.offsets = $([])
this.targets = $([])
var self = this
var $targets = this.$body
.find(this.selector)
.map(function () {
var $el = $(this)
var href = $el.data('target') || $el.attr('href')
var $href = /^#\w/.test(href) && $(href)
return ($href
&& $href.length
&& [[ $href[offsetMethod]().top + (!$.isWindow(self.$scrollElement.get(0)) && self.$scrollElement.scrollTop()), href ]]) || null
})
.sort(function (a, b) { return a[0] - b[0] })
.each(function () {
self.offsets.push(this[0])
self.targets.push(this[1])
})
}
ScrollSpy.prototype.process = function () {
var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
var scrollHeight = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight
var maxScroll = scrollHeight - this.$scrollElement.height()
var offsets = this.offsets
var targets = this.targets
var activeTarget = this.activeTarget
var i
if (scrollTop >= maxScroll) {
return activeTarget != (i = targets.last()[0]) && this.activate(i)
}
for (i = offsets.length; i--;) {
activeTarget != targets[i]
&& scrollTop >= offsets[i]
&& (!offsets[i + 1] || scrollTop <= offsets[i + 1])
&& this.activate( targets[i] )
}
}
ScrollSpy.prototype.activate = function (target) {
this.activeTarget = target
$(this.selector)
.parents('.active')
.removeClass('active')
var selector = this.selector
+ '[data-target="' + target + '"],'
+ this.selector + '[href="' + target + '"]'
var active = $(selector)
.parents('li')
.addClass('active')
if (active.parent('.dropdown-menu').length) {
active = active
.closest('li.dropdown')
.addClass('active')
}
active.trigger('activate.bs.scrollspy')
}
// SCROLLSPY PLUGIN DEFINITION
// ===========================
var old = $.fn.scrollspy
$.fn.scrollspy = function (option) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.scrollspy')
var options = typeof option == 'object' && option
if (!data) $this.data('bs.scrollspy', (data = new ScrollSpy(this, options)))
if (typeof option == 'string') data[option]()
})
}
$.fn.scrollspy.Constructor = ScrollSpy
// SCROLLSPY NO CONFLICT
// =====================
$.fn.scrollspy.noConflict = function () {
$.fn.scrollspy = old
return this
}
// SCROLLSPY DATA-API
// ==================
$(window).on('load', function () {
$('[data-spy="scroll"]').each(function () {
var $spy = $(this)
$spy.scrollspy($spy.data())
})
})
}(jQuery);

View File

@@ -0,0 +1,135 @@
/* ========================================================================
* Bootstrap: tab.js v3.0.3
* http://getbootstrap.com/javascript/#tabs
* ========================================================================
* Copyright 2013 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ======================================================================== */
+function ($) { "use strict";
// TAB CLASS DEFINITION
// ====================
var Tab = function (element) {
this.element = $(element)
}
Tab.prototype.show = function () {
var $this = this.element
var $ul = $this.closest('ul:not(.dropdown-menu)')
var selector = $this.data('target')
if (!selector) {
selector = $this.attr('href')
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
}
if ($this.parent('li').hasClass('active')) return
var previous = $ul.find('.active:last a')[0]
var e = $.Event('show.bs.tab', {
relatedTarget: previous
})
$this.trigger(e)
if (e.isDefaultPrevented()) return
var $target = $(selector)
this.activate($this.parent('li'), $ul)
this.activate($target, $target.parent(), function () {
$this.trigger({
type: 'shown.bs.tab'
, relatedTarget: previous
})
})
}
Tab.prototype.activate = function (element, container, callback) {
var $active = container.find('> .active')
var transition = callback
&& $.support.transition
&& $active.hasClass('fade')
function next() {
$active
.removeClass('active')
.find('> .dropdown-menu > .active')
.removeClass('active')
element.addClass('active')
if (transition) {
element[0].offsetWidth // reflow for transition
element.addClass('in')
} else {
element.removeClass('fade')
}
if (element.parent('.dropdown-menu')) {
element.closest('li.dropdown').addClass('active')
}
callback && callback()
}
transition ?
$active
.one($.support.transition.end, next)
.emulateTransitionEnd(150) :
next()
$active.removeClass('in')
}
// TAB PLUGIN DEFINITION
// =====================
var old = $.fn.tab
$.fn.tab = function ( option ) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.tab')
if (!data) $this.data('bs.tab', (data = new Tab(this)))
if (typeof option == 'string') data[option]()
})
}
$.fn.tab.Constructor = Tab
// TAB NO CONFLICT
// ===============
$.fn.tab.noConflict = function () {
$.fn.tab = old
return this
}
// TAB DATA-API
// ============
$(document).on('click.bs.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
e.preventDefault()
$(this).tab('show')
})
}(jQuery);

View File

@@ -0,0 +1,386 @@
/* ========================================================================
* Bootstrap: tooltip.js v3.0.3
* http://getbootstrap.com/javascript/#tooltip
* Inspired by the original jQuery.tipsy by Jason Frame
* ========================================================================
* Copyright 2013 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ======================================================================== */
+function ($) { "use strict";
// TOOLTIP PUBLIC CLASS DEFINITION
// ===============================
var Tooltip = function (element, options) {
this.type =
this.options =
this.enabled =
this.timeout =
this.hoverState =
this.$element = null
this.init('tooltip', element, options)
}
Tooltip.DEFAULTS = {
animation: true
, placement: 'top'
, selector: false
, template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'
, trigger: 'hover focus'
, title: ''
, delay: 0
, html: false
, container: false
}
Tooltip.prototype.init = function (type, element, options) {
this.enabled = true
this.type = type
this.$element = $(element)
this.options = this.getOptions(options)
var triggers = this.options.trigger.split(' ')
for (var i = triggers.length; i--;) {
var trigger = triggers[i]
if (trigger == 'click') {
this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
} else if (trigger != 'manual') {
var eventIn = trigger == 'hover' ? 'mouseenter' : 'focus'
var eventOut = trigger == 'hover' ? 'mouseleave' : 'blur'
this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
}
}
this.options.selector ?
(this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
this.fixTitle()
}
Tooltip.prototype.getDefaults = function () {
return Tooltip.DEFAULTS
}
Tooltip.prototype.getOptions = function (options) {
options = $.extend({}, this.getDefaults(), this.$element.data(), options)
if (options.delay && typeof options.delay == 'number') {
options.delay = {
show: options.delay
, hide: options.delay
}
}
return options
}
Tooltip.prototype.getDelegateOptions = function () {
var options = {}
var defaults = this.getDefaults()
this._options && $.each(this._options, function (key, value) {
if (defaults[key] != value) options[key] = value
})
return options
}
Tooltip.prototype.enter = function (obj) {
var self = obj instanceof this.constructor ?
obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type)
clearTimeout(self.timeout)
self.hoverState = 'in'
if (!self.options.delay || !self.options.delay.show) return self.show()
self.timeout = setTimeout(function () {
if (self.hoverState == 'in') self.show()
}, self.options.delay.show)
}
Tooltip.prototype.leave = function (obj) {
var self = obj instanceof this.constructor ?
obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type)
clearTimeout(self.timeout)
self.hoverState = 'out'
if (!self.options.delay || !self.options.delay.hide) return self.hide()
self.timeout = setTimeout(function () {
if (self.hoverState == 'out') self.hide()
}, self.options.delay.hide)
}
Tooltip.prototype.show = function () {
var e = $.Event('show.bs.'+ this.type)
if (this.hasContent() && this.enabled) {
this.$element.trigger(e)
if (e.isDefaultPrevented()) return
var $tip = this.tip()
this.setContent()
if (this.options.animation) $tip.addClass('fade')
var placement = typeof this.options.placement == 'function' ?
this.options.placement.call(this, $tip[0], this.$element[0]) :
this.options.placement
var autoToken = /\s?auto?\s?/i
var autoPlace = autoToken.test(placement)
if (autoPlace) placement = placement.replace(autoToken, '') || 'top'
$tip
.detach()
.css({ top: 0, left: 0, display: 'block' })
.addClass(placement)
this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)
var pos = this.getPosition()
var actualWidth = $tip[0].offsetWidth
var actualHeight = $tip[0].offsetHeight
if (autoPlace) {
var $parent = this.$element.parent()
var orgPlacement = placement
var docScroll = document.documentElement.scrollTop || document.body.scrollTop
var parentWidth = this.options.container == 'body' ? window.innerWidth : $parent.outerWidth()
var parentHeight = this.options.container == 'body' ? window.innerHeight : $parent.outerHeight()
var parentLeft = this.options.container == 'body' ? 0 : $parent.offset().left
placement = placement == 'bottom' && pos.top + pos.height + actualHeight - docScroll > parentHeight ? 'top' :
placement == 'top' && pos.top - docScroll - actualHeight < 0 ? 'bottom' :
placement == 'right' && pos.right + actualWidth > parentWidth ? 'left' :
placement == 'left' && pos.left - actualWidth < parentLeft ? 'right' :
placement
$tip
.removeClass(orgPlacement)
.addClass(placement)
}
var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight)
this.applyPlacement(calculatedOffset, placement)
this.$element.trigger('shown.bs.' + this.type)
}
}
Tooltip.prototype.applyPlacement = function(offset, placement) {
var replace
var $tip = this.tip()
var width = $tip[0].offsetWidth
var height = $tip[0].offsetHeight
// manually read margins because getBoundingClientRect includes difference
var marginTop = parseInt($tip.css('margin-top'), 10)
var marginLeft = parseInt($tip.css('margin-left'), 10)
// we must check for NaN for ie 8/9
if (isNaN(marginTop)) marginTop = 0
if (isNaN(marginLeft)) marginLeft = 0
offset.top = offset.top + marginTop
offset.left = offset.left + marginLeft
$tip
.offset(offset)
.addClass('in')
// check to see if placing tip in new offset caused the tip to resize itself
var actualWidth = $tip[0].offsetWidth
var actualHeight = $tip[0].offsetHeight
if (placement == 'top' && actualHeight != height) {
replace = true
offset.top = offset.top + height - actualHeight
}
if (/bottom|top/.test(placement)) {
var delta = 0
if (offset.left < 0) {
delta = offset.left * -2
offset.left = 0
$tip.offset(offset)
actualWidth = $tip[0].offsetWidth
actualHeight = $tip[0].offsetHeight
}
this.replaceArrow(delta - width + actualWidth, actualWidth, 'left')
} else {
this.replaceArrow(actualHeight - height, actualHeight, 'top')
}
if (replace) $tip.offset(offset)
}
Tooltip.prototype.replaceArrow = function(delta, dimension, position) {
this.arrow().css(position, delta ? (50 * (1 - delta / dimension) + "%") : '')
}
Tooltip.prototype.setContent = function () {
var $tip = this.tip()
var title = this.getTitle()
$tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
$tip.removeClass('fade in top bottom left right')
}
Tooltip.prototype.hide = function () {
var that = this
var $tip = this.tip()
var e = $.Event('hide.bs.' + this.type)
function complete() {
if (that.hoverState != 'in') $tip.detach()
}
this.$element.trigger(e)
if (e.isDefaultPrevented()) return
$tip.removeClass('in')
$.support.transition && this.$tip.hasClass('fade') ?
$tip
.one($.support.transition.end, complete)
.emulateTransitionEnd(150) :
complete()
this.$element.trigger('hidden.bs.' + this.type)
return this
}
Tooltip.prototype.fixTitle = function () {
var $e = this.$element
if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') {
$e.attr('data-original-title', $e.attr('title') || '').attr('title', '')
}
}
Tooltip.prototype.hasContent = function () {
return this.getTitle()
}
Tooltip.prototype.getPosition = function () {
var el = this.$element[0]
return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : {
width: el.offsetWidth
, height: el.offsetHeight
}, this.$element.offset())
}
Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) {
return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } :
placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } :
placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } :
/* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width }
}
Tooltip.prototype.getTitle = function () {
var title
var $e = this.$element
var o = this.options
title = $e.attr('data-original-title')
|| (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
return title
}
Tooltip.prototype.tip = function () {
return this.$tip = this.$tip || $(this.options.template)
}
Tooltip.prototype.arrow = function () {
return this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow')
}
Tooltip.prototype.validate = function () {
if (!this.$element[0].parentNode) {
this.hide()
this.$element = null
this.options = null
}
}
Tooltip.prototype.enable = function () {
this.enabled = true
}
Tooltip.prototype.disable = function () {
this.enabled = false
}
Tooltip.prototype.toggleEnabled = function () {
this.enabled = !this.enabled
}
Tooltip.prototype.toggle = function (e) {
var self = e ? $(e.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type) : this
self.tip().hasClass('in') ? self.leave(self) : self.enter(self)
}
Tooltip.prototype.destroy = function () {
this.hide().$element.off('.' + this.type).removeData('bs.' + this.type)
}
// TOOLTIP PLUGIN DEFINITION
// =========================
var old = $.fn.tooltip
$.fn.tooltip = function (option) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.tooltip')
var options = typeof option == 'object' && option
if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))
if (typeof option == 'string') data[option]()
})
}
$.fn.tooltip.Constructor = Tooltip
// TOOLTIP NO CONFLICT
// ===================
$.fn.tooltip.noConflict = function () {
$.fn.tooltip = old
return this
}
}(jQuery);

View File

@@ -0,0 +1,63 @@
/* ========================================================================
* Bootstrap: transition.js v3.0.3
* http://getbootstrap.com/javascript/#transitions
* ========================================================================
* Copyright 2013 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ======================================================================== */
+function ($) { "use strict";
// CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/)
// ============================================================
function transitionEnd() {
var el = document.createElement('bootstrap')
var transEndEventNames = {
'WebkitTransition' : 'webkitTransitionEnd'
, 'MozTransition' : 'transitionend'
, 'OTransition' : 'oTransitionEnd otransitionend'
, 'transition' : 'transitionend'
}
for (var name in transEndEventNames) {
if (el.style[name] !== undefined) {
return { end: transEndEventNames[name] }
}
}
}
// http://blog.alexmaccaw.com/css-transitions
$.fn.emulateTransitionEnd = function (duration) {
var called = false, $el = this
$(this).one($.support.transition.end, function () { called = true })
var callback = function () { if (!called) $($el).trigger($.support.transition.end) }
setTimeout(callback, duration)
return this
}
$(function () {
$.support.transition = transitionEnd()
});
// issue #SLWP-49
$(function () {
$(function () {
$.support.transition = transitionEnd();
});
});
}(jQuery);

View File

@@ -0,0 +1,126 @@
( function( $ ){
// CHECKBOX CONTROL CLASS DEFINITION
// ================================
var CheckboxControl = function (element) {
var self = this;
this.$element = $(element);
this.$result = this.$element.find(".factory-result");
this.$on = this.$element.find(".factory-on");
this.$off = this.$element.find(".factory-off");
var isTumbler = this.$element.is(".factory-tumbler");
var hasTumblerHint = this.$element.is(".factory-has-tumbler-hint");
var tumblerFunction = this.$element.data('tumbler-function');
var tumblerDelay = this.$element.data('tumbler-delay');
if ( !tumblerDelay ) tumblerDelay = 3000;
this.callByPath = function( functionName, args ) {
var parts = functionName.split(".");
var obj = window;
for( var i = 0; i < parts.length; i++ ) {
obj = obj[parts[i]];
}
obj.apply( obj, args );
}
this.$on.click(function(){
self.$off.removeClass('active');
self.$on.addClass('active');
if ( !isTumbler ) {
self.$result.attr('checked', 'checked');
self.$result.trigger('change');
} else {
setTimeout(function(){
self.$on.removeClass('active');
self.$off.addClass('active');
var $hint = hasTumblerHint ? self.$element.next() : null;
if ( tumblerFunction ) {
self.callByPath( tumblerFunction, [ self.$element, $hint] );
} else {
if ( hasTumblerHint ) {
self.$element.next().fadeIn(300);
setTimeout(function(){ self.$element.next().fadeOut( 500 ); }, tumblerDelay);
}
}
}, 300);
}
return false;
});
this.$off.click(function(){
self.$on.removeClass('active');
self.$off.addClass('active');
if ( !isTumbler ) {
self.$result.removeAttr('checked');
self.$result.trigger('change');
} else {
setTimeout(function(){
self.$off.removeClass('active');
self.$on.addClass('active');
var $hint = hasTumblerHint ? self.$element.next() : null;
if ( tumblerFunction ) {
self.callByPath( tumblerFunction, [ self.$element, $hint] );
} else {
if ( hasTumblerHint ) {
self.$element.next().fadeIn(300);
setTimeout(function(){ self.$element.next().fadeOut( 500 ); }, tumblerDelay);
}
}
}, 300);
}
return false;
});
};
// CHECKBOX CONTROL DEFINITION
// ================================
$.fn.factoryBootstrap331_checkboxControl = function (option) {
// call an method
if ( typeof option === "string" ) {
var data = $(this).data('factory.checkbox.control');
if ( !data ) return null;
return data[option]();
}
// creating an object
else {
return this.each(function () {
var $this = $(this);
var data = $this.data('factory.checkbox.control');
if (!data) $this.data('factory.checkbox.control', (data = new CheckboxControl(this)));
});
}
};
$.fn.factoryBootstrap331_checkboxControl.Constructor = CheckboxControl;
// AUTO CREATING
// ================================
$(function(){
$(".factory-bootstrap-331 .factory-checkbox.factory-buttons-way").factoryBootstrap331_checkboxControl();
});
}( jQuery ) );

View File

@@ -0,0 +1,32 @@
( function( $, undef ){
$(function(){
$(function(){
$(".factory-bootstrap-331 .factory-color-and-opacity").each(function(){
var $colorOpacityControl = $(this);
var $colorControl = $colorOpacityControl.find('.factory-color');
var $integerControl = $colorOpacityControl.find('.factory-integer');
// apply to change opacity of the preview
$integerControl.change(function(){
var opacityValue = $integerControl.find(".factory-result").val() / 100;
$colorControl.find('.factory-background').css('opacity', opacityValue );
});
$integerControl.change();
$integerControl.on("click.color.factory", function(e){
e.stopPropagation();
});
});
});
});
}( jQuery ) );

View File

@@ -0,0 +1,88 @@
/**
* Factory Botstrap Color Control
*
* @uses plugin.iris.js
*
* @author Paul Kashtanoff <paul@byonepress.com>
* @copyright (c) 2013-2014, OnePress Ltd
*
* @package factory-forms
* @since 3.1.0
*/
;( function( $ ){
$.widget( "factoryBootstrap331.colorControl", {
_create: function() {
this.$element = this.element;
this.$picker = this.$element.find('.factory-color-hex');
this.$preview = this.$element.find('.factory-preview');
this.$background = this.$element.find('.factory-background');
this._init();
},
_init: function( event ) {
var self = this;
var irisOptions = {
width: 216,
palettes: ['#16a086', '#27ae61', '#2a80b9', '#8f44ad', '#2d3e50', '#f49c14', '#c1392b', '#bec3c7'],
hide: true,
change: function(event, ui) {
self.$background.css({ background: ui.color.toString() });
self.$element.trigger('change.color.factory', [ ui.color.toString() ]);
self.$element.trigger('updated.color.factory', [ ui.color.toString() ]);
}
};
var picketTarget = this.$element.data('picker-target');
if ( picketTarget ) irisOptions.target = $(picketTarget);
this.$picker.factoryBootstrap331_iris(irisOptions);
this.$picker.off('focus');
$(document).on("click.color.factory", function(){
self.$picker.factoryBootstrap331_iris("hide");
});
this.$picker.add(this.$background).on("click.color.factory", function(e){
e.stopPropagation();
self.$picker.factoryBootstrap331_iris("show");
});
},
togglePicker: function() {
if( this.$element.hasClass('factory-picker-active') ) this.hidePicker();
else this.showPicker();
},
hidePicker: function() {
this.$element.removeClass('factory-picker-active');
this.$picker.factoryBootstrap331_iris( 'hide' );
},
showPicker: function() {
this.$element.addClass('factory-picker-active');
this.$picker.factoryBootstrap331_iris( 'show' );
},
getValue: function() {
return this.$picker.val();
},
setValue: function( value, trigger ) {
this.$picker.val(value);
if ( trigger ) self.$picker.trigger('change');
}
});
$(function(){
$.widget.bridge( "factoryBootstrap331_colorControl", $.factoryBootstrap331.colorControl );
$(".factory-bootstrap-331 .factory-color").factoryBootstrap331_colorControl({});
});
}( jQuery ) );

View File

@@ -0,0 +1,212 @@
( function( $ ){
// DROPDOWN CONTROL CLASS DEFINITION
// ================================
var DropdownControl = function (element) {
var self = this;
this.$element = $(element);
this.way = this.$element.data('way');
this.name = this.$element.data('name') || this.$element.attr('name');
if ( 'buttons' === this.way ) {
this.$result = this.$element.find(".factory-result");
this.$hints = this.$element.find(".factory-hints");
this.$buttons = this.$element.find(".btn");
this.$buttons.click(function(){
var value = $(this).data('value');
self.$buttons.removeClass('active');
$(this).addClass('active');
self.$hints.find(".factory-hint").hide();
self.$hints.find(".factory-hint-" + value).fadeIn();
self.$result.val(value);
self.$result.trigger('change');
return false;
});
} else if ( 'ddslick' === this.way ) {
var data = window['factory_' + this.name + "_data"];
var $ddslick = this.$element.find(".factory-ddslick");
var width = this.$element.data("width") || 300;
var imagePosition = this.$element.data("align") || 'right';
$(data).each(function(){
if ( !this.imageHoverSrc ) return true;
$('<img/>')[0].src = this.imageHoverSrc;
});
$ddslick.ddslick({
data: data,
width: width,
imagePosition: imagePosition,
selectText: "- select -",
onSelected: function (data) {
if ( data.selectedData.imageHoverSrc )
self.$element.find(".dd-selected-image").attr('src', data.selectedData.imageHoverSrc);
var $result = self.$element.find(".factory-result").val( data.selectedData.value );
$result.change();
}
});
} else {
// hints
this.$hints = this.$element.next();
if ( this.$hints.hasClass('factory-hints') ) {
this.$element.change(function(){
self.updateHints();
return false;
});
this.updateHints = function() {
var value = self.$element.val();
self.$hints.find(".factory-hint").hide();
self.$hints.find(".factory-hint-" + value).show();
};
self.updateHints();
}
// ajax
this.getAjaxData = function() {
var ajaxDataID = self.$element.data('ajax-data-id');
return window[ajaxDataID];
};
this.loadData = function() {
var ajaxData = self.getAjaxData();
var req = $.ajax({
url: ajaxData.url,
data: ajaxData.data,
dataType: 'json',
success: function( response ){
if ( response.error ) return self.showError( response.error );
self.fill( response.items );
},
error: function( response ) {
if ( console && console.log ) {
console.log( response.responseText );
}
self.showError('Unexpected error occurred during the ajax request.');
},
complete: function() {
self.removeLoader();
}
});
};
this.fill = function( items ) {
this.clearList();
var ajaxData = self.getAjaxData();
if ( !items || !items.length ) {
this.$element.append("<option>" + ajaxData.emptyList + "</li>");
} else {
for( var index in items ) {
var item = items[index];
self.addListItem( item );
}
}
this.$element.trigger("factory-loaded");
};
this.clearList = function() {
this.$element.html("");
};
this.addListItem = function( item ) {
var $option = $('<option />')
.attr('value', item.value)
.text(item.title)
.appendTo( this.$element );
var ajaxData = self.getAjaxData();
if ( ajaxData.selected && ajaxData.selected == item.value ) {
$option.attr('selected', 'selected');
}
};
this.showError = function( text ) {
this.clearList();
var $error = $("<div class='factory-control-error'></div>")
.append($("<i class='fa fa-exclamation-triangle'></i>"))
.append( text );
var ajaxData = self.getAjaxData();
this.$element.append("<option>" + ajaxData.emptyList + "</li>");
this.$element.after($error);
this.$element.addClass('factory-has-error');
};
this.removeLoader = function() {
this.$element.removeClass('factory-hidden');
var ajaxData = self.getAjaxData();
$( ajaxData.loader ).remove();
}
var ajax = this.$element.data('ajax');
if ( ajax ) this.loadData();
}
};
// DROPDOWN CONTROL DEFINITION
// ================================
$.fn.factoryBootstrap331_dropdownControl = function (option) {
// call an method
if ( typeof option === "string" ) {
var data = $(this).data('factory.dropdown.control');
if ( !data ) return null;
return data[option]();
}
// creating an object
else {
return this.each(function () {
var $this = $(this);
var data = $this.data('factory.dropdown.control');
if (!data) $this.data('factory.dropdown.control', (data = new DropdownControl(this)));
});
}
};
$.fn.factoryBootstrap331_dropdownControl.Constructor = DropdownControl;
// AUTO CREATING
// ================================
$(function(){
$(".factory-bootstrap-331 .factory-dropdown").factoryBootstrap331_dropdownControl();
});
}( jQuery ) );

View File

@@ -0,0 +1,196 @@
/**
* Font Control
*
* @author Paul Kashtanoff <paul@byonepress.com>
* @copyright (c) 2013-2014, OnePress Ltd
*
* @package factory-forms
* @since 3.1.0
*/
;( function( $ ){
$.widget( "factoryBootstrap331.fontControl", {
_create: function() {
this.$element = this.element;
this.$family = this.$element.find(".factory-family-wrap select");
this.$googleFontData = this.$element.find(".factory-google-font-data");
this.fontSelectorName = this.$family.attr('name');
this.googleFontsOptions = {
frameName: this.element.data('google-fonts-frame-name')
};
if ( !this.googleFontsOptions.frameName )
this.googleFontsOptions.frameName = 'preview';
this._initUI();
this._bindEvents();
},
_initUI: function() {
this.$family.chosen();
},
_bindEvents: function() {
var self = this;
this.$family.change(function( data ){
var $option = self._getCurrentOption();
var isGoogleFont = $option.data('google-font');
if ( isGoogleFont ) {
var family = $option.data('family');
var variants = $option.data('variants').split(',');
var subsets = $option.data('subsets').split(',');
self._loadGoogleFont( family, variants, subsets );
} else {
self.$googleFontData.val("");
}
});
},
_getCurrentOption: function() {
var value = this.$family.val();
return this._getOptionByValue( value );
},
_getOptionByValue: function( value ) {
var $option = this.$family.find("option[value='" + value + "']");
return $option;
},
_loadGoogleFont: function( family, variants, subsets ) {
// these filters allow extrenal apps to manage which variants
// and subsets have to be laoded and which should be skipped
var variants = this._filterGoogleFontVariantsBeforeLoading( family, variants, subsets );
var subsets = this._filterGoogleFontSubsetsBeforeLoading( family, variants, subsets );
this.$googleFontData.val(this._encode64(JSON.stringify({
name: family,
styles: variants,
subsets: subsets
})));
// the target is a place (current window or an iframe)
// where the font should be loaded
var $target = this._getTargetToLoadGoogleFont();
// the id is used to prevent loading multiple
// fonts for a single font control
var linkId = this.fontSelectorName + "-font-loader";
// removes the previous link with the same id
var $link = $target.find('#' + linkId);
if ( $target.find('#' + linkId).length > 0 ) {
$link.remove();
}
// builds an URL for loading the font
var url = 'http://fonts.googleapis.com/css';
if ( variants && variants.length ) family = family + ":" + variants.join(",");
url = url + '?family=' + family;
if ( subsets && subsets.length ) url = url + '&subset=' + subsets.join(",");
$('<link id="' + linkId + '" rel="stylesheet" type="text/css" href="' + url + '" >').appendTo( $target );
},
/**
* Calls external filters to modify the list of the google font variants to be loaded.
* @since 3.2.8
*/
_filterGoogleFontVariantsBeforeLoading: function( family, variants, subsets ) {
var self = this;
$(document).trigger('factory-filter-google-font-variants', [variants, self.$element, family, subsets]);
return variants;
},
/**
* Calls external filters to modify the list of the google font subsets to be loaded.
* @since 3.2.8
*/
_filterGoogleFontSubsetsBeforeLoading: function( family, variants, subsets ) {
var self = this;
$(document).trigger('factory-filter-google-font-subsets', [subsets, self.$element, variants, subsets]);
return subsets;
},
/**
* Returns a target element where the google font link element should be appended.
* @since 3.2.8
*/
_getTargetToLoadGoogleFont: function() {
var frameName = this.googleFontsOptions.frameName;
var $target = $('head');
if ( frameName ) {
var $frame = $('iframe[name="' + frameName + '"]');
if ( $frame.length === 0 ) return console.error('The preview container not found.');
$target = $frame.contents().find('head');
}
return $target;
},
_base64KeyStr: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
_encode64: function(input) {
input = escape(input);
var output = "";
var chr1, chr2, chr3 = "";
var enc1, enc2, enc3, enc4 = "";
var i = 0;
do {
chr1 = input.charCodeAt(i++);
chr2 = input.charCodeAt(i++);
chr3 = input.charCodeAt(i++);
enc1 = chr1 >> 2;
enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
enc4 = chr3 & 63;
if (isNaN(chr2)) {
enc3 = enc4 = 64;
} else if (isNaN(chr3)) {
enc4 = 64;
}
output = output +
this._base64KeyStr.charAt(enc1) +
this._base64KeyStr.charAt(enc2) +
this._base64KeyStr.charAt(enc3) +
this._base64KeyStr.charAt(enc4);
chr1 = chr2 = chr3 = "";
enc1 = enc2 = enc3 = enc4 = "";
} while (i < input.length);
return output;
}
});
$(function(){
$.widget.bridge( "factoryBootstrap331_fontControl", $.factoryBootstrap331.fontControl );
$(".factory-bootstrap-331 .factory-font").factoryBootstrap331_fontControl({});
});
}( jQuery ) );

View File

@@ -0,0 +1,51 @@
( function( $ ){
// GRADIENT CONTROL CLASS DEFINITION
// ================================
var GradientControl = function (el) {
this.$element = $(el);
this.$picker = this.$element.find(".factory-gradient-picker");
this.$result = this.$element.find(".factory-result");
this.init();
};
GradientControl.prototype.init = function() {
var self = this;
var directions = this.$element.data('directions');
var points = this.$element.data('points');
var arrPoints = points ? points.split(',') : [];
this.$picker.gradientPicker({
change: function(points, styles) {
self.$result.val(styles).trigger('keyup');
},
fillDirection: directions,
controlPoints: arrPoints
});
};
// GRADIENT CONTROL DEFINITION
// ================================
$.fn.factoryBootstrap331_gradientControl = function (option) {
return this.each(function () {
var $this = $(this);
var data = $this.data('factory.gradient-control');
if (!data) $this.data('factory.gradient-control', (data = new GradientControl(this)));
if (typeof option === 'string') data[option].call(data);
});
};
$.fn.factoryBootstrap331_gradientControl.Constructor = GradientControl;
// GRADIENT CREATING
// ================================
$(function(){
$(".factory-bootstrap-331 .factory-gradient").factoryBootstrap331_gradientControl();
});
}( jQuery ) );

View File

@@ -0,0 +1,102 @@
( function( $ ){
// INTEGER CONTROL CLASS DEFINITION
// ================================
var IntegerControl = function (el) {
this.$element = $(el);
if ( this.$element.hasClass('factory-has-slider') ) {
this.createSlider();
}
};
IntegerControl.prototype.createSlider = function() {
var self = this;
var $container = this.$element.find(".factory-slider-container");
this.$bar = $container.find(".factory-bar");
this.$result = $container.find(".factory-result");
this.$visibleValue = $container.find(".factory-visible-value");
this.units = $container.data('units');
this.rangeStart = $container.data('range-start');
this.rangeEnd = $container.data('range-end');
this.step = $container.data('step');
if ( !this.step ) this.step = 1;
var value = this.$result.val();
var setValue = function( value ) {
self.setValue( value );
}
this.$bar.noUiSlider({
start: parseInt( value ),
range: {min: self.rangeStart, max: self.rangeEnd},
connect: "lower",
step: self.step
});
this.$bar.on("slide set", function(){
self.setValue( parseInt( self.$bar.val() ) );
});
};
IntegerControl.prototype.setValue = function ( value, force) {
this.$result.val( value );
if ( this.$visibleValue.length > 0 ) {
if ( this.units ) this.$visibleValue.text(value + this.units);
else this.$visibleValue.text(value);
}
if ( force ) {
this.$bar.noUiSlider({ start: value }, true);
}
this.$result.trigger('keyup');
this.$element.trigger('change');
};
IntegerControl.prototype.getValue = function () {
return this.$result.val();
};
IntegerControl.prototype.api = function () {
return this;
};
// INTEGER CONTROL DEFINITION
// ================================
$.fn.factoryBootstrap331_integerControl = function (option) {
// call an method
if ( typeof option === "string" ) {
var data = $(this).data('factory.integer-control');
if ( !data ) return null;
return data[option]();
}
// creating an object
else {
return this.each(function () {
var $this = $(this);
var data = $this.data('factory.integer-control');
if (!data) $this.data('factory.integer-control', (data = new IntegerControl(this)));
});
}
};
$.fn.factoryBootstrap331_integerControl.Constructor = IntegerControl;
// AUTO CREATING
// ================================
$(function(){
$(".factory-bootstrap-331 .factory-integer").factoryBootstrap331_integerControl();
});
}( jQuery ) );

View File

@@ -0,0 +1,142 @@
( function( $ ){
var list = function (element) {
var self = this;
this.$element = $(element);
this.way = this.$element.data('way');
this.name = this.$element.data('name');
// curently the control supports only checklists
if ( 'checklist' !== this.way ) return;
this.getAjaxData = function() {
var ajaxDataID = self.$element.data('ajax-data-id');
return window[ajaxDataID];
}
this.loadData = function() {
var ajaxData = self.getAjaxData();
var req = $.ajax({
url: ajaxData.url,
data: ajaxData.data,
method: 'POST',
dataType: 'json',
success: function( response ){
if ( response.error ) return self.showError( response.error );
self.fill( response.items );
},
error: function() {
self.showError('Unexpected error occurred during the ajax request.');
},
complete: function() {
self.removeLoader();
}
});
};
this.fill = function( items ) {
this.clearList();
var ajaxData = self.getAjaxData();
if ( !items || !items.length ) {
this.$element.addClass('factory-empty');
this.$element.append("<li>" + ajaxData.emptyList + "</li>");
} else {
this.$element.removeClass('factory-empty');
for( var index in items ) {
var item = items[index];
self.addListItem( item );
}
}
};
this.clearList = function() {
this.$element.html("");
};
this.addListItem = function( item ) {
var $li = $('<li>');
var $label = $('<label>')
.attr('for', 'factory-checklist-' + self.name + '-' + item.value)
.appendTo($li);
var $checkboxSpan = $('<span>')
.appendTo($label);
var $checkbox = $('<input />')
.attr('type', 'checkbox')
.attr('name', self.name + "[]")
.val(item.value)
.attr('id', 'factory-checklist-' + self.name + '-' + item.value)
.appendTo($checkboxSpan);
var $title = $('<span>' + item.title + '</span>')
.appendTo($label);
var ajaxData = self.getAjaxData();
if ( ajaxData.selected.length && $.inArray( item.value, ajaxData.selected ) >= 0 ) {
$checkbox.attr('checked', 'checked');
}
this.$element.append($li);
};
this.showError = function( text ) {
this.$element.html("")
.append($("<i class='fa fa-exclamation-triangle'></i>"))
.append( text );
this.$element.addClass('factory-list-error');
};
this.removeLoader = function() {
this.$element.removeClass('factory-hidden');
var ajaxData = self.getAjaxData();
$( ajaxData.loader ).remove();
}
var ajax = this.$element.data('ajax');
if ( ajax ) this.loadData();
};
$.fn.factoryBootstrap331_listControl = function (option) {
// call an method
if ( typeof option === "string" ) {
var data = $(this).data('factory.list.control');
if ( !data ) return null;
return data[option]();
}
// creating an object
else {
return this.each(function () {
var $this = $(this);
var data = $this.data('factory.list.control');
if (!data) $this.data('factory.list.control', (data = new list(this)));
});
}
};
$.fn.factoryBootstrap331_listControl.Constructor = list;
$(function(){
$(".factory-bootstrap-331 .factory-list").factoryBootstrap331_listControl();
});
}( jQuery ) );

View File

@@ -0,0 +1,218 @@
/**
* Pattern Control
*
* @author Alex Kovalev <alex@byonepress.com>
* @author Paul Kashtanoff <paul@byonepress.com>
* @copyright (c) 2013-2014, OnePress Ltd
*
* @package factory-forms
* @since 3.1.0
*/
;( function( $ ){
$.widget( "factoryBootstrap331.patternControl", {
_create: function() {
this.$element = this.element;
this.$preview = this.$element.find(".factory-preview");
this.$patternResult = this.$element.find(".factory-pattern-result");
this.$colorResult = this.$element.find(".factory-color-result");
this.$patterns = this.$element.find(".factory-patterns-panel");
this.$patternItems = this.$element.find(".factory-patterns-item");
this.$btnUpload = this.$element.find(".factory-upload-btn");
this.$btnChangeColor = this.$element.find(".factory-change-color-btn");
this.$colorPanel = this.$element.find(".factory-color-panel");
this.$colorContol = this.$element.find(".factory-color");
this._initMainPanel();
this._initColorPickerPanel();
this._initPatternsPanel();
},
/**
* Inits the Main Panel with the dropdown and buttons.
*
* @since 3.1.0
* @return void
*/
_initMainPanel: function( ) {
var self = this;
// a click on a preview opens the patterns panel
this.$preview.on('click', function(){
self.togglePatternsPanel();
return false;
});
// the button showing the panel to a pattern change color
this.$btnChangeColor.on('click', function(){
self.toggleColorPanel();
return false;
});
},
/**
* Toggles the panel with which the user can choose another color for a pattern.
*
* @since 3.1.0
* @returns void
*/
togglePatternsPanel: function() {
if ( this.$element.hasClass('factory-patterns-panel-active') ) this.hidePatternsPanel();
else this.showPatternsPanel();
},
/**
* Hides the panel with which the user can choose another color for a pattern.
*
* @since 3.1.0
* @returns void
*/
hidePatternsPanel: function() {
this.$element.removeClass('factory-patterns-panel-active');
},
/**
* Shows the panel with which the user can choose another color for a pattern.
*
* @since 3.1.0
* @returns void
*/
showPatternsPanel: function() {
this.$element.addClass('factory-patterns-panel-active');
},
/**
* Returns true if the pattern has the color options set.
*
* @since 3.1.0
* @returns bool
*/
hasColor: function() {
return this.$element.hasClass('factory-color-panel-active');
},
/**
* Toggles the panel with which the user can choose another color for a pattern.
*
* @since 3.1.0
* @returns void
*/
toggleColorPanel: function() {
if ( this.hasColor() ) this.hideColorPanel();
else this.showColorPanel();
},
/**
* Hides the panel with which the user can choose another color for a pattern.
*
* @since 3.1.0
* @returns void
*/
hideColorPanel: function() {
this.$element.removeClass('factory-color-panel-active');
this.$btnChangeColor.removeClass('button-active');
this.$colorResult.val('');
this.$colorResult.trigger('change');
this.$element.trigger('change');
},
/**
* Shows the panel with which the user can choose another color for a pattern.
*
* @since 3.1.0
* @returns void
*/
showColorPanel: function() {
this.$element.addClass('factory-color-panel-active');
this.$btnChangeColor.addClass('button-active');
this.$colorResult.val( this.$colorContol.factoryBootstrap331_colorControl('getValue') );
this.$colorResult.trigger('change');
this.$element.trigger('change');
},
/**
* Inits the Color Picker panel.
*
* @since 3.1.0
* @return void
*/
_initColorPickerPanel: function() {
var self = this;
this.$colorContol.bind('updated.color.factory', function( e, color ){
self.$colorResult.val( color );
return false;
});
},
/**
* Inits the Patterns Panel.
*
* @since 3.1.0
* @return void
*/
_initPatternsPanel: function() {
var self = this;
// the upload button
var _custom_media = true,
_orig_send_attachment = wp.media.editor.send.attachment;
this.$btnUpload.on('click', function(){
_custom_media = true;
wp.media.editor.send.attachment = function(props, attachment){
if ( _custom_media ) {
self.$preview.css({background:'url('+attachment.url+') repeat', border:'0', fontSize:'0'});
self.$patternResult.attr('value', attachment.url).trigger('change');
} else {
return _orig_send_attachment.apply( this, [props, attachment] );
};
}
wp.media.editor.open( self.$btnUpload );
$('.add_media').on('click', function(){
_custom_media = false;
});
return false;
});
// selecting a pattern
this.$patternItems.on('click', function(){
if( $(this).data('pattern') ) {
var puthImage = $(this).data('pattern');
self.$preview.removeClass('factory-empty');
self.$preview.css({ background: 'url('+puthImage+') repeat' });
self.$patternResult.attr('value', puthImage).trigger('change');
}
});
}
});
$(function(){
$.widget.bridge( "factoryBootstrap331_patternControl", $.factoryBootstrap331.patternControl );
$(".factory-bootstrap-331 .factory-pattern").factoryBootstrap331_patternControl({});
});
}( jQuery ) );

View File

@@ -0,0 +1,28 @@
/**
* Конвертирует hex в rgb
*/
function hexToRgb(hex) {
// Expand shorthand form (e.g. "03F") to full form (e.g. "0033FF")
var shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
hex = hex.replace(shorthandRegex, function(m, r, g, b) {
return r + r + g + g + b + b;
});
var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
return result ? {
r: parseInt(result[1], 16),
g: parseInt(result[2], 16),
b: parseInt(result[3], 16)
} : null;
}
/**
* Конвертирует rgb в hex
*/
function rgb2hex(rgb){
rgb = rgb.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);
return "#" +
("0" + parseInt(rgb[1],10).toString(16)).slice(-2) +
("0" + parseInt(rgb[2],10).toString(16)).slice(-2) +
("0" + parseInt(rgb[3],10).toString(16)).slice(-2);
}

View File

@@ -0,0 +1,20 @@
/**
*jQuery Control group holder
*/
(function( $ ) {
$(document).ready(function(){
$('.factory-control-group-nav-label').on('click', function(){
var parent = $(this).parents('.factory-control-group');
if( !$(this).hasClass('active') ) {
$('.factory-control-group-nav-label', parent).add('.factory-control-group-item', parent).removeClass('current');
$('.factory-control-is-active', parent).val(0);
$(this).add($("." + $(this).data('control-id'), parent)).addClass('current');
parent.children('input[type="hidden"]').val($(this).data('control-name')).trigger('change');
$('.factory-control-is-active', $("." + $(this).data('control-id'), parent)).val(1);
}
return false;
});
});
}(jQuery));

View File

@@ -0,0 +1,37 @@
/**
* Factory More Link
*/
;(function ( $, window, document, undefined ) {
"use strict"; // jshint ;_;
var pluginName = 'factoryBootstrap331_moreLink';
$.fn[pluginName] = function ( param1, param2 ) {
return this.each(function () {
var $this = $(this);
$this.find(".factory-more-link-show").click(function(){
$( $(this).attr('href') ).fadeIn();
$(this).hide();
return false;
});
$this.find(".factory-more-link-hide").click(function(){
var content = $( $(this).attr('href') );
content.fadeOut(300, function(){
content.parents(".factory-more-link").find(".factory-more-link-show").show();
});
return false;
});
});
};
// auto init
$(function(){
$('.factory-bootstrap-331 .factory-more-link').factoryBootstrap331_moreLink();
});
})( jQuery, window, document );

View File

@@ -0,0 +1,595 @@
/**
* jQuery Color
* A utility class for working with colors in JavaScript.
*/
(function(global, undef) {
var Color = function( color, type ) {
if ( ! ( this instanceof Color ) )
return new Color( color, type );
return this._init( color, type );
};
Color.fn = Color.prototype = {
_color: 0,
_alpha: 1,
error: false,
// for preserving hue/sat in fromHsl().toHsl() flows
_hsl: { h: 0, s: 0, l: 0 },
// for preserving hue/sat in fromHsv().toHsv() flows
_hsv: { h: 0, s: 0, v: 0 },
// for setting hsl or hsv space - needed for .h() & .s() functions to function properly
_hSpace: 'hsl',
_init: function( color ) {
var func = 'noop';
switch ( typeof color ) {
case 'object':
// alpha?
if ( color.a !== undef )
this.a( color.a );
func = ( color.r !== undef ) ? 'fromRgb' :
( color.l !== undef ) ? 'fromHsl' :
( color.v !== undef ) ? 'fromHsv' : func;
return this[func]( color );
case 'string':
return this.fromCSS( color );
case 'number':
return this.fromInt( parseInt( color, 10 ) );
}
return this;
},
_error: function() {
this.error = true;
return this;
},
clone: function() {
var newColor = new Color( this.toInt() ),
copy = ['_alpha', '_hSpace', '_hsl', '_hsv', 'error'];
for ( var i = copy.length - 1; i >= 0; i-- ) {
newColor[ copy[i] ] = this[ copy[i] ];
}
return newColor;
},
setHSpace: function( space ) {
this._hSpace = ( space === 'hsv' ) ? space : 'hsl';
return this;
},
noop: function() {
return this;
},
fromCSS: function( color ) {
var list,
leadingRE = /^(rgb|hs(l|v))a?\(/;
this.error = false;
// whitespace and semicolon trim
color = color.replace(/^\s+/, '').replace(/\s+$/, '').replace(/;$/, '');
if ( color.match(leadingRE) && color.match(/\)$/) ) {
list = color.replace(/(\s|%)/g, '').replace(leadingRE, '').replace(/,?\);?$/, '').split(',');
if ( list.length < 3 )
return this._error();
if ( list.length === 4 ) {
this.a( parseFloat( list.pop() ) );
// error state has been set to true in .a() if we passed NaN
if ( this.error )
return this;
}
for (var i = list.length - 1; i >= 0; i--) {
list[i] = parseInt(list[i], 10);
if ( isNaN( list[i] ) )
return this._error();
}
if ( color.match(/^rgb/) ) {
return this.fromRgb( {
r: list[0],
g: list[1],
b: list[2]
} );
} else if ( color.match(/^hsv/) ) {
return this.fromHsv( {
h: list[0],
s: list[1],
v: list[2]
} );
} else {
return this.fromHsl( {
h: list[0],
s: list[1],
l: list[2]
} );
}
} else {
// must be hex amirite?
return this.fromHex( color );
}
},
fromRgb: function( rgb, preserve ) {
if ( typeof rgb !== 'object' || rgb.r === undef || rgb.g === undef || rgb.b === undef )
return this._error();
this.error = false;
return this.fromInt( parseInt( ( rgb.r << 16 ) + ( rgb.g << 8 ) + rgb.b, 10 ), preserve );
},
fromHex: function( color ) {
color = color.replace(/^#/, '').replace(/^0x/, '');
if ( color.length === 3 ) {
color = color[0] + color[0] + color[1] + color[1] + color[2] + color[2];
}
// rough error checking - this is where things go squirrely the most
this.error = ! /^[0-9A-F]{6}$/i.test( color );
return this.fromInt( parseInt( color, 16 ) );
},
fromHsl: function( hsl ) {
var r, g, b, q, p, h, s, l;
if ( typeof hsl !== 'object' || hsl.h === undef || hsl.s === undef || hsl.l === undef )
return this._error();
this._hsl = hsl; // store it
this._hSpace = 'hsl'; // implicit
h = hsl.h / 360; s = hsl.s / 100; l = hsl.l / 100;
if ( s === 0 ) {
r = g = b = l; // achromatic
}
else {
q = l < 0.5 ? l * ( 1 + s ) : l + s - l * s;
p = 2 * l - q;
r = this.hue2rgb( p, q, h + 1/3 );
g = this.hue2rgb( p, q, h );
b = this.hue2rgb( p, q, h - 1/3 );
}
return this.fromRgb( {
r: r * 255,
g: g * 255,
b: b * 255
}, true ); // true preserves hue/sat
},
fromHsv: function( hsv ) {
var h, s, v, r, g, b, i, f, p, q, t;
if ( typeof hsv !== 'object' || hsv.h === undef || hsv.s === undef || hsv.v === undef )
return this._error();
this._hsv = hsv; // store it
this._hSpace = 'hsv'; // implicit
h = hsv.h / 360; s = hsv.s / 100; v = hsv.v / 100;
i = Math.floor( h * 6 );
f = h * 6 - i;
p = v * ( 1 - s );
q = v * ( 1 - f * s );
t = v * ( 1 - ( 1 - f ) * s );
switch( i % 6 ) {
case 0:
r = v; g = t; b = p;
break;
case 1:
r = q; g = v; b = p;
break;
case 2:
r = p; g = v; b = t;
break;
case 3:
r = p; g = q; b = v;
break;
case 4:
r = t; g = p; b = v;
break;
case 5:
r = v; g = p; b = q;
break;
}
return this.fromRgb( {
r: r * 255,
g: g * 255,
b: b * 255
}, true ); // true preserves hue/sat
},
// everything comes down to fromInt
fromInt: function( color, preserve ) {
this._color = parseInt( color, 10 );
if ( isNaN( this._color ) )
this._color = 0;
// let's coerce things
if ( this._color > 16777215 )
this._color = 16777215;
else if ( this._color < 0 )
this._color = 0;
// let's not do weird things
if ( preserve === undef ) {
this._hsv.h = this._hsv.s = this._hsl.h = this._hsl.s = 0;
}
// EVENT GOES HERE
return this;
},
hue2rgb: function( p, q, t ) {
if ( t < 0 ) {
t += 1;
}
if ( t > 1 ) {
t -= 1;
}
if ( t < 1/6 ) {
return p + ( q - p ) * 6 * t;
}
if ( t < 1/2 ) {
return q;
}
if ( t < 2/3 ) {
return p + ( q - p ) * ( 2/3 - t ) * 6;
}
return p;
},
toString: function() {
var hex = parseInt( this._color, 10 ).toString( 16 );
if ( this.error )
return '';
// maybe left pad it
if ( hex.length < 6 ) {
for (var i = 6 - hex.length - 1; i >= 0; i--) {
hex = '0' + hex;
}
}
return '#' + hex;
},
toCSS: function( type, alpha ) {
type = type || 'hex';
alpha = parseFloat( alpha || this._alpha );
switch ( type ) {
case 'rgb':
case 'rgba':
var rgb = this.toRgb();
if ( alpha < 1 ) {
return "rgba( " + rgb.r + ", " + rgb.g + ", " + rgb.b + ", " + alpha + " )";
}
else {
return "rgb( " + rgb.r + ", " + rgb.g + ", " + rgb.b + " )";
}
break;
case 'hsl':
case 'hsla':
var hsl = this.toHsl();
if ( alpha < 1 ) {
return "hsla( " + hsl.h + ", " + hsl.s + "%, " + hsl.l + "%, " + alpha + " )";
}
else {
return "hsl( " + hsl.h + ", " + hsl.s + "%, " + hsl.l + "% )";
}
break;
default:
return this.toString();
}
},
toRgb: function() {
return {
r: 255 & ( this._color >> 16 ),
g: 255 & ( this._color >> 8 ),
b: 255 & ( this._color )
};
},
toHsl: function() {
var rgb = this.toRgb();
var r = rgb.r / 255, g = rgb.g / 255, b = rgb.b / 255;
var max = Math.max( r, g, b ), min = Math.min( r, g, b );
var h, s, l = ( max + min ) / 2;
if ( max === min ) {
h = s = 0; // achromatic
} else {
var d = max - min;
s = l > 0.5 ? d / ( 2 - max - min ) : d / ( max + min );
switch ( max ) {
case r: h = ( g - b ) / d + ( g < b ? 6 : 0 );
break;
case g: h = ( b - r ) / d + 2;
break;
case b: h = ( r - g ) / d + 4;
break;
}
h /= 6;
}
// maintain hue & sat if we've been manipulating things in the HSL space.
h = Math.round( h * 360 );
if ( h === 0 && this._hsl.h !== h ) {
h = this._hsl.h;
}
s = Math.round( s * 100 );
if ( s === 0 && this._hsl.s ) {
s = this._hsl.s;
}
return {
h: h,
s: s,
l: Math.round( l * 100 )
};
},
toHsv: function() {
var rgb = this.toRgb();
var r = rgb.r / 255, g = rgb.g / 255, b = rgb.b / 255;
var max = Math.max( r, g, b ), min = Math.min( r, g, b );
var h, s, v = max;
var d = max - min;
s = max === 0 ? 0 : d / max;
if ( max === min ) {
h = s = 0; // achromatic
} else {
switch( max ){
case r:
h = ( g - b ) / d + ( g < b ? 6 : 0 );
break;
case g:
h = ( b - r ) / d + 2;
break;
case b:
h = ( r - g ) / d + 4;
break;
}
h /= 6;
}
// maintain hue & sat if we've been manipulating things in the HSV space.
h = Math.round( h * 360 );
if ( h === 0 && this._hsv.h !== h ) {
h = this._hsv.h;
}
s = Math.round( s * 100 );
if ( s === 0 && this._hsv.s ) {
s = this._hsv.s;
}
return {
h: h,
s: s,
v: Math.round( v * 100 )
};
},
toInt: function() {
return this._color;
},
toIEOctoHex: function() {
// AARRBBGG
var hex = this.toString();
var AA = parseInt( 255 * this._alpha, 10 ).toString(16);
if ( AA.length === 1 ) {
AA = '0' + AA;
}
return '#' + AA + hex.replace(/^#/, '' );
},
toLuminosity: function() {
var rgb = this.toRgb();
return 0.2126 * Math.pow( rgb.r / 255, 2.2 ) + 0.7152 * Math.pow( rgb.g / 255, 2.2 ) + 0.0722 * Math.pow( rgb.b / 255, 2.2);
},
getDistanceLuminosityFrom: function( color ) {
if ( ! ( color instanceof Color ) ) {
throw 'getDistanceLuminosityFrom requires a Color object';
}
var lum1 = this.toLuminosity();
var lum2 = color.toLuminosity();
if ( lum1 > lum2 ) {
return ( lum1 + 0.05 ) / ( lum2 + 0.05 );
}
else {
return ( lum2 + 0.05 ) / ( lum1 + 0.05 );
}
},
getMaxContrastColor: function() {
var lum = this.toLuminosity();
var hex = ( lum >= 0.5 ) ? '000000' : 'ffffff';
return new Color( hex );
},
getReadableContrastingColor: function( bgColor, minContrast ) {
if ( ! bgColor instanceof Color ) {
return this;
}
// you shouldn't use less than 5, but you might want to.
var targetContrast = ( minContrast === undef ) ? 5 : minContrast;
// working things
var contrast = bgColor.getDistanceLuminosityFrom( this );
var maxContrastColor = bgColor.getMaxContrastColor();
var maxContrast = maxContrastColor.getDistanceLuminosityFrom( bgColor );
// if current max contrast is less than the target contrast, we had wishful thinking.
// still, go max
if ( maxContrast <= targetContrast ) {
return maxContrastColor;
}
// or, we might already have sufficient contrast
else if ( contrast >= targetContrast ) {
return this;
}
var incr = ( 0 === maxContrastColor.toInt() ) ? -1 : 1;
while ( contrast < targetContrast ) {
this.l( incr, true ); // 2nd arg turns this into an incrementer
contrast = this.getDistanceLuminosityFrom( bgColor );
// infininite loop prevention: you never know.
if ( this._color === 0 || this._color === 16777215 ) {
break;
}
}
return this;
},
a: function( val ) {
if ( val === undef )
return this._alpha;
var a = parseFloat( val );
if ( isNaN( a ) )
return this._error();
this._alpha = a;
return this;
},
// TRANSFORMS
darken: function( amount ) {
amount = amount || 5;
return this.l( - amount, true );
},
lighten: function( amount ) {
amount = amount || 5;
return this.l( amount, true );
},
saturate: function( amount ) {
amount = amount || 15;
return this.s( amount, true );
},
desaturate: function( amount ) {
amount = amount || 15;
return this.s( - amount, true );
},
toGrayscale: function() {
return this.setHSpace('hsl').s( 0 );
},
getComplement: function() {
return this.h( 180, true );
},
getSplitComplement: function( step ) {
step = step || 1;
var incr = 180 + ( step * 30 );
return this.h( incr, true );
},
getAnalog: function( step ) {
step = step || 1;
var incr = step * 30;
return this.h( incr, true );
},
getTetrad: function( step ) {
step = step || 1;
var incr = step * 60;
return this.h( incr, true );
},
getTriad: function( step ) {
step = step || 1;
var incr = step * 120;
return this.h( incr, true );
},
_partial: function( key ) {
var prop = shortProps[key];
return function( val, incr ) {
var color = this._spaceFunc('to', prop.space);
// GETTER
if ( val === undef )
return color[key];
// INCREMENT
if ( incr === true )
val = color[key] + val;
// MOD & RANGE
if ( prop.mod )
val = val % prop.mod;
if ( prop.range )
val = ( val < prop.range[0] ) ? prop.range[0] : ( val > prop.range[1] ) ? prop.range[1] : val;
// NEW VALUE
color[key] = val;
return this._spaceFunc('from', prop.space, color);
};
},
_spaceFunc: function( dir, s, val ) {
var space = s || this._hSpace,
funcName = dir + space.charAt(0).toUpperCase() + space.substr(1);
return this[funcName](val);
}
};
var shortProps = {
h: {
mod: 360
},
s: {
range: [0,100]
},
l: {
space: 'hsl',
range: [0,100]
},
v: {
space: 'hsv',
range: [0,100]
},
r: {
space: 'rgb',
range: [0,255]
},
g: {
space: 'rgb',
range: [0,255]
},
b: {
space: 'rgb',
range: [0,255]
}
};
for ( var key in shortProps ) {
if ( shortProps.hasOwnProperty( key ) )
Color.fn[key] = Color.fn._partial(key);
}
// play nicely with Node + browser
if ( typeof exports === 'object' )
module.exports = Color;
else
global.Color = Color;
}(this));

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,585 @@
/**
*jQuery gradient generator
@author Matt Crinklaw-Vogt (tantaman)
*/
(function( $ ) {
if (!$.event.special.destroyed) {
$.event.special.destroyed = {
remove: function(o) {
if (o.handler) {
o.handler();
}
}
}
}
//Сортирует в порядке убывания
function ctrlPtComparator(l,r) {
return l.position - r.position;
}
//Преобразует и инициализирует объекты вне области видимости
function bind(fn, ctx) {
if (typeof fn.bind === "function") {
return fn.bind(ctx);
} else {
return function() {
fn.apply(ctx, arguments);
}
}
}
var agent = window.navigator.userAgent;
var browserPrefix = ["-webkit-", "-moz-", "-ms-"];
var x,y = 0;
function GradientSelection($el, opts) {
var self = this;
this.$el = $el;
this.$presets = this.$el.find('.gradientPicker-pallets');
this.$presetsItems = this.$presets.find('.factory-preset-gradient');
this.$preview = this.$el.find(".gradientPicker-preview");
this.$pointsContainer = this.$el.find(".factory-points");
this.$colorPickerContainer = this.$el.find(".factory-color-picker-container");
this.$colorPicker = this.$el.find(".factory-color-picker");
this.$colorHex = this.$el.find(".factory-color-hex");
this.$opacitySliderContainer = this.$el.find(".factory-slider-container");
this.$opacitySlider = this.$el.find(".factory-bar");
this.$el.css("position", "relative");
this.opts = opts;
this._createPresetGradients();
this._createPreview();
this._createColorPicker();
this._createDirectionDropdown();
this.controlPoints = [];
opts.controlPoints = opts.controlPoints || [];
for (var i = 0; i < opts.controlPoints.length; ++i) {
var ctrlPt = this.createCtrlPt(opts.controlPoints[i]);
this.controlPoints.push(ctrlPt);
}
// if the gradient is not specified by default
// then we're using the first preset gradient
if ( this.controlPoints.length === 0 ) {
this.controlPoints.push( this.createCtrlPt( this.$presetsItems.data('primary') + " 0% 1" ) );
this.controlPoints.push( this.createCtrlPt( this.$presetsItems.data('secondary') + " 100% 1" ) );
}
// hides a color picker on losing the focus
$(document).on('click.gp.factory', function(){
self.hideColorPicker();
});
// doesn't hide on clicks inside the picker container
this.$colorPickerContainer.on('click.gp.factory', function(e){
e.stopPropagation();
});
this.$pointsContainer.on('click.gp.factory',function(e){
e.stopPropagation();
self.placePoint(e);
});
this.updatePreview();
}
GradientSelection.prototype = {
/* ----------------------------------------------------------------------------- */
/* Markup & Events
/* ----------------------------------------------------------------------------- */
/**
* Creates a panel with preset gradients.
*
* @returns void
*/
_createPresetGradients: function() {
var self = this;
// painting the preset gradients
this.$presetsItems.each(function(){
var $item = $(this);
var $secondaryColorWrap = $('<span class="factory-secondary-color-wrap"></span>').appendTo( $item );
var $secondaryColor = $('<span class="factory-secondary-color"></span>').appendTo($secondaryColorWrap);
$item.css("background", $item.data('primary'));
$secondaryColor.css("background", $item.data('secondary'));
});
// set gradient on clicl
this.$presetsItems.click(function(){
var primaryColor = $(this).data('primary');
var secondaryColor = $(this).data('secondary');
self.setGradient([primaryColor + " 0% 1", secondaryColor + " 100% 1"]);
});
},
/**
* Creates the gradient preview.
* @returns {undefined}
*/
_createPreview: function() {
var canvas = this.$preview[0];
canvas.width = canvas.clientWidth === 0 ? 210 : canvas.clientWidth;
canvas.height = canvas.clientHeight === 0 ? 30 : canvas.clientHeight;
this.g2d = canvas.getContext("2d");
},
/**
* Creates a color picker for points.
*
* @return void
*/
_createColorPicker: function() {
var self = this;
this.$colorPicker.factoryBootstrap331_iris({
width: 217,
palettes: ['#16a086', '#27ae61', '#2a80b9', '#8f44ad', '#2d3e50', '#f49c14', '#c1392b', '#bec3c7'],
hide: true,
change: function(event, ui) {
self.currentPoint.updateColor( ui.color.toString() );
if ( !self._colorLock ) self.$colorHex.val( ui.color.toString() );
}
});
self.$colorHex.on('change paste keyup', function(){
self._colorLock = true;
self.$colorPicker.factoryBootstrap331_iris('color', self.$colorHex.val());
self._cancelColorLock();
});
this.$opacitySlider.noUiSlider({
start: 100,
range: {'min': 0, 'max': 100 },
step: 1
});
this.$opacitySlider.on('slide', function(){
var value = parseInt( self.$opacitySlider.val() );
var valueWithUnits = value + "%";
self.$opacitySliderContainer.find(".factory-visible-value").text(valueWithUnits);
self.currentPoint.updateOpacity( value / 100 );
});
this.$opacitySlider.on('set', function(){
self.$result.val( self.getValue() );
self.$result.trigger('change');
});
},
/**
* The code that allows to a dead loop when editing the hex value directly.
*/
_repeatColorLock: false,
_colorLock: false,
_colorLockTimer: false,
_cancelColorLock: function( force ) {
var self = this;
if ( self._colorLockTimer && !force ) {
this._repeatColorLock = true;
return false;
}
this._colorLockTimer = setTimeout(function(){
if ( self._repeatColorLock ) {
self._repeatColorLock = false;
self._cancelColorLock( true );
return false;
}
self._colorLock = false;
self._colorLockTimer = false;
self._repeatColorLock = false;
}, 500);
},
/**
* Creates the gradient direction dropdown.
*
* @returns void
*/
_createDirectionDropdown: function() {
var self = this;
var resVertical = factory && factory.res && factory.res.resVertical || 'vertical';
var resHorizontal = factory && factory.res && factory.res.resHorizontal || 'horizontal';
this.$directionDropdown =
$('<select class="gradientPicker-filldirection">'+
'<option value="vertical"'+ (self.opts.fillDirection === 'top' ? ' selected' : '') +'>' + resVertical + '</option>'+
'<option value="horizontal"'+ (self.opts.fillDirection === 'left' ? ' selected' : '') +'>' + resHorizontal + '</option>'+
'</select>');
this.$el.append( this.$directionDropdown );
this.$directionDropdown.chosen();
this.$directionDropdown.change(function(){
self.setGradientDirection( $(this).val() );
});
},
/* ----------------------------------------------------------------------------- */
/* Actions
/* ----------------------------------------------------------------------------- */
/**
* Shows a color picker for the given point.
*
* @param ControlPoint point
* @returns void
*/
showColorPicker: function( point ) {
this.currentPoint = point;
$(".factory-current-point").removeClass('factory-current-point');
point.$el.addClass('factory-current-point');
this.$colorPickerContainer.show();
this.$colorPicker.factoryBootstrap331_iris( 'show' );
this.$colorPicker.factoryBootstrap331_iris( 'option', 'color', point.color );
this.$opacitySlider.val( point.opacity * 100 );
this.$opacitySlider.trigger('slide');
},
hideColorPicker: function() {
$(".factory-current-point").removeClass('factory-current-point');
this.currentPoint = false;
this.$colorPickerContainer.hide();
},
isColorPickerShown: function() {
return this.currentPoint;
},
docClicked: function() {
//this.ctrlPtConfig.hide();
$('.gradientPicker-iris-wrap').hide();
$('.gradientPicker-ctrlPt').removeClass('open');
},
createCtrlPt: function(ctrlPtSetup) {
return new ControlPoint(this, ctrlPtSetup, this.opts.orientation)
},
/**
* Upadtes given options.
*
* @param array opts
* @param bool recreatPoints
* @returns void
*/
updateOptions: function( opts, recreatPoints ) {
$.extend(this.opts, opts);
if( recreatPoints ) {
this.controlPoints = [];
this.$pointsContainer.html('');
for (var i = 0; i < this.opts.controlPoints.length; ++i) {
var ctrlPt = this.createCtrlPt(this.opts.controlPoints[i]);
this.controlPoints.push(ctrlPt);
}
}
this.updatePreview();
switch ( this.opts.fillDirection ) {
case 'top':
fillDirectCheck = 'horizontal';
break;
case 'left':
fillDirectCheck = 'vertical';
break;
default:
fillDirectCheck = false;
break;
}
if( fillDirectCheck )
$('.gradientPicker-filldirection', this.$el).find('option[value="' + fillDirectCheck + '"]').prop('selected', true);
},
/**
* Refreshes the gradient preview.
*
* @returns void
*/
updatePreview: function() {
var result = [];
this.controlPoints.sort(ctrlPtComparator);
this.g2d.clearRect ( 0, 0, this.g2d.canvas.width , this.g2d.canvas.height );
if (this.opts.orientation === "horizontal") {
var grad = this.g2d.createLinearGradient(0, 0, this.g2d.canvas.width, 0);
for (var i = 0; i < this.controlPoints.length; ++i) {
var pt = this.controlPoints[i];
grad.addColorStop(pt.position, "rgba(" + hexToRgb(pt.color).r + "," + hexToRgb(pt.color).g + "," + hexToRgb(pt.color).b + ", "+pt.opacity+")");
result.push({
position: pt.position,
color: pt.color,
opacity: pt.opacity
});
}
} else {
}
this.g2d.fillStyle = grad;
this.g2d.fillRect(0, 0, this.g2d.canvas.width, this.g2d.canvas.height);
if (this.opts.generateStyles)
var styles = this._generatePreviewStyles();
this.opts.change(result, styles);
},
removeControlPoint: function(ctrlPt) {
var cpidx = this.controlPoints.indexOf(ctrlPt);
if (cpidx != -1) {
this.controlPoints.splice(cpidx, 1);
ctrlPt.$el.remove();
}
},
/**
* Adds a new point.
*/
placePoint: function(e) {
e.stopPropagation();
var offset = $(e.target).offset();
var x = e.pageX - offset.left;
var y = e.pageY - offset.top;
var imgData = this.g2d.getImageData(x,y,1,1);
var colorStr = "rgb(" + imgData.data[0] + "," + imgData.data[1] + "," + imgData.data[2] + ")";
var opacity = ( 1 / 255 ) * imgData.data[3];
var cp = this.createCtrlPt({
position: x / this.g2d.canvas.width,
color: rgb2hex(colorStr),
opacity: opacity
});
this.controlPoints.push(cp);
this.controlPoints.sort(ctrlPtComparator);
this.showColorPicker( cp );
},
setGradient: function( controlPoints ) {
this.updateOptions({ controlPoints: controlPoints }, true);
this.updatePreview();
},
setGradientDirection: function( direction ){
switch ( direction ) {
case 'horizontal':
this.updateOptions({type: "linear", fillDirection: "top"}, false);
break;
case 'vertical':
this.updateOptions({type: "linear", fillDirection: "left"}, false);
break;
}
},
_generatePreviewStyles: function() {
var gradientOption = {};
gradientOption['filldirection'] = this.opts.fillDirection;
gradientOption['color_points'] = [];
for (var i = 0; i < this.controlPoints.length; ++i) {
var pt = this.controlPoints[i];
gradientOption['color_points'].push( pt.color + " " + ((pt.position*100)|0) + "% " + pt.opacity );
}
return JSON.stringify(gradientOption);
},
_genPalletsBackground: function(primaryColor, secondaryColor) {
cssRules = 'linear-gradient(90deg, '+primaryColor+' 0%, '+secondaryColor+' 100%)';
if (agent.indexOf('WebKit') >= 0)
crossBrowserRule = browserPrefix[0] + cssRules;
else if (agent.indexOf('Mozilla') >= 0)
crossBrowserRule = browserPrefix[1] + cssRules;
else if (agent.indexOf('Microsoft') >= 0)
crossBrowserRule = browserPrefix[2] + cssRules;
else
crossBrowserRule = cssRules;
return crossBrowserRule;
}
};
/**
* Gradient Control Point
*/
function ControlPoint(parent, initialState, orientation) {
var self = this;
this.parent = parent;
this.$container = parent.$pointsContainer;
this.$el = $('<span class="factory-point"></span>');
this.$pointColor = $('<span class="factory-point-color"></span>').appendTo( this.$el );
this.$container.append( this.$el );
if (typeof initialState === "string") {
initialState = initialState.split(" ");
this.position = parseFloat(initialState[1])/100;
this.color = initialState[0];
this.opacity = initialState[2];
} else {
this.position = initialState.position;
this.color = initialState.color;
this.opacity = initialState.opacity;
}
this.outerWidth = this.$el.outerWidth();
this.$pointColor.css({
"background-color": self.color,
"opacity": self.opacity
});
if (orientation === "horizontal") {
var pxLeft = (self.$container.width() - this.$el.outerWidth()) * (this.position);
this.$el.css("left", pxLeft);
} else {
var pxTop = (self.$container.height() - this.$el.outerHeight()) * (this.position);
this.$el.css("top", pxTop);
}
this.drag = bind(this.drag, this);
this.stop = bind(this.stop, this);
this.$el.disableSelection().css('webkit-user-select','none').draggable({
axis: (orientation === "horizontal") ? "x" : "y",
drag: this.drag,
stop: this.stop,
containment: self.$container,
cancel: null
});
// shows the locker picker on click
this.$el.on('click.gp.factory', function(e){
if ( self.parent.currentPoint === self ) self.parent.hideColorPicker( self );
else self.parent.showColorPicker( self );
e.stopPropagation();
});
}
ControlPoint.prototype = {
updateColor: function( color ) {
this.color = color;
this.$pointColor.css( 'background-color', color );
this.parent.updatePreview();
},
updateOpacity: function( opacity ) {
this.opacity = opacity;
this.$pointColor.css( 'opacity', opacity );
this.parent.updatePreview();
},
drag: function(e, ui) {
var stopPointPosition = eval( this.$el.parent().offset().top + this.$el.parent().height() + 20 );
if( e.pageY > stopPointPosition ) {
this.remove();
}
// convert position to a %
var left = ui.position.left;
this.position = (left / (this.$container.width() - this.outerWidth));
this.parent.updatePreview();
},
stop: function() {
this.parent.updatePreview();
},
remove: function() {
this.parent.removeControlPoint(this);
this.parent.hideColorPicker();
this.parent.updatePreview();
}
};
var methods = {
init: function(opts) {
//orientation - Позиция пикера
//type - linear, radial
//fillDirection - направление градиента
opts = $.extend({
controlPoints: ["#FFF 0% 1", "#000 100% 1"],
orientation: "horizontal",
type: "linear",
fillDirection: "left",
generateStyles: true,
change: function() {}
}, opts);
this.each(function() {
var $this = $(this);
var gradSel = new GradientSelection($this, opts);
$this.data("gradientPicker-sel", gradSel);
});
},
update: function(opts) {
this.each(function() {
var $this = $(this);
var gradSel = $this.data("gradientPicker-sel");
if (gradSel != null) {
gradSel.updateOptions(opts, true);
}
});
}
};
$.fn.gradientPicker = function(method, opts) {
if (typeof method === "string" && method !== "init") {
methods[method].call(this, opts);
} else {
opts = method;
methods.init.call(this, opts);
}
};
})( jQuery );

View File

@@ -0,0 +1,893 @@
/*! Iris Color Picker - v1.0.4 - 2013-11-18
* https://github.com/Automattic/Iris
* Copyright (c) 2013 Matt Wiebe; Licensed GPLv2 */
/* global Color, jQuery */
(function( $, undef ){
var _html, nonGradientIE, gradientType, vendorPrefixes, _css, Iris, UA, isIE, IEVersion;
_html = '<div class="iris-picker"><div class="iris-picker-inner"><div class="iris-square"><a class="iris-square-value" href="#"><span class="iris-square-handle ui-slider-handle"></span></a><div class="iris-square-inner iris-square-horiz"></div><div class="iris-square-inner iris-square-vert"></div></div><div class="iris-slider iris-strip"><div class="iris-slider-offset"></div></div></div></div>';
// Even IE9 dosen't support gradients. Elaborate sigh.
UA = navigator.userAgent.toLowerCase();
isIE = navigator.appName === 'Microsoft Internet Explorer';
IEVersion = isIE ? parseFloat( UA.match( /msie ([0-9]{1,}[\.0-9]{0,})/ )[1] ) : 0;
nonGradientIE = ( isIE && IEVersion < 10 );
gradientType = false;
// we don't bother with an unprefixed version, as it has a different syntax
vendorPrefixes = [ '-moz-', '-webkit-', '-o-', '-ms-' ];
// This is manually copied from iris.min.css until I can figure out how to do it without
_css = '.iris-picker{display:block;position:relative}.iris-picker,.iris-picker *{-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input+.iris-picker{margin-top:4px}.iris-error{background-color:#ffafaf}.iris-border{border-radius:3px;border:1px solid #aaa;width:200px;background-color:#fff}.iris-picker-inner{position:absolute;top:0;right:0;left:0;bottom:0}.iris-border .iris-picker-inner{top:10px;right:10px;left:10px;bottom:10px}.iris-picker .iris-square-inner{position:absolute;left:0;right:0;top:0;bottom:0}.iris-picker .iris-square,.iris-picker .iris-slider,.iris-picker .iris-square-inner,.iris-picker .iris-palette{border-radius:3px;box-shadow:inset 0 0 5px rgba(0,0,0,.4);height:100%;width:12.5%;float:left;margin-right:5%}.iris-picker .iris-square{width:76%;margin-right:10%;position:relative}.iris-picker .iris-square-inner{width:auto;margin:0}.iris-ie-9 .iris-square,.iris-ie-9 .iris-slider,.iris-ie-9 .iris-square-inner,.iris-ie-9 .iris-palette{box-shadow:none;border-radius:0}.iris-ie-9 .iris-square,.iris-ie-9 .iris-slider,.iris-ie-9 .iris-palette{outline:1px solid rgba(0,0,0,.1)}.iris-ie-lt9 .iris-square,.iris-ie-lt9 .iris-slider,.iris-ie-lt9 .iris-square-inner,.iris-ie-lt9 .iris-palette{outline:1px solid #aaa}.iris-ie-lt9 .iris-square .ui-slider-handle{outline:1px solid #aaa;background-color:#fff;-ms-filter:"alpha(Opacity=30)"}.iris-ie-lt9 .iris-square .iris-square-handle{background:0;border:3px solid #fff;-ms-filter:"alpha(Opacity=50)"}.iris-picker .iris-strip{margin-right:0;position:relative}.iris-picker .iris-strip .ui-slider-handle{position:absolute;background:0;margin:0;right:-3px;left:-3px;border:4px solid #aaa;border-width:4px 3px;width:auto;height:6px;border-radius:4px;box-shadow:0 1px 2px rgba(0,0,0,.2);opacity:.9;z-index:5;cursor:ns-resize}.iris-strip .ui-slider-handle:before{content:" ";position:absolute;left:-2px;right:-2px;top:-3px;bottom:-3px;border:2px solid #fff;border-radius:3px}.iris-picker .iris-slider-offset{position:absolute;top:11px;left:0;right:0;bottom:-3px;width:auto;height:auto;background:transparent;border:0;top:none;border-radius:0}.iris-picker .iris-square-handle{background:transparent;border:5px solid #aaa;border-radius:50%;border-color:rgba(128,128,128,.5);box-shadow:none;width:12px;height:12px;position:absolute;left:-10px;top:-10px;cursor:move;opacity:1;z-index:10}.iris-picker .ui-state-focus .iris-square-handle{opacity:.8}.iris-picker .iris-square-handle:hover{border-color:#999}.iris-picker .iris-square-value:focus .iris-square-handle{box-shadow:0 0 2px rgba(0,0,0,.75);opacity:.8}.iris-picker .iris-square-handle:hover::after{border-color:#fff}.iris-picker .iris-square-handle::after{position:absolute;bottom:-4px;right:-4px;left:-4px;top:-4px;border:3px solid #f9f9f9;border-color:rgba(255,255,255,.8);border-radius:50%;content:" "}.iris-picker .iris-square-value{width:8px;height:8px;position:absolute}.iris-ie-lt9 .iris-square-value,.iris-mozilla .iris-square-value{width:1px;height:1px}.iris-palette-container{position:absolute;bottom:0;left:0;margin:0;padding:0}.iris-border .iris-palette-container{left:10px;bottom:10px}.iris-picker .iris-palette{margin:0;cursor:pointer}';
// Bail for IE <= 7
if ( nonGradientIE && IEVersion <= 7 ) {
$.fn.iris = $.noop;
$.support.iris = false;
return;
}
$.support.factoryBootstrap331_iris = true;
function testGradientType() {
var el, base;
if ( nonGradientIE ) {
gradientType = 'filter';
}
else {
el = $( '<div id="iris-gradtest" />' );
base = 'linear-gradient(top,#fff,#000)';
$.each( vendorPrefixes, function( i, val ){
el.css( 'backgroundImage', val + base );
if ( el.css( 'backgroundImage').match( 'gradient' ) ) {
gradientType = i;
return false;
}
});
// check for legacy webkit gradient syntax
if ( gradientType === false ) {
el.css( 'background', '-webkit-gradient(linear,0% 0%,0% 100%,from(#fff),to(#000))' );
if ( el.css( 'backgroundImage').match( 'gradient' ) ) {
gradientType = 'webkit';
}
}
el.remove();
}
}
/**
* Only for CSS3 gradients. oldIE will use a separate function.
*
* Accepts as many color stops as necessary from 2nd arg on, or 2nd
* arg can be an array of color stops
*
* @param {string} origin Gradient origin - top or left, defaults to left.
* @return {string} Appropriate CSS3 gradient string for use in
*/
function createGradient( origin, stops ) {
origin = ( origin === 'top' ) ? 'top' : 'left';
stops = $.isArray( stops ) ? stops : Array.prototype.slice.call( arguments, 1 );
if ( gradientType === 'webkit' ) {
return legacyWebkitGradient( origin, stops );
} else {
return vendorPrefixes[ gradientType ] + 'linear-gradient(' + origin + ', ' + stops.join(', ') + ')';
}
}
/**
* Stupid gradients for a stupid browser.
*/
function stupidIEGradient( origin, stops ) {
var type, self, lastIndex, filter, startPosProp, endPosProp, dimensionProp, template, html;
origin = ( origin === 'top' ) ? 'top' : 'left';
stops = $.isArray( stops ) ? stops : Array.prototype.slice.call( arguments, 1 );
// 8 hex: AARRGGBB
// GradientType: 0 vertical, 1 horizontal
type = ( origin === 'top' ) ? 0 : 1;
self = $( this );
lastIndex = stops.length - 1;
filter = 'filter';
startPosProp = ( type === 1 ) ? 'left' : 'top';
endPosProp = ( type === 1 ) ? 'right' : 'bottom';
dimensionProp = ( type === 1 ) ? 'height' : 'width';
template = '<div class="iris-ie-gradient-shim" style="position:absolute;' + dimensionProp + ':100%;' + startPosProp + ':%start%;' + endPosProp + ':%end%;' + filter + ':%filter%;" data-color:"%color%"></div>';
html = '';
// need a positioning context
if ( self.css('position') === 'static' ) {
self.css( {position: 'relative' } );
}
stops = fillColorStops( stops );
$.each(stops, function( i, startColor ) {
var endColor, endStop, filterVal;
// we want two at a time. if we're on the last pair, bail.
if ( i === lastIndex ) {
return false;
}
endColor = stops[ i + 1 ];
//if our pairs are at the same color stop, moving along.
if ( startColor.stop === endColor.stop ) {
return;
}
endStop = 100 - parseFloat( endColor.stop ) + '%';
startColor.octoHex = new Color( startColor.color ).toIEOctoHex();
endColor.octoHex = new Color( endColor.color ).toIEOctoHex();
filterVal = 'progid:DXImageTransform.Microsoft.Gradient(GradientType=' + type + ', StartColorStr=\'' + startColor.octoHex + '\', EndColorStr=\'' + endColor.octoHex + '\')';
html += template.replace( '%start%', startColor.stop ).replace( '%end%', endStop ).replace( '%filter%', filterVal );
});
self.find( '.iris-ie-gradient-shim' ).remove();
$( html ).prependTo( self );
}
function legacyWebkitGradient( origin, colorList ) {
var stops = [];
origin = ( origin === 'top' ) ? '0% 0%,0% 100%,' : '0% 100%,100% 100%,';
colorList = fillColorStops( colorList );
$.each( colorList, function( i, val ){
stops.push( 'color-stop(' + ( parseFloat( val.stop ) / 100 ) + ', ' + val.color + ')' );
});
return '-webkit-gradient(linear,' + origin + stops.join(',') + ')';
}
function fillColorStops( colorList ) {
var colors = [],
percs = [],
newColorList = [],
lastIndex = colorList.length - 1;
$.each( colorList, function( index, val ) {
var color = val,
perc = false,
match = val.match( /1?[0-9]{1,2}%$/ );
if ( match ) {
color = val.replace( /\s?1?[0-9]{1,2}%$/, '' );
perc = match.shift();
}
colors.push( color );
percs.push( perc );
});
// back fill first and last
if ( percs[0] === false ) {
percs[0] = '0%';
}
if ( percs[lastIndex] === false ) {
percs[lastIndex] = '100%';
}
percs = backFillColorStops( percs );
$.each( percs, function( i ){
newColorList[i] = { color: colors[i], stop: percs[i] };
});
return newColorList;
}
function backFillColorStops( stops ) {
var first = 0,
last = stops.length - 1,
i = 0,
foundFirst = false,
incr,
steps,
step,
firstVal;
if ( stops.length <= 2 || $.inArray( false, stops ) < 0 ) {
return stops;
}
while ( i < stops.length - 1 ) {
if ( ! foundFirst && stops[i] === false ) {
first = i - 1;
foundFirst = true;
} else if ( foundFirst && stops[i] !== false ) {
last = i;
i = stops.length;
}
i++;
}
steps = last - first;
firstVal = parseInt( stops[first].replace('%'), 10 );
incr = ( parseFloat( stops[last].replace('%') ) - firstVal ) / steps;
i = first + 1;
step = 1;
while ( i < last ) {
stops[i] = ( firstVal + ( step * incr ) ) + '%';
step++;
i++;
}
return backFillColorStops( stops );
}
$.fn.factoryBootstrap331_gradient = function() {
var args = arguments;
return this.each( function() {
// this'll be oldishIE
if ( nonGradientIE ) {
stupidIEGradient.apply( this, args );
} else {
// new hotness
$( this ).css( 'backgroundImage', createGradient.apply( this, args ) );
}
});
};
$.fn.factoryBootstrap331_raninbowGradient = function( origin, args ) {
var opts, template, i, steps;
origin = origin || 'top';
opts = $.extend( {}, { s: 100, l: 50 }, args );
template = 'hsl(%h%,' + opts.s + '%,' + opts.l + '%)';
i = 0;
steps = [];
while ( i <= 360 ) {
steps.push( template.replace('%h%', i) );
i += 30;
}
return this.each(function() {
$(this).factoryBootstrap331_gradient( origin, steps );
});
};
// the colorpicker widget def.
Iris = {
options: {
color: false,
mode: 'hsl',
controls: {
horiz: 's', // horizontal defaults to saturation
vert: 'l', // vertical defaults to lightness
strip: 'h' // right strip defaults to hue
},
hide: true, // hide the color picker by default
border: true, // draw a border around the collection of UI elements
target: false, // a DOM element / jQuery selector that the element will be appended within. Only used when called on an input.
width: 200, // the width of the collection of UI elements
palettes: false // show a palette of basic colors beneath the square.
},
_color: '',
_palettes: [ '#000', '#fff', '#d33', '#d93', '#ee2', '#81d742', '#1e73be', '#8224e3' ],
_inited: false,
_defaultHSLControls: {
horiz: 's',
vert: 'l',
strip: 'h'
},
_defaultHSVControls: {
horiz: 'h',
vert: 'v',
strip: 's'
},
_scale: {
h: 360,
s: 100,
l: 100,
v: 100
},
_create: function() {
var self = this,
el = self.element,
color = self.options.color || el.val();
if ( gradientType === false ) {
testGradientType();
}
if ( el.is( 'input' ) ) {
if ( self.options.target ) {
self.picker = $( _html ).appendTo( self.options.target );
} else {
self.picker = $( _html ).insertAfter( el );
}
self._addInputListeners( el );
} else {
el.append( _html );
self.picker = el.find( '.iris-picker' );
}
// Browsers / Versions
// Feature detection doesn't work for these, and $.browser is deprecated
if ( isIE ) {
if ( IEVersion === 9 ) {
self.picker.addClass( 'iris-ie-9' );
} else if ( IEVersion <= 8 ) {
self.picker.addClass( 'iris-ie-lt9' );
}
} else if ( UA.indexOf('compatible') < 0 && UA.indexOf('khtml') < 0 && UA.match( /mozilla/ ) ) {
self.picker.addClass( 'iris-mozilla' );
}
if ( self.options.palettes ) {
self._addPalettes();
}
self._color = new Color( color ).setHSpace( self.options.mode );
self.options.color = self._color.toString();
// prep 'em for re-use
self.controls = {
square: self.picker.find( '.iris-square' ),
squareDrag: self.picker.find( '.iris-square-value' ),
horiz: self.picker.find( '.iris-square-horiz' ),
vert: self.picker.find( '.iris-square-vert' ),
strip: self.picker.find( '.iris-strip' ),
stripSlider: self.picker.find( '.iris-strip .iris-slider-offset' )
};
// small sanity check - if we chose hsv, change default controls away from hsl
if ( self.options.mode === 'hsv' && self._has('l', self.options.controls) ) {
self.options.controls = self._defaultHSVControls;
} else if ( self.options.mode === 'hsl' && self._has('v', self.options.controls) ) {
self.options.controls = self._defaultHSLControls;
}
// store it. HSL gets squirrely
self.hue = self._color.h();
if ( self.options.hide ) {
self.picker.hide();
}
if ( self.options.border ) {
self.picker.addClass( 'iris-border' );
}
self._initControls();
self.active = 'external';
self._dimensions();
self._change();
},
_has: function(needle, haystack) {
var ret = false;
$.each(haystack, function(i,v){
if ( needle === v ) {
ret = true;
// exit the loop
return false;
}
});
return ret;
},
_addPalettes: function () {
var container = $( '<div class="iris-palette-container" />' ),
palette = $( '<a class="iris-palette" tabindex="0" />' ),
colors = $.isArray( this.options.palettes ) ? this.options.palettes : this._palettes;
// do we have an existing container? Empty and reuse it.
if ( this.picker.find( '.iris-palette-container' ).length ) {
container = this.picker.find( '.iris-palette-container' ).detach().html( '' );
}
$.each(colors, function(index, val) {
palette.clone().data( 'color', val )
.css( 'backgroundColor', val ).appendTo( container )
.height( 10 ).width( 10 );
});
this.picker.append(container);
},
_paint: function() {
var self = this;
self._paintDimension( 'top', 'strip' );
self._paintDimension( 'top', 'vert' );
self._paintDimension( 'left', 'horiz' );
},
_paintDimension: function( origin, control ) {
var self = this,
c = self._color,
mode = self.options.mode,
color = self._getHSpaceColor(),
target = self.controls[ control ],
controlOpts = self.options.controls,
stops;
// don't paint the active control
if ( control === self.active || ( self.active === 'square' && control !== 'strip' ) ) {
return;
}
switch ( controlOpts[ control ] ) {
case 'h':
if ( mode === 'hsv' ) {
color = c.clone();
switch ( control ) {
case 'horiz':
color[controlOpts.vert](100);
break;
case 'vert':
color[controlOpts.horiz](100);
break;
case 'strip':
color.setHSpace('hsl');
break;
}
stops = color.toHsl();
} else {
if ( control === 'strip' ) {
stops = { s: color.s, l: color.l };
} else {
stops = { s: 100, l: color.l };
}
}
target.factoryBootstrap331_raninbowGradient( origin, stops );
break;
case 's':
if ( mode === 'hsv' ) {
if ( control === 'vert' ) {
stops = [ c.clone().a(0).s(0).toCSS('rgba'), c.clone().a(1).s(0).toCSS('rgba') ];
} else if ( control === 'strip' ) {
stops = [ c.clone().s(100).toCSS('hsl'), c.clone().s(0).toCSS('hsl') ];
} else if ( control === 'horiz' ) {
stops = [ '#fff', 'hsl(' + color.h + ',100%,50%)' ];
}
} else { // implicit mode === 'hsl'
if ( control === 'vert' && self.options.controls.horiz === 'h' ) {
stops = ['hsla(0, 0%, ' + color.l + '%, 0)', 'hsla(0, 0%, ' + color.l + '%, 1)'];
} else {
stops = ['hsl('+ color.h +',0%,50%)', 'hsl(' + color.h + ',100%,50%)'];
}
}
target.factoryBootstrap331_gradient( origin, stops );
break;
case 'l':
if ( control === 'strip' ) {
stops = ['hsl(' + color.h + ',100%,100%)', 'hsl(' + color.h + ', ' + color.s + '%,50%)', 'hsl('+ color.h +',100%,0%)'];
} else {
stops = ['#fff', 'rgba(255,255,255,0) 50%', 'rgba(0,0,0,0) 50%', 'rgba(0,0,0,1)'];
}
target.factoryBootstrap331_gradient( origin, stops );
break;
case 'v':
if ( control === 'strip' ) {
stops = [ c.clone().v(100).toCSS(), c.clone().v(0).toCSS() ];
} else {
stops = ['rgba(0,0,0,0)', '#000'];
}
target.factoryBootstrap331_gradient( origin, stops );
break;
default:
break;
}
},
_getHSpaceColor: function() {
return ( this.options.mode === 'hsv' ) ? this._color.toHsv() : this._color.toHsl();
},
_dimensions: function( reset ) {
// whatever size
var self = this,
opts = self.options,
controls = self.controls,
square = controls.square,
strip = self.picker.find( '.iris-strip' ),
squareWidth = '77.5%',
stripWidth = '12%',
totalPadding = 20,
innerWidth = opts.border ? opts.width - totalPadding : opts.width,
controlsHeight,
paletteCount = $.isArray( opts.palettes ) ? opts.palettes.length : self._palettes.length,
paletteMargin, paletteWidth, paletteContainerWidth;
if ( reset ) {
square.css( 'width', '' );
strip.css( 'width', '' );
self.picker.css( {width: '', height: ''} );
}
squareWidth = innerWidth * ( parseFloat( squareWidth ) / 100 );
stripWidth = innerWidth * ( parseFloat( stripWidth ) / 100 );
controlsHeight = opts.border ? squareWidth + totalPadding : squareWidth;
square.width( squareWidth ).height( squareWidth );
strip.height( squareWidth ).width( stripWidth );
self.picker.css( { width: opts.width, height: controlsHeight } );
if ( ! opts.palettes ) {
return self.picker.css( 'paddingBottom', '' );
}
// single margin at 2%
paletteMargin = squareWidth * 2 / 100;
paletteContainerWidth = squareWidth - ( ( paletteCount - 1 ) * paletteMargin );
paletteWidth = paletteContainerWidth / paletteCount;
self.picker.find('.iris-palette').each( function( i ) {
var margin = i === 0 ? 0 : paletteMargin;
$( this ).css({
width: paletteWidth,
height: paletteWidth,
marginLeft: margin
});
});
self.picker.css( 'paddingBottom', paletteWidth + paletteMargin );
strip.height( paletteWidth + paletteMargin + squareWidth );
},
_addInputListeners: function( input ) {
var self = this,
debounceTimeout = 100,
callback = function( event ){
var color = new Color( input.val() ),
val = input.val().replace( /^#/, '' );
input.removeClass( 'iris-error' );
// we gave a bad color
if ( color.error ) {
// don't error on an empty input - we want those allowed
if ( val !== '' ) {
input.addClass( 'iris-error' );
}
} else {
if ( color.toString() !== self._color.toString() ) {
// let's not do this on keyup for hex shortcodes
if ( ! ( event.type === 'keyup' && val.match( /^[0-9a-fA-F]{3}$/ ) ) ) {
self._setOption( 'color', color.toString() );
}
}
}
};
input.on( 'change', callback ).on( 'keyup', self._debounce( callback, debounceTimeout ) );
// If we initialized hidden, show on first focus. The rest is up to you.
if ( self.options.hide ) {
input.one( 'focus', function() {
self.show();
});
}
},
_initControls: function() {
var self = this,
controls = self.controls,
square = controls.square,
controlOpts = self.options.controls,
stripScale = self._scale[controlOpts.strip];
controls.stripSlider.slider({
orientation: 'vertical',
max: stripScale,
slide: function( event, ui ) {
self.active = 'strip';
// "reverse" for hue.
if ( controlOpts.strip === 'h' ) {
ui.value = stripScale - ui.value;
}
self._color[controlOpts.strip]( ui.value );
self._change.apply( self, arguments );
}
});
controls.squareDrag.draggable({
containment: 'parent',
zIndex: 1000,
cursor: 'move',
drag: function( event, ui ) {
self._squareDrag( event, ui );
},
start: function() {
square.addClass( 'iris-dragging' );
$(this).addClass( 'ui-state-focus' );
},
stop: function() {
square.removeClass( 'iris-dragging' );
$(this).removeClass( 'ui-state-focus' );
}
}).on( 'mousedown mouseup', function( event ) {
var focusClass = 'ui-state-focus';
event.preventDefault();
if (event.type === 'mousedown' ) {
self.picker.find( '.' + focusClass ).removeClass( focusClass ).blur();
$(this).addClass( focusClass ).focus();
} else {
$(this).removeClass( focusClass );
}
}).on( 'keydown', function( event ) {
var container = controls.square,
draggable = controls.squareDrag,
position = draggable.position(),
distance = self.options.width / 100; // Distance in pixels the draggable should be moved: 1 "stop"
// make alt key go "10"
if ( event.altKey ) {
distance *= 10;
}
// Reposition if one of the directional keys is pressed
switch ( event.keyCode ) {
case 37: position.left -= distance; break; // Left
case 38: position.top -= distance; break; // Up
case 39: position.left += distance; break; // Right
case 40: position.top += distance; break; // Down
default: return true; // Exit and bubble
}
// Keep draggable within container
position.left = Math.max( 0, Math.min( position.left, container.width() ) );
position.top = Math.max( 0, Math.min( position.top, container.height() ) );
draggable.css(position);
self._squareDrag( event, { position: position });
event.preventDefault();
});
// allow clicking on the square to move there and keep dragging
square.mousedown( function( event ) {
var squareOffset, pos;
// only left click
if ( event.which !== 1 ) {
return;
}
// prevent bubbling from the handle: no infinite loops
if ( ! $( event.target ).is( 'div' ) ) {
return;
}
squareOffset = self.controls.square.offset();
pos = {
top: event.pageY - squareOffset.top,
left: event.pageX - squareOffset.left
};
event.preventDefault();
self._squareDrag( event, { position: pos } );
event.target = self.controls.squareDrag.get(0);
self.controls.squareDrag.css( pos ).trigger( event );
});
// palettes
if ( self.options.palettes ) {
self._paletteListeners();
}
},
_paletteListeners: function() {
var self = this;
self.picker.find('.iris-palette-container').on('click.palette', '.iris-palette', function() {
self._color.fromCSS( $(this).data('color') );
self.active = 'external';
self._change();
}).on( 'keydown.palette', '.iris-palette', function( event ) {
if ( ! ( event.keyCode === 13 || event.keyCode === 32 ) ) {
return true;
}
event.stopPropagation();
$( this ).click();
});
},
_squareDrag: function( event, ui ) {
var self = this,
controlOpts = self.options.controls,
dimensions = self._squareDimensions(),
vertVal = Math.round( ( dimensions.h - ui.position.top ) / dimensions.h * self._scale[controlOpts.vert] ),
horizVal = self._scale[controlOpts.horiz] - Math.round( ( dimensions.w - ui.position.left ) / dimensions.w * self._scale[controlOpts.horiz] );
self._color[controlOpts.horiz]( horizVal )[controlOpts.vert]( vertVal );
self.active = 'square';
self._change.apply( self, arguments );
},
_setOption: function( key, value ) {
var self = this,
oldValue = self.options[key],
doDimensions = false,
hexLessColor,
newColor,
method;
// ensure the new value is set. We can reset to oldValue if some check wasn't met.
self.options[key] = value;
switch(key) {
case 'color':
// cast to string in case we have a number
value = '' + value;
hexLessColor = value.replace( /^#/, '' );
newColor = new Color( value ).setHSpace( self.options.mode );
if ( newColor.error ) {
self.options[key] = oldValue;
} else {
self._color = newColor;
self.options.color = self.options[key] = self._color.toString();
self.active = 'external';
self._change();
}
break;
case 'palettes':
doDimensions = true;
if ( value ) {
self._addPalettes();
} else {
self.picker.find('.iris-palette-container').remove();
}
// do we need to add events?
if ( ! oldValue ) {
self._paletteListeners();
}
break;
case 'width':
doDimensions = true;
break;
case 'border':
doDimensions = true;
method = value ? 'addClass' : 'removeClass';
self.picker[method]('iris-border');
break;
case 'mode':
case 'controls':
// if nothing's changed, let's bail, since this causes re-rendering the whole widget
if ( oldValue === value ) {
return;
}
// we're using these poorly named variables because they're already scoped.
// method is the element that Iris was called on. oldValue will be the options
method = self.element;
oldValue = self.options;
oldValue.hide = ! self.picker.is( ':visible' );
self.destroy();
self.picker.remove();
return $(self.element).iris(oldValue);
}
// Do we need to recalc dimensions?
if ( doDimensions ) {
self._dimensions(true);
}
},
_squareDimensions: function( forceRefresh ) {
var square = this.controls.square,
dimensions,
control;
if ( forceRefresh !== undef && square.data('dimensions') ) {
return square.data('dimensions');
}
control = this.controls.squareDrag;
dimensions = {
w: square.width(),
h: square.height()
};
square.data( 'dimensions', dimensions );
return dimensions;
},
_isNonHueControl: function( active, type ) {
if ( active === 'square' && this.options.controls.strip === 'h' ) {
return true;
} else if ( type === 'external' || ( type === 'h' && active === 'strip' ) ) {
return false;
}
return true;
},
_change: function() {
var self = this,
controls = self.controls,
color = self._getHSpaceColor(),
actions = [ 'square', 'strip' ],
controlOpts = self.options.controls,
type = controlOpts[self.active] || 'external',
oldHue = self.hue;
if ( self.active === 'strip' ) {
// take no action on any of the square sliders if we adjusted the strip
actions = [];
} else if ( self.active !== 'external' ) {
// for non-strip, non-external, strip should never change
actions.pop(); // conveniently the last item
}
$.each( actions, function(index, item) {
var value, dimensions, cssObj;
if ( item !== self.active ) {
switch ( item ) {
case 'strip':
// reverse for hue
value = ( controlOpts.strip === 'h' ) ? self._scale[controlOpts.strip] - color[controlOpts.strip] : color[controlOpts.strip];
controls.stripSlider.slider( 'value', value );
break;
case 'square':
dimensions = self._squareDimensions();
cssObj = {
left: color[controlOpts.horiz] / self._scale[controlOpts.horiz] * dimensions.w,
top: dimensions.h - ( color[controlOpts.vert] / self._scale[controlOpts.vert] * dimensions.h )
};
self.controls.squareDrag.css( cssObj );
break;
}
}
});
// Ensure that we don't change hue if we triggered a hue reset
if ( color.h !== oldHue && self._isNonHueControl( self.active, type ) ) {
self._color.h(oldHue);
}
// store hue for repeating above check next time
self.hue = self._color.h();
self.options.color = self._color.toString();
// only run after the first time
if ( self._inited ) {
self._trigger( 'change', { type: self.active }, { color: self._color } );
}
if ( self.element.is( ':input' ) && ! self._color.error ) {
self.element.removeClass( 'iris-error' );
if ( self.element.val() !== self._color.toString() ) {
self.element.val( self._color.toString() );
}
}
self._paint();
self._inited = true;
self.active = false;
},
// taken from underscore.js _.debounce method
_debounce: function( func, wait, immediate ) {
var timeout, result;
return function() {
var context = this,
args = arguments,
later,
callNow;
later = function() {
timeout = null;
if ( ! immediate) {
result = func.apply( context, args );
}
};
callNow = immediate && !timeout;
clearTimeout( timeout );
timeout = setTimeout( later, wait );
if ( callNow ) {
result = func.apply( context, args );
}
return result;
};
},
show: function() {
this.picker.show();
},
hide: function() {
this.picker.hide();
},
toggle: function() {
this.picker.toggle();
},
color: function(newColor) {
if ( newColor === true ) {
return this._color.clone();
} else if ( newColor === undef ) {
return this._color.toString();
}
this.option('color', newColor);
}
};
// initialize the widget
$.widget( 'a8c.factoryBootstrap331_iris', Iris );
// add CSS
$( '<style id="iris-css">' + _css + '</style>' ).appendTo( 'head' );
}( jQuery ));

View File

@@ -0,0 +1,24 @@
/*! $.noUiSlider - WTFPL - refreshless.com/nouislider/ */
(function(e){function h(a){throw new RangeError("noUiSlider: "+a);}function x(a,b,d){(a[b]||a[d])&&a[b]===a[d]&&h("(Link) '"+b+"' can't match '"+d+"'.'")}function t(a){return"number"===typeof a&&!isNaN(a)&&isFinite(a)}function H(a){return e.isArray(a)?a:[a]}function D(a,b){a.addClass(b);setTimeout(function(){a.removeClass(b)},300)}function y(a,b){return 100*b/(a[1]-a[0])}function I(a,b){if(b>=a.d.slice(-1)[0])return 100;for(var d=1,c,g,e;b>=a.d[d];)d++;c=a.d[d-1];g=a.d[d];e=a.c[d-1];c=[c,g];return e+
y(c,0>c[0]?b+Math.abs(c[0]):b-c[0])/(100/(a.c[d]-e))}function J(a,b){for(var d=1,c;b>=a.c[d];)d++;if(a.m)return c=a.c[d-1],d=a.c[d],b-c>(d-c)/2?d:c;a.h[d-1]?(c=a.h[d-1],d=a.c[d-1]+Math.round((b-a.c[d-1])/c)*c):d=b;return d}function s(a){void 0===a&&(a={});"object"!==typeof a&&h("(Format) 'format' option must be an object.");var b={};e(K).each(function(d,c){void 0===a[c]?b[c]=z[d]:typeof a[c]===typeof z[d]?("decimals"===c&&(0>a[c]||7<a[c])&&h("(Format) 'format.decimals' option must be between 0 and 7."),
b[c]=a[c]):h("(Format) 'format."+c+"' must be a "+typeof z[d]+".")});x(b,"mark","thousand");x(b,"prefix","negative");x(b,"prefix","negativeBefore");this.B=b}function q(a,b){if(!(this instanceof q))throw Error("Link: Don't use Link as a function. Use the 'new' keyword.");if(!a)throw new RangeError("Link: missing parameters.");this.g=a.format||{};this.update=!b;var d=this,c=a.target||function(){},g=a.method,f="string"===typeof c&&0===c.indexOf("-tooltip-"),h="string"===typeof c&&0!==c.indexOf("-"),
n="function"===typeof c,r=c instanceof e||e.zepto&&e.zepto.isZ(c),E=r&&c.is("input, select, textarea"),l=r&&"function"===typeof g,s=r&&"string"===typeof g&&c[g];if(f)this.method=g||"html",this.j=e(c.replace("-tooltip-","")||"<div/>")[0];else if(h)this.method="val",this.j=document.createElement("input"),this.j.name=c,this.j.type="hidden";else if(n)this.target=!1,this.method=c;else{if(r){if(g&&(l||s)){this.target=c;this.method=g;return}if(!g&&E){this.method="val";this.target=c;this.target.on("change",
function(a){a=e(a.target).val();var b=d.q;d.u.val([b?null:a,b?a:null],{link:d})});return}if(!g&&!E){this.method="html";this.target=c;return}}throw new RangeError("Link: Invalid Link.");}}function L(a,b){t(b)||h("'step' is not numeric.");a.h[0]=b}function M(a,b){("object"!==typeof b||e.isArray(b))&&h("'range' is not an object.");e.each(b,function(b,c){var g;"number"===typeof c&&(c=[c]);e.isArray(c)||h("'range' contains invalid value.");g="min"===b?0:"max"===b?100:parseFloat(b);t(g)&&t(c[0])||h("'range' value isn't numeric.");
a.c.push(g);a.d.push(c[0]);g?a.h.push(isNaN(c[1])?!1:c[1]):isNaN(c[1])||(a.h[0]=c[1])});e.each(a.h,function(b,c){if(!c)return!0;a.h[b]=y([a.d[b],a.d[b+1]],c)/(100/(a.c[b+1]-a.c[b]))})}function N(a,b){"number"===typeof b&&(b=[b]);(!e.isArray(b)||!b.length||2<b.length)&&h("'start' option is incorrect.");a.a=b.length;a.start=b}function O(a,b){a.m=b;"boolean"!==typeof b&&h("'snap' option must be a boolean.")}function P(a,b){"lower"===b&&1===a.a?a.i=1:"upper"===b&&1===a.a?a.i=2:!0===b&&2===a.a?a.i=3:!1===
b?a.i=0:h("'connect' option was doesn't match handle count.")}function Q(a,b){switch(b){case "horizontal":a.k=0;break;case "vertical":a.k=1;break;default:h("'orientation' option is invalid.")}}function R(a,b){2<a.c.length&&h("'margin' option is only supported on linear sliders.");a.margin=y(a.d,b);t(b)||h("'margin' option must be numeric.")}function S(a,b){switch(b){case "ltr":a.dir=0;break;case "rtl":a.dir=1;a.i=[0,2,1,3][a.i];break;default:h("'direction' option was not recognized.")}}function T(a,
b){"string"!==typeof b&&h("'behaviour' must be a string containing options.");var d=0<=b.indexOf("snap");a.n={p:0<=b.indexOf("tap")||d,extend:0<=b.indexOf("extend"),s:0<=b.indexOf("drag"),fixed:0<=b.indexOf("fixed"),m:d}}function U(a,b,d){a.o=[b.lower,b.upper];a.g=new s(b.format);e.each(a.o,function(a,g){e.isArray(g)||h("'serialization."+(a?"upper":"lower")+"' must be an array.");e.each(g,function(){this instanceof q||h("'serialization."+(a?"upper":"lower")+"' can only contain Link instances.");this.q=
a;this.u=d;this.scope=this.scope||d;this.g=new s(e.extend({},b.format,this.g))})});a.dir&&1<a.a&&a.o.reverse()}function V(a,b){var d={c:[],d:[],h:[!1],margin:0},c;c={step:{e:!1,f:L},range:{e:!0,f:M},start:{e:!0,f:N},snap:{e:!1,f:O},connect:{e:!0,f:P},orientation:{e:!1,f:Q},margin:{e:!1,f:R},direction:{e:!0,f:S},behaviour:{e:!0,f:T},serialization:{e:!0,f:U}};a=e.extend({connect:!1,direction:"ltr",behaviour:"tap",orientation:"horizontal"},a);a.serialization=e.extend({lower:[],upper:[],format:{}},a.serialization);
e.each(c,function(c,e){if(void 0===a[c])if(e.e)h("'"+c+"' is required.");else return!0;e.f(d,a[c],b)});d.style=d.k?"top":"left";return d}function W(a,b){var d=e("<div><div/></div>").addClass(f[2]),c=["-lower","-upper"];a.dir&&c.reverse();d.children().addClass(f[3]+" "+f[3]+c[b]);return d}function X(a,b){b.j&&(b=new q({target:e(b.j).clone().appendTo(a),method:b.method,format:b.g},!0));return b}function Y(a,b){var d,c=[];for(d=0;d<a.a;d++){var e=c,f=d,h=a.o[d],n=b[d].children(),r=void 0,l=[];l.push(new q({format:a.g},
!0));for(r=0;r<h.length;r++)l.push(X(n,h[r]));e[f]=l}return c}function Z(a,b,d){switch(a){case 1:b.addClass(f[7]);d[0].addClass(f[6]);break;case 3:d[1].addClass(f[6]);case 2:d[0].addClass(f[7]);case 0:b.addClass(f[6])}}function aa(a,b){var d,c=[];for(d=0;d<a.a;d++)c.push(W(a,d).appendTo(b));return c}function ba(a,b){b.addClass([f[0],f[8+a.dir],f[4+a.k]].join(" "));return e("<div/>").appendTo(b).addClass(f[1])}function ca(a,b,d){function c(){return u[["width","height"][b.k]]()}function g(a){var b,
c=[m.val()];for(b=0;b<a.length;b++)m.trigger(a[b],c)}function h(a,c,d){var g=a[0]!==k[0][0]?1:0,p=v[0]+b.margin,F=v[1]-b.margin;d&&1<k.length&&(c=g?Math.max(c,p):Math.min(c,F));100>c&&(c=J(b,c));c=Math.max(Math.min(parseFloat(c.toFixed(7)),100),0);if(c===v[g])return 1===k.length?!1:c===p||c===F?0:!1;a.css(b.style,c+"%");a.is(":first-child")&&a.toggleClass(f[17],50<c);v[g]=c;b.dir&&(c=100-c);e(w[g]).each(function(){this.write(b,c,a.children(),m)});return!0}function q(a,b,c){c||D(m,f[14]);h(a,b,!1);
g(["slide","set","change"])}function n(a,c,d,e){a=a.replace(/\s/g,".nui ")+".nui";c.on(a,function(a){var c=m.attr("disabled");if(m.hasClass(f[14])||void 0!==c&&null!==c)return!1;a.preventDefault();var c=0===a.type.indexOf("touch"),g=0===a.type.indexOf("mouse"),B=0===a.type.indexOf("pointer"),A,h,k=a;0===a.type.indexOf("MSPointer")&&(B=!0);a.originalEvent&&(a=a.originalEvent);c&&(A=a.changedTouches[0].pageX,h=a.changedTouches[0].pageY);if(g||B)B||void 0!==window.pageXOffset||(window.pageXOffset=document.documentElement.scrollLeft,
window.pageYOffset=document.documentElement.scrollTop),A=a.clientX+window.pageXOffset,h=a.clientY+window.pageYOffset;k.v=[A,h];k.cursor=g;a=k;a.l=a.v[b.k];d(a,e)})}function r(a,b){var d=b.a||k,e,f=!1,f=100*(a.l-b.start)/c(),m=d[0][0]!==k[0][0]?1:0;var n=b.w;e=f+n[0];f+=n[1];1<d.length?(0>e&&(f+=Math.abs(e)),100<f&&(e-=f-100),e=[Math.max(Math.min(e,100),0),Math.max(Math.min(f,100),0)]):e=[e,f];f=h(d[0],e[m],1===d.length);1<d.length&&(f=h(d[1],e[m?0:1],!1)||f);f&&g(["slide"])}function s(a){e("."+f[15]).removeClass(f[15]);
a.cursor&&e("body").css("cursor","").off(".nui");C.off(".nui");m.removeClass(f[12]);g(["set","change"])}function t(a,b){1===b.a.length&&b.a[0].children().addClass(f[15]);a.stopPropagation();n(l.move,C,r,{start:a.l,a:b.a,w:[v[0],v[k.length-1]]});n(l.end,C,s,null);a.cursor&&(e("body").css("cursor",e(a.target).css("cursor")),1<k.length&&m.addClass(f[12]),e("body").on("selectstart.nui",!1))}function x(a){var d=a.l,g=0;a.stopPropagation();e.each(k,function(){g+=this.offset()[b.style]});g=d<g/2||1===k.length?
0:1;d-=u.offset()[b.style];d=100*d/c();q(k[g],d,b.n.m);b.n.m&&t(a,{a:[k[g]]})}function y(a){var c=(a=a.l<u.offset()[b.style])?0:100;a=a?0:k.length-1;q(k[a],c,!1)}var m=e(a),v=[-1,-1],u,w,k;if(!m.is(":empty"))throw Error("Slider was already initialized.");u=ba(b,m);k=aa(b,u);w=Y(b,k);Z(b.i,m,k);(function(a){var b;if(!a.fixed)for(b=0;b<k.length;b++)n(l.start,k[b].children(),t,{a:[k[b]]});a.p&&n(l.start,u,x,{a:k});a.extend&&(m.addClass(f[16]),a.p&&n(l.start,m,y,{a:k}));a.s&&(b=u.find("."+f[7]).addClass(f[10]),
a.fixed&&(b=b.add(u.children().not(b).children())),n(l.start,b,t,{a:k}))})(b.n);a.F=function(a,c,d,n,p){var l;b.dir&&1<b.a&&a.reverse();p&&D(m,f[14]);for(l=0;l<(1<k.length?3:1);l++)p=d||w[l%2][0],p=p.valueOf(a[l%2]),!1!==p&&(p=I(b,p),b.dir&&(p=100-p),!0!==h(k[l%2],p,!0)&&e(w[l%2]).each(function(){this.write(b,v[l%2],k[l%2].children(),m,n)}));!0===c&&g(["set"])};a.D=function(){var a,c=[];for(a=0;a<b.a;a++)c[a]=w[a][0].A;return 1===c.length?c[0]:b.dir&&1<b.a?c.reverse():c};a.r=function(){e.each(w,function(){e.each(this,
function(){this.target&&this.target.off(".nui")})});e(this).off(".nui").removeClass(f.join(" ")).empty();return d};m.val(b.start)}function da(a){this.length||h("Can't initialize slider on empty selection.");var b=V(a,this);return this.each(function(){ca(this,b,a)})}function ea(a){return this.each(function(){var b=e(this).val(),d=this.r(),c=e.extend({},d,a);e(this).noUiSlider(c);d.start===c.start&&e(this).val(b)})}var C=e(document),G=e.fn.val,l=window.navigator.G?{start:"pointerdown",move:"pointermove",
end:"pointerup"}:window.navigator.msPointerEnabled?{start:"MSPointerDown",move:"MSPointerMove",end:"MSPointerUp"}:{start:"mousedown touchstart",move:"mousemove touchmove",end:"mouseup touchend"},f="noUi-target noUi-base noUi-origin noUi-handle noUi-horizontal noUi-vertical noUi-background noUi-connect noUi-ltr noUi-rtl noUi-dragable noUi-state-drag noUi-state-tap noUi-active noUi-extended noUi-stacking".split(" "),K="decimals mark thousand prefix postfix encoder decoder negative negativeBefore".split(" "),
z=[2,".","","","",function(a){return a},function(a){return a},"-",""];s.prototype.b=function(a){return this.B[a]};s.prototype.C=function(a){function b(a){return a.split("").reverse().join("")}a=this.b("encoder")(a);var d="",c="",e="",f="";0>a&&(d=this.b("negative"),c=this.b("negativeBefore"));a=Math.abs(a).toFixed(this.b("decimals")).toString();a=a.split(".");0===parseFloat(a)&&(a[0]="0");this.b("thousand")?(e=b(a[0]).match(/.{1,3}/g),e=b(e.join(b(this.b("thousand"))))):e=a[0];this.b("mark")&&1<a.length&&
(f=this.b("mark")+a[1]);return c+this.b("prefix")+d+e+f+this.b("postfix")};s.prototype.t=function(a){function b(a){return a.replace(/[\-\/\\\^$*+?.()|\[\]{}]/g,"\\$&")}var d;if(null===a||void 0===a)return!1;a=a.toString();d=a.replace(RegExp("^"+b(this.b("negativeBefore"))),"");a!==d?(a=d,d="-"):d="";a=a.replace(RegExp("^"+b(this.b("prefix"))),"");this.b.negative&&(d="",a=a.replace(RegExp("^"+b(this.b("negative"))),"-"));a=a.replace(RegExp(b(this.b("postfix"))+"$"),"").replace(RegExp(b(this.b("thousand")),
"g"),"").replace(this.b("mark"),".");a=this.b("decoder")(parseFloat(d+a));return isNaN(a)?!1:a};q.prototype.write=function(a,b,d,c,e){if(!this.update||!1!==e){if(100<=b)b=a.d.slice(-1)[0];else{e=1;for(var f,h,l;b>=a.c[e];)e++;f=a.d[e-1];h=a.d[e];l=a.c[e-1];f=[f,h];b=100/(a.c[e]-l)*(b-l)*(f[1]-f[0])/100+f[0]}this.A=b=this.format(b);if("function"===typeof this.method)this.method.call(this.target[0]||c[0],b,d,c);else this.target[this.method](b,d,c)}};q.prototype.format=function(a){return this.g.C(a)};
q.prototype.valueOf=function(a){return this.g.t(a)};e.noUiSlider={Link:q};e.fn.noUiSlider=function(a,b){return(b?ea:da).call(this,a)};e.fn.val=function(){var a=Array.prototype.slice.call(arguments,0),b,d,c,g;if(!a.length)return this.hasClass(f[0])?this[0].D():G.apply(this);"object"===typeof a[1]?(b=a[1].set,d=a[1].link,c=a[1].update,g=a[1].animate):!0===a[1]&&(b=!0);return this.each(function(){e(this).hasClass(f[0])?this.F(H(a[0]),b,d,c,g):G.apply(e(this),a)})}})(window.jQuery||window.Zepto);

View File

@@ -0,0 +1,254 @@
( function( $ ){
var PaddingsEditor = function (element) {
this.$element = $(element);
this.$rectangle = this.$element.find(".factory-rectangle");
this.$center = this.$element.find(".factory-side-center");
this.$bar = this.$element.find(".factory-bar");
this.$sides = this.$element.find(".factory-side");
this.$result = this.$element.find(".factory-result");
this.units = this.$element.data('units');
this.rangeStart = this.$element.data('range-start');
this.rangeEnd = this.$element.data('range-end');
this.step = this.$element.data('step');
this._createCanvas();
this._createSlider();
this._initMouse();
this.selectSide('center');
};
/**
* Creates canvas for drawing control.
*/
PaddingsEditor.prototype._createCanvas = function() {
var self = this;
this._recalculateSizes();
this.$canvas = $("<canvas width='" + self.elementWidth + "' height='" + self.elementHeight + "'>")
.appendTo(this.$rectangle);
this.canvasContext = this.$canvas.get(0).getContext('2d');
this._redraw();
};
/**
* Creates slider.
*/
PaddingsEditor.prototype._createSlider = function() {
var self = this;
this.$bar.noUiSlider({
start: parseInt( self.$center.data('value') ),
range: {'min': self.rangeStart, 'max': self.rangeEnd },
step: self.step
});
this.$bar.on('slide', function(){
var value = parseInt( self.$bar.val() );
var valueWithUnits = value + self.units;
if ( self.activeSide === 'center' ) {
self.$sides.data('value', value);
self.$sides.find(".factory-visible-value").text( valueWithUnits );
} else {
self.$activeSide.data('value', value);
self.$activeSide.find(".factory-visible-value").text( valueWithUnits );
}
});
this.$bar.on('set', function(){
self.$result.val( self.getValue() );
self.$result.trigger('change');
});
};
/**
* Returns a current value.
*/
PaddingsEditor.prototype.getValue = function() {
var topValue = this.$element.find(".factory-side-top").data('value');
var rightValue = this.$element.find(".factory-side-right").data('value');
var bottomValue = this.$element.find(".factory-side-bottom").data('value');
var leftValue = this.$element.find(".factory-side-left").data('value');
return topValue + this.units + " " + rightValue + this.units + " " + bottomValue + this.units + " " + leftValue + this.units;
}
/**
* Selects a given side by its name.
*/
PaddingsEditor.prototype.selectSide = function( side ) {
if ( this.activeSide === side ) return;
this.activeSide = side;
this.$activeSide = this.$element.find(".factory-side-" + this.activeSide);
this.$element.find(".factory-side.factory-active").removeClass("factory-active");
this.$activeSide.addClass("factory-active");
this._redraw();
this.$bar.val( this.$activeSide.data('value') );
}
PaddingsEditor.prototype._initMouse = function() {
var self = this;
this._recalculateSizes();
this.$rectangle.on('mousemove.paddings-editor', function(e){
self.hoveredSide = self._getCurrentSide(e.pageX, e.pageY);
if ( self.hoveredSide === self.lastHoveredSide ) return;
self.lastHoveredSide = self.hoveredSide;
self._redraw();
});
this.$rectangle.on('mouseleave.paddings-editor', function(e){
self.hoveredSide = self.lastHoveredSide = null;
self._redraw();
});
this.$rectangle.on('click.paddings-editor', function(e){
var side = self._getCurrentSide(e.pageX, e.pageY);
self.selectSide( side );
});
};
/**
* Returns a current side by mouse pointer position.
*/
PaddingsEditor.prototype._getCurrentSide = function(pageX, pageY) {
var offset = this.$element.offset();
var offsetX = pageX - offset.left;
var offsetY = pageY - offset.top;
var dX = offsetX - this.centerX;
var dY = offsetY - this.centerY;
var dL = Math.sqrt ( Math.pow(dX,2) + Math.pow(dY,2) );
if ( dL <= this.centerR ) return "center";
// for line #1 (from bottom-left corner to top-right conner)
var a1 = this.elementHeight;
var b1 = this.elementWidth;
var c1 = -this.elementWidth * this.elementHeight;
var resultY1 = - ( c1 + a1 * offsetX ) / b1;
// for line #2 (from bottom-left corner to top-right conner)
var a2 = -this.elementHeight;
var b2 = this.elementWidth;
var c2 = 0;
var resultY2 = - ( c2 + a2 * offsetX ) / b2;
if ( resultY1 < offsetY && resultY2 > offsetY ) return "right";
if ( resultY1 > offsetY && resultY2 < offsetY ) return "left";
if ( resultY1 > offsetY && resultY2 > offsetY ) return "top";
if ( resultY1 < offsetY && resultY2 < offsetY ) return "bottom";
return null;
}
/**
* Redraws the canvas.
*/
PaddingsEditor.prototype._redraw = function() {
this.canvasContext.clearRect ( 0, 0, this.elementWidth, this.elementHeight );
this._highlightSide('top', '#a6b6b6');
this._highlightSide('bottom', '#a6b6b6');
this._highlightSide('left', '#aec0c0');
this._highlightSide('right', '#aec0c0');
this._highlightSide(this.hoveredSide, '#c0cece');
if ( this.activeSide ) this._highlightSide(this.activeSide, '#829595');
}
/**
* Hightlights hovered area.
*/
PaddingsEditor.prototype._highlightSide = function( side, style ) {
if ( !side ) return;
if ( side === 'center' ) return;
this.canvasContext.fillStyle = style;
this.canvasContext.beginPath();
if ( 'top' === side ) {
this.canvasContext.moveTo(0, 0);
this.canvasContext.lineTo(this.centerX, this.centerY);
this.canvasContext.lineTo(this.elementWidth, 0);
} else if ( 'bottom' === side ) {
this.canvasContext.moveTo(0, this.elementHeight);
this.canvasContext.lineTo(this.centerX, this.centerY);
this.canvasContext.lineTo(this.elementWidth, this.elementHeight);
} else if ( 'left' === side ) {
this.canvasContext.moveTo(0, 0);
this.canvasContext.lineTo(this.centerX, this.centerY);
this.canvasContext.lineTo(0, this.elementHeight);
} else if ( 'right' === side ) {
this.canvasContext.moveTo(this.elementWidth, 0);
this.canvasContext.lineTo(this.centerX, this.centerY);
this.canvasContext.lineTo(this.elementWidth, this.elementHeight);
}
this.canvasContext.closePath();
this.canvasContext.fill();
};
PaddingsEditor.prototype._recalculateSizes = function() {
this.elementOffset = this.$element.offset();
this.elementWidth = this.$rectangle.innerWidth();
this.elementHeight = this.$rectangle.innerHeight();
this.centerSize = this.$center.innerWidth();
this.centerR = this.centerSize / 2;
this.centerX = this.elementWidth / 2;
this.centerY = this.elementHeight / 2;
}
// INTEGER CONTROL DEFINITION
// ================================
$.fn.factoryBootstrap331_paddingsEditor = function (option) {
// call an method
if ( typeof option === "string" ) {
var data = $(this).data('factory.paddings-editor');
if ( !data ) return null;
return data[option]();
}
// creating an object
else {
return this.each(function () {
var $this = $(this);
var data = $this.data('factory.paddings-editor');
if (!data) $this.data('factory.paddings-editor', (data = new PaddingsEditor(this)));
});
}
};
$.fn.factoryBootstrap331_paddingsEditor.Constructor = PaddingsEditor;
// AUTO CREATING
// ================================
$(function(){
$(".factory-bootstrap-331 .factory-paddings-editor").factoryBootstrap331_paddingsEditor();
});
}( jQuery ) );

View File

@@ -0,0 +1,29 @@
<?php
/**
* Factory Bootstrap
*
* Factory is an internal professional framework developed by OnePress Ltd
* for own needs. Please don't use it to create your own independent plugins.
* In future the one will be documentated and released for public.
*
* @author Paul Kashtanoff <paul@byonepress.com>
* @copyright (c) 2013, OnePress Ltd
*
* @package factory-bootstrap
* @since 1.0.0
*/
// module provides function only for the admin area
if ( !is_admin() ) return;
if (defined('FACTORY_BOOTSTRAP_331_LOADED')) return;
define('FACTORY_BOOTSTRAP_331_LOADED', true);
define('FACTORY_BOOTSTRAP_331_DIR', dirname(__FILE__));
define('FACTORY_BOOTSTRAP_331_URL', plugins_url(null, __FILE__ ));
// sets version of admin interface
define('FACTORY_BOOTSTRAP_331_VERSION', 'FACTORY_BOOTSTRAP_331');
if ( !defined('FACTORY_FLAT_ADMIN')) define('FACTORY_FLAT_ADMIN', true);
include_once(FACTORY_BOOTSTRAP_331_DIR . '/includes/functions.php');

View File

@@ -0,0 +1,216 @@
<?php
/**
* This file manages assets of the Factory Bootstap.
*
* @author Alex Kovalev <alex@byonepress.com>
* @author Paul Kashtanoff <paul@byonepress.com>
* @copyright (c) 2013, OnePress Ltd
*
* @package core
* @since 1.0.0
*/
add_action('factory_bootstrap_331_plugin_created', 'factory_bootstrap_331_plugin_created');
function factory_bootstrap_331_plugin_created( $plugin ) {
$manager = new FactoryBootstrap331_Manager( $plugin );
$plugin->bootstrap = $manager;
}
/**
* The Bootstrap Manager class.
*
* @since 3.2.0
*/
class FactoryBootstrap331_Manager {
/**
* A plugin for which the manager was created.
*
* @since 3.2.0
* @var Factory325_Plugin
*/
public $plugin;
/**
* Contains scripts to include.
*
* @since 3.2.0
* @var string[]
*/
public $scripts = array();
/**
* Contains styles to include.
*
* @since 3.2.0
* @var string[]
*/
public $styles = array();
/**
* Createas a new instance of the license api for a given plugin.
*
* @since 1.0.0
*/
public function __construct( $plugin ) {
$this->plugin = $plugin;
add_action('admin_enqueue_scripts', array($this, 'loadAssets'));
add_filter('admin_body_class', array($this, 'adminBodyClass'));
}
/**
* Includes the Bootstrap scripts.
*
* @since 3.2.0
* @param mixedp[] $scripts
* @return void
*/
public function enqueueScript( $scripts ) {
if ( is_array( $scripts )) {
foreach( $scripts as $script) {
if ( !in_array ( $script, $this->scripts ) ) $this->scripts[] = $script;
}
} else {
if ( !in_array ( $scripts, $this->scripts ) ) $this->scripts[] = $scripts;
}
}
/**
* Includes the Bootstrap styles.
*
* @since 3.2.0
* @param mixedp[] $scripts
* @return void
*/
public function enqueueStyle( $styles ) {
if ( is_array( $styles )) {
foreach( $styles as $style ) {
if ( !in_array ( $style, $this->styles ) ) $this->styles[] = $style;
}
} else {
if ( !in_array ( $styles, $this->styles ) ) $this->styles[] = $styles;
}
}
/**
* Loads Bootstrap assets.
*
* @see admin_enqueue_scripts
*
* @since 3.2.0
* @return void
*/
public function loadAssets( $hook ) {
do_action('factory_bootstrap_enqueue_scripts', $hook );
do_action('factory_bootstrap_enqueue_scripts_' . $this->plugin->pluginName, $hook );
$dependencies = array();
if ( !empty( $this->scripts ) ) {
$dependencies[] = 'jquery';
$dependencies[] = 'jquery-ui-core';
$dependencies[] = 'jquery-ui-widget';
}
foreach( $this->scripts as $script ) {
switch ($script) {
case 'plugin.iris':
$dependencies[] = 'jquery-ui-widget';
$dependencies[] = 'jquery-ui-slider';
$dependencies[] = 'jquery-ui-draggable';
break;
}
}
$id = md5(FACTORY_BOOTSTRAP_331_VERSION);
$isFirst = true;
foreach($this->scripts as $scriptToLoad) {
wp_enqueue_script($scriptToLoad . '-' . $id, FACTORY_BOOTSTRAP_331_URL . "/assets/js/$scriptToLoad.js", $isFirst ? $dependencies : false);
$isFirst = false;
}
foreach($this->styles as $styleToLoad) {
wp_enqueue_style($styleToLoad . '-' . $id, FACTORY_BOOTSTRAP_331_URL . "/assets/flat/css/$styleToLoad.css" );
}
$userId = get_current_user_id();
$colorName = get_user_meta($userId, 'admin_color', true);
if ( $colorName !== 'fresh' ) {
wp_enqueue_style('factory-bootstrap-331-colors', FACTORY_BOOTSTRAP_331_URL . '/assets/flat/css/bootstrap.' . $colorName . '.css');
}
if ( $colorName == 'light' ) {
$primaryDark = '#037c9a';
$primaryLight = '#04a4cc';
} elseif( $colorName == 'blue' ) {
$primaryDark = '#d39323';
$primaryLight = '#e1a948';
} elseif( $colorName == 'coffee' ) {
$primaryDark = '#b78a66';
$primaryLight = '#c7a589';
} elseif( $colorName == 'ectoplasm' ) {
$primaryDark = '#839237';
$primaryLight = '#a3b745';
} elseif( $colorName == 'ocean' ) {
$primaryDark = '#80a583';
$primaryLight = '#9ebaa0';
} elseif( $colorName == 'midnight' ) {
$primaryDark = '#d02a21';
$primaryLight = '#e14d43';
} elseif( $colorName == 'sunrise' ) {
$primaryDark = '#c36822';
$primaryLight = '#dd823b';
} else {
$primaryDark = '#0074a2';
$primaryLight = '#2ea2cc';
}
?>
<script>
if ( !window.factory ) window.factory = {};
if ( !window.factory.factoryBootstrap331 ) window.factory.factoryBootstrap331 = {};
window.factory.factoryBootstrap331.colors = {
primaryDark: '<?php echo $primaryDark ?>',
primaryLight: '<?php echo $primaryLight ?>'
};
</script>
<?php
}
/**
* Tests whether the scripts and styles path contain query arguments or them were removed.
*
* See 'script_loader_src'
* See 'style_loader_src'
*
* @since 3.2.5
* @return void
*/
public function testKeepingArgsInPaths( $src, $handle ) {
if ( substr($handle, 0, 22) !== 'factory-bootstrap-331-') return $src;
$parts = explode( '?', $src );
if ( count( $parts ) > 1 ) return $src;
update_option('factory_css_js_compression', false );
return $src;
}
/**
* Adds the body classes: 'factory-flat or 'factory-volumetric'.
*
* @since 3.2.0
* @param string $classes
* @return string
*/
public function adminBodyClass( $classes) {
$classes .= FACTORY_FLAT_ADMIN ? ' factory-flat ' : ' factory-volumetric ';
return $classes;
}
}