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,61 @@
.onp-locker .onp-config-wrap {
background-color: rgba(139,139,150,0.1);
padding: 10px 10px 1px 10px;
}
.onp-locker .onp-config-wrap > * {
display: inline-block;
vertical-align: middle;
}
.onp-locker .onp-config-wrap label {
margin-right: 5px;
}
.onp-locker .onp-preview-wrap {
position: relative;
min-height: 60px;
display: flex;
flex-direction: column;
padding: 0 25px;
}
.onp-locker .block-editor-default-block-appender textarea.block-editor-default-block-appender__content {
padding-left: 0px;
margin-top: 32px;
}
.onp-locker .onp-top-bracket,
.onp-locker .onp-bottom-bracket {
border: 4px solid rgba(139,139,150,0.1);
height: 30px;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
.onp-locker .onp-top-bracket {
border-bottom: 0px;
bottom: auto;
}
.onp-locker .onp-bottom-bracket {
border-top: 0px;
top: auto;
}
.onp-locker .onp-locker-select-wrap select {
width: auto;
}
.onp-locker .onp-locker-select-wrap > div {
margin-bottom: 0px;
}
.onp-locker .onp-button {
margin-left: 5px;
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;
}

View File

@@ -0,0 +1,419 @@
/**
* CSS for the How To Use section of the Opt-In Panda
*
* @author Paul Kashtanoff <paul@byonepress.com>
* @copyright (c) 2014, OnePress Ltd
*
* @package optinpanda
* @since 1.0.0
*/
.wrap {
width: 950px;
margin: 18px auto;
}
.wrap * {
font-family: 'helvetica neue',helvetica,arial,'lucida grande',sans-serif;
}
/* ---
* Navigation
*/
.onp-help-nav {
width: 192px;
float: left;
position: fixed;
}
.onp-help-nav a {
display: block;
color: #141823;
padding: 14px 12px;
text-decoration: none;
}
.onp-help-nav a:focus {
outline: none;
box-shadow: none;
}
/* Sub items */
.onp-help-nav-subitems {
display: none;
}
.onp-help-active-item > .onp-inner-wrap > .onp-help-nav-subitems {
display: block;
}
/* Icons */
.onp-help-nav .fa {
margin-right: 2px;
font-size: 14px;
position: relative;
top: 1px;
color: #999;
}
.onp-help-nav .fa-minus-square-o {
display: none;
}
.onp-help-active-item > .onp-inner-wrap > a .fa-minus-square-o {
display: inline-block;
}
.onp-help-active-item > .onp-inner-wrap > a .fa-plus-square-o {
display: none;
}
/* Categories */
.onp-help-nav-category > .onp-inner-wrap > a {
padding-top: 6px;
padding-bottom: 6px;
padding-left: 9px;
color: #999;
font-weight: bold;
}
.onp-help-nav-category > .onp-inner-wrap > a:hover {
text-decoration: underline;
color: #555;
}
.onp-help-nav-category + .onp-help-nav-category.onp-help-active-item {
margin-top: 5px;
}
.onp-help-nav-category.onp-help-active-item {
background-color: #fff;
border: 1px solid #e3e3e3;
border-radius: 3px;
overflow: hidden;
margin-bottom: 10px;
}
.onp-help-nav-category.onp-help-active-item > .onp-inner-wrap {
border-bottom: 1px solid #f1f1f1;
}
.onp-help-nav-category.onp-help-active-item > .onp-inner-wrap > a {
border-left: 0px;
margin: 0px;
background-color: #fafafa;
color: #777;
border-bottom: 1px solid #f1f1f1;
padding: 12px 12px 10px 12px;
}
.onp-help-nav-category.onp-help-active-item > .onp-inner-wrap > a:hover {
text-decoration: none;
}
.onp-help-nav-category > .onp-inner-wrap > a .fa {
display: none;
}
/* Pages */
.onp-help-nav-page + .onp-help-nav-page {
border-top: 1px solid #f7f7f7;
}
.onp-help-nav-page.onp-help-active-item.onp-has-subitems + .onp-help-nav-page {
border-top: 0px;
}
.onp-help-nav-page.onp-help-active-item > .onp-inner-wrap > a > span {
font-weight: bold;
}
.onp-help-nav-page > .onp-inner-wrap > a:hover {
background-color: #fdfdfd;
}
.onp-help-nav-page > .onp-inner-wrap > .onp-help-nav-subitems {
background-color: #f9f9f9;
border-bottom: 0px;
border-top: 2px solid #f1f1f1;
border-bottom: 1px solid #f1f1f1;
}
.onp-help-nav-page:last-child > .onp-inner-wrap > .onp-help-nav-subitems {
border-bottom: 0px;
}
/* Sub Pages */
.onp-help-nav-subpage a {
padding-top: 9px;
padding-bottom: 9px;
}
.onp-help-nav-subpage a:first-child {
padding-top: 12px;
}
.onp-help-nav-subpage.onp-help-active-item > .onp-inner-wrap > a span {
font-style: italic;
}
.onp-help-nav-subpage > .onp-inner-wrap > a:hover {
background-color: #fcfcfc;
}
/* ---
* Content
*/
.onp-help-content {
background: #fff;
border: 1px solid #e3e3e3;
-moz-box-sizing: border-box;
box-sizing: border-box;
margin-left: 210px;
width: 725px;
border-radius: 3px;
}
.onp-help-content > .onp-inner-wrap {
border-bottom: 1px solid #f1f1f1;
}
.onp-help-content p {
margin: 0 0 20px 0;
font-size: 14px;
}
.onp-help-content .onp-help-section p:last-child {
margin-bottom: 0px;
}
.onp-help-content .onp-help-section {
color: #4e5665;
font-size: 14px;
line-height: 20px;
padding: 30px;
}
.onp-help-content .onp-help-section + .onp-help-section {
border-top: 1px solid #f9f9f9;
}
.onp-help-content .onp-help-section h1,
.onp-help-content .onp-help-section h2 {
margin: 0;
padding: 0px;
}
.onp-help-content .onp-help-section h1,
.onp-help-content .onp-help-section h2,
.onp-help-content .onp-help-section h3,
.onp-help-content .onp-help-section h4 {
color: #4e5665;
}
.onp-help-content .onp-help-section h1 {
font-size: 24px;
font-weight: normal;
line-height: 32px;
margin-bottom: 12px;
}
.onp-help-content .onp-help-section h2 {
font-size: 20px;
font-weight: normal;
line-height: 24px;
margin-bottom: 20px;
}
/* Buttons */
.onp-help-content .fa {
margin-left: 7px;
font-size: 11px;
}
/* List */
.onp-help-content .onp-list {
list-style: disc;
padding: 0 0 0 20px;
}
.onp-help-content .onp-list li {
padding: 0px;
margin: 0px;
}
.onp-help-content .onp-list li + li {
margin-top: 15px;
}
/* Bold List */
.onp-help-content .onp-bold-link {
font-weight: bold;
text-decoration: none;
}
.onp-help-content .onp-bold-link:hover {
text-decoration: underline;
}
/* Marks */
.onp-help-content .onp-mark {
padding: 0px 0;
display: inline-block;
}
.onp-help-content .onp-mark-stricked {
border-bottom: 1px solid #fff;
}
.onp-help-content .onp-mark-yellow {
background-color: #fffaea;
border-bottom-color: #f9f1e1;
}
.onp-help-content .onp-mark-gray {
background-color: #f7f7f7;
border-bottom-color: #e9e9e9;
}
/* Code */
.onp-help-content .onp-code {
font-family: Consolas;
font-size: 13px;
}
/* Stress */
.onp-help-content strong {
color: #555;
}
.onp-help-content .onp-stress {
font-weight: 600;
font-style: italic;
color: #555;
}
/* Notes */
.onp-help-content .onp-note {
border-left: 5px solid #2c3e50;
padding: 10px 15px;
background-color: #f9f9f9;
color: #444;
}
.onp-help-content .onp-remark {
background: #f9f9f9;
border-radius: 3px;
}
.onp-help-content .onp-remark .onp-inner-wrap {
display: block;
padding: 10px 10px 10px 15px;
}
/* images */
.onp-help-content .onp-img {
margin: 20px 0px 25px 0;
padding: 35px 20px 30px 20px;
text-align: center;
line-height: 50%;
background-color: #fcfcfc;
}
.onp-help-content .onp-img img {
max-width: 612px;
-moz-box-sizing: content-box;
box-sizing: content-box;
}
.onp-help-content .onp-img i {
display: block;
font-style: italic;
margin: 20px 0 0 0px;
padding: 0px;
line-height: 150%;
color: #aaa;
font-size: 15px;
padding: 0 70px;
}
.onp-help-content strong {
font-weight: bold;
}
.onp-help-content ul {
padding-left: 20px;
list-style: inside;
}
/**
* Upgrade To Premium
*/
.onp-how-comparation thead {
background-color: #f9f9f9;
}
.onp-how-comparation,
.onp-how-comparation td,
.onp-how-comparation th {
border: 0px !important;
}
.onp-how-group-title {
font-weight: bold;
padding-top: 30px !important;
}
.onp-how-title a {
color: #4e5665;
text-decoration: none;
border-bottom: 1px dotted #5e6675;
}
.onp-how-no {
color: #ddd;
}
.onp-how-yes strong {
color: #444;
}
.onp-how-premium {
background-color: #f6fcfe;
}
thead .onp-how-premium {
background-color: #2ea2cc;
color: #fff;
}
#activate-trial-btn,
#onp-sl-purchase-btn {
padding: 20px 0 !important;
font-size: 20px;
-moz-box-sizing: content-box;
box-sizing: content-box;
width: 100%;
text-align: center;
height: auto;
}
#onp-sl-purchase-btn {
padding: 20px 0 !important;
font-size: 20px;
-moz-box-sizing: content-box;
box-sizing: content-box;
width: 100%;
text-align: center;
height: auto;
background: #fffaea;
border-color: #ddd9cd;
-moz-box-shadow: 0 0 8px #fddf67;
-webkit-box-shadow: 0 0 8px #fddf67;
box-shadow: 0 0 8px #fddf67;
-moz-text-shadow: none;
-webkit-text-shadow: none;
text-shadow: none;
}
/* hides the vk note on the how to use page */
.onp-sl-vk-note {
display: none;
}
/* tables */
.onp-help-content .table p {
margin: 0px;
}
.onp-help-content .table p + p {
margin-top: 5px;
}
.onp-help-content .table .onp-title {
font-weight: bold;
white-space: nowrap;
}
.onp-help-content .table > thead {
background-color: #f9f9f9;
}
.onp-help-content .table > thead > tr > th {
border-bottom-width: 1px;
}
.onp-help-content .table > tbody > tr > td,
.onp-help-content .table > tr > td {
border-bottom: 1px solid #f9f9f9;
}

View File

@@ -0,0 +1,234 @@
/**
* More Features
*/
.advanced-function-demo .demo-themes {
width: 565px;
height: 541px;
background-image: url("../img/more-features/en_US/demo-themes.png");
}
.advanced-function-demo .demo-social-options {
width: 859px;
height: 466px;
background-image: url("../img/more-features/en_US/demo-social-options.png");
}
.advanced-function-demo .demo-blurring-effect {
width: 594px;
height: 424px;
background-image: url("../img/more-features/en_US/demo-blurring.png");
}
.advanced-function-demo .demo-advanced-options {
width: 597px;
height: 537px;
background-image: url("../img/more-features/en_US/demo-visibility-options.png");
}
/**
* Social Tabs
*/
.factory-flat #OPanda_SocialOptionsMetaBox {
background: #f6f6f6;
}
.factory-flat #OPanda_SocialOptionsMetaBox .nav-tabs li {
background-color: transparent;
}
.onp-sl-metabox-hint {
margin-bottom: 15px;
}
.factory-bootstrap-331 .factory-align-vertical .nav-tabs li {
padding-left: 32px;
background: url("../img/drag.png") 5px 50% no-repeat;
cursor: move;
}
.factory-bootstrap-331 .sortable-placeholder {
height: 40px;
background: #f3f3f3 !important;
margin: 0px !important;
box-shadow: inset 0px 0px 7px rgba(0,0,0,0.15);
border-bottom-left-radius: 4px;
}
.factory-bootstrap-331 .factory-align-vertical .nav-tabs {
width: 150px;
}
.factory-bootstrap-331 .factory-align-vertical .nav-tabs li:hover {
background-image: url("../img/drag-hover.png") !important;
}
.factory-bootstrap-331 .factory-align-vertical .nav-tabs a {
background-image: url("../img/social-buttons-for-admin-en_US.png");
background-position: -38px 0;
height: 42px;
-moz-transition: none;
transition: none;
}
.factory-bootstrap-331 .factory-align-vertical .factory-bodies {
min-height: 350px !important;
}
.factory-volumetric .factory-bootstrap-331 .factory-align-vertical .nav-tabs a {
height: 22px;
}
.factory-bootstrap-331 .factory-align-vertical .factory-tab-item-header-facebook-like a {
background-position: -38px -1px;
}
.factory-bootstrap-331 .factory-align-vertical .factory-tab-item-header-facebook-share a {
background-position: -38px -41px;
}
.factory-bootstrap-331 .factory-align-vertical .factory-tab-item-header-twitter-tweet a {
background-position: -38px -81px;
}
.factory-bootstrap-331 .factory-align-vertical .factory-tab-item-header-twitter-follow a {
background-position: -38px -121px;
}
.factory-bootstrap-331 .factory-align-vertical .factory-tab-item-header-google-plus a {
background-position: -38px -161px;
}
.factory-bootstrap-331 .factory-align-vertical .factory-tab-item-header-google-share a {
background-position: -38px -201px;
}
.factory-bootstrap-331 .factory-align-vertical .factory-tab-item-header-youtube-subscribe a {
background-position: -38px -282px;
}
.factory-bootstrap-331 .factory-align-vertical .factory-tab-item-header-linkedin-share a {
background-position: -38px -241px;
}
.factory-bootstrap-331 .factory-align-vertical .factory-disabled.factory-tab-item-header-facebook-like a {
background-position: -195px -1px;
}
.factory-bootstrap-331 .factory-align-vertical .factory-disabled.factory-tab-item-header-facebook-share a {
background-position: -195px -41px;
}
.factory-bootstrap-331 .factory-align-vertical .factory-disabled.factory-tab-item-header-twitter-tweet a {
background-position: -195px -81px;
}
.factory-bootstrap-331 .factory-align-vertical .factory-disabled.factory-tab-item-header-twitter-follow a {
background-position: -195px -121px;
}
.factory-bootstrap-331 .factory-align-vertical .factory-disabled.factory-tab-item-header-google-plus a {
background-position: -195px -161px;
}
.factory-bootstrap-331 .factory-align-vertical .factory-disabled.factory-tab-item-header-google-share a {
background-position: -195px -201px;
}
.factory-bootstrap-331 .factory-align-vertical .factory-disabled.factory-tab-item-header-youtube-subscribe a {
background-position: -195px -282px;
}
.factory-bootstrap-331 .factory-align-vertical .factory-disabled.factory-tab-item-header-linkedin-share a {
background-position: -195px -241px;
}
.factory-bootstrap-331 .factory-align-vertical .nav-tabs li a {
cursor: pointer;
}
.factory-bootstrap-331 .factory-align-vertical .nav-tabs {
background-color: transparent;
}
.factory-bootstrap-331 .factory-align-vertical .pi-tab-hint {
padding-left: 4px;
}
#optinpanda_facebook_like_title,
#optinpanda_facebook_share_title,
#optinpanda_twitter_tweet_title,
#optinpanda_twitter_follow_title,
#optinpanda_google_plus_title,
#optinpanda_google_share_title,
#optinpanda_linkedin_share_title{
width: 150px;
}
#optinpanda_twitter_tweet_text {
height: 100px;
}
#vk-share .alert,
#facebook-like .alert,
#facebook-share .alert,
#youtube-subscribe .alert,
#google-share .alert {
position: relative;
top: -15px;
margin-left: 5px;
}
.factory-volumetric #facebook-share .alert,
.factory-volumetric #google-share .alert {
margin-bottom: 15px;
line-height: 170%;
}
#OPanda_SocialOptionsMetaBox .factory-tab {
margin-bottom: 0px;
}
#OPanda_SocialOptionsMetaBox .factory-tab .form-group:last-child {
margin-bottom: 0px;
}
#OPanda_SocialOptionsMetaBox .factory-control-show_counters {
position: absolute;
top: 11px;
right: 37px;
white-space: nowrap;
}
#OPanda_SocialOptionsMetaBox .factory-control-show_counters {
vertical-align: middle;
}
#OPanda_SocialOptionsMetaBox .factory-control-show_counters .control-group,
#OPanda_SocialOptionsMetaBox .factory-control-show_counters .control-label {
width: auto;
display: inline-block;
padding: 0px;
vertical-align: middle;
float: none;
}
#OPanda_SocialOptionsMetaBox .factory-control-show_counters .control-label {
font-weight: normal;
margin-right: 10px;
}
#OPanda_SocialOptionsMetaBox .factory-control-show_counters .btn-group {
padding: 0px;
border: 0px;
}
#OPanda_SocialOptionsMetaBox .factory-control-show_counters .btn-group .btn {
padding-top: 3px;
padding-bottom: 3px;
}
#OPanda_SocialOptionsMetaBox .factory-control-show_counters .btn-group .btn {
background: #fafafa;
color: #555;
border-color: #ccc;
background: #f7f7f7;
-webkit-box-shadow: inset 0 1px 0 #fff,0 1px 0 rgba(0,0,0,.08);
box-shadow: inset 0 1px 0 #fff,0 1px 0 rgba(0,0,0,.08);
vertical-align: top;
}
#OPanda_SocialOptionsMetaBox .factory-control-show_counters .btn-group .btn:hover,
#OPanda_SocialOptionsMetaBox .factory-control-show_counters .btn-group .btn:focus,
#OPanda_SocialOptionsMetaBox .factory-control-show_counters .btn-group .btn:active,
#OPanda_SocialOptionsMetaBox .factory-control-show_counters .btn-group .btn.active {
background: #fafafa;
border-color: #999;
color: #222;
}
#OPanda_SocialOptionsMetaBox .factory-control-show_counters .btn-group .btn:active,
#OPanda_SocialOptionsMetaBox .factory-control-show_counters .btn-group .btn.active {
background-color: #fff;
border-color: #dbdbdb;
}
.factory-volumetric #OPanda_SocialOptionsMetaBox .factory-control-show_counters .control-label {
padding-top: 6px;
font-size: 12px;
}
.factory-volumetric #OPanda_SocialOptionsMetaBox .factory-control-show_counters .controls {
margin-left: 0px;
display: inline-block;
vertical-align: middle;
}
.factory-volumetric #OPanda_SocialOptionsMetaBox .factory-control-show_counters {
right: 22px;
top: 7px;
}
.factory-volumetric #OPanda_SocialOptionsMetaBox .factory-control-show_counters .btn {
font-size: 12px;
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,239 @@
/**
* CSS for Opt-In Panda viewtable
*
* @author Paul Kashtanoff <paul@byonepress.com>
* @copyright (c) 2013, OnePress Ltd
*
* @package optinpanda
* @since 1.0.0
*/
.column-shortcode input {
width: 100%;
max-width: 280px;
border: 0px;
background-color: transparent;
font-size: 12px;
font-family: "Consolas", Tahoma, Arial;
padding: 5px;
background-color: transparent;
box-shadow: inset 1px 1px 1px rgba(0,0,0,0.05), 1px 1px 1px #fff !important;
}
.column-shortcode {
width: 30%;
}
.column-bulk {
width: 270px;
}
.column-bulk .onp-sl-setup-section {
overflow: hidden;
padding: 10px;
}
.column-bulk .onp-sl-setup-section.onp-sl-empty-state {
padding: 0px;
}
.column-bulk .onp-sl-empty-state .onp-sl-has-options-content,
.column-bulk .onp-sl-has-options-state .onp-sl-empty-content {
display: none;
}
.column-bulk .onp-sl-setup-section .btn {
text-decoration: none;
}
.column-bulk .onp-sl-setup-section .btn + .btn {
margin-left: 5px;
}
.column-bulk.onp-sl-setup-section .btn .fa {
font-size: 14px;
position: relative;
top: 1px;
margin-right: 2px;
}
/* Empty State */
.column-bulk .onp-sl-empty-content .btn {
float: right;
}
/* Has Options */
.column-bulk .onp-sl-has-options-state {
color: #fff;
background-color: #0074a2;
border-top: 1px solid #006187;
}
.column-bulk .onp-sl-has-options-state p {
color: #fff;
}
.admin-color-light .column-bulk .onp-sl-has-options-state {
color: #111;
background-color: #f5f5f5;
border-top: 1px solid #dddddd;
}
.admin-color-light .column-bulk .onp-sl-has-options-state p {
color: #111;
}
.admin-color-blue .column-bulk .onp-sl-has-options-state {
color: #111;
background-color: #f5f5f5;
border-top: 1px solid #dddddd;
}
.admin-color-blue .column-bulk .onp-sl-has-options-state p {
color: #111;
}
.admin-color-coffee .column-bulk .onp-sl-has-options-state {
background-color: #59524c;
border-top: 1px solid #403c39;
}
.admin-color-ectoplasm .column-bulk .onp-sl-has-options-state {
background-color: #523f6d;
border-top: 1px solid #382b4b;
}
.admin-color-midnight .column-bulk .onp-sl-has-options-state {
background-color: #363b3f;
border-top: 1px solid #1c1f21;
}
.admin-color-ocean .column-bulk .onp-sl-has-options-state {
background-color: #738e96;
border-top: 1px solid #667c82;
}
.admin-color-sunrise .column-bulk .onp-sl-has-options-state {
background-color: #cf4944;
border-top: 1px solid #c1423d;
}
.factory-volumetric .column-bulk .onp-sl-has-options-state {
color: #fff;
background: #21759b;
border-radius: 3px;
margin-bottom: 9px;
margin-top: 4px;
border: 0px;
border-top: 1px solid #21759b;
-webkit-box-shadow: 0px 2px 8px 0px rgba(0,0,0,0.15),inset 0px 1px 0px 0px rgba(255,255,255,0.2);
box-shadow: 0px 2px 8px 0px rgba(0,0,0,0.15),inset 0px 1px 0px 0px rgba(255,255,255,0.2);
}
.column-bulk .onp-sl-way-description {
display: none;
}
.column-bulk .onp-sl-skip-lock-state .onp-sl-skip-lock-content,
.column-bulk .onp-sl-more-tag-state .onp-sl-more-tag-content,
.column-bulk .onp-sl-css-selector-state .onp-sl-css-selector-content {
display: block;
}
.column-bulk .onp-sl-rules,
.column-bulk .onp-sl-post-types-rule,
.column-bulk .onp-sl-exclude-post-ids-rule,
.column-bulk .onp-sl-exclude-categories-ids-rule {
display: none;
}
.column-bulk .onp-sl-post-types-rule-state .onp-sl-rules,
.column-bulk .onp-sl-exclude-post-ids-rule-state .onp-sl-rules,
.column-bulk .onp-sl-exclude-categories-ids-rule-state .onp-sl-rules,
.column-bulk .onp-sl-post-types-rule-state .onp-sl-post-types-rule,
.column-bulk .onp-sl-exclude-post-ids-rule-state .onp-sl-exclude-post-ids-rule,
.column-bulk .onp-sl-exclude-categories-ids-rule-state .onp-sl-exclude-categories-ids-rule {
display: block;
}
.column-bulk .onp-sl-rules {
position: relative;
top: 10px;
}
.column-bulk .onp-sl-rules span + span {
margin-top: 5px;
}
.column-bulk .onp-sl-rules,
.column-bulk .onp-sl-css-selector-view {
background-color: rgba(255,255,255,0.1);
-moz-box-sizing: content-box;
box-sizing: content-box;
width: 100%;
margin-left: -10px;
padding: 10px;
overflow: hidden;
}
.admin-color-light .column-bulk .onp-sl-rules,
.admin-color-light .column-bulk .onp-sl-css-selector-view,
.admin-color-blue .column-bulk .onp-sl-rules,
.admin-color-blue .column-bulk .onp-sl-css-selector-view {
background-color: rgba(0,0,0,0.02);
}
.column-bulk .onp-sl-css-selector-view {
display: block;
margin-top: 0px;
position: relative;
top: 10px;
}
.column-bulk .onp-sl-way-description p {
margin: 0px;
}
.column-bulk .onp-sl-way-description p + p {
margin-top: 5px;
}
.column-bulk .onp-sl-skip-lock-content > span {
display: none;
}
.column-bulk .onp-sl-skip-lock-0-state .onp-sl-skip-lock-0-content,
.column-bulk .onp-sl-skip-lock-1-state .onp-sl-skip-lock-1-content,
.column-bulk .onp-sl-skip-lock-2-state .onp-sl-skip-lock-2-content {
display: block;
}
.column-bulk .onp-sl-controls {
padding-top: 12px;
}
.column-stats .opanda-empty {
color: #555;
}
/**
* Stats Column
*/
th.column-stats span {
cursor: help;
}
/**
* Visibility Conditions
*/
table.fixed {
table-layout: auto;
}
.column-visibility {
padding-left: 10px !important;
}
.column-visibility .onp-sl-inner-wrap {
min-width: 200px;
}
.column-visibility ul {
padding: 0px;
margin: 0px;
}
.column-visibility .bp-visibility-conditions {
}
.column-visibility .bp-filter-type,
.column-visibility strong {
font-weight: bold;
color: #111;
}
.column-visibility strong {
color: #111;
}
.column-visibility .bp-scopes {
margin-left: 10px;
}

View File

@@ -0,0 +1,441 @@
#opanda-leads-page .column-avatar {
width: 46px;
}
#opanda-leads-page td,
#opanda-leads-page th {
overflow: hidden;
color: #555;
}
#opanda-leads-page .column-avatar .opanda-avatar {
display: block;
width: 40px;
height: 40px;
padding: 2px;
border: 1px solid #D3D6DB;
background-color: #FFF;
background-position: center center;
background-repeat: no-repeat;
background-size: 40px 40px;
margin-bottom: 4px;
}
#opanda-leads-page .column-name .opanda-name {
font-weight: 700;
font-size: 1.2em;
line-height: 1.6em;
}
#opanda-leads-page .column-name strong.opanda-name {
color: #555;
}
#opanda-leads-page .column-status i {
vertical-align: middle;
}
#opanda-leads-page .column-status .fa {
font-size: 15px;
margin-right: 5px;
}
#opanda-leads-page .column-status .opanda-status-help {
cursor: help;
}
#opanda-leads-page .opanda_lead_way ul {
padding: 0px;
margin: 0px;
}
#opanda-leads-page .opanda_lead_way li {
margin: 0px;
}
#opanda-leads-page .opanda_lead_way li + li {
margin-top: 5px;
}
#opanda-leads-page .opanda_lead_confirmed {
cursor: help;
}
#opanda-leads-page .opanda_lead_checkbox {
width: 1%;
}
#opanda-leads-page .column-opanda_lead_email,
#opanda-leads-page .column-opanda_lead_name,
#opanda-leads-page .column-opanda_lead_date {
width: 1%;
padding-right: 50px !important;
min-width: 80px;
}
#opanda-leads-page .opanda_lead_checkbox,
#opanda-leads-page .opanda_lead_how,
#opanda-leads-page .column-opanda_lead_confirmed {
width: 1%;
}
#opanda-leads-page .opanda_lead_how {
white-space: nowrap;
padding-right: 50px !important;
}
#opanda-leads-page table.fixed {
table-layout: auto;
}
#opanda-leads-page .opanda-social-icon {
margin-left: 7px;
background: #fff;
box-shadow: 0px 1px 1px rgba(0,0,0,0.07);
width: 18px;
height: 18px;
display: inline-block;
text-align: center;
position: relative;
top: -1px;
}
#opanda-leads-page .opanda-social-icon + .opanda-social-icon {
margin-left: 5px;
}
#opanda-leads-page .opanda-social-icon i {
line-height: 18px;
color: #777;
font-size: 10px;
position: relative;
top: -1px;
}
#opanda-leads-page .opanda-social-icon .fa-twitter {
position: relative;
}
#opanda-leads-page .opanda-social-icon .fa-google-plus {
position: relative;
}
#opanda-leads-page .opanda-social-icon .fa-facebook {
position: relative;
}
#opanda-leads-page .opanda-social-icon:hover i {
color: #fff;
}
#opanda-leads-page .opanda-facebook-icon:hover {
background-color: #3c5a9a;
}
#opanda-leads-page .opanda-twitter-icon:hover {
background-color: #4086cc;
}
#opanda-leads-page .opanda-google-icon:hover {
background-color: #e75c3c;
}
#opanda-leads-page .opanda-linkedin-icon:hover {
background-color: #3a9bdc;
}
/**
* Lead Details
*/
#opanda-lead-details-page h2 {
margin-bottom: 30px;
}
#opanda-lead-details-page .avatar-wrap{
width: 180px;
}
#opanda-lead-details-page .opanda-avatar {
display: block;
width: 150px;
height: 150px;
padding: 4px;
border: 1px solid #D3D6DB;
background-color: #FFF;
background-position: center center;
background-repeat: no-repeat;
background-size: 40px 40px;
margin-bottom: 4px;
}
/* Controls */
.controls-wrap {
padding: 20px;
padding-left: 8px;
}
#opanda-lead-details-page .detail .click-to-edit{
margin: 0;
display: inline-block;
min-width: 150px;
}
#opanda-lead-details-page .detail.active .click-to-edit{
min-width: 350px;
}
#opanda-lead-details-page .user-info .detail code{
visibility: hidden;
font-size: 12px;
}
#opanda-lead-details-page .user-info .detail:hover code{
visibility: visible;
}
#opanda-lead-details-page .user-info .detail{
cursor: pointer;
-webkit-box-sizing:border-box;
-moz-box-sizing:border-box;
box-sizing:border-box;
}
#opanda-lead-details-page .user-info .detail.active{
background-color: #F9F9F9;
cursor: default;
}
#opanda-lead-details-page .new .user-info .detail.active{
background-color: inherit;
}
#opanda-lead-details-page .user-info .detail.active code{
display: none;
}
#opanda-lead-details-page .user-info .detail.v-top label{
vertical-align: top;
padding-right: 5px;
}
#opanda-lead-details-page .user-info .detail:hover{
background-color: #F9F9F9;
}
#opanda-lead-details-page .new .user-info .detail:hover{
background-color: inherit;
}
#opanda-lead-details-page h3.detail .click-to-edit{
width: 70%;
}
#opanda-lead-details-page .new .click-to-edit, .new h3.detail .click-to-edit, h3.detail.active .click-to-edit{
width: 100%;
}
#opanda-lead-details-page .click-to-edit li{
display: none;
}
#opanda-lead-details-page .click-to-edit li:first-child{
display: block;
min-width: 102%;
}
#opanda-lead-details-page .new .click-to-edit li{
display: block;
}
#opanda-lead-details-page .new .click-to-edit li:first-child{
display: none;
}
#opanda-lead-details-page .new .click-to-edit li li:first-child{
display: inherit;
margin-top: 4px;
}
#opanda-lead-details-page .click-to-edit li li{
display: inherit;
}
#opanda-lead-details-page label{
font-weight:700;
}
#opanda-lead-details-page .click-to-edit label{
font-weight:normal;
}
#opanda-lead-details-page #subscriber_form .info{
margin: 5px 8px;
font-size: 12px;
}
#opanda-lead-details-page #subscriber_form .avatar-wrap .info{
margin: 2px 8px;
font-size: 12px;
}
#opanda-lead-details-page #subscriber_form .info .more-info{
margin: 5px 0px;
display:none;
}
#opanda-lead-details-page #subscriber_form .info .show-more-info{
cursor: pointer;
margin-right: 20px;
}
#opanda-lead-details-page .custom-field-wrap{
margin-top: 36px;
}
#opanda-lead-details-page .form-table td{
vertical-align: top;
padding:0;
}
#opanda-lead-details-page .avatar{
display: block;
width:200px;
height:200px;
padding: 4px;
border: 1px solid #D3D6DB;
background-color: #FFF;
background-position: center center;
background-repeat: no-repeat;
background-size: 200px 200px;
-moz-user-select: -moz-none;
-khtml-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
user-select: none;
}
#opanda-lead-details-page .branch-3-3 .avatar.wp-user:before,.branch-3-4 .avatar.wp-user:before,.branch-3-5 .avatar.wp-user:before,.branch-3-6 .avatar.wp-user:before,.branch-3-7 .avatar.wp-user:before{
content :'';
}
#opanda-lead-details-page .avatar.wp-user:before{
font-family: 'dashicons';
content: '\f120';
margin-left: 156px;
line-height: 357px;
font-size: 300%
}
#opanda-lead-details-page .user-info{
}
#opanda-lead-details-page .user-info h3, .user-info ul{
margin: 0;
}
#opanda-lead-details-page .user-info .detail{
padding: 11px 8px 2px;
margin-right: 20px;
border-bottom:1px solid #ccc;
}
#opanda-lead-details-page .user-info .detail code{
float: right;
padding: 2px;
font-weight: normal;
}
#opanda-lead-details-page .new .user-info .detail code{
display:none;
}
#opanda-lead-details-page .user-meta{
min-height: 200px;
width: 300px;
}
#opanda-lead-details-page .map{
border: 1px solid #D3D6DB;
}
#opanda-lead-details-page .map img{
display: block;
box-shadow: inset 0px 1px 3px rgba(0, 0, 0, 0.1);
-moz-box-shadow: inset 0px 1px 3px rgba(0,0,0,0.1);
-webkit-box-shadow: inset 0px 1px 3px rgba(0, 0, 0, 0.1);
-moz-user-select: -moz-none;
-khtml-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
user-select: none;
}
#opanda-lead-details-page .map.zoomable img{
cursor:-webkit-zoom-in;
cursor:-moz-zoom-in;
cursor:zoom-in;
}
#opanda-lead-details-page .map.zoomable img.zoomed{
cursor:-webkit-zoom-out;
cursor:-moz-zoom-out;
cursor:zoom-out;
}
#opanda-lead-details-page h3 input{
font-size: 20px;
line-height: 1.4em;
width: 100%;
}
#opanda-lead-details-page .stats-wrap #stats {
margin-top:20px;
margin-bottom:20px;
border:0;
width: 80%;
}
#opanda-lead-details-page .stats-wrap #stats td {
vertical-align:middle;
border:0;
}
#opanda-lead-details-page .stats-wrap .big {
font-size:18px;
font-weight:100;
text-shadow:1px 1px 0 rgba(255,255,255,1);
display:inline-block;
width:90px;
margin-right:5px
}
#opanda-lead-details-page .stats-wrap .verybold {
line-height:2.5em;
font-size:22px;
font-weight:700;
text-shadow:1px 1px 0 rgba(255,255,255,1);
}
#opanda-lead-details-page .mymail-icon.client-desktop:before{
content:'\e811';
}
#opanda-lead-details-page .mymail-icon.client-mobile:before{
content:'\e813';
}
#opanda-lead-details-page .mymail-icon.client-webmail:before{
content:'\e828';
}
#opanda-lead-details-page .activity-wrap{
float: none;
clear: both;
}
#opanda-lead-details-page .activity-wrap .red{
color: #D8605F;
}
#opanda-lead-details-page .activity-wrap .icon-mm-error{
color: #D8605F;
}
#opanda-lead-details-page .activity-wrap .icon-mm-bounce.hard{
text-align:center;
border-radius:50%;
display:block;
width:18px;
height:18px;
line-height: 17px;
font-size:11px;
color:#fff;
background-color:#D8605F;
}
#opanda-lead-details-page .activity-wrap .icon-mm-bounce.hard:before{
margin-left:2px;
}
/**
* Export
*/
#opanda-export-page .control-group label {
font-weight: normal;
}
#opanda-export-page .control-group label,
#opanda-export-page .control-group label input {
vertical-align: bottom;
}
#opanda-export-page .control-group label input[type="checkbox"] {
margin-top: 0px;
margin-right: 5px;
}
#opanda-export-page .control-group label input[type="radio"] {
margin-left: 3px;
margin-right: 15px;
}
label[for="factory-checklist-opanda_lockers-all"] {
border-bottom: 1px dashed #555;
}
label[for="factory-checklist-opanda_lockers-all"]:hover {
border-bottom: 1px dashed transparent;
}
label[for="factory-checklist-opanda_lockers-all"] input {
display: none;
}

View File

@@ -0,0 +1,34 @@
.dropdown-menu {
position: absolute;
top: 100%;
left: 0;
z-index: 1000;
display: none;
float: left;
min-width: 160px;
padding: 5px 0;
margin: 2px 0 0;
list-style: none;
background-color: #ffffff;
border: 1px solid #ccc;
border: 1px solid rgba(0, 0, 0, 0.2);
*border-right-width: 2px;
*border-bottom-width: 2px;
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
border-radius: 6px;
-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;
}
/*
Datepicker for Bootstrap
Copyright 2012 Stefan Petre
Licensed under the Apache License v2.0
http://www.apache.org/licenses/LICENSE-2.0
*/
.datepicker { top: 0; left: 0; padding: 4px; margin-top: 1px; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; /*.dow { border-top: 1px solid #ddd !important; }*/ } .datepicker:before { content: ''; display: inline-block; border-left: 7px solid transparent; border-right: 7px solid transparent; border-bottom: 7px solid #ccc; border-bottom-color: rgba(0, 0, 0, 0.2); position: absolute; top: -7px; left: 6px; } .datepicker:after { content: ''; display: inline-block; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 6px solid #ffffff; position: absolute; top: -6px; left: 7px; } .datepicker > div { display: none; } .datepicker table { width: 100%; margin: 0; } .datepicker td, .datepicker th { text-align: center; width: 20px; height: 20px; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; } .datepicker td.day:hover { background: #eeeeee; cursor: pointer; } .datepicker td.old, .datepicker td.new { color: #999999; } .datepicker td.active, .datepicker td.active:hover { background-color: #006dcc; background-image: -moz-linear-gradient(top, #0088cc, #0044cc); background-image: -ms-linear-gradient(top, #0088cc, #0044cc); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc)); background-image: -webkit-linear-gradient(top, #0088cc, #0044cc); background-image: -o-linear-gradient(top, #0088cc, #0044cc); background-image: linear-gradient(top, #0088cc, #0044cc); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc', endColorstr='#0044cc', GradientType=0); border-color: #0044cc #0044cc #002a80; border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); color: #fff; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); } .datepicker td.active:hover, .datepicker td.active:hover:hover, .datepicker td.active:active, .datepicker td.active:hover:active, .datepicker td.active.active, .datepicker td.active:hover.active, .datepicker td.active.disabled, .datepicker td.active:hover.disabled, .datepicker td.active[disabled], .datepicker td.active:hover[disabled] { background-color: #0044cc; } .datepicker td.active:active, .datepicker td.active:hover:active, .datepicker td.active.active, .datepicker td.active:hover.active { background-color: #003399 \9; } .datepicker td span { display: block; width: 47px; height: 54px; line-height: 54px; float: left; margin: 2px; cursor: pointer; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; } .datepicker td span:hover { background: #eeeeee; } .datepicker td span.active { background-color: #006dcc; background-image: -moz-linear-gradient(top, #0088cc, #0044cc); background-image: -ms-linear-gradient(top, #0088cc, #0044cc); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc)); background-image: -webkit-linear-gradient(top, #0088cc, #0044cc); background-image: -o-linear-gradient(top, #0088cc, #0044cc); background-image: linear-gradient(top, #0088cc, #0044cc); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc', endColorstr='#0044cc', GradientType=0); border-color: #0044cc #0044cc #002a80; border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); color: #fff; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); } .datepicker td span.active:hover, .datepicker td span.active:active, .datepicker td span.active.active, .datepicker td span.active.disabled, .datepicker td span.active[disabled] { background-color: #0044cc; } .datepicker td span.active:active, .datepicker td span.active.active { background-color: #003399 \9; } .datepicker td span.old { color: #999999; } .datepicker th.switch { width: 145px; } .datepicker th.next, .datepicker th.prev { font-size: 19.5px; } .datepicker thead tr:first-child th { cursor: pointer; } .datepicker thead tr:first-child th:hover { background: #eeeeee; } .input-append.date .add-on i, .input-prepend.date .add-on i { display: block; cursor: pointer; width: 16px; height: 16px; }

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,147 @@
/**
* The Page 'New Item'
*
* @author Paul Kashtanoff <paul@byonepress.com>
* @copyright (c) 2014, OnePress Ltd
*
* @package optinpanda
* @since 1.0.0
*/
html {
}
.wrap {
margin-top: 0px;
}
.opanda-fullwidth {
-moz-box-sizing: content-box;
box-sizing: content-box;
width: 100%;
margin-left: -22px;
padding-left: 22px;
padding-right: 22px;
}
.opanda-items {
padding-top: 10px;
padding-bottom: 20px;
overflow: hidden;
background-color: #f1f1f1;
}
.opanda-items .opanda-buttons .button {
background-color: #fff;
}
.opanda-item {
width: 250px;
min-width: 0;
height: 250px;
padding: 20px;
margin: 0 15px 15px 0;
vertical-align: top;
float: left;
-moz-box-sizing: border-box;
box-sizing: border-box;
line-height: 150%;
position: relative;
}
.opanda-item .opanda-title {
font-size: 16px;
margin: 0 0 15px 0;
}
.opanda-item .opanda-buttons {
position: absolute;
bottom: 0;
left: 0; right: 0;
padding: 18px;
background-color: #f9f9f9;
height: 66px;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.opanda-item .opanda-buttons .fa {
position: relative;
font-size: 14px;
}
.opanda-item .opanda-buttons .fa + span {
margin-left: 5px;
}
.opanda-item .opanda-buttons .opanda-right {
float: right;
}
.opanda-item .opanda-buttons .opanda-create {
}
.opanda-item .opanda-buttons .opanda-create .fa {
top: 1px
}
.opanda-item .opanda-buttons .opanda-help .fa {
}
.opanda-separator {
border-top: 1px solid #e1e1e1;
border-bottom: 1px solid #f8f8f8;
}
.opanda-extra-items {
padding-top: 30px;
}
.opanda-extra-items {
position: relative;
}
.opanda-extra-items .opanda-arrow {
display: none;
margin-left: 20px;
margin-top: 20px;
}
.opanda-extra-items .opanda-item {
border: 2px dashed rgba(0,0,0,0.2);
background-color: rgba(255,255,255,0.2);
box-shadow: none;
}
.opanda-extra-items .opanda-plus-background {
display: none;
position: absolute;
font-size: 30px;
right: 10px;
top: 10px;
}
.opanda-extra-items .opanda-item:hover {
border: 2px dashed rgba(0,0,0,0.3);
}
.opanda-extra-items .opanda-item em {
font-size: 12px;
font-style: normal;
color: #999;
font-weight: normal;
display: block;
}
.opanda-extra-items .opanda-buttons {
background-color: transparent;
padding-top: 20px;
}
.opanda-extra-items .opanda-separator {
margin-bottom: 20px;
}
.opanda-extra-items h2 + p {
margin-bottom: 30px;
}
.opanda-item-premium .opanda-item-cover {
width: 67px;
height: 67px;
background: url("../img/premium-item.png") top right no-repeat;
position: absolute;
top: -2px;
right: -2px;
}

View File

@@ -0,0 +1,302 @@
/**
* CSS for the Premium section
*
* @author Paul Kashtanoff <paul@byonepress.com>
* @copyright (c) 2015, OnePress Ltd
*
* @package bizpanda
* @since 1.0.0
*/
.wrap {
width: 850px;
margin: 18px auto;
}
.wrap * {
font-family: 'helvetica neue',helvetica,arial,'lucida grande',sans-serif;
}
/* ---
* Content
*/
.onp-page-content {
background: #fff;
border: 1px solid #e3e3e3;
-moz-box-sizing: border-box;
box-sizing: border-box;
width: 100%;
border-radius: 3px;
}
.onp-page-content > .onp-inner-wrap {
border-bottom: 1px solid #f1f1f1;
}
.onp-page-content p {
margin: 0 0 20px 0;
font-size: 14px;
}
.onp-page-content .onp-page-section p:last-child {
margin-bottom: 0px;
}
.onp-page-content .onp-page-section {
color: #4e5665;
font-size: 14px;
line-height: 20px;
padding: 30px;
}
.onp-page-content .onp-page-section + .onp-page-section {
border-top: 1px solid #f9f9f9;
}
.onp-page-content .onp-page-section h1,
.onp-page-content .onp-page-section h2 {
margin: 0;
padding: 0px;
}
.onp-page-content .onp-page-section h1,
.onp-page-content .onp-page-section h2,
.onp-page-content .onp-page-section h3,
.onp-page-content .onp-page-section h4 {
color: #4e5665;
}
.onp-page-content .onp-page-section h1 {
font-size: 24px;
font-weight: normal;
line-height: 32px;
margin-bottom: 12px;
}
.onp-page-content .onp-page-section h2 {
font-size: 20px;
font-weight: normal;
line-height: 24px;
margin-bottom: 20px;
}
.onp-page-content .onp-page-section .updated {
display: none;
}
/* List */
.onp-page-content .onp-list {
list-style: disc;
padding: 0 0 0 20px;
}
.onp-page-content .onp-list li {
padding: 0px;
margin: 0px;
}
.onp-page-content .onp-list li + li {
margin-top: 15px;
}
/* Bold List */
.onp-page-content .onp-bold-link {
font-weight: bold;
text-decoration: none;
}
.onp-page-content .onp-bold-link:hover {
text-decoration: underline;
}
/* Marks */
.onp-page-content .onp-mark {
padding: 0px 0;
display: inline-block;
}
.onp-page-content .onp-mark-stricked {
border-bottom: 1px solid #fff;
}
.onp-page-content .onp-mark-yellow {
background-color: #fffaea;
border-bottom-color: #f9f1e1;
}
.onp-page-content .onp-mark-gray {
background-color: #f7f7f7;
border-bottom-color: #e9e9e9;
}
/* Code */
.onp-page-content .onp-code {
font-family: Consolas;
font-size: 13px;
}
/* Stress */
.onp-page-content strong {
color: #555;
}
.onp-page-content .onp-stress {
font-weight: 600;
font-style: italic;
color: #555;
}
/* Notes */
.onp-page-content .onp-note {
border-left: 5px solid #2c3e50;
padding: 10px 15px;
background-color: #f9f9f9;
color: #444;
}
.onp-page-content .onp-remark {
background: #f9f9f9;
border-radius: 3px;
}
.onp-page-content .onp-remark .onp-inner-wrap {
display: block;
padding: 10px 10px 10px 15px;
}
/* images */
.onp-page-content .onp-img {
margin: 20px 0px 25px 0;
padding: 35px 20px 30px 20px;
text-align: center;
line-height: 50%;
background-color: #fcfcfc;
}
.onp-page-content .onp-img img {
max-width: 616px;
-moz-box-sizing: content-box;
box-sizing: content-box;
}
.onp-page-content .onp-img i {
display: block;
font-style: italic;
margin: 20px 0 0 0px;
padding: 0px;
line-height: 150%;
color: #aaa;
font-size: 15px;
padding: 0 70px;
}
.onp-page-content strong {
font-weight: bold;
}
.onp-page-content ul {
padding-left: 20px;
list-style: inside;
}
/**
* Table
*/
.onp-how-comparation thead {
background-color: #f9f9f9;
}
.onp-how-comparation,
.onp-how-comparation td,
.onp-how-comparation th {
border: 0px !important;
}
.onp-how-comparation tr {
border-bottom: 1px solid #f9f9f9;
}
.onp-how-comparation .onp-how-group-separator {
height: 40px;
border-bottom: 0px;
}
.onp-how-comparation .onp-how-group {
background-color: #fafafa;
border-bottom: 1px solid #f3f3f3;
}
.onp-how-comparation .onp-how-group .onp-how-premium {
background-color: #2ea2cc;
border-bottom: 1px solid #2491b9 !important;
color: #fff;
}
.onp-how-group-title {
font-weight: bold;
}
.onp-how-group-title .fa {
margin-right: 5px;
}
.onp-how-title a {
color: #4e5665;
text-decoration: none;
border-bottom: 1px dotted #5e6675;
}
.onp-how-no {
color: #ddd;
}
.onp-how-yes strong {
}
.onp-how-comparation .onp-how-premium {
background-color: #f3fcff;
}
thead .onp-how-premium {
background-color: #2ea2cc;
color: #fff;
}
#activate-trial-btn,
#onp-sl-purchase-btn {
padding: 20px 0 !important;
font-size: 20px;
-moz-box-sizing: content-box;
box-sizing: content-box;
width: 100%;
text-align: center;
height: auto;
}
#onp-sl-purchase-btn {
padding: 20px 0 !important;
font-size: 20px;
-moz-box-sizing: content-box;
box-sizing: content-box;
width: 100%;
text-align: center;
height: auto;
background: #fffaea;
border-color: #ddd9cd;
-moz-box-shadow: 0 0 8px #fddf67;
-webkit-box-shadow: 0 0 8px #fddf67;
box-shadow: 0 0 8px #fddf67;
-moz-text-shadow: none;
-webkit-text-shadow: none;
text-shadow: none;
}
/* hides the vk note on the how to use page */
.onp-sl-vk-note {
display: none;
}
/* tables */
.onp-page-content .table p {
margin: 0px;
}
.onp-page-content .table p + p {
margin-top: 5px;
}
.onp-page-content .table .onp-title {
font-weight: bold;
white-space: nowrap;
}
.onp-page-content .table > thead {
background-color: #f9f9f9;
}
.onp-page-content .table > thead > tr > th {
border-bottom-width: 1px;
}
.onp-page-content .table > tbody > tr > td,
.onp-page-content .table > tr > td {
border-bottom: 1px solid #f9f9f9;
}

View File

@@ -0,0 +1,305 @@
/**
* CSS for Opt-In Panda Settings
*
* @author Paul Kashtanoff <paul@byonepress.com>
* @copyright (c) 2013, OnePress Ltd
*
* @package optinpanda
* @since 1.0.0
*/
.alert.alert-success {
margin: 0px;
margin-top: 10px;
margin-bottom: 10px;
font-weight: bold;
padding: 10px;
}
.alert.alert-success p {
margin: 0px;
}
input[type=text],
textarea {
max-width: 400px;
}
select {
width: auto !important;
}
textarea {
min-height: 100px;
}
.opanda-hidden {
display: none;
}
.factory-bootstrap-331 .form-control {
display: inline-block;
}
.help-block a {
color: #737373;
}
.help-block a:hover {
}
#opanda_facebook_appid,
#opanda_vk_appid,
#opanda_linkedin_client_id,
#opanda_linkedin_client_secret {
width: 250px;
}
#opanda_dynamic_theme_event,
#opanda_managed_hook {
width: 250px;
}
#opanda_lang {
width: 250px;
}
#opanda_timeout,
#opanda_session_duration {
width: 100px;
}
.help-block {
position: relative;
margin-top: 8px !important;
line-height: 160%;
}
.form-horizontal {
max-width: 1200px;
}
.btn-group {
border: 0px !important;
}
.factory-bootstrap-331 .btn-group {
margin-bottom: 0px;
}
.form-horizontal .onp-sl-inline {
padding-top: 1px;
margin: 0px;
}
.factory-volumetric .onp-sl-inline {
font-size: 14px;
line-height: 100%;
padding-top: 8px;
}
.btn + .btn {
margin-left: 5px;
}
/**
* Confirmation Dialog
*/
#onp-confirm-dialog.onp-page-wrap {
width: 700px;
margin: auto;
margin-top: 100px;
}
#onp-confirm-dialog-wrap {
background-color: #fefefe;
border-radius: 15px;
padding: 40px 40px 40px 210px;
-moz-box-sizing: border-box;
box-sizing: border-box;
min-height: 165px;
border-bottom: 2px solid #dfdfdf;
background-image: url("../img/confirmation-dialog.png");
background-repeat: no-repeat;
background-position: 40px 40px;
}
.factory-volumetric #onp-confirm-dialog-wrap {
background-color: #f9f9f9;
border-bottom: 2px solid #f3f3f3;
}
#onp-confirm-dialog-wrap h1 {
padding: 0px;
margin: 0 0 15px 0;
color: #48515F;
-moz-text-shadow: #fff;
text-shadow: #fff;
line-height: 120%;
font-size: 20px;
}
#onp-confirm-dialog-wrap p {
margin: 0px;
}
#onp-confirm-dialog-wrap .onp-actions {
padding-top: 20px;
}
#onp-confirm-dialog-wrap .onp-actions a + a {
margin-left: 10px;
}
#opanda_alt_overlap_mode {
max-width: 200px;
}
#opanda_na_mode {
max-width: 300px;
}
/** ---
* Common
*/
.control-group > * {
vertical-align: middle;
}
.factory-dropdown.factory-buttons-way {
margin-bottom: 8px;
}
.control-group .btn {
height: 33px;
line-height: 33px;
padding: 0 12px 0px 12px;
}
.factory-bootstrap-331 .factory-after {
margin-left: 2px;
}
/** ---
* Social Options
*/
#opanda_twitter_use_dev_keys {
width: 250px !important;
}
/** ---
* Subscription Options
*/
.opanda-screen-subscription .factory-dropdown .factory-hint {
background: none;
color: #737373;
}
.opanda-aweber-steps ul,
.opanda-aweber-steps span,
.opanda-aweber-steps a {
display: inline-block;
vertical-align: bottom;
line-height: 28px;
}
.opanda-screen-subscription .dd-option-image,
.opanda-screen-subscription .dd-selected-image {
max-width: 110px !important;
margin-left: 20px;
}
.opanda-screen-subscription .dd-options {
max-height: 400px;
}
.opanda-screen-subscription .dd-options li {
margin-bottom: 0px;
}
/** ---
* Lock Options
*/
.opanda-screen-lock .opanda-example {
display: none;
}
.opanda-screen-lock .opanda-url {
color: #0074a2;
text-decoration: none;
}
.opanda-screen-lock .opanda-url:hover {
text-decoration: underline;
}
.opanda-screen-lock .opanda-passcode {
font-weight: bold;
color: #0074a2;
}
/** ---
* Permissions
*/
.opanda-screen-permissions .opanda-user-role-options-group {
display: none;
}
.opanda-screen-permissions .help-block {
margin: 5px 0 0 5px !important;
}
.opanda-screen-permissions .control-group * {
display: inline-block;
}
.opanda-screen-permissions .permissions-set {
padding-bottom: 15px;
}
.opanda-screen-permissions .permissions-set .control-label {
font-weight: normal;
}
.opanda-screen-permissions .permissions-set .form-group {
margin-bottom: 5px;
}
.opanda-screen-permissions .permissions-set .help-block {
cursor: pointer;
}
/** ---
* Font-end Text
*/
.opanda-screen-text .factory-legend {
margin-bottom: 40px;
background-color: rgba(255,255,255,0.6) !important;
border-radius: 3px;
border-bottom: 1px solid #e3e3e3;
padding: 15px !important;
}
.opanda-screen-text .factory-legend + .factory-separator {
margin-bottom: 40px;
}
.opanda-screen-text fieldset + fieldset {
margin-top: 30px !important;
}
.opanda-screen-text .form-horizontal {
max-width: 750px;
}
.opanda-screen-text label {
width: 220px;
}
.opanda-screen-text .control-group {
width: 500px !important;
}
.opanda-screen-text input[type=text],
.opanda-screen-text textarea {
max-width: none;
}
.opanda-screen-text .opanda-width-short {
width: 200px;
}
.opanda-screen-text fieldset .factory-separator {
border-top: 0px;
border-bottom: 1px dashed #d9d9d9;
}
.opanda-screen-text .factory-form-group .factory-hint {
font-size: 13px;
}
.opanda-screen-terms #opanda-enabled-options,
.opanda-screen-terms #opanda-nopages-options,
.opanda-screen-terms #opanda-pages-options {
display: none;
}
.opanda-screen-terms #opanda_terms_of_use_text,
.opanda-screen-terms #opanda_privacy_policy_text {
max-width: none;
}
.opanda-screen-terms .wp-editor-wrap {
max-width: 800px;
}

View File

@@ -0,0 +1,329 @@
/**
* CSS for Opt-In Panda Statistics
*
* @author Paul Kashtanoff <paul@byonepress.com>
* @copyright (c) 2013, OnePress Ltd
*
* @package optinpanda
* @since 1.0.0
*/
/**
* Control Panel
*/
#opanda-control-panel {
height: 28px;
padding-top: 0px;
-moz-box-sizing: content-box;
box-sizing: content-box;
}
#opanda-control-panel .opanda-left {
float: left;
}
#opanda-control-panel .opanda-right {
float: right;
}
#opanda-control-panel .opanda-left > *,
#opanda-control-panel .opanda-right > * {
display: inline-block;
vertical-align: middle;
line-height: 28px;
}
#opanda-current-item a {
text-decoration: none;
}
#opanda-current-item a:hover {
text-decoration: underline;
}
#opanda-item-selector {
position: relative;
top: -1px;
}
/**
* Chart description
*/
#opanda-chart-description {
background-color: #fff;
margin-top: 15px;
padding: 8px 20px 7px 20px;
}
/**
* Chart Area
*/
#onp-sl-chart-area {
background-color: #fff;
padding: 0 20px;
border-top: 1px solid #f4f4f4;
border-bottom: 2px solid #e9e9e9;
}
#onp-sl-settings-bar {
height: 55px;
padding-top: 10px;
margin-top: 10px;
-webkit-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
#onp-sl-settings-bar .btn {
padding: 3px 10px 4px 10px;
}
.factory-volumetric #onp-sl-settings-bar .btn {
padding: 3px 8px;
}
/* Type Select */
#onp-sl-type-select {
float: left;
white-space: nowrap;
border: 0px;
position: relative;
top: -6px;
}
#onp-sl-type-select .fa {
font-size: 14px;
margin-right: 3px;
}
#onp-sl-type-select > * {
display: inline-block;
}
/* Date Select */
#onp-sl-date-select {
float: right;
}
#onp-sl-date-select > * {
display: inline-block;
vertical-align: top;
}
.onp-sl-range-label {
position: relative;
margin-right: 8px;
top: 4px;
}
#onp-sl-date-start, #onp-sl-date-end {
width: 120px;
height: 28px;
}
#onp-sl-apply-dates {
margin-left: 5px;
padding-left: 10px;
padding-right: 10px;
font-size: 13px;
}
#onp-sl-apply-dates .fa {
margin-right: 3px;
position: relative;
top: 1px;
}
.chart-wrap {
margin-bottom: 20px;
margin-top: 20px;
}
/**
* Charts selector
*/
#onp-sl-chart-selector {
padding-top: 15px;
padding-bottom: 15px;
line-height: 100%;
}
#onp-sl-chart-selector .onp-sl-selector-item {
display: inline-block;
clear: both;
cursor: pointer;
padding: 7px;
border-radius: 3px;
color: #d0d0d0;
}
#onp-sl-chart-selector .onp-sl-selector-item.opanda-active {
color: #111;
background-color: #f9f9f9;
}
#onp-sl-chart-selector .onp-sl-selector-item:hover {
background-color: #fbfbfb;
}
#onp-sl-chart-selector .onp-sl-selector-item {
margin: 3px;
line-height: 100%;
vertical-align: middle;
position: relative;
left: -3px;
top: -3px;
}
#onp-sl-chart-selector .chart-color {
width: 15px;
height: 15px;
float: left;
margin-right: 5px;
position: relative;
top: -1px;
}
#onp-sl-chart-selector .onp-sl-selector-item.opanda-inactive .chart-color {
background-color: #e5e5e5 !important;
}
.onp-chart-hint {
margin-top: 5px;
display: inline-block;
background-color: #ffffdd;
padding: 2px 8px;
width: 100%;
display: none;
}
/**
* Posts
*/
#opanda-data-table-wrap {
background: #f6f6f6;
}
#opanda-pagination-wrap {
text-align: right;
}
#opanda-pagination-wrap .pagination {
margin-bottom: 0px;
text-align: right;
margin-top: 10px;
}
#opanda-data-table {
background-color: #fff;
width: 100%;
padding: 0px;
border-collapse: collapse;
border-bottom: 2px solid #e5e5e5;
}
#opanda-data-table thead tr + tr {
border-top: 1px solid #f1f1f1;
}
#opanda-data-table th {
text-align: left;
padding: 8px 10px 8px 6px;
font-family: Arial, Helvetica, Geneva, sans-serif;
font-size: 11px;
font-weight: bold;
}
#opanda-data-table th.opanda-col-number {
text-align: right;
white-space: nowrap;
}
#opanda-data-table th.opanda-col-common {
text-align: center;
}
#opanda-data-table td {
text-align: right;
font-family: Arial, Helvetica, Geneva, sans-serif;
font-size: 13px;
}
#opanda-data-table td,
#opanda-data-table th {
padding: 9px 20px;
}
#opanda-data-table th .opanda-hint {
background: url('../img/help.png') no-repeat 0 0 transparent;
margin-left: 3px;
opacity: 0.55;
position: relative;
height: 14px;
width: 13px;
overflow: hidden;
display: inline-block;
cursor: help;
vertical-align: middle;
top: -1px;
}
#opanda-data-table tbody tr {
border-bottom: 1px solid #f1f1f1;
border-top: 1px solid #f1f1f1;
}
#opanda-data-table tbody tr:nth-child(odd) {
background-color: #fafafa;
}
#opanda-data-table .opanda-col-index {
width: 1%;
}
#opanda-data-table .opanda-col-number {
width: 1%;
min-width: 100px;
border-left: 1px solid #f1f1f1;
white-space: nowrap;
}
#opanda-data-table td em {
font-style: normal;
color: #aaa;
}
#opanda-data-table.opanda-free-table .opanda-col-number {
white-space: nowrap;
}
#opanda-data-table .opanda-col-title {
text-align: left;
}
#opanda-data-table .opanda-col-title a {
text-decoration: none;
}
#opanda-data-table .opanda-col-title a:hover {
text-decoration: underline;
}
#opanda-data-table th.opanda-column-highlight,
#opanda-data-table td.opanda-column-highlight {
background-color: #fbfbfb;
font-weight: bold;
border-left: 1px solid #eee;
border-right: 1px solid #eee;
}
#opanda-data-table tr:nth-child(odd) td.opanda-column-highlight {
background-color: #f7f7f7;
}
#opanda-data-table .opanda-empty {
text-align: left;
font-style: italic;
}
/**
* Locker Selector Popup
*/
#opanda-locker-select-popup {
position: absolute;
padding: 30px;
background-color: #fff;
-moz-box-sizing: content-box;
box-sizing: content-box;
width: 400px;
top: 50%;
box-shadow: 0 0 15px 3px rgba(0,0,0,0.08);
border-radius: 4px;
z-index: 51;
}
#opanda-locker-select-overlap {
background-color: #f1f1f1;
opacity: 0.5;
position: absolute;
top: 0; bottom: 0; left: 0; right: 0;
z-index: 50;
}
#opanda-locker-select-popup strong {
font-size: 18px;
}
#opanda-locker-select-popup p {
margin-top: 5px;
}

View File

@@ -0,0 +1,15 @@
body {
font-family: Arial;
font-size: 14px;
background-color: #fff;
line-height: 155%;
}
p {
margin: 0px;
}
p + p {
margin-top: 15px;
}
strong {
color: #333;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 363 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 243 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 390 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 312 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 155 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 476 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 252 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 392 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 322 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 529 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 247 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 644 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 424 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 919 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 452 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 488 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 563 B

View File

@@ -0,0 +1,347 @@
"use strict";
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _createForOfIteratorHelper(o) { if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (o = _unsupportedIterableToArray(o))) { var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var it, normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(n); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
function _createSuper(Derived) { return function () { var Super = _getPrototypeOf(Derived), result; if (_isNativeReflectConstruct()) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
(function (element, blockEditor, blocksConfig) {
var el = element.createElement;
var __ = wp.i18n.__;
var availableBlocks = blocksConfig.blockTypes;
var SelectControl = wp.components.SelectControl;
var knownBlocks = {
'sociallocker': {
'title': __('Social Locker', 'bizpanda'),
'description': __('Hides content inside the block behind a social locker.', 'bizpanda'),
'keywords': ['locker', 'sociallocker', 'social locker', 'social', 'lock'],
'transformsFrom': ['bizpanda/signinlocker', 'bizpanda/emaillocker'],
'icon': el("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 992.13 992.13"
}, el("path", {
d: "M282.61,687.13l-88.25-88.25c-71.66-71.66-71.66-188.26,0-259.93a183.77,183.77,0,0,1,259.94,0l18.26,18.28L490.83,339A183.7,183.7,0,0,1,792.44,534.37l39.15,39.14A235.39,235.39,0,0,0,472.56,286a235.49,235.49,0,0,0-314.72,16.48c-91.79,91.79-91.79,241.16,0,332.95l88.25,88.26Z",
fill: "#555d66",
stroke: "#555d66",
"stroke-miterlimit": "10",
"stroke-width": "0.25"
}), el("polygon", {
points: "472.56 950.13 319.13 796.7 355.64 760.18 472.56 877.08 730.82 618.82 767.33 655.33 472.56 950.13 472.56 950.13",
fill: "#555d66",
stroke: "#555d66",
"stroke-miterlimit": "10",
"stroke-width": "60"
}))
},
'signinlocker': {
'title': __('Sign-In Locker', 'bizpanda'),
'description': __('Hides content inside the block behind a sign-in locker.', 'bizpanda'),
'keywords': ['locker', 'signinlocker', 'signin locker', 'social', 'lock'],
'transformsFrom': ['bizpanda/sociallocker', 'bizpanda/emaillocker'],
'icon': el("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 992.13 992.13"
}, el("polygon", {
points: "482.6 950.55 329.17 797.14 365.69 760.62 482.59 877.52 740.87 619.26 777.38 655.78 482.6 950.55 482.6 950.55",
fill: "#555d66",
stroke: "#555d66",
"stroke-miterlimit": "10",
"stroke-width": "60"
}), el("path", {
d: "M849.54,583.63L886,547.1,781.71,442.77H626.84l0-35c0.42-4.13,5.11-18.29,8.89-29.67C648,341,666.63,285,666.64,226.54c0-123.93-74-207.21-184.07-207.21S298.63,102.61,298.63,226.54C298.63,285,317.2,341,329.5,378.13c3.77,11.38,8.48,25.54,8.83,29l0,35.59H183.49L79.15,547.1l177,177,36.52-36.53L152.21,547.1l52.68-52.69H390V407.17c0-10.7-4.31-23.72-11.46-45.3-11.25-33.94-28.27-85.24-28.26-135.34C350.26,130.59,401,71,482.57,71S615,130.59,615,226.52c0,50.11-17,101.4-28.3,135.35-7.17,21.57-11.5,34.6-11.5,45.31v87.24H760.32Z",
fill: "#555d66",
stroke: "#555d66",
"stroke-miterlimit": "10",
"stroke-width": "0.25"
}))
},
'emaillocker': {
'title': __('Email Locker', 'bizpanda'),
'description': __('Hides content inside the block behind an email locker.', 'bizpanda'),
'keywords': ['locker', 'emaillocker', 'email locker', 'optin', 'opt-in', 'lock'],
'transformsFrom': ['bizpanda/sociallocker', 'bizpanda/signinlocker'],
'icon': el("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 992.13 992.13"
}, el("path", {
d: "M231.37,686.2l-91.73-91.73,255.85,0H586.16v-139H842.06l-89.44,89.44,36.53,36.52L940.9,429.61,560.35,49.07,40.77,568.65,194.85,722.72Zm354.8-538.28L842,403.78l-255.88,0V147.93Zm-51.63,0V542.81l-394.89,0Z",
fill: "#555d66",
stroke: "#555d66",
"stroke-miterlimit": "10",
"stroke-width": "0.25"
}), el("polygon", {
points: "421.33 949.21 267.89 795.75 304.4 759.25 421.33 876.16 679.58 617.89 716.09 654.4 421.33 949.21 421.33 949.21",
fill: "#555d66",
stroke: "#555d66",
"stroke-miterlimit": "10",
"stroke-width": "60"
}))
}
};
/**
* Locker Select
*/
var LockerSelect = /*#__PURE__*/function (_wp$element$Component) {
_inherits(LockerSelect, _wp$element$Component);
var _super = _createSuper(LockerSelect);
function LockerSelect() {
var _this;
_classCallCheck(this, LockerSelect);
_this = _super.apply(this, arguments);
_this.state = {
isLoading: true,
selectedId: _this.props.lockerId ? parseInt(_this.props.lockerId) : 0,
options: []
};
_this.handleSelectChange = _this.handleSelectChange.bind(_assertThisInitialized(_this));
return _this;
}
_createClass(LockerSelect, [{
key: "componentDidMount",
value: function componentDidMount() {
var self = this;
var request = jQuery.ajax(window.ajaxurl, {
type: 'post',
dataType: 'json',
data: {
action: 'get_opanda_lockers',
shortcode: self.props.shortcode
}
});
request.done(function (data) {
var options = [];
var hasSelected = false;
var defaultLocker = false;
var _iterator = _createForOfIteratorHelper(data),
_step;
try {
for (_iterator.s(); !(_step = _iterator.n()).done;) {
var locker = _step.value;
if (self.state.selectedId && self.state.selectedId === parseInt(locker.id)) {
hasSelected = true;
}
var item = {
label: locker.title,
value: locker.id,
shortcode: locker.shortcode
};
if (!defaultLocker) defaultLocker = item;
options.push(item);
}
} catch (err) {
_iterator.e(err);
} finally {
_iterator.f();
}
if (!hasSelected && defaultLocker) {
console.log(defaultLocker);
self.props.onChange(defaultLocker);
}
self.setState({
isLoading: false,
options: options,
selectedId: hasSelected ? self.state.selectedId : defaultLocker.value
});
});
}
}, {
key: "handleSelectChange",
value: function handleSelectChange(lockerId) {
var option = null;
var _iterator2 = _createForOfIteratorHelper(this.state.options),
_step2;
try {
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
var optionItem = _step2.value;
if (parseInt(optionItem.value) === parseInt(lockerId)) {
option = optionItem;
this.setState({
selectedId: lockerId ? parseInt(lockerId) : 0
});
break;
}
}
} catch (err) {
_iterator2.e(err);
} finally {
_iterator2.f();
}
this.props.onChange(option);
}
}, {
key: "render",
value: function render() {
var self = this;
var options = this.state.options;
if (this.state.isLoading) {
options = [{
label: __('Loading...', 'bizpanda'),
value: 0
}];
}
var hasLockers = options.length > 0;
if (!hasLockers) {
options = [{
label: __('[ - empty - ]', 'bizpanda'),
value: 0
}];
}
var hasEditableItem = !this.state.isLoading && hasLockers && this.state.selectedId ? true : false;
var hasAddAbility = !this.state.isLoading;
return el(React.Fragment, null, el(SelectControl, {
className: "onp-locker-select-wrap",
label: self.props.label + ':',
onChange: this.handleSelectChange,
value: self.props.lockerId,
options: options
}), (hasAddAbility || hasEditableItem) && el("div", null, "|"), hasEditableItem && el("a", {
href: blocksConfig.urlEditUrl.replace('{0}', this.state.selectedId),
target: "_blank",
className: "button onp-button"
}, __('Edit', 'bizpanda')), hasAddAbility && el("a", {
href: blocksConfig.urlCreateNew,
target: "_blank",
className: "button onp-button"
}, __('Add', 'bizpanda')));
}
}]);
return LockerSelect;
}(wp.element.Component);
var _iterator3 = _createForOfIteratorHelper(availableBlocks),
_step3;
try {
var _loop = function _loop() {
var pluginBlockType = _step3.value;
if (!knownBlocks[pluginBlockType]) return "continue";
var shortcode = pluginBlockType;
var blockName = 'bizpanda/' + pluginBlockType;
var blockTitle = knownBlocks[pluginBlockType].title;
var blockDescription = knownBlocks[pluginBlockType].description;
var blockIcon = knownBlocks[pluginBlockType].icon;
var blockKeywords = knownBlocks[pluginBlockType].keywords;
var blockTransformsFrom = knownBlocks[pluginBlockType].transformsFrom;
wp.blocks.registerBlockType(blockName, {
title: blockTitle,
description: blockDescription,
icon: blockIcon,
category: 'widgets',
keywords: blockKeywords,
attributes: {
id: {
type: 'number'
}
},
transforms: {
from: [{
type: 'block',
blocks: blockTransformsFrom,
transform: function transform(attributes) {
return wp.blocks.createBlock(blockName, _objectSpread({}, attributes));
}
}]
},
edit: function edit(props) {
var elements = []; // if selected, shows the settings
if (props.isSelected) {
var onChange = function onChange(option) {
console.log(option);
props.setAttributes({
id: option && option.value ? parseInt(option.value) : null
});
};
var configWrap = el("div", {
className: "onp-config-wrap"
}, el(LockerSelect, {
shortcode: shortcode,
label: blockTitle,
onChange: onChange,
lockerId: props.attributes.id
}));
elements.push(configWrap);
}
var previewWrap = el("div", {
className: "onp-preview-wrap"
}, el("div", {
className: "onp-top-bracket"
}), el(blockEditor.InnerBlocks, null), el("div", {
className: "onp-bottom-bracket"
}));
elements.push(previewWrap);
return el("div", {
className: "onp-locker"
}, elements);
},
save: function save(props) {
return el("div", {
className: "onp-locker-block"
}, el(blockEditor.InnerBlocks.Content, null));
}
});
};
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
var _ret = _loop();
if (_ret === "continue") continue;
}
} catch (err) {
_iterator3.e(err);
} finally {
_iterator3.f();
}
})(window.wp.element, window.wp.blockEditor, window.__bizpanda_locker_blocks);

View File

@@ -0,0 +1,255 @@
(function( element, blockEditor, blocksConfig ) {
const el = element.createElement;
const __ = wp.i18n.__;
const availableBlocks = blocksConfig.blockTypes;
const { SelectControl } = wp.components;
const knownBlocks = {
'sociallocker': {
'title': __('Social Locker', 'bizpanda'),
'description': __('Hides content inside the block behind a social locker.', 'bizpanda'),
'keywords': [ 'locker', 'sociallocker', 'social locker', 'social', 'lock' ],
'transformsFrom': ['bizpanda/signinlocker', 'bizpanda/emaillocker'],
'icon': <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 992.13 992.13"><path d="M282.61,687.13l-88.25-88.25c-71.66-71.66-71.66-188.26,0-259.93a183.77,183.77,0,0,1,259.94,0l18.26,18.28L490.83,339A183.7,183.7,0,0,1,792.44,534.37l39.15,39.14A235.39,235.39,0,0,0,472.56,286a235.49,235.49,0,0,0-314.72,16.48c-91.79,91.79-91.79,241.16,0,332.95l88.25,88.26Z" fill="#555d66" stroke="#555d66" stroke-miterlimit="10" stroke-width="0.25"/><polygon points="472.56 950.13 319.13 796.7 355.64 760.18 472.56 877.08 730.82 618.82 767.33 655.33 472.56 950.13 472.56 950.13" fill="#555d66" stroke="#555d66" stroke-miterlimit="10" stroke-width="60"/></svg>
},
'signinlocker': {
'title': __('Sign-In Locker', 'bizpanda'),
'description': __('Hides content inside the block behind a sign-in locker.', 'bizpanda'),
'keywords': [ 'locker', 'signinlocker', 'signin locker', 'social', 'lock' ],
'transformsFrom': ['bizpanda/sociallocker', 'bizpanda/emaillocker'],
'icon': <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 992.13 992.13"><polygon points="482.6 950.55 329.17 797.14 365.69 760.62 482.59 877.52 740.87 619.26 777.38 655.78 482.6 950.55 482.6 950.55" fill="#555d66" stroke="#555d66" stroke-miterlimit="10" stroke-width="60"/><path d="M849.54,583.63L886,547.1,781.71,442.77H626.84l0-35c0.42-4.13,5.11-18.29,8.89-29.67C648,341,666.63,285,666.64,226.54c0-123.93-74-207.21-184.07-207.21S298.63,102.61,298.63,226.54C298.63,285,317.2,341,329.5,378.13c3.77,11.38,8.48,25.54,8.83,29l0,35.59H183.49L79.15,547.1l177,177,36.52-36.53L152.21,547.1l52.68-52.69H390V407.17c0-10.7-4.31-23.72-11.46-45.3-11.25-33.94-28.27-85.24-28.26-135.34C350.26,130.59,401,71,482.57,71S615,130.59,615,226.52c0,50.11-17,101.4-28.3,135.35-7.17,21.57-11.5,34.6-11.5,45.31v87.24H760.32Z" fill="#555d66" stroke="#555d66" stroke-miterlimit="10" stroke-width="0.25"/></svg>
},
'emaillocker': {
'title': __('Email Locker', 'bizpanda'),
'description': __('Hides content inside the block behind an email locker.', 'bizpanda'),
'keywords': [ 'locker', 'emaillocker', 'email locker', 'optin', 'opt-in', 'lock' ],
'transformsFrom': ['bizpanda/sociallocker', 'bizpanda/signinlocker'],
'icon': <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 992.13 992.13"><path d="M231.37,686.2l-91.73-91.73,255.85,0H586.16v-139H842.06l-89.44,89.44,36.53,36.52L940.9,429.61,560.35,49.07,40.77,568.65,194.85,722.72Zm354.8-538.28L842,403.78l-255.88,0V147.93Zm-51.63,0V542.81l-394.89,0Z" fill="#555d66" stroke="#555d66" stroke-miterlimit="10" stroke-width="0.25"/><polygon points="421.33 949.21 267.89 795.75 304.4 759.25 421.33 876.16 679.58 617.89 716.09 654.4 421.33 949.21 421.33 949.21" fill="#555d66" stroke="#555d66" stroke-miterlimit="10" stroke-width="60"/></svg>
}
};
/**
* Locker Select
*/
class LockerSelect extends wp.element.Component {
constructor() {
super(...arguments);
this.state = {
isLoading: true,
selectedId: this.props.lockerId ? parseInt( this.props.lockerId ) : 0,
options: []
};
this.handleSelectChange = this.handleSelectChange.bind(this);
}
componentDidMount() {
const self = this;
const request = jQuery.ajax(window.ajaxurl, {
type: 'post',
dataType: 'json',
data: {
action: 'get_opanda_lockers',
shortcode: self.props.shortcode
}
});
request.done(function( data ){
const options = [];
let hasSelected = false;
let defaultLocker = false;
for ( let locker of data ) {
if ( self.state.selectedId && self.state.selectedId === parseInt( locker.id ) ) {
hasSelected = true;
}
const item = { label: locker.title, value: locker.id, shortcode: locker.shortcode };
if ( !defaultLocker ) defaultLocker = item;
options.push(item);
}
if ( !hasSelected && defaultLocker ) {
console.log(defaultLocker);
self.props.onChange(defaultLocker);
}
self.setState({
isLoading: false,
options: options,
selectedId: hasSelected ? self.state.selectedId : defaultLocker.value
});
});
}
handleSelectChange( lockerId ) {
let option = null;
for ( let optionItem of this.state.options ) {
if ( parseInt( optionItem.value ) === parseInt( lockerId ) ) {
option = optionItem;
this.setState({
selectedId: lockerId ? parseInt( lockerId ) : 0
});
break;
}
}
this.props.onChange( option );
}
render() {
const self = this;
let options = this.state.options;
if ( this.state.isLoading ) {
options = [{label: __('Loading...', 'bizpanda'), value: 0}];
}
const hasLockers = options.length > 0;
if ( !hasLockers ) {
options = [{label: __('[ - empty - ]', 'bizpanda'), value: 0}];
}
const hasEditableItem = ( !this.state.isLoading && hasLockers && this.state.selectedId ) ? true : false;
const hasAddAbility = !this.state.isLoading;
return (
<>
<SelectControl
className={"onp-locker-select-wrap"}
label={self.props.label + ':'}
onChange={this.handleSelectChange}
value={self.props.lockerId}
options={options}
/>
{
( hasAddAbility || hasEditableItem ) &&
<div>|</div>
}
{
hasEditableItem &&
<a href={blocksConfig.urlEditUrl.replace('{0}', this.state.selectedId)} target="_blank" className="button onp-button">{__('Edit', 'bizpanda')}</a>
}
{
hasAddAbility &&
<a href={blocksConfig.urlCreateNew} target="_blank" className="button onp-button">{__('Add', 'bizpanda')}</a>
}
</>
);
}
}
for ( let pluginBlockType of availableBlocks ) {
if ( !knownBlocks[pluginBlockType] ) continue;
const shortcode = pluginBlockType;
const blockName = 'bizpanda/' + pluginBlockType;
const blockTitle = knownBlocks[pluginBlockType].title;
const blockDescription = knownBlocks[pluginBlockType].description;
const blockIcon = knownBlocks[pluginBlockType].icon;
const blockKeywords = knownBlocks[pluginBlockType].keywords;
const blockTransformsFrom = knownBlocks[pluginBlockType].transformsFrom;
wp.blocks.registerBlockType(blockName, {
title: blockTitle,
description: blockDescription,
icon: blockIcon,
category: 'widgets',
keywords: blockKeywords,
attributes: {
id: {
type: 'number'
},
},
transforms: {
from: [
{
type: 'block',
blocks: blockTransformsFrom,
transform: function ( attributes ) {
return wp.blocks.createBlock( blockName, {...attributes});
},
},
]
},
edit: function(props) {
const elements = [];
// if selected, shows the settings
if ( props.isSelected ) {
const onChange = (option) => {
console.log( option );
props.setAttributes({
id: ( option && option.value ) ? parseInt( option.value ) : null
});
};
const configWrap = (
<div className="onp-config-wrap">
<LockerSelect
shortcode={shortcode}
label={blockTitle}
onChange={onChange}
lockerId={props.attributes.id}>
</LockerSelect>
</div>
);
elements.push(configWrap);
}
const previewWrap = (
<div className="onp-preview-wrap">
<div className="onp-top-bracket"></div>
<blockEditor.InnerBlocks />
<div className="onp-bottom-bracket"></div>
</div>
)
elements.push(previewWrap);
return (
<div className="onp-locker">{elements}</div>
);
},
save: function(props) {
return (
<div className="onp-locker-block">
<blockEditor.InnerBlocks.Content />
</div>
);
}
});
}
})(
window.wp.element,
window.wp.blockEditor,
window.__bizpanda_locker_blocks
);

View File

@@ -0,0 +1,80 @@
/*!
* Filers & Hooks API
* Copyright 2014, OnePress, http://byonepress.com
*
* @since 1.0.0
* @pacakge core
*/
(function ($) {
'use strict';
if ( !$.bizpanda ) $.bizpanda = {};
$.bizpanda.filters = $.bizpanda.filters || {
/**
* A set of registered filters.
*/
_items: {},
/**
* A set of priorities of registered filters.
*/
_priorities: {},
/**
* Applies filters to a given input value.
*/
run: function( filterName, args ) {
var input = args && args.length > 0 ? args[0] : null;
if ( !this._items[filterName] ) return input;
for ( var i in this._priorities[filterName] ) {
if ( !this._priorities[filterName].hasOwnProperty(i) ) continue;
var priority = this._priorities[filterName][i];
for ( var k = 0; k < this._items[filterName][priority].length; k++ ) {
var f = this._items[filterName][priority][k];
input = f.apply(f, args);
}
}
return input;
},
/**
* Registers a new filter.
*/
add: function( filterName, callback, priority ) {
if ( !priority ) priority = 10;
if ( !this._items[filterName] ) this._items[filterName] = {};
if ( !this._items[filterName][priority] ) this._items[filterName][priority] = [];
this._items[filterName][priority].push( callback );
if ( !this._priorities[filterName] ) this._priorities[filterName] = [];
if ( $.inArray( priority, this._priorities[filterName]) === -1 ) this._priorities[filterName].push( priority );
this._priorities[filterName].sort(function(a,b){return a-b;});
}
};
$.bizpanda.hooks = $.bizpanda.hooks || {
/**
* Applies filters to a given input value.
*/
run: function( filterName, args ) {
$.bizpanda.filters.run( filterName, args );
},
/**
* Registers a new filter.
*/
add: function( filterName, callback, priority ) {
$.bizpanda.filters.add( filterName, callback, priority );
}
};
})(jQuery);

View File

@@ -0,0 +1,291 @@
if ( !window.bizpanda ) window.bizpanda = {};
if ( !window.bizpanda.lockerEditor ) window.bizpanda.lockerEditor = {};
(function($){
window.bizpanda.lockerEditor = {
init: function() {
this.item = $('#opanda_item').val();
this.basicOptions.init( this, this.item );
this.trackInputChanges();
this.recreatePreview();
this.initStyleRollerButton();
},
/**
* Inits a button which offers to buy the StyleRoller Add-on.
*/
initStyleRollerButton: function() {
if ( window.window.onp_sl_styleroller || !window.onp_sl_show_styleroller_offer ) return;
var $button = $("<a target='_blank' class='btn btn-default' id='onp-sl-styleroller-btn' href='" + window.onp_sl_styleroller_offer_url + "'><i class='fa fa-flask'></i>" + window.onp_sl_styleroller_offer_text + "</a>");
$("#opanda_style").after($button);
},
/**
* Starts to track user input to refresh the preview.
*/
trackInputChanges: function() {
var self = this;
var tabs = [
"#OPanda_BasicOptionsMetaBox",
"#OPanda_SocialOptionsMetaBox",
"#OPanda_AdvancedOptionsMetaBox",
"#OPanda_ConnectOptionsMetaBox",
'#OPanda_SubscriptionOptionsMetaBox',
'#OPanda_TermsOptionsMetaBox'
];
for(var index in tabs) {
$(tabs[index])
.find("input, select, textarea")
.bind('change keyup', function(){ self.refreshPreview(); });
}
},
/**
* Binds the change event of the WP editor.
*/
bindWpEditorChange: function( ed ) {
var self = this;
var changed = function() {
tinyMCE.activeEditor.save();
self.refreshPreview();
};
if ( tinymce.majorVersion <= 3 ) {
ed.onChange.add(function(){ changed(); });
} else {
ed.on("change", function(){ changed(); });
}
},
/**
* Refreshes the preview after short delay.
*/
refreshPreview: function( force ) {
var self = this;
if ( this.timerOn && !force ) {
this.timerAgain = true;
return;
}
this.timerOn = true;
setTimeout(function(){
if (self.timerAgain) {
self.timerAgain = false;
self.refreshPreview( true );
} else {
self.timerAgain = false;
self.timerOn = false;
self.recreatePreview();
}
}, 500);
},
/**
* Recreates the preview, submmits forms to the preview frame.
*/
recreatePreview: function() {
var url = $("#lock-preview-wrap").data('url');
var options = this.getPreviewOptions();
console.log(options);
$.bizpanda.hooks.run('opanda-refresh-preview');
window.bizpanda.preview.refresh( url, 'preview', options, 'onp_sl_update_preview_height' );
},
/**
* Gets options for the preview to submit into the frame.
*/
getPreviewOptions: function() {
var options = this.getCommonOptions();
var options = $.bizpanda.filters.run('opanda-preview-options', [options]);
if ( window.bizpanda.lockerEditor.filterOptions ) {
options = window.bizpanda.lockerEditor.filterOptions( options );
}
$(document).trigger('onp-sl-filter-preview-options', [options]);
return options;
},
getCommonOptions: function() {
var timer = parseInt( $("#opanda_timer").val() );
var options = {
text: {
header: $("#opanda_header").val(),
message: $("#opanda_message").val()
},
site: {
'title': window.opanda_site_name,
'url': window.opanda_home_url
},
theme: 'secrets',
agreement: {
checkbox: $("#opanda_agreement_checkbox").is(':checked') ? $("#opanda_agreement_checkbox_position").val() : false,
note: $("#opanda_agreement_note").is(':checked'),
termsUrl: window.opanda_terms,
privacyPolicyUrl: window.opanda_privacy_policy
},
overlap: {
mode: $("#opanda_overlap").val(),
position: $("#opanda_overlap_position").val()
},
effects: {
highlight: $("#opanda_highlight").is(':checked')
},
locker: {
timer: ( !timer || timer === 0 ) ? null : timer,
close: $("#opanda_close").is(':checked'),
mobile: $("#opanda_mobile").is(':checked')
},
proxy: {
consumer: {
company: {
title: window.opanda_site_name,
url: window.opanda_home_url
},
privacyPolicy: {
title: window.opanda_privacy_policy_title,
url: window.opanda_privacy_policy
}
}
},
actionsProxy: {
url: window.opanda_proxy_url,
paramPrefix: 'opanda'
},
};
if (!options.text.header && options.text.message) {
options.text = options.text.message;
}
options['theme'] = $("#opanda_style").val();
if ( window.bizpanda.previewGoogleFonts ) {
var theme = options['theme'];
options['theme'] = {
'name': theme,
'fonts': window.bizpanda.previewGoogleFonts
};
}
return options;
},
// --------------------------------------
// Basic Metabox
// --------------------------------------
basicOptions: {
init: function( editor ){
this.editor = editor;
this.initThemeSelector();
this.initOverlapModeButtons();
},
initThemeSelector: function() {
var showThemePreview = function(){
var $item = $("#opanda_style").find("option:selected");
var preview = $item.data('preview');
var previewHeight = $item.data('previewheight');
var $wrap = $("#lock-preview-wrap");
if ( preview ) {
$wrap.find("iframe").hide();
$wrap.css('height', previewHeight ? previewHeight + 'px' : '300px');
$wrap.css('background', 'url("' + preview + '") center center no-repeat');
} else {
$wrap.find("iframe").show();
$wrap.css('height', 'auto');
$wrap.css('background', 'none');
}
};
showThemePreview();
$.bizpanda.hooks.add('opanda-refresh-preview', function(){
showThemePreview();
});
},
initOverlapModeButtons: function() {
var $overlapControl = $("#OPanda_BasicOptionsMetaBox .factory-control-overlap .factory-buttons-group");
var $positionControl = $("#OPanda_BasicOptionsMetaBox .factory-control-overlap_position");
var $position = $("#opanda_overlap_position");
$overlapControl.after( $("<div id='opanda_overlap_position_wrap'></div>").append( $position ) );
var checkPositionControlVisability = function( ){
var value = $("#opanda_overlap").val();
if ( value === 'full' ) {
$("#opanda_overlap_position_wrap").css("display", "none");
} else {
$("#opanda_overlap_position_wrap").css("display", "inline-block");
}
};
var toggleAjaxOption = function() {
var value = $("#opanda_overlap").val();
if ( value === 'full' ) {
$("#opanda-ajax-disabled").hide();
} else {
$("#opanda-ajax-disabled").fadeIn();
}
};
checkPositionControlVisability();
toggleAjaxOption();
$("#opanda_overlap").change(function(){
checkPositionControlVisability()
toggleAjaxOption();
});
}
}
};
$(function(){
window.bizpanda.lockerEditor.init();
});
})(jQuery)
function opanda_editor_callback(e) {
if ( e.type == 'keyup') {
tinyMCE.activeEditor.save();
window.bizpanda.lockerEditor.refreshPreview();
}
return true;
}

View File

@@ -0,0 +1,11 @@
(function($){
$(function(){
$(".column-shortcode input").click(function(){
$(this).select();
});
});
})(jQuery)

View File

@@ -0,0 +1,59 @@
if ( !window.bizpanda ) window.bizpanda = {};
if ( !window.bizpanda.statistics ) window.bizpanda.leads = {};
(function($){
window.bizpanda.leads = {
init: function() {
if ( $("#opanda-leads-page").length ) this.list.init();
if ( $("#opanda-lead-details-page").length ) this.details.init();
if ( $("#opanda-export-page").length ) this.export.init();
},
list: {
init: function(){}
},
details: {
init: function() {
$('.detail').on('click', function(){
var _this = $(this).addClass('active'),
_ul = _this.find('.click-to-edit'),
_first = _ul.find('> li').first(),
_last = _ul.find('> li').last();
if(!_first.is(':hidden')){
_first.hide();
_last.show().find('input').first().focus().select();
}
});
}
},
export: {
init: function(){
$("#factory-checklist-opanda_lockers-all").change( function(){
var $checkboxes = $(".factory-control-lockers input");
if ( $(this).is(":checked") ) {
$checkboxes.attr('checked', 'checked');
} else {
$checkboxes.removeAttr('checked', 'checked');
}
});
}
}
};
$(function(){
window.bizpanda.leads.init();
});
})(jQuery)

View File

@@ -0,0 +1,454 @@
/* =========================================================
* bootstrap-datepicker.js
* http://www.eyecon.ro/bootstrap-datepicker
* =========================================================
* Copyright 2012 Stefan Petre
*
* 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( $ ) {
// Picker object
var Datepicker = function(element, options){
this.element = $(element);
this.format = DPGlobal.parseFormat(options.format||this.element.data('date-format')||'mm/dd/yyyy');
this.picker = $(DPGlobal.template)
.appendTo('body')
.on({
click: $.proxy(this.click, this),
mousedown: $.proxy(this.mousedown, this)
});
this.isInput = this.element.is('input');
this.component = this.element.is('.date') ? this.element.find('.add-on') : false;
if (this.isInput) {
this.element.on({
focus: $.proxy(this.show, this),
blur: $.proxy(this.hide, this),
keyup: $.proxy(this.update, this)
});
} else {
if (this.component){
this.component.on('click', $.proxy(this.show, this));
} else {
this.element.on('click', $.proxy(this.show, this));
}
}
this.minViewMode = options.minViewMode||this.element.data('date-minviewmode')||0;
if (typeof this.minViewMode === 'string') {
switch (this.minViewMode) {
case 'months':
this.minViewMode = 1;
break;
case 'years':
this.minViewMode = 2;
break;
default:
this.minViewMode = 0;
break;
}
}
this.viewMode = options.viewMode||this.element.data('date-viewmode')||0;
if (typeof this.viewMode === 'string') {
switch (this.viewMode) {
case 'months':
this.viewMode = 1;
break;
case 'years':
this.viewMode = 2;
break;
default:
this.viewMode = 0;
break;
}
}
this.startViewMode = this.viewMode;
this.weekStart = options.weekStart||this.element.data('date-weekstart')||0;
this.weekEnd = this.weekStart === 0 ? 6 : this.weekStart - 1;
this.fillDow();
this.fillMonths();
this.update();
this.showMode();
};
Datepicker.prototype = {
constructor: Datepicker,
show: function(e) {
this.picker.show();
this.height = this.component ? this.component.outerHeight() : this.element.outerHeight();
this.place();
$(window).on('resize', $.proxy(this.place, this));
if (e ) {
e.stopPropagation();
e.preventDefault();
}
if (!this.isInput) {
$(document).on('mousedown', $.proxy(this.hide, this));
}
this.element.trigger({
type: 'show',
date: this.date
});
},
hide: function(){
this.picker.hide();
$(window).off('resize', this.place);
this.viewMode = this.startViewMode;
this.showMode();
if (!this.isInput) {
$(document).off('mousedown', this.hide);
}
this.set();
this.element.trigger({
type: 'hide',
date: this.date
});
},
set: function() {
var formated = DPGlobal.formatDate(this.date, this.format);
if (!this.isInput) {
if (this.component){
this.element.find('input').prop('value', formated);
}
this.element.data('date', formated);
} else {
this.element.prop('value', formated);
}
},
setValue: function(newDate) {
if (typeof newDate === 'string') {
this.date = DPGlobal.parseDate(newDate, this.format);
} else {
this.date = new Date(newDate);
}
this.set();
this.viewDate = new Date(this.date.getFullYear(), this.date.getMonth(), 1, 0, 0, 0, 0);
this.fill();
},
place: function(){
var offset = this.component ? this.component.offset() : this.element.offset();
this.picker.css({
top: offset.top + this.height,
left: offset.left
});
},
update: function(newDate){
this.date = DPGlobal.parseDate(
typeof newDate === 'string' ? newDate : (this.isInput ? this.element.prop('value') : this.element.data('date')),
this.format
);
this.viewDate = new Date(this.date.getFullYear(), this.date.getMonth(), 1, 0, 0, 0, 0);
this.fill();
},
fillDow: function(){
var dowCnt = this.weekStart;
var html = '<tr>';
while (dowCnt < this.weekStart + 7) {
html += '<th class="dow">'+DPGlobal.dates.daysMin[(dowCnt++)%7]+'</th>';
}
html += '</tr>';
this.picker.find('.datepicker-days thead').append(html);
},
fillMonths: function(){
var html = '';
var i = 0
while (i < 12) {
html += '<span class="month">'+DPGlobal.dates.monthsShort[i++]+'</span>';
}
this.picker.find('.datepicker-months td').append(html);
},
fill: function() {
var d = new Date(this.viewDate),
year = d.getFullYear(),
month = d.getMonth(),
currentDate = this.date.valueOf();
this.picker.find('.datepicker-days th:eq(1)')
.text(DPGlobal.dates.months[month]+' '+year);
var prevMonth = new Date(year, month-1, 28,0,0,0,0),
day = DPGlobal.getDaysInMonth(prevMonth.getFullYear(), prevMonth.getMonth());
prevMonth.setDate(day);
prevMonth.setDate(day - (prevMonth.getDay() - this.weekStart + 7)%7);
var nextMonth = new Date(prevMonth);
nextMonth.setDate(nextMonth.getDate() + 42);
nextMonth = nextMonth.valueOf();
html = [];
var clsName;
while(prevMonth.valueOf() < nextMonth) {
if (prevMonth.getDay() === this.weekStart) {
html.push('<tr>');
}
clsName = '';
if (prevMonth.getMonth() < month) {
clsName += ' old';
} else if (prevMonth.getMonth() > month) {
clsName += ' new';
}
if (prevMonth.valueOf() === currentDate) {
clsName += ' active';
}
html.push('<td class="day'+clsName+'">'+prevMonth.getDate() + '</td>');
if (prevMonth.getDay() === this.weekEnd) {
html.push('</tr>');
}
prevMonth.setDate(prevMonth.getDate()+1);
}
this.picker.find('.datepicker-days tbody').empty().append(html.join(''));
var currentYear = this.date.getFullYear();
var months = this.picker.find('.datepicker-months')
.find('th:eq(1)')
.text(year)
.end()
.find('span').removeClass('active');
if (currentYear === year) {
months.eq(this.date.getMonth()).addClass('active');
}
html = '';
year = parseInt(year/10, 10) * 10;
var yearCont = this.picker.find('.datepicker-years')
.find('th:eq(1)')
.text(year + '-' + (year + 9))
.end()
.find('td');
year -= 1;
for (var i = -1; i < 11; i++) {
html += '<span class="year'+(i === -1 || i === 10 ? ' old' : '')+(currentYear === year ? ' active' : '')+'">'+year+'</span>';
year += 1;
}
yearCont.html(html);
},
click: function(e) {
e.stopPropagation();
e.preventDefault();
var target = $(e.target).closest('span, td, th');
if (target.length === 1) {
switch(target[0].nodeName.toLowerCase()) {
case 'th':
switch(target[0].className) {
case 'switch':
this.showMode(1);
break;
case 'prev':
case 'next':
this.viewDate['set'+DPGlobal.modes[this.viewMode].navFnc].call(
this.viewDate,
this.viewDate['get'+DPGlobal.modes[this.viewMode].navFnc].call(this.viewDate) +
DPGlobal.modes[this.viewMode].navStep * (target[0].className === 'prev' ? -1 : 1)
);
this.fill();
this.set();
break;
}
break;
case 'span':
if (target.is('.month')) {
var month = target.parent().find('span').index(target);
this.viewDate.setMonth(month);
} else {
var year = parseInt(target.text(), 10)||0;
this.viewDate.setFullYear(year);
}
if (this.viewMode !== 0) {
this.date = new Date(this.viewDate);
this.element.trigger({
type: 'changeDate',
date: this.date,
viewMode: DPGlobal.modes[this.viewMode].clsName
});
}
this.showMode(-1);
this.fill();
this.set();
break;
case 'td':
if (target.is('.day')){
var day = parseInt(target.text(), 10)||1;
var month = this.viewDate.getMonth();
if (target.is('.old')) {
month -= 1;
} else if (target.is('.new')) {
month += 1;
}
var year = this.viewDate.getFullYear();
this.date = new Date(year, month, day,0,0,0,0);
this.viewDate = new Date(year, month, Math.min(28, day),0,0,0,0);
this.fill();
this.set();
this.element.trigger({
type: 'changeDate',
date: this.date,
viewMode: DPGlobal.modes[this.viewMode].clsName
});
}
break;
}
}
},
mousedown: function(e){
e.stopPropagation();
e.preventDefault();
},
showMode: function(dir) {
if (dir) {
this.viewMode = Math.max(this.minViewMode, Math.min(2, this.viewMode + dir));
}
this.picker.find('>div').hide().filter('.datepicker-'+DPGlobal.modes[this.viewMode].clsName).show();
}
};
$.fn.datepicker = function ( option, val ) {
return this.each(function () {
var $this = $(this),
data = $this.data('datepicker'),
options = typeof option === 'object' && option;
if (!data) {
$this.data('datepicker', (data = new Datepicker(this, $.extend({}, $.fn.datepicker.defaults,options))));
}
if (typeof option === 'string') data[option](val);
});
};
$.fn.datepicker.defaults = {
};
$.fn.datepicker.Constructor = Datepicker;
var DPGlobal = {
modes: [
{
clsName: 'days',
navFnc: 'Month',
navStep: 1
},
{
clsName: 'months',
navFnc: 'FullYear',
navStep: 1
},
{
clsName: 'years',
navFnc: 'FullYear',
navStep: 10
}],
dates:{
days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"],
daysShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
daysMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"],
months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
monthsShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
},
isLeapYear: function (year) {
return (((year % 4 === 0) && (year % 100 !== 0)) || (year % 400 === 0))
},
getDaysInMonth: function (year, month) {
return [31, (DPGlobal.isLeapYear(year) ? 29 : 28), 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month]
},
parseFormat: function(format){
var separator = format.match(/[.\/\-\s].*?/),
parts = format.split(/\W+/);
if (!separator || !parts || parts.length === 0){
throw new Error("Invalid date format.");
}
return {separator: separator, parts: parts};
},
parseDate: function(date, format) {
var parts = date.split(format.separator),
date = new Date(),
val;
date.setHours(0);
date.setMinutes(0);
date.setSeconds(0);
date.setMilliseconds(0);
if (parts.length === format.parts.length) {
for (var i=0, cnt = format.parts.length; i < cnt; i++) {
val = parseInt(parts[i], 10)||1;
switch(format.parts[i]) {
case 'dd':
case 'd':
date.setDate(val);
break;
case 'mm':
case 'm':
date.setMonth(val - 1);
break;
case 'yy':
date.setFullYear(2000 + val);
break;
case 'yyyy':
date.setFullYear(val);
break;
}
}
}
return date;
},
formatDate: function(date, format){
var val = {
d: date.getDate(),
m: date.getMonth() + 1,
yy: date.getFullYear().toString().substring(2),
yyyy: date.getFullYear()
};
val.dd = (val.d < 10 ? '0' : '') + val.d;
val.mm = (val.m < 10 ? '0' : '') + val.m;
var date = [];
for (var i=0, cnt = format.parts.length; i < cnt; i++) {
date.push(val[format.parts[i]]);
}
return date.join(format.separator);
},
headTemplate: '<thead>'+
'<tr>'+
'<th class="prev">&lsaquo;</th>'+
'<th colspan="5" class="switch"></th>'+
'<th class="next">&rsaquo;</th>'+
'</tr>'+
'</thead>',
contTemplate: '<tbody><tr><td colspan="7"></td></tr></tbody>'
};
DPGlobal.template = '<div class="datepicker dropdown-menu">'+
'<div class="datepicker-days">'+
'<table class=" table-condensed">'+
DPGlobal.headTemplate+
'<tbody></tbody>'+
'</table>'+
'</div>'+
'<div class="datepicker-months">'+
'<table class="table-condensed">'+
DPGlobal.headTemplate+
DPGlobal.contTemplate+
'</table>'+
'</div>'+
'<div class="datepicker-years">'+
'<table class="table-condensed">'+
DPGlobal.headTemplate+
DPGlobal.contTemplate+
'</table>'+
'</div>'+
'</div>';
}( window.jQuery )

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,486 @@
/*
json2.js
2013-05-26
Public Domain.
NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
See http://www.JSON.org/js.html
This code should be minified before deployment.
See http://javascript.crockford.com/jsmin.html
USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO
NOT CONTROL.
This file creates a global JSON object containing two methods: stringify
and parse.
JSON.stringify(value, replacer, space)
value any JavaScript value, usually an object or array.
replacer an optional parameter that determines how object
values are stringified for objects. It can be a
function or an array of strings.
space an optional parameter that specifies the indentation
of nested structures. If it is omitted, the text will
be packed without extra whitespace. If it is a number,
it will specify the number of spaces to indent at each
level. If it is a string (such as '\t' or '&nbsp;'),
it contains the characters used to indent at each level.
This method produces a JSON text from a JavaScript value.
When an object value is found, if the object contains a toJSON
method, its toJSON method will be called and the result will be
stringified. A toJSON method does not serialize: it returns the
value represented by the name/value pair that should be serialized,
or undefined if nothing should be serialized. The toJSON method
will be passed the key associated with the value, and this will be
bound to the value
For example, this would serialize Dates as ISO strings.
Date.prototype.toJSON = function (key) {
function f(n) {
// Format integers to have at least two digits.
return n < 10 ? '0' + n : n;
}
return this.getUTCFullYear() + '-' +
f(this.getUTCMonth() + 1) + '-' +
f(this.getUTCDate()) + 'T' +
f(this.getUTCHours()) + ':' +
f(this.getUTCMinutes()) + ':' +
f(this.getUTCSeconds()) + 'Z';
};
You can provide an optional replacer method. It will be passed the
key and value of each member, with this bound to the containing
object. The value that is returned from your method will be
serialized. If your method returns undefined, then the member will
be excluded from the serialization.
If the replacer parameter is an array of strings, then it will be
used to select the members to be serialized. It filters the results
such that only members with keys listed in the replacer array are
stringified.
Values that do not have JSON representations, such as undefined or
functions, will not be serialized. Such values in objects will be
dropped; in arrays they will be replaced with null. You can use
a replacer function to replace those with JSON values.
JSON.stringify(undefined) returns undefined.
The optional space parameter produces a stringification of the
value that is filled with line breaks and indentation to make it
easier to read.
If the space parameter is a non-empty string, then that string will
be used for indentation. If the space parameter is a number, then
the indentation will be that many spaces.
Example:
text = JSON.stringify(['e', {pluribus: 'unum'}]);
// text is '["e",{"pluribus":"unum"}]'
text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\t');
// text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]'
text = JSON.stringify([new Date()], function (key, value) {
return this[key] instanceof Date ?
'Date(' + this[key] + ')' : value;
});
// text is '["Date(---current time---)"]'
JSON.parse(text, reviver)
This method parses a JSON text to produce an object or array.
It can throw a SyntaxError exception.
The optional reviver parameter is a function that can filter and
transform the results. It receives each of the keys and values,
and its return value is used instead of the original value.
If it returns what it received, then the structure is not modified.
If it returns undefined then the member is deleted.
Example:
// Parse the text. Values that look like ISO date strings will
// be converted to Date objects.
myData = JSON.parse(text, function (key, value) {
var a;
if (typeof value === 'string') {
a =
/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value);
if (a) {
return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],
+a[5], +a[6]));
}
}
return value;
});
myData = JSON.parse('["Date(09/09/2001)"]', function (key, value) {
var d;
if (typeof value === 'string' &&
value.slice(0, 5) === 'Date(' &&
value.slice(-1) === ')') {
d = new Date(value.slice(5, -1));
if (d) {
return d;
}
}
return value;
});
This is a reference implementation. You are free to copy, modify, or
redistribute.
*/
/*jslint evil: true, regexp: true */
/*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply,
call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,
getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,
lastIndex, length, parse, prototype, push, replace, slice, stringify,
test, toJSON, toString, valueOf
*/
// Create a JSON object only if one does not already exist. We create the
// methods in a closure to avoid creating global variables.
if (typeof JSON !== 'object') {
JSON = {};
}
(function () {
'use strict';
function f(n) {
// Format integers to have at least two digits.
return n < 10 ? '0' + n : n;
}
if (typeof Date.prototype.toJSON !== 'function') {
Date.prototype.toJSON = function () {
return isFinite(this.valueOf())
? this.getUTCFullYear() + '-' +
f(this.getUTCMonth() + 1) + '-' +
f(this.getUTCDate()) + 'T' +
f(this.getUTCHours()) + ':' +
f(this.getUTCMinutes()) + ':' +
f(this.getUTCSeconds()) + 'Z'
: null;
};
String.prototype.toJSON =
Number.prototype.toJSON =
Boolean.prototype.toJSON = function () {
return this.valueOf();
};
}
var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
gap,
indent,
meta = { // table of character substitutions
'\b': '\\b',
'\t': '\\t',
'\n': '\\n',
'\f': '\\f',
'\r': '\\r',
'"' : '\\"',
'\\': '\\\\'
},
rep;
function quote(string) {
// If the string contains no control characters, no quote characters, and no
// backslash characters, then we can safely slap some quotes around it.
// Otherwise we must also replace the offending characters with safe escape
// sequences.
escapable.lastIndex = 0;
return escapable.test(string) ? '"' + string.replace(escapable, function (a) {
var c = meta[a];
return typeof c === 'string'
? c
: '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
}) + '"' : '"' + string + '"';
}
function str(key, holder) {
// Produce a string from holder[key].
var i, // The loop counter.
k, // The member key.
v, // The member value.
length,
mind = gap,
partial,
value = holder[key];
// If the value has a toJSON method, call it to obtain a replacement value.
if (value && typeof value === 'object' &&
typeof value.toJSON === 'function') {
value = value.toJSON(key);
}
// If we were called with a replacer function, then call the replacer to
// obtain a replacement value.
if (typeof rep === 'function') {
value = rep.call(holder, key, value);
}
// What happens next depends on the value's type.
switch (typeof value) {
case 'string':
return quote(value);
case 'number':
// JSON numbers must be finite. Encode non-finite numbers as null.
return isFinite(value) ? String(value) : 'null';
case 'boolean':
case 'null':
// If the value is a boolean or null, convert it to a string. Note:
// typeof null does not produce 'null'. The case is included here in
// the remote chance that this gets fixed someday.
return String(value);
// If the type is 'object', we might be dealing with an object or an array or
// null.
case 'object':
// Due to a specification blunder in ECMAScript, typeof null is 'object',
// so watch out for that case.
if (!value) {
return 'null';
}
// Make an array to hold the partial results of stringifying this object value.
gap += indent;
partial = [];
// Is the value an array?
if (Object.prototype.toString.apply(value) === '[object Array]') {
// The value is an array. Stringify every element. Use null as a placeholder
// for non-JSON values.
length = value.length;
for (i = 0; i < length; i += 1) {
partial[i] = str(i, value) || 'null';
}
// Join all of the elements together, separated with commas, and wrap them in
// brackets.
v = partial.length === 0
? '[]'
: gap
? '[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']'
: '[' + partial.join(',') + ']';
gap = mind;
return v;
}
// If the replacer is an array, use it to select the members to be stringified.
if (rep && typeof rep === 'object') {
length = rep.length;
for (i = 0; i < length; i += 1) {
if (typeof rep[i] === 'string') {
k = rep[i];
v = str(k, value);
if (v) {
partial.push(quote(k) + (gap ? ': ' : ':') + v);
}
}
}
} else {
// Otherwise, iterate through all of the keys in the object.
for (k in value) {
if (Object.prototype.hasOwnProperty.call(value, k)) {
v = str(k, value);
if (v) {
partial.push(quote(k) + (gap ? ': ' : ':') + v);
}
}
}
}
// Join all of the member texts together, separated with commas,
// and wrap them in braces.
v = partial.length === 0
? '{}'
: gap
? '{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}'
: '{' + partial.join(',') + '}';
gap = mind;
return v;
}
}
// If the JSON object does not yet have a stringify method, give it one.
if (typeof JSON.stringify !== 'function') {
JSON.stringify = function (value, replacer, space) {
// The stringify method takes a value and an optional replacer, and an optional
// space parameter, and returns a JSON text. The replacer can be a function
// that can replace values, or an array of strings that will select the keys.
// A default replacer method can be provided. Use of the space parameter can
// produce text that is more easily readable.
var i;
gap = '';
indent = '';
// If the space parameter is a number, make an indent string containing that
// many spaces.
if (typeof space === 'number') {
for (i = 0; i < space; i += 1) {
indent += ' ';
}
// If the space parameter is a string, it will be used as the indent string.
} else if (typeof space === 'string') {
indent = space;
}
// If there is a replacer, it must be a function or an array.
// Otherwise, throw an error.
rep = replacer;
if (replacer && typeof replacer !== 'function' &&
(typeof replacer !== 'object' ||
typeof replacer.length !== 'number')) {
throw new Error('JSON.stringify');
}
// Make a fake root object containing our value under the key of ''.
// Return the result of stringifying the value.
return str('', {'': value});
};
}
// If the JSON object does not yet have a parse method, give it one.
if (typeof JSON.parse !== 'function') {
JSON.parse = function (text, reviver) {
// The parse method takes a text and an optional reviver function, and returns
// a JavaScript value if the text is a valid JSON text.
var j;
function walk(holder, key) {
// The walk method is used to recursively walk the resulting structure so
// that modifications can be made.
var k, v, value = holder[key];
if (value && typeof value === 'object') {
for (k in value) {
if (Object.prototype.hasOwnProperty.call(value, k)) {
v = walk(value, k);
if (v !== undefined) {
value[k] = v;
} else {
delete value[k];
}
}
}
}
return reviver.call(holder, key, value);
}
// Parsing happens in four stages. In the first stage, we replace certain
// Unicode characters with escape sequences. JavaScript handles many characters
// incorrectly, either silently deleting them, or treating them as line endings.
text = String(text);
cx.lastIndex = 0;
if (cx.test(text)) {
text = text.replace(cx, function (a) {
return '\\u' +
('0000' + a.charCodeAt(0).toString(16)).slice(-4);
});
}
// In the second stage, we run the text against regular expressions that look
// for non-JSON patterns. We are especially concerned with '()' and 'new'
// because they can cause invocation, and '=' because it can cause mutation.
// But just to be safe, we want to reject all unexpected forms.
// We split the second stage into 4 regexp operations in order to work around
// crippling inefficiencies in IE's and Safari's regexp engines. First we
// replace the JSON backslash pairs with '@' (a non-JSON character). Second, we
// replace all simple value tokens with ']' characters. Third, we delete all
// open brackets that follow a colon or comma or that begin the text. Finally,
// we look to see that the remaining characters are only whitespace or ']' or
// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.
if (/^[\],:{}\s]*$/
.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@')
.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']')
.replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
// In the third stage we use the eval function to compile the text into a
// JavaScript structure. The '{' operator is subject to a syntactic ambiguity
// in JavaScript: it can begin a block or an object literal. We wrap the text
// in parens to eliminate the ambiguity.
j = eval('(' + text + ')');
// In the optional fourth stage, we recursively walk the new structure, passing
// each name/value pair to a reviver function for possible transformation.
return typeof reviver === 'function'
? walk({'': j}, '')
: j;
}
// If the text is not JSON parseable, then a SyntaxError is thrown.
throw new SyntaxError('JSON.parse');
};
}
}());

View File

@@ -0,0 +1,276 @@
(function($){
/**
* Methods to manager bulk lockiing options.
*/
window.metaboxBulkLock = {
wrap: $("#OPanda_BulkLockingMetaBox"),
/**
* Inits the bulk locking metabox.
*/
init: function() {
var self = this;
$("#onp-sl-bulk-locking-way-selector .btn").click(function(){
self.selectWay( $(this).data('name') );
return false;
});
$("#onp-sl-save-bulk-locking-btn").click(function(){
self.saveOptions();
return false;
});
this.wrap.find(".onp-sl-cancel").click(function(){
self.cancel();
return false;
});
if ( this.wrap.find(".onp-sl-has-options-content").is(".onp-sl-css-selector-state") ) {
this.disableVisiblityOptions();
}
$("#onp-sl-bulk-lock-modal").on("keydown keypress keyup", function(e) {
if(e.keyCode == 13) {
e.preventDefault();
e.stopPropagation();
$("#onp-sl-save-bulk-locking-btn").click();
return false;
}
});
},
/**
* Selects a given bulk locking way by its name.
*/
selectWay: function( name ) {
$("#onp-sl-bulk-locking-way-selector .active").removeClass("active");
$(".onp-sl-bulk-locking-options").addClass('hide');
var $this = $("#onp-sl-bulk-locking-way-selector ." + name);
$this.addClass("active");
var target = $this.data('target');
$(target).removeClass('hide');
},
/**
* Cancels the bulk locking.
*/
cancel: function() {
var self = this;
$("#onp-sl-bulk-lock-options").html("");
this.enableVisiblityOptions();
this.wrap.find(".onp-sl-setup-section").fadeOut(300, function(){
self.wrap.find(".onp-sl-setup-section")
.removeClass("onp-sl-has-options-state")
.addClass("onp-sl-empty-state");
self.wrap.addClass("onp-sl-changed");
self.wrap.find(".onp-sl-interrelation-hint").removeClass("onp-sl-has-options-state");
self.wrap.find(".onp-sl-setup-section").fadeIn(500);
});
},
/**
* Saves selected bulk locking options.
*/
saveOptions: function() {
var self = this;
if ( !this.validateOptions() ) return;
var options = {};
options['way'] = $("#onp-sl-bulk-locking-way-selector .active").data("name");
if ( options['way'] === "skip-lock" ) {
options['skip_number'] = parseInt( $("#onp-sl-skip-lock-options .onp-sl-skip-number").val() );
} else if ( options['way'] === "css-selector" ) {
options['css_selector'] = $("#onp-sl-css-selector-options .onp-sl-css-selector").val();
}
if ( options['way'] === "skip-lock" || options['way'] === "more-tag" ) {
var $base = options['way'] === "skip-lock"
? $("#onp-sl-skip-lock-options")
: $("#onp-sl-more-tags-options");
var postTypes = [];
$base.find(".onp-sl-post-type:checked").each(function(){
postTypes.push( $(this).val() );
});
options['post_types'] = postTypes.join(', ');
options['exclude_posts'] = $.trim( $base.find(".onp-sl-exclude-posts").val() );
options['exclude_categories'] = $.trim( $base.find(".onp-sl-exclude-categories").val() );
this.enableVisiblityOptions();
} else {
this.disableVisiblityOptions();
}
$("#onp-sl-bulk-lock-modal").factoryBootstrap331_modal("hide");
// generating hidden fields to save on form submitting
$("#onp-sl-bulk-lock-options").html("");
for(var optionName in options) {
var $h = $("<input type='hidden' />")
.attr('name', "onp_sl_" + optionName)
.val(options[optionName]);
$("#onp-sl-bulk-lock-options").append($h);
}
// shows selected values
this.wrap.find(".onp-sl-setup-section").fadeOut(300, function(){
self.wrap.find(".onp-sl-setup-section")
.removeClass("onp-sl-empty-state")
.addClass("onp-sl-has-options-state");
self.wrap.find(".onp-sl-has-options-content")
.removeClass("onp-sl-skip-lock-state")
.removeClass("onp-sl-more-tag-state")
.removeClass("onp-sl-css-selector-state")
.addClass("onp-sl-" + options['way'] + '-state');
if ( options['way'] === "skip-lock" ) {
self.wrap.find(".onp-sl-skip-lock-content")
.removeClass('onp-sl-skip-lock-0-state')
.removeClass('onp-sl-skip-lock-1-state')
.removeClass('onp-sl-skip-lock-2-state');
if ( options['skip_number'] === 0 )
self.wrap.find(".onp-sl-skip-lock-content").addClass("onp-sl-skip-lock-0-state");
else if ( options['skip_number'] === 1 )
self.wrap.find(".onp-sl-skip-lock-content").addClass("onp-sl-skip-lock-1-state");
else if ( options['skip_number'] > 1 ) {
var text = window.bizpanda.lang.everyPostWillBeLockedEntirelyExceptFirstsParagraphs.replace("%s", options['skip_number']);
self.wrap.find(".onp-sl-skip-lock-2-content").text(text);
self.wrap.find(".onp-sl-skip-lock-content").addClass("onp-sl-skip-lock-2-state");
}
} else if ( options['way'] === 'css-selector' ) {
self.wrap.find(".onp-sl-css-selector-view").text( options['css_selector'] );
}
self.wrap.find(".onp-sl-has-options-content")
.removeClass("onp-sl-post-types-rule-state")
.removeClass("onp-sl-exclude-post-ids-rule-state")
.removeClass("onp-sl-exclude-categories-ids-rule-state");
if ( options['way'] === "skip-lock" || options['way'] === "more-tag" ) {
var $base = options['way'] === "skip-lock"
? $("#onp-sl-skip-lock-options")
: $("#onp-sl-more-tags-options");
self.wrap.find(".onp-sl-post-types-rule").text(
window.bizpanda.lang.appliesToTypes.replace("%s", options['post_types'])
);
self.wrap.find(".onp-sl-exclude-post-ids-rule").text(
window.bizpanda.lang.excludesPosts.replace("%s", options['exclude_posts'])
);
self.wrap.find(".onp-sl-exclude-categories-ids-rule").text(
window.bizpanda.lang.excludesCategories.replace("%s", options['exclude_categories'])
);
self.wrap.find(".onp-sl-has-options-content")
.addClass("onp-sl-post-types-rule-state");
if ( options['exclude_posts'] ) {
self.wrap.find(".onp-sl-has-options-content")
.addClass("onp-sl-exclude-post-ids-rule-state");
}
if ( options['exclude_categories'] ) {
self.wrap.find(".onp-sl-has-options-content")
.addClass("onp-sl-exclude-categories-ids-rule-state");
}
}
self.wrap.find(".onp-sl-setup-section").fadeIn(500);
self.wrap.addClass("onp-sl-changed");
self.wrap.find(".onp-sl-interrelation-hint").addClass("onp-sl-has-options-state");
});
return false;
},
/**
* Validates the bulk locking options.
*/
validateOptions: function() {
this.wrap.find(".has-error").removeClass('has-error');
var way = $("#onp-sl-bulk-locking-way-selector .active").data("name");
if ( way === "skip-lock" ) {
if ( $("#onp-sl-skip-lock-options .alert").length > 0 ) {
$("#onp-sl-skip-lock-options .alert").fadeOut(300, function(){
$("#onp-sl-skip-lock-options .alert").fadeIn();
});
return false;
}
var skipNumber = parseInt( $("#onp-sl-skip-lock-options .onp-sl-skip-number").val() );
if ( isNaN( skipNumber ) || skipNumber < 0 ) {
$("#onp-sl-skip-lock-options .onp-sl-skip-number-row").addClass('has-error');
return false;
}
if ( $("#onp-sl-skip-lock-options .onp-sl-post-type:checked").length === 0 ) {
$("#onp-sl-skip-lock-options .onp-sl-post-types").addClass('has-error');
return false;
}
} else if ( way === 'more-tag' ) {
if ( $("#onp-sl-more-tags-options .alert").length > 0 ) {
$("#onp-sl-more-tags-options .alert").fadeOut(300, function(){
$("#onp-sl-more-tags-options .alert").fadeIn();
});
return false;
}
if ( $("#onp-sl-more-tags-options .onp-sl-post-type:checked").length === 0 ) {
$("#onp-sl-more-tags-options .onp-sl-post-types").addClass('has-error');
return false;
}
} else if ( way === 'css-selector' ) {
var cssSelector = $.trim( $("#onp-sl-css-selector-options .onp-sl-css-selector").val() );
if ( !cssSelector ) {
$("#onp-sl-css-selector-options .onp-sl-content").addClass('has-error');
return false;
}
return true;
}
return true;
},
disableVisiblityOptions: function() {
var $message = this.wrap.find(".onp-sl-visibility-options-disabled").clone();
$("#OPanda_VisabilityOptionsMetaBox .form-horizontal").hide().after($message);
$message.fadeIn();
},
enableVisiblityOptions: function() {
$("#OPanda_VisabilityOptionsMetaBox .onp-sl-visibility-options-disabled").remove();
$("#OPanda_VisabilityOptionsMetaBox .form-horizontal").fadeIn();
}
};
$(function(){
window.metaboxBulkLock.init();
});
})(jQuery);

View File

@@ -0,0 +1,23 @@
(function($){
/**
* Inits the metabox Manual Locking
*/
window.metaboxManualLock = {
/**
* Inits the bulk locking metabox.
*/
init: function() {
$(".onp-sl-shortcode").click(function(){
$(this).select();
});
},
};
$(function(){
window.metaboxManualLock.init();
});
})(jQuery);

View File

@@ -0,0 +1,31 @@
(function($){
/**
* Visability Options.
*/
window.termsOptions = {
init: function() {
this.initOptions();
},
initOptions: function() {
var self = this;
$("#opanda_agreement_checkbox").change(function(){
console.log('fff');
if ( $(this).is(":checked") ) {
$("#onp-sl-agreement_checkbox-options").hide().removeClass('hide');
$("#onp-sl-agreement_checkbox-options").fadeIn();
} else {
$("#onp-sl-agreement_checkbox-options").hide();
}
});
}
};
$(function(){
window.termsOptions.init();
});
})(jQuery);

View File

@@ -0,0 +1,38 @@
(function($){
/**
* Inits the trial box.
*/
window.metaboxTrialBox = {
/**
* Inits the bulk locking metabox.
*/
init: function() {
$("#OPanda_MoreFeaturesMetaBox ul span").qtip({
content: {
text: function() {
var className = $(this).data('target');
return $("#OPanda_MoreFeaturesMetaBox ." + className).clone();
}
},
position: {
my: 'center right',
at: 'center left',
adjust: {
x: -45
}
},
style: {
classes: 'qtip-bootstrap advanced-function-demo'
}
});
}
};
$(function(){
window.metaboxTrialBox.init();
});
})(jQuery);

View File

@@ -0,0 +1,100 @@
(function($){
/**
* Visability Options.
*/
window.visibilityOptions = {
init: function() {
this.initSwitcher();
this.initSimpleOptions();
this.initAdvancedOptions();
},
initSwitcher: function() {
var $buttons = $(".bp-options-switcher .btn");
var selectOptions = function( value ) {
if ( !value ) value = $("#opanda_visibility_mode").val();
$buttons.removeClass('active');
if ( 'simple' === value ) {
$(".bp-options-switcher .btn-btn-simple").addClass('active');
$("#bp-advanced-visibility-options").hide();
$("#bp-simple-visibility-options").fadeIn(300);
} else {
$(".bp-options-switcher .btn-btn-advanced").addClass('active');
$("#bp-simple-visibility-options").hide();
$("#bp-advanced-visibility-options").fadeIn(300);
}
$("#opanda_visibility_mode").val(value);
};
$buttons = $(".bp-options-switcher .btn").click(function(){
var value = $(this).data('value');
selectOptions(value);
return false;
});
selectOptions();
},
initSimpleOptions: function() {
var self = this;
$("#opanda_relock").change(function(){
if ( $(this).is(":checked") ) {
$("#onp-sl-relock-options").hide().removeClass('hide');
$("#onp-sl-relock-options").fadeIn();
} else {
$("#onp-sl-relock-options").hide();
}
});
},
initAdvancedOptions: function() {
var self = this;
var $btnShow = $("#bp-show-more-visability-options");
var $btnSave = $("#bp-advanced-visability-options .bp-save");
var $modal = $("#bp-advanced-visability-options");
var $hidden = $("#opanda_visibility_filters");
var $editor = $("#bp-advanced-visability-options");
// creating an editor
var value = $hidden.val();
$editor.bpConditionEditor({
filters: value ? $.parseJSON( value ) : {}
});
// shows an editor on clicking the button Show
$btnShow.click(function(){
$modal.factoryBootstrap331_modal("show");
});
// saves conditions on clicking the button Save
$btnSave.click(function(){
var data = $editor.bpConditionEditor("getData");
console.log(data);
var json = JSON.stringify(data);
$hidden.val(json);
$modal.factoryBootstrap331_modal("hide");
});
}
};
$(function(){
window.visibilityOptions.init();
});
})(jQuery);

View File

@@ -0,0 +1,18 @@
if ( !window.opanda ) window.opanda = {};
if ( !window.opanda.newItem ) window.opanda.newItem = {};
(function($){
window.opanda.newItem = {
init: function() {
}
};
$(function(){
window.opanda.newItem.init();
});
})(jQuery)

View File

@@ -0,0 +1,82 @@
(function() {
tinymce.create('tinymce.plugins.optinpanda', {
plugin_url: null,
editor: null,
init : function(ed, url) {
this.plugin_url = url;
this.editor = ed;
},
createControl : function(n, cm) {
var self = this;
if ( n === 'optinpanda' )
{
var c = cm.createSplitButton('optinpanda', {
title : 'Split button',
image : self.plugin_url + '/../img/opanda-shortcode-icon.png',
onclick : function() {
self.insertShortCode(null, 'connectlocker', true);
}
});
jQuery(document).ready(function($) {
$.ajax(ajaxurl, {
type: 'post',
dataType: 'json',
data: {
action: 'get_opanda_lockers'
},
success: function(data, textStatus, jqXHR) {
c.onRenderMenu.add(function(c, m) {
m.add({title : 'Lockers', 'class' : 'mceMenuItemTitle'}).setDisabled(1);
var menuItems = [];
$.each(data, function(index, item){
var mItem = m.add({title : item.title, onclick : function(e, a) {
for( index in menuItems ) {
menuItems[index].setSelected(false);
}
mItem.setSelected(true);
self.insertShortCode(item.id, item.shortcode, item.isDefault);
}});
menuItems.push(mItem);
});
});
}
});
});
return c;
}
return null;
},
insertShortCode: function(id, shortcode, isDefault) {
var self = this;
var shortcodeStart = '[' + shortcode + ']';
if ( id && !isDefault ) {
shortcodeStart = '[' + shortcode + ' id=' + id + ']';
}
var shortcodeEnd = '[/' + shortcode + ']';
self.editor.selection.setContent( shortcodeStart + editor.selection.getContent() + shortcodeEnd );
}
});
tinymce.PluginManager.add('optinpanda', tinymce.plugins.optinpanda);
})();

View File

@@ -0,0 +1,54 @@
( function($) {
tinymce.PluginManager.add( 'optinpanda', function( editor, url ) {
var menuCreated = false;
var menu = [];
editor.addButton( 'optinpanda', {
title: window.bizpanda_shortcode_title ? window.bizpanda_shortcode_title : 'BizPanda',
type: 'menubutton',
icon: 'icon onp-sl-shortcode-icon',
menu: menu,
/*
* After rendeing contol, starts to load manu items (locker shortcodes).
*/
onpostrender: function(e) {
if ( menuCreated ) return;
menuCreated = true;
var self = this;
var req = $.ajax(ajaxurl, {
type: 'post',
dataType: 'json',
data: {
action: 'get_opanda_lockers'
},
success: function(data, textStatus, jqXHR) {
$.each(data, function(index, item){
var shortcodeStart = '[' + item.shortcode + ']';
if ( item.id && !item.isDefault ) {
shortcodeStart = '[' + item.shortcode + ' id=' + item.id + ']';
}
var shortcodeEnd = '[/' + item.shortcode + ']';
menu.push({
text: item.title,
value: item.id,
onclick: function() {
editor.selection.setContent(shortcodeStart + editor.selection.getContent() + shortcodeEnd);
}
});
});
self.settings.menu = menu;
}
});
}
});
});
} )(jQuery);

View File

@@ -0,0 +1,64 @@
if ( !window.bizpanda ) window.bizpanda = {};
if ( !window.bizpanda.preview ) window.bizpanda.preview = {};
(function($){
window.bizpanda.preview = {
_forms: {},
refresh: function( url, name, options, callback ) {
if ( !$("iframe[name=" + name + "]").length ) return;
// removes previos forms
if ( this._forms[name] ) {
if ( $("iframe[name='" + name + "']")[0].contentWindow.setOptions )
$("iframe[name='" + name + "']")[0].contentWindow.setOptions( options );
return;
}
var $form = $("<form method='post'></form>")
.attr('target', name)
.attr('action', url);
options = this._encodeOptions( options );
this._createField($form, 'options', JSON.stringify( options ));
this._createField($form, 'name', name);
this._createField($form, 'url', url);
this._createField($form, 'callback', callback);
$form.appendTo( $("body") );
$form.submit();
// saves a form to remove in the next time
this._forms[name] = $form;
},
_createField: function( $form, name, value ){
$("<input type='hidden' />")
.attr('name', name)
.attr('value', value)
.appendTo($form);
},
_encodeOptions: function( options ) {
for( var optionName in options ) {
if ( !$.isPlainObject(options[optionName])) continue;
if ( typeof options[optionName] === 'object' ) {
options[optionName] = this._encodeOptions( options[optionName] );
} else {
if ( options[optionName] ) {
options[optionName] = encodeURI( options[optionName] );
}
}
}
return options;
}
}
})(jQuery);

View File

@@ -0,0 +1,284 @@
(function($){
var settings = {
init: function() {
this.basic.init();
this.social.init();
this.subscription.init();
this.lock.init();
this.notifications.init();
this.permissions.init();
this.text.init();
},
/** ---
* Basic Options
*/
basic: {
init: function() {
}
},
/** ---
* Social Options
*/
social: {
init: function() {
var $wrapSocialApps = $("#own_social_apps_wrap");
var $wrapSigninApps = $("#own_signin_apps_wrap");
$("#opanda_own_apps_for_permissions").change(function(){
if ( $(this).is(":checked") ) $wrapSocialApps.fadeIn();
else $wrapSocialApps.fadeOut();
}).change();
$("#opanda_own_apps_to_signin").change(function(){
if ( $(this).is(":checked") ) $wrapSigninApps.fadeIn();
else $wrapSigninApps.fadeOut();
}).change();
var linkedFiles = {
'opanda_facebook_app_id': {},
'opanda_facebook_app_secret': {},
'opanda_google_client_id': {},
'opanda_google_client_secret': {}
};
for ( var prop in linkedFiles ) {
if ( !linkedFiles.hasOwnProperty(prop) ) continue;
linkedFiles[prop] = $('[name="' + prop + '"]');
linkedFiles[prop].on('change', function(){
var changed = this;
var value = $(this).val();
var name = $(this).attr('name');
linkedFiles[name].each(function(){
var current = this;
if ( changed === current ) return;
$(this).val(value);
});
});
}
}
},
/** ---
* Subscription Options
*/
subscription: {
init: function() {
$("#opanda_subscription_service").change(function(){
var value = $(this).val();
var $options = $("#opanda-" + value + "-options");
$(".opanda-mail-service-options").hide();
$options.fadeIn();
if ( 'none' !== value ) {
$("#opanda-all-services-options").fadeIn();
}
}).change();
}
},
/** ---
* Lock Options
*/
lock: {
init: function() {
var $passcode = $("#opanda_passcode");
var $passcodeUrl = $(".factory-control-passcode .opanda-url");
var $passcodeExample = $(".factory-control-passcode .opanda-example");
var checkPasscode = function() {
var value = $passcode.val();
if ( $.trim( value ) ) $passcodeExample.show();
else $passcodeExample.hide();
};
checkPasscode();
$("#opanda_passcode").keyup(function(){
var value = $.trim( $(this).val() );
$(".opanda-passcode").text( '?' + value );
$passcodeUrl.attr('href', $passcodeUrl.text());
checkPasscode();
}).keyup();
$("#opanda_in_app_browsers").change(function(){
if ( $(this).val() === 'visible_with_warning' ) {
$("#in_app_browsers_warning").fadeIn();
} else {
$("#in_app_browsers_warning").hide();
}
}).change();
$("#opanda_forbid_temp_emails").change(function(){
if ( $(this).is(":checked") ) {
$("#temp_domains_list").fadeIn();
} else {
$("#temp_domains_list").hide();
}
}).change();
$("#opanda_adblock").change(function(){
if ( $(this).val() === 'show_error' ) {
$("#adblock_error").fadeIn();
} else {
$("#adblock_error").hide();
}
}).change();
}
},
/** ---
* Notifications Options
*/
notifications: {
init: function() {
$("#opanda_notify_leads").change(function(){
if ( $(this).is(":checked") ) {
$("#opanda_notify_leads-options").fadeIn();
} else {
$("#opanda_notify_leads-options").hide();
}
}).change();
$("#opanda_notify_unlocks").change(function(){
if ( $(this).is(":checked") ) {
$("#opanda_notify_unlocks-options").fadeIn();
} else {
$("#opanda_notify_unlocks-options").hide();
}
}).change();
}
},
/** ---
* Permissions Options
*/
permissions: {
init: function() {
var self = this;
$('input[id^="opanda_user_role_"]').each(function(){
self.toggle.call(this);
});
$('input[id^="opanda_user_role_"]').change(function(){
self.toggle.call(this);
});
//fix checkbox
$('input[id^="opanda_allow_user_role_"]').change(function(){
$(this).val( $(this).is(':checked') ? 1 : 0 );
});
$(".permissions-set .help-block").click(function(){
var $checkbox = $(this).prev();
$checkbox.click();
});
},
toggle: function() {
var changeGroupId = $(this).attr('id');
if( $(this).is(':checked') )
$('#' + changeGroupId + '_options_group').fadeIn(200);
else {
$('#' + changeGroupId + '_options_group').find('input[id^="opanda_allow_user_role_"]')
.prop('checked', false);
$('#' + changeGroupId + '_options_group').fadeOut(200);
}
}
},
/** ---
* Terms & Policies Options
*/
text: {
init: function() {
$("#opanda_terms_enabled").change(function(){
if ( $(this).is(":checked") ) {
$("#page-opanda-terms-enabled-options").fadeIn();
$("#no-page-opanda-terms-enabled-options").fadeIn();
$(".factory-control-terms_use_pages").fadeIn();
} else {
$("#page-opanda-terms-enabled-options").hide();
$("#no-page-opanda-terms-enabled-options").hide();
if ( !$("#opanda_privacy_enabled").is(":checked") ) {
$(".factory-control-terms_use_pages").hide();
}
}
}).change();
$("#opanda_privacy_enabled").change(function(){
if ( $(this).is(":checked") ) {
$("#page-opanda-privacy-enabled-options").fadeIn();
$("#no-page-opanda-privacy-enabled-options").fadeIn();
$(".factory-control-terms_use_pages").fadeIn();
} else {
$("#page-opanda-privacy-enabled-options").hide();
$("#no-page-opanda-privacy-enabled-options").hide();
if ( !$("#opanda_terms_enabled").is(":checked") ) {
$(".factory-control-terms_use_pages").hide();
}
}
}).change();
$("#opanda_terms_use_pages").change(function(){
if ( $(this).is(":checked") ) {
$("#opanda-nopages-options").hide();
$("#opanda-pages-options").fadeIn();
} else {
$("#opanda-nopages-options").fadeIn();
$("#opanda-pages-options").hide();
}
}).change();
}
}
};
$(function(){
settings.init();
});
})(jQuery)

View File

@@ -0,0 +1,349 @@
if ( !window.bizpanda ) window.bizpanda = {};
if ( !window.bizpanda.statistics ) window.bizpanda.statistics = {};
(function($){
window.bizpanda.statistics = {
// default chart options that will be changed when the chart is drawing
defaultOptions: {
isStacked: true,
fontSize: 11,
legend: {
position: 'in',
format: 'dd MMM'
},
pointSize: 7,
lineWidth: 3,
tooltip: {
showColorCode: true,
textStyle: {fontSize: '11', color: '#333'}
},
colors: [],
hAxis: {
baselineColor: '#fff',
gridlines: {color: '#fff'},
textStyle: {fontSize: '11', color: '#333'},
format: 'dd MMM'
},
vAxis: {
baselineColor: '#111',
gridlines: {color: '#f6f6f6'},
textPosition: 'in',
textStyle: {fontSize: '11', color: '#333'}
},
chartArea: { height: '250', width: '100%', top: 0 }
},
init: function() {
var self = this;
this.initLockerSelectorPopup();
this.initButtonSelector();
this.initTypeSelector();
this.initDateRangeSelector();
$(window).resize(function(){
self.redrawChart();
});
},
initLockerSelectorPopup: function() {
var $popup = $("#opanda-locker-select-popup").appendTo( $("body") );
if ( $popup.length === 0 ) return;
var $overlap = $("#opanda-locker-select-overlap");
var $select = $("#opanda-locker-select");
var $menu = $("#adminmenuback");
$overlap.show();
$popup.show();
var updatePopupPosition = function(){
var height = $popup.innerHeight();
var width = $popup.innerWidth();
var windowWidth = $( window ).width();
var shift = ( $menu.is(":visible") ) ? $menu.innerWidth() : 0;
$popup.css({
'marginTop': -parseInt( height / 2 ) + "px",
'left': shift + ( ( windowWidth - shift - width ) / 2 ) + "px"
});
};
$(window).resize(function(){
updatePopupPosition();
});
$("#collapse-menu").click(function(){
updatePopupPosition();
});
updatePopupPosition();
$("#opanda-locker-select-submit").click(function(){
var defaultOption = $select.find(":selected").data('default');
if ( defaultOption ) {
$popup.remove();
$overlap.remove();
return;
}
window.location.href = $select.val();
return;
});
},
/**
* Inits buttons selector
*/
initButtonSelector: function() {
var self = this;
var activeSelectors = this.getDefaultSelectors();
$(".onp-sl-selector-item")
.addClass('opanda-inactive')
.removeClass('opanda-active');
for( var index in activeSelectors) {
$(".onp-sl-selector-" + activeSelectors[index])
.addClass('opanda-active')
.removeClass('opanda-inactive');
}
$(".onp-sl-selector-item").click(function(){
var selectorName = $(this).data("selector");
self.toggleSelector( selectorName );
return false;
});
},
/**
* Toggles a given selector.
*/
toggleSelector: function( selectorName ) {
var $item = $(".onp-sl-selector-" + selectorName);
if ( $item.hasClass('opanda-active') ) this.deactivateSelector( selectorName );
else this.activateSelector( selectorName );
},
/**
* Activates a given selector.
*/
activateSelector: function( selectorName ) {
$(".onp-sl-selector-" + selectorName)
.addClass('opanda-active')
.removeClass('opanda-inactive');
this.redrawChart();
},
/**
* Deactivates a given selector.
*/
deactivateSelector: function( selectorName ) {
$(".onp-sl-selector-" + selectorName)
.removeClass('opanda-active')
.addClass('opanda-inactive');
this.redrawChart();
},
savePreSelectedButtons: function() {
if ( !window.localStorage ) return;
var buttons = [];
$(".onp-sl-chart-item.active").each(function(){
var buttonName = $(this).data("button");
buttons.push(buttonName);
});
localStorage.setItem('onp-sl-chart-buttons', JSON.stringify(buttons) );
},
/**
* Returns default selectors.
*/
getDefaultSelectors: function() {
if ( !window.localStorage ) return window.opanda_default_selectors;
var selectors = localStorage.getItem( 'opanda-chart-selectors' );
if ( !selectors ) return window.opanda_default_selectors;
try {
selectors = JSON.parse( selectors );
if ( selectors.length === 0 ) return this.opanda_default_selectors;
} catch(ex) {
return this.opanda_default_selectors;
}
return selectors;
},
/**
* Inits types selector.
*/
initTypeSelector: function() {
var self = this;
$("#onp-sl-type-select button").click(function(){
var type = $(this).data('value');
$("#onp-sl-type-select button.active").removeClass("active");
if ( window.localStorage ) window.localStorage.setItem('admin-optinpanda-chart-type', type);
$(this).addClass("active");
self.drawChart(type);
$(document).find(".onp-chart-hint").hide();
$(document).find(".onp-chart-hint-" + type).fadeIn();
});
if ( window.localStorage ) {
var type = localStorage.getItem('admin-optinpanda-chart-type');
var btnType = '.type-' + type;
$("#onp-sl-type-select").find("button.active").removeClass('active');
$("#onp-sl-type-select").find(btnType).click();
}
},
/**
* Inits date range selector.
*/
initDateRangeSelector: function() {
var self = this;
$('#onp-sl-date-start')
.datepicker()
.bind('changeDate', function(ev){
$('#onp-sl-date-start').datepicker('hide');
});
$('#onp-sl-date-end')
.datepicker()
.bind('changeDate', function(ev){
$('#onp-sl-date-end').datepicker('hide');
});
$("#onp-sl-apply-dates").click(function(){
$(this).parents("form").submit();
return false;
});
},
/**
* Returns currently active selectors.
*/
getActiveSelectors: function() {
var result = [];
var activeItems = $(".onp-sl-selector-item.opanda-active");
activeItems.each(function(){
result.push( $(this).data('selector') );
});
if ( !result.length ) return false;
return result;
},
/**
* Draws the chart.
*/
drawChart: function ( params ) {
var data = [], index, button;
var options = $.extend({}, this.defaultOptions);
var chartType = params.type || 'line';
var chartFunction = 'LineChart';
this._params = params;
if ( 'area' === chartType ) {
chartFunction = 'AreaChart';
options.legend.position = 'in';
options.areaOpacity = 0.1;
}
else if ( 'column' === chartType ) {
options.legend.position = 'none';
chartFunction = 'ColumnChart';
}
else {
options.legend.position = 'none';
chartFunction = 'LineChart';
}
var activeSelectors = this.getActiveSelectors();
// Create the data table.
var dataTable = new google.visualization.DataTable();
var data = [];
var columns = [];
var colors = [];
columns.push({type: 'date', 'title': 'Date'});
// building the columns and colors
var row = window.chartData[0];
for ( var column in row ) {
if ( 'date' === column ) continue;
// if the page contains selectors
if ( activeSelectors && $.inArray( column, activeSelectors) === -1 ) continue;
// column & title
columns.push({type: 'number', 'title': row[column]['title']});
var color = 'PRIMARY_DARK' === row[column]['color']
? window.factory.factoryBootstrap331.colors.primaryDark
: row[column]['color'];
colors.push(color);
}
// building the data array
var data = [];
for( var rowIndex in window.chartData ) {
var row = window.chartData[rowIndex];
var chartRow = [ row['date']['value'] ];
for ( var column in row ) {
if ( 'date' === column ) continue;
// if the page contains selectors
if ( activeSelectors && $.inArray( column, activeSelectors) === -1 ) continue;
chartRow.push( row[column]['value'] );
}
data.push(chartRow);
}
for( var i in columns ) dataTable.addColumn( columns[i].type, columns[i].title );
options.colors = colors;
dataTable.addRows(data);
// Instantiate and draw our chart, passing in some options.
var chart = new google.visualization[chartFunction](document.getElementById('chart'));
chart.draw(dataTable, options);
},
redrawChart: function() {
this.drawChart( this._params );
}
};
$(function(){
window.bizpanda.statistics.init();
});
})(jQuery)

View File

@@ -0,0 +1,849 @@
if ( !window.bp ) window.bp = {};
(function($){
/**
* Condition Editor
*/
$.widget( "bp.bpConditionEditor", {
options: {
filters: null
},
_create: function() {
var self = this;
this._counter = 0;
this._$editor = this.element;
this._$editor.data('bp-api', this);
this._$filters = this._$editor.find(".bp-filters");
this._$tmplFilter = this._$editor.find(".bp-filter.bp-template").clone().removeClass("bp-template");
this._$btnAdd = this._$editor.find(".bp-add-filter");
this._$btnAdd.click(function(){ self.addFilter(); return false; });
this._$editor.on('bp.filters-changed', function(){
self._checkIsEmpty();
});
this._load();
this._checkIsEmpty();
},
_load: function() {
if ( this.options.filters ) {
for ( var index in this.options.filters ) {
this.addFilter( this.options.filters[index]);
}
}
},
_checkIsEmpty: function() {
if ( this.getCount() === 0 ) {
this._$editor.addClass('bp-empty');
} else {
this._$editor.removeClass('bp-empty');
}
},
addFilter: function( data ) {
if ( !data ) data = {type: 'showif'};
var self = this;
var $filter = this._$tmplFilter.clone();
this._$filters.append( $filter );
$filter.data('bp-editor', this._$editor);
this._counter = this._counter + 1;
$filter.bpConditionFilter({
index: self._counter,
type: data.type,
conditions: data.conditions
});
self._$editor.trigger('bp.filters-changed');
return $filter;
},
getData: function() {
var filters = [];
this._$filters.find(".bp-filter").each(function(){
var definition = $(this).bpConditionFilter('getData');
filters.push(definition);
});
return filters;
},
getCount: function() {
return this._$editor.find('.bp-filter:not(.bp-template)').length;
}
});
/**
* Condition Filter
*/
$.widget( "bp.bpConditionFilter", {
options: {
type: 'showif',
conditions: null,
index: null
},
_create: function() {
var self = this;
this._counter = 0;
this._index = this.options.index;
this._$filter = this.element;
this._$filter.data('bp-api', this);
this._$editor = this._$filter.data('bp-editor');
this._$conditions = this._$filter.find(".bp-conditions");
this._$tmplCondition = this._$editor.find(".bp-condition.bp-template").clone().removeClass("bp-template");
this._$tmplScope = this._$editor.find(".bp-scope.bp-template").clone().removeClass("bp-template");
this._load();
this._$filter.find(".bp-link-add").click(function(){
self.addCondition();
return false;
});
this._$filter.find(".btn-remove-filter").click(function(){
self._$filter.remove();
self._$editor.trigger('bp.filters-changed');
return false;
});
this._$filter.find(".bp-btn-apply-template").click(function(){
var templateName = $(".bp-select-template").val();
if ( templateName ) {
var data = self.getTemplateData(templateName);
if ( data ) self.setFilterData( data );
}
return false;
});
this._$filter.on('bp.conditions-changed', function(){
self._checkIsEmpty();
});
},
_load: function() {
if ( !this.options.conditions ) {
this.addCondition();
} else {
this.setFilterData(this.options);
}
},
setFilterData: function( data ) {
this._$filter.find('.bp-condition').remove();
if ( data.conditions ) {
for ( var index in data.conditions ) {
this.addCondition( data.conditions[index] );
}
}
this._$filter.find(".bp-filter-type").val(data.type);
this._checkIsEmpty();
},
_checkIsEmpty: function() {
if ( this.getCount() === 0 ) {
this._$filter.addClass('bp-empty');
} else {
this._$filter.removeClass('bp-empty');
}
this._$conditions.find('.bp-scope').each(function(){
var count = $(this).find('.bp-condition').length;
if ( count === 0 )$(this).remove();
});
},
addCondition: function( data, $scope ) {
if ( !data ) data = {type: 'condition'};
if ( data.type === 'scope' ) {
this.addScope( data );
} else if ( data.type === 'condition' && !$scope ) {
var $scope = this.addScope();
this.addCondition( data, $scope );
} else {
var $condition = this._$tmplCondition.clone();
$scope.append( $condition );
$condition.data('bp-scope', $scope);
$condition.data('bp-editor', this._$editor);
$condition.data('bp-filter', this._$filter);
this._counter = this._counter + 1;
data.index = this._index + '_' + this._counter;
$condition.bpCondition( data );
this._$filter.trigger('bp.conditions-changed');
}
},
addScope: function( data ) {
if ( !data ) data = {};
var $scope = this._$tmplScope.clone();
this._$conditions.append($scope);
if ( data && data.conditions ) {
for ( var index in data.conditions ) {
this.addCondition( data.conditions[index], $scope );
}
}
return $scope;
},
getData: function() {
var scopes = [];
this._$conditions.find('.bp-scope').each(function(){
var scope = {
type: 'scope',
conditions: []
};
scopes.push(scope);
$(this).find('.bp-condition').each(function(){
var condition = $(this).bpCondition('getData');
scope.conditions.push( condition );
});
});
var filterType = this._$filter.find(".bp-filter-type").val();
return {
conditions: scopes,
type: filterType
};
},
getCount: function() {
return this._$filter.find('.bp-condition').length;
},
getTemplateData: function( paramName ) {
if ( !window.bp ) return;
if ( !window.bp.templates ) return;
for ( var index in window.bp.templates ) {
var data = window.bp.templates[index];
if ( data['id'] === paramName ) return data['filter'];
}
return false;
}
});
/**
* Condition
*/
$.widget( "bp.bpCondition", {
options: {
index: null
},
_create: function() {
this._index = this.options.index;
this._$condition = this.element;
this._$condition.data('bp-condition', this);
this._$editor = this._$condition.data('bp-editor');
this._$filter = this._$condition.data('bp-filter');
this._$scope = this._$condition.data('bp-scope');
this._editor = this._$editor.data('bp-api');
this._filter = this._$filter.data('bp-api');
this._$hint = this.element.find(".bp-hint");
this._$hintContent = this.element.find(".bp-hint-content");
this._$tmplDateControl = this._$editor.find(".bp-date-control.bp-template").clone().removeClass("bp-template");
},
_init: function() {
var self = this;
this._$condition.find(".bp-param-select").change(function(){ self.prepareFields(); });
self.prepareFields( true );
// buttons
this._$condition.find(".bp-btn-remove").click(function(){
self.remove();
return false;
});
this._$condition.find(".bp-btn-or").click(function(){
self._filter.addCondition( null, self._$scope );
return false;
});
this._$condition.find(".bp-btn-and").click(function(){
self._filter.addCondition();
return false;
});
},
remove: function() {
this._$condition.remove();
this._$filter.trigger('bp.conditions-changed');
},
getData: function() {
var currentParam = this._$condition.find(".bp-param-select").val();
var paramOptions = this.getParamOptions( currentParam );
var $operator = this._$condition.find(".bp-operator-select");
var currentOperator = $operator.val();
var value = null;
if ( 'select' === paramOptions['type'] ) {
value = this.getSelectValue( paramOptions );
} else if ( 'date' === paramOptions['type'] ) {
value = this.getDateValue( paramOptions );
} else if ( 'integer' === paramOptions['type'] ) {
value = this.getIntegerValue( paramOptions );
} else {
value = this.getTextValue( paramOptions );
}
return {
param: currentParam,
operator: currentOperator,
type: paramOptions['type'],
value: value
};
},
prepareFields: function( isInit ) {
var self = this;
if ( isInit && this.options.param ) {
this.selectParam( this.options.param );
}
var currentParam = this._$condition.find(".bp-param-select").val();
var paramOptions = this.getParamOptions( currentParam );
this.setParamHint(paramOptions.description);
var operators = [];
if ( 'select' === paramOptions['type'] || paramOptions['onlyEquals'] ) {
operators = ['equals', 'notequal'];
} else if ( 'date' === paramOptions['type'] ) {
operators = ['equals', 'notequal', 'younger', 'older', 'between'];
} else if ( 'integer' === paramOptions['type'] ) {
operators = ['equals', 'notequal', 'less', 'greater', 'between'];
} else {
operators = ['equals', 'notequal', 'contains', 'notcontain'];
}
this.setOperators(operators);
if ( isInit && this.options.operator ) {
this.selectOperator( this.options.operator );
}
this.createValueControl( paramOptions, isInit );
},
/**
* Displays and configures the param hint.
*/
setParamHint: function( description ) {
if ( description ) {
this._$hintContent.html(description);
this._$hint.show();
} else {
this._$hint.hide();
}
},
/**
* Creates control to specify value.
*/
createValueControl: function( paramOptions, isInit ) {
if ( 'select' === paramOptions['type'] ) {
this.createValueAsSelect( paramOptions, isInit );
} else if ( 'date' === paramOptions['type'] ) {
this.createValueAsDate( paramOptions, isInit );
} else if ( 'integer' === paramOptions['type'] ) {
this.createValueAsInteger( paramOptions, isInit );
} else {
this.createValueAsText( paramOptions, isInit );
}
},
// -------------------
// Select Control
// -------------------
/**
* Creates the Select control.
*/
createValueAsSelect: function( paramOptions, isInit ) {
var self = this;
var createSelect = function( values ) {
var $select = self.createSelect( values );
self.insertValueControl( $select );
if ( isInit && self.options.value ) self.setSelectValue( self.options.value );
};
if ( !paramOptions['values'] ) return;
if ( 'ajax' === paramOptions['values']['type'] ) {
var $fakeSelect = self.createSelect( [{value: null, title: '- loading -'}] );
self.insertValueControl( $fakeSelect );
$fakeSelect.attr('disabled', 'disabled');
$fakeSelect.addClass('bp-fake-select');
if ( isInit && this.options.value ) {
$fakeSelect.data('value', this.options.value);
}
var req = $.ajax({
url: window.ajaxurl,
data: {
action: paramOptions['values']['action']
},
dataType: 'json',
success: function( data ) {
if ( data.error ) {
self.advancedOptions.showError( data.error );
return;
} else if ( !data.values ) {
self.advancedOptions.showError( req.responseText );
return;
}
createSelect( data.values );
},
error: function() {
self.advancedOptions.showError( 'Unexpected error during the ajax request.' );
},
complete: function() {
if ( $fakeSelect ) $fakeSelect.remove();
$fakeSelect = null;
}
});
} else {
createSelect( paramOptions['values'] );
}
},
/**
* Returns a value for the select control.
*/
getSelectValue: function() {
var $select = this._$condition.find(".bp-value select");
var value = $select.val();
if ( !value ) value = $select.data('value');
return value;
},
/**
* Sets a select value.
*/
setSelectValue: function( value ) {
var $select = this._$condition.find(".bp-value select");
if ( $select.hasClass('.bp-fake-select') ) {
$select.data('value', value);
} else {
$select.val(value);
}
},
// -------------------
// Date Control
// -------------------
/**
* Creates a control for the input linked with the date.
*/
createValueAsDate: function( paramOptions, isInit ) {
var $operator = this._$condition.find(".bp-operator-select");
var $control = this._$tmplDateControl.clone();
$operator.change(function(){
var currentOperator = $operator.val();
if ( 'between' === currentOperator ) {
$control.addClass('bp-between');
$control.removeClass('bp-solo');
} else {
$control.addClass('bp-solo');
$control.removeClass('bp-between');
}
});
$operator.change();
var $radioes = $control.find(".bp-switcher input")
.attr('name', 'bp_switcher_' + this._index)
.click(function(){
var value = $control.find(".bp-switcher input:checked").val();
if ( 'relative' === value ) {
$control.addClass('bp-relative');
$control.removeClass('bp-absolute');
} else {
$control.addClass('bp-absolute');
$control.removeClass('bp-relative');
}
});
$control.find(".bp-absolute-date input[type='text']").datepicker({
format: 'dd.mm.yyyy',
todayHighlight: true,
autoclose: true
});
this.insertValueControl( $control );
if ( isInit && this.options.value ) this.setDateValue( this.options.value );
},
/**
* Returns a value for the Date control.
* @returns {undefined}
*/
getDateValue: function() {
var value = {};
var $operator = this._$condition.find(".bp-operator-select");
var currentOperator = $operator.val();
var $control = this._$condition.find(".bp-value > .bp-date-control");
var $holder = this._$condition.find(".bp-value > .bp-date-control");
if ( 'between' === currentOperator ) {
$holder = $holder.find(".bp-between-date");
value.range = true;
value.start = {};
value.end = {};
if ( $control.hasClass('bp-relative') ) {
$holder = $holder.find(".bp-relative-date");
value.start.unitsCount = $holder.find(".bp-date-value-start").val();
value.end.unitsCount = $holder.find(".bp-date-value-end").val();
value.start.units = $holder.find(".bp-date-start-units").val();
value.end.units = $holder.find(".bp-date-end-units").val();
value.start.type = 'relative';
value.end.type = 'relative';
} else {
$holder = $holder.find(".bp-absolute-date");
value.start = $holder.find(".bp-date-value-start").datepicker('getUTCDate').getTime();
value.end = $holder.find(".bp-date-value-end").datepicker('getUTCDate').getTime();
value.end = value.end + ( ( ( 23 * 60 * 60 ) + ( 59 * 60 ) + 59 ) * 1000 ) + 999;
}
} else {
$holder = $holder.find(".bp-solo-date");
value.range = false;
if ( $control.hasClass('bp-relative') ) {
$holder = $holder.find(".bp-relative-date");
value.type = 'relative';
value.unitsCount = $holder.find(".bp-date-value").val();
value.units = $holder.find(".bp-date-value-units").val();
} else {
$holder = $holder.find(".bp-absolute-date");
value = $holder.find("input[type='text']").datepicker('getUTCDate').getTime();
if ( 'older' === currentOperator ) {
value = value + ( ( ( 23 * 60 * 60 ) + ( 59 * 60 ) + 59 ) * 1000 ) + 999;
}
}
}
return value;
},
/**
* Sets a select value.
*/
setDateValue: function( value ) {
if ( !value ) value = {};
var $holder = this._$condition.find(".bp-value > .bp-date-control");
var $control = this._$condition.find(".bp-value > .bp-date-control");
if ( value.range ) {
if ( 'relative' === value.start.type ) {
$holder = $holder.find(".bp-relative-date");
$holder.find(".bp-date-value-start").val(value.start.unitsCount);
$holder.find(".bp-date-value-end").val(value.end.unitsCount);
$holder.find(".bp-date-start-units").val(value.start.units);
$holder.find(".bp-date-end-units").val(value.end.units);
} else {
$holder = $holder.find(".bp-absolute-date");
var start = new Date(value.start);
var end = new Date(value.end);
$holder.find(".bp-date-value-start").datepicker('setUTCDate', start);
$holder.find(".bp-date-value-end").datepicker('setUTCDate', end);
}
} else {
if ( 'relative' === value.type ) {
$holder = $holder.find(".bp-relative-date");
$holder.find(".bp-date-value").val(value.unitsCount);
$holder.find(".bp-date-value-units").val(value.units);
} else {
$holder = $holder.find(".bp-absolute-date");
var date = new Date(value);
$holder.find(".bp-date-value").datepicker('setUTCDate', date);
}
}
var $relative = $control.find(".bp-switcher input[value=relative]");
var $absolute = $control.find(".bp-switcher input[value=absolute]");
if ( 'relative' === value.type || ( value.start && 'relative' === value.start.type ) ) {
$relative.attr('checked', 'checked');
$relative.click();
} else {
$absolute.attr('checked', 'checked');
$absolute.click();
}
},
// -------------------
// Integer Control
// -------------------
/**
* Creates a control for the input linked with the integer.
*/
createValueAsInteger: function( paramOptions, isInit ) {
var self = this;
var $operator = this._$condition.find(".bp-operator-select");
$operator.on('change', function(){
var currentOperator = $operator.val();
var $control;
if ( 'between' === currentOperator ) {
$control = $("<span><input type='text' class='bp-integer bp-integer-start' /> and <input type='text' class='bp-integer bp-integer-end' /></span>");
} else {
$control = $("<input type='text' class='bp-integer bp-integer-solo' /></span>");
}
self.insertValueControl( $control );
});
$operator.change();
if ( isInit && this.options.value ) this.setIntegerValue( this.options.value );
},
/**
* Returns a value for the Integer control.
*/
getIntegerValue: function() {
var value = {};
var $operator = this._$condition.find(".bp-operator-select");
var currentOperator = $operator.val();
if ( 'between' === currentOperator ) {
value.range = true;
value.start = this._$condition.find(".bp-integer-start").val();
value.end = this._$condition.find(".bp-integer-end").val();
} else {
value = this._$condition.find(".bp-integer-solo").val();
}
return value;
},
/**
* Sets a value for the Integer control.
*/
setIntegerValue: function( value ) {
if ( !value ) value = {};
if ( value.range ) {
this._$condition.find(".bp-integer-start").val(value.start);
this._$condition.find(".bp-integer-end").val(value.end);
} else {
this._$condition.find(".bp-integer-solo").val(value);
}
},
// -------------------
// Text Control
// -------------------
/**
* Creates a control for the input linked with the integer.
*/
createValueAsText: function( paramOptions, isInit ) {
var $control = $("<input type='text' class='bp-text' /></span>");
this.insertValueControl( $control );
if ( isInit && this.options.value ) this.setTextValue( this.options.value );
},
/**
* Returns a value for the Text control.
* @returns {undefined}
*/
getTextValue: function() {
return this._$condition.find(".bp-text").val();
},
/**
* Sets a value for the Text control.
*/
setTextValue: function( value ) {
this._$condition.find(".bp-text").val(value);
},
// -------------------
// Helper Methods
// -------------------
selectParam: function( value ) {
this._$condition.find(".bp-param-select").val(value);
},
selectOperator: function( value ) {
this._$condition.find(".bp-operator-select").val(value);
},
setOperators: function( values ) {
var $operator = this._$condition.find(".bp-operator-select");
$operator.off('change');
$operator.find("option").hide();
for ( var index in values ) {
$operator.find("option[value='" + values[index] + "']").show();
}
},
insertValueControl: function( $control ) {
this._$condition.find(".bp-value").html("").append($control);
},
getParamOptions: function( paramName ) {
if ( !window.bp ) return;
if ( !window.bp.filtersParams ) return;
for ( var index in window.bp.filtersParams ) {
var paramOptions = window.bp.filtersParams[index];
if ( paramOptions['id'] === paramName ) return paramOptions;
}
return false;
},
createSelect: function( values, attrs ) {
var $select = $("<select></select>");
if ( attrs ) $select.attr( attrs );
for ( var index in values ){
var item = values[index];
var $option = $("<option></option>")
.attr('value', item['value'])
.text(item['title']);
$select.append( $option );
}
return $select;
},
createDataPircker: function() {
var $control = $('<div class="bp-date-control" data-date="today"></div>');
var $input = $('<input size="16" type="text" readonly="readonly" />');
var $icon = $('<i class="fa fa-calendar"></i>');
$control.append($input);
$control.append($icon);
var $datepicker = $input.datepicker({
autoclose: true,
format: 'dd/mm/yyyy'
});
$control.data('bp-datepicker', $datepicker);
$icon.click(function(){
$input.datepicker('show');
});
$control.on('changeDate', function(ev){
$input.datepicker('hide');
});
return $control;
}
});
})(jQuery);