first commit

This commit is contained in:
alazhar
2020-01-02 23:15:16 +07:00
commit eda9661806
3433 changed files with 595883 additions and 0 deletions

View File

@ -0,0 +1,29 @@
.colorpicker{width:356px;height:176px;overflow:hidden;position:absolute;background:url(../images/colorpicker/colorpicker_background.png);font-family:Arial, Helvetica, sans-serif;z-index:9999;display:none;}
.colorpicker_color{width:150px;height:150px;left:14px;top:13px;position:absolute;background:#f00;overflow:hidden;cursor:crosshair;}
.colorpicker_color div{position:absolute;top:0;left:0;width:150px;height:150px;background:url(../images/colorpicker/colorpicker_overlay.png);}
.colorpicker_color div div{position:absolute;top:0;left:0;width:11px;height:11px;overflow:hidden;background:url(../images/colorpicker/colorpicker_select.gif);margin:-5px 0 0 -5px;}
.colorpicker_hue{position:absolute;top:13px;left:171px;width:35px;height:150px;cursor:n-resize;}
.colorpicker_hue div{position:absolute;width:35px;height:9px;overflow:hidden;background:url(../images/colorpicker/colorpicker_indic.gif) left top;margin:-4px 0 0 0;left:0px;}
.colorpicker_new_color{position:absolute;width:60px;height:30px;left:213px;top:13px;background:#f00;}
.colorpicker_current_color{position:absolute;width:60px;height:30px;left:283px;top:13px;background:#f00;}
.colorpicker input{background-color:transparent;border:1px solid transparent;position:absolute;font-size:10px;font-family:Arial, Helvetica, sans-serif;color:#898989;top:4px;right:11px;text-align:right;margin:0;padding:0;height:15px;}
.colorpicker_hex{position:absolute;width:72px;height:22px;background:url(../images/colorpicker/colorpicker_hex.png) top;left:212px;top:142px;}
.colorpicker_hex input{right:6px;}
.colorpicker_field{height:22px;width:62px;background-position:top;position:absolute;}
.colorpicker_field span{position:absolute;width:12px;height:22px;overflow:hidden;top:0;right:0;cursor:n-resize;}
.colorpicker_rgb_r{background-image:url(../images/colorpicker/colorpicker_rgb_r.png);top:52px;left:212px;}
.colorpicker_rgb_g{background-image:url(../images/colorpicker/colorpicker_rgb_g.png);top:82px;left:212px;}
.colorpicker_rgb_b{background-image:url(../images/colorpicker/colorpicker_rgb_b.png);top:112px;left:212px;}
.colorpicker_hsb_h{background-image:url(../images/colorpicker/colorpicker_hsb_h.png);top:52px;left:282px;}
.colorpicker_hsb_s{background-image:url(../images/colorpicker/colorpicker_hsb_s.png);top:82px;left:282px;}
.colorpicker_hsb_b{background-image:url(../images/colorpicker/colorpicker_hsb_b.png);top:112px;left:282px;}
.colorpicker_submit{position:absolute;width:22px;height:22px;background:url(../images/colorpicker/colorpicker_submit.png) top;left:322px;top:142px;overflow:hidden;}
.colorpicker_focus{background-position:center;}
.colorpicker_hex.colorpicker_focus{background-position:bottom;}
.colorpicker_submit.colorpicker_focus{background-position:bottom;}
.colorpicker_slider{background-position:bottom;}
.color_selector{width:104px;height:33px;background:url('../images/colorpicker/color-picker-container.png') no-repeat center center;}
.color_selector .color_picker{position:relative;float:left;width:34px;height:33px;background:url("../images/colorpicker/color_picker.png") no-repeat center center;}
.color_selector .color_picker div{position:absolute;top:8px;left:9px;width:16px;height:16px;background:url("../images/colorpicker/colocpicker_select.png") center;}
.color_selector input[type=text]{margin: 1px 1px 1px 1px;padding: 0px;width: 60px;min-width: 60px;height: 31px;border: 0px;border-radius: 0px;background: none;text-align: center;font-size: 11px;}

View File

@ -0,0 +1,39 @@
.tw-metaboxes th span {
display: block;
margin-top: 5px;
color: #B9B9B9;
}
.tw-metaboxes input[type="text"], .tw-metaboxes textarea {
width: 75%;
margin-right: 20px;
}
.gallery-thumbs li {
float: left;
margin-right: 10px;
}
.tw-metaboxes .type_layout a {
text-indent: -9999px;
height: 92px;
width: 92px;
float: left;
margin-right: 20px;
background: url(../images/select_layout.png) no-repeat;
}
.type_layout a.left-sidebar {
background-position: 0 0;
}
.type_layout a.without-sidebar {
background-position: -111px 0;
}
.type_layout a.right-sidebar {
background-position: -220px 0;
}
.type_layout .left-sidebar.active {
background-position: 0 -94px;
}
.type_layout .without-sidebar.active {
background-position: -111px -94px;
}
.type_layout .right-sidebar.active {
background-position: -220px -94px;
}

View File

@ -0,0 +1,997 @@
/* START - Clearfix */
.clearfix:after {
content: ".";
display: block;
clear: both;
visibility: hidden;
line-height: 0;
height: 0;
}
.clearfix {
display: inline-block;
}
html[xmlns] .clearfix {
display: block;
}
* html .clearfix {
height: 1%;
}
a:focus, a:active{
outline: none;
}
/* END - Clearfix */
/* START - Pagebuilder */
#cmeta_pagebuilder h3.hndle span{
font-family: Arial;
font-weight: bold;
font-size: 14px;
color:#333;
}
#cmeta_pagebuilder h3.hndle{
}
#pagebuilder-select-layout label strong{
font-family: Arial;
font-size: 14px;
line-height: 28px;
color: #333;
font-weight: bold;
}
#pagebuilder-select-layout label span{
font-family: Arial;
font-size: 11px;
line-height: 18px;
color: #9c9c9c;
}
#pagebuilder-area{
border-top: 1px solid #DFDFDF;
background: #fff;
}
#pagebuilder-area>div{
padding: 1%;
position: relative;
min-height: 200px;
float: left;
}
#pagebuilder-area>div.builder-area.size-1-4>.item{
width: 97.8%;
}
#pagebuilder-area>div.builder-area.size-1-4>.item>.list>.size-sizer-container{
display: none;
}
#pagebuilder-area>div.builder-area.size-1-4>.item>.list>.name{
margin-left: -35px;
}
#pagebuilder-area>div.builder-area.left-sidebar{
border-left: 1px solid #DFDFDF;
}
#pagebuilder-area>div.builder-area.right-sidebar{
border-right: 1px solid #DFDFDF;
}
#pagebuilder-area>div.placeholder.size-1-1{
border: none;
position: relative;
display: block;
}
#pagebuilder-elements-container>.item>.list, #pagebuilder-elements-container>.item>.data,
#pagebuilder-area .builder-area>.item>.thumb, #pagebuilder-area .builder-area>.item>.data{
display: none;
}
/* Themewaves pb Start*/
#poststuff #cmeta_pagebuilder .inside{
background-color: #f9f9f9;
margin: 0;
padding: 0;
}
.pagebuilder-head-container{
padding: 30px 20px 10px 20px;
}
.tw-template-container{
padding: 0 20px;
}
div.tw-one{
vertical-align: top;
display: inline-block;
max-width: 20%;
margin-right: 4%;
}
div.tw-one h4{
color:#333;
font-family: Arial;
font-size: 14px;
line-height: 28px;
margin: 0 0 10px 0;
}
div.tw-two{
display: inline-block;
max-width: 74%;
}
div.tw-two .sidebar{
text-indent: -9999px;
height: 92px;
width: 92px;
float: left;
margin-right: 20px;
background: url(../images/select_layout.png) no-repeat;
}
div.tw-two .sidebar.left-sidebar{
background-position: 0 0;
}
div.tw-two .sidebar.right-sidebar{
background-position: -220px 0;
}
div.tw-two .sidebar.full{
background-position: -111px 0;
}
div.tw-two .sidebar.left-sidebar.active{
background-position: 0 -94px;
}
div.tw-two .sidebar.right-sidebar.active{
background-position: -220px -94px;
}
div.tw-two .sidebar.full.active{
background-position: -111px -94px;
}
/* Themewaves Items CSS*/
#pagebuilder-elements-container>.item{
width: auto;
float: left;
margin-right: 10px;
margin-bottom: 10px;
cursor: pointer;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
background: #333;
background: -webkit-gradient(linear, left bottom, left top, from(#65b6fc), to(#b3e1ff));
background: -moz-linear-gradient(bottom, #65b6fc, #b3e1ff);
color: #ffffff;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#65b6fc', endColorstr='#b3e1ff');
-webkit-box-shadow: 0 2px 4px rgba(1,1,1,.1), inset 0 1px rgba(255,255,255,.6);
-moz-box-shadow: 0 2px 4px rgba(1,1,1,.1), inset 0 1px rgba(255,255,255,.6);
box-shadow: 0 2px 4px rgba(1,1,1,.1), inset 0 1px rgba(255,255,255,.6);
border: solid 1px #6395c0;
}
#pagebuilder-elements-container>.item:active{
background-color: #8ac8fc;
-webkit-box-shadow: 0 2px 4px rgba(1,1,1,.1), inset 0 1px 6px rgba(0,0,0,.25);
-moz-box-shadow: 0 2px 4px rgba(1,1,1,.1), inset 0 1px 6px rgba(0,0,0,.25);
box-shadow: 0 2px 4px rgba(1,1,1,.1), inset 0 1px 6px rgba(0,0,0,.25);
cursor: move;
}
#pagebuilder-elements-container>.item:hover,.ui-dialog-buttonpane.ui-widget-content.ui-helper-clearfix .ui-dialog-buttonset button.ui-state-default:hover, .tw-pb-main-container input[type="button"]:hover{
background: -webkit-gradient(linear, left bottom, left top, from(#78befb), to(#c6e9ff));
background: -moz-linear-gradient(bottom, #78befb, #b3e1ff);
color: #ffffff;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#78befb', endColorstr='#c6e9ff');
-webkit-box-shadow: 0 1px #fff, inset 0 1px rgba(255,255,255,.6);
-moz-box-shadow: 0 1px #fff, inset 0 1px rgba(255,255,255,.6);
box-shadow: 0 1px #fff, inset 0 1px rgba(255,255,255,.6);
}
#pagebuilder-elements-container>.item .thumb{
position: relative;
color: #FFF;
font-size: 13px;
font-weight: bold;
font-family: Arial;
line-height: 28px;
padding: 4px 12px 4px 37px;
}
#pagebuilder-elements-container>.item span{
width: 30px;
height: 30px;
background: url(../images/themewaves-elements.png) no-repeat center left;
text-indent: -99999px;
background-position: -10px -14px;
display: block;
position: absolute;
left: 10px;
}
#pagebuilder-elements-container>.item span.blog{
background-position: -140px -14px;
}
#pagebuilder-elements-container>.item span.carousel{
background-position: -453px -14px;
}
#pagebuilder-elements-container>.item span.callout{
background-position: -11px -50px;
}
#pagebuilder-elements-container>.item span.column{
background-position: -229px -14px;
}
#pagebuilder-elements-container>.item span.column_service{
background-position: -272px -50px;
}
#pagebuilder-elements-container>.item span.content{
background-position: -50px -50px;
}
#pagebuilder-elements-container>.item span.divider{
background-position: -95px -50px;
}
#pagebuilder-elements-container>.item span.image_slider{
background-position: -187px -50px;
}
#pagebuilder-elements-container>.item span.message_box{
background-position: -410px -14px;
}
#pagebuilder-elements-container>.item span.portfolio{
background-position: -365px -50px;
}
#pagebuilder-elements-container>.item span.pricing_table{
background-position: -498px -14px;
}
#pagebuilder-elements-container>.item span.progress_bar{
background-position: -278px -14px;
}
#pagebuilder-elements-container>.item span.recent_posts{
background-position: -141px -50px;
}
#pagebuilder-elements-container>.item span.sidebar{
background-position: -365px -14px;
}
#pagebuilder-elements-container>.item span.slider{
background-position: -232px -50px;
}
#pagebuilder-elements-container>.item span.tab{
background-position: -322px -14px;
}
#pagebuilder-elements-container>.item span.team{
background-position: -52px -14px;
}
#pagebuilder-elements-container>.item span.testimonials{
background-position: -95px -14px;
}
#pagebuilder-elements-container>.item span.toggle{
background-position: -410px -50px;
}
#pagebuilder-elements-container>.item span.twitter{
background-position: -322px -50px;
}
#pagebuilder-elements-container>.item span.toggle{
background-position: -187px -14px;
}
#pagebuilder-elements-container>.item span.video{
background-position: -187px -14px;
}
#pagebuilder-area .builder-area>.item{
position: relative;
float: left;
margin-left: 0.9%;
margin-right: 0.9%;
margin-top: 5px;
margin-bottom: 5px;
font-family: sans-serif;
font-size: 11px;
font-weight: bold;
color: #737373;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
background-color: #f3f3f3;
-webkit-box-shadow: 0 2px 4px rgba(1,1,1,.1), inset 0 3px rgba(255,255,255,.4);
-moz-box-shadow: 0 2px 4px rgba(1,1,1,.1), inset 0 3px rgba(255,255,255,.4);
box-shadow: 0 2px 4px rgba(1,1,1,.1), inset 0 3px rgba(255,255,255,.4);
border: solid 1px #bebebe;
height: 38px;
min-width: 22.75%;
}
#pagebuilder-area .builder-area>.item a,#pagebuilder-area .builder-area>.item div.size{
display: block;
text-indent: -9999px;
width: 20px;
height: 20px;
background: url(../images/tw-page-builder-actions.png);
}
#pagebuilder-area .builder-area>.item div.size{
text-align: center;
color: #FFF;
line-height: 20px;
width: 40px;
text-indent: inherit;
background-position: -83px -6px;
}
#pagebuilder-area .builder-area>.item a.up{
float: left;
background-position: 0 0;
}
#pagebuilder-area .builder-area>.item a.up:hover{
background-position: 0 -20px;
}
#pagebuilder-area .builder-area>.item a.down{
background-position: -20px 0;
float: right;
width: 19px;
}
#pagebuilder-area .builder-area>.item a.down:hover{
background-position: -20px -20px;
}
#pagebuilder-area .builder-area>.item a.action-delete{
float: right;
background-position: -59px 0;
}
#pagebuilder-area .builder-area>.item a.action-delete:hover{
background-position: -59px -20px;
}
#pagebuilder-area .builder-area>.item a.action-duplicate{
float: left;
background-position: -40px 0;
width: 19px;
}
#pagebuilder-area .builder-area>.item a.action-duplicate:hover{
background-position: -40px -20px;
}
#pagebuilder-area .builder-area>.item a.action-edit{
width: 39px;
background-position: -127px -6px;
}
#pagebuilder-area .builder-area>.item a.action-edit:hover{
background-position: -171px -6px;
}
#pagebuilder-area .builder-area>.item>.list>div.name{
line-height: 36px;
color: #333;
font-family: Arial;
font-size: 13px;
font-weight: bold;
position: absolute;
left: 50px;
}
#pagebuilder-area .builder-area>.item.size-1-4>.list>div.name{
max-width: 82px;
padding-left: 0px;
overflow: hidden;
}
#pagebuilder-area .builder-area>.item>.list>div{
height: 100%;
float: left;
}
#pagebuilder-area .builder-area>.item>.list .sizer{
width: 39px;
}
#pagebuilder-area .builder-area>.item>.list>div.actions{
float: right;
width: 39px;
position: relative;
right: -1px;
top: -1px;
}
#pagebuilder-area .builder-area>.item>.list>div.size-sizer-container{
position: relative;
left: -1px;
top: -1px;
}
/* ThemeWaves Template Start */
.tw-template-container #template-save div.template{
position: relative;
display: inline-block;
*display: inline;
padding: 10px 20px 10px 30px;
color: #fff;
background-color: #65b6fc;
-webkit-box-shadow: inset 0 1px rgba(255,255,255,.6);
-moz-box-shadow: inset 0 1px rgba(255,255,255,.6);
box-shadow: inset 0 1px rgba(255,255,255,.6);
border: solid 1px #6395c0;
background-image: -webkit-linear-gradient(bottom, #65b6fc, #b3e1ff);
background-image: -moz-linear-gradient(bottom, #65b6fc, #b3e1ff);
background-image: -o-linear-gradient(bottom, #65b6fc, #b3e1ff);
background-image: -ms-linear-gradient(bottom, #65b6fc, #b3e1ff);
background-image: linear-gradient(to top, #65b6fc, #b3e1ff);
border-radius: 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
font-family: Arial;
font-size: 13px;
color: #fff;
font-weight: bold;
cursor: pointer;
}
.tw-template-container #template-save span.image-save{
left: 10px;
top: 12px;
position: absolute;
width: 14px;
height: 14px;
background: url(../images/template-save.png) no-repeat;
}
#template-save {
position: relative;
}
#template-save>.template-container{
display: none;
-webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, .15);
-moz-box-shadow: inset 0 1px 3px rgba(0,0,0,.15);
box-shadow: inset 0 1px 3px rgba(0, 0, 0, .15);
border: solid 1px #8F8F8F;
background-image: -webkit-linear-gradient(bottom, #969696, #C5C5C5);
background-image: -moz-linear-gradient(bottom, #969696, #C5C5C5);
background-image: -o-linear-gradient(bottom, #969696, #C5C5C5);
background-image: -ms-linear-gradient(bottom, #969696, #C5C5C5);
background-image: linear-gradient(to top, #969696, #C5C5C5);
position: absolute;
z-index: 999;
margin: 0;
top: 36px;
color: #ed1c24;
padding: 15px 15px 15px 10px;
}
#template-save>.template-container a{
color: #fff;
font-family: Arial;
cursor: pointer;
font-size: 12px;
line-height: 28px;
font-weight: bold;
}
#template-save>.template-container li{
position: relative;
margin: 0;
padding-left: 10px;
padding-right: 30px;
}
#template-save>.template-container li span{
position: absolute;
cursor: pointer;
right: 10px;
top: 6px;
font-size: 10px;
font-weight: bold;
}
#template-save>.template-container li:hover{
background: #333;
border-radius: 3px;
}
/* Grid */
.size-1-1{width:97.8%;}
.size-1-2{width:47.89%;}
.size-1-4{width:22.92%;}
.size-3-4{width:72.9%;}
.size-1-3{width:31.25%;}
.size-2-3{width:64.5%;}
.left-sidebar .size-1-1,.right-sidebar .size-1-1{width:97.5%;}
.left-sidebar .size-1-2,.right-sidebar .size-1-2{width:47.7%;}
.left-sidebar .size-1-4,.right-sidebar .size-1-4{width:22.75%;}
.left-sidebar .size-3-4,.right-sidebar .size-3-4{width:72.5%;}
.left-sidebar .size-1-3,.right-sidebar .size-1-3{width:31.05%;}
.left-sidebar .size-2-3,.right-sidebar .size-2-3{width:63.5%;}
/* Delete Modal */
#pb-delete-modal-container{
background: #FFF;
padding-top: 50px;
padding-bottom: 20px;
text-align: center;
color: #333;
min-height: 50px !important;
font-size: 19px;
font-weight: bold;
}
/* Modal */
.ui-dialog.tw-pb-main-container{
padding: 9px;
background-color: rgba(0, 0, 0, .6);
width: 660px !important;
font-family: Arial, "Lucida Grande", sans-serif;
font-weight: normal;
border-radius: 3px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
}
.field-item>.field-data .field .container-item{
margin-bottom: 15px;
}
.tw-pb-main-container .ui-dialog-titlebar{
height: 44px;
font-size: 14px;
font-family: Arial;
font-weight: bold;
color:#333;
-webkit-border-radius: 3px 3px 0 0;
-moz-border-radius: 3px 3px 0 0;
border-radius: 3px 3px 0 0;
background-color: #fbfbfb;
-webkit-box-shadow: 0 1px #6395c0, inset 0 1px rgba(255,255,255,.6);
-moz-box-shadow: 0 1px #6395c0, inset 0 1px rgba(255,255,255,.6);
box-shadow: 0 1px #6395c0, inset 0 1px rgba(255,255,255,.6);
background-image: -webkit-linear-gradient(bottom, #65b6fc, #b3e1ff);
background-image: -moz-linear-gradient(bottom, #65b6fc, #b3e1ff);
background-image: -o-linear-gradient(bottom, #65b6fc, #b3e1ff);
background-image: -ms-linear-gradient(bottom, #65b6fc, #b3e1ff);
background-image: linear-gradient(to top, #65b6fc, #b3e1ff);
}
.tw-pb-main-container .ui-dialog-titlebar span.ui-dialog-title{
padding: 14px 30px;
color: #fff;
display: inline-block;
}
.tw-pb-main-container .ui-dialog-titlebar-close{float: right;}
.tw-pb-main-container .ui-dialog-titlebar-close,.tw-pb-main-container .ui-dialog-titlebar-close>span,
.container-item .action-delete,.container-item>.list .action-expand>.closed,.container-item .action-duplicate, .container-item.expanded>.list .action-expand>.opened,.category-list-item .actions .action-delete{
padding: 10px;
background:url(../images/pb-close.png) no-repeat 15px 17px;
display: inline-block;
width: 20px;
height: 20px;
text-indent: -9999px;}
.category-list-item .actions .action-delete{
padding: 0;
background-position: 9px 6px;
}
.container-item .action-delete,.container-item .action-duplicate{
padding: 0;
margin-top: 10px;
width: 16px;
height: 16px;
position: absolute;
top: 4px;
}
.container-item .action-delete{
background-position: 4px -30px;
right: 5px;
}
.container-item .action-duplicate{
background-position: 4px -66px;
right: 25px;
}
.container-item>.list .action-expand>.closed{
padding: 0;
margin-top: 10px;
background-position: -29px -26px;
}
.container-item.expanded>.list .action-expand>.opened{
padding: 0;
margin-top: 10px;
background-position: -29px 2px;
}
.ui-dialog-buttonpane.ui-widget-content.ui-helper-clearfix{
position: relative;
border-top: 1px solid #e0e0e0;
background: #F5F5F5;
height: 78px;
}
.ui-dialog-buttonpane.ui-widget-content.ui-helper-clearfix .ui-dialog-buttonset{
position: absolute;
right: 30px;
top: 20px;
}
.ui-dialog-buttonpane .watch-tutorial{
display: block;
position: absolute;
text-indent: -9999px;
width: 173px;
height: 16px;
left: 30px;
top: 30px;
background: url(../images/watch-tutorial.png) no-repeat 0 0;
}
.ui-dialog-buttonpane.ui-widget-content.ui-helper-clearfix .ui-dialog-buttonset button.ui-state-default,.tw-pb-main-container input[type="button"]{
position: relative;
padding: 10px 17px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
color: #fff;
margin: 0;
margin-left: 10px;
background-color: #333;
-webkit-box-shadow: 0 2px 4px rgba(1, 1, 1, .1), inset 0 1px rgba(255, 255, 255, .6);
-moz-box-shadow: 0 2px 4px rgba(1,1,1,.1), inset 0 1px rgba(255,255,255,.6);
box-shadow: 0 2px 4px rgba(1, 1, 1, .1), inset 0 1px rgba(255, 255, 255, .6);
border: solid 1px #6395C0;
background-image: -webkit-linear-gradient(bottom, #65B6FC, #B3E1FF);
background-image: -moz-linear-gradient(bottom, #65B6FC, #B3E1FF);
background-image: -o-linear-gradient(bottom, #65B6FC, #B3E1FF);
background-image: -ms-linear-gradient(bottom, #65B6FC, #B3E1FF);
background-image: linear-gradient(to top, #65B6FC, #B3E1FF);
cursor: pointer;
}
.tw-pb-main-container input[type="button"]{
margin: 0;
}
.ui-dialog-buttonpane.ui-widget-content.ui-helper-clearfix .ui-dialog-buttonset button.ui-state-default span{
font-size: 13px;
font-weight: bold;
font-family: Arial;
color: #FFF;
}
.tw-pb-main-container .field-data input[type="text"]{
border: 1px solid #bebebe;
padding: 8px 10px;
min-width: 220px;
}
.tw-pb-main-container .general-field-container .field-data input[type="text"]{
min-width: 203px;
}
.tw-pb-main-container .general-field-container div.field-title,.tw-pb-main-container .general-field-container .field-item>.field-data{
width: auto;
}
.tw-pb-main-container .general-field-container{
position: relative;
border-bottom: 1px solid #e0e0e0;
background: #f5f5f5;
padding: 18px 0px 18px 30px;
}
.tw-pb-main-container .general-field-container .field-item{
width: 310px;
display: inline-block;
}
.tw-pb-main-container .general-field-container .field-desc{
display: none;
}
.field-item>div{
display: inline-block;
}
.field-item>div.field-title{
width: 120px;
font-family: Arial;
font-size: 12px;
font-weight: bold;
line-height: 28px;
color: #333;
}
.custom-field-container .field-item>div.field-title{
display: block;
width: auto;
vertical-align: top;
}
#shortcode_container_dialog.loading-shortcode .custom-field-container{
background-image: url('../../../assets/img/prettyPhoto/loader.gif');
background-repeat: no-repeat;
background-position: center;
min-height: 100px;
}
#shortcode_container_dialog .custom-field-container{
background: #fff;
margin-bottom: -20px;
padding-bottom: 20px;
}
#shortcode_container_dialog .general-field-container div.field-title{
line-height: 15px;
vertical-align: top;
margin-right: 30px;
padding-top: 10px;
}
.content .custom-field-container .field-item>div.field-data{
display: none;
}
.content .custom-field-container .field-item>div.field-title{
text-align: center;
}
.field-item>div.field-desc{
font-family: Arial;
font-size: 11px;
color: #9c9c9c;
vertical-align: top;
float: right;
width: 280px;
}
.field-item>.field-data{
width: 250px;
}
.field-item.type-color>.field-data{width: auto; position: relative;}
.field-item.type-color>.field-data>.color-view{position: absolute;display: none;z-index: 9999;left: 50%;}
.field-item.type-color>.field-data>.color-info{
background: url(../images/colorpicker/select.png) no-repeat;
width: 27px;
height: 27px;
position: absolute;
top: 4px;
right: 3px;
}
.field-item.type-color>.field-data>[data-type="color"]{background-color: #fff !important;color:#bebebe !important;}
.container-item>.list{
height: 34px;
line-height: 34px;
z-index: 9;
position: relative;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
background-color: #f3f3f3;
-webkit-box-shadow: inset 0 4px rgba(255,255,255,.4);
-moz-box-shadow: inset 0 4px rgba(255,255,255,.4);
box-shadow: inset 0 4px rgba(255,255,255,.4);
border: solid 1px #bebebe;
padding: 0px 20px 0px 40px;
color: #333333;
cursor: move;
}
.container-item>.content{
width: 558px;
position: relative;
top: -2px;
display: none;
border: 1px solid #dfdfdf;
background-color: #fff;
border-top: none;
padding: 20px;
}
.container-item.expanded>.content{
display: block;
}
.container-item>.list .name{
float: left;
font-family: Arial;
font-size: 13px;
line-height: 36px;
font-weight: bold;
}
.container-item>.list .actions{
position: absolute;
width: 95%;
left: 20px;
}
/* Font awesome on Page Builder */
#pb-modal-container .custom-field-container .field-item .field-data .fa-viewer{
display: inline-block;
}
#fontawesome_container_dialog .general-field-container .field-item{
width: 200px;
}
#fontawesome_container_dialog .general-field-container .field-item .field-data input[type="text"]{
width: 150px;
min-width: 100px;
}
#fontawesome_container_dialog .general-field-container div.field-title{
width: 140px;
}
.custom-field-container > div.field-item.type-fa .field-title{
display: none;
}
.custom-field-container > div.field-item{
padding: 20px 30px 0px 30px;
}
.custom-field-container > div.field-item:last-child{
margin-bottom: 20px;
}
.custom-field-container .content div.field-item{
display: inline-block;
width: 100%;
margin: 5px 0;
}
/* Column Editor Styling */
.tw-pb-main-container .field-item.type-textArea.editor>.field-data{
width: 600px;
}
.tw-pb-main-container .field-item.type-textArea.editor>.field-data textarea{
width: 597px;
border: none;
min-height: 200px;
}
.tw-pb-main-container .field-item.type-textArea.editor>.field-data .tw-editor-content{
border-width: 1px;
border-style: solid;
-webkit-border-top-right-radius: 3px;
-webkit-border-top-left-radius: 3px;
border-top-right-radius: 3px;
border-top-left-radius: 3px;
border-color: #CCC #CCC #DFDFDF;
}
/* DropDown Styling */
.tw-pb-main-container .field-item>.field-data{
position: relative;
min-height: 35px;
}
.tw-pb-main-container .field-item>.field-data>select{
position: absolute;
z-index: 8888;
opacity: 0;
width: 220px;
height: 36px;
left: 0;
}
.tw-pb-main-container .field-item>.field-data>.select-text{
left: 0;
color: #9c9c9c;
position: absolute;
padding: 10px 45px 10px 15px;
background: #FFF url('../images/pb-dropdown.png') no-repeat right 1px top 0px;
}
.tw-pb-main-container .field-item>.field-data>.category-list-container{
margin-top: 35px;
width: 600px;
}
/* List Item Styling */
.category-list-container .category-list-item{
position: relative;
min-width: 145px;
display: inline-block !important;
padding: 8px 20px;
color: #FFF;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
margin-top: 10px;
margin-right: 10px;
background-color: #333;
-webkit-box-shadow: inset 0 1px 5px rgba(0, 0, 0, .15);
-moz-box-shadow: inset 0 1px 5px rgba(0,0,0,.15);
box-shadow: inset 0 1px 5px rgba(0, 0, 0, .15);
border: solid 1px #8F8F8F;
background-image: -webkit-linear-gradient(bottom, #969696, #C5C5C5);
background-image: -moz-linear-gradient(bottom, #969696, #C5C5C5);
background-image: -o-linear-gradient(bottom, #969696, #C5C5C5);
background-image: -ms-linear-gradient(bottom, #969696, #C5C5C5);
background-image: linear-gradient(to top, #969696, #C5C5C5);
}
.category-list-container .category-list-item .name,.category-list-container .category-list-item .actions{
display: inline-block;
font-family: Arial;
font-size: 13px;
font-weight: bold;
line-height: 18px;
color: #FFF;
}
.category-list-container .category-list-item .actions{
position: absolute;
right: 10px;
}
/* CheckBox Styling */
.tw-pb-main-container .field-item.type-checkbox>.field-data>.checkbox-text{
width: 90px;
height: 36px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
background-color: #f3f3f3;
-webkit-box-shadow: 0 2px 4px rgba(1,1,1,.1), inset 0 4px rgba(255,255,255,.4);
-moz-box-shadow: 0 2px 4px rgba(1,1,1,.1), inset 0 4px rgba(255,255,255,.4);
box-shadow: 0 2px 4px rgba(1,1,1,.1), inset 0 4px rgba(255,255,255,.4);
}
.tw-pb-main-container .field-item.type-checkbox>.field-data>.checkbox-text>div{
height: 34px;
border-style: solid;
border-width: 1px;
border-color: #bebebe;
float: left;
font-family: Arial;
font-size: 12px;
line-height: 34px;
font-weight: bold;
text-align: center;
}
.tw-pb-main-container .field-item.type-checkbox>.field-data>.checkbox-text.checked-true>.checkbox-true{
width: 43px;
-webkit-border-radius: 3px 0 0 3px;
-moz-border-radius: 3px 0 0 3px;
border-radius: 3px 0 0 3px;
background-color: #fff;
-webkit-box-shadow: inset 0 2px rgba(255,255,255,.2);
-moz-box-shadow: inset 0 2px rgba(255,255,255,.2);
box-shadow: inset 0 2px rgba(255,255,255,.2);
border: solid 1px #6395c0;
background-image: -webkit-linear-gradient(bottom, #65b6fc, #b3e1ff);
background-image: -moz-linear-gradient(bottom, #65b6fc, #b3e1ff);
background-image: -o-linear-gradient(bottom, #65b6fc, #b3e1ff);
background-image: -ms-linear-gradient(bottom, #65b6fc, #b3e1ff);
background-image: linear-gradient(to top, #65b6fc, #b3e1ff);
}
.tw-pb-main-container .field-item.type-checkbox>.field-data>.checkbox-text.checked-true>.checkbox-false{
width: 44px;
border-left-width: 0px;
-webkit-border-radius: 0 3px 3px 0;
-moz-border-radius: 0 3px 3px 0;
border-radius: 0 3px 3px 0;
}
.tw-pb-main-container .field-item.type-checkbox>.field-data>.checkbox-text.checked-false>.checkbox-true{
width: 44px;
border-right-width: 0px;
-webkit-border-radius: 3px 0 0 3px;
-moz-border-radius: 3px 0 0 3px;
border-radius: 3px 0 0 3px;
}
.tw-pb-main-container .field-item.type-checkbox>.field-data>.checkbox-text.checked-false>.checkbox-false{
width: 43px;
border-color: #8f8f8f;
-webkit-border-radius: 0 3px 3px 0;
-moz-border-radius: 0 3px 3px 0;
border-radius: 0 3px 3px 0;
background-color: #fff;
-webkit-box-shadow: inset 0 1px 4px rgba(0,0,0,.15);
-moz-box-shadow: inset 0 1px 4px rgba(0,0,0,.15);
box-shadow: inset 0 1px 4px rgba(0,0,0,.15);
border: solid 1px #8f8f8f;
background-image: -webkit-linear-gradient(bottom, #969696, #c5c5c5);
background-image: -moz-linear-gradient(bottom, #969696, #c5c5c5);
background-image: -o-linear-gradient(bottom, #969696, #c5c5c5);
background-image: -ms-linear-gradient(bottom, #969696, #c5c5c5);
background-image: linear-gradient(to top, #969696, #c5c5c5);
}
.tw-pb-main-container .field-item.type-checkbox>.field-data{
display: inline-block;
float: right;
width: 90px;
height: 36px;
min-height: 24px;
cursor: pointer;
}
/* List Styling */
.list .custom-field-container .field-item>.field-title{
display: none;
}
.list .custom-field-container .content>.field-item.type-text>.field-desc{
display: block;
}
.list .custom-field-container .content>.field-item.type-text>.field-data{
width:250px;
}
/* Accordion Styling */
.accordion .custom-field-container .field-item>div.field-title,.accordion .custom-field-container .field-item>div.field-desc{
display: none;
}
.field-item.type-container>.field-data{
width: 600px;
}
.tw-pb-main-container textarea{
padding: 10px;
min-height: 85px;
min-width: 550px;
border: 1px solid #bebebe;
}
.tw-pb-main-container .custom-field-container textarea{
min-width: 550px;
}
.tw-pb-main-container .custom-field-container .type-container .type-checkbox{
position: absolute;
right: 30px;
top: 18px;
width: auto;
}
.tw-pb-main-container .custom-field-container .type-container .type-checkbox .field-title{
position: absolute;
right: 100px;
top: 4px;
width: 200px;
text-align: right;
display: block;
}
#pb-modal-container{
display: inline-block !important;
min-height: 400px !important;
width: 660px !important;
background: #FFF;
}
.ui-widget-overlay{
opacity: 0 !important;
}
/* Container Item - Toggle Styling */
.container-item>.list .action-expand>.opened,.container-item.expanded>.list .action-expand>.closed{display: none;}
.container-item>.list .action-expand>.closed,.container-item.expanded>.list .action-expand>.opened{display: block;}
/* Container Item - Image Slider Styling */
[data-container-type="image_slider"]>.container-item{
display: inline-block;
width: 100px;
}
[data-container-type="image_slider"]>.container-item>.content{
padding: 0px;
height: 99px;
width: 99px;
margin: 0;
}
.image .container-item .action-delete{
right: 25px;
}
[data-container-type="image_slider"]>.container-item>.content>.image-src{
width: 99px;
height: 99px;
}
[data-container-type="image_slider"]>.container-item>.list>.name,
[data-container-type="image_slider"]>.container-item>.list>.actions>.action-expand{
display: none;
}
.placeholding{
line-height: 42px !important;
}
/* END - Pagebuilder */
.pagebuilder-container .hidden,.pagebuilder-container .size-0-0,.field-item.hidden{display: none !important;}

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 532 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 970 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1012 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 970 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 984 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 562 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 970 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1008 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1018 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 997 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 518 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 315 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@ -0,0 +1,485 @@
/**
*
* Color picker
* Author: Stefan Petre www.eyecon.ro
*
* Dual licensed under the MIT and GPL licenses
*
*/
(function ($) {
var ColorPicker = function () {
var
ids = {},
inAction,
charMin = 65,
visible,
tpl = '<div class="colorpicker"><div class="colorpicker_color"><div><div></div></div></div><div class="colorpicker_hue"><div></div></div><div class="colorpicker_new_color"></div><div class="colorpicker_current_color"></div><div class="colorpicker_hex"><input type="text" maxlength="6" size="6" /></div><div class="colorpicker_rgb_r colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_rgb_g colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_rgb_b colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_h colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_s colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_b colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_submit"></div></div>',
defaults = {
eventName: 'click',
onShow: function () {},
onBeforeShow: function(){},
onHide: function () {},
onChange: function () {},
onSubmit: function () {},
color: 'ff0000',
livePreview: true,
flat: false
},
fillRGBFields = function (hsb, cal) {
var rgb = HSBToRGB(hsb);
$(cal).data('colorpicker').fields
.eq(1).val(rgb.r).end()
.eq(2).val(rgb.g).end()
.eq(3).val(rgb.b).end();
},
fillHSBFields = function (hsb, cal) {
$(cal).data('colorpicker').fields
.eq(4).val(hsb.h).end()
.eq(5).val(hsb.s).end()
.eq(6).val(hsb.b).end();
},
fillHexFields = function (hsb, cal) {
$(cal).data('colorpicker').fields
.eq(0).val(HSBToHex(hsb)).end();
},
setSelector = function (hsb, cal) {
$(cal).data('colorpicker').selector.css('backgroundColor', '#' + HSBToHex({h: hsb.h, s: 100, b: 100}));
$(cal).data('colorpicker').selectorIndic.css({
left: parseInt(150 * hsb.s/100, 10),
top: parseInt(150 * (100-hsb.b)/100, 10)
});
},
setHue = function (hsb, cal) {
$(cal).data('colorpicker').hue.css('top', parseInt(150 - 150 * hsb.h/360, 10));
},
setCurrentColor = function (hsb, cal) {
$(cal).data('colorpicker').currentColor.css('backgroundColor', '#' + HSBToHex(hsb));
},
setNewColor = function (hsb, cal) {
$(cal).data('colorpicker').newColor.css('backgroundColor', '#' + HSBToHex(hsb));
},
keyDown = function (ev) {
var pressedKey = ev.charCode || ev.keyCode || -1;
if ((pressedKey > charMin && pressedKey <= 90) || pressedKey == 32) {
return false;
}
var cal = $(this).parent().parent();
if (cal.data('colorpicker').livePreview === true) {
change.apply(this);
}
},
change = function (ev) {
var cal = $(this).parent().parent(), col;
if (this.parentNode.className.indexOf('_hex') > 0) {
cal.data('colorpicker').color = col = HexToHSB(fixHex(this.value));
} else if (this.parentNode.className.indexOf('_hsb') > 0) {
cal.data('colorpicker').color = col = fixHSB({
h: parseInt(cal.data('colorpicker').fields.eq(4).val(), 10),
s: parseInt(cal.data('colorpicker').fields.eq(5).val(), 10),
b: parseInt(cal.data('colorpicker').fields.eq(6).val(), 10)
});
} else {
cal.data('colorpicker').color = col = RGBToHSB(fixRGB({
r: parseInt(cal.data('colorpicker').fields.eq(1).val(), 10),
g: parseInt(cal.data('colorpicker').fields.eq(2).val(), 10),
b: parseInt(cal.data('colorpicker').fields.eq(3).val(), 10)
}));
}
if (ev) {
fillRGBFields(col, cal.get(0));
fillHexFields(col, cal.get(0));
fillHSBFields(col, cal.get(0));
}
setSelector(col, cal.get(0));
setHue(col, cal.get(0));
setNewColor(col, cal.get(0));
//cal.data('colorpicker').onChange.apply(cal, [col, HSBToHex(col), HSBToRGB(col)]);
cal.data('colorpicker').onChange.apply(cal, [col, HSBToHex(col), HSBToRGB(col), cal.data('colorpicker').el]);
},
blur = function (ev) {
var cal = $(this).parent().parent();
cal.data('colorpicker').fields.parent().removeClass('colorpicker_focus');
},
focus = function () {
charMin = this.parentNode.className.indexOf('_hex') > 0 ? 70 : 65;
$(this).parent().parent().data('colorpicker').fields.parent().removeClass('colorpicker_focus');
$(this).parent().addClass('colorpicker_focus');
},
downIncrement = function (ev) {
var field = $(this).parent().find('input').focus();
var current = {
el: $(this).parent().addClass('colorpicker_slider'),
max: this.parentNode.className.indexOf('_hsb_h') > 0 ? 360 : (this.parentNode.className.indexOf('_hsb') > 0 ? 100 : 255),
y: ev.pageY,
field: field,
val: parseInt(field.val(), 10),
preview: $(this).parent().parent().data('colorpicker').livePreview
};
$(document).bind('mouseup', current, upIncrement);
$(document).bind('mousemove', current, moveIncrement);
},
moveIncrement = function (ev) {
ev.data.field.val(Math.max(0, Math.min(ev.data.max, parseInt(ev.data.val + ev.pageY - ev.data.y, 10))));
if (ev.data.preview) {
change.apply(ev.data.field.get(0), [true]);
}
return false;
},
upIncrement = function (ev) {
change.apply(ev.data.field.get(0), [true]);
ev.data.el.removeClass('colorpicker_slider').find('input').focus();
$(document).unbind('mouseup', upIncrement);
$(document).unbind('mousemove', moveIncrement);
return false;
},
downHue = function (ev) {
var current = {
cal: $(this).parent(),
y: $(this).offset().top
};
current.preview = current.cal.data('colorpicker').livePreview;
$(document).bind('mouseup', current, upHue);
$(document).bind('mousemove', current, moveHue);
},
moveHue = function (ev) {
change.apply(
ev.data.cal.data('colorpicker')
.fields
.eq(4)
.val(parseInt(360*(150 - Math.max(0,Math.min(150,(ev.pageY - ev.data.y))))/150, 10))
.get(0),
[ev.data.preview]
);
return false;
},
upHue = function (ev) {
fillRGBFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
fillHexFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
$(document).unbind('mouseup', upHue);
$(document).unbind('mousemove', moveHue);
return false;
},
downSelector = function (ev) {
var current = {
cal: $(this).parent(),
pos: $(this).offset()
};
current.preview = current.cal.data('colorpicker').livePreview;
$(document).bind('mouseup', current, upSelector);
$(document).bind('mousemove', current, moveSelector);
},
moveSelector = function (ev) {
change.apply(
ev.data.cal.data('colorpicker')
.fields
.eq(6)
.val(parseInt(100*(150 - Math.max(0,Math.min(150,(ev.pageY - ev.data.pos.top))))/150, 10))
.end()
.eq(5)
.val(parseInt(100*(Math.max(0,Math.min(150,(ev.pageX - ev.data.pos.left))))/150, 10))
.get(0),
[ev.data.preview]
);
return false;
},
upSelector = function (ev) {
fillRGBFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
fillHexFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
$(document).unbind('mouseup', upSelector);
$(document).unbind('mousemove', moveSelector);
return false;
},
enterSubmit = function (ev) {
$(this).addClass('colorpicker_focus');
},
leaveSubmit = function (ev) {
$(this).removeClass('colorpicker_focus');
},
clickSubmit = function (ev) {
var cal = $(this).parent();
var col = cal.data('colorpicker').color;
cal.data('colorpicker').origColor = col;
setCurrentColor(col, cal.get(0));
cal.data('colorpicker').onSubmit(col, HSBToHex(col), HSBToRGB(col), cal.data('colorpicker').el);
},
show = function (ev) {
var cal = $('#' + $(this).data('colorpickerId'));
cal.data('colorpicker').onBeforeShow.apply(this, [cal.get(0)]);
var pos = $(this).offset();
var viewPort = getViewport();
var top = pos.top + this.offsetHeight;
var left = pos.left;
if (top + 176 > viewPort.t + viewPort.h) {
top -= this.offsetHeight + 176;
}
if (left + 356 > viewPort.l + viewPort.w) {
left -= 356;
}
cal.css({left: left + 'px', top: top + 'px'});
if (cal.data('colorpicker').onShow.apply(this, [cal.get(0)]) != false) {
cal.show();
}
$(document).bind('mousedown', {cal: cal}, hide);
return false;
},
hide = function (ev) {
if (!isChildOf(ev.data.cal.get(0), ev.target, ev.data.cal.get(0))) {
if (ev.data.cal.data('colorpicker').onHide.apply(this, [ev.data.cal.get(0)]) != false) {
ev.data.cal.hide();
}
$(document).unbind('mousedown', hide);
}
},
isChildOf = function(parentEl, el, container) {
if (parentEl == el) {
return true;
}
if (parentEl.contains) {
return parentEl.contains(el);
}
if ( parentEl.compareDocumentPosition ) {
return !!(parentEl.compareDocumentPosition(el) & 16);
}
var prEl = el.parentNode;
while(prEl && prEl != container) {
if (prEl == parentEl)
return true;
prEl = prEl.parentNode;
}
return false;
},
getViewport = function () {
var m = document.compatMode == 'CSS1Compat';
return {
l : window.pageXOffset || (m ? document.documentElement.scrollLeft : document.body.scrollLeft),
t : window.pageYOffset || (m ? document.documentElement.scrollTop : document.body.scrollTop),
w : window.innerWidth || (m ? document.documentElement.clientWidth : document.body.clientWidth),
h : window.innerHeight || (m ? document.documentElement.clientHeight : document.body.clientHeight)
};
},
fixHSB = function (hsb) {
return {
h: Math.min(360, Math.max(0, hsb.h)),
s: Math.min(100, Math.max(0, hsb.s)),
b: Math.min(100, Math.max(0, hsb.b))
};
},
fixRGB = function (rgb) {
return {
r: Math.min(255, Math.max(0, rgb.r)),
g: Math.min(255, Math.max(0, rgb.g)),
b: Math.min(255, Math.max(0, rgb.b))
};
},
fixHex = function (hex) {
var len = 6 - hex.length;
if (len > 0) {
var o = [];
for (var i=0; i<len; i++) {
o.push('0');
}
o.push(hex);
hex = o.join('');
}
return hex;
},
HexToRGB = function (hex) {
var hex = parseInt(((hex.indexOf('#') > -1) ? hex.substring(1) : hex), 16);
return {r: hex >> 16, g: (hex & 0x00FF00) >> 8, b: (hex & 0x0000FF)};
},
HexToHSB = function (hex) {
return RGBToHSB(HexToRGB(hex));
},
RGBToHSB = function (rgb) {
var hsb = {
h: 0,
s: 0,
b: 0
};
var min = Math.min(rgb.r, rgb.g, rgb.b);
var max = Math.max(rgb.r, rgb.g, rgb.b);
var delta = max - min;
hsb.b = max;
if (max != 0) {
}
hsb.s = max != 0 ? 255 * delta / max : 0;
if (hsb.s != 0) {
if (rgb.r == max) {
hsb.h = (rgb.g - rgb.b) / delta;
} else if (rgb.g == max) {
hsb.h = 2 + (rgb.b - rgb.r) / delta;
} else {
hsb.h = 4 + (rgb.r - rgb.g) / delta;
}
} else {
hsb.h = -1;
}
hsb.h *= 60;
if (hsb.h < 0) {
hsb.h += 360;
}
hsb.s *= 100/255;
hsb.b *= 100/255;
return hsb;
},
HSBToRGB = function (hsb) {
var rgb = {};
var h = Math.round(hsb.h);
var s = Math.round(hsb.s*255/100);
var v = Math.round(hsb.b*255/100);
if(s == 0) {
rgb.r = rgb.g = rgb.b = v;
} else {
var t1 = v;
var t2 = (255-s)*v/255;
var t3 = (t1-t2)*(h%60)/60;
if(h==360) h = 0;
if(h<60) {rgb.r=t1; rgb.b=t2; rgb.g=t2+t3}
else if(h<120) {rgb.g=t1; rgb.b=t2; rgb.r=t1-t3}
else if(h<180) {rgb.g=t1; rgb.r=t2; rgb.b=t2+t3}
else if(h<240) {rgb.b=t1; rgb.r=t2; rgb.g=t1-t3}
else if(h<300) {rgb.b=t1; rgb.g=t2; rgb.r=t2+t3}
else if(h<360) {rgb.r=t1; rgb.g=t2; rgb.b=t1-t3}
else {rgb.r=0; rgb.g=0; rgb.b=0}
}
return {r:Math.round(rgb.r), g:Math.round(rgb.g), b:Math.round(rgb.b)};
},
RGBToHex = function (rgb) {
var hex = [
rgb.r.toString(16),
rgb.g.toString(16),
rgb.b.toString(16)
];
$.each(hex, function (nr, val) {
if (val.length == 1) {
hex[nr] = '0' + val;
}
});
return hex.join('');
},
HSBToHex = function (hsb) {
return RGBToHex(HSBToRGB(hsb));
},
restoreOriginal = function () {
var cal = $(this).parent();
var col = cal.data('colorpicker').origColor;
cal.data('colorpicker').color = col;
fillRGBFields(col, cal.get(0));
fillHexFields(col, cal.get(0));
fillHSBFields(col, cal.get(0));
setSelector(col, cal.get(0));
setHue(col, cal.get(0));
setNewColor(col, cal.get(0));
};
return {
init: function (opt) {
opt = $.extend({}, defaults, opt||{});
if (typeof opt.color == 'string') {
opt.color = HexToHSB(opt.color);
} else if (opt.color.r != undefined && opt.color.g != undefined && opt.color.b != undefined) {
opt.color = RGBToHSB(opt.color);
} else if (opt.color.h != undefined && opt.color.s != undefined && opt.color.b != undefined) {
opt.color = fixHSB(opt.color);
} else {
return this;
}
return this.each(function () {
if (!$(this).data('colorpickerId')) {
var options = $.extend({}, opt);
options.origColor = opt.color;
var id = 'collorpicker_' + parseInt(Math.random() * 1000);
$(this).data('colorpickerId', id);
var cal = $(tpl).attr('id', id);
if (options.flat) {
cal.appendTo(this).show();
} else {
cal.appendTo(document.body);
}
options.fields = cal
.find('input')
.bind('keyup', keyDown)
.bind('change', change)
.bind('blur', blur)
.bind('focus', focus);
cal
.find('span').bind('mousedown', downIncrement).end()
.find('>div.colorpicker_current_color').bind('click', restoreOriginal);
options.selector = cal.find('div.colorpicker_color').bind('mousedown', downSelector);
options.selectorIndic = options.selector.find('div div');
options.el = this;
options.hue = cal.find('div.colorpicker_hue div');
cal.find('div.colorpicker_hue').bind('mousedown', downHue);
options.newColor = cal.find('div.colorpicker_new_color');
options.currentColor = cal.find('div.colorpicker_current_color');
cal.data('colorpicker', options);
cal.find('div.colorpicker_submit')
.bind('mouseenter', enterSubmit)
.bind('mouseleave', leaveSubmit)
.bind('click', clickSubmit);
fillRGBFields(options.color, cal.get(0));
fillHSBFields(options.color, cal.get(0));
fillHexFields(options.color, cal.get(0));
setHue(options.color, cal.get(0));
setSelector(options.color, cal.get(0));
setCurrentColor(options.color, cal.get(0));
setNewColor(options.color, cal.get(0));
if (options.flat) {
cal.css({
position: 'relative',
display: 'block'
});
} else {
$(this).bind(options.eventName, show);
}
}
});
},
showPicker: function() {
return this.each( function () {
if ($(this).data('colorpickerId')) {
show.apply(this);
}
});
},
hidePicker: function() {
return this.each( function () {
if ($(this).data('colorpickerId')) {
$('#' + $(this).data('colorpickerId')).hide();
}
});
},
setColor: function(col) {
if (typeof col == 'string') {
col = HexToHSB(col);
} else if (col.r != undefined && col.g != undefined && col.b != undefined) {
col = RGBToHSB(col);
} else if (col.h != undefined && col.s != undefined && col.b != undefined) {
col = fixHSB(col);
} else {
return this;
}
return this.each(function(){
if ($(this).data('colorpickerId')) {
var cal = $('#' + $(this).data('colorpickerId'));
cal.data('colorpicker').color = col;
cal.data('colorpicker').origColor = col;
fillRGBFields(col, cal.get(0));
fillHSBFields(col, cal.get(0));
fillHexFields(col, cal.get(0));
setHue(col, cal.get(0));
setSelector(col, cal.get(0));
setCurrentColor(col, cal.get(0));
setNewColor(col, cal.get(0));
}
});
}
};
}();
$.fn.extend({
ColorPicker: ColorPicker.init,
ColorPickerHide: ColorPicker.hidePicker,
ColorPickerShow: ColorPicker.showPicker,
ColorPickerSetColor: ColorPicker.setColor
});
})(jQuery)

View File

@ -0,0 +1,262 @@
function showHidePostFormatField(){
jQuery('#normal-sortables>[id*="tw-format-"]').each(function(){
if(jQuery(this).attr('id').replace("tw","post")===jQuery('#post-formats-select input:radio:checked').attr('id').replace('image', '0')){
jQuery(this).css('display', 'block');
} else {
jQuery(this).css('display', 'none');
}
});
}
jQuery(function(){
/* Color Picker */
jQuery(".color_picker").ColorPicker({
onShow: function (colpkr) {
jQuery(colpkr).fadeIn(500);
return false;
},
onHide: function (colpkr) {
jQuery(colpkr).fadeOut(500);
return false;
},
onChange: function (hsb, hex, rgb, el) {
jQuery(el).parent().find('.color_picker_inner').css('backgroundColor', '#' + hex);
jQuery(el).parent().find('.color_picker_value').val('#' + hex);
}
});
/* Check show hide */
jQuery('.check-show-hide').change(function() {
var datashow = jQuery(this).attr('data-show');
var datahide = jQuery(this).attr('data-hide');
if(jQuery(this).is(':checked')) {
jQuery(datashow).fadeIn();
jQuery(datahide).fadeOut();
} else {
jQuery(datashow).fadeOut();
jQuery(datahide).fadeIn();
}
});
jQuery('.check-show-hide').each(function() {
jQuery(this).change();
});
/* Select options */
jQuery(".tw-metaboxes select").each(function(){
$this = jQuery(this);
if( $this.attr("data-value") != "" ){
$this.val($this.attr("data-value"));
}
});
jQuery("#header_type select").change(function(){
$this = jQuery(this);
if( $this.val() == "subtitle" ){
jQuery(".tw-metaboxes #subtitle").fadeIn();
jQuery(".tw-metaboxes #bg_image").fadeIn();
jQuery(".tw-metaboxes #slider_id").fadeOut();
jQuery(".tw-metaboxes #googlemap").fadeOut();
} else if($this.val() == "slider") {
jQuery(".tw-metaboxes #slider_id").fadeIn();
jQuery(".tw-metaboxes #subtitle").fadeOut();
jQuery(".tw-metaboxes #bg_image").fadeOut();
jQuery(".tw-metaboxes #googlemap").fadeOut();
} else if($this.val() == "map") {
jQuery(".tw-metaboxes #googlemap").fadeIn();
jQuery(".tw-metaboxes #slider_id").fadeOut();
jQuery(".tw-metaboxes #subtitle").fadeOut();
jQuery(".tw-metaboxes #bg_image").fadeOut();
} else {
jQuery(".tw-metaboxes #googlemap").fadeOut();
jQuery(".tw-metaboxes #slider_id").fadeOut();
jQuery(".tw-metaboxes #subtitle").fadeOut();
jQuery(".tw-metaboxes #bg_image").fadeOut();
}
});
jQuery("#header_type select").change();
/* Page layout options */
jQuery(".tw-metaboxes .type_layout a").each(function(){
$val = jQuery(".tw-metaboxes .type_layout input").val();
$this = jQuery(this);
if( $this.data("value") == $val ){
$this.addClass("active");
}
});
jQuery(".tw-metaboxes .type_layout a").click(function(){
jQuery(".tw-metaboxes .type_layout a").removeClass("active");
$val = jQuery(this).data('value');
jQuery(".tw-metaboxes .type_layout input").val($val);
jQuery(this).addClass("active");
})
/* Post format */
showHidePostFormatField();
jQuery('#post-formats-select input').change(showHidePostFormatField);
/* Gallery */
var frame;
var images = script_data.image_ids;
var selection = loadImages(images);
jQuery('#gallery_images_upload').on('click', function(e) {
e.preventDefault();
// Set options for 1st frame render
var options = {
title: script_data.label_create,
state: 'gallery-edit',
frame: 'post',
selection: selection
};
// Check if frame or gallery already exist
if( frame || selection ) {
options['title'] = script_data.label_edit;
}
frame = wp.media(options).open();
// Tweak views
frame.menu.get('view').unset('cancel');
frame.menu.get('view').unset('separateCancel');
frame.menu.get('view').get('gallery-edit').el.innerHTML = script_data.label_edit;
frame.content.get('view').sidebar.unset('gallery'); // Hide Gallery Settings in sidebar
// When we are editing a gallery
overrideGalleryInsert();
frame.on( 'toolbar:render:gallery-edit', function() {
overrideGalleryInsert();
});
frame.on( 'content:render:browse', function( browser ) {
if ( !browser ) return;
// Hide Gallery Setting in sidebar
browser.sidebar.on('ready', function(){
browser.sidebar.unset('gallery');
});
// Hide filter/search as they don't work
browser.toolbar.on('ready', function(){
if(browser.toolbar.controller._state == 'gallery-library'){
browser.toolbar.$el.hide();
}
});
});
// All images removed
frame.state().get('library').on( 'remove', function() {
var models = frame.state().get('library');
if(models.length == 0){
selection = false;
jQuery.post(ajaxurl, {
ids: '',
action: 'themewaves_save_images',
post_id: script_data.post_id,
nonce: script_data.nonce
});
}
});
// Override insert button
function overrideGalleryInsert() {
frame.toolbar.get('view').set({
insert: {
style: 'primary',
text: script_data.label_save,
click: function() {
var models = frame.state().get('library'),
ids = '';
models.each( function( attachment ) {
ids += attachment.id + ','
});
this.el.innerHTML = script_data.label_saving;
jQuery.ajax({
type: 'POST',
url: ajaxurl,
data: {
ids: ids,
action: 'themewaves_save_images',
post_id: script_data.post_id,
nonce: script_data.nonce
},
success: function(){
selection = loadImages(ids);
jQuery('#gallery_image_ids').val( ids );
frame.close();
},
dataType: 'html'
}).done( function( data ) {
jQuery('.gallery-thumbs').html( data );
});
}
}
});
}
});
// Load images
function loadImages(images) {
if( images ){
var shortcode = new wp.shortcode({
tag: 'gallery',
attrs: { ids: images },
type: 'single'
});
var attachments = wp.media.gallery.attachments( shortcode );
var selection = new wp.media.model.Selection( attachments.models, {
props: attachments.props.toJSON(),
multiple: true
});
selection.gallery = attachments.gallery;
// Fetch the query's attachments, and then break ties from the
// query to allow for sorting.
selection.more().done( function() {
// Break ties with the query.
selection.props.set({ query: false });
selection.unmirror();
selection.props.unset('orderby');
});
return selection;
}
return false;
}
});
function browseimage(id){
var elementId = id;
window.original_send_to_editor = window.send_to_editor;
window.custom_editor = true;
window.send_to_editor = function(html){
if (elementId != undefined) {
jQuery(html).find('img').each(function(){
var imgurl = jQuery(this).attr('src');
jQuery('input[name="'+elementId+'"]').val(imgurl);
return;
});
} else {
window.original_send_to_editor(html);
}
elementId = undefined;
};
wp.media.editor.open();
}
window.original_send_to_editor = window.send_to_editor;
window.custom_editor = true;

View File

@ -0,0 +1,914 @@
var $currentContentEditor='content';
var $currentDeleteModal=false;
var $pbSavingDone=true;
// Reset Content width
jQuery(function(){
$homeURI+='/';
if($homeURI[$homeURI.length-1]==='/'){$homeURI=$homeURI.substring(0,$homeURI.length-1);}
twSortDragg();
// init Source Datas
twInitSourceDatas(jQuery('#pagebuilder-area-source>div'));
// Click to Add Item
jQuery('#pagebuilder-elements-container>.item').click(function(){
jQuery('#pagebuilder-area>div').eq(1).append(jQuery(this).clone());
pbSaveData();
pbInitEvents();
});
// Layout Change
jQuery('#pagebuilder-select-layout>.sidebar').bind('click').bind('click',function(e){e.preventDefault();
var $currentLayout = jQuery(this);
var $currentValueArray = $currentLayout.attr('data-value').split(',');
var $currentLayoutInput=$currentLayout.siblings('.page-layout');
$currentLayout.addClass('active').siblings('.sidebar').removeClass('active');
$currentLayoutInput.attr("value",$currentLayout.attr('data-input'));
if($currentValueArray[0]!==''){
var $currentBuilderArea='';
var $currentBuilderAreaClasses='';
for(var i = 0, length=$currentValueArray.length ; i<length; i++){
$currentBuilderArea=jQuery('#pagebuilder-area').children('.builder-area').eq(i);
$currentBuilderAreaClasses=$currentBuilderArea.attr('class').split(' ');
for(var ind=0,len=$currentBuilderAreaClasses.length;ind<len;ind++){if($currentBuilderAreaClasses[ind].search('size-')!==-1){$currentBuilderArea.removeClass($currentBuilderAreaClasses[ind]).addClass('size-'+$currentValueArray[i]);break;}}
}
//START - Sidebar elements moving
var $oldSidebar=false;
var $newSidebar=false;
if($currentLayoutInput.val()=='left'){
jQuery('#pagebuilder-area').children('.builder-area').eq(1).removeClass('right-sidebar').removeClass('no-sidebar').addClass('left-sidebar');
$oldSidebar=jQuery('#pagebuilder-area').children('.builder-area').eq(-1);
$newSidebar=jQuery('#pagebuilder-area').children('.builder-area').eq(0);
}else if($currentLayoutInput.val()=='right'){
jQuery('#pagebuilder-area').children('.builder-area').eq(1).removeClass('left-sidebar').removeClass('no-sidebar').addClass('right-sidebar');
$oldSidebar=jQuery('#pagebuilder-area').children('.builder-area').eq(0);
$newSidebar=jQuery('#pagebuilder-area').children('.builder-area').eq(-1);
}else{
jQuery('#pagebuilder-area').children('.builder-area').eq(1).removeClass('left-sidebar').removeClass('right-sidebar').addClass('no-sidebar');
}
if($oldSidebar&&$newSidebar){
if($newSidebar.children().length===0){
$newSidebar.html($oldSidebar.html());
$oldSidebar.html('');
}
}
//END - Sidebar elements moving
pbSaveData();
pbInitEvents();
}
});
jQuery('#pagebuilder-select-layout>.sidebar.active').click();
pbInitEvents();
pbInitTemplateEvents();
pbSaveData();
});
function pbInitTemplateEvents(){
// Template Action
jQuery('.template-add').unbind('click').bind('click',function(e){e.preventDefault();
var $currentTemplateName = prompt('Template Name?');
var $currentTemplateLayout = jQuery('input[name="pb-page-layout"]') .val();
var $currentTemplateContent=encodeURIComponent(jQuery('#pagebuilder-area').html());
if($currentTemplateName==null){
return false;
}else if($currentTemplateName!='' && $currentTemplateLayout!=''){
jQuery.ajax({
type: "POST",
url: ajaxurl,
data: {
'action':'template_add',
'template_name':$currentTemplateName,
'template_content':$currentTemplateContent,
'template_layout':$currentTemplateLayout
},
success: function(response){
if(jQuery('.succes',response).text()!=''){
jQuery('ul.template-container').append('<li class="template-item"><a class="template-name">'+$currentTemplateName+'</a><span class="template-delete">X</span></li>');
pbInitTemplateEvents();
// alert(jQuery('.succes',response).text());
}else if(jQuery('.error',response).text()!=''){
alert(jQuery('.error',response).text());
}
}
});
}else{
alert('Template name is empty!!! Try again.');
}
jQuery('#template-save').removeClass('active').children('.template-container').slideUp();
});
jQuery('.template-name').unbind('click').bind('click',function(e){e.preventDefault();
var $currentTemplateName = jQuery(this).text();
var $currentResponse = 'waitingajax';
if($currentTemplateName){
jQuery.ajax({
type: "POST",
url: ajaxurl,
data: {
'action':'template_get',
'template_name':$currentTemplateName
},
success: function(response){
$currentResponse=response;
}
});
if(confirm("Your old contents are will delete ?")){
var templateAjaxInt=setInterval(function(){
if($currentResponse!=='waitingajax'){
clearInterval(templateAjaxInt);
if(jQuery('.data',$currentResponse).html()!=''){
jQuery('#pagebuilder-select-layout>[data-input="'+jQuery('.data>.layout',$currentResponse).text()+'"]').click();
jQuery('#pagebuilder-area').html('');
var tmp=jQuery($currentResponse).clone();
jQuery('>.data>.content>div',tmp).each(function(){
jQuery('#pagebuilder-area').append(jQuery(this).html(''));
});
twSortDragg();
// init Source Datas
twInitSourceDatas(jQuery('>.data>.content>div',$currentResponse));
pbSaveData();
pbInitEvents();
}else if(jQuery('.error',$currentResponse).text()!=''){
alert(jQuery('.error',$currentResponse).text());
}
}
},100);
}
}
jQuery('#template-save').removeClass('active').children('.template-container').slideUp();
});
jQuery('.template-delete').unbind('click').bind('click',function(e){e.preventDefault();
var $this = jQuery(this);
var $currentTemplateName = $this.closest('.template-item').find('.template-name').text();
if($currentTemplateName && confirm("Are you delete this template ?")){
jQuery.ajax({
type: "POST",
url: ajaxurl,
data: {
'action':'template_remove',
'template_name':$currentTemplateName
},
success: function(response){
$this.closest('.template-item').remove();
if(jQuery('.error',response).text()!=''){
alert(jQuery('.error',response).text());
}
}
});
}
jQuery('#template-save').removeClass('active').children('.template-container').slideUp();
});
// Template Style
jQuery('#template-save>.template').unbind('click').bind('click',function(e){e.preventDefault();
if(jQuery('#template-save').hasClass('active')){
jQuery('#template-save').removeClass('active').children('.template-container').slideUp();
}else{
jQuery('#template-save').addClass('active').children('.template-container').slideDown();
}
});
}
function pbInitEvents(){
// height repaire
var $builderMaxHeight=0;
jQuery('#pagebuilder-area>div').css('min-height','');
jQuery('#pagebuilder-area>div').each(function(){if(jQuery(this).height()>$builderMaxHeight){$builderMaxHeight=jQuery(this).height();}});
jQuery('#pagebuilder-area>div').css('min-height',$builderMaxHeight+'px');
// Sortable Draggable
twSortDragg();
//resize
jQuery(".builder-area>.item>.list>.size-sizer-container>.sizer>a.down").unbind("click").bind("click",function(e){e.preventDefault();
var $this = jQuery(this);
var $sizeList=jQuery('#size-list').clone();
var $currentItem = $this.closest('.item');
var $currentSizeText = jQuery('.list>.size-sizer-container>.size',$currentItem).text();
var $currentSizeList = jQuery('li[data-text="'+$currentSizeText+'"]',$sizeList);
$currentItem.removeClass($currentSizeList.attr('data-class'));
if($currentItem.attr('data-min')){$sizeList.find('[data-class="'+$currentItem.attr('data-min')+'"]').addClass('min').siblings('.min').removeClass('min');}
if($currentSizeList.hasClass('min')){
// $currentSizeList=$currentSizeList.siblings('.max');
}else{
$currentSizeList=$currentSizeList.prev();
}
$currentItem.addClass($currentSizeList.attr('data-class'));
jQuery('.list>.size-sizer-container>.size',$currentItem).text($currentSizeList.attr('data-text'));
pbSaveData();
});
jQuery(".builder-area>.item>.list>.size-sizer-container>.sizer>a.up").unbind("click").bind("click",function(e){e.preventDefault();
var $this = jQuery(this);
var $sizeList=jQuery('#size-list').clone();
var $currentItem = $this.closest('.item');
var $currentSizeText = jQuery('.list>.size-sizer-container>.size',$currentItem).text();
var $currentSizeList = jQuery('li[data-text="'+$currentSizeText+'"]',$sizeList);
$currentItem.removeClass($currentSizeList.attr('data-class'));
if($currentItem.attr('data-min')){$sizeList.find('[data-class="'+$currentItem.attr('data-min')+'"]').addClass('min').siblings('.min').removeClass('min');}
if($currentSizeList.hasClass('max')){
// $currentSizeList=$currentSizeList.siblings('.min');
}else{
$currentSizeList=$currentSizeList.next();
}
$currentItem.addClass($currentSizeList.attr('data-class'));
jQuery('.list>.size-sizer-container>.size',$currentItem).text($currentSizeList.attr('data-text'));
pbSaveData();
});
//duplicate
jQuery(".builder-area>.item>.list>.actions>a.action-duplicate").unbind("click").bind("click",function(e){e.preventDefault();
var $parent = jQuery(this).closest('.item');
var $newItem = $parent.clone().addClass('hidded').css('display','none');
$parent.after($newItem).promise().done(function(){
jQuery('.builder-area>.item.hidded').removeClass('hidded').fadeIn('slow').promise().done(function(){
pbSaveData();pbInitEvents();
});
});
});
//edit
jQuery(".builder-area>.item>.list>.actions>a.action-edit").unbind("click").bind("click",function(e){e.preventDefault();
$parent = jQuery(this).closest('.item');
$parent.addClass('item-modalled').siblings('.item-modalled').removeClass('item-modalled');
var $videoURL = jQuery(this).attr('data-video');
html = $parent.children('.data').html();
//pbInitModalSave
jQuery( '<div id="pb-modal-container" class="'+$parent.attr('data-slug')+'" />' ).append(html).dialog({
closeOnEscape: true,
title: $parent.children('.list').children('.name').text(),
resizable: false,
width: 800,
modal: true,
open: function(event, ui){
jQuery(this).closest('.ui-dialog').addClass('tw-pb-main-container');
jQuery(this).closest('.ui-dialog').focus();
if($parent.attr('data-help')){jQuery(this).closest('.ui-dialog').find('.ui-dialog-buttonpane').prepend('<a href="'+$parent.attr('data-help')+'" target="_blank" class="watch-tutorial">LINK</a>');}
pbModalInitActions(jQuery(this));
},
close: function(){
$currentContentEditor='content';
jQuery('#pb-modal-container').closest('.ui-dialog').remove();
jQuery('body>#pb-modal-container').remove();
},
buttons: {
"Save": function() {
pbModalSave(jQuery(this));
jQuery(this).dialog("close");
pbSaveData();
},
"Cancel": function() {
jQuery(this).dialog("close");
}
}
});
});
//remove item
jQuery(".builder-area>.item>.list>.actions>a.action-delete").unbind("click").bind("click",function(e){e.preventDefault();
$currentDeleteModal = jQuery(this).closest('.item');
//pbInitModalSave
jQuery( '<div id="pb-delete-modal-container" />' ).append('Are you sure to delete this?').dialog({
closeOnEscape: true,
title: 'Confirm',
resizable: false,
width: 800,
modal: true,
open: function(event, ui){
jQuery(this).closest('.ui-dialog').addClass('tw-pb-main-container');
jQuery(this).closest('.ui-dialog').find('.ui-dialog-buttonset>.ui-button').first().focus();
},
close: function(){
$currentDeleteModal=false;
jQuery('#pb-delete-modal-container').closest('.ui-dialog').remove();
jQuery('body>#pb-delete-modal-container').remove();
},
buttons: {
"Yes": function() {
$currentDeleteModal.remove();
$currentDeleteModal=false;
pbSaveData();
jQuery(this).dialog("close");
},
"No": function() {
jQuery(this).dialog("close");
}
}
});
});
}
function pbSaveData(){
var savingInt=setInterval(function(){
if($pbSavingDone){
$pbSavingDone=false;
clearInterval(savingInt);
var item = '';
jQuery('#pagebuilder-area>div').each(function(iCont){
var $currentContainer=jQuery(this);
var $size='';
var $classes=$currentContainer.attr('class').split(' ');
for(var i=0,len=$classes.length;i<len;i++){
if($classes[i].search('size-')!==-1){
$size=$classes[i];
break;
}
}
if(iCont){item += ',';}
item += '"'+iCont+'":{"size":"'+$size+'","items":{';
$currentContainer.children('.item').each(function(i){
var $currentItem=jQuery(this);
if(i){item += ',';}
item += '"'+i+'":{"slug":"'+$currentItem.attr('data-slug')+'","size":"' + jQuery('.list>.size-sizer-container>.size',$currentItem).text() + '",';
jQuery('.data .general-field-container>.field-item>.field-data>.field',$currentItem).each(function(){
var $currentField=jQuery(this);
item += '"'+$currentField.attr('data-name')+'":"'+$currentField.val()+'",';
}).promise().done(function(){
item += '"settings":{';
jQuery('.data .custom-field-container>.field-item>.field-data>.field',$currentItem).each(function(index){
var $currentField=jQuery(this);
if(index){item += ',';}
if($currentField.attr('data-type')==='container'){
item += '"'+$currentField.attr('data-name')+'":{';
$currentField.children('.container-item').each(function(itemIndex){
var $currentContainerItem=jQuery(this);
if(itemIndex){item += ',';}
item += '"'+itemIndex+'":{';
jQuery('.content>.field-item>.field-data>.field',$currentContainerItem).each(function(fieldIndex){
var $currentContainerItemField = jQuery(this);
if(fieldIndex){item += ',';}
item += '"'+$currentContainerItemField.attr('data-name')+'":"'+encodeURIComponent($currentContainerItemField.val())+'"';
});
item += '}';
});
item += '}';
}else{
item += '"'+$currentField.attr('data-name')+'":"'+encodeURIComponent($currentField.val())+'"';
}
}).promise().done(function(){
item += '}}';
});
});
}).promise().done(function(){
item += '}}';
});
}).promise().done(function(){
// jQuery('textarea#pb_content').val('{'+item+'}');
jQuery('textarea#pb_content').val(encodeURIComponent('{'+item+'}'));
$pbSavingDone=true;
});
}
},500);
}
function pbModalInitActions($currentModal){
//Font Awesome Actions
jQuery('[data-name="fa_icon"]',$currentModal).each(function(){
var $currIconField = jQuery(this).closest('.field-item');
var $currFa = $currIconField.siblings('.field-item.type-fa').hasClass('type-fa')?$currIconField.siblings('.field-item.type-fa'):$currentModal;
var $currFaFields = $currIconField.parent().children('.field-item');
//Font Awesome Viewer
jQuery('[data-name="fa_icon"]',$currFaFields).unbind('input').bind('input',function(){
var $style='display:block; text-align:center; margin: 0 auto;';
$style +='font-size:' +jQuery('[data-name="fa_size"]', $currFaFields).val()+';';
$style +='width:' +jQuery('[data-name="fa_size"]', $currFaFields).val()+';';
$style +='line-height:' +jQuery('[data-name="fa_size"]', $currFaFields).val()+';';
$style +='padding:' +jQuery('[data-name="fa_padding"]', $currFaFields).val()+';';
$style +='color:' +jQuery('[data-name="fa_color"]', $currFaFields).val()+';';
$style +='border-color:'+jQuery('[data-name="fa_bg_color"]',$currFaFields).val()+';';
$style +='border-width:' +jQuery('[data-name="fa_rounded"]', $currFaFields).val()+';';
jQuery('.fa-viewer',$currFa).html('<i class="'+jQuery('[data-name="fa_icon"]', $currFaFields).val()+'" style="border-radius: 50%;-moz-border-radius: 50%;-webkit-border-radius: 50%; border-style: solid; '+$style+'"></i>').css('padding',jQuery('[data-name="fa_padding"]',$currFaFields).val());
});
jQuery('[data-name="fa_icon"]',$currFaFields).trigger('input');
//Font Awesome Modal
jQuery('.remove-fa',$currFa).unbind('click').bind('click',function(e){e.preventDefault();
jQuery('[data-name="fa_size"]', $currFaFields).val('');
jQuery('[data-name="fa_padding"]', $currFaFields).val('');
jQuery('[data-name="fa_color"]', $currFaFields).val('');
jQuery('[data-name="fa_bg_color"]',$currFaFields).val('');
jQuery('[data-name="fa_rounded"]', $currFaFields).val('');
jQuery('[data-name="fa_icon"]', $currFaFields).val('').trigger('input');
});
//Font Awesome Modal
jQuery('.show-fa-modal',$currFa).unbind('click').bind('click',function(e){e.preventDefault();
var $currentButton=jQuery(this);
if($currentButton.not('.loading')){
$currentButton.addClass('loading');
jQuery.ajax({
type: "POST",
url: ajaxurl,
data: {
'action':'get_fontawesome'
},
success: function(response){
if(jQuery(response).hasClass('fontawesome-ajax-data')){
jQuery( '<div id="fontawesome_container_dialog" data-current="none" />').append(jQuery(response).html()).dialog({
title: 'Font Awesome',
resizable: true,
width: 800,
// height: 500,
modal: true,
open: function(){
jQuery(this).closest('.ui-dialog').addClass('tw-pb-main-container');
jQuery(this).closest('.ui-dialog').focus();
pbModalSaveField($currFaFields,jQuery(this).find('.general-field-container').children('.field-item'));
pbModalInitActions(jQuery(this));
pbFaModalInitActions(jQuery(this));
},
close: function(){
jQuery('#fontawesome_container_dialog').closest('.ui-dialog').remove();
jQuery('body>#fontawesome_container_dialog').remove();
},
buttons: {
"Insert": function() {
pbModalSaveField(jQuery(this).find('.general-field-container').children('.field-item'),$currentButton.closest('.field-item').parent().children('.field-item'));
$currentButton.closest('.field-item').parent().find('[data-name="fa_icon"]').trigger('input');
jQuery(this).dialog("close");
},
"Cancel": function() {
jQuery(this).dialog("close");
}
}
});
}
$currentButton.removeClass('loading');
}
});
}
});
});
//Upload Button Item
jQuery('.field-item>.field-data>[data-type="button"]',$currentModal).each(function(){
var $currentButton=jQuery(this);
var $currentButtonSaveTo=$currentButton.attr('data-save-to');
if($currentButtonSaveTo!==''){
$currentButton.unbind('click').bind('click',function(){
var $currentSaveField = $currentButton.closest('.field-item').siblings('.field-item').find('>.field-data>[data-name="'+$currentButtonSaveTo+'"]',$currentModal);
window.original_send_to_editor = window.send_to_editor;
window.custom_editor = true;
window.send_to_editor = function(html){
html = jQuery("<div />").html(html);
$currentSaveField.val(jQuery(html).find('img').attr('src'));
tb_remove();
};
tb_show('Upload', $homeURI+'/wp-admin/media-upload.php?post_ID=' + pID + '&type=image&TB_iframe=true',false);
jQuery('#TB_overlay').css('z-index','9998');
jQuery('#TB_window').css('z-index','9999');
});
}
});
//TextEditor Item
jQuery('.field-item>.field-data>[data-tinymce="true"]',$currentModal).each(function(){
var $currentEditor=jQuery(this);
var $currentEditorName=$currentEditor.attr('data-name');
pbModalContentEditor($currentEditorName,$currentEditor);
$currentContentEditor=$currentEditorName;
});
//CheckBox Item
jQuery('.field-item>.field-data>[data-type="checkbox"]',$currentModal).each(function(){
var $currentCheck=jQuery(this);
var $currentCheckText=$currentCheck.next('.checkbox-text');
$currentCheckText.children('.checkbox-true').unbind('click').bind('click',function(){
$currentCheck.attr("value",true).attr("checked",true).change();
if($currentCheck.closest('.ui-dialog-content.ui-widget-content').hasClass('accordion')){
$currentCheck.closest('.container-item').siblings('.container-item').find('.field-item>.field-data>[data-name="'+$currentCheck.attr('data-name')+'"]').next('.checkbox-text').children('.checkbox-false').click();
}
});
$currentCheckText.children('.checkbox-false').unbind('click').bind('click',function(){
$currentCheck.attr("value",false).attr("checked",false).change();
});
$currentCheck.unbind('change').bind('change',function(){
var $checked=$currentCheck.is(':checked');
var $styleON={
color: '#333333',
borderColor: '#bebebe',
backgroundColor: '#fff'
};
var $styleOFF=$styleON;
if($checked){
$currentCheckText.removeClass('checked-false').addClass('checked-true');
$styleON={
color: '#ffffff',
borderColor: '#6395c0',
backgroundColor: '#9ed5fe'
};
}else{
$currentCheckText.removeClass('checked-true').addClass('checked-false');
$styleOFF={
color: '#ffffff',
borderColor: '#8f8f8f',
backgroundColor: '#a4a4a4'
};
}
$currentCheckText.children('.checkbox-true') .animate($styleON, 300);
$currentCheckText.children('.checkbox-false').animate($styleOFF,300);
});
$currentCheck.change();
});
//Select Item
jQuery('.field-item>.field-data>select',$currentModal).each(function(){
var $currentSelect=jQuery(this);
var $currentSelectText=$currentSelect.next('.select-text');
$currentSelectText.width(pbItemRL($currentSelect)+$currentSelect.width()-pbItemRL($currentSelectText));
});
jQuery('.field-item>.field-data>select',$currentModal).unbind('change').bind('change',function(){
var $currentSelect=jQuery(this);
var $currentVal=$currentSelect.val();
var $currentSelectText=$currentSelect.next('.select-text');
var $currentSelectOption=$currentSelect.find('option[value="'+$currentVal+'"]');
var $currentHideArray= $currentSelectOption.attr('hide')?$currentSelectOption.attr('hide').split(','):[""];
$currentSelectOption.attr('selected','selected').siblings().removeAttr('selected');
if($currentHideArray[0]!==''){
$currentSelect.closest('.field-item').parent().children('.field-item.hide-for-select').removeClass('hide-for-select').show();
for(var i = 0, length=$currentHideArray.length ; i<length; i++){
if($currentHideArray[i]==='fa'){
$currentSelect.closest('.field-item').siblings('.field-item.type-fa').addClass('hide-for-select').hide();
}else{
$currentSelect.closest('.field-item').siblings('.field-item').find('>.field-data>[data-name="'+$currentHideArray[i]+'"]').closest('.field-item').addClass('hide-for-select').hide();
}
}
}
$currentSelectText.text($currentSelectOption.text());
if($currentSelect.attr('id')==='style_shortcode'&&$currentVal!=='none'){
$currentSelect.children('option[value="none"]').attr('selected','selected').siblings().removeAttr('selected');
twGetShortcode($currentVal);
}
});
jQuery('.field-item>.field-data>select',$currentModal).change();
//Color Picker Item
jQuery('.field-item>.field-data>[data-type="color"]',$currentModal).each(function(){
var $currentInput=jQuery(this);
jQuery($currentInput.siblings(".color-info")).ColorPicker({
onShow: function (colpkr) {
jQuery(colpkr).find('.colorpicker_hex>input').val($currentInput.val().replace('#','')).change();
jQuery(colpkr).fadeIn(500);
return false;
},
onHide: function (colpkr) {
jQuery(colpkr).fadeOut(500);
return false;
},
onChange: function (hsb, hex, rgb, el) {
$currentInput.siblings('.color-info').css('background-color','#' + hex);
$currentInput.val('#' + hex).change().trigger('input');
}
});
$currentInput.unbind('input change').bind('input change',function(){
if(jQuery(this).val()===''){jQuery(this).val(' ');}
$currentInput.siblings('.color-info').css('background-color',jQuery(this).val());
});
jQuery(this).change();
});
//Container Item
jQuery('.field-item>.field-data>[data-type="container"]',$currentModal).each(function(){
var $currentContainer = jQuery(this);
jQuery('.field-item>.field-data>[data-name="'+$currentContainer.attr('data-add-button')+'"]',$currentModal).unbind('click').bind('click',function(e){e.preventDefault();
var $currentButton=jQuery(this);
var $newElement = $currentButton.next('.data').find('[data-type="container"]');
if($currentContainer.attr('data-container-type')==='toggle'){
$currentContainer.append($newElement.html());
pbModalInitActions($currentModal);
}else{
window.original_send_to_editor = window.send_to_editor;
window.custom_editor = true;
window.send_to_editor = function(html){
html = jQuery("<div />").html(html);
jQuery(html).find('img').each(function(){
$newElement.find('.image-src').attr('src',jQuery(this).attr('src'));
$newElement.find('[data-name="'+$newElement.attr('data-title-as')+'"]').attr('value',jQuery(this).attr('src'));
$currentContainer.append($newElement.html());
}).promise().done(function(){
tb_remove();
pbModalInitActions($currentModal);
});
};
tb_show('Upload', $homeURI+'/wp-admin/media-upload.php?post_ID=' + pID + '&type=image&TB_iframe=true',false);
jQuery('#TB_overlay').css('z-index','9998');
jQuery('#TB_window').css('z-index','9999');
}
});
if($currentContainer.attr('data-container-type')==='toggle'){
jQuery('.container-item>.content>.field-item>.field-data>[data-name="'+$currentContainer.attr('data-title-as')+'"]',$currentContainer).each(function(){
var $currentChanger=jQuery(this);
var $currentChangerType=$currentChanger.attr('data-type');
if($currentChangerType==='select'){
$currentChanger.bind('change',function(){
$currentChanger.closest('.container-item').children('.list').children('.name').text($currentChanger.val());
});
$currentChanger.change();
}else{
$currentChanger.unbind('input').bind('input',function(e){e.preventDefault();
$currentChanger.closest('.container-item').children('.list').children('.name').text($currentChanger.val());
});
$currentChanger.trigger('input');
}
});
}
});
jQuery('.container-item>.list',$currentModal).unbind('click').bind('click',function(e){e.preventDefault();
var $containerItem = jQuery(this).closest('.container-item');
if($containerItem.closest('.container').attr('data-container-type')==='toggle'){
if($containerItem.hasClass('expanded')){
jQuery(this).next('.content').slideUp("normal", function(){$containerItem.removeClass('expanded');});
}else{
jQuery(this).next('.content').slideDown("normal", function(){$containerItem.addClass('expanded');});
}
}
});
jQuery('.container-item>.list>.actions>.action-delete',$currentModal).unbind('click').bind('click',function(e){e.preventDefault();
jQuery(this).closest('.container-item').remove();
});
jQuery('.container-item>.list>.actions>.action-duplicate',$currentModal).unbind('click').bind('click',function(e){e.preventDefault();
var $parent = jQuery(this).closest('.container-item');
var $newItem = $parent.clone().addClass('hidded').css('display','none');
$parent.after($newItem).promise().done(function(){
$newItem.removeClass('hidded').fadeIn('slow').promise().done(function(){
pbModalInitActions($currentModal);
});
});
return false;
});
jQuery('.field-item>.field-data>[data-type="container"]',$currentModal).sortable({placeholder: 'container-item placeholding'});
//Category Item
function catReseter($currentCategorySelector, $currentSaveTo){
var $currentCategoryList = $currentCategorySelector.siblings('.category-list-container');
var $currentSaveToArray=$currentSaveTo.val().split(',');
$currentCategorySelector.find('option').show();
$currentCategoryList.html('');
for (var i = 0, length=$currentSaveToArray.length ; i<length; i++){
if($currentSaveToArray[i]!==''){
$currentCategoryList.append('<div class="category-list-item clearfix" data-value="'+$currentSaveToArray[i]+'"><div class="name">'+$currentCategorySelector.find('option[value="'+$currentSaveToArray[i]+'"]').hide().text()+'</div><div class="actions"><a href="#" class="action-delete">X</a></div></div>');
}
}
$currentCategoryList.find(".category-list-item .action-delete").unbind('click').bind('click',function(){
var $oldArray=$currentSaveTo.val().split(',');
var $newArray=[];
var $delValue=jQuery(this).closest(".category-list-item").attr('data-value');
jQuery(this).closest(".category-list-item").remove();
for (var i = 0, length=$oldArray.length ; i<length; i++){
if($oldArray[i]!==$delValue && $oldArray[i]!==''){
$newArray.push($oldArray[i]);
}
}
$currentSaveTo.val($newArray.join(','));
catReseter($currentCategorySelector, $currentSaveTo)
});
}
jQuery('.field-item>.field-data>[data-type="category"]',$currentModal).each(function(){
var $currentCategorySelector = jQuery(this);
var $currentCategoryList = $currentCategorySelector.siblings('.category-list-container');
var $currentSaveTo = jQuery('.field-item>.field-data>[data-selector="'+$currentCategorySelector.attr('data-name')+'"]',$currentModal);
$currentCategorySelector.change(function(){
var $val = $currentCategorySelector.val();
var $noProblem = true;
$currentCategoryList.children(".category-list-item").each(function(){
if(jQuery(this).attr('data-value') == $val) {
$noProblem = false;
}
});
if($val == 0 || $val == '0'){
return false;
}else{
$currentCategorySelector.children('option[value="0"]').attr('selected','selected').siblings().removeAttr('selected');
$currentCategorySelector.change();
if($noProblem){
var $currentSaveToArray = $currentSaveTo.val().split(',');
if($currentSaveToArray.indexOf($val)<0){
if($currentSaveToArray[0]===''){
$currentSaveToArray[0]=$val;
}else{
$currentSaveToArray.push($val);
}
$currentSaveTo.val($currentSaveToArray.join(','));
}
catReseter($currentCategorySelector,$currentSaveTo);
}
}
});
catReseter($currentCategorySelector,$currentSaveTo);
});
jQuery('textarea',$currentModal).each(function(){
var $currTextArea=jQuery(this);
$currTextArea.unbind('input').bind('input',function(){$currTextArea.html($currTextArea.val());});
});
}
function pbFaModalInitActions($currentFaModal){
jQuery('ul.unstyled>li',$currentFaModal).unbind('click').bind('click',function(e){e.preventDefault();
var $iconClass=jQuery(this).children('span').not('.muted');
jQuery('[data-name="fa_icon"]',$currentFaModal).val($iconClass.text().replace(' ','')).trigger('input');
});
jQuery('[data-name="fa_size"],[data-name="fa_padding"],[data-name="fa_color"],[data-name="fa_bg_color"],[data-name="fa_rounded"]',$currentFaModal).unbind('input').bind('input',function(){
jQuery('[data-name="fa_icon"]',$currentFaModal).trigger('input');
});
}
function pbModalSaveField($from,$to){
$from.each(function(){
var $currentField = jQuery(this).children('.field-data').children('.field');
var $currentFieldSlug = $currentField.attr('data-name');
var $currentFieldType = $currentField.attr('data-type');
var $currentFieldAddButton= $currentField.attr('data-add-button');
var $currentFieldValue = $currentField.val();
switch($currentFieldType){
case 'select':{
jQuery('>.field-data>.field[data-name="'+$currentFieldSlug+'"] option[value="'+$currentFieldValue+'"]',$to).attr('selected','selected').siblings().removeAttr('selected');
break;
}
case 'textArea':{
if($currentField.attr('data-tinyMCE')==='true'){
tinyMCE.execCommand('mceAddControl', false, $currentContentEditor);
jQuery('>.field-data>.field[data-name="'+$currentFieldSlug+'"]',$to).html(tinyMCE.get($currentContentEditor).getContent());
}else{
jQuery('>.field-data>.field[data-name="'+$currentFieldSlug+'"]',$to).html($currentFieldValue);
}
break;
}
case 'container':{
var $newContainer = jQuery('>.field-data>.field[data-name="'+$currentFieldSlug+'"]',$to);
var $template=jQuery('>.field-data>.field[data-name="'+$currentFieldAddButton+'"]',$from).next('.data').children('.field-item').children('.field-data').children('.field').html();
$template = jQuery('<div/>').append($template);
$newContainer.html('');
$currentField.children('.container-item').each(function(){
jQuery(this).find('>.content>.field-item>.field-data>.field').each(function(){
var $cField = jQuery(this);
var $cFieldSlug = $cField.attr('data-name');
var $cFieldType = $cField.attr('data-type');
var $cFieldValue = $cField.val();
switch($cFieldType){
case 'select':{
jQuery('.field[data-name="'+$cFieldSlug+'"] option[value="'+$cFieldValue+'"]',$template).attr('selected','selected').siblings().removeAttr('selected');
break;
}
case 'textArea':{
jQuery('.field[data-name="'+$cFieldSlug+'"]',$template).html($cFieldValue);
break;
}
case 'checkbox':{
jQuery('.field[data-name="'+$cFieldSlug+'"]',$template).attr("value",$cField.is(':checked')).attr("checked",$cField.is(':checked'));
break;
}
default:{
jQuery('.field[data-name="'+$cFieldSlug+'"]',$template).attr("value",$cFieldValue);
break;
}
}
});
$newContainer.append($template.html());
});
break;
}
case 'checkbox':{
jQuery('>.field-data>.field[data-name="'+$currentFieldSlug+'"]',$to).attr("value",$currentField.is(':checked')).attr("checked",$currentField.is(':checked'));
break;
}
default:{
jQuery('>.field-data>.field[data-name="'+$currentFieldSlug+'"]',$to).attr("value",$currentFieldValue);
break;
}
}
});
}
function pbModalSave($item){
var $saveTo = jQuery('.item.item-modalled');
$saveTo.removeClass('item-modalled');
pbModalSaveField($item.find('.general-field-container').children('.field-item'),$saveTo.find('.general-field-container').children('.field-item'));
pbModalSaveField($item.find('.custom-field-container') .children('.field-item'),$saveTo.find('.custom-field-container') .children('.field-item'));
}
/* Item Right Left Width */
/* ------------------------------------------------------------------- */
function pbItemRL($item){
$item=jQuery($item);
var $itemMarginRL = parseInt($item.css('margin-left') .replace('px','')) + parseInt($item.css('margin-right').replace('px',''));
var $itemPaddingRL = parseInt($item.css('padding-left').replace('px','')) + parseInt($item.css('padding-right').replace('px',''));
var $itemBorderRL = parseInt($item.css('border-left-width').replace('px','')) + parseInt($item.css('border-right-width').replace('px',''));
var $itemRL = $itemMarginRL+$itemPaddingRL+$itemBorderRL;
return $itemRL;
}
/* Content Editor */
function pbModalContentEditor($id,$currentEditor){
var $language = jQuery('html').attr('lang');
var $currentField = $currentEditor.closest('.field-data');
$language = $language.substr(0,$language.indexOf('-'));
var $wpFullscreenContentCSS=$homeURI+"/wp-includes/js/tinymce/plugins/wpfullscreen/css/wp-fullscreen.css";
var $newEditorDiv= jQuery('<div />').append($currentEditor.clone().attr('id',$id));
$currentEditor.hide().closest('.field-data').append(
'<div id="wp-content-editor-tools" class="wp-editor-tools tw-editor-menu hide-if-no-js">'+
'<a id="content-tmce" class="change-to-html wp-switch-editor switch-html" onclick="switchEditors.switchto(this);">Text</a>'+
'<a id="content-html" class="change-to-visual disabled wp-switch-editor switch-tmce" onclick="switchEditors.switchto(this);">Visual</a>'+
'</div>'+
'<div id="wp-content-editor-container" class="tw-editor-content">'+
$newEditorDiv.html()+
'</div>'
).promise().done(function(){
tinyMCE.init({
mode:"exact",
width:"100%",
theme:"advanced",
skin:"wp_theme",
language:$language,
theme_advanced_toolbar_location:"top",
theme_advanced_toolbar_align:"left",
theme_advanced_statusbar_location:"bottom",
theme_advanced_resizing:true,
theme_advanced_resize_horizontal:false,
dialog_type:"modal",
formats:{
alignleft:[{
selector:'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li',
styles:{
textAlign:'left'
}
},{
selector:'img,table',
classes:'alignleft'
}],
aligncenter:[{
selector:'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li',
styles:{
textAlign:'center'
}
},{
selector:'img,table',
classes:'aligncenter'
}],
alignright:[{
selector:'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li',
styles:{
textAlign:'right'
}
},{
selector:'img,table',
classes:'alignright'
}],
strikethrough:{
inline:'del'
}
},
relative_urls:false,
remove_script_host:false,
convert_urls:false,
remove_linebreaks:true,
fix_list_elements:true,
keep_styles:false,
entities:"38,amp,60,lt,62,gt",
accessibility_focus:true,
media_strict:false,
paste_remove_styles:true,
paste_remove_spans:true,
paste_strip_class_attributes:"all",
paste_text_use_dialog:true,
webkit_fake_resize:false,
schema:"html5",
wpeditimage_disable_captions:false,
wp_fullscreen_content_css:$wpFullscreenContentCSS,
// plugins:"inlinepopups,spellchecker,tabfocus,paste,media,wordpress,wpeditimage,wpgallery,wplink,wpdialogs,-twshortcodegenerator",
plugins:"inlinepopups,tabfocus,paste,media,wpeditimage,wpgallery,wplink,wpdialogs,-twshortcodegenerator",
elements:$id,
wpautop:true,
apply_source_formatting:false,
theme_advanced_buttons1:"bold,italic,strikethrough,bullist,numlist,blockquote,justifyleft,justifycenter,justifyright,link,unlink,wp_more,wp_fullscreen,wp_adv,|,twshortcodegenerator",
theme_advanced_buttons2:"formatselect,underline,justifyfull,forecolor,pastetext,pasteword,removeformat,charmap,outdent,indent,undo,redo,wp_help",
theme_advanced_buttons3:"",
theme_advanced_buttons4:"",
tabfocus_elements:"sample-permalink,post-preview",
body_class:"content post-type-page",
theme_advanced_resizing_use_cookie:false
});
jQuery('a.change-to-html',$currentField).unbind('click').bind('click',function() {
jQuery(this).addClass('disabled').siblings('a').removeClass('disabled');
tinyMCE.execCommand('mceRemoveControl', false, $id);
});
jQuery('a.change-to-visual',$currentField).unbind('click').bind('click',function() {
jQuery(this).addClass('disabled').siblings('a').removeClass('disabled');
tinyMCE.execCommand('mceAddControl', false, $id);
});
});
}
function twInitSourceDatas($from){
jQuery('#pagebuilder-area>div').each(function(i){
jQuery(this).html($from.eq(i).html());
});
}
function twSortDragg(){
//Sortables
jQuery("#pagebuilder-area>div").sortable({
placeholder: 'item placeholding',
connectWith: "#pagebuilder-area>div",
// helper:'original',
revert: true,
update: function(event, ui){
pbSaveData();
pbInitEvents();
},
start: function(event, ui) {
var plus;
if(ui.item.hasClass('size-1-4')) plus = 'size-1-4';
else if(ui.item.hasClass('size-1-3')) plus = 'size-1-3';
else if(ui.item.hasClass('size-1-2')) plus = 'size-1-2';
else if(ui.item.hasClass('size-2-3')) plus = 'size-2-3';
else if(ui.item.hasClass('size-3-4')) plus = 'size-3-4';
else if(ui.item.hasClass('size-1-1')) plus = 'size-1-1';
else plus = 'size-1-3';
ui.placeholder.addClass(plus);
}
});
// Draggable
try{
jQuery('#pagebuilder-elements-container>.item').draggable({
connectToSortable: '#pagebuilder-area>div',
helper: 'clone',
revert: "invalid"
});
}catch(err){}
}

View File

@ -0,0 +1,89 @@
function showHidePostFormatField(){
selectedFrmt=(''+jQuery('#post-formats-select input:radio:checked').val());
jQuery('#themewaves_custom_post_format > div').each(function(){
if(jQuery(this).hasClass('themewaves_format_'+jQuery('#post-formats-select input:radio:checked').val())){
jQuery(this).show('fast');
}else{
jQuery(this).hide('fast');
}
});
}
jQuery(document).ready(function(){
// active tab
showHidePostFormatField();
jQuery('#post-formats-select input:radio').change(showHidePostFormatField);
jQuery(".gallery-images").sortable({
update: function(event, ui){
var newimages = '';
jQuery('.gallery-images img').each(function(){
newimages += jQuery(this).attr('src')+'""';
});
jQuery("input#gallery_images").val(newimages);
}
});
deleteGalleryImage();
});
function deleteGalleryImage() {
var elementId = '.gallery-images';
var elementVal = '#gallery_images';
jQuery('.gallery-delete').unbind('click').bind('click',function(){
var newimages = '';
jQuery(this).closest('.gallery-block').fadeOut('slow',function(){
jQuery(this).remove();
jQuery(elementId+' img').each(function(){
newimages += jQuery(this).attr('src')+'""';
});
jQuery("input"+elementVal).val(newimages);
});
});
}
function browseAudio(id){
var elementIdd = id;
window.original_send_to_editor = window.send_to_editor;
window.custom_editor = true;
window.send_to_editor = function(html){
if (elementIdd != undefined) {
var $audio = jQuery(html).attr('href');
jQuery('input[name="'+elementIdd+'"]').val($audio);
return;
} else {
window.original_send_to_editor(html);
}
elementIdd = undefined;
};
wp.media.editor.open();
}
function browseMediaGallery(post_id){
var elementId = '.gallery-images';
var elementVal = '#gallery_images';
var pID=post_id;
window.original_send_to_editor = window.send_to_editor;
window.custom_editor = true;
window.send_to_editor = function(html){
jQuery(elementVal).parent().find('img').fadeIn();
if (elementId != undefined) {
html = jQuery("<div />").html(html);
jQuery(html).find('img').each(function(){
var imgurl = jQuery(this).attr('src');
var images = imgurl+'""'+jQuery(elementVal).val();
jQuery(elementVal).val(images);
jQuery(elementId).prepend('<div class="gallery-block" style="position: relative;"><img src="'+imgurl+'" height="100"/><div class="gallery-delete" style="position: absolute;cursor: pointer;top: 0px;width: 15px;height: 15px;background: red;"></div></div>');
deleteGalleryImage();
}).promise().done( function(){ jQuery(elementVal).parent().find('img').fadeOut(); } );
} else {
window.original_send_to_editor(html);
}
elementId = undefined;
};
wp.media.editor.open();
}
window.original_send_to_editor = window.send_to_editor;
window.custom_editor = true;