first commit
146
wp-content/themes/worldwide-v1-01/include/javascript/edit-box.js
Normal file
@ -0,0 +1,146 @@
|
||||
/**
|
||||
* Goodlayers Edit Box File
|
||||
* ---------------------------------------------------------------------
|
||||
* @version 1.0
|
||||
* @author Goodlayers
|
||||
* @link http://goodlayers.com
|
||||
* @copyright Copyright (c) Goodlayers
|
||||
* ---------------------------------------------------------------------
|
||||
* This file contains the script of the editbox that create overlay over
|
||||
* any elements and copy desired element to be showed in that overlay.
|
||||
* ---------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
jQuery(document).ready(function(){
|
||||
|
||||
// initialize necessary variables
|
||||
var gdl_div_wrapper = jQuery('#gdl-overlay-wrapper');
|
||||
var gdl_edit_box_elements = {
|
||||
editbox: '<div id="gdl-edit-box">\
|
||||
<div id="gdl-overlay"></div>\
|
||||
<div id="gdl-overlay2"></div>\
|
||||
<div id="gdl-inline-wrapper">\
|
||||
<div class="gdl-inline-header">\
|
||||
<div class="gdl-inline-header-wrapper">\
|
||||
<div class="gdl-inline-header-inner-wrapper" >\
|
||||
<div class="gdl-inline-header-text"> EDITOR </div>\
|
||||
<div id="gdl-head-edit-img" class="gdl-head-edit-img"></div>\
|
||||
</div>\
|
||||
</div>\
|
||||
<div id="close-gdl-edit-box"></div>\
|
||||
</div>\
|
||||
<div id="gdl-inline"></div>\
|
||||
<div class="gdl-inline-footer">\
|
||||
<input type="button" value="Done" id="gdl-inline-edit-done" class="gdl-button">\
|
||||
<br class="clear">\
|
||||
</div>\
|
||||
</div>\
|
||||
</div>',
|
||||
opacity: 0.42
|
||||
};
|
||||
gdl_div_wrapper.append(gdl_edit_box_elements.editbox);
|
||||
|
||||
var gdl_editbox = gdl_div_wrapper.find('#gdl-edit-box');
|
||||
var gdl_content = gdl_editbox.siblings('#gdl-overlay-content');
|
||||
var gdl_overlay = gdl_editbox.find('#gdl-overlay');
|
||||
var gdl_inline = gdl_editbox.find('#gdl-inline');
|
||||
var gdl_clicked_item = '';
|
||||
var gdl_edit_item = '';
|
||||
var gdl_clone_item = '';
|
||||
|
||||
// bind the initialize elements
|
||||
gdl_editbox.children().css('display','none');
|
||||
gdl_overlay.css('opacity',gdl_edit_box_elements.opacity);
|
||||
jQuery('#close-gdl-edit-box').click(function(){
|
||||
gdl_close_editbox();
|
||||
});
|
||||
jQuery('#gdl-inline-edit-done').click(function(){
|
||||
gdl_close_editbox();
|
||||
});
|
||||
jQuery('div[rel="gdl-edit-box"]').click(function(){
|
||||
gdl_clicked_item = jQuery(this);
|
||||
gdl_open_editbox();
|
||||
});
|
||||
jQuery('input#publish[name="save"]').click(function(){
|
||||
gdl_close_editbox();
|
||||
});
|
||||
|
||||
// copy the content and open the edit box to use
|
||||
function gdl_open_editbox(){
|
||||
clicked_id = gdl_clicked_item.attr('id');
|
||||
gdl_edit_item = gdl_clicked_item.parents('#page-element-item').siblings('#' + clicked_id);
|
||||
gdl_clone_item = gdl_edit_item.children().clone(true);
|
||||
|
||||
var li_cloned = gdl_clone_item.find('div.selected-image ul').children().clone(true);
|
||||
li_cloned = jQuery('<ul></ul>').append(li_cloned);
|
||||
gdl_clone_item.find('div.selected-image ul').replaceWith(li_cloned)
|
||||
gdl_clone_item.find('div.selected-image ul').sortable({ tolerance: 'pointer', forcePlaceholderSize: true, placeholder: 'slider-placeholder', cancel: '.slider-detail-wrapper' });
|
||||
|
||||
//gdl_clone_item.css('display','block');
|
||||
|
||||
// Remove unnecessary size
|
||||
gdl_clone_item.find("#page-option-item-testimonial-size, #page-option-item-portfolio-size, \
|
||||
#page-option-item-blog-size, #page-option-item-page-size").children("option").each(function(){
|
||||
var item_size = jQuery(this).html();
|
||||
|
||||
if(item_size == "Widget Style"){
|
||||
item_size = 1/8;
|
||||
}else{
|
||||
item_size = parseInt(item_size.substr(0,1)) / parseInt(item_size.substr(2,1));
|
||||
}
|
||||
});
|
||||
|
||||
gdl_inline.append(gdl_clone_item);
|
||||
|
||||
// Open Process
|
||||
gdl_editbox.children().fadeIn(600);
|
||||
gdl_content.hide(function(){
|
||||
jQuery(this).css('position','absolute');
|
||||
jQuery(this).show();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
// manipulate the edited content and close editbox
|
||||
function gdl_close_editbox(){
|
||||
var gdl_edited_item = gdl_inline.children().clone(true);
|
||||
if(gdl_edit_item){
|
||||
gdl_edit_item.html(gdl_edited_item);
|
||||
}
|
||||
gdl_clear_editbox();
|
||||
}
|
||||
|
||||
// clear the editbox variables and internal content
|
||||
function gdl_clear_editbox(){
|
||||
gdl_content.hide(0, function(){
|
||||
gdl_content.css('position','relative');
|
||||
gdl_content.slideDown(600);
|
||||
gdl_editbox.children().fadeOut( function(){
|
||||
gdl_inline.children().remove();
|
||||
gdl_edit_item = '';
|
||||
gdl_clone_item = '';
|
||||
gdl_clicked_item = '';
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
jQuery.fn.bindEditBox = function(){
|
||||
gdl_clicked_item = jQuery(this);
|
||||
gdl_open_editbox();
|
||||
}
|
||||
});
|
||||
|
||||
// Fix the clone problem of <textarea> and <select> elements
|
||||
(function (original) {
|
||||
jQuery.fn.clone = function () {
|
||||
var result = original.apply (this, arguments),
|
||||
my_textareas = this.find('textarea, select'),
|
||||
result_textareas = result.find('textarea, select');
|
||||
|
||||
for (var i = 0, l = my_textareas.length; i < l; ++i)
|
||||
jQuery(result_textareas[i]).val (jQuery(my_textareas[i]).val());
|
||||
|
||||
return result;
|
||||
};
|
||||
}) (jQuery.fn.clone);
|
||||
|
@ -0,0 +1,555 @@
|
||||
/**
|
||||
* Goodlayers Goodlayers Panel File
|
||||
* ---------------------------------------------------------------------
|
||||
* @version 1.0
|
||||
* @author Goodlayers
|
||||
* @link http://goodlayers.com
|
||||
* @copyright Copyright (c) Goodlayers
|
||||
* ---------------------------------------------------------------------
|
||||
* This file contains the jQuery script that animate the goodlayers
|
||||
* panel elements.
|
||||
* ---------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
jQuery(document).ready(function(){
|
||||
|
||||
// Accordion Css
|
||||
jQuery('#panel-nav li a#parent').click(function(){
|
||||
if (jQuery(this).attr('class') != 'active'){
|
||||
jQuery('#panel-nav li ul').slideUp();
|
||||
jQuery(this).next().slideToggle();
|
||||
jQuery('#panel-nav li a').removeClass('active');
|
||||
jQuery(this).addClass('active');
|
||||
}else{
|
||||
jQuery('#panel-nav li ul').slideUp();
|
||||
jQuery(this).removeClass('active');
|
||||
}
|
||||
return false;
|
||||
});
|
||||
jQuery('#panel-nav li a#children').click(function(){
|
||||
if (jQuery(this).attr('class') != 'c-active'){
|
||||
jQuery('#panel-nav li a#children').removeClass('c-active');
|
||||
jQuery(this).addClass('c-active');
|
||||
}
|
||||
var selectedDiv = jQuery('div#panel-elements').children('#'+jQuery(this).attr('rel'));
|
||||
selectedDiv.fadeIn();
|
||||
selectedDiv.siblings().not('.panel-element-head, .panel-element-tail').hide();
|
||||
return false;
|
||||
});
|
||||
jQuery('#panel-nav ul li:first a').triggerHandler('click');
|
||||
jQuery('#panel-nav ul li:first ul li:first a').triggerHandler('click');
|
||||
// Upload Button
|
||||
jQuery("input#upload_image_text").change(function(){
|
||||
jQuery(this).siblings("input[type='hidden']").val(jQuery(this).val());
|
||||
});
|
||||
jQuery('input:button.upload_image_button').click(function() {
|
||||
example_image = jQuery(this).siblings("#input-example-image");
|
||||
upload_text = jQuery(this).siblings("#upload_image_text");
|
||||
attachment_id = jQuery(this).siblings("#upload_image_attachment_id");
|
||||
tb_show('Upload Media', 'media-upload.php?post_id=&type=image&TB_iframe=true');
|
||||
|
||||
var oldSendToEditor = window.send_to_editor;
|
||||
window.send_to_editor = function(html){
|
||||
image_url = jQuery(html).attr('href');
|
||||
thumb_url = jQuery('img',html).attr('src');
|
||||
attid = jQuery(html).attr('attid');
|
||||
|
||||
attachment_id.val(attid);
|
||||
example_image.html('<img src=' + thumb_url + ' />');
|
||||
upload_text.val(image_url);
|
||||
tb_remove();
|
||||
|
||||
window.send_to_editor = oldSendToEditor;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
// Mini Color
|
||||
jQuery(".color-picker").miniColors({
|
||||
change: function(hex, rgb) {
|
||||
jQuery("#console").prepend('HEX: ' + hex + ' (RGB: ' + rgb.r + ', ' + rgb.g + ', ' + rgb.b + ')<br />');
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
// Create Sidebar
|
||||
jQuery("div#add-more-sidebar").click(function(){
|
||||
var clone_item = jQuery(this).parents('.panel-input').siblings('#selected-sidebar').find('.default-sidebar-item').clone(true);
|
||||
var clone_val = jQuery(this).siblings('input#add-more-sidebar').val();
|
||||
if(clone_val.indexOf("&") > 0){
|
||||
alert('You can\'t use the special charactor ( such as & ) as the sidebar name.');
|
||||
return;
|
||||
}
|
||||
if(clone_val == '' || clone_val == 'type title here') return;
|
||||
clone_item.removeClass('default-sidebar-item').addClass('sidebar-item');
|
||||
clone_item.find('input').attr('name',function(){
|
||||
return jQuery(this).attr('id') + '[]';
|
||||
});
|
||||
clone_item.find('input').attr('value', clone_val);
|
||||
clone_item.find('.slider-item-text').html(clone_val);
|
||||
jQuery("#selected-sidebar").append(clone_item);
|
||||
jQuery(".sidebar-item").slideDown();
|
||||
});
|
||||
jQuery(".sidebar-item").css('display','block');
|
||||
jQuery(".panel-delete-sidebar").click(function(){
|
||||
|
||||
var deleted_sidebar = jQuery(this);
|
||||
jQuery.confirm({
|
||||
'message' : 'Are you sure to do this?',
|
||||
'buttons' : {
|
||||
'Delete' : {
|
||||
'class' : 'confirm-yes',
|
||||
'action': function(){
|
||||
deleted_sidebar.parents("#sidebar-item").slideUp("200",function(){
|
||||
jQuery(this).remove();
|
||||
});
|
||||
}
|
||||
},
|
||||
'Cancel' : {
|
||||
'class' : 'confirm-no',
|
||||
'action': function(){ return false; }
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
jQuery('input#add-more-sidebar').setBlankText();
|
||||
|
||||
// Upload Font
|
||||
jQuery('div#add-more-font').click(function(){
|
||||
var clone_item = jQuery(this).siblings('#added-font').find('.default-font-item').clone(true);
|
||||
clone_item.removeClass('default-font-item').addClass('font-item');
|
||||
clone_item.find('input').attr('name',function(){
|
||||
return jQuery(this).attr('id') + '[]';
|
||||
});
|
||||
jQuery("#added-font").append(clone_item);
|
||||
jQuery('.font-item').slideDown();
|
||||
});
|
||||
jQuery(".font-item").css('display','block');
|
||||
jQuery(".panel-delete-font").click(function(){
|
||||
var deleted_font = jQuery(this);
|
||||
|
||||
jQuery.confirm({
|
||||
'message' : 'Are you sure to do this?',
|
||||
'buttons' : {
|
||||
'Delete' : {
|
||||
'class' : 'confirm-yes',
|
||||
'action': function(){
|
||||
deleted_font.parents("#font-item").slideUp('200',function(){
|
||||
jQuery(this).remove();
|
||||
});
|
||||
}
|
||||
},
|
||||
'Cancel' : {
|
||||
'class' : 'confirm-no',
|
||||
'action': function(){ return false; }
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
jQuery("input.upload-font-button").click(function(){
|
||||
attachment_id = jQuery(this).siblings(".font-attachment-id");
|
||||
upload_font = jQuery(this).siblings(".upload-font-text");
|
||||
font_name_box = jQuery(this).parents('#font-item').find(".gdl_upload_font_name");
|
||||
tb_show('Upload Media', 'media-upload.php?post_id=&TB_iframe=true');
|
||||
|
||||
var oldSendToEditor = window.send_to_editor;
|
||||
window.send_to_editor = function(html){
|
||||
attid = jQuery(html).attr('attid');
|
||||
font_url = jQuery(html).attr('href');
|
||||
jQuery.get(font_url, function(data){
|
||||
var font_family_pos = data.indexOf('"font-family":"');
|
||||
if( font_family_pos > 0 ){
|
||||
attachment_id.val(attid);
|
||||
upload_font.val(font_url);
|
||||
font_family_pos = font_family_pos + 15
|
||||
|
||||
var font_family_pos_end = data.indexOf('"', font_family_pos + 1);
|
||||
var font_name = data.substring(font_family_pos, font_family_pos_end);
|
||||
font_name_box.val(font_name);
|
||||
|
||||
var custom_font = jQuery(".gdl-panel-select-font-family").children('option:nth-child(2)');
|
||||
jQuery("<option rel='" + font_url + "' >" + "- " + font_name + "</option>").insertAfter(custom_font);
|
||||
tb_remove();
|
||||
|
||||
window.send_to_editor = oldSendToEditor;
|
||||
}else{
|
||||
tb_remove();
|
||||
alert( 'Only CUFON ( .js file ) is supported with the upload font function. If it\'s already cufon try choosing the "File URL" as link instead of the "Attachment ID" when you click the "Insert to post" button.' );
|
||||
|
||||
window.send_to_editor = oldSendToEditor;
|
||||
}
|
||||
});
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
//Submit Button
|
||||
jQuery("#goodlayer-panel-form").submit(function(){
|
||||
var loading = jQuery(this).find('.loading-save-changes');
|
||||
loading.addClass('now-loading');
|
||||
console.log(jQuery(this).serialize());
|
||||
jQuery.post(ajaxurl,jQuery(this).serialize(),function(data){
|
||||
if( data.success == "-1" ){
|
||||
jQuery('#panel-element-save-complete').children(".panel-element-save-text").html("<span class='alert-err'>" + data.alert + "</span>");
|
||||
var y = jQuery(window).scrollTop() + 140;
|
||||
jQuery('#panel-element-save-complete').css('top', y);
|
||||
jQuery('#panel-element-save-complete').show().delay('5000').fadeOut();
|
||||
loading.removeClass('now-loading');
|
||||
}else{
|
||||
jQuery('#panel-element-save-complete').children(".panel-element-save-text").html("Save Options Complete");
|
||||
var y = jQuery(window).scrollTop() + 140;
|
||||
jQuery('#panel-element-save-complete').css('top', y);
|
||||
jQuery('#panel-element-save-complete').show().delay('2000').fadeOut();
|
||||
loading.removeClass('now-loading');
|
||||
}
|
||||
|
||||
|
||||
}, 'json');
|
||||
return false;
|
||||
});
|
||||
|
||||
// Import Dummies Data
|
||||
jQuery('#import-dummies-data').click(function(){
|
||||
var now_loading = jQuery(this).siblings('#import-now-loading');
|
||||
now_loading.fadeIn();
|
||||
jQuery.post(ajaxurl,{ action:'load_dummy_data' },function(data){
|
||||
if( data == 1 ){
|
||||
|
||||
var y = jQuery(window).scrollTop() + 140;
|
||||
jQuery('#panel-element-save-complete').children(".panel-element-save-text").html("Import Option Complete");
|
||||
jQuery('#panel-element-save-complete').css('top', y);
|
||||
jQuery('#panel-element-save-complete').show().delay('2000').fadeOut();
|
||||
now_loading.fadeOut();
|
||||
|
||||
}else{
|
||||
|
||||
now_loading.hide();
|
||||
alert(data);
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
// Sliderbar
|
||||
jQuery('div[rel="sliderbar"]').each(function(){
|
||||
var bar_id = jQuery(this).attr('id');
|
||||
var init_val = jQuery(this).siblings('input[name="' + bar_id + '"]').attr('value');
|
||||
jQuery(this).slider({ min:10, max:50, value: init_val,
|
||||
slide: function(event, ui){
|
||||
jQuery(this).siblings('input[name="' + bar_id + '"]').attr('value',ui.value);
|
||||
jQuery(this).siblings('#slidertext').html(ui.value + ' px');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Load Example Font
|
||||
jQuery(".gdl-panel-select-font-family").change(function(){
|
||||
var selected_combobox = jQuery(this);
|
||||
var selected_rel = selected_combobox.find("option:selected").attr('rel');
|
||||
|
||||
if( typeof selected_rel === 'undefined' ){
|
||||
var sample_text = selected_combobox.parent().siblings("#panel-font-sample");
|
||||
jQuery.post(ajaxurl,{ action:'get_gdl_font_url', font: jQuery(this).val().substring(2) },function(data){
|
||||
if( data ){
|
||||
if( data.type == "Google Font" ){
|
||||
jQuery('head').append('<link rel="stylesheet" type="text/css" href="' + data.url + '" >');
|
||||
sample_text.html(URL.sample_text);
|
||||
//jQuery.fontAvailable(selected_combobox.val());
|
||||
sample_text.css('font-family',selected_combobox.val().substring(2));
|
||||
}else if( data.type == "Cufon" ){
|
||||
var script = document.createElement("script");
|
||||
script.type = "text/javascript";
|
||||
script.src = data.url;
|
||||
jQuery('head').append(script);
|
||||
// Cufon.hasFont(selected_combobox.val());
|
||||
Cufon.replace(sample_text, {fontFamily: selected_combobox.val().substring(2)});
|
||||
}
|
||||
}
|
||||
}, 'json');
|
||||
}else{
|
||||
var script = document.createElement("script");
|
||||
var sample_text = selected_combobox.parent().siblings("#panel-font-sample");
|
||||
|
||||
script.type = "text/javascript";
|
||||
script.src = selected_rel;
|
||||
jQuery('head').append(script);
|
||||
// Cufon.hasFont(selected_combobox.val());
|
||||
Cufon.replace(sample_text, {fontFamily: selected_combobox.val().substring(2)});
|
||||
}
|
||||
|
||||
});
|
||||
jQuery(".gdl-panel-select-font-family").each(function(){
|
||||
jQuery(this).triggerHandler("change");
|
||||
})
|
||||
|
||||
// Change the style of <select>
|
||||
if (!jQuery.browser.opera) {
|
||||
jQuery('.combobox select').each(function(){
|
||||
var title = jQuery(this).attr('title');
|
||||
if( jQuery('option:selected', this).val() != '' ) title = jQuery('option:selected',this).text();
|
||||
jQuery(this)
|
||||
.css({'z-index':10,'opacity':0,'-khtml-appearance':'none'})
|
||||
.after('<span rel="combobox">' + title + '</span>')
|
||||
.change(function(){
|
||||
val = jQuery('option:selected',this).text();
|
||||
jQuery(this).next().text(val);
|
||||
})
|
||||
});
|
||||
};
|
||||
|
||||
// Style of on off button
|
||||
jQuery("div.checkbox-switch").click(function(){
|
||||
if(jQuery(this).hasClass('checkbox-switch-on')){
|
||||
jQuery(this).removeClass('checkbox-switch-on').addClass('checkbox-switch-off');
|
||||
}else{
|
||||
jQuery(this).removeClass('checkbox-switch-off').addClass('checkbox-switch-on');
|
||||
}
|
||||
});
|
||||
|
||||
//radioimage check-list
|
||||
jQuery('.radio-image-wrapper input').change(function(){
|
||||
jQuery(this).parent().parent().find(".check-list").removeClass("check-list");
|
||||
jQuery(this).siblings("label").children("#check-list").addClass("check-list");
|
||||
|
||||
var panel_body = jQuery(this).parents('.panel-body');
|
||||
if( jQuery(this).val() == 'post-right-sidebar' ){
|
||||
panel_body.siblings('.gdl-default-post-left-sidebar').slideUp();
|
||||
panel_body.siblings('.gdl-default-post-right-sidebar').slideDown();
|
||||
}else if( jQuery(this).val() == 'post-left-sidebar' ){
|
||||
panel_body.siblings('.gdl-default-post-right-sidebar').slideUp();
|
||||
panel_body.siblings('.gdl-default-post-left-sidebar').slideDown();
|
||||
}else if( jQuery(this).val() == 'post-both-sidebar' || jQuery(this).val() == 'post-both-sidebar-reverse' ){
|
||||
panel_body.siblings('.gdl-default-post-left-sidebar').slideDown();
|
||||
panel_body.siblings('.gdl-default-post-right-sidebar').slideDown();
|
||||
}else if( jQuery(this).val() == 'post-no-sidebar' ){
|
||||
panel_body.siblings('.gdl-default-post-left-sidebar').slideUp();
|
||||
panel_body.siblings('.gdl-default-post-right-sidebar').slideUp();
|
||||
}
|
||||
|
||||
if( jQuery(this).val() == 'all-prod-right-sidebar' ){
|
||||
panel_body.siblings('.gdl-all-prod-left-sidebar').slideUp();
|
||||
panel_body.siblings('.gdl-all-prod-right-sidebar').slideDown();
|
||||
}else if( jQuery(this).val() == 'all-prod-left-sidebar' ){
|
||||
panel_body.siblings('.gdl-all-prod-right-sidebar').slideUp();
|
||||
panel_body.siblings('.gdl-all-prod-left-sidebar').slideDown();
|
||||
}else if( jQuery(this).val() == 'all-prod-both-sidebar' || jQuery(this).val() == 'all-prod-both-sidebar-reverse' ){
|
||||
panel_body.siblings('.gdl-all-prod-left-sidebar').slideDown();
|
||||
panel_body.siblings('.gdl-all-prod-right-sidebar').slideDown();
|
||||
}else if( jQuery(this).val() == 'all-prod-no-sidebar' ){
|
||||
panel_body.siblings('.gdl-all-prod-left-sidebar').slideUp();
|
||||
panel_body.siblings('.gdl-all-prod-right-sidebar').slideUp();
|
||||
}
|
||||
|
||||
if( jQuery(this).val() == 'single-prod-right-sidebar' ){
|
||||
panel_body.siblings('.gdl-single-prod-left-sidebar').slideUp();
|
||||
panel_body.siblings('.gdl-single-prod-right-sidebar').slideDown();
|
||||
}else if( jQuery(this).val() == 'single-prod-left-sidebar' ){
|
||||
panel_body.siblings('.gdl-single-prod-right-sidebar').slideUp();
|
||||
panel_body.siblings('.gdl-single-prod-left-sidebar').slideDown();
|
||||
}else if( jQuery(this).val() == 'single-prod-both-sidebar' || jQuery(this).val() == 'single-prod-both-sidebar-reverse' ){
|
||||
panel_body.siblings('.gdl-single-prod-left-sidebar').slideDown();
|
||||
panel_body.siblings('.gdl-single-prod-right-sidebar').slideDown();
|
||||
}else if( jQuery(this).val() == 'single-prod-no-sidebar' ){
|
||||
panel_body.siblings('.gdl-single-prod-left-sidebar').slideUp();
|
||||
panel_body.siblings('.gdl-single-prod-right-sidebar').slideUp();
|
||||
}
|
||||
})
|
||||
jQuery('.radio-image-wrapper input:checked').each(function(){
|
||||
jQuery(this).triggerHandler("change");
|
||||
});
|
||||
|
||||
//background combobox
|
||||
jQuery('#gdl_background_style').change(function(){
|
||||
if(jQuery(this).val() == 'Pattern'){
|
||||
jQuery(this).parents('.panel-body').siblings('.body-gdl_background_pattern').slideDown();
|
||||
jQuery(this).parents('.panel-body').siblings('.body-gdl_background_custom').slideUp();
|
||||
}else if(jQuery(this).val() == 'Custom Image'){
|
||||
jQuery(this).parents('.panel-body').siblings('.body-gdl_background_pattern').slideUp();
|
||||
jQuery(this).parents('.panel-body').siblings('.body-gdl_background_custom').slideDown();
|
||||
}else{
|
||||
jQuery(this).parents('.panel-body').siblings('.body-gdl_background_pattern').slideUp();
|
||||
jQuery(this).parents('.panel-body').siblings('.body-gdl_background_custom').slideUp();
|
||||
}
|
||||
});
|
||||
jQuery('#gdl_background_style').each(function(){
|
||||
if(jQuery(this).val() == 'Pattern'){
|
||||
jQuery(this).parents('.panel-body').siblings('.body-gdl_background_pattern').css('display','block');
|
||||
jQuery(this).parents('.panel-body').siblings('.body-gdl_background_custom').css('display','none');
|
||||
}else if(jQuery(this).val() == 'Custom Image'){
|
||||
jQuery(this).parents('.panel-body').siblings('.body-gdl_background_pattern').css('display','none');
|
||||
jQuery(this).parents('.panel-body').siblings('.body-gdl_background_custom').css('display','block');
|
||||
}else{
|
||||
jQuery(this).parents('.panel-body').siblings('.body-gdl_background_pattern').css('display','none');
|
||||
jQuery(this).parents('.panel-body').siblings('.body-gdl_background_custom').css('display','none');
|
||||
}
|
||||
});
|
||||
|
||||
// Load Default Color
|
||||
jQuery('#gdl_load_default_color_button').click(function(){
|
||||
jQuery.confirm({
|
||||
'message' : 'Are you sure to do this?',
|
||||
'buttons' : {
|
||||
'Yes' : {
|
||||
'class' : 'confirm-yes',
|
||||
'action': function(){
|
||||
jQuery('.color-picker').each(function(){
|
||||
jQuery(this).val(jQuery(this).attr('default'));
|
||||
jQuery(this).trigger('keyup.miniColors');
|
||||
});
|
||||
|
||||
}
|
||||
},
|
||||
'No' : {
|
||||
'class' : 'confirm-no',
|
||||
'action': function(){ return false; }
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// a function to check if selected font is currenty available for use
|
||||
(function($) {
|
||||
|
||||
var element;
|
||||
$.fontAvailable = function(fontName) {
|
||||
var width, height;
|
||||
|
||||
// prepare element, and append to DOM
|
||||
if(!element) {
|
||||
element = $( document.createElement( 'span' ))
|
||||
.css( 'visibility', 'hidden' )
|
||||
.css( 'position', 'absolute' )
|
||||
.css( 'top', '-10000px' )
|
||||
.css( 'left', '-10000px' )
|
||||
.html( 'abcdefghijklmnopqrstuvwxyz' )
|
||||
.appendTo( document.body );
|
||||
}
|
||||
|
||||
// get the width/height of element after applying a fake font
|
||||
width = element
|
||||
.css('font-family', '__FAKEFONT__')
|
||||
.width();
|
||||
height = element.height();
|
||||
|
||||
// set test font
|
||||
element.css('font-family', fontName);
|
||||
|
||||
return width !== element.width() || height !== element.height();
|
||||
}
|
||||
|
||||
$.fn.setBlankText = function(){
|
||||
this.live("blur", function(){
|
||||
var default_value = $(this).attr("rel");
|
||||
if ($(this).val() == ""){
|
||||
$(this).val(default_value);
|
||||
$(this).css('font-style','italic');
|
||||
$(this).css('color','#999');
|
||||
}
|
||||
|
||||
}).live("focus", function(){
|
||||
var default_value = $(this).attr("rel");
|
||||
if ($(this).val() == default_value){
|
||||
$(this).val("");
|
||||
$(this).css('font-style','normal');
|
||||
$(this).css('color','#444');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// export option section
|
||||
var panel_form = jQuery('#goodlayer-panel-form');
|
||||
var export_option_button = jQuery('#gdl_export_option_button');
|
||||
var export_option_field = export_option_button.siblings('#gdl_export_option_text');
|
||||
|
||||
export_option_button.click(function(){
|
||||
export_option_field.val(panel_form.serialize());
|
||||
|
||||
jQuery('#panel-element-save-complete').children(".panel-element-save-text").html("<span class='alert-err'>Export Complete</span>");
|
||||
var y = jQuery(window).scrollTop() + 140;
|
||||
jQuery('#panel-element-save-complete').css('top', y);
|
||||
jQuery('#panel-element-save-complete').show().delay('1000').fadeOut();
|
||||
});
|
||||
jQuery('#gdl_import_option_button').click(function(){
|
||||
var import_button = jQuery(this);
|
||||
jQuery.confirm({
|
||||
'message' : 'Are you sure to do this?',
|
||||
'buttons' : {
|
||||
'Yes' : {
|
||||
'class' : 'confirm-yes',
|
||||
'action': function(){
|
||||
var import_field = import_button.siblings('#gdl_import_option_text');
|
||||
|
||||
var loading = panel_form.find('.loading-save-changes');
|
||||
loading.addClass('now-loading');
|
||||
jQuery.post(ajaxurl,import_field.val(),function(data){
|
||||
if( data.success == "-1" ){
|
||||
jQuery('#panel-element-save-complete').children(".panel-element-save-text").html("<span class='alert-err'>" + data.alert + "</span>");
|
||||
var y = jQuery(window).scrollTop() + 140;
|
||||
jQuery('#panel-element-save-complete').css('top', y);
|
||||
jQuery('#panel-element-save-complete').show().delay('5000').fadeOut();
|
||||
loading.removeClass('now-loading');
|
||||
}else{
|
||||
location.reload();
|
||||
}
|
||||
|
||||
|
||||
}, 'json');
|
||||
return false;
|
||||
}
|
||||
},
|
||||
'No' : {
|
||||
'class' : 'confirm-no',
|
||||
'action': function(){ return false; }
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
// export color section
|
||||
var panel_elements = jQuery('#panel-elements');
|
||||
var export_button = jQuery('#gdl_export_color_button');
|
||||
var export_field = export_button.siblings('#gdl_export_color_text');
|
||||
|
||||
export_button.click(function(){
|
||||
var all_color_input = panel_elements.find('input.color-picker');
|
||||
var color_code = '';
|
||||
|
||||
all_color_input.each(function(){
|
||||
color_code = color_code + jQuery(this).attr('name') + '=' + jQuery(this).val() + ',';
|
||||
});
|
||||
export_field.val(color_code);
|
||||
|
||||
jQuery('#panel-element-save-complete').children(".panel-element-save-text").html("<span class='alert-err'>Export Complete</span>");
|
||||
var y = jQuery(window).scrollTop() + 140;
|
||||
jQuery('#panel-element-save-complete').css('top', y);
|
||||
jQuery('#panel-element-save-complete').show().delay('1000').fadeOut();
|
||||
});
|
||||
|
||||
jQuery('#gdl_import_color_button').click(function(){
|
||||
var import_field = jQuery(this).siblings('#gdl_import_color_text');
|
||||
var all_color_input = import_field.val();
|
||||
|
||||
var equal_pos = all_color_input.indexOf('=');
|
||||
var comma_pos = all_color_input.indexOf(',');
|
||||
while( equal_pos >= 0 && comma_pos >= 0 ){
|
||||
var name = all_color_input.substr(0, equal_pos);
|
||||
var color_val = all_color_input.substr(equal_pos+1, comma_pos-(equal_pos+1))
|
||||
|
||||
jQuery('input[name="' + name + '"]').val(color_val).trigger('keyup.miniColors');
|
||||
|
||||
all_color_input = all_color_input.substr(comma_pos + 1);
|
||||
equal_pos = all_color_input.indexOf('=');
|
||||
comma_pos = all_color_input.indexOf(',');
|
||||
}
|
||||
|
||||
jQuery('#panel-element-save-complete').children(".panel-element-save-text").html("<span class='alert-err'>Import Complete</span>");
|
||||
var y = jQuery(window).scrollTop() + 140;
|
||||
jQuery('#panel-element-save-complete').css('top', y);
|
||||
jQuery('#panel-element-save-complete').show().delay('1000').fadeOut();
|
||||
});
|
||||
|
||||
})(jQuery);
|
@ -0,0 +1,110 @@
|
||||
/**
|
||||
* Goodlayers Image Picker File
|
||||
* ---------------------------------------------------------------------
|
||||
* @version 1.0
|
||||
* @author Goodlayers
|
||||
* @link http://goodlayers.com
|
||||
* @copyright Copyright (c) Goodlayers
|
||||
* ---------------------------------------------------------------------
|
||||
* This file contains the jQuery script for slider image chooser
|
||||
* ---------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
jQuery(document).ready(function(){
|
||||
|
||||
// Decide to show select-image-none element for each image chooser
|
||||
jQuery('.image-picker').each(function(){
|
||||
if(jQuery(this).find('#selected-image ul').children().size() > 1 ){
|
||||
jQuery(this).find('#selected-image-none').css('display','none');
|
||||
}
|
||||
});
|
||||
|
||||
// Bind the edit and delete image button
|
||||
jQuery('.edit-image').click(function(){
|
||||
jQuery(this).parents('li').find('#slider-detail-wrapper').fadeIn();
|
||||
});
|
||||
jQuery('.gdl-button#gdl-detail-edit-done').click(function(){
|
||||
jQuery(this).parents('#slider-detail-wrapper').fadeOut();
|
||||
});
|
||||
jQuery('.unpick-image').click(function(){
|
||||
jQuery(this).bindImagePickerUnpick();
|
||||
});
|
||||
jQuery.fn.bindImagePickerUnpick = function(){
|
||||
var deleted_image = jQuery(this);
|
||||
|
||||
jQuery.confirm({
|
||||
'message' : 'Are you sure to do this?',
|
||||
'buttons' : {
|
||||
'Delete' : {
|
||||
'class' : 'confirm-yes',
|
||||
'action': function(){
|
||||
deleted_image.parents('li').slideUp('200',function(){
|
||||
jQuery(this).remove();
|
||||
});
|
||||
if ( deleted_image.parents('#image-picker').find('#selected-image ul').children().size() == 2 ){
|
||||
deleted_image.parents('#image-picker').find('#selected-image-none').slideDown();
|
||||
}
|
||||
deleted_image.parents('#image-picker').find('input#slider-num').attr('value',function(){
|
||||
return parseInt(jQuery(this).attr('value')) - 1;
|
||||
});
|
||||
}
|
||||
},
|
||||
'Cancel' : {
|
||||
'class' : 'confirm-no',
|
||||
'action': function(){ return false; }
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// Bind the navigation bar and call server using ajax to get the media for each page
|
||||
jQuery('div.selected-image ul').sortable({ tolerance: 'pointer', forcePlaceholderSize: true, placeholder: 'slider-placeholder', cancel: '.slider-detail-wrapper' });
|
||||
jQuery('.media-gallery-nav ul a li').click(function(){
|
||||
jQuery(this).bindImagePickerClickPage();
|
||||
});
|
||||
jQuery.fn.bindImagePickerClickPage = function(){
|
||||
var image_picker = jQuery(this).parents('#image-picker');
|
||||
var current_gallery = image_picker.find('#media-image-gallery');
|
||||
var paged = jQuery(this).attr('rel');
|
||||
current_gallery.slideUp('200');
|
||||
image_picker.find('#show-media-text').html('Loading');
|
||||
image_picker.find('#show-media-image').addClass('loading-media-image');
|
||||
jQuery.post(ajaxurl,{ action:'get_media_image', page: paged },function(data){
|
||||
paged='';
|
||||
current_gallery.html(data);
|
||||
current_gallery.find('ul li img').bind('click',function(){
|
||||
jQuery(this).bindImagePickerChooseItem();
|
||||
});
|
||||
current_gallery.find('#media-gallery-nav ul a li').bind('click',function(){
|
||||
jQuery(this).bindImagePickerClickPage();
|
||||
});
|
||||
current_gallery.slideDown('200');
|
||||
image_picker.find('#show-media-text').html('');
|
||||
image_picker.find('#show-media-image').removeClass();
|
||||
});
|
||||
}
|
||||
|
||||
// Bind the image when user choose item
|
||||
jQuery('.image-picker').find('#media-image-gallery').find('ul li img').click(function(){
|
||||
jQuery(this).bindImagePickerChooseItem();
|
||||
});
|
||||
jQuery.fn.bindImagePickerChooseItem = function(){
|
||||
var clone = jQuery(this).parents('#image-picker').find('#default').clone(true);
|
||||
clone.find('input, textarea, select').attr('name',function(){
|
||||
return jQuery(this).attr('id') + '[]';
|
||||
});
|
||||
clone.attr('id','slider-image-init');
|
||||
clone.attr('class','slider-image-init');
|
||||
clone.css('display','none');
|
||||
clone.find('.slider-image-url').attr('value', jQuery(this).attr('attid'));
|
||||
clone.find('img').attr('src',jQuery(this).attr('rel'));
|
||||
clone.find('img').attr('rel', jQuery(this).attr('rel'));
|
||||
jQuery(this).parents('#image-picker').find('#selected-image-none').slideUp();
|
||||
jQuery(this).parents('#image-picker').find('#selected-image ul').append(clone);
|
||||
jQuery(this).parents('#image-picker').find('#selected-image ul li').not('#default').slideDown('200');
|
||||
jQuery(this).parents('#image-picker').find('input#slider-num').attr('value',function(){
|
||||
return parseInt(jQuery(this).attr('value')) + 1;
|
||||
});
|
||||
}
|
||||
|
||||
});
|
@ -0,0 +1,54 @@
|
||||
(function($){
|
||||
|
||||
$.confirm = function(params){
|
||||
|
||||
if($('#confirmOverlay').length){
|
||||
// A confirm is already shown on the page:
|
||||
return false;
|
||||
}
|
||||
|
||||
var buttonHTML = '';
|
||||
$.each(params.buttons,function(name,obj){
|
||||
|
||||
// Generating the markup for the buttons:
|
||||
|
||||
buttonHTML += '<div class="button '+obj['class']+'">'+name+'</div>';
|
||||
|
||||
if(!obj.action){
|
||||
obj.action = function(){};
|
||||
}
|
||||
});
|
||||
var markup = [
|
||||
'<div id="confirmOverlay">',
|
||||
'<div id="confirmBox">',
|
||||
'<div id="confirmText">',params.message,'</div>',
|
||||
'<div id="confirmButtons">',
|
||||
buttonHTML,
|
||||
'<br class="clear"></div></div></div>'
|
||||
].join('');
|
||||
|
||||
$(markup).hide().appendTo('body').fadeIn();
|
||||
|
||||
var buttons = $('#confirmBox .button'),
|
||||
i = 0;
|
||||
|
||||
$.each(params.buttons,function(name,obj){
|
||||
buttons.eq(i++).click(function(){
|
||||
|
||||
// Calling the action attribute when a
|
||||
// click occurs, and hiding the confirm.
|
||||
|
||||
obj.action();
|
||||
$.confirm.hide();
|
||||
return false;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
$.confirm.hide = function(){
|
||||
$('#confirmOverlay').fadeOut(function(){
|
||||
$(this).remove();
|
||||
});
|
||||
}
|
||||
|
||||
})(jQuery);
|
9266
wp-content/themes/worldwide-v1-01/include/javascript/jquery.js
vendored
Normal file
@ -0,0 +1,580 @@
|
||||
/*
|
||||
* jQuery miniColors: A small color selector
|
||||
*
|
||||
* Copyright 2011 Cory LaViska for A Beautiful Site, LLC. (http://abeautifulsite.net/)
|
||||
*
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses
|
||||
*
|
||||
*/
|
||||
if(jQuery) (function($) {
|
||||
|
||||
$.extend($.fn, {
|
||||
|
||||
miniColors: function(o, data) {
|
||||
|
||||
var create = function(input, o, data) {
|
||||
//
|
||||
// Creates a new instance of the miniColors selector
|
||||
//
|
||||
|
||||
// Determine initial color (defaults to white)
|
||||
var color = expandHex(input.val());
|
||||
if( !color ) color = 'ffffff';
|
||||
var hsb = hex2hsb(color);
|
||||
|
||||
// Create trigger
|
||||
var trigger = $('<a class="miniColors-trigger" style="background-color: #' + color + '" href="#"></a>');
|
||||
trigger.insertAfter(input);
|
||||
|
||||
// Set input data and update attributes
|
||||
input
|
||||
.addClass('miniColors')
|
||||
.data('original-maxlength', input.attr('maxlength') || null)
|
||||
.data('original-autocomplete', input.attr('autocomplete') || null)
|
||||
.data('letterCase', 'lowercase')
|
||||
.data('trigger', trigger)
|
||||
.data('hsb', hsb)
|
||||
.data('change', o.change ? o.change : null)
|
||||
.data('close', o.close ? o.close : null)
|
||||
.data('open', o.open ? o.open : null)
|
||||
.attr('maxlength', 7)
|
||||
.attr('autocomplete', 'off')
|
||||
.val('#' + convertCase(color, o.letterCase));
|
||||
|
||||
// Handle options
|
||||
if( o.readonly ) input.prop('readonly', true);
|
||||
if( o.disabled ) disable(input);
|
||||
|
||||
// Show selector when trigger is clicked
|
||||
trigger.bind('click.miniColors', function(event) {
|
||||
event.preventDefault();
|
||||
if( input.val() === '' ) input.val('#');
|
||||
show(input);
|
||||
|
||||
});
|
||||
|
||||
// Show selector when input receives focus
|
||||
input.bind('focus.miniColors', function(event) {
|
||||
if( input.val() === '' ) input.val('#');
|
||||
show(input);
|
||||
});
|
||||
|
||||
// Hide on blur
|
||||
input.bind('blur.miniColors', function(event) {
|
||||
var hex = expandHex( hsb2hex(input.data('hsb')) );
|
||||
input.val( hex ? '#' + convertCase(hex, input.data('letterCase')) : '' );
|
||||
});
|
||||
|
||||
// Hide when tabbing out of the input
|
||||
input.bind('keydown.miniColors', function(event) {
|
||||
if( event.keyCode === 9 ) hide(input);
|
||||
});
|
||||
|
||||
// Update when color is typed in
|
||||
input.bind('keyup.miniColors', function(event) {
|
||||
setColorFromInput(input);
|
||||
});
|
||||
|
||||
// Handle pasting
|
||||
input.bind('paste.miniColors', function(event) {
|
||||
// Short pause to wait for paste to complete
|
||||
setTimeout( function() {
|
||||
setColorFromInput(input);
|
||||
}, 5);
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
var destroy = function(input) {
|
||||
//
|
||||
// Destroys an active instance of the miniColors selector
|
||||
//
|
||||
|
||||
hide();
|
||||
input = $(input);
|
||||
|
||||
// Restore to original state
|
||||
input.data('trigger').remove();
|
||||
input
|
||||
.attr('autocomplete', input.data('original-autocomplete'))
|
||||
.attr('maxlength', input.data('original-maxlength'))
|
||||
.removeData()
|
||||
.removeClass('miniColors')
|
||||
.unbind('.miniColors');
|
||||
$(document).unbind('.miniColors');
|
||||
};
|
||||
|
||||
var enable = function(input) {
|
||||
//
|
||||
// Enables the input control and the selector
|
||||
//
|
||||
input
|
||||
.prop('disabled', false)
|
||||
.data('trigger')
|
||||
.css('opacity', 1);
|
||||
};
|
||||
|
||||
var disable = function(input) {
|
||||
//
|
||||
// Disables the input control and the selector
|
||||
//
|
||||
hide(input);
|
||||
input
|
||||
.prop('disabled', true)
|
||||
.data('trigger')
|
||||
.css('opacity', 0.5);
|
||||
};
|
||||
|
||||
var show = function(input) {
|
||||
//
|
||||
// Shows the miniColors selector
|
||||
//
|
||||
if( input.prop('disabled') ) return false;
|
||||
|
||||
// Hide all other instances
|
||||
hide();
|
||||
|
||||
// Generate the selector
|
||||
var selector = $('<div class="miniColors-selector"></div>');
|
||||
selector
|
||||
.append('<div class="miniColors-colors" style="background-color: #FFF;"><div class="miniColors-colorPicker"><div class="miniColors-colorPicker-inner"></div></div>')
|
||||
.append('<div class="miniColors-hues"><div class="miniColors-huePicker"></div></div>')
|
||||
.css({
|
||||
top: input.is(':visible') ? input.offset().top + input.outerHeight() : input.data('trigger').offset().top + input.data('trigger').outerHeight(),
|
||||
left: input.is(':visible') ? input.offset().left : input.data('trigger').offset().left,
|
||||
display: 'none'
|
||||
})
|
||||
.addClass( input.attr('class') );
|
||||
|
||||
// Set background for colors
|
||||
var hsb = input.data('hsb');
|
||||
selector
|
||||
.find('.miniColors-colors')
|
||||
.css('backgroundColor', '#' + hsb2hex({ h: hsb.h, s: 100, b: 100 }));
|
||||
|
||||
// Set colorPicker position
|
||||
var colorPosition = input.data('colorPosition');
|
||||
if( !colorPosition ) colorPosition = getColorPositionFromHSB(hsb);
|
||||
selector.find('.miniColors-colorPicker')
|
||||
.css('top', colorPosition.y + 'px')
|
||||
.css('left', colorPosition.x + 'px');
|
||||
|
||||
// Set huePicker position
|
||||
var huePosition = input.data('huePosition');
|
||||
if( !huePosition ) huePosition = getHuePositionFromHSB(hsb);
|
||||
selector.find('.miniColors-huePicker').css('top', huePosition.y + 'px');
|
||||
|
||||
// Set input data
|
||||
input
|
||||
.data('selector', selector)
|
||||
.data('huePicker', selector.find('.miniColors-huePicker'))
|
||||
.data('colorPicker', selector.find('.miniColors-colorPicker'))
|
||||
.data('mousebutton', 0);
|
||||
|
||||
$('BODY').append(selector);
|
||||
selector.fadeIn(100);
|
||||
|
||||
// Prevent text selection in IE
|
||||
selector.bind('selectstart', function() { return false; });
|
||||
|
||||
$(document).bind('mousedown.miniColors touchstart.miniColors', function(event) {
|
||||
|
||||
input.data('mousebutton', 1);
|
||||
var testSubject = $(event.target).parents().andSelf();
|
||||
|
||||
if( testSubject.hasClass('miniColors-colors') ) {
|
||||
event.preventDefault();
|
||||
input.data('moving', 'colors');
|
||||
moveColor(input, event);
|
||||
}
|
||||
|
||||
if( testSubject.hasClass('miniColors-hues') ) {
|
||||
event.preventDefault();
|
||||
input.data('moving', 'hues');
|
||||
moveHue(input, event);
|
||||
}
|
||||
|
||||
if( testSubject.hasClass('miniColors-selector') ) {
|
||||
event.preventDefault();
|
||||
return;
|
||||
}
|
||||
|
||||
if( testSubject.hasClass('miniColors') ) return;
|
||||
|
||||
hide(input);
|
||||
});
|
||||
|
||||
$(document)
|
||||
.bind('mouseup.miniColors touchend.miniColors', function(event) {
|
||||
event.preventDefault();
|
||||
input.data('mousebutton', 0).removeData('moving');
|
||||
})
|
||||
.bind('mousemove.miniColors touchmove.miniColors', function(event) {
|
||||
event.preventDefault();
|
||||
if( input.data('mousebutton') === 1 ) {
|
||||
if( input.data('moving') === 'colors' ) moveColor(input, event);
|
||||
if( input.data('moving') === 'hues' ) moveHue(input, event);
|
||||
}
|
||||
});
|
||||
|
||||
// Fire open callback
|
||||
if( input.data('open') ) {
|
||||
input.data('open').call(input.get(0), '#' + hsb2hex(hsb), hsb2rgb(hsb));
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
var hide = function(input) {
|
||||
|
||||
//
|
||||
// Hides one or more miniColors selectors
|
||||
//
|
||||
|
||||
// Hide all other instances if input isn't specified
|
||||
if( !input ) input = '.miniColors';
|
||||
|
||||
$(input).each( function() {
|
||||
var selector = $(this).data('selector');
|
||||
$(this).removeData('selector');
|
||||
$(selector).fadeOut(100, function() {
|
||||
// Fire close callback
|
||||
if( input.data('close') ) {
|
||||
var hsb = input.data('hsb'), hex = hsb2hex(hsb);
|
||||
input.data('close').call(input.get(0), '#' + hex, hsb2rgb(hsb));
|
||||
}
|
||||
$(this).remove();
|
||||
});
|
||||
});
|
||||
|
||||
$(document).unbind('.miniColors');
|
||||
|
||||
};
|
||||
|
||||
var moveColor = function(input, event) {
|
||||
|
||||
var colorPicker = input.data('colorPicker');
|
||||
|
||||
colorPicker.hide();
|
||||
|
||||
var position = {
|
||||
x: event.pageX,
|
||||
y: event.pageY
|
||||
};
|
||||
|
||||
// Touch support
|
||||
if( event.originalEvent.changedTouches ) {
|
||||
position.x = event.originalEvent.changedTouches[0].pageX;
|
||||
position.y = event.originalEvent.changedTouches[0].pageY;
|
||||
}
|
||||
position.x = position.x - input.data('selector').find('.miniColors-colors').offset().left - 5;
|
||||
position.y = position.y - input.data('selector').find('.miniColors-colors').offset().top - 5;
|
||||
if( position.x <= -5 ) position.x = -5;
|
||||
if( position.x >= 144 ) position.x = 144;
|
||||
if( position.y <= -5 ) position.y = -5;
|
||||
if( position.y >= 144 ) position.y = 144;
|
||||
|
||||
input.data('colorPosition', position);
|
||||
colorPicker.css('left', position.x).css('top', position.y).show();
|
||||
|
||||
// Calculate saturation
|
||||
var s = Math.round((position.x + 5) * 0.67);
|
||||
if( s < 0 ) s = 0;
|
||||
if( s > 100 ) s = 100;
|
||||
|
||||
// Calculate brightness
|
||||
var b = 100 - Math.round((position.y + 5) * 0.67);
|
||||
if( b < 0 ) b = 0;
|
||||
if( b > 100 ) b = 100;
|
||||
|
||||
// Update HSB values
|
||||
var hsb = input.data('hsb');
|
||||
hsb.s = s;
|
||||
hsb.b = b;
|
||||
|
||||
// Set color
|
||||
setColor(input, hsb, true);
|
||||
};
|
||||
|
||||
var moveHue = function(input, event) {
|
||||
|
||||
var huePicker = input.data('huePicker');
|
||||
|
||||
huePicker.hide();
|
||||
|
||||
var position = {
|
||||
y: event.pageY
|
||||
};
|
||||
|
||||
// Touch support
|
||||
if( event.originalEvent.changedTouches ) {
|
||||
position.y = event.originalEvent.changedTouches[0].pageY;
|
||||
}
|
||||
|
||||
position.y = position.y - input.data('selector').find('.miniColors-colors').offset().top - 1;
|
||||
if( position.y <= -1 ) position.y = -1;
|
||||
if( position.y >= 149 ) position.y = 149;
|
||||
input.data('huePosition', position);
|
||||
huePicker.css('top', position.y).show();
|
||||
|
||||
// Calculate hue
|
||||
var h = Math.round((150 - position.y - 1) * 2.4);
|
||||
if( h < 0 ) h = 0;
|
||||
if( h > 360 ) h = 360;
|
||||
|
||||
// Update HSB values
|
||||
var hsb = input.data('hsb');
|
||||
hsb.h = h;
|
||||
|
||||
// Set color
|
||||
setColor(input, hsb, true);
|
||||
|
||||
};
|
||||
|
||||
var setColor = function(input, hsb, updateInput) {
|
||||
input.data('hsb', hsb);
|
||||
var hex = hsb2hex(hsb);
|
||||
if( updateInput ) input.val( '#' + convertCase(hex, input.data('letterCase')) );
|
||||
input.data('trigger').css('backgroundColor', '#' + hex);
|
||||
if( input.data('selector') ) input.data('selector').find('.miniColors-colors').css('backgroundColor', '#' + hsb2hex({ h: hsb.h, s: 100, b: 100 }));
|
||||
|
||||
// Fire change callback
|
||||
if( input.data('change') ) {
|
||||
if( hex === input.data('lastChange') ) return;
|
||||
input.data('change').call(input.get(0), '#' + hex, hsb2rgb(hsb));
|
||||
input.data('lastChange', hex);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
var setColorFromInput = function(input) {
|
||||
|
||||
input.val('#' + cleanHex(input.val()));
|
||||
var hex = expandHex(input.val());
|
||||
if( !hex ) return false;
|
||||
|
||||
// Get HSB equivalent
|
||||
var hsb = hex2hsb(hex);
|
||||
|
||||
// If color is the same, no change required
|
||||
var currentHSB = input.data('hsb');
|
||||
if( hsb.h === currentHSB.h && hsb.s === currentHSB.s && hsb.b === currentHSB.b ) return true;
|
||||
|
||||
// Set colorPicker position
|
||||
var colorPosition = getColorPositionFromHSB(hsb);
|
||||
var colorPicker = $(input.data('colorPicker'));
|
||||
colorPicker.css('top', colorPosition.y + 'px').css('left', colorPosition.x + 'px');
|
||||
input.data('colorPosition', colorPosition);
|
||||
|
||||
// Set huePosition position
|
||||
var huePosition = getHuePositionFromHSB(hsb);
|
||||
var huePicker = $(input.data('huePicker'));
|
||||
huePicker.css('top', huePosition.y + 'px');
|
||||
input.data('huePosition', huePosition);
|
||||
|
||||
setColor(input, hsb);
|
||||
|
||||
return true;
|
||||
|
||||
};
|
||||
|
||||
var convertCase = function(string, letterCase) {
|
||||
if( letterCase === 'lowercase' ) return string.toLowerCase();
|
||||
if( letterCase === 'uppercase' ) return string.toUpperCase();
|
||||
return string;
|
||||
};
|
||||
|
||||
var getColorPositionFromHSB = function(hsb) {
|
||||
var x = Math.ceil(hsb.s / 0.67);
|
||||
if( x < 0 ) x = 0;
|
||||
if( x > 150 ) x = 150;
|
||||
var y = 150 - Math.ceil(hsb.b / 0.67);
|
||||
if( y < 0 ) y = 0;
|
||||
if( y > 150 ) y = 150;
|
||||
return { x: x - 5, y: y - 5 };
|
||||
};
|
||||
|
||||
var getHuePositionFromHSB = function(hsb) {
|
||||
var y = 150 - (hsb.h / 2.4);
|
||||
if( y < 0 ) h = 0;
|
||||
if( y > 150 ) h = 150;
|
||||
return { y: y - 1 };
|
||||
};
|
||||
|
||||
var cleanHex = function(hex) {
|
||||
return hex.replace(/[^A-F0-9]/ig, '');
|
||||
};
|
||||
|
||||
var expandHex = function(hex) {
|
||||
hex = cleanHex(hex);
|
||||
if( !hex ) return null;
|
||||
if( hex.length === 3 ) hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2];
|
||||
return hex.length === 6 ? hex : null;
|
||||
};
|
||||
|
||||
var hsb2rgb = 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)
|
||||
};
|
||||
};
|
||||
|
||||
var rgb2hex = 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('');
|
||||
};
|
||||
|
||||
var hex2rgb = function(hex) {
|
||||
hex = parseInt(((hex.indexOf('#') > -1) ? hex.substring(1) : hex), 16);
|
||||
|
||||
return {
|
||||
r: hex >> 16,
|
||||
g: (hex & 0x00FF00) >> 8,
|
||||
b: (hex & 0x0000FF)
|
||||
};
|
||||
};
|
||||
|
||||
var rgb2hsb = 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;
|
||||
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;
|
||||
};
|
||||
|
||||
var hex2hsb = function(hex) {
|
||||
var hsb = rgb2hsb(hex2rgb(hex));
|
||||
// Zero out hue marker for black, white, and grays (saturation === 0)
|
||||
if( hsb.s === 0 ) hsb.h = 360;
|
||||
return hsb;
|
||||
};
|
||||
|
||||
var hsb2hex = function(hsb) {
|
||||
return rgb2hex(hsb2rgb(hsb));
|
||||
};
|
||||
|
||||
|
||||
// Handle calls to $([selector]).miniColors()
|
||||
switch(o) {
|
||||
|
||||
case 'readonly':
|
||||
|
||||
$(this).each( function() {
|
||||
if( !$(this).hasClass('miniColors') ) return;
|
||||
$(this).prop('readonly', data);
|
||||
});
|
||||
|
||||
return $(this);
|
||||
|
||||
case 'disabled':
|
||||
|
||||
$(this).each( function() {
|
||||
if( !$(this).hasClass('miniColors') ) return;
|
||||
if( data ) {
|
||||
disable($(this));
|
||||
} else {
|
||||
enable($(this));
|
||||
}
|
||||
});
|
||||
|
||||
return $(this);
|
||||
|
||||
case 'value':
|
||||
|
||||
// Getter
|
||||
if( data === undefined ) {
|
||||
if( !$(this).hasClass('miniColors') ) return;
|
||||
var input = $(this),
|
||||
hex = expandHex(input.val());
|
||||
return hex ? '#' + convertCase(hex, input.data('letterCase')) : null;
|
||||
}
|
||||
|
||||
// Setter
|
||||
$(this).each( function() {
|
||||
if( !$(this).hasClass('miniColors') ) return;
|
||||
$(this).val(data);
|
||||
setColorFromInput($(this));
|
||||
});
|
||||
|
||||
return $(this);
|
||||
|
||||
case 'destroy':
|
||||
|
||||
$(this).each( function() {
|
||||
if( !$(this).hasClass('miniColors') ) return;
|
||||
destroy($(this));
|
||||
});
|
||||
|
||||
return $(this);
|
||||
|
||||
default:
|
||||
|
||||
if( !o ) o = {};
|
||||
|
||||
$(this).each( function() {
|
||||
|
||||
// Must be called on an input element
|
||||
if( $(this)[0].tagName.toLowerCase() !== 'input' ) return;
|
||||
|
||||
// If a trigger is present, the control was already created
|
||||
if( $(this).data('trigger') ) return;
|
||||
|
||||
// Create the control
|
||||
create($(this), o, data);
|
||||
|
||||
});
|
||||
|
||||
return $(this);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
})(jQuery);
|
@ -0,0 +1,350 @@
|
||||
/**
|
||||
* Goodlayers Page Dragging File
|
||||
* ---------------------------------------------------------------------
|
||||
* @version 1.0
|
||||
* @author Goodlayers
|
||||
* @link http://goodlayers.com
|
||||
* @copyright Copyright (c) Goodlayers
|
||||
* ---------------------------------------------------------------------
|
||||
* This file contains the jQuery script for Page Dragging
|
||||
* ---------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
jQuery(document).ready(function(){
|
||||
|
||||
// All of size that div can be (text, class, value)
|
||||
var DIV_SIZE = [
|
||||
['1/4','element1-4',1/4,['Column','Gallery','Content','Personnal','Page','Portfolio','Testimonial','Post-Slider','Slider','Accordion','Tab','Divider','Message-Box','Toggle-Box','Column-Service','Price-Item','Blog']],
|
||||
['1/3','element1-3',1/3,['Column','Gallery','Content','Personnal','Page','Portfolio','Testimonial','Post-Slider','Slider','Accordion','Tab','Divider','Message-Box','Toggle-Box','Column-Service','Price-Item','Blog']],
|
||||
['1/2','element1-2',1/2,['Column','Gallery','Content','Personnal','Page','Portfolio','Testimonial','Post-Slider','Slider','Accordion','Tab','Divider','Message-Box','Toggle-Box','Column-Service','Price-Item','Blog']],
|
||||
['2/3','element2-3',2/3,['Column','Gallery','Content','Personnal','Page','Portfolio','Testimonial','Post-Slider','Slider','Accordion','Tab','Divider','Message-Box','Toggle-Box','Column-Service','Price-Item','Blog']],
|
||||
['3/4','element3-4',3/4,['Column','Gallery','Content','Personnal','Page','Portfolio','Testimonial','Post-Slider','Slider','Accordion','Tab','Divider','Message-Box','Toggle-Box','Column-Service','Price-Item','Blog']],
|
||||
['1/1','element1-1',1 ,['Column','Gallery','Content','Personnal','Page','Portfolio','Testimonial','Post-Slider','Slider','Accordion','Tab','Divider','Message-Box','Toggle-Box','Column-Service','Price-Item','Blog','Stunning-Text','Contact-Form']]
|
||||
];
|
||||
|
||||
var page_item_list = jQuery("#page-element-lists");
|
||||
var page_methodology = jQuery('#page-methodology');
|
||||
var page_alignment_val = '';
|
||||
|
||||
//Bind sidebar template option
|
||||
jQuery('input[name="page-option-sidebar-template"]').change(function(){
|
||||
jQuery(this).parent().parent().find(".check-list").removeClass("check-list");
|
||||
jQuery(this).siblings("label").children("#check-list").addClass("check-list");
|
||||
if(jQuery(this).val() == "left-sidebar"){
|
||||
jQuery("#page-option-choose-left-sidebar").parents(".meta-body").slideDown();
|
||||
jQuery("#page-option-choose-right-sidebar").parents(".meta-body").slideUp();
|
||||
}else if(jQuery(this).val() == "right-sidebar"){
|
||||
jQuery("#page-option-choose-left-sidebar").parents(".meta-body").slideUp();
|
||||
jQuery("#page-option-choose-right-sidebar").parents(".meta-body").slideDown();
|
||||
}else if(jQuery(this).val() == "both-sidebar" || jQuery(this).val() == "both-sidebar-reverse"){
|
||||
jQuery("#page-option-choose-left-sidebar").parents(".meta-body").slideDown();
|
||||
jQuery("#page-option-choose-right-sidebar").parents(".meta-body").slideDown();
|
||||
}else{
|
||||
jQuery("#page-option-choose-left-sidebar").parents(".meta-body").slideUp();
|
||||
jQuery("#page-option-choose-right-sidebar").parents(".meta-body").slideUp();
|
||||
}
|
||||
});
|
||||
jQuery('input[name="page-option-sidebar-template"]:checked').triggerHandler("change");
|
||||
|
||||
// Change the style of <select>
|
||||
if (!jQuery.browser.opera) {
|
||||
jQuery('.meta-input .combobox select').each(function(){
|
||||
var title = jQuery(this).attr('title');
|
||||
if( jQuery('option:selected', this).val() != '' ) title = jQuery('option:selected',this).text();
|
||||
jQuery(this)
|
||||
.css({'z-index':10,'opacity':0,'-khtml-appearance':'none'})
|
||||
.after('<span rel="combobox">' + title + '</span>')
|
||||
.change(function(){
|
||||
val = jQuery('option:selected',this).text();
|
||||
jQuery(this).next().text(val);
|
||||
})
|
||||
});
|
||||
};
|
||||
|
||||
//Bind the delete element button
|
||||
var init_object = jQuery("div#gdl-overlay-wrapper");
|
||||
init_object.find(".delete-element").click(function(){
|
||||
|
||||
var deleted_element = jQuery(this).parents('#page-element');
|
||||
|
||||
jQuery.confirm({
|
||||
'message' : 'Are you sure to do this?',
|
||||
'buttons' : {
|
||||
'Delete' : {
|
||||
'class' : 'confirm-yes',
|
||||
'action': function(){
|
||||
deleted_element.fadeOut( function(){jQuery(this).remove();} );
|
||||
}
|
||||
},
|
||||
'Cancel' : {
|
||||
'class' : 'confirm-no',
|
||||
'action': function(){ return false; }
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//Add Element Size
|
||||
init_object.find(".add-element-size").click(function(){
|
||||
jQuery(this).gdlPageAddElementSize();
|
||||
});
|
||||
jQuery.fn.gdlPageAddElementSize = function(){
|
||||
var click_object = jQuery(this).parents('#page-element');
|
||||
var object_type = click_object.attr('rel');
|
||||
var is_upper_style = false;
|
||||
var current_style = '';
|
||||
for(var i=0; i<DIV_SIZE.length-1; i++){
|
||||
if(click_object.hasClass(DIV_SIZE[i][1])){
|
||||
is_upper_style = true;
|
||||
current_style = DIV_SIZE[i][1];
|
||||
}
|
||||
if( is_upper_style && jQuery.inArray(object_type,DIV_SIZE[i+1][3]) > -1){
|
||||
if( i < DIV_SIZE.length-2 ){
|
||||
click_object.removeClass(current_style).addClass(DIV_SIZE[i+1][1]);
|
||||
click_object.find("#element-size-text").html(DIV_SIZE[i+1][0]);
|
||||
click_object.find("#page-option-item-size").val(DIV_SIZE[i+1][1])
|
||||
}else if( i == DIV_SIZE.length-2){
|
||||
click_object.removeClass(current_style).addClass(DIV_SIZE[i+1][1]);
|
||||
click_object.find("#element-size-text").html(DIV_SIZE[i+1][0]);
|
||||
click_object.find("#page-option-item-size").val(DIV_SIZE[i+1][1])
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Subtract Element size
|
||||
init_object.find(".sub-element-size").click(function(){
|
||||
jQuery(this).gdlPageSubElementSize();
|
||||
});
|
||||
jQuery.fn.gdlPageSubElementSize = function(){
|
||||
var click_object = jQuery(this).parents('#page-element');
|
||||
var object_type = click_object.attr('rel');
|
||||
var is_lower_style = false;
|
||||
var current_style = '';
|
||||
for(var i=DIV_SIZE.length-1; i > 0; i--){
|
||||
if( click_object.hasClass(DIV_SIZE[i][1]) ){
|
||||
is_lower_style = true;
|
||||
current_style = DIV_SIZE[i][1];
|
||||
}
|
||||
if( is_lower_style && jQuery.inArray(object_type, DIV_SIZE[i-1][3]) > -1){
|
||||
if( i > 1 ){
|
||||
click_object.removeClass(current_style).addClass(DIV_SIZE[i-1][1]);
|
||||
click_object.find("#element-size-text").html(DIV_SIZE[i-1][0]);
|
||||
click_object.find("#page-option-item-size").val(DIV_SIZE[i-1][1])
|
||||
}else if( i == 1){
|
||||
click_object.removeClass(current_style).addClass(DIV_SIZE[i-1][1]);
|
||||
click_object.find("#element-size-text").html(DIV_SIZE[i-1][0]);
|
||||
click_object.find("#page-option-item-size").val(DIV_SIZE[i-1][1])
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Bind Add Items
|
||||
jQuery("input#page-add-item-button").click(function(){
|
||||
var selectd_list = jQuery(this).siblings(".page-select-element-list-wrapper").children("select");
|
||||
var clone_item = page_item_list.find('div[rel="' + selectd_list.val() + '"]').clone(true);
|
||||
if( clone_item ){
|
||||
clone_item.find("#page-option-item-size").attr('name',function(){
|
||||
return jQuery(this).attr('id')+ '[]';
|
||||
});
|
||||
clone_item.find("#page-option-item-type").attr('name',function(){
|
||||
return jQuery(this).attr('id')+ '[]';
|
||||
});
|
||||
clone_item.css("display","none");
|
||||
page_methodology.find("#page-selected-elements").append(clone_item);
|
||||
page_methodology.find(".page-element").fadeIn();
|
||||
}
|
||||
});
|
||||
page_methodology.find("#page-selected-elements").sortable({ forcePlaceholderSize: true, placeholder: 'placeholder' });
|
||||
|
||||
// Button effects;
|
||||
jQuery(".add-element-size").hover(function(){
|
||||
jQuery(this).addClass("add-element-size-hover");
|
||||
},function(){
|
||||
jQuery(this).removeClass("add-element-size-hover");
|
||||
});
|
||||
jQuery(".sub-element-size").hover(function(){
|
||||
jQuery(this).addClass("sub-element-size-hover");
|
||||
},function(){
|
||||
jQuery(this).removeClass("sub-element-size-hover");
|
||||
});
|
||||
|
||||
// Tab chooser
|
||||
jQuery('.page-item-tab').css('display','block');
|
||||
jQuery(".page-tab-add-more").click(function(){
|
||||
var added_tab = jQuery(this).siblings(".meta-input").children("#added-tab");
|
||||
var clone_tab = added_tab.find(".default").clone(true);
|
||||
clone_tab.attr('class','page-item-tab');
|
||||
clone_tab.find('input, textarea, select').attr('name', function(){
|
||||
return jQuery(this).attr('id') + '[]';
|
||||
});
|
||||
added_tab.siblings("#tab-num").val(function(){
|
||||
return parseInt(jQuery(this).val()) + 1;
|
||||
});
|
||||
added_tab.children("ul").append(clone_tab);
|
||||
added_tab.find('.page-item-tab').slideDown();
|
||||
|
||||
});
|
||||
jQuery(".unpick-tab").click(function(){
|
||||
var deleted_tab = jQuery(this);
|
||||
|
||||
jQuery.confirm({
|
||||
'message' : 'Are you sure to do this?',
|
||||
'buttons' : {
|
||||
'Delete' : {
|
||||
'class' : 'confirm-yes',
|
||||
'action': function(){
|
||||
deleted_tab.parents('#page-item-tab').slideUp(function(){
|
||||
jQuery(this).remove();
|
||||
});
|
||||
deleted_tab.parents("#added-tab").siblings("#tab-num").val(function(){
|
||||
return parseInt(jQuery(this).val()) - 1;
|
||||
});
|
||||
}
|
||||
},
|
||||
'Cancel' : {
|
||||
'class' : 'confirm-no',
|
||||
'action': function(){ return false; }
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Link type of slider
|
||||
jQuery("select#page-option-item-slider-linktype, select#page-option-top-slider-linktype").change(function(){
|
||||
var selected_val = jQuery(this).val();
|
||||
if(selected_val == 'No Link' || selected_val == 'Lightbox'){
|
||||
jQuery(this).parent().siblings('div').slideUp();
|
||||
}else{
|
||||
if(selected_val == 'Link to URL'){
|
||||
jQuery(this).parent().siblings('div').not('[rel="video"]').slideDown();
|
||||
jQuery(this).parent().siblings('div[rel="video"]').slideUp();
|
||||
}else{
|
||||
jQuery(this).parent().siblings('div').not('[rel="url"]').slideDown();
|
||||
jQuery(this).parent().siblings('div[rel="url"]').slideUp();
|
||||
}
|
||||
}
|
||||
});
|
||||
jQuery('select#page-option-item-slider-linktype, select#page-option-top-slider-linktype').each(function(){
|
||||
var selected_val = jQuery(this).val();
|
||||
if(selected_val == 'No Link' || selected_val == 'Lightbox'){
|
||||
jQuery(this).parent().siblings('div').css('display','none');
|
||||
}else{
|
||||
if(selected_val == 'Link to URL'){
|
||||
jQuery(this).parent().siblings('div').not('[rel="video"]').css('display','block');
|
||||
jQuery(this).parent().siblings('div[rel="video"]').css('display','none');
|
||||
}else{
|
||||
jQuery(this).parent().siblings('div').not('[rel="url"]').css('display','block');
|
||||
jQuery(this).parent().siblings('div[rel="url"]').css('display','none');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Upload Image
|
||||
jQuery("input#upload_image_text_meta").change(function(){
|
||||
jQuery(this).siblings("input[type='hidden']").val(jQuery(this).val());
|
||||
});
|
||||
jQuery('input:button.upload_image_button_meta').click(function() {
|
||||
example_image = jQuery(this).siblings("#meta-input-example-image");
|
||||
upload_text = jQuery(this).siblings("#upload_image_text_meta");
|
||||
attachment_id = jQuery(this).siblings("#upload_image_attachment_id");
|
||||
tb_show('Upload Media', 'media-upload.php?post_id=&type=image&TB_iframe=true');
|
||||
|
||||
var oldSendToEditor = window.send_to_editor;
|
||||
window.send_to_editor = function(html){
|
||||
image_url = jQuery(html).attr('href');
|
||||
thumb_url = jQuery('img',html).attr('src');
|
||||
attid = jQuery(html).attr('attid');
|
||||
|
||||
upload_text.val(image_url);
|
||||
attachment_id.val(attid);
|
||||
example_image.html('<img src=' + thumb_url + ' />');
|
||||
tb_remove();
|
||||
|
||||
window.send_to_editor = oldSendToEditor;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
// Bind No Top Slider
|
||||
jQuery('select#page-option-top-slider-types').change(function(){
|
||||
if(jQuery(this).val()=='None' || jQuery(this).val()=='Title'){
|
||||
jQuery(this).parents('.meta-body').siblings('#gdl-top-slider-wrapper').slideUp();
|
||||
jQuery(this).parents('.meta-body').siblings('#gdl-layer-slider-wrapper').slideUp();
|
||||
}else if(jQuery(this).val()=='Post Slider'){
|
||||
jQuery(this).parents('.meta-body').siblings('#gdl-top-slider-wrapper').slideUp();
|
||||
jQuery(this).parents('.meta-body').siblings('#gdl-layer-slider-wrapper').slideDown();
|
||||
}else{
|
||||
jQuery(this).parents('.meta-body').siblings('#gdl-top-slider-wrapper').slideDown();
|
||||
jQuery(this).parents('.meta-body').siblings('#gdl-layer-slider-wrapper').slideUp();
|
||||
}
|
||||
});
|
||||
jQuery('select#page-option-top-slider-types').each(function(){
|
||||
if(jQuery(this).val()=='None' || jQuery(this).val()=='Title'){
|
||||
jQuery(this).parents('.meta-body').siblings('#gdl-top-slider-wrapper').css('display','none');
|
||||
jQuery(this).parents('.meta-body').siblings('#gdl-layer-slider-wrapper').css('display','none');
|
||||
}else if(jQuery(this).val()=='Post Slider'){
|
||||
jQuery(this).parents('.meta-body').siblings('#gdl-top-slider-wrapper').css('display','none');
|
||||
jQuery(this).parents('.meta-body').siblings('#gdl-layer-slider-wrapper').css('display','block');
|
||||
}else{
|
||||
jQuery(this).parents('.meta-body').siblings('#gdl-top-slider-wrapper').css('display','block');
|
||||
jQuery(this).parents('.meta-body').siblings('#gdl-layer-slider-wrapper').css('display','none');
|
||||
}
|
||||
});
|
||||
|
||||
// Testimonial item size
|
||||
jQuery('select#page-option-item-testimonial-display-type').change(function(){
|
||||
if(jQuery(this).val()=='Carousel Testimonial'){
|
||||
jQuery(this).parents('.meta-body').siblings('.testimonial-item-size-wrapper').slideUp();
|
||||
}else{
|
||||
jQuery(this).parents('.meta-body').siblings('.testimonial-item-size-wrapper').slideDown();
|
||||
}
|
||||
});
|
||||
jQuery('select#page-option-item-testimonial-display-type').each(function(){
|
||||
if(jQuery(this).val()=='Carousel Testimonial'){
|
||||
jQuery(this).parents('.meta-body').siblings('.testimonial-item-size-wrapper').css('display','none');
|
||||
}else{
|
||||
jQuery(this).parents('.meta-body').siblings('.testimonial-item-size-wrapper').css('display','block');
|
||||
}
|
||||
});
|
||||
|
||||
// Portfolio Description
|
||||
jQuery('select#page-option-item-portfolio-type').change(function(){
|
||||
if(jQuery(this).val()!='Carousel Description Portfolio'){
|
||||
jQuery(this).parents('.meta-body').siblings('.page-option-item-portfolio-first-column-description-wrapper').slideUp();
|
||||
}else{
|
||||
jQuery(this).parents('.meta-body').siblings('.page-option-item-portfolio-first-column-description-wrapper').slideDown();
|
||||
}
|
||||
});
|
||||
jQuery('select#page-option-item-portfolio-type').each(function(){
|
||||
if(jQuery(this).val()!='Carousel Description Portfolio'){
|
||||
jQuery(this).parents('.meta-body').siblings('.page-option-item-portfolio-first-column-description-wrapper').css('display','none');
|
||||
}else{
|
||||
jQuery(this).parents('.meta-body').siblings('.page-option-item-portfolio-first-column-description-wrapper').css('display','block');
|
||||
}
|
||||
});
|
||||
|
||||
// blog widget type
|
||||
jQuery('select#page-option-item-blog-size').change(function(){
|
||||
if( jQuery(this).val() == '1/4 Blog Widget' || jQuery(this).val() == '1/3 Blog Widget' ||
|
||||
jQuery(this).val() == '1/2 Blog Widget' || jQuery(this).val() == '1/1 Blog Widget' ){
|
||||
|
||||
jQuery(this).parents('.meta-body').siblings('.page-option-item-blog-type-wrapper').slideDown();
|
||||
}else{
|
||||
jQuery(this).parents('.meta-body').siblings('.page-option-item-blog-type-wrapper').slideUp();
|
||||
}
|
||||
});
|
||||
jQuery('select#page-option-item-blog-size').each(function(){
|
||||
if( jQuery(this).val() == '1/4 Blog Widget' || jQuery(this).val() == '1/3 Blog Widget' ||
|
||||
jQuery(this).val() == '1/2 Blog Widget' || jQuery(this).val() == '1/1 Blog Widget' ){
|
||||
|
||||
jQuery(this).parents('.meta-body').siblings('.page-option-item-blog-type-wrapper').css('display','block');
|
||||
}else{
|
||||
jQuery(this).parents('.meta-body').siblings('.page-option-item-blog-type-wrapper').css('display','none');
|
||||
}
|
||||
});
|
||||
|
||||
});
|
@ -0,0 +1,175 @@
|
||||
/**
|
||||
* Goodlayers Goodlayers Backoffice Post Effects File
|
||||
* ---------------------------------------------------------------------
|
||||
* @version 1.0
|
||||
* @author Goodlayers
|
||||
* @link http://goodlayers.com
|
||||
* @copyright Copyright (c) Goodlayers
|
||||
* ---------------------------------------------------------------------
|
||||
* This file contains the jQuery script that animate the post backoffice
|
||||
* elements.
|
||||
* ---------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
jQuery(document).ready(function(){
|
||||
//Post Thumbnails
|
||||
jQuery('select#post-option-thumbnail-types').change(function(){
|
||||
var selected_option = jQuery(this).children("option:selected").val();
|
||||
if(selected_option == 'Image'){
|
||||
jQuery(this).parents("div#post-option-meta").children('div#thumbnail-video, div#thumbnail-slider, div#thumbnail-html5-video').slideUp();
|
||||
jQuery(this).parents("div#post-option-meta").children('div#thumbnail-feature-image').slideDown();
|
||||
}else if(selected_option == 'Video'){
|
||||
jQuery(this).parents("div#post-option-meta").children('div#thumbnail-feature-image, div#thumbnail-slider, div#thumbnail-html5-video').slideUp();;
|
||||
jQuery(this).parents("div#post-option-meta").children('div#thumbnail-video').slideDown();
|
||||
}else if(selected_option == 'Slider'){
|
||||
jQuery(this).parents("div#post-option-meta").children('div#thumbnail-feature-image, div#thumbnail-video, div#thumbnail-html5-video').slideUp();;
|
||||
jQuery(this).parents("div#post-option-meta").children('div#thumbnail-slider').slideDown();
|
||||
}else if(selected_option == 'HTML5 Video'){
|
||||
jQuery(this).parents("div#post-option-meta").children('div#thumbnail-feature-image, div#thumbnail-video, div#thumbnail-slider').slideUp();;
|
||||
jQuery(this).parents("div#post-option-meta").children('div#thumbnail-html5-video').slideDown();
|
||||
}
|
||||
});
|
||||
jQuery("select#post-option-thumbnail-types").triggerHandler("change");
|
||||
|
||||
jQuery('select#post-option-inside-thumbnail-types').change(function(){
|
||||
var selected_option = jQuery(this).children("option:selected").val();
|
||||
if(selected_option == 'Image'){
|
||||
jQuery(this).parents("div#post-option-meta").children('div#inside-thumbnail-video, div#inside-thumbnail-slider, div#inside-thumbnail-html5-video').slideUp();
|
||||
jQuery(this).parents("div#post-option-meta").children('div#inside-thumbnail-image').slideDown();
|
||||
}else if(selected_option == 'Video'){
|
||||
jQuery(this).parents("div#post-option-meta").children('div#inside-thumbnail-image, div#inside-thumbnail-slider, div#inside-thumbnail-html5-video').slideUp();
|
||||
jQuery(this).parents("div#post-option-meta").children('div#inside-thumbnail-video').slideDown();
|
||||
}else if(selected_option == 'Slider' || selected_option == 'Stack Images' ){
|
||||
jQuery(this).parents("div#post-option-meta").children('div#inside-thumbnail-image, div#inside-thumbnail-video, div#inside-thumbnail-html5-video').slideUp();
|
||||
jQuery(this).parents("div#post-option-meta").children('div#inside-thumbnail-slider').slideDown();
|
||||
}else if(selected_option == 'HTML5 Video'){
|
||||
jQuery(this).parents("div#post-option-meta").children('div#inside-thumbnail-image, div#inside-thumbnail-video, div#inside-thumbnail-slider').slideUp();;
|
||||
jQuery(this).parents("div#post-option-meta").children('div#inside-thumbnail-html5-video').slideDown();
|
||||
}
|
||||
});
|
||||
jQuery("select#post-option-inside-thumbnail-types").triggerHandler("change");
|
||||
|
||||
// Upload Image
|
||||
jQuery("input#upload_image_text_meta").change(function(){
|
||||
jQuery(this).siblings("input[type='hidden']").val(jQuery(this).val());
|
||||
});
|
||||
jQuery('input:button.upload_image_button_meta').click(function() {
|
||||
example_image = jQuery(this).siblings("#meta-input-example-image");
|
||||
upload_text = jQuery(this).siblings("#upload_image_text_meta");
|
||||
attachment_id = jQuery(this).siblings("#upload_image_attachment_id");
|
||||
tb_show('Upload Media', 'media-upload.php?post_id=&type=image&TB_iframe=true');
|
||||
|
||||
var oldSendToEditor = window.send_to_editor;
|
||||
window.send_to_editor = function(html){
|
||||
image_url = jQuery(html).attr('href');
|
||||
thumb_url = jQuery('img',html).attr('src');
|
||||
attid = jQuery(html).attr('attid');
|
||||
|
||||
upload_text.val(image_url);
|
||||
attachment_id.val(attid);
|
||||
example_image.html('<img src=' + thumb_url + ' />');
|
||||
tb_remove();
|
||||
|
||||
window.send_to_editor = oldSendToEditor;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
// Upload media (Html5 video)
|
||||
jQuery('input:button.upload_media_button_meta').click(function() {
|
||||
upload_text = jQuery(this).siblings("#upload_media_text_meta");
|
||||
tb_show('Upload Media', 'media-upload.php?post_id=&TB_iframe=true');
|
||||
|
||||
var oldSendToEditor = window.send_to_editor;
|
||||
window.send_to_editor = function(html){
|
||||
upload_text.val(html);
|
||||
tb_remove();
|
||||
|
||||
window.send_to_editor = oldSendToEditor;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
// Change the style of <select>
|
||||
if (!jQuery.browser.opera) {
|
||||
jQuery('.meta-input .combobox select').each(function(){
|
||||
var title = jQuery(this).attr('title');
|
||||
if( jQuery('option:selected', this).val() != '' ) title = jQuery('option:selected',this).text();
|
||||
jQuery(this)
|
||||
.css({'z-index':10,'opacity':0,'-khtml-appearance':'none'})
|
||||
.after('<span rel="combobox">' + title + '</span>')
|
||||
.change(function(){
|
||||
val = jQuery('option:selected',this).text();
|
||||
jQuery(this).next().text(val);
|
||||
})
|
||||
});
|
||||
};
|
||||
|
||||
// Template Check List
|
||||
jQuery('.radio-image-wrapper input').change(function(){
|
||||
jQuery(this).parent().parent().find(".check-list").removeClass("check-list");
|
||||
jQuery(this).siblings("label").children("#check-list").addClass("check-list");
|
||||
if(jQuery(this).val() == "left-sidebar"){
|
||||
jQuery("#post-option-choose-left-sidebar").parents(".meta-body").slideDown();
|
||||
jQuery("#post-option-choose-right-sidebar").parents(".meta-body").slideUp();
|
||||
}else if(jQuery(this).val() == "right-sidebar"){
|
||||
jQuery("#post-option-choose-left-sidebar").parents(".meta-body").slideUp();
|
||||
jQuery("#post-option-choose-right-sidebar").parents(".meta-body").slideDown();
|
||||
}else if(jQuery(this).val() == "both-sidebar" || jQuery(this).val() == "both-sidebar-reverse"){
|
||||
jQuery("#post-option-choose-left-sidebar").parents(".meta-body").slideDown();
|
||||
jQuery("#post-option-choose-right-sidebar").parents(".meta-body").slideDown();
|
||||
}else{
|
||||
jQuery("#post-option-choose-left-sidebar").parents(".meta-body").slideUp();
|
||||
jQuery("#post-option-choose-right-sidebar").parents(".meta-body").slideUp();
|
||||
}
|
||||
});
|
||||
jQuery('.radio-image-wrapper input:checked').triggerHandler("change");
|
||||
|
||||
// Link type of slider
|
||||
jQuery("select#post-option-inside-thumbnail-slider-linktype, select#post-option-thumbnail-slider-linktype").change(function(){
|
||||
var selected_val = jQuery(this).val();
|
||||
if(selected_val == 'No Link' || selected_val == 'Lightbox'){
|
||||
jQuery(this).parent().siblings('div').slideUp();
|
||||
}else{
|
||||
if(selected_val == 'Link to URL'){
|
||||
jQuery(this).parent().siblings('div').not('[rel="video"]').slideDown();
|
||||
jQuery(this).parent().siblings('div[rel="video"]').slideUp();
|
||||
}else{
|
||||
jQuery(this).parent().siblings('div').not('[rel="url"]').slideDown();
|
||||
jQuery(this).parent().siblings('div[rel="url"]').slideUp();
|
||||
}
|
||||
}
|
||||
});
|
||||
jQuery('select#post-option-inside-thumbnail-slider-linktype, select#post-option-thumbnail-slider-linktype').each(function(){
|
||||
var selected_val = jQuery(this).val();
|
||||
if(selected_val == 'No Link' || selected_val == 'Lightbox'){
|
||||
jQuery(this).parent().siblings('div').css('display','none');
|
||||
}else{
|
||||
if(selected_val == 'Link to URL'){
|
||||
jQuery(this).parent().siblings('div').not('[rel="video"]').css('display','block');
|
||||
jQuery(this).parent().siblings('div[rel="video"]').css('display','none');
|
||||
}else{
|
||||
jQuery(this).parent().siblings('div').not('[rel="url"]').css('display','block');
|
||||
jQuery(this).parent().siblings('div[rel="url"]').css('display','none');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//Thumbnail Image Type
|
||||
jQuery('#post-option-featured-image-type').change(function(){
|
||||
var choose_url = jQuery(this).parents("#thumbnail-feature-image").find("#post-option-featured-image-url");
|
||||
if(jQuery(this).val() == "Link to Current Post" || jQuery(this).val() == "Lightbox to Current Thumbnail"){
|
||||
choose_url.parents(".meta-body").slideUp();
|
||||
}else{
|
||||
choose_url.parents(".meta-body").slideDown();
|
||||
}
|
||||
});
|
||||
jQuery('#post-option-featured-image-type').each(function(){
|
||||
var choose_url = jQuery(this).parents("#thumbnail-feature-image").find("#post-option-featured-image-url");
|
||||
if(jQuery(this).val() == "Link to Current Post" || jQuery(this).val() == "Lightbox to Current Thumbnail"){
|
||||
choose_url.parents(".meta-body").css('display','none');
|
||||
}else{
|
||||
choose_url.parents(".meta-body").css('display','block');
|
||||
}
|
||||
});
|
||||
});
|
@ -0,0 +1,30 @@
|
||||
/**
|
||||
* Goodlayers Page Dragging File
|
||||
* ---------------------------------------------------------------------
|
||||
* @version 1.0
|
||||
* @author Goodlayers
|
||||
* @link http://goodlayers.com
|
||||
* @copyright Copyright (c) Goodlayers
|
||||
* ---------------------------------------------------------------------
|
||||
* This file contains the jQuery script for Page Dragging
|
||||
* ---------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
jQuery(document).ready(function(){
|
||||
|
||||
// Change the style of <select>
|
||||
if (!jQuery.browser.opera) {
|
||||
jQuery('.meta-input .combobox select').each(function(){
|
||||
var title = jQuery(this).attr('title');
|
||||
if( jQuery('option:selected', this).val() != '' ) title = jQuery('option:selected',this).text();
|
||||
jQuery(this)
|
||||
.css({'z-index':10,'opacity':0,'-khtml-appearance':'none'})
|
||||
.after('<span rel="combobox">' + title + '</span>')
|
||||
.change(function(){
|
||||
val = jQuery('option:selected',this).text();
|
||||
jQuery(this).next().text(val);
|
||||
})
|
||||
});
|
||||
};
|
||||
|
||||
});
|
@ -0,0 +1,22 @@
|
||||
(function() {
|
||||
tinymce.create('tinymce.plugins.accordion', {
|
||||
init : function(ed, url) {
|
||||
ed.addButton('accordion', {
|
||||
title : 'Add Accordion',
|
||||
image : url + '/images/accordion.png',
|
||||
onclick : function() {
|
||||
ed.focus();
|
||||
ed.selection.setContent('[accordion]<br/> \
|
||||
[acc_item title="ITEM_TITLE"]ADD_CONTENT_HERE[/acc_item]<br/> \
|
||||
[acc_item title="ITEM_TITLE"]ADD_CONTENT_HERE[/acc_item]<br/> \
|
||||
[acc_item title="ITEM_TITLE"]ADD_CONTENT_HERE[/acc_item]<br/> \
|
||||
[/accordion]<br/>');
|
||||
}
|
||||
});
|
||||
},
|
||||
createControl : function(n, cm) {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
tinymce.PluginManager.add('accordion', tinymce.plugins.accordion);
|
||||
})();
|
@ -0,0 +1,18 @@
|
||||
(function() {
|
||||
tinymce.create('tinymce.plugins.button', {
|
||||
init : function(ed, url) {
|
||||
ed.addButton('button', {
|
||||
title : 'Add Button',
|
||||
image : url + '/images/button.png',
|
||||
onclick : function() {
|
||||
ed.focus();
|
||||
ed.selection.setContent('[button color="#COLOR_CODE" background="#COLOR_CODE" size="medium" src="PLACE_LINK_HERE"]ADD_BUTTON_CONTENT[/button]<br/>');
|
||||
}
|
||||
});
|
||||
},
|
||||
createControl : function(n, cm) {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
tinymce.PluginManager.add('button', tinymce.plugins.button);
|
||||
})();
|
@ -0,0 +1,18 @@
|
||||
(function() {
|
||||
tinymce.create('tinymce.plugins.column', {
|
||||
init : function(ed, url) {
|
||||
ed.addButton('column', {
|
||||
title : 'Add Column',
|
||||
image : url + '/images/column.png',
|
||||
onclick : function() {
|
||||
ed.focus();
|
||||
ed.selection.setContent('[column col="1/4"]ADD_CONTENT_HERE[/column]<br/>');
|
||||
}
|
||||
});
|
||||
},
|
||||
createControl : function(n, cm) {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
tinymce.PluginManager.add('column', tinymce.plugins.column);
|
||||
})();
|
@ -0,0 +1,18 @@
|
||||
(function() {
|
||||
tinymce.create('tinymce.plugins.divider', {
|
||||
init : function(ed, url) {
|
||||
ed.addButton('divider', {
|
||||
title : 'Add Divider',
|
||||
image : url + '/images/divider.png',
|
||||
onclick : function() {
|
||||
ed.focus();
|
||||
ed.selection.setContent('[divider scroll_text="SCROLL_TEXT"]<br/>');
|
||||
}
|
||||
});
|
||||
},
|
||||
createControl : function(n, cm) {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
tinymce.PluginManager.add('divider', tinymce.plugins.divider);
|
||||
})();
|
@ -0,0 +1,18 @@
|
||||
(function() {
|
||||
tinymce.create('tinymce.plugins.dropcap', {
|
||||
init : function(ed, url) {
|
||||
ed.addButton('dropcap', {
|
||||
title : 'Add Dropcap',
|
||||
image : url + '/images/dropcap.png',
|
||||
onclick : function() {
|
||||
ed.focus();
|
||||
ed.selection.setContent('[dropcap type="circle" color="#COLOR_CODE" background="#COLOR_CODE"]ADD_CONTENT_HERE[/dropcap]<br/>');
|
||||
}
|
||||
});
|
||||
},
|
||||
createControl : function(n, cm) {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
tinymce.PluginManager.add('dropcap', tinymce.plugins.dropcap);
|
||||
})();
|
@ -0,0 +1,18 @@
|
||||
(function() {
|
||||
tinymce.create('tinymce.plugins.gdl_gallery', {
|
||||
init : function(ed, url) {
|
||||
ed.addButton('gdl_gallery', {
|
||||
title : 'Add Gallery',
|
||||
image : url + '/images/gdl-gallery.png',
|
||||
onclick : function() {
|
||||
ed.focus();
|
||||
ed.selection.setContent('[gdl_gallery title="GALLERY_TITLE" width="GALLERY_WIDTH" height="IMAGE_HEIGHT" galid="1" ]<br/>');
|
||||
}
|
||||
});
|
||||
},
|
||||
createControl : function(n, cm) {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
tinymce.PluginManager.add('gdl_gallery', tinymce.plugins.gdl_gallery);
|
||||
})();
|
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 3.0 KiB |
After Width: | Height: | Size: 2.9 KiB |
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 3.0 KiB |
After Width: | Height: | Size: 3.5 KiB |
After Width: | Height: | Size: 3.5 KiB |
After Width: | Height: | Size: 2.9 KiB |
After Width: | Height: | Size: 2.9 KiB |
After Width: | Height: | Size: 2.7 KiB |
After Width: | Height: | Size: 3.0 KiB |
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 3.3 KiB |
@ -0,0 +1,23 @@
|
||||
(function() {
|
||||
tinymce.create('tinymce.plugins.list', {
|
||||
init : function(ed, url) {
|
||||
ed.addButton('list', {
|
||||
title : 'Add List',
|
||||
image : url + '/images/list.png',
|
||||
onclick : function() {
|
||||
ed.focus();
|
||||
ed.selection.setContent('[list type="check"]<br/>\
|
||||
<ul>\
|
||||
<li>ADD_LIST_CONTENT</li>\
|
||||
<li>ADD_LIST_CONTENT</li>\
|
||||
</ul>\
|
||||
[/list]<br/>');
|
||||
}
|
||||
});
|
||||
},
|
||||
createControl : function(n, cm) {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
tinymce.PluginManager.add('list', tinymce.plugins.list);
|
||||
})();
|
@ -0,0 +1,18 @@
|
||||
(function() {
|
||||
tinymce.create('tinymce.plugins.message_box', {
|
||||
init : function(ed, url) {
|
||||
ed.addButton('message_box', {
|
||||
title : 'Add Message Box',
|
||||
image : url + '/images/message-box.png',
|
||||
onclick : function() {
|
||||
ed.focus();
|
||||
ed.selection.setContent('[message_box title="MESSAGE TITLE" color="red"]ADD_CONTENT_HERE[/message_box]<br/>');
|
||||
}
|
||||
});
|
||||
},
|
||||
createControl : function(n, cm) {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
tinymce.PluginManager.add('message_box', tinymce.plugins.message_box);
|
||||
})();
|
@ -0,0 +1,18 @@
|
||||
(function() {
|
||||
tinymce.create('tinymce.plugins.price_item', {
|
||||
init : function(ed, url) {
|
||||
ed.addButton('price_item', {
|
||||
title : 'Add Price Item',
|
||||
image : url + '/images/price-item.png',
|
||||
onclick : function() {
|
||||
ed.focus();
|
||||
ed.selection.setContent('[price-item item_number="6" category="PRICE_TABLE_CATEGORY"]');
|
||||
}
|
||||
});
|
||||
},
|
||||
createControl : function(n, cm) {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
tinymce.PluginManager.add('price_item', tinymce.plugins.price_item);
|
||||
})();
|
@ -0,0 +1,18 @@
|
||||
(function() {
|
||||
tinymce.create('tinymce.plugins.quote', {
|
||||
init : function(ed, url) {
|
||||
ed.addButton('quote', {
|
||||
title : 'Add Quote',
|
||||
image : url + '/images/quote.png',
|
||||
onclick : function() {
|
||||
ed.focus();
|
||||
ed.selection.setContent('[quote align="center" color="#999999"]ADD_CONTENT_HERE[/quote]<br/>');
|
||||
}
|
||||
});
|
||||
},
|
||||
createControl : function(n, cm) {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
tinymce.PluginManager.add('quote', tinymce.plugins.quote);
|
||||
})();
|
@ -0,0 +1,18 @@
|
||||
(function() {
|
||||
tinymce.create('tinymce.plugins.social', {
|
||||
init : function(ed, url) {
|
||||
ed.addButton('social', {
|
||||
title : 'Add Social Icon',
|
||||
image : url + '/images/social.png',
|
||||
onclick : function() {
|
||||
ed.focus();
|
||||
ed.selection.setContent('[social type="facebook" opacity="dark"]PLACE_LINK_HERE[/social]<br/>');
|
||||
}
|
||||
});
|
||||
},
|
||||
createControl : function(n, cm) {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
tinymce.PluginManager.add('social', tinymce.plugins.social);
|
||||
})();
|
@ -0,0 +1,18 @@
|
||||
(function() {
|
||||
tinymce.create('tinymce.plugins.space', {
|
||||
init : function(ed, url) {
|
||||
ed.addButton('space', {
|
||||
title : 'Add Space',
|
||||
image : url + '/images/space.png',
|
||||
onclick : function() {
|
||||
ed.focus();
|
||||
ed.selection.setContent('[space height="HEIGHT"]<br/>');
|
||||
}
|
||||
});
|
||||
},
|
||||
createControl : function(n, cm) {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
tinymce.PluginManager.add('space', tinymce.plugins.space);
|
||||
})();
|
@ -0,0 +1,22 @@
|
||||
(function() {
|
||||
tinymce.create('tinymce.plugins.tab', {
|
||||
init : function(ed, url) {
|
||||
ed.addButton('tab', {
|
||||
title : 'Add Tab',
|
||||
image : url + '/images/tab.png',
|
||||
onclick : function() {
|
||||
ed.focus();
|
||||
ed.selection.setContent('[tab]<br/>\
|
||||
[tab_item title="ITEM_TITLE"]ADD_CONTENT_HERE[/tab_item]<br/>\
|
||||
[tab_item title="ITEM_TITLE"]ADD_CONTENT_HERE[/tab_item]<br/>\
|
||||
[tab_item title="ITEM_TITLE"]ADD_CONTENT_HERE[/tab_item]<br/>\
|
||||
[/tab]<br/>');
|
||||
}
|
||||
});
|
||||
},
|
||||
createControl : function(n, cm) {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
tinymce.PluginManager.add('tab', tinymce.plugins.tab);
|
||||
})();
|
@ -0,0 +1,18 @@
|
||||
(function() {
|
||||
tinymce.create('tinymce.plugins.testimonial', {
|
||||
init : function(ed, url) {
|
||||
ed.addButton('testimonial', {
|
||||
title : 'Add Testimonial',
|
||||
image : url + '/images/testimonial.png',
|
||||
onclick : function() {
|
||||
ed.focus();
|
||||
ed.selection.setContent('[testimonial category="TESTIMONIAL_CATEGORY" size="1/1" type="static"]<br/>');
|
||||
}
|
||||
});
|
||||
},
|
||||
createControl : function(n, cm) {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
tinymce.PluginManager.add('testimonial', tinymce.plugins.testimonial);
|
||||
})();
|
@ -0,0 +1,21 @@
|
||||
(function() {
|
||||
tinymce.create('tinymce.plugins.toggle_box', {
|
||||
init : function(ed, url) {
|
||||
ed.addButton('toggle_box', {
|
||||
title : 'Add Toggle Box',
|
||||
image : url + '/images/toggle-box.png',
|
||||
onclick : function() {
|
||||
ed.focus();
|
||||
ed.selection.setContent('[toggle_box]<br/>\
|
||||
[toggle_item title="ITEM_TITLE" active="true"]ADD_CONTENT_HERE[/toggle_item]<br/>\
|
||||
[toggle_item title="ITEM_TITLE" active="true"]ADD_CONTENT_HERE[/toggle_item]<br/>\
|
||||
[/toggle_box]<br/>');
|
||||
}
|
||||
});
|
||||
},
|
||||
createControl : function(n, cm) {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
tinymce.PluginManager.add('toggle_box', tinymce.plugins.toggle_box);
|
||||
})();
|
@ -0,0 +1,18 @@
|
||||
(function() {
|
||||
tinymce.create('tinymce.plugins.vimeo', {
|
||||
init : function(ed, url) {
|
||||
ed.addButton('vimeo', {
|
||||
title : 'Add Vimeo',
|
||||
image : url + '/images/vimeo.png',
|
||||
onclick : function() {
|
||||
ed.focus();
|
||||
ed.selection.setContent('[vimeo height="HEIGHT" width="WIDTH"]PLACE_LINK_HERE[/vimeo]<br/>');
|
||||
}
|
||||
});
|
||||
},
|
||||
createControl : function(n, cm) {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
tinymce.PluginManager.add('vimeo', tinymce.plugins.vimeo);
|
||||
})();
|
@ -0,0 +1,18 @@
|
||||
(function() {
|
||||
tinymce.create('tinymce.plugins.youtube', {
|
||||
init : function(ed, url) {
|
||||
ed.addButton('youtube', {
|
||||
title : 'Add Youtube',
|
||||
image : url + '/images/youtube.png',
|
||||
onclick : function() {
|
||||
ed.focus();
|
||||
ed.selection.setContent('[youtube height="HEIGHT" width="WIDTH"]PLACE_LINK_HERE[/youtube]<br/>');
|
||||
}
|
||||
});
|
||||
},
|
||||
createControl : function(n, cm) {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
tinymce.PluginManager.add('youtube', tinymce.plugins.youtube);
|
||||
})();
|