Commit inicial - WordPress Análisis de Precios Unitarios

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

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

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

View File

@@ -0,0 +1,93 @@
#wpdreams .ac-container{
width: 720px;
margin: 10px auto 30px auto;
text-align: left;
}
#wpdreams .ac-container>div>label{
padding: 5px 20px;
position: relative;
z-index: 20;
display: block;
height: 30px;
cursor: pointer;
color: #777;
text-shadow: 1px 1px 1px rgba(255,255,255,0.8);
line-height: 33px;
font-size: 14px;
background: #fcfcfc; /* Old browsers */
background: -moz-linear-gradient(top, #fcfcfc 0%, #fcfcfc 50%, #f9f9f9 54%, #fafafa 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#fcfcfc), color-stop(50%,#fcfcfc), color-stop(54%,#f9f9f9), color-stop(100%,#fafafa)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #fcfcfc 0%,#fcfcfc 50%,#f9f9f9 54%,#fafafa 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #fcfcfc 0%,#fcfcfc 50%,#f9f9f9 54%,#fafafa 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #fcfcfc 0%,#fcfcfc 50%,#f9f9f9 54%,#fafafa 100%); /* IE10+ */
background: linear-gradient(to bottom, #fcfcfc 0%,#fcfcfc 50%,#f9f9f9 54%,#fafafa 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fcfcfc', endColorstr='#fafafa',GradientType=0 ); /* IE6-9 */
box-shadow:
0px 0px 0px 1px rgba(155,155,155,0.3),
1px 0px 0px 0px rgba(255,255,255,0.9) inset,
0px 2px 2px rgba(0,0,0,0.1);
}
#wpdreams .ac-container>label:hover{
background: #fff;
}
#wpdreams .ac-container>div>input:checked + label,
#wpdreams .ac-container>div>input:checked + label:hover{
background: #c6e1ec;
color: #3d7489;
text-shadow: 0px 1px 1px rgba(255,255,255, 0.6);
box-shadow:
0px 0px 0px 1px rgba(155,155,155,0.3),
0px 2px 2px rgba(0,0,0,0.1);
}
#wpdreams .ac-container>div>label:hover:after,
#wpdreams .ac-container>div>input:checked + label:hover:after{
content: '';
position: absolute;
width: 24px;
height: 24px;
right: 13px;
top: 7px;
background: transparent url(../images/arrow_down.png) no-repeat center center;
}
#wpdreams .ac-container>div>input:checked + label:hover:after{
background-image: url(../images/arrow_up.png);
}
#wpdreams .ac-container>div>input{
display: none;
}
#wpdreams .ac-container>div article{
background: rgba(255, 255, 255, 0.5);
margin-top: -1px;
overflow: hidden;
height: 0px;
position: relative;
z-index: 10;
-webkit-transition: height 0.3s ease-in-out, box-shadow 0.6s linear;
-moz-transition: height 0.3s ease-in-out, box-shadow 0.6s linear;
-o-transition: height 0.3s ease-in-out, box-shadow 0.6s linear;
-ms-transition: height 0.3s ease-in-out, box-shadow 0.6s linear;
transition: height 0.3s ease-in-out, box-shadow 0.6s linear;
}
#wpdreams .ac-container input:checked ~ article{
-webkit-transition: height 0.5s ease-in-out, box-shadow 0.1s linear;
-moz-transition: height 0.5s ease-in-out, box-shadow 0.1s linear;
-o-transition: height 0.5s ease-in-out, box-shadow 0.1s linear;
-ms-transition: height 0.5s ease-in-out, box-shadow 0.1s linear;
transition: height 0.5s ease-in-out, box-shadow 0.1s linear;
box-shadow: 0px 0px 0px 1px rgba(155,155,155,0.3);
width: 690px;
}
#wpdreams .ac-container div>input:checked ~ article.ac-auto {
height: auto;
}
#wpdreams .ac-container div>input:checked ~ article.ac-small{
height: 140px;
}
#wpdreams .ac-container div>input:checked ~ article.ac-medium{
height: 180px;
}
#wpdreams .ac-container div>input:checked ~ article.ac-large{
height: 230px;
}

View File

@@ -0,0 +1,31 @@
jQuery(function($){
$('select[name=analytics]').on('change', function(){
var v = $(this).val();
if ( v == '0' ) {
$('.asp_al_pageview').addClass('hiddend');
$('.asp_al_event').addClass('hiddend');
$('.asp_al_both').addClass('hiddend');
} else if ( v == 'pageview' ) {
$('.asp_al_pageview').removeClass('hiddend');
$('.asp_al_event').addClass('hiddend');
$('.asp_al_both').removeClass('hiddend');
} else if ( v == 'event' ) {
$('.asp_al_pageview').addClass('hiddend');
$('.asp_al_event').removeClass('hiddend');
$('.asp_al_both').removeClass('hiddend');
}
}).trigger('change');
$('.asp_gtag_switch input[isparam]').on('change', function(){
if ( $(this).val() == 1 ) {
$(this).closest('fieldset').find('.asp_gtag_inputs').removeClass('disabled');
} else {
$(this).closest('fieldset').find('.asp_gtag_inputs').addClass('disabled');
}
}).trigger('change');
$('.asp_submit_reset').on('click', function(){
if(confirm('Do you really want to reset the options to defaults?')) {
return true;
}
return false;
});
});

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,35 @@
// Simulate a click on the first element to initialize the tabs
jQuery(function ($) {
// Remove the # from the hash, as different browsers may or may not include it
var hash = location.hash.replace('#','');
if(hash != ''){
hash = parseInt(hash);
$('.tabs a[tabid=' + Math.floor( hash / 100 ) + ']').trigger('click');
$('.tabs a[tabid=' + hash + ']').trigger('click');
} else {
$('.tabs a[tabid=1]').trigger('click');
}
$('.tabs a').on('click', function(){
location.hash = $(this).attr('tabid');
});
$('input[name=selective_enabled]').on('change', function(){
if ( $(this).val() == 0 ) {
$(this).closest('fieldset').find('.item_selective_load').addClass('disabled');
} else {
$(this).closest('fieldset').find('.item_selective_load').removeClass('disabled');
}
}).trigger('change');
$('select[name=js_source]').on('change', function(){
if ( $(this).val().indexOf('jqueryless') < 0 ) {
$('select[name=script_loading_method]').closest('.item').addClass('disabled');
} else {
$('select[name=script_loading_method]').closest('.item').removeClass('disabled');
}
}).trigger('change');
});

View File

@@ -0,0 +1,53 @@
jQuery(function($){
$('#asp_export_textarea').on('click', function(){
var $this = $(this);
$this.select();
// Work around Chrome's little problem
$this.mouseup(function() {
// Prevent further mouseup intervention
$this.unbind("mouseup");
return false;
});
});
$('#asp_export_button').on('click', function(){
if ($('#asp_export :selected').length < 1) return false;
$(this).next().removeClass('hiddend');
$(this).prop('disabled', true);
var $this = $(this);
setTimeout(function(){
var searches = [];
$('#asp_export :selected').each(function(i, selected){
searches.push( $(this).val() );
});
if (searches.length > 0)
$('#asp_export_textarea').val(JSON.stringify(searches));
$this.prop('disabled', false);
$this.next().addClass('hiddend');
}, 1000);
});
$('#asp_export_button_sett').on('click', function(){
if ($('#asp_export_sett :selected').length < 1) return false;
$(this).next().removeClass('hiddend');
$(this).prop('disabled', true);
var $this = $(this);
setTimeout(function(){
$('#asp_export_textarea_sett').val($('#asp_export_sett').val());
$this.prop('disabled', false);
$this.next().addClass('hiddend');
}, 1000);
});
$('#asp_import_button_sett').on('click', function(e){
return confirm(msg('suc_msg'));
});
$('.tabs a[tabid=1]').trigger('click');
// ------------------------------------------- ETC -----------------------------------------------------------------
function msg(k) {
return typeof ASP_EI_LOC[k] != 'undefined' ? ASP_EI_LOC[k] : '';
}
});

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,85 @@
var webFontLoaded = [];
function loadFonts(family) {
WebFontConfig = {
google: { families: [family+":400,700"] }
};
if ( webFontLoaded.indexOf(family) < 0 ) {
if ( typeof WebFont !== 'undefined' ) {
WebFont.load(WebFontConfig);
webFontLoaded.push(family);
}
}
}
jQuery(function($){
$('.wpdreamsFontComplete input[type=text], .wpdreamsFontComplete select').on('keyup change', function() {
var p = $(this).closest('.wpdreamsFontComplete');
var family, fonts;
if ( p.find('select.wd_fonts_select').val() != 'custom' ) {
var realFamilyName = p.find('select.wd_fonts_select').val().replace('--g--', '');
loadFonts(realFamilyName);
fonts = p.find('select.wd_fonts_select').val().replace(/'|"/gi, '');
family = "font-family:" + fonts + ";";
} else {
if ( p.find('input.wd_fonts_custom').val() != '' ) {
fonts = p.find('input.wd_fonts_custom').val().replace(/'|"/gi, '');
family = "font-family:" + fonts + ";";
} else {
family = "font-family: Open Sans;";
}
}
var weight = "font-weight:"+p.find('select.wd_font_weight').val()+";";
var color = "color:"+p.find('.wd_fonts_type input.color').val()+";";
var size = "font-size:"+p.find('input.wd_fonts_size').val()+";";
var lh = "line-height:"+p.find('input.wd_fonts_line').val()+";";
var tShadow = p.find('input._xx_hlength_xx_').val() + "px " + p.find('input._xx_vlength_xx_').val() + "px ";
tShadow += p.find('input._xx_blurradius_xx_').val() + "px " + p.find('.wpd_font_shadow input.color').val();
var textShadow = "text-shadow:" + tShadow + ";";
p.find("input[isparam=1]").val(weight+family+color+size+lh+textShadow).trigger('change');
});
$('.wpdreamsFontComplete select.wd_fonts_select').on('change', function(){
var cf = $(this).closest('.wpdreamsFontComplete').find('label.wd_fonts_custom');
if ( $(this).val() == 'custom' ) {
cf.removeClass('hiddend');
} else {
cf.addClass('hiddend');
}
});
$('.wpdreamsFontComplete select.wd_fonts_select').trigger('change');
$(".wpdreamsFontComplete>.triggerer").on('click', function() {
var p = $(this).closest('.wpdreamsFontComplete');
var val = p.find("input[isparam=1]").val().replace(/(\r\n|\n|\r)/gm,"");
var font = $.trim(val.match(/family:(.*?);/)[1]).replace('--g--', '');
font = font.replace(/'|"/gi, '');
if ( $("select.wd_fonts_select option[value='"+font+"']").length > 0 ) {
p.find('select.wd_fonts_select').val( font );
} else {
p.find('select.wd_fonts_select').val('custom');
p.find('input.wd_fonts_custom').val(font);
}
p.find('select.wd_font_weight').val( $.trim(val.match(/font-weight:(.*?);/)[1]) );
p.find('input.wd_fonts_size').val( $.trim(val.match(/size:(.*?);/)[1]) );
p.find('input.wd_fonts_line').val( $.trim(val.match(/height:(.*?);/)[1]) );
p.find('.wd_fonts_type input.color').val( $.trim(val.match(/color:(.*?);/)[1]) );
p.find('.wd_fonts_type input.color').spectrum('set', $.trim(val.match(/color:(.*?);/)[1]));
var ts = val.match(/text-shadow:(.*?)px (.*?)px (.*?)px (.*?);/);
if (ts != null && ts.length > 0) {
p.find('input._xx_hlength_xx_').val( $.trim(ts[1]) );
p.find('input._xx_vlength_xx_').val( $.trim(ts[2]) );
p.find('input._xx_blurradius_xx_').val( $.trim(ts[3]) );
p.find('.wpd_font_shadow input.color').val( $.trim(ts[4]) );
p.find('.wpd_font_shadow input.color').spectrum('set', $.trim(ts[4]));
}
p.find('select.wd_fonts_select').trigger('change');
});
});

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 988 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 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: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -0,0 +1,16 @@
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="512px" height="512px" viewBox="0 0 512 512" enable-background="new 0 0 512 512" xml:space="preserve">
<path id="magnifier-3-icon" d="M208.464,363.98c-86.564,0-156.989-70.426-156.989-156.99C51.475,120.426,121.899,50,208.464,50
c86.565,0,156.991,70.426,156.991,156.991C365.455,293.555,295.029,363.98,208.464,363.98z M208.464,103.601
c-57.01,0-103.389,46.381-103.389,103.39s46.379,103.389,103.389,103.389c57.009,0,103.391-46.38,103.391-103.389
S265.473,103.601,208.464,103.601z M367.482,317.227c-14.031,20.178-31.797,37.567-52.291,51.166L408.798,462l51.728-51.729
L367.482,317.227z"/>
</svg>

After

Width:  |  Height:  |  Size: 723 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 984 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1015 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@@ -0,0 +1,14 @@
#it_first_modal ul {
margin-left: 24px;
list-style-type: disc;
}
#asp_i_dontclose {
padding: 12px;
background: #b059af;
text-align: center;
font-size: 16px;
font-weight: bold;
line-height: 29px;
color: #ffffff;
}

View File

@@ -0,0 +1,164 @@
.hiddend {
display: none !important;
}
.descMsg {
font-size: 12px;
color: #7b7b7b;
}
.wpd-syn-results {
position: relative;
}
/* Fix the uploader z-index */
body div[id*=wp-uploader-id-] {
z-index: 2147483647 !important;
}
#syn-import-modal .wpd-syn-overlay,
#wpd_modal_inner .wpd-syn-overlay,
.wpd-synonyms-editor .wpd-syn-overlay,
.wpd-syn-results .wpd-syn-overlay {
position: absolute;
width: 100%;
height: 100%;
display: none;
top: 0;
left: 0;
z-index: 999;
background: rgba(255, 255, 255, 0.7) url("../icons/loading-big.gif") no-repeat center center;
}
.wpd-synonyms-row {
border-bottom: 1px solid #eaeaea;
padding: 10px 0;
display: flex;
flex-wrap: wrap;
}
.wpd-synonyms-err {
margin: auto 20px;
padding: 20px 0 0;
width: 100%;
}
.wpd-synonyms-row.wpd-synonyms-row-noflex {
display: block;
}
.wpd-synonyms-col:nth-child(1) {
width: 20%;
margin: auto 20px;
line-height: 30px;
flex-basis: 160px;
}
.wpd-synonyms-col:nth-child(2) {
width: 55%;
flex-basis: 340px;
flex-grow: 0;
}
.wpd-synonyms-col:nth-child(3) {
/* width: 25%; */
margin: auto 0 auto 20px;
flex-basis: 170px;
}
.syn-kw-col span {
display: block;
font-size: 12px;
color: #8c8c8c;
}
.wpd-sr-search {
border-bottom: none;
}
.wpd-sr-search .wpd-sr-search-left {
float: left;
}
.wpd-sr-search .wpd-sr-search-right {
float: right;
}
.wpd-sr-search:after {
content: "";
display: table;
clear: both;
}
label[for=wpd-syn-search-lang],
label[for=wpd-synonym-lang]{
margin: 0 !important;
}
.wd_button_syn {
background: transparent !important;
border: 1px solid #ffffff !important;
box-shadow: none !important;
color: #1879a0 !important;
text-shadow: none !important;
text-decoration: underline !important;
}
.wd_button_syn:hover {
border: 1px solid #18779c !important;
}
.wd_button_syn.asp_syn_remove_all {
color: #d46969 !important;
}
.wd_button_syn.asp_syn_remove_all:hover {
color: #d64c4c !important;
border: 1px solid #d64c4c !important;
}
.wpd-synonyms-row-head,
.wpd-synonyms-row-head .wpd-synonyms-col {
font-weight: bold;
}
.wpd-synonyms-row .wpd-synonyms-col input[type=button] {
opacity: 0;
transition: opacity 0.2s linear;
}
.wpd-synonyms-editor {
position: relative;
}
.wpd-synonyms-editor .wpd-synonyms-col input[type=button],
.wpd-synonyms-row:hover .wpd-synonyms-col input[type=button] {
opacity: 1;
}
#wpd-synonyms-editor .wpd-synonyms-col input[type=text] {
margin: 0;
width: auto;
}
#wpd-synonyms-editor .wpd-type-zone {
min-width: 20px;
display: inline-block;
margin: 0 10px 0 0;
}
.wpd-tagging {
border: none;
font-size: 1em;
height: auto;
padding: 0;
line-height: 34px;
}
/* MODAL related */
#syn-export-modal,
#syn-import-modal {
position: relative;
margin: 12px 0;
line-height: 34px;
}

View File

@@ -0,0 +1,493 @@
jQuery(function($){
var post;
var st;
var $editor = $('#wpd-synonyms-editor');
var tagArgs = {
"edit-on-delete": false,
"forbidden-chars": [ ".", "?", "!" ],
"close-class": "wpd-tag-i",
"tag-box-class": "wpd-tagging",
"type-zone-class": "wpd-type-zone",
"type-zone-placeholder": "Enter synonyms here..",
"tag-box-editable-class": "editable",
"tag-class": "wpd-tag",
"tags-limit": 15,
"tag-char": "",
"no-spacebar": true,
"pre-tags-separator": ","
};
var nonce = $('#asp_synonyms_request_nonce').val();
$('#asp_syn_add').on('click', function(e){
editorOpen();
});
// Search language change
$('#wpd-syn-search-lang').on('change', function(){
editorErrorHide();
clearTimeout(st);
st = setTimeout(function() {
editorClose();
findKeyword();
}, 220);
});
// Search input
$('#wpd-search-synonyms').on('input', function(){
editorErrorHide();
clearTimeout(st);
st = setTimeout(function() {
editorClose();
findKeyword();
}, 220);
});
$('#syn-editor-cancel').on('click', function(e){
editorErrorHide();
editorClose();
});
$('#syn-editor-save').on('click', function(e){
editorErrorHide();
if ( editorSaveCheck() == true ) {
var synonyms = [];
jQuery('#wpd-tag input[name="tag[]"]').each(function(i, o){
synonyms.push($(this).val());
});
var data = {
action: 'asp_syn_admin_ajax',
op: 'update',
asp_synonyms_request_nonce: nonce,
keyword: $('#wpd-synonym-input').val(),
synonyms: synonyms,
lang: $('#wpd-synonym-lang').val(),
overwrite_existing: editorIsUpdate() ? 1 : 0
};
$('#asp_syn_add').attr('disabled', 'disabled');
if ( editorIsUpdate() )
$editor.parent().find('>.wpd-syn-overlay').css('display', 'block');
else
$editor.find('.wpd-syn-overlay').css('display', 'block');
if (post != null && typeof post.abort != 'undefined')
post.abort();
post = $.post(ajaxurl, data)
.done(function(response){
var res = response.replace(/^\s*[\r\n]/gm, "");
res = res.match(/!!!ASP_SYN_START!!!(.*[\s\S]*)!!!ASP_SYN_END!!!/);
if (res != null && (typeof res[1] != 'undefined')) {
res = parseInt(res[1]); // Number of affected rows by the query, -1 on error
if ( res == -1 ) {
editorErrorRaise(msg('edt_er1'));
} else if ( res == 0 && !editorIsUpdate() ) {
editorErrorRaise(msg('edt_er2'));
} else {
// Success
if ( editorIsUpdate() ) {
updateKeyword();
return true; // Exit here, let the second function finish the task
} else {
editorClose();
findKeyword(false);
}
}
}
$('#asp_syn_add').removeAttr('disabled');
if ( editorIsUpdate() )
$editor.parent().find('>.wpd-syn-overlay').css('display', 'none');
else
$editor.find('.wpd-syn-overlay').css('display', 'none');
}).fail(function(){
$('#asp_syn_add').removeAttr('disabled');
if ( editorIsUpdate() )
$editor.parent().find('>.wpd-syn-overlay').css('display', 'none');
else
$editor.find('.wpd-syn-overlay').css('display', 'none');
});
}
});
$('#wpd-synonyms-editor').on('input', '.wpd-type-zone', function(){
editorErrorHide();
});
$('#wpd-synonym-input').keypress( function(e) {
var chr = String.fromCharCode(e.which);
// Ignore some characters
if ( e.which == 13 ) {
e.preventDefault();
$('#wpd-tag .wpd-type-zone').get(0).focus();
}
});
$('#wpd-synonym-input').on('input', function(){
editorErrorHide();
});
$('.wpd-syn-results').on('click', '.syn-edit-row', function(e){
editorErrorHide();
editorClose();
editorOpen($(this).closest('.wpd-synonyms-row'));
$(this).closest('.wpd-synonyms-row').addClass('hiddend');
});
$('.wpd-syn-results').on('click', '.syn-delete-row', function(){
if ( !confirm(msg('res_ms1')) )
return false;
editorErrorHide();
$row = $(this).closest('.wpd-synonyms-row');
var data = {
action: 'asp_syn_admin_ajax',
op: 'delete',
asp_synonyms_request_nonce: nonce,
id: $row.data('id')
};
$row.find('.wpd-syn-overlay').css('display', 'block');
if (post != null && typeof post.abort != 'undefined')
post.abort();
post = $.post(ajaxurl, data)
.done(function(response){
var res = response.replace(/^\s*[\r\n]/gm, "");
res = res.match(/!!!ASP_SYN_START!!!(.*[\s\S]*)!!!ASP_SYN_END!!!/);
if (res != null && (typeof res[1] != 'undefined')) {
res = parseInt(res[1]); // Number of affected rows by the query, -1 on error
if ( res == -1 ) {
$row.find('.wpd-syn-overlay').css('display', 'none');
editorErrorRaise(msg('edt_er1'), $row);
} else if ( res == 0 ) {
$row.find('.wpd-syn-overlay').css('display', 'none');
editorErrorRaise(msg('edt_er3'), $row);
} else {
$row.detach();
}
}
}).fail(function(){
$row.find('.wpd-syn-overlay').css('display', 'none');
});
});
$('#asp-syn-remove-all').on('click', function(){
if ( !confirm(msg('del_all')) )
return false;
var data = {
action: 'asp_syn_admin_ajax',
op: 'wipe',
asp_synonyms_request_nonce: nonce
};
$('#wpd-syn-results').find('.wpd-syn-overlay').css('display', 'block');
if (post != null && typeof post.abort != 'undefined')
post.abort();
post = $.post(ajaxurl, data)
.done(function(response){
$('#wpd-syn-results').find('.wpd-syn-overlay').css('display', 'block');
findKeyword(false);
}).fail(function(){
$('#wpd-syn-results').find('.wpd-syn-overlay').css('display', 'block');
});
});
var mw = window.WPD_Modal;
var $export_div = $('#syn-export-modal').detach();
var $import_div = $('#syn-import-modal').detach();
$('#asp-syn-export').on('click', function(){
mw.options({
'type': 'info',
'content': $export_div,
'header': msg('mod_ms1'),
'buttons': {
'okay': {
'text': msg('mod_ms3'),
'type': 'okay',
'click': function(e, button){}
}
}
});
mw.show();
});
$('#asp-syn-import').on('click', function(){
mw.options({
'type': 'info',
'content': $import_div,
'header': msg('mod_ms2'),
'buttons': {
'okay': {
'text': msg('mod_ms3'),
'type': 'okay',
'click': function(e, button){}
}
}
});
mw.show();
});
$('#wpd_modal').on('click', '#syn-export-generate', function(){
var $loader = $(this).closest('#wpd_modal_inner').find('.wpd-syn-overlay');
var $error = $('#syn-export-error');
var $errorMsg = $('#syn-export-error .errorMsg');
$loader.css('display', 'block');
$error.addClass('hiddend');
var data = {
action: 'asp_syn_admin_ajax',
op: 'export',
asp_synonyms_request_nonce: nonce
};
if (post != null && typeof post.abort != 'undefined')
post.abort();
post = $.post(ajaxurl, data)
.done(function(response){
var res = response.replace(/^\s*[\r\n]/gm, "");
res = res.match(/!!!ASP_SYN_START!!!(.*[\s\S]*)!!!ASP_SYN_END!!!/);
if (res != null && (typeof res[1] != 'undefined')) {
res = res[1];
if ( res == "-1" || res == "0" ) {
$error.removeClass('hiddend');
$errorMsg.removeClass('hiddend');
}
if ( res == "-1" ) {
$errorMsg.text(msg('gen_er1'));
} else if ( res == "0" ) {
$errorMsg.text(msg('gen_er2'));
} else {
$('#syn-export-download a').attr('href', res + '?' + (Math.random() + 1).toString(36).substring(2,7));
$('#syn-export-download').removeClass('hiddend');
}
}
$loader.css('display', 'none');
}).fail(function(){
$loader.css('display', 'block');
});
});
$('#wpd_modal').on('input change focus blur', 'input[name=syn-import-upload]', function(){
if ( $(this).val() == '' ) {
$('#syn-import-upload').attr('disabled', 'disabled');
} else {
$('#syn-import-upload').removeAttr('disabled');
}
});
$('#wpd_modal').on('click', '#syn-import-upload', function(){
var $loader = $(this).closest('#wpd_modal_inner').find('.wpd-syn-overlay');
var $error = $('#syn-import-error');
var $errorMsg = $('#syn-import-error .errorMsg');
var $infoMsg = $('#syn-import-error .infoMsg');
$error.addClass('hiddend');
$loader.css('display', 'block');
var data = {
action: 'asp_syn_admin_ajax',
path: $('input[name=syn-import-upload]').val(),
op: 'import',
asp_synonyms_request_nonce: nonce
};
if (post != null && typeof post.abort != 'undefined')
post.abort();
post = $.post(ajaxurl, data)
.done(function(response){
var res = response.replace(/^\s*[\r\n]/gm, "");
res = res.match(/!!!ASP_SYN_START!!!(.*[\s\S]*)!!!ASP_SYN_END!!!/);
if (res != null && (typeof res[1] != 'undefined')) {
res = res[1];
if ( res == "-2" || res == "-1" || res == "0" ) {
$error.removeClass('hiddend');
$errorMsg.removeClass('hiddend');
$infoMsg.addClass('hiddend');
}
if ( res == "-2" ) {
$errorMsg.text(msg('gen_er1'));
} else if ( res == "-1" ) {
$errorMsg.text(msg('gen_er3'));
} else if ( res == "0" ) {
$errorMsg.text(msg('gen_er4'));
} else {
$infoMsg.html(msg('gen_ms1') + ' <strong>' + res + '</strong> ' + msg('gen_ms2'));
$error.removeClass('hiddend');
$infoMsg.removeClass('hiddend');
$errorMsg.addClass('hiddend');
$('#syn-import-download').removeClass('hiddend');
$('#wpd-search-synonyms').val('');
$('#wpd-syn-search-lang').val('any').trigger('change');
}
}
$loader.css('display', 'none');
}).fail(function(){
$loader.css('display', 'block');
});
});
// --------------------------------------- RESULTS LIST FUNCTIONS --------------------------------------------------
function updateKeyword() {
var keyword = $editor.prev().data('keyword');
var lang = $editor.prev().data('lang')
if ( keyword == '' )
return false;
var data = {
action: 'asp_syn_admin_ajax',
op: 'findexact',
asp_synonyms_request_nonce: nonce,
keyword: keyword,
lang: lang
};
if (post != null && typeof post.abort != 'undefined')
post.abort();
$('#wpd-syn-results>.wpd-syn-overlay').css('display', 'block');
post = $.post(ajaxurl, data)
.done(function(response) {
var res = response.replace(/^\s*[\r\n]/gm, "");
res = res.match(/!!!ASP_SYN_START!!!(.*[\s\S]*)!!!ASP_SYN_END!!!/);
if (res != null && (typeof res[1] != 'undefined')) {
res = JSON.parse(res[1]);
if ( res.length > 0 ) {
$.each(res, function(i, o){
var lang = o.lang == '' ? 'default' : o.lang;
var $n = $('#wpd-synonyms-row-sample').clone();
$n.find('.syn-kw-col').html(o.keyword + '<span>' + '[language: ' + lang + ']' + '</span>');
$n.find('.syn-syn-col').html(o.synonyms.replace(/,/g, ', '));
$n.data('keyword', o.keyword);
$n.data('lang', o.lang);
$n.data('id', o.id);
$n.attr('id', '');
$n.removeClass('hiddend');
$editor.prev().detach(); // Remove the old
$n.insertBefore($editor); // Add the new
editorClose();
return false; // Break
});
}
}
$('#wpd-syn-results>.wpd-syn-overlay').css('display', 'none');
});
}
function findKeyword(phrase) {
if ( typeof phrase == 'undefined' )
phrase = $('#wpd-search-synonyms').val();
else if ( phrase === false )
phrase = '';
var data = {
action: 'asp_syn_admin_ajax',
op: 'find',
asp_synonyms_request_nonce: nonce,
keyword: phrase,
lang: $('#wpd-syn-search-lang').val()
};
if (post != null && typeof post.abort != 'undefined')
post.abort();
$('#wpd-syn-results>.wpd-syn-overlay').css('display', 'block');
post = $.post(ajaxurl, data)
.done(function(response) {
var res = response.replace(/^\s*[\r\n]/gm, "");
res = res.match(/!!!ASP_SYN_START!!!(.*[\s\S]*)!!!ASP_SYN_END!!!/);
if (res != null && (typeof res[1] != 'undefined')) {
res = JSON.parse(res[1]);
$('#wpd-syn-results').find('.wpd-synonyms-row').detach();
if ( res.length > 0 ) {
$('#wpd-syn-results').find('.wpd-synonyms-nores').addClass('hiddend');
$.each(res, function(i, o){
var $n = $('#wpd-synonyms-row-sample').clone();
var lang = o.lang == '' ? 'default' : o.lang;
$n.find('.syn-kw-col').html(o.keyword + '<span>' + '[language: ' + lang + ']' + '</span>');
$n.find('.syn-syn-col').html(o.synonyms.replace(/,/g, ', '));
$n.data('keyword', o.keyword);
$n.data('lang', o.lang);
$n.data('id', o.id);
$n.attr('id', '');
$n.removeClass('hiddend');
$n.appendTo('#wpd-syn-results');
});
} else {
$('#wpd-syn-results').find('.wpd-synonyms-nores').removeClass('hiddend');
}
}
$('#wpd-syn-results>.wpd-syn-overlay').css('display', 'none');
});
}
// ------------------------------------- EDITOR RELATED FUNCTIONS --------------------------------------------------
function editorOpen($node) {
editorReset();
$editor.removeClass('hiddend');
editorErrorHide();
// Empty editor
if ( typeof $node == 'undefined' ) {
$editor.data('update', 0);
$('#wpd-synonym-input').removeAttr('disabled');
$('#wpd-synonym-lang').removeAttr('disabled');
$editor.detach().insertAfter('.wpd-synonyms-row-head');
$('#wpd-tag').tagging(tagArgs);
} else {
$editor.data('update', 1);
$editor.detach().insertAfter($node);
$('#wpd-synonym-input').val($node.data('keyword')).attr('disabled', 'disabled');
$('#wpd-synonym-lang').val($node.data('lang')).attr('disabled', 'disabled');
$('#wpd-tag').html($node.find('.syn-syn-col').text());
$('#wpd-tag').tagging(tagArgs);
}
}
function editorIsUpdate() {
return $editor.data('update') == 1;
}
function editorClose($node) {
if ( typeof $node != 'undefined' )
$node.removeClass('hiddend');
editorReset();
$editor.addClass('hiddend');
$('#asp_syn_add').removeAttr('disabled');
if ( $editor.prev().length > 0 && $editor.prev().hasClass('wpd-synonyms-row') ) {
$editor.prev().removeClass('hiddend');
}
}
function editorSaveCheck() {
// Trigger the tag input save
$('.wpd-type-zone').trigger('blur');
if ( $('#wpd-synonym-input').val().trim() == '' ) {
editorErrorRaise(msg('edt_er4'));
return false;
}
// Synonyms field check
var synonyms = [];
jQuery('#wpd-tag input[name="tag[]"]').each(function(i, o){
synonyms.push($(this).val());
});
if ( synonyms.length <= 0 ) {
editorErrorRaise(msg('edt_er5'));
return false;
}
return true;
}
function editorErrorHide() {
$('.wpd-synonyms-err').addClass('hiddend');
}
function editorErrorRaise(msg, $node) {
$editor = typeof $node == 'undefined' ? $editor : $node;
$editor.find('.wpd-synonyms-err').removeClass('hiddend');
$editor.find('.wpd-synonyms-err .errorMsg').html(msg);
}
function editorReset() {
$('#wpd-synonym-input').val('');
if (
typeof $('#wpd-tag').data('tag-box') != 'undefined' &&
$('#wpd-tag').data('tag-box') != null
)
$('#wpd-tag').tagging('destroy', tagArgs);
}
// ------------------------------------------- ETC -----------------------------------------------------------------
function msg(k) {
return typeof ASP_SYN_MSG[k] != 'undefined' ? ASP_SYN_MSG[k] : '';
}
});

View File

@@ -0,0 +1,615 @@
jQuery(function ($) {
// ------------- TAB HANDLING ---------------
// Remove the # from the hash, as different browsers may or may not include it
var hash = location.hash.replace('#','');
if (hash != '') {
hash = parseInt(hash);
$('.tabs a[tabid=' + hash + ']').trigger('click');
} else {
$('.tabs a[tabid=1]').trigger('click');
}
$('.tabs a').on('click', function(){
location.hash = $(this).attr('tabid');
});
// ------------------------------------------
var post = null;
var postTimeout = null;
var indexing = false;
var defragmenting = false;
var defragCount = 0;
var defragInterval = 300000; // Defrag at every X number of keywords found
var failCount = 0; // Consecutive failures counter
var reloadStats = true;
var statsData = {
postsIndexed: 0,
postsIndexedStart: 0,
postsIndexedNow: 0,
postsToIndex: 10,
postsTotal: 10,
keywordsFound: 0,
totalKeywords: 0,
runTimeNow: 0,
postsPerSecond: 0
};
ASP_IT.stats = statsData;
var $buttons = $("#index_buttons input[type='button']");
var $progress = $(".wd_progress_text, .wd_progress, .wd_progress_stop");
var $progress_bar = $(".wd_progress span");
var $progress_text = $(".wd_progress_text");
var $overlay = $("#asp_it_disable");
var $success = $("#asp_i_success");
var $error = $("#asp_i_error");
var $error_cont = $("#asp_i_error_cont");
var $dontclose = $("#asp_i_dontclose");
var data = "";
var keywords_found = 0;
var remaining_blogs = [];
var blog = "";
var initial_action = "";
var lastRequestDuration = 0;
var longestRequestDuration = 0;
var _lrStart;
var _timer;
function showTimer(duration, display) {
duration = parseInt(duration);
var timer = duration, minutes, seconds, hours;
clearInterval(_timer);
_timer = setInterval(function () {
hours = parseInt(timer / 3600, 10);
minutes = parseInt(parseInt(timer % 3600, 10) / 60, 10);
seconds = parseInt(timer % 60, 10);
hours = hours < 10 ? "0" + hours : hours;
minutes = minutes < 10 ? "0" + minutes : minutes;
seconds = seconds < 10 ? "0" + seconds : seconds;
$(display).text("Approx. remaining time: " + hours + ":" + minutes + ":" + seconds);
if (--timer < 0) {
timer = duration;
}
}, 1000);
}
function hideTimer(display) {
clearInterval(_timer);
$(display).text("");
}
function stats(first_run) {
reloadStats = false;
first_run = typeof first_run == 'undefined' ? false : first_run;
$('.index_stats_container .index_stats').addClass('hiddend');
$('.index_stats_container .index_stats_loader').removeClass('hiddend');
$.ajax({
'url': ajaxurl,
'data': {
'action': 'asp_indextable_get_stats',
'asp_it_request_nonce': $('#asp_it_request_nonce').val(),
'blog_id': blog,
'data': $('#asp_indextable_settings').serialize(),
},
'method': 'POST',
'timeout': 90000
}).done(function(response){
var res = response.replace(/^\s*[\r\n]/gm, "");
res = res.match(/!!!ASP_INDEX_STAT_START!!!(.*[\s\S]*)!!!ASP_INDEX_STAT_STOP!!!/);
if (res != null && (typeof res[1] != 'undefined')) {
res = JSON.parse(res[1]);
statsData.postsIndexed = Number(res.postsIndexed);
if ( first_run )
statsData.postsIndexedStart = Number(res.postsIndexed);
statsData.postsToIndex = Number(res.postsToIndex);
statsData.totalKeywords = Number(res.totalKeywords);
statsData.postsTotal = statsData.postsIndexed + statsData.postsToIndex;
$("#indexed_counter").html(statsData.postsIndexed);
$("#not_indexed_counter").html(statsData.postsToIndex);
$("#keywords_counter").html(statsData.totalKeywords);
$('.index_stats_container .index_stats').removeClass('hiddend');
$('.index_stats_container .index_stats_loader').addClass('hiddend');
}
}).fail(function(r){
console.log("Failed to get stats.");
$('.index_stats_container .index_stats').removeClass('hiddend');
$('.index_stats_container .index_stats_loader').addClass('hiddend');
});
}
stats(true);
var statsLastTrigger = (new Date()).getTime();
setInterval(function () {
var elapsedTime = ( (new Date()).getTime() - statsLastTrigger ) / 1000;
if ( reloadStats && elapsedTime > 179 && !indexing && !defragmenting ) {
stats();
statsLastTrigger = (new Date()).getTime();
}
}, 500 );
function index( action, failures, delay ) {
action = typeof action == 'undefined' ? 'extend' : action;
failures = typeof failures == 'undefined' ? false : failures;
delay = typeof delay == 'undefined' ? 0 : delay;
var timeout = 3000;
if ( failures ) {
timeout = 15000;
} else {
if ( lastRequestDuration >= 10 ) {
timeout = 7000;
} else if ( lastRequestDuration <= 4 ) {
timeout = 1500;
}
}
timeout += delay;
data = {
action: 'asp_indextable_admin_ajax',
asp_index_action: action,
blog_id: blog,
data: $('#asp_indextable_settings').serialize(),
asp_it_request_nonce: $('#asp_it_request_nonce').val(),
last_request_duration: lastRequestDuration,
longest_request_duration: longestRequestDuration
};
// Wait a bit to cool off the server
postTimeout = setTimeout(function () {
_lrStart = (new Date()).getTime();
indexing = true;
post = $.post(ajaxurl, data)
.done(asp_on_post_success)
.fail(asp_on_post_failure);
}, timeout );
}
function defragment( the_action ) {
the_action = typeof the_action == 'undefined' ? false : the_action;
defragCount++;
var dfStart = (new Date()).getTime();
console.log("Optimizing: ", defragCount);
defragmenting = true;
$.ajax({
'url': ajaxurl,
'data': {
'action': 'asp_indextable_optimize',
'asp_it_request_nonce': $('#asp_it_request_nonce').val(),
},
'method': 'POST',
'timeout': 60000
}).done(function(r){
console.log("[S] Optimizing finished in: ", parseInt(( (new Date()).getTime() - dfStart ) / 1000) );
defragmenting = false;
if ( the_action !== false ) {
index(the_action, false, 15000);
}
}).fail(function(r){
console.log("[F] Optimizing finished in: ", parseInt(( (new Date()).getTime() - dfStart ) / 1000) );
defragmenting = false;
if ( the_action !== false ) {
index(the_action, false, 30000);
}
});
}
function asp_on_post_success(response) {
lastRequestDuration = (( (new Date()).getTime() - _lrStart ) / 1000);
longestRequestDuration = lastRequestDuration > longestRequestDuration ? lastRequestDuration : longestRequestDuration;
indexing = false;
var res = response.replace(/^\s*[\r\n]/gm, "");
res = res.match(/!!!ASP_INDEX_START!!!(.*[\s\S]*)!!!ASP_INDEX_STOP!!!/);
if (res != null && (typeof res[1] != 'undefined')) {
res = JSON.parse(res[1]);
if (
typeof res.postsIndexedNow != "undefined" ||
(typeof res.postsIndexedNow != "undefined" && remaining_blogs.length > 0)
) {
failCount = 0; // Reset fail counter
// New or extend operation
res.postsToIndex = Number(res.postsToIndex);
statsData.keywordsFound = Number(res.keywordsFound);
statsData.totalIgnored = Number(res.totalIgnored);
statsData.postsIndexedNow += Number(res.postsIndexedNow);
statsData.runTimeNow += lastRequestDuration;
statsData.postsPerSecond = statsData.postsIndexedNow / statsData.runTimeNow;
$("#index_db_other_data").html('Ignored: ' + res.totalIgnored);
if (res.postsToIndex > 0 || remaining_blogs.length > 0) {
var percent = ( (statsData.postsIndexedNow + statsData.postsIndexedStart) / statsData.postsTotal ) * 100;
percent = percent < 0 ? 0 : percent;
percent = percent > 100 ? 99.99 : percent;
keywords_found += statsData.keywordsFound;
$progress_bar.css('width', percent + "%");
showTimer(
( (statsData.postsTotal - statsData.postsIndexedNow - statsData.postsIndexedStart) / statsData.postsPerSecond ) + longestRequestDuration,
'#it_timer'
);
if ($('input[name=it_blog_ids]').val() != "")
$progress_text.html(msg('msg_pro') + " " + percent.toFixed(2) + "% | " + msg('msg_kwf') + keywords_found + " | " + msg('msg_blo') + " " + blog);
else
$progress_text.html(msg('msg_pro') + " " + percent.toFixed(2) + "% | " + msg('msg_kwf') + keywords_found);
var the_action = 'extend';
// No posts left, try switching the blog
if (res.postsToIndex <= 0 && remaining_blogs.length > 0) {
blog = remaining_blogs.shift();
if (initial_action == 'new')
the_action = 'switching_blog';
}
if ( Math.floor( keywords_found / defragInterval) > defragCount ) {
defragment(the_action);
} else {
index(the_action);
}
reloadStats = true;
return;
}
// Indexing finished below this line
keywords_found += statsData.keywordsFound;
// Next indexing starting point
statsData.postsIndexedStart += statsData.postsIndexedNow;
if ( keywords_found > 10000 && defragCount == 0 ) {
// Trigger silent index table alter to prevent fragmentations
defragment(false );
}
stats();
hideTimer("#it_timer");
$('.wd_MSLicenseActivator').trigger('refresh');
$success.removeClass('hiddend').html( sprintf(msg('msg_skw'), keywords_found) );
if ( typeof WPD_Modal != 'undefined' && ASP_IT.first_index == 1 ) {
var $it_first_modal = $('#it_first_modal').detach();
WPD_Modal.options({
'type': 'info',
'content': $it_first_modal,
'header': msg('mod_h1'),
'buttons': {
'okay': {
'text': msg('mod_ms1'),
'type': 'okay',
'click': function(e, button){}
}
}
});
WPD_Modal.show();
}
createCookie('_asp_first_index', 1, 9999);
} else {
//statsData.postsToIndex = Number(res.postsToIndex);
statsData.totalKeywords = Number(res.totalKeywords);
$("#indexed_counter").html(0);
$("#not_indexed_counter").html(statsData.postsToIndex);
$("#keywords_counter").html(statsData.totalKeywords);
$success.removeClass('hiddend').html(msg('msg_emp'));
}
} else {
$error.removeClass('hiddend').html(msg('msg_er1') + ' ');
$error_cont.removeClass('hiddend').val(response);
}
$buttons.removeAttr('disabled');
$progress.addClass('hiddend');
$overlay.addClass('hiddend');
$dontclose.addClass('hiddend');
}
function asp_on_post_failure(response, t) {
lastRequestDuration = parseInt(( (new Date()).getTime() - _lrStart ) / 1000);
longestRequestDuration = lastRequestDuration > longestRequestDuration ? lastRequestDuration : longestRequestDuration;
// Manual abort, do nothing
if ( response.aborted || t == 'abort' )
return;
++failCount;
indexing = false;
// 10 consecutive fails, abort
if ( failCount > 10 ) {
if (t === "timeout") {
$error.removeClass('hiddend').html(msg('msg_er2'));
} else {
$error.removeClass('hiddend').html(msg('msg_er1') + ' ');
console.log(response);
if (
typeof response.status != 'undefined' &&
typeof response.statusText != 'undefined'
) {
$error_cont.removeClass('hiddend').val(msg('msg_sta') + " " + response.status + "\n" + msg('msg_cod') + " " + response.statusText);
} else {
$error_cont.removeClass('hiddend').val(response);
}
}
$buttons.removeAttr('disabled');
$progress.addClass('hiddend');
$overlay.addClass('hiddend');
$dontclose.addClass('hiddend');
} else {
console.log('Index Table Request failed, but continuing in 15 seconds. Consecutive failures count:', failCount);
console.log(response);
index('extend', true);
}
}
$('#asp_index_new, #asp_index_extend, #asp_index_delete').on('click', function (e) {
if (!confirm($(this).attr('index_msg'))) {
return false;
}
statsData.postsIndexedNow = 0;
statsData.runTimeNow = 0;
if ( $(this).attr('index_action') == 'new' ) {
statsData.postsIndexed = 0;
statsData.postsIndexedStart = 0;
}
$('.asp-notice-ri').css("display", "none");
$('.wd_progress_stop').trigger('click');
var blogids_input_val = $('input[name=it_blog_ids]').val().replace('xxx1', '');
if ($('input.use-all-blogs').is(':checked')) {
$(".wpdreamsBlogselect ul.connectedSortable li").each(function () {
remaining_blogs.push($(this).attr('bid'));
});
} else if (blogids_input_val != "") {
remaining_blogs = blogids_input_val.split('|');
} else {
remaining_blogs = ASP_IT.current_blog_id.slice(0);
}
// Still nothing
if (remaining_blogs.length == 0)
remaining_blogs = ASP_IT.current_blog_id.slice(0); // make a shadow clone, otherwise ASP_IT.curr.. will be altered
blog = remaining_blogs.shift();
$buttons.attr('disabled', 'disabled');
$progress.removeClass('hiddend');
$overlay.removeClass('hiddend');
$dontclose.removeClass('hiddend');
$success.addClass('hiddend');
$error.addClass('hiddend');
$error_cont.addClass('hiddend');
initial_action = $(this).attr('index_action');
index($(this).attr('index_action'));
});
$('.wd_progress_stop').on('click', function (e) {
if (post != null) post.abort();
clearTimeout(postTimeout);
indexing = false;
keywords_found = 0;
data = "";
if ( e.originalEvent !== undefined ) {
stats();
}
hideTimer("#it_timer");
$("#index_buttons input[type='button']").removeAttr('disabled');
$(".wd_progress_text, .wd_progress, .wd_progress_stop").addClass('hiddend');
$error.addClass('hiddend');
$error_cont.addClass('hiddend');
$progress_bar.css('width', "0%");
$progress_text.html(msg('msg_ini'));
$overlay.removeClass('hiddend');
$dontclose.addClass('hiddend');
});
$("ul.connectedSortable", $('input[name=it_post_types]').parent()).on("sortupdate", function(){
var val = JSON.parse( WD_Helpers.Base64.decode($('input[name=it_post_types]').val().replace(/^(_decode_)/,"")) );
val = val.join(',');
if ( val.indexOf('attachment') > -1 || val.indexOf('ngg_pictures') > -1 ) {
$('#it_file_indexing').removeClass('disabled-opacity');
$('#it_media_service').removeClass('hiddend');
if (
typeof WPD_Modal != 'undefined' &&
readCookie('_asp_media_service_modal') == null &&
$('input[name=ms_license_active]').val() != 1
) {
WPD_Modal.options({
'type': 'info',
'content': $('#it_media_service_modal').detach(),
'header': msg('mod_h2'),
'buttons': {
'okay': {
'text': msg('mod_ms2'),
'type': 'okay',
'click': function(e, button){
createCookie('_asp_media_service_modal', 1, 9999);
$('#asp_media_service_link').get(0).click();
}
},
'cancel': {
'text': msg('mod_ms3'),
'type': 'cancel',
'click': function(e, button){
createCookie('_asp_media_service_modal', 1, 9999);
}
}
}
});
WPD_Modal.show();
}
} else {
$('#it_file_indexing').addClass('disabled-opacity');
$('#it_media_service').addClass('hiddend');
}
});
$("ul.connectedSortable", $('input[name=it_post_types]').parent()).trigger("sortupdate");
/**
* @description determine if an array contains one or more items from another array.
* @param {array} haystack the array to search.
* @param {array} arr the array providing items to check for in the haystack.
* @return {boolean} true|false if haystack contains at least one item from arr.
*/
var findOne = function (haystack, arr) {
return arr.some(function (v) {
return haystack.indexOf(v) >= 0;
});
};
var mimes = {
'pdf': [
'application/pdf'
],
'text' : [
'text/plain',
'text/csv',
'text/tab-separated-values',
'text/calendar',
'text/css',
'text/vtt',
'text/html'
],
'richtext' : [
'text/richtext',
'application/rtf'
],
'mso_word' : [
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
'application/vnd.ms-word.document.macroEnabled.12',
'application/vnd.openxmlformats-officedocument.wordprocessingml.template',
'application/vnd.ms-word.template.macroEnabled.12',
'application/vnd.oasis.opendocument.text'
],
'mso_excel' : [
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
'application/vnd.ms-excel.sheet.macroEnabled.12',
'application/vnd.ms-excel.sheet.binary.macroEnabled.12',
'application/vnd.openxmlformats-officedocument.spreadsheetml.template',
'application/vnd.ms-excel.template.macroEnabled.12',
'application/vnd.ms-excel.addin.macroEnabled.12',
'application/vnd.oasis.opendocument.spreadsheet',
'application/vnd.oasis.opendocument.chart',
'application/vnd.oasis.opendocument.database',
'application/vnd.oasis.opendocument.formula'
],
'mso_powerpoint' : [
'application/vnd.ms-powerpoint',
'application/vnd.openxmlformats-officedocument.presentationml.presentation',
'application/vnd.ms-powerpoint.presentation.macroEnabled.12',
'application/vnd.openxmlformats-officedocument.presentationml.slideshow',
'application/vnd.ms-powerpoint.slideshow.macroEnabled.12',
'application/vnd.openxmlformats-officedocument.presentationml.template',
'application/vnd.ms-powerpoint.template.macroEnabled.12',
'application/vnd.ms-powerpoint.addin.macroEnabled.12',
'application/vnd.openxmlformats-officedocument.presentationml.slide',
'application/vnd.ms-powerpoint.slide.macroEnabled.12',
'application/vnd.oasis.opendocument.presentation',
'application/vnd.oasis.opendocument.graphics'
],
'image': [
'image/jpeg',
'image/gif',
'image/png',
'image/bmp',
'image/tiff',
'image/x-icon'
],
'video': [
'video/x-ms-asf',
'video/x-ms-wmv',
'video/x-ms-wmx',
'video/x-ms-wm',
'video/avi',
'video/divx',
'video/x-flv',
'video/quicktime',
'video/mpeg',
'video/mp4',
'video/ogg',
'video/webm',
'video/x-matroska'
],
'audio': [
'audio/mpeg',
'audio/x-realaudio',
'audio/wav',
'audio/ogg',
'audio/midi',
'audio/x-ms-wma',
'audio/x-ms-wax',
'audio/x-matroska'
]
};
$("input[name=it_pool_size_auto]").on('change', function(){
if ( $(this).val() == 1 ) {
$('.it_pool_size.item').addClass('disabled');
} else {
$('.it_pool_size.item').removeClass('disabled');
}
});
$("input[name=it_pool_size_auto]").trigger('change');
WPD.Conditionals.init('#it_file_indexing');
WPD.Conditionals.init('#it_inflections');
// ------------------------------------------- ETC -----------------------------------------------------------------
function msg(k) {
return typeof ASP_IT_MSG[k] != 'undefined' ? ASP_IT_MSG[k] : '';
}
function sprintf(s) {
var i = 1, r = '';
while ( s.indexOf('%s') !== false ) {
r = typeof arguments[i] !== 'undefined' ? arguments[i] : '';
s = s.replace('%s', r);
i++;
if ( i > 40 )
break;
}
return s;
}
function createCookie(name,value,days) {
var expires = "";
if (days) {
var date = new Date();
date.setTime(date.getTime() + (days*24*60*60*1000));
expires = "; expires=" + date.toUTCString();
}
document.cookie = name + "=" + value + expires + "; path=/";
}
function readCookie(name) {
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for(var i=0;i < ca.length;i++) {
var c = ca[i];
while (c.charAt(0)==' ') c = c.substring(1,c.length);
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
}
return null;
}
function eraseCookie(name) {
createCookie(name,"",-1);
}
});

View File

@@ -0,0 +1,78 @@
jQuery(function($){
// ---------------------- HELPER FUNCTIONS ----------------------
function h_code(str){
var hash = 0;
if (str.length == 0) return hash;
for (i = 0; i < str.length; i++) {
char = str.charCodeAt(i);
hash = ((hash<<5)-hash)+char;
hash = hash & hash; // Convert to 32bit integer
}
return hash;
}
function disable_instant() {
$('input[name=autocomplete_instant_limit]').closest('.item').addClass('hiddend');
}
function enable_instant() {
$('input[name=autocomplete_instant_limit]').closest('.item').removeClass('hiddend');
}
function get_working_configuration() {
var s = $('input[name=autocomplete_source]').val() +
$('input[name=autocomplete_length]').val() +
$('input[name=autocomplete_instant_limit]').val();
return h_code(s);
}
function get_last_working_configuration() {
return $('input[name=autocomplete_instant_gen_config]').val();
}
function set_last_working_configuration() {
$('input[name=autocomplete_instant_gen_config]').val(get_working_configuration());
}
// -------------------- THE ACTUAL HANDLERS --------------------
$('select[name=autocomplete_instant]').on('change', function(e){
if ( $(this).val() != 'enabled' ) {
disable_instant();
} else {
enable_instant();
}
// Resolve button statuses
if ( get_working_configuration() == get_last_working_configuration() ) {
$('input[id^=asp_inst_generate]').addClass('hiddend');
$('#asp_inst_generate_d').removeClass('hiddend');
} else if ( !$('#asp_inst_generate_d').hasClass('hiddend') ) {
$('input[id^=asp_inst_generate]').removeClass('hiddend');
$('#asp_inst_generate_d').addClass('hiddend');
}
});
$('#asp_inst_generate').on('click', function(e){
$(this).addClass('hiddend');
$('#asp_inst_generate_save').addClass('hiddend');
$('#asp_inst_generate_cancel').removeClass('hiddend');
$('#wpd_white_fixed_bg').css('display', 'block');
$('#asp_inst_generate').closest('.item').addClass('highlight_over_bg');
// Generate DB
// Set status
set_last_working_configuration();
});
$('#asp_inst_generate_save').on('click', function(e){
$(this).addClass('hiddend');
$('#asp_inst_generate').addClass('hiddend');
$('#asp_inst_generate_cancel').removeClass('hiddend');
$('#wpd_white_fixed_bg').css('display', 'block');
$('#asp_inst_generate').closest('.item').addClass('highlight_over_bg');
// Generate DB
// Set status
set_last_working_configuration();
// Trigger save
});
$('#asp_inst_generate_cancel').on('click', function(e) {
$(this).addClass('hiddend');
$('#asp_inst_generate_save').removeClass('hiddend');
$('#asp_inst_generate').removeClass('hiddend');
$('#wpd_white_fixed_bg').css('display', 'none');
$('#asp_inst_generate').closest('.item').removeClass('highlight_over_bg');
});
});

View File

@@ -0,0 +1,57 @@
/* Tagging Basic Style */
.wpd-tagging {
border: 1px solid #CCCCCC;
font-size: 1em;
height: auto;
padding: 10px 10px 15px;
}
.wpd-tagging.wpd-editable {
cursor: text;
}
.wpd-tag {
background: none repeat scroll 0 0 #EE7407;
border-radius: 2px;
color: white;
cursor: default;
display: inline-block;
position: relative;
white-space: nowrap;
padding: 6px 26px 6px 12px;
margin: 5px 10px 0 0;
}
.wpd-tag span {
display: none;
}
.wpd-tag .wpd-tag-i {
color: white;
cursor: pointer;
font-size: 26px;
height: 0;
line-height: 26px;
position: absolute;
right: 9px;
top: 2px;
text-align: center;
width: 10px;
}
.wpd-wpd-tag .wpd-tag-i:hover {
color: black;
text-decoration: underline;
}
.wpd-type-zone {
border: 0 none;
height: auto;
width: auto;
min-width: 20px;
display: inline-block;
}
.wpd-type-zone:focus {
outline: none;
}

View File

@@ -0,0 +1,828 @@
// taggingJS v1.3.3
// 2015-05-04
// Copyright (c) 2014 Fabrizio Fallico
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
(function( $, window, document, undefined ) {
/**
* taggingJS Constructor
*
* @param obj elem DOM object of tag box
* @param obj options Custom JS options
*/
var Tagging = function( elem, options ) {
this.elem = elem; // The tag box
this.$elem = $( elem ); // jQuerify tag box
this.options = options; // JS custom options
this.tags = []; // Here we store all tags
// this.$type_zone = void 0; // The tag box's input zone
};
/**
* taggingJS Prototype
*/
Tagging.prototype = {
// All special Keys
keys: {
// Special keys to add a tag
add: {
comma: ",",
enter: "Enter",
spacebar: " ",
},
// Special keys to remove last tag
remove: {
del: "Delete",
backspace: "Backspace",
}
},
// Default options value
defaults: {
"case-sensitive": false, // True to allow differences between lowercase and uppercase
"close-char": "&times;", // Single Tag close char
"close-class": "tag-i", // Single Tag close class
"edit-on-delete": true, // True to edit tag that has just been removed from tag box
"forbidden-chars": [ ".", "_", "?" ], // Array of forbidden characters
"forbidden-chars-callback": window.alert, // Function to call when there is a forbidden chars
"forbidden-chars-text": "Forbidden character:", // Basic text passed to forbidden-chars callback
"forbidden-words": [], // Array of forbidden words
"forbidden-words-callback": window.alert, // Function to call when there is a forbidden words
"forbidden-words-text": "Forbidden word:", // Basic text passed to forbidden-words callback
"no-backspace": false, // Backspace key remove last tag, true to avoid that
"no-comma": false, // Comma "," key add a new tag, true to avoid that
"no-del": false, // Delete key remove last tag, true to avoid that
"no-duplicate": true, // No duplicate in tag box
"no-duplicate-callback": window.alert, // Function to call when there is a duplicate tag
"no-duplicate-text": "Duplicate tag:", // Basic text passed to no-duplicate callback
"no-enter": false, // Enter key add a new tag, true to avoid that
"no-spacebar": false, // Spacebar key add a new tag by default, true to avoid that
"pre-tags-separator": ", ", // By default, you must put new tags using a new line
"tag-box-class": "tagging", // Class of the tag box
"tag-box-editable-class": "editable", // Class of the tag box when editable, used together with tags-limit option for css targeting
"tag-char": "#", // Single Tag char
"tag-class": "tag", // Single Tag class
"tags-input-name": "tag", // Name to use as name="" in single tags (by default tag[])
"tag-on-blur": true, // Add the current tag if user clicks away from type-zone
"tags-limit": 0, // Limit the number of tags that can be added, zero means no limit
"type-zone-class": "type-zone", // Class of the type-zone
"type-zone-placeholder": "Enter tags here.." // Placeholder of type-zone input
},
/**
* Add a tag
*
* @param string text Text to add as tag, if null we get the content of tag box type_zone.
* @return boolean|funtion true if OK; false if NO; function with some config error.
*/
add: function( text ) {
// console.log( 'add' );
var $tag, l, self,
index, forbidden_words,
callback_f, callback_t;
// Caching this
self = this;
// If text is an array, call add on each element
if ( $.isArray( text ) ) {
// Adding text present on type_zone as tag on first call
return $.each( text, function() {
self.add( this + "" );
});
}
// Forbidden Words shortcut
forbidden_words = self.config[ "forbidden-words" ];
// If no text is passed, take it as text of $type_zone and then empty it
if ( ! text ) {
text = self.valInput();
self.emptyInput();
}
if ( typeof text == 'string' )
text = text.trim();
// If text is empty too, then go out
if ( ! text || ! text.length ) {
return false;
}
// If case-sensitive is true, write everything in lowercase
if ( ! self.config[ "case-sensitive" ] ) {
text = text.toLowerCase();
}
// Checking if text is a Forbidden Word
l = forbidden_words.length;
while ( l-- ) {
// Looking for a forbidden words
index = text.indexOf( forbidden_words[ l ] );
// There is a forbidden word
if ( index >= 0 ) {
// Removing all text and ','
self.emptyInput();
// Renaiming
callback_f = self.config[ "forbidden-words-callback" ];
callback_t = self.config[ "forbidden-words-text" ];
// Remove as a duplicate
return self.throwError( callback_f, callback_t, text );
}
}
// If no-duplicate is true, check that the text is not already present
if ( self.config[ "no-duplicate" ] ) {
// Looking for each text inside tags
l = self.tags.length;
while ( l-- ) {
if ( self.tags[ l ].pure_text === text ) {
// Removing all text and ','
self.emptyInput();
// Renaiming
callback_f = self.config[ "no-duplicate-callback" ];
callback_t = self.config[ "no-duplicate-text" ];
// Remove the duplicate
return self.throwError( callback_f, callback_t, text );
}
}
}
// Creating a new div for the new tag
$tag = $( document.createElement( "div" ) )
.addClass( self.config[ "tag-class" ] )
.html( "<span>" + self.config[ "tag-char" ] + "</span> " + text );
// Creating and Appending hidden input
$( document.createElement( "input" ) )
.attr( "type", "hidden" )
// custom input name
.attr( "name", self.config[ "tags-input-name" ] + "[]" )
.val( text )
.appendTo( $tag );
// Creating and tag button (with "x" to remove tag)
$( document.createElement( "a" ) )
.attr( "role", "button" )
// adding custom class
.addClass( self.config[ "close-class" ] )
// using custom char
.html( self.config[ "close-char" ] )
// click addEventListener
.on('click', function() {
self.remove( $tag );
})
// finally append close button to tag element
.appendTo( $tag );
// Adding pure_text and position property to $tag
$tag.pure_text = text;
// Adding to tags the new tag (as jQuery Object)
self.tags.push( $tag );
// Adding tag in the type zone
self.$type_zone.before( $tag );
// Hide the type zone if we already have a maximum number of tags
if ( self.config[ "tags-limit" ] > 0 && self.tags.length >= self.config[ "tags-limit" ] ) {
// Remove editable class for css targeting
self.$elem.removeClass( self.config[ "tag-box-editable-class" ] );
// Hide the type zone
self.$type_zone.hide();
}
// Trigger after event
self.$elem.trigger("add:after", [text, self]);
return true;
},
/**
* Add a special keys
*
* @param array arr Array like ['type', obj], where 'type' is 'add' or 'remove', obj is { key_name: key_num }
* @return string|obj Error message or actually 'type'_key (add_key or remove_key).
*/
addSpecialKeys: function( arr ) {
// console.log( 'addSpecialKeys' );
var self, value, to_add, obj, type;
self = this;
type = arr[0];
obj = arr[1];
to_add = {};
// If obj is an array, call addSpecialKeys on each element
if ( $.isArray( obj ) ) {
return $.each( obj, function() {
self.addSpecialKeys( [ type, this ] );
});
}
// Check if obj is really an object
// @link http://stackoverflow.com/a/16608045
if ( ( ! obj ) && ( obj.constructor !== Object ) ) {
return "Error -> The second argument is not an Object!";
}
for ( value in obj ) {
if ( obj.hasOwnProperty( value ) ) {
// @link stackoverflow.com/a/3885844
if ( obj[ value ] === +obj[ value ] && obj[ value ] === ( obj[ value ]|0 ) ) {
$.extend( to_add, obj );
}
}
}
self.keys[ type ] = $.extend( {}, to_add, self.keys[ type ] );
return self.keys[ type ];
},
/**
* Opposite of init, remove type_zone, all tags and other things.
*
* @return boolean
*/
destroy: function() {
// Removing the type-zone
this.$elem.find( "." + this.config[ "type-zone-class" ] ).remove();
// Removing all tags
this.$elem.find( "." + this.config[ "tag-class" ] ).remove();
// Destroy tag-box parameters
this.$elem.data( "tag-box", null );
// Exit with success
return true;
},
/**
* Empty tag box's type_zone
*
* @return $_obj The type_zone itself
*/
emptyInput: function() {
// console.log( 'emptyInput' );
this.focusInput();
return this.valInput( "" );
},
/**
* Trigger focus on tag box's input
*
* @return $_obj The tag box's input
*/
focusInput: function() {
// console.log( 'focusInput' );
return this.$type_zone.focus();
},
/**
* Get Data attributes custom options
*
* @return object Tag-box data attributes options
*/
getDataOptions: function() {
var key, data_option, data_options;
// Here we store all data_options
data_options = {};
// For each option
for ( key in this.defaults ) {
// Getting value
data_option = this.$elem.data( key );
// Checking if it is not undefined
if ( data_option /*!= null*/ ) {
// Saving in data_options object
data_options[ key ] = data_option;
}
}
return data_options;
},
/**
* Return all special keys inside an object (without distinction)
*
* @return obj
*/
getSpecialKeys: function() {
return $.extend( {}, this.keys.add, this.keys.remove );
},
/**
* Return all special keys inside an object (with distinction)
*
* @return obj
*/
getSpecialKeysD: function() {
return this.keys;
},
/**
* Return all tags as string
*
* @return array All tags as member of strings.
*/
getTags: function() {
// console.log( 'getTags' );
var all_txt_tags, i, l;
l = this.tags.length;
all_txt_tags = [];
for ( i = 0; i < l; i += 1 ) {
all_txt_tags.push( this.tags[ i ].pure_text );
}
return all_txt_tags;
},
/**
* Return all tags as object
*
* @return array All tags as member of objects.
*/
getTagsObj: function() {
// console.log( 'getTagsObj' );
return this.tags;
},
/**
* Init method to bootstrap all things
*
* @return $_obj The jQuerify tag box
*/
init: function() {
// console.log( 'init' );
var init_text, self, text;
self = this;
// Getting all data Parameters to fully customize the single tag box selecteds
self.config = $.extend( {}, self.defaults, self.options, self.getDataOptions() );
// Pre-existent text
init_text = self.$elem.text();
// Empty the original div
self.$elem.empty();
// Create the type_zone input using custom class and contenteditable attribute
self.$type_zone = $( document.createElement( "input" ) )
.addClass( self.config[ "type-zone-class" ] )
.attr( "contenteditable", true )
.attr( "placeholder", self.config[ "type-zone-placeholder" ] );
// Adding tagging and editable class and appending the type zone
self.$elem
.addClass( self.config[ "tag-box-class" ] )
.addClass( self.config[ "tag-box-editable-class" ] )
.append( self.$type_zone );
// Keydown event listener on tag box type_zone
self.$type_zone.on('keydown', function( e ) {
var key, index, l, pressed_key, all_keys,
forbidden_chars, actual_text,
callback_f, callback_t;
all_keys = self.getSpecialKeys();
// Forbidden Chars shortcut
forbidden_chars = self.config[ "forbidden-chars" ];
// Actual text in the type_zone
actual_text = self.valInput();
// The pressed key
//pressed_key = e.which;
pressed_key = e.key;
//console.log( pressed_key );
// For in loop to look to Remove Keys
if ( ! actual_text ) {
for ( key in all_keys ) {
// Some special key
if ( pressed_key === all_keys[ key ] ) {
// Enter or comma or spacebar - We cannot add an empty tag
if ( self.keys.add[ key ] /*!= null*/ ) {
// Prevent Default
e.preventDefault();
// Exit with 'true'
return true;
}
// Backspace or Del
if ( self.keys.remove[ key ] /*!= null*/ ) {
// Checking if it enabled
if ( ! self.config[ "no-" + key ] ) {
// Prevent Default
e.preventDefault();
return self.remove();
}
}
}
}
} else {
// For loop to remove Forbidden Chars from Text
l = forbidden_chars.length;
while ( l-- ) {
// Looking for a forbidden char
index = actual_text.indexOf( forbidden_chars[ l ] );
// There is a forbidden text
if ( index >= 0 ) {
// Prevent Default
e.preventDefault();
// Removing Forbidden Char
actual_text = actual_text.replace( forbidden_chars[ l ], "" );
// Update type_zone text
self.focusInput();
self.valInput( actual_text );
// Renaiming
callback_f = self.config[ "forbidden-chars-callback" ];
callback_t = self.config[ "forbidden-chars-text" ];
// Remove the duplicate
return self.throwError( callback_f, callback_t, forbidden_chars[ l ] );
}
}
// For in to look in Add Keys
for ( key in self.keys.add ) {
// Enter or comma or spacebar if enabled
if ( pressed_key === self.keys.add[ key ] ) {
if ( ! self.config[ "no-" + key ] ) {
// Prevent Default
e.preventDefault();
// Adding tag with no text
return self.add();
}
}
}
}
// Exit with success
return true;
});
// Add tag on a click away from the type_zone
if ( self.config[ "tag-on-blur" ] ) {
self.$type_zone.focusout(function() {
// Get text from current input box
text = self.valInput();
// If text is empty, then continue focusout
if ( ! text || ! text.length ) {
return false;
}
// Otherwise add the tag first
return self.add();
});
}
// On click, we focus the type_zone
self.$elem.on( "click", function() {
self.focusInput();
});
// Refresh tag box using refresh public method with a text
self.refresh( init_text );
// We don't break the chain, right?
return self;
},
/**
* Remove and insert all tag
*
* @param string text String with all tags (if null, simply we call getTags method)
* @return boolean
*/
refresh: function( text ) {
// console.log( 'refresh' );
var self, separator;
self = this;
separator = self.config[ "pre-tags-separator" ];
text = text || self.getTags().join( separator );
self.reset();
// Adding text present on type_zone as tag on first call
$.each( text.split( separator ), function() {
self.add( this + "" );
});
return true;
},
/**
* Remove last tag in tag box's type_zone or a specified one.
*
* @param string|$_obj The text of tag to remove or the $_obj of itself.
* @return string|$_obj An error if the tag is not found, or the $_obj of removed tag.
*/
remove: function( $tag ) {
// console.log( 'remove' );
var self, text, l;
self = this;
// If $tag is an array, call remove on each element
if ( $.isArray( $tag ) ) {
// Adding text present on type_zone as tag on first call
return $.each( $tag, function() {
self.remove( this + "" );
});
}
// If $tag is a string, we must find the $_obj of the tag
if ( typeof $tag === "string" ) {
// Renaiming
text = $tag;
// Retrieving the $_obj of the tag
$tag = self.$elem.find( "input[value=" + text + "]" ).parent();
// If nothing is found, return an error
if ( ! $tag.length ) {
return "Error -> Tag not found";
}
}
// Not specified any tags
if ( ! $tag ) {
// Retrieving the last
$tag = self.tags.pop();
} else {
// Iterate the tags array and removing the specified tags
l = self.tags.length;
while ( l-- ) {
// Confront the content of $tag and the tags array
if ( self.tags[ l ][0].innerHTML === $tag[0].innerHTML ) {
// Removing definitively
self.tags.splice( l, 1 );
}
}
}
// Getting text if not alredy setted
text = text || $tag.pure_text;
// Removing last tag
$tag.remove();
// If you want to change the text when a tag is deleted
if ( self.config[ "edit-on-delete" ] ) {
// Empting input
self.emptyInput();
// Set the new text
self.valInput( $tag.pure_text );
}
// Show the type zone if we no longer have a maximum number of tags
if ( self.config[ "tags-limit" ] > 0 && self.$type_zone.not(":visible") && self.tags.length < self.config[ "tags-limit" ] ) {
// Add editable class for css targeting
self.$elem.addClass( self.config[ "tag-box-editable-class" ] );
// Show the type zone
self.$type_zone.show();
}
// Trigger after event
self.$elem.trigger("remove:after", [text, self]);
return $tag;
},
/**
* Alias of reset
*
* @return array All removed tags
*/
removeAll: function() {
// console.log( 'removeAll' );
return this.reset();
},
/**
* Remove a special keys
*
* @param array arr Array like ['type', key_code], where 'type' is 'add' or 'remove', key_code is the key number
* @return obj Actually 'type'_key (add_key or remove_key).
*/
removeSpecialKeys: function( arr ) {
// console.log( 'removeSpecialKeys' );
var self, value, to_add, key_code, type;
self = this;
type = arr[0];
key_code = arr[1];
to_add = {};
// If key_code is an array, call removeSpecialKeys on each element
if ( $.isArray( key_code ) ) {
return $.each( key_code, function() {
self.removeSpecialKeys( [ type, this ] );
});
}
// Iterate proper array
for ( value in self.keys[ type ] ) {
if ( self.keys[ type ].hasOwnProperty( value ) ) {
// If the key_code is equal to the actual key_code
if ( self.keys[ type ][ value ] === key_code ) {
// We set to undefined the property
self.keys[ type ][ value ] = undefined;
}
}
}
return self.keys[ type ];
},
/**
* Remove all tags from tag box's type_zone
*
* @return array All removed tags
*/
reset: function() {
// console.log( 'reset' );
while (this.tags.length ) {
this.remove( this.tags[ this.tags.length ] );
}
this.emptyInput();
return this.tags;
},
/**
* Raise a callback with some text
*
* @param function callback_f Callback function
* @param string callback_t Basic text
* @param string tag_text Tag text
* @return function
*/
throwError: function( callback_f, callback_t, tag_text ) {
// Calling the callback with t as th
return callback_f( [ callback_t + " '" + tag_text + "'." ] );
},
/**
* Get or Set the tag box type_zone's value
*
* @param string text String to put as tag box type_zone's value
* @return string|$_obj The value of tag box's type_zone or the type_zone itself
*/
valInput: function( text ) {
// console.log( 'valInput' );
if ( text == null ) {
return this.$type_zone.val();
}
return this.$type_zone.val( text );
},
};
/**
* Registering taggingJS
*
* @param obj|string arg1 Object with custom options or string with a method
* @param string arg2 Argument to pass to the method
* @return $_Obj All tag-box or result from "arg2" public method.
*/
$.fn.tagging = function( arg1, arg2 ) {
var results = [];
this.each(function() {
var $this, tagging, val;
$this = $( this );
tagging = $this.data( "tag-box" );
// Initialize a new tags input
if ( ! tagging ) {
tagging = new Tagging( this, arg1 );
$this.data( "tag-box", tagging );
tagging.init();
results.push( tagging.$elem );
} else {
// Invoke function on existing tags input
val = tagging[ arg1 ]( arg2 );
if ( val /*!= null*/ ) {
results.push( val );
}
}
});
if ( typeof arg1 === "string") {
// Return the results from the invoked function calls
return ( results.length > 1 ) ? results : results[0];
}
return results;
};
})( window.jQuery, window, document );

View File

@@ -0,0 +1 @@
.jqplot-target{position:relative;color:#666;font-family:"Trebuchet MS",Arial,Helvetica,sans-serif;font-size:1em;}.jqplot-axis{font-size:.75em;}.jqplot-xaxis{margin-top:10px;}.jqplot-x2axis{margin-bottom:10px;}.jqplot-yaxis{margin-right:10px;}.jqplot-y2axis,.jqplot-y3axis,.jqplot-y4axis,.jqplot-y5axis,.jqplot-y6axis,.jqplot-y7axis,.jqplot-y8axis,.jqplot-y9axis,.jqplot-yMidAxis{margin-left:10px;margin-right:10px;}.jqplot-axis-tick,.jqplot-xaxis-tick,.jqplot-yaxis-tick,.jqplot-x2axis-tick,.jqplot-y2axis-tick,.jqplot-y3axis-tick,.jqplot-y4axis-tick,.jqplot-y5axis-tick,.jqplot-y6axis-tick,.jqplot-y7axis-tick,.jqplot-y8axis-tick,.jqplot-y9axis-tick,.jqplot-yMidAxis-tick{position:absolute;white-space:pre;}.jqplot-xaxis-tick{top:0;left:15px;vertical-align:top;}.jqplot-x2axis-tick{bottom:0;left:15px;vertical-align:bottom;}.jqplot-yaxis-tick{right:0;top:15px;text-align:right;}.jqplot-yaxis-tick.jqplot-breakTick{right:-20px;margin-right:0;padding:1px 5px 1px 5px;z-index:2;font-size:1.5em;}.jqplot-y2axis-tick,.jqplot-y3axis-tick,.jqplot-y4axis-tick,.jqplot-y5axis-tick,.jqplot-y6axis-tick,.jqplot-y7axis-tick,.jqplot-y8axis-tick,.jqplot-y9axis-tick{left:0;top:15px;text-align:left;}.jqplot-yMidAxis-tick{text-align:center;white-space:nowrap;}.jqplot-xaxis-label{margin-top:10px;font-size:11pt;position:absolute;}.jqplot-x2axis-label{margin-bottom:10px;font-size:11pt;position:absolute;}.jqplot-yaxis-label{margin-right:10px;font-size:11pt;position:absolute;}.jqplot-yMidAxis-label{font-size:11pt;position:absolute;}.jqplot-y2axis-label,.jqplot-y3axis-label,.jqplot-y4axis-label,.jqplot-y5axis-label,.jqplot-y6axis-label,.jqplot-y7axis-label,.jqplot-y8axis-label,.jqplot-y9axis-label{font-size:11pt;margin-left:10px;position:absolute;}.jqplot-meterGauge-tick{font-size:.75em;color:#999;}.jqplot-meterGauge-label{font-size:1em;color:#999;}table.jqplot-table-legend{margin-top:12px;margin-bottom:12px;margin-left:12px;margin-right:12px;}table.jqplot-table-legend,table.jqplot-cursor-legend{background-color:rgba(255,255,255,0.6);border:1px solid #ccc;position:absolute;font-size:.75em;}td.jqplot-table-legend{vertical-align:middle;}td.jqplot-seriesToggle:hover,td.jqplot-seriesToggle:active{cursor:pointer;}.jqplot-table-legend .jqplot-series-hidden{text-decoration:line-through;}div.jqplot-table-legend-swatch-outline{border:1px solid #ccc;padding:1px;}div.jqplot-table-legend-swatch{width:0;height:0;border-top-width:5px;border-bottom-width:5px;border-left-width:6px;border-right-width:6px;border-top-style:solid;border-bottom-style:solid;border-left-style:solid;border-right-style:solid;}.jqplot-title{top:0;left:0;padding-bottom:.5em;font-size:1.2em;}table.jqplot-cursor-tooltip{border:1px solid #ccc;font-size:.75em;}.jqplot-cursor-tooltip{border:1px solid #ccc;font-size:.75em;white-space:nowrap;background:rgba(208,208,208,0.5);padding:1px;}.jqplot-highlighter-tooltip,.jqplot-canvasOverlay-tooltip{border:1px solid #ccc;font-size:.75em;white-space:nowrap;background:rgba(208,208,208,0.5);padding:1px;}.jqplot-point-label{font-size:.75em;z-index:2;}td.jqplot-cursor-legend-swatch{vertical-align:middle;text-align:center;}div.jqplot-cursor-legend-swatch{width:1.2em;height:.7em;}.jqplot-error{text-align:center;}.jqplot-error-message{position:relative;top:46%;display:inline-block;}div.jqplot-bubble-label{font-size:.8em;padding-left:2px;padding-right:2px;color:rgb(20%,20%,20%);}div.jqplot-bubble-label.jqplot-bubble-label-highlight{background:rgba(90%,90%,90%,0.7);}div.jqplot-noData-container{text-align:center;background-color:rgba(96%,96%,96%,0.3);}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,57 @@
/**
* jqPlot
* Pure JavaScript plotting plugin using jQuery
*
* Version: 1.0.4r1121
*
* Copyright (c) 2009-2011 Chris Leonello
* jqPlot is currently available for use in all personal or commercial projects
* under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
* version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
* choose the license that best suits your project and use it accordingly.
*
* Although not required, the author would appreciate an email letting him
* know of any substantial use of jqPlot. You can reach the author at:
* chris at jqplot dot com or see http://www.jqplot.com/info.php .
*
* If you are feeling kind and generous, consider supporting the project by
* making a donation at: http://www.jqplot.com/donate.php .
*
* sprintf functions contained in jqplot.sprintf.js by Ash Searle:
*
* version 2007.04.27
* author Ash Searle
* http://hexmen.com/blog/2007/03/printf-sprintf/
* http://hexmen.com/js/sprintf.js
* The author (Ash Searle) has placed this code in the public domain:
* "This code is unrestricted: you are free to use it however you like."
*
* included jsDate library by Chris Leonello:
*
* Copyright (c) 2010-2011 Chris Leonello
*
* jsDate is currently available for use in all personal or commercial projects
* under both the MIT and GPL version 2.0 licenses. This means that you can
* choose the license that best suits your project and use it accordingly.
*
* jsDate borrows many concepts and ideas from the Date Instance
* Methods by Ken Snyder along with some parts of Ken's actual code.
*
* Ken's origianl Date Instance Methods and copyright notice:
*
* Ken Snyder (ken d snyder at gmail dot com)
* 2008-09-10
* version 2.0.2 (http://kendsnyder.com/sandbox/date/)
* Creative Commons Attribution License 3.0 (http://creativecommons.org/licenses/by/3.0/)
*
* jqplotToImage function based on Larry Siden's export-jqplot-to-png.js.
* Larry has generously given permission to adapt his code for inclusion
* into jqPlot.
*
* Larry's original code can be found here:
*
* https://github.com/lsiden/export-jqplot-to-png
*
*
*/
(function(a){a.jqplot.CanvasAxisTickRenderer=function(b){this.mark="outside";this.showMark=true;this.showGridline=true;this.isMinorTick=false;this.angle=0;this.markSize=4;this.show=true;this.showLabel=true;this.labelPosition="auto";this.label="";this.value=null;this._styles={};this.formatter=a.jqplot.DefaultTickFormatter;this.formatString="";this.prefix="";this.fontFamily='"Trebuchet MS", Arial, Helvetica, sans-serif';this.fontSize="10pt";this.fontWeight="normal";this.fontStretch=1;this.textColor="#666666";this.enableFontSupport=true;this.pt2px=null;this._elem;this._ctx;this._plotWidth;this._plotHeight;this._plotDimensions={height:null,width:null};a.extend(true,this,b);var c={fontSize:this.fontSize,fontWeight:this.fontWeight,fontStretch:this.fontStretch,fillStyle:this.textColor,angle:this.getAngleRad(),fontFamily:this.fontFamily};if(this.pt2px){c.pt2px=this.pt2px}if(this.enableFontSupport){if(a.jqplot.support_canvas_text()){this._textRenderer=new a.jqplot.CanvasFontRenderer(c)}else{this._textRenderer=new a.jqplot.CanvasTextRenderer(c)}}else{this._textRenderer=new a.jqplot.CanvasTextRenderer(c)}};a.jqplot.CanvasAxisTickRenderer.prototype.init=function(b){a.extend(true,this,b);this._textRenderer.init({fontSize:this.fontSize,fontWeight:this.fontWeight,fontStretch:this.fontStretch,fillStyle:this.textColor,angle:this.getAngleRad(),fontFamily:this.fontFamily})};a.jqplot.CanvasAxisTickRenderer.prototype.getWidth=function(d){if(this._elem){return this._elem.outerWidth(true)}else{var f=this._textRenderer;var c=f.getWidth(d);var e=f.getHeight(d);var b=Math.abs(Math.sin(f.angle)*e)+Math.abs(Math.cos(f.angle)*c);return b}};a.jqplot.CanvasAxisTickRenderer.prototype.getHeight=function(d){if(this._elem){return this._elem.outerHeight(true)}else{var f=this._textRenderer;var c=f.getWidth(d);var e=f.getHeight(d);var b=Math.abs(Math.cos(f.angle)*e)+Math.abs(Math.sin(f.angle)*c);return b}};a.jqplot.CanvasAxisTickRenderer.prototype.getAngleRad=function(){var b=this.angle*Math.PI/180;return b};a.jqplot.CanvasAxisTickRenderer.prototype.setTick=function(b,d,c){this.value=b;if(c){this.isMinorTick=true}return this};a.jqplot.CanvasAxisTickRenderer.prototype.draw=function(c,f){if(!this.label){this.label=this.prefix+this.formatter(this.formatString,this.value)}if(this._elem){if(a.jqplot.use_excanvas&&window.G_vmlCanvasManager.uninitElement!==undefined){window.G_vmlCanvasManager.uninitElement(this._elem.get(0))}this._elem.emptyForce();this._elem=null}var e=f.canvasManager.getCanvas();this._textRenderer.setText(this.label,c);var b=this.getWidth(c);var d=this.getHeight(c);e.width=b;e.height=d;e.style.width=b;e.style.height=d;e.style.textAlign="left";e.style.position="absolute";e=f.canvasManager.initCanvas(e);this._elem=a(e);this._elem.css(this._styles);this._elem.addClass("jqplot-"+this.axis+"-tick");e=null;return this._elem};a.jqplot.CanvasAxisTickRenderer.prototype.pack=function(){this._textRenderer.draw(this._elem.get(0).getContext("2d"),this.label)}})(jQuery);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,493 @@
/***
Spectrum Colorpicker v1.1.1
https://github.com/bgrins/spectrum
Author: Brian Grinstead
License: MIT
***/
.sp-container {
position:absolute;
top:0;
left:0;
display:inline-block;
*display: inline;
*zoom: 1;
z-index: 2147483647;
overflow: hidden;
}
.sp-container.sp-flat {
position: relative;
}
/* http://ansciath.tumblr.com/post/7347495869/css-aspect-ratio */
.sp-top {
position:relative;
width: 100%;
display:inline-block;
}
.sp-top-inner {
position:absolute;
top:0;
left:0;
bottom:0;
right:0;
}
.sp-color {
position: absolute;
top:0;
left:0;
bottom:0;
right:20%;
cursor: pointer;
}
.sp-hue {
position: absolute;
top:0;
right:0;
bottom:0;
left:84%;
height: 100%;
}
.sp-fill {
padding-top: 80%;
}
.sp-sat, .sp-val {
position: absolute;
top:0;
left:0;
right:0;
bottom:0;
}
.sp-alpha-enabled .sp-top
{
margin-bottom: 18px;
}
.sp-alpha-enabled .sp-alpha
{
display: block;
}
.sp-alpha-handle
{
position:absolute;
top:-4px;
bottom: -4px;
width: 6px;
left: 50%;
cursor: pointer;
border: 1px solid black;
background: white;
opacity: .8;
}
.sp-alpha
{
display: none;
position: absolute;
bottom: -14px;
right: 0;
left: 0;
height: 8px;
}
.sp-alpha-inner{
border: solid 1px #333;
}
/* Don't allow text selection */
.sp-container, .sp-replacer, .sp-preview, .sp-dragger, .sp-slider, .sp-alpha, .sp-alpha-handle, .sp-container.sp-dragging .sp-input, .sp-container button {
-webkit-user-select:none;
-moz-user-select: -moz-none;
-o-user-select:none;
user-select: none;
}
.sp-container.sp-input-disabled .sp-input-container {
display: none;
}
.sp-container.sp-buttons-disabled .sp-button-container {
display: none;
}
.sp-palette-only .sp-picker-container {
display: none;
}
.sp-palette-disabled .sp-palette-container {
display: none;
}
.sp-initial-disabled .sp-initial {
display: none;
}
/* Gradients for hue, saturation and value instead of images. Not pretty... but it works */
.sp-sat {
background-image: -webkit-gradient(linear, 0 0, 100% 0, from(#FFF), to(rgba(204, 154, 129, 0)));
background-image: -webkit-linear-gradient(left, #FFF, rgba(204, 154, 129, 0));
background-image: -moz-linear-gradient(left, #fff, rgba(204, 154, 129, 0));
background-image: -o-linear-gradient(left, #fff, rgba(204, 154, 129, 0));
background-image: -ms-linear-gradient(left, #fff, rgba(204, 154, 129, 0));
background-image: linear-gradient(to right, #fff, rgba(204, 154, 129, 0));
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType = 1, startColorstr=#FFFFFFFF, endColorstr=#00CC9A81)";
filter : progid:DXImageTransform.Microsoft.gradient(GradientType = 1, startColorstr='#FFFFFFFF', endColorstr='#00CC9A81');
}
.sp-val {
background-image: -webkit-gradient(linear, 0 100%, 0 0, from(#000000), to(rgba(204, 154, 129, 0)));
background-image: -webkit-linear-gradient(bottom, #000000, rgba(204, 154, 129, 0));
background-image: -moz-linear-gradient(bottom, #000, rgba(204, 154, 129, 0));
background-image: -o-linear-gradient(bottom, #000, rgba(204, 154, 129, 0));
background-image: -ms-linear-gradient(bottom, #000, rgba(204, 154, 129, 0));
background-image: linear-gradient(to top, #000, rgba(204, 154, 129, 0));
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#00CC9A81, endColorstr=#FF000000)";
filter : progid:DXImageTransform.Microsoft.gradient(startColorstr='#00CC9A81', endColorstr='#FF000000');
}
.sp-hue {
background: -moz-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);
background: -ms-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);
background: -o-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);
background: -webkit-gradient(linear, left top, left bottom, from(#ff0000), color-stop(0.17, #ffff00), color-stop(0.33, #00ff00), color-stop(0.5, #00ffff), color-stop(0.67, #0000ff), color-stop(0.83, #ff00ff), to(#ff0000));
background: -webkit-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);
}
/* IE filters do not support multiple color stops.
Generate 6 divs, line them up, and do two color gradients for each.
Yes, really.
*/
.sp-1 {
height:17%;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0000', endColorstr='#ffff00');
}
.sp-2 {
height:16%;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffff00', endColorstr='#00ff00');
}
.sp-3 {
height:17%;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00ff00', endColorstr='#00ffff');
}
.sp-4 {
height:17%;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00ffff', endColorstr='#0000ff');
}
.sp-5 {
height:16%;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0000ff', endColorstr='#ff00ff');
}
.sp-6 {
height:17%;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff00ff', endColorstr='#ff0000');
}
.sp-hidden {
display: none !important;
}
/* Clearfix hack */
.sp-cf:before, .sp-cf:after { content: ""; display: table; }
.sp-cf:after { clear: both; }
.sp-cf { *zoom: 1; }
/* Mobile devices, make hue slider bigger so it is easier to slide */
@media (max-device-width: 480px) {
.sp-color { right: 40%; }
.sp-hue { left: 63%; }
.sp-fill { padding-top: 60%; }
}
.sp-dragger {
border-radius: 5px;
height: 5px;
width: 5px;
border: 1px solid #fff;
background: #000;
cursor: pointer;
position:absolute;
top:0;
left: 0;
}
.sp-slider {
position: absolute;
top:0;
cursor:pointer;
height: 3px;
left: -1px;
right: -1px;
border: 1px solid #000;
background: white;
opacity: .8;
}
/* Basic display options (colors, fonts, global widths) */
.sp-container {
background-color: #FEFEFE;
border: 1px solid transparent;
border-radius: 0 0 0 0;
padding: 0;
box-shadow: 0 0px 24px -10px #000000;
}
.sp-container, .sp-container button, .sp-container input, .sp-color, .sp-hue
{
font: normal 12px "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Geneva, Verdana, sans-serif;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
}
.sp-top
{
margin-bottom: 3px;
}
.sp-color, .sp-hue
{
border: solid 1px #666;
}
/* Input */
.sp-input-container {
float:right;
width: 100px;
margin-bottom: 4px;
}
.sp-initial-disabled .sp-input-container {
width: 100%;
}
.sp-input {
font-size: 12px !important;
border: 1px inset;
padding: 4px 5px;
margin: 0;
width: 100%;
background:transparent;
border-radius: 3px;
color: #222;
}
.sp-input:focus {
border: 1px solid orange;
}
.sp-input.sp-validation-error
{
border: 1px solid red;
background: #fdd;
}
.sp-picker-container , .sp-palette-container
{
float:left;
position: relative;
padding: 10px;
padding-bottom: 300px;
margin-bottom: -290px;
}
.sp-picker-container
{
width: 172px;
border-left: solid 1px #fff;
}
/* Palettes */
.sp-palette-container
{
border-right: solid 1px #ccc;
}
.sp-palette .sp-thumb-el {
display: block;
position:relative;
float:left;
width: 24px;
height: 15px;
margin: 3px;
cursor: pointer;
border:solid 2px transparent;
}
.sp-palette .sp-thumb-el:hover, .sp-palette .sp-thumb-el.sp-thumb-active {
border-color: orange;
}
.sp-thumb-el
{
position:relative;
}
/* Initial */
.sp-initial
{
float: left;
border: solid 1px #333;
}
.sp-initial span {
width: 30px;
height: 25px;
border:none;
display:block;
float:left;
margin:0;
}
/* Buttons */
.sp-button-container {
float: right;
}
/* Replacer (the little preview div that shows up instead of the <input>) */
.sp-replacer {
background: none repeat scroll 0 0 #FEFEFE;
border: 1px solid #E5E5E5;
box-shadow: 0 0 3px rgba(0, 0, 0, 0.1);
color: #333333;
cursor: pointer;
display: inline-block;
margin: 0;
overflow: hidden;
padding: 4px;
vertical-align: middle;
}
.sp-replacer:hover {
border-color: #F0C49B;
color: #111;
}
.sp-replacer.sp-active {
border-bottom: 1px solid transparent;
border-color: #DDDDDD #DDDDDD transparent;
color: #111111;
}
.sp-replacer.sp-disabled {
cursor:default;
border-color: silver;
color: silver;
}
.sp-dd {
padding: 2px 0;
height: 16px;
line-height: 16px;
float:left;
font-size:10px;
}
.sp-preview
{
position:relative;
width:25px;
height: 20px;
border: solid 1px #222;
margin-right: 5px;
float:left;
z-index: 0;
}
.sp-palette
{
*width: 220px;
max-width: 220px;
}
.sp-palette .sp-thumb-el
{
width:16px;
height: 16px;
margin:2px 1px;
border: solid 1px #d0d0d0;
}
.sp-container
{
padding-bottom:0;
}
/* Buttons: http://hellohappy.org/css3-buttons/ */
.sp-container button {
background-color: #eeeeee;
background-image: -webkit-linear-gradient(top, #eeeeee, #cccccc);
background-image: -moz-linear-gradient(top, #eeeeee, #cccccc);
background-image: -ms-linear-gradient(top, #eeeeee, #cccccc);
background-image: -o-linear-gradient(top, #eeeeee, #cccccc);
background-image: -ms-linear-gradient(top, #eeeeee, #cccccc);
background-image: linear-gradient(to bottom, #eeeeee, #cccccc);
border: 1px solid #ccc;
border-bottom: 1px solid #bbb;
border-radius: 3px;
color: #333;
font-size: 14px;
line-height: 1;
padding: 5px 4px;
text-align: center;
text-shadow: 0 1px 0 #eee;
vertical-align: middle;
}
.sp-container button:hover {
background-color: #dddddd;
background-image: -webkit-linear-gradient(top, #dddddd, #bbbbbb);
background-image: -moz-linear-gradient(top, #dddddd, #bbbbbb);
background-image: -ms-linear-gradient(top, #dddddd, #bbbbbb);
background-image: -o-linear-gradient(top, #dddddd, #bbbbbb);
background-image: -ms-linear-gradient(top, #dddddd, #bbbbbb);
background-image: linear-gradient(to bottom, #dddddd, #bbbbbb);
border: 1px solid #bbb;
border-bottom: 1px solid #999;
cursor: pointer;
text-shadow: 0 1px 0 #ddd;
}
.sp-container button:active {
border: 1px solid #aaa;
border-bottom: 1px solid #888;
-webkit-box-shadow: inset 0 0 5px 2px #aaaaaa, 0 1px 0 0 #eeeeee;
-moz-box-shadow: inset 0 0 5px 2px #aaaaaa, 0 1px 0 0 #eeeeee;
-ms-box-shadow: inset 0 0 5px 2px #aaaaaa, 0 1px 0 0 #eeeeee;
-o-box-shadow: inset 0 0 5px 2px #aaaaaa, 0 1px 0 0 #eeeeee;
box-shadow: inset 0 0 5px 2px #aaaaaa, 0 1px 0 0 #eeeeee;
}
.sp-cancel
{
font-size: 11px;
color: #d93f3f !important;
margin:0;
padding:2px;
margin-right: 5px;
vertical-align: middle;
text-decoration:none;
}
.sp-cancel:hover
{
color: #d93f3f !important;
text-decoration: underline;
}
.sp-palette span:hover, .sp-palette span.sp-thumb-active
{
border-color: #000;
}
.sp-preview, .sp-alpha, .sp-thumb-el
{
position:relative;
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==);
}
.sp-preview-inner, .sp-alpha-inner, .sp-thumb-inner
{
display:block;
position:absolute;
top:0;left:0;bottom:0;right:0;
}
.sp-palette .sp-thumb-inner
{
background-position: 50% 50%;
background-repeat: no-repeat;
}
.sp-palette .sp-thumb-light.sp-thumb-active .sp-thumb-inner
{
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAIVJREFUeNpiYBhsgJFMffxAXABlN5JruT4Q3wfi/0DsT64h8UD8HmpIPCWG/KemIfOJCUB+Aoacx6EGBZyHBqI+WsDCwuQ9mhxeg2A210Ntfo8klk9sOMijaURm7yc1UP2RNCMbKE9ODK1HM6iegYLkfx8pligC9lCD7KmRof0ZhjQACDAAceovrtpVBRkAAAAASUVORK5CYII=);
}
.sp-palette .sp-thumb-dark.sp-thumb-active .sp-thumb-inner
{
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAMdJREFUOE+tkgsNwzAMRMugEAahEAahEAZhEAqlEAZhEAohEAYh81X2dIm8fKpEspLGvudPOsUYpxE2BIJCroJmEW9qJ+MKaBFhEMNabSy9oIcIPwrB+afvAUFoK4H0tMaQ3XtlrggDhOVVMuT4E5MMG0FBbCEYzjYT7OxLEvIHQLY2zWwQ3D+9luyOQTfKDiFD3iUIfPk8VqrKjgAiSfGFPecrg6HN6m/iBcwiDAo7WiBeawa+Kwh7tZoSCGLMqwlSAzVDhoK+6vH4G0P5wdkAAAAASUVORK5CYII=);
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,132 @@
jQuery(function ($) {
var $success = $("#asp_i_success");
var $error = $("#asp_i_error");
var $error_cont = $("#asp_i_error_cont");
$('#asp_reset, #asp_wipe').on('click', function(e){
e.preventDefault();
asp_clear_msg();
if ( $(this).attr('id') == 'asp_reset' )
var r = confirm(msg('msg_res'));
else if ( $(this).attr('id') == 'asp_wipe' )
var r = confirm(msg('msg_rem'));
else
var r = true;
if (r == true) {
asp_disable_buttons();
var data = {
'action' : 'asp_maintenance_admin_ajax',
'data' : $(this).closest('form').serialize()
};
$.post(ajaxurl, data)
.done(asp_on_post_success)
.fail(asp_on_post_failure);
$('.loading-small', $(this).parent()).removeClass('hiddend');
}
return true;
});
$('#asp_index_defrag').on('click', function(e){
e.preventDefault();
asp_clear_msg();
asp_disable_buttons();
var data = {
'action' : 'asp_maintenance_admin_ajax',
'data' : $(this).closest('form').serialize()
};
$.ajax({
'url': ajaxurl,
'data': data,
'method': 'POST',
'timeout': 60000
}).done(function(){
asp_enable_buttons();
asp_show_success('Index table optimized!');
}).fail(function(){
asp_enable_buttons();
asp_show_success('Index table optimized!');
});
$('.loading-small', $(this).parent()).removeClass('hiddend');
return true;
});
function asp_on_post_success(response) {
var res = response.replace(/^\s*[\r\n]/gm, "");
res = res.match(/!!!ASP_MAINT_START!!!(.*[\s\S]*)!!!ASP_MAINT_STOP!!!/);
if (res != null && (typeof res[1] != 'undefined')) {
res = JSON.parse(res[1]);
if (typeof res.status != "undefined" && res.status == 1 ) {
if ( res.action == 'redirect' ) {
asp_show_success('<strong>SUCCESS: </strong>' + res.msg);
setTimeout(function () {
location.href = ASP_MNT.admin_url + '/plugins.php';
}, 5000);
} else if ( res.action == 'refresh' ) {
asp_show_success(msg('msg_suc'));
$('form#asp_empty_redirect input[name=asp_mnt_msg]').val(res.msg);
$('form#asp_empty_redirect').submit();
} else {
asp_show_success('<strong>'+msg('msg_ssc')+' </strong>' + res.msg);
}
} else {
if (typeof res.status != "undefined" && res.status == 0 ) {
asp_show_error('<strong>'+msg('msg_fal')+' </strong>' + res.msg);
} else {
asp_show_error(msg('msg_err') + ' ', response);
}
asp_enable_buttons();
}
} else { // Failure?
asp_show_error(msg('msg_err') + ' ', response);
asp_enable_buttons();
}
}
function asp_on_post_failure(response, t) {
if (t === "timeout") {
asp_show_error(msg('msg_tim'));
} else {
asp_show_error(msg('msg_err') + ' ', response);
}
asp_enable_buttons();
}
function asp_show_success(msg) {
$success.removeClass('hiddend').html(msg);
}
function asp_show_error(msg, response) {
$error.removeClass('hiddend').html(msg);
if ( typeof response !== 'undefined') {
console.log(response);
if (
typeof response.status != 'undefined' &&
typeof response.statusText != 'undefined'
) {
$error_cont.removeClass('hiddend').val("Status: " + response.status + "\nCode: " + response.statusText);
} else {
$error_cont.removeClass('hiddend').val(response);
}
}
}
function asp_disable_buttons() {
$('#asp_reset, #asp_wipe, #asp_index_defrag').addClass('disabled');
}
function asp_enable_buttons() {
$('.loading-small').addClass('hiddend');
$('#asp_reset, #asp_wipe, #asp_index_defrag').removeClass('disabled');
}
function asp_clear_msg() {
$error_cont.addClass('hiddend');
$error.addClass('hiddend');
$success.addClass('hiddend');
}
// ------------------------------------------- ETC -----------------------------------------------------------------
function msg(k) {
return typeof ASP_MNT[k] != 'undefined' ? ASP_MNT[k] : '';
}
});

View File

@@ -0,0 +1,140 @@
(function ($) {
/**
* Contains pseudo selector, case insensitive
*/
jQuery.expr[':'].Contains = function(a, i, m) {
return jQuery(a).text().toUpperCase()
.indexOf(m[3].toUpperCase()) >= 0;
};
var matches = [];
function os_fetch_results( phrase ) {
clean_phrase = phrase.replace(/,|\.|\!|\?/gi);
var parts = clean_phrase.split(" ");
var contains = "";
exact_matches = [];
matches = [];
for (var i=0; i<parts.length; i++) {
contains = contains + ":Contains(" + parts[i] + ")";
}
matches = $("#wpdreams fieldset .item" + contains).slice(0, 10);
}
function os_group_results() {
grouped_res = {};
for (var i=0; i<matches.length; i++) {
var this_group = "";
var tabid = 0;
var _breaker = 0;
$parent = $(matches[i]).parent();
while (!$parent.hasClass("wpdreams-box")) {
if (_breaker > 500) break;
if ( typeof $parent.attr("tabid") != "undefined" ) {
if (this_group == "")
this_group = $("ul li a[tabid=" + $parent.attr("tabid") + "]").text();
else
this_group = $("ul li a[tabid=" + $parent.attr("tabid") + "]").text() + " >> " + this_group;
}
if (typeof $parent.attr('tabid') != "undefined" && tabid == 0)
tabid = $parent.attr('tabid');
$parent = $parent.parent();
_breaker++;
}
this_group = this_group == "" ? "ungrouped" : this_group;
if (
$( "label", $(matches[i])).length > 0 ||
$( "fieldset legend", $(matches[i]) ).length > 0
) {
if ( typeof grouped_res[this_group] == "undefined" )
grouped_res[this_group] = [];
if ( $( "fieldset legend", $(matches[i]) ).length > 0 )
var title = $( $( "fieldset legend", $(matches[i])).get(0) ).text();
else
var title = $( $( "label", $(matches[i]) ).get(0) ).text();
grouped_res[this_group].push({
"title": title,
"tabid": tabid,
"group": this_group,
"node": i
});
}
}
}
function os_show_results() {
var remaining = 10;
var resHTML = "";
if ( Object.keys(grouped_res).length > 0) {
$.each(grouped_res, function (k, v) {
resHTML += "<label>" + k + "</label>";
for (var i = 0; i < v.length; i++) {
resHTML += "<p><a class='asp-os-res' xnode='" + v[i].node + "' tabid='" + v[i].tabid + "' href='#" + v[i].tabid + "'>" + v[i].title + "</a></p>";
}
});
} else {
resHTML = "<label>No results.</label>";
}
$("#asp-os-results").html(resHTML);
}
function os_clear_results() {
$("#asp-os-results").html("");
}
/**
* Very simple main logic
*/
var t = null;
$('#asp-os-input').on('keyup', function(){
$this = $(this);
clearTimeout(t);
t = setTimeout(function(){
var phrase = $this.val().trim();
if (phrase.length > 0) {
var res = os_fetch_results( phrase );
os_group_results()
os_show_results();
} else {
os_clear_results();
}
}, 50)
});
$("#asp-os-results").on("click", "a.asp-os-res", function(){
var tabid = $(this).attr("tabid");
$('.tabs a[tabid=' + Math.floor( tabid / 100 ) + ']').trigger('click');
$('.tabs a[tabid=' + tabid + ']').trigger('click');
$('.asp-os-highlighted').removeClass("asp-os-highlighted");
$(matches[$(this).attr("xnode")]).addClass("asp-os-highlighted");
});
$("#wpdreams").on("click mouseleave", ".asp-os-highlighted", function(){
$(this).removeClass("asp-os-highlighted");
});
})(jQuery);

View File

@@ -0,0 +1,204 @@
.hiddend {
display: none !important;
}
/* RULES LIST */
#pg_no_pg,
#pg_information {
margin: 1.5em 12px;
color: grey;
}
.pg_rule_group {
line-height: 48px;
vertical-align: middle;
border-bottom: 1px dashed #cccccc;
margin: 0 12px;
position: relative;
font-size: 13px;
}
.pg_rule_group:last-child {
border-bottom: none;
}
.pg_rule_group >img {
cursor: pointer;
}
.pg_rule_group >* {
vertical-align: middle;
margin-right: 6px
}
.pg_rule_group >span.pg_name {
margin: 0 0 0 12px;
}
.pg_rule_group >span.pg_info {
color: #ababab;
position: absolute;
right: 0;
top: 50%;
margin-top: -9px;
}
/* ------------------- Modal Window style ----------------------*/
#wpd_modal {
top: 20px !important;
margin-top: 0 !important;
}
#wpd_modal .pg_line {
margin: 12px 0;
}
#wpd_modal .pg_line:first-child {
padding: 0 0 12px;
border-bottom: 1px dashed #d0d0d0;
}
#pg_rule_editor .re_line {
margin: 8px 0;
}
#wpd_modal .pg_line label,
#pg_rule_editor .re_line label {
display: inline-block;
width: 180px;
max-width: 200px;
font-weight: 600;
margin: 0 12px 0 0;
vertical-align: middle;
}
#wpd_modal .pg_line select,
#wpd_modal .pg_line input,
#pg_rule_editor .re_line select,
#pg_rule_editor .re_line input{
display: inline-block;
width: 160px;
max-width: 160px;
vertical-align: middle;
}
#wpd_modal .pg_line label[for=pg_phrase] {
width: auto;
max-width: 30px;
margin: 0 3px;
}
#wpd_modal .pg_rules {
margin: 0 0 12px 0;
}
#wpd_modal .pg_rule {
line-height: 24px;
vertical-align: middle;
border: none;
margin: 12px 0 0 2px;
position: relative;
font-size: 13px;
}
#wpd_modal .pg_rule >* {
vertical-align: middle;
margin-right: 6px
}
#wpd_modal .pg_rule:last-child {
border-bottom: none;
}
#wpd_modal .pg_rule >img {
cursor: pointer;
}
#wpd_modal .wd_button:first-child {
margin-left: 0 !important;
}
label[for=pg_phrase][disabled],
#pg_phrase[disabled] {
opacity: 0.5 !important;
cursor: initial !important;
}
/* ------------------- Modal Window Rule editor ----------------------*/
#pg_rule_editor .wd_cf_search {
display: inline;
}
#pg_rule_editor {
border: 1px dashed #d0d0d0;
padding: 12px;
margin: 24px 0 18px;
position: relative;
}
#pg_rule_editor span.re_label {
/* margin: -22px 0 0 9px; */
background: #ffffff;
display: inline-block;
width: auto;
text-align: center;
font-weight: bold;
position: absolute;
top: -10px;
padding: 0 4px;
}
ul#pg_selected_tax_terms li {
display: inline-block;
padding: 4px 8px;
margin: 4px 8px 4px 0;
border: 1px solid grey;
border-radius: 3px;
cursor: pointer;
position: relative;
}
ul#pg_selected_tax_terms li:hover {
color: #58585847;
}
ul#pg_selected_tax_terms li:hover:before {
content: "";
position: absolute;
display: block;
margin: auto;
left: 50%;
top: 0;
bottom: 0;
width: 16px;
margin-left: -7px;
height: 0;
border-top: 3px solid #F44336;
transform: rotate(45deg);
transform-origin: center;
}
ul#pg_selected_tax_terms li:hover:after {
content: "";
position: absolute;
display: block;
margin: auto;
left: 50%;
margin-left: -7px;
top: 0;
bottom: 0;
width: 16px;
height: 0;
border-top: 3px solid #F44336;
transform: rotate(-45deg);
transform-origin: center;
}
#wpd_modal .wd_taxterm_search_res li.wtsr_selected {
opacity: 0.5;
}
#wpd_modal .wd_taxterm_search_res li.wtsr_selected:hover {
background: transparent !important;
}

View File

@@ -0,0 +1,83 @@
jQuery(function($){
// ------------- TAB HANDLING ---------------
// Remove the # from the hash, as different browsers may or may not include it
var hash = location.hash.replace('#','');
if(hash != ''){
hash = parseInt(hash);
$('.tabs a[tabid=' + Math.floor( hash / 100 ) + ']').trigger('click');
$('.tabs a[tabid=' + hash + ']').trigger('click');
} else {
$('.tabs a[tabid=1]').trigger('click');
}
$('.tabs a').on('click', function(){
location.hash = $(this).attr('tabid');
});
// ------------------------------------------
// -------- Individual Priorities -----------
$("#p_asp_submit").on('click', function(e){
e.preventDefault();
var data = {
action: 'ajaxsearchpro_priorities',
'asp_priorities_request_nonce': $('#asp_priorities_request_nonce').val(),
options: $("#asp_priorities").serialize(),
ptask: "get"
};
$('#p_asp_loader').css('display', 'block');
$('#p_asp_results').fadeOut(10);
var post = $.post(ASP_PTS.ajax_url, data, function (response) {
response = response.replace(/^\s*[\r\n]/gm, "");
response = response.match(/!!PASPSTART!!(.*[\s\S]*)!!PASPEND!!/)[1];
response = JSON.parse(response);
var html = '';
$.each(response, function(k, v){
var input = "<input type='text' name='priority[" + v.id + "]' style='width:40px;' value='100' />";
var old_priority = "<input type='hidden' name='old_priority[" + v.id + "]' value='100'/>";
if (typeof (v.priority) != 'undefined') {
input = "<input type='text' style='width:40px;' name='priority[" + v.id + "]' value='" + v.priority + "'/>";
old_priority = "<input type='hidden' name='old_priority[" + v.id + "]' value='" + v.priority + "'/>";
}
html += "<div class='p_asp_row'><p class='p_asp_title'>["+ v.id +"] " + v.title + "</p><p class='p_asp_priority'><label>" + msg('msg_pri') + "</label>" + input + old_priority + "</p><p class='p_asp_date'>" + v.date + "</p><p class='p_asp_author'>" + v.author + "</p></div>";
});
if (html == '') {
$('#p_asp_loader').css('display', 'none');
$('#p_asp_results').html('<p style="text-align:center;">No results!</p>');
return true;
}
html += "<input type='hidden' name='p_blogid' value='"+$('select[name="p_asp_blog"]').val()+"'>";
$('#p_asp_results').html("<div class='p_row_header_footer'><p>" + msg('msg_pda') + "</p><input type='submit' class='p_asp_save' value='" + msg('msg_sav') + "'></div><form name='asp_priorities_list' id='asp_priorities_list' method='post'>" + html + "</form><div class='p_row_header_footer'><p>" + msg('msg_pda') + "</p><input type='submit' class='p_asp_save' value='" + msg('msg_sav') + "'></div>");
$('#p_asp_loader').css('display', 'none');
$('#p_asp_results').fadeIn(150);
}, "text");
});
$('#p_asp_results').on('click', '.p_asp_save', function(e){
e.preventDefault();
var $this = $(this);
var data = {
action: 'ajaxsearchpro_priorities',
'asp_priorities_request_nonce': $('#asp_priorities_request_nonce').val(),
options: $("#asp_priorities_list").serialize(),
ptask: "set"
};
$this.prop('disabled', true);
$('#p_asp_results').fadeOut(10);
$('#p_asp_loader').css('display', 'block');
var post = $.post(ASP_PTS.ajax_url, data, function (response) {
response = response.replace(/^\s*[\r\n]/gm, "");
response = response.match(/!!PSASPSTART!!(.*[\s\S]*)!!PSASPEND!!/)[1];
response = JSON.parse(response);
$this.prop('disabled', false);
$('#p_asp_loader').css('display', 'none');
$("#p_asp_submit").trigger('click');
}, "text");
});
// ------------------------------------------- ETC -----------------------------------------------------------------
function msg(k) {
return typeof ASP_PTS[k] != 'undefined' ? ASP_PTS[k] : '';
}
});

View File

@@ -0,0 +1,344 @@
/**
* Priority groups list controller
*/
window.$ = jQuery;
var listController = {
// Node storage
$container: '',
$noPG: '',
$pgInput: '',
// Others objects
groupsObject: {},
init: function (args) {
// this.$variable = args[variable];
var $this = this;
$.each(args, function (k, v) {
$this[k] = v;
});
$this.$groupSample = $this.$container.find('.pg_rule_group').detach();
},
printGroups: function () {
var $this = this;
$this.$container.html('');
$.each($this.groupsObject, function (i, o) {
var n = $this.$groupSample.clone();
var groupID = i + 1;
n.data('groupid', groupID);
$('span.pg_name', n).html(o.name);
var plural = o.rules.length == 1 ? '' : 's';
$('span.pg_info', n).html(o.rules.length + ' rule' + plural + '. Priority: ' + o.priority);
n.appendTo($this.$container);
});
if ($this.groupsObject.length == 0) {
$this.$noPG.removeClass('hiddend');
} else {
$this.$noPG.addClass('hiddend');
}
},
saveGroups: function () {
var $this = this;
$this.$pgInput.val(WD_Helpers.Base64.encode(JSON.stringify($this.groupsObject)));
},
deleteGroup: function (id) {
var $this = this;
this.groupsObject.splice(id, 1);
this.saveGroups();
},
deleteGroups: function () {
var $this = this;
this.groupsObject = [];
this.saveGroups();
}
};
/**
* Modal window Group and Rule editor controller
*/
var mgController = {
$group: {}, // Group node list (except the rule editor)
$rules: '', // Rules container
$ruleEditor: '', // Rule editor container
$selectedTaxTerms: '', // Selected taxonomy terms container
$fields: '', // Fields in Rule editor
$addRuleBTN: '', // Add Rule button
$ruleSample: '',
// Others objects
groupsObject: {},
modalOriginalStates: {},
editorOriginalStates: {},
openedRuleGroup: {},
defaultRule: {},
_taxTermNames: {}, // Temporary storage for taxonomy term names in use
init: function(args) {
var $this = this;
// this.$variable = args[variable];
$.each(args, function(k, v){
$this[k] = v;
});
$('select, input', $this.$group.editor).each(function(){
$this.modalOriginalStates[$(this).attr('name')] = $(this).val();
});
$this.$ruleEditor.find('select, input').each(function(){
$this.editorOriginalStates[$(this).attr('name')] = $(this).val();
});
$this.$ruleSample = $this.$rules.find('p').detach();
},
resetRuleEditor: function() {
var $this = this;
$.each($this.editorOriginalStates, function(k, o){
$('*[name="' + k + '"]', $this.$ruleEditor).val(o);
});
$this.$selectedTaxTerms.html('');
},
openRuleEditor: function(id) {
var $this = this;
$this.resetRuleEditor();
var rules = $this.openedRuleGroup.rules;
// Set the latest rule, if the id is not defined
id = typeof id == 'undefined' ? rules.length - 1 : id;
if ( id < 0 )
return false;
var name = typeof rules[id] != 'undefined' ? rules[id].name : 'New rule';
if ( id > -1 ) {
$this.loadRule(id);
}
$this.$ruleEditor.data('rule-id', id);
$('.re_label', $this.$ruleEditor).html('Editing: ' + name);
$this.$ruleEditor.removeClass('hiddend');
$this.$rules.addClass('hiddend');
$this.$addRuleBTN.addClass('hiddend');
$('>p', $this.$ruleEditor).addClass('hiddend');
},
closeRuleEditor: function () {
var $this = this;
$this.$rules.removeClass('hiddend');
$this.$ruleEditor.addClass('hiddend');
$this.$addRuleBTN.removeClass('hiddend');
$('>p', $this.$ruleEditor).removeClass('hiddend');
},
printRules: function() {
var $this = this;
var rules = $this.openedRuleGroup.rules;
$this.$rules.html('');
$.each(rules, function(i, r){
var $r = $this.$ruleSample.clone();
var id = i + 0;
$r.addClass('pg_rule_' + id);
$r.data('id', id);
$r.find('span').html(r.name);
$r.appendTo($this.$rules);
});
},
maxRulesCheck: function() {
var $this = this;
var maxRules = 4;
if ( $this.openedRuleGroup.rules.length >= maxRules ) {
$this.$addRuleBTN.attr('disabled', 'disabled');
} else {
$this.$addRuleBTN.removeAttr('disabled');
}
},
loadRule: function(id) {
var $this = this;
var rules = $this.openedRuleGroup.rules;
if (
typeof rules[id] != 'undefined'
) {
var rule = rules[id];
if ( rule.rule_field != 0 ) {
$this.toEditor(rule);
$('.pg_rule_'+rule.field, $this.$ruleEditor).removeClass('hiddend');
}
}
},
saveOpenRule: function() {
var $this = this;
if ( !$this.$ruleEditor.hasClass('hiddend') ) {
var id = $this.$ruleEditor.data('rule-id');
return $this.saveRule(id);
}
},
saveRule: function(id) {
var $this = this;
var rules = $this.openedRuleGroup.rules;
if ( id == -1 ) {
// Safe add new rule
rules.push( JSON.parse(JSON.stringify($this.defaultRule)) );
} else {
var rule = $this.fromEditor();
if ( typeof(rules[id]) != 'undefined' )
rules[id] = rule;
else
rules.push(rule);
}
return rules;
},
deleteRule: function(id) {
var $this = this;
var rules = $this.openedRuleGroup.rules;
if ( typeof(rules[id]) != 'undefined' ) {
rules.splice(id, 1);
}
return rules;
},
fromEditor: function() {
var $this = this;
var rule = $.extend({}, $this.defaultRule);
var $f = $this.$fields;
rule.name = $f.name.val();
rule.field = $f.field.val();
switch(rule.field) {
case 'tax':
rule.operator = $f.termOperator.val();
rule.values = {};
$.each($f.termValues.find('li'), function(i, o){
var tax = $(this).data('taxonomy');
var id = $(this).data('id');
rule.values[tax] = rule.values[tax] || [];
if ( $.inArray(id, rule.values[tax]) )
rule.values[tax].push(id);
$this._taxTermNames[tax] = $this._taxTermNames[tax] || {};
$this._taxTermNames[tax][id] = $(this).text();
});
break;
case 'cf':
rule.operator = $f.cfOperator.val();
rule.values = {};
rule.values[$f.cfField.val()] = [];
if ( $f.cfVal1.val() != '' )
rule.values[$f.cfField.val()].push($f.cfVal1.val());
if ( $f.cfVal2.val() != '' )
rule.values[$f.cfField.val()].push($f.cfVal2.val());
break;
case 'title':
rule.operator = $f.titleOperator.val();
rule.values = [];
if ( $f.titleValue.val() != '' )
rule.values.push($f.titleValue.val());
break;
}
return rule;
},
toEditor: function(rule) {
var $this = this;
// Load rule values to editor
var $f = $this.$fields;
$f.name.val(rule.name).trigger('change');
$f.field.val(rule.field).trigger('change');
switch(rule.field) {
case 'tax':
$f.termOperator.val(rule.operator).trigger('change');
$.each(rule.values, function(tax, ids){
$.each(ids, function(kk, id){
var $li = $('<li>');
$li.html($this._findTermName(rule, tax, id));
$li.addClass('t_'+tax+'_'+id);
$li.data('taxonomy', tax);
$li.data('id', id);
$li.appendTo($this.$selectedTaxTerms);
});
});
break;
case 'cf':
$f.cfOperator.val(rule.operator).trigger('change');
$.each(rule.values, function(k, o){
$f.cfField.val(k);
if ( typeof o[0] !== 'undefined' )
$f.cfVal1.val(o[0]);
if ( typeof o[1] !== 'undefined' )
$f.cfVal2.val(o[1]);
return false;
});
break;
case 'title':
$f.titleOperator.val(rule.operator);
if ( typeof rule.values[0] !== 'undefined' )
$f.titleValue.val(rule.values[0]);
break;
}
},
saveRuleGroup: function(id) {
var $this = this;
$this.openedRuleGroup.name = $this.$group.name.val();
$this.openedRuleGroup.instance = $this.$group.instance.val();
$this.openedRuleGroup.priority = $this.$group.priority.val();
$this.openedRuleGroup.phrase_logic = $this.$group.phraseLogic.val();
$this.openedRuleGroup.logic = $this.$group.ruleLogic.val();
if ( $this.openedRuleGroup.phrase_logic != 'disabled' ) {
$this.openedRuleGroup.phrase = $this.$group.phrase.val();
} else {
$this.openedRuleGroup.phrase = '';
}
if ( id == -1 ) {
$this.groupsObject.push($this.openedRuleGroup);
} else {
$this.groupsObject[id] = $this.openedRuleGroup;
}
},
loadRuleGroup: function(g) {
var $this = this;
if ( typeof g != 'undefined' )
$this.openedRuleGroup = g;
$.each($this.modalOriginalStates, function (k, o) {
$('*[name="' + k + '"]', $this.$group.editor).val(o);
});
if ( typeof $this.openedRuleGroup != 'undefined' ) {
// Group editor stuff
$this.$group.name.val($this.openedRuleGroup.name);
$this.$group.instance.val($this.openedRuleGroup.instance);
$this.$group.priority.val($this.openedRuleGroup.priority);
$this.$group.phrase.val($this.openedRuleGroup.phrase);
$this.$group.phraseLogic.val($this.openedRuleGroup.phrase_logic).trigger('change');
$this.$group.ruleLogic.val($this.openedRuleGroup.logic).trigger('change');
// Rule editor stuff
if ( typeof $this.openedRuleGroup.rules != 'undefined' ) {
$this.closeRuleEditor();
//ruleEditorPrintRules(g.rules);
$this.printRules();
$this.maxRulesCheck();
}
}
},
// ----------------- HELPER PRIVATE METHODS ------------------------
_findTermName: function(rule, tax, id) {
var $this = this;
// Look within recent tax term names
if ( typeof $this._taxTermNames[tax] != 'undefined' &&
typeof $this._taxTermNames[tax][id] != 'undefined'
)
return $this._taxTermNames[tax][id];
// Look within the initial printed tax term names
if ( typeof rule._values != 'undefined' &&
typeof rule._values[tax] != 'undefined' &&
typeof rule._values[tax][id] != 'undefined'
)
return rule._values[tax][id];
return '';
}
};

View File

@@ -0,0 +1,302 @@
jQuery(function($){
// --------------------------------------- INIT VARIABLES --------------------------------------------------------------
var $pgEditor = $('#asp_pg_editor').detach();
var openedRuleGroupDef = {
priority: 100,
name: 'Priority Group',
phrase: '',
phrase_logic: 'disabled',
instance: 0,
logic: 'and',
rules: []
};
var openedRuleGroup = JSON.parse(JSON.stringify(openedRuleGroupDef)); // Reference to the currently opened group
// Reference to the whole groups array - this is gettings saved
var groupsObject = JSON.parse(WD_Helpers.Base64.decode($('#priority_groups').val()));
var initialValue = $('#priority_groups').val(); // Used to check whenever the user leaves the page
var submit_clicked = false; // Used to check whenever the user leaves the page
listController.init({
// Node storage
$container: $('#pg_container'),
$noPG: $('#pg_no_pg'),
$pgInput: $('#priority_groups'),
// Others objects
groupsObject: groupsObject
});
mgController.init({
$group: {
editor: $pgEditor,
name: $('#ruleset_name', $pgEditor), // Group name input
priority: $('#pg_priority', $pgEditor), // Group priority input
instance: $('#pg_instance', $pgEditor), // Search instance to affect
phrase: $('#pg_phrase', $pgEditor), // Group Phrase
phraseLogic: $('#pg_phrase_logic', $pgEditor), // Group Phrase Logic
ruleLogic: $('#pg_rule_logic', $pgEditor) // Group Rules Logic
},
$rules: $('#pg_rules_container', $pgEditor),
$ruleEditor: $('#pg_rule_editor', $pgEditor),
$selectedTaxTerms: $('#pg_selected_tax_terms', $pgEditor),
$addRuleBTN: $('#pg_add_rule', $pgEditor),
$fields: {
name: $('#pg_rule_editor', $pgEditor).find('input[name=rule_name]'),
field: $('#pg_rule_editor', $pgEditor).find('select[name=rule_field]'),
termOperator: $('#pg_rule_editor', $pgEditor).find('select[name=term_operator]'),
cfOperator: $('#pg_rule_editor', $pgEditor).find('select[name=cf_operator]'),
titleOperator: $('#pg_rule_editor', $pgEditor).find('select[name=title_operator]'),
termValues: $('#pg_rule_editor', $pgEditor).find('#pg_selected_tax_terms'),
cfField: $('#pg_rule_editor', $pgEditor).find('input[name=pg_search_cf]'),
cfVal1: $('#pg_rule_editor', $pgEditor).find('input[name=cf_val1]'),
cfVal2: $('#pg_rule_editor', $pgEditor).find('input[name=cf_val2]'),
titleValue: $('#pg_rule_editor', $pgEditor).find('input[name=title_value]')
},
groupsObject: groupsObject,
openedRuleGroup: openedRuleGroup,
defaultRule: {
'name' : 'Rule name',
'field' : 'tax', // 'tax', 'cf', 'title'
'operator' : 'in', // in, not in, like, not like, elike, =, <>, >, <, >=, <=, BETWEEN
'values' : []
}
});
listController.printGroups();
// Modal controller shorthand reference
var mw = window.WPD_Modal;
// Set the modal content only once, to prevent event detaching
// ..use it later with the 'leaveContent: true' param
mw.options({
'content': $pgEditor
});
mw.layout({
'max-width': '640px',
'width': '640px'
});
// ---------------------------------------------------------------------------------------------------------------------
// -------------------------------------- GROUP LISTING & BUTTONS ------------------------------------------------------
// Add new group
$('#pg_add_new').on('click', function(){
$pgEditor.removeClass('hiddend');
mw.options({
'type': 'info',
'header': msg('msg_npg'),
'leaveContent': true,
'buttons': {
'okay': {
'text': msg('msg_sav'),
'type': 'okay',
'click': function(e, button){
mgController.saveOpenRule();
mgController.closeRuleEditor();
mgController.saveRuleGroup(-1);
listController.printGroups();
listController.saveGroups();
}
},
'cancel': {
'text': msg('msg_can'),
'type': 'cancel',
'click': function(e, button){}
}
}
});
openedRuleGroup = JSON.parse(JSON.stringify(openedRuleGroupDef));
mgController.loadRuleGroup(openedRuleGroup);
mw.show();
});
// Edit existing group
$('#pg_container').on('click', '.pg_rg_edit', function(){
var id = $(this).closest('.pg_rule_group').data('groupid') - 1;
if ( typeof groupsObject[id] == 'undefined' )
return false;
openedRuleGroup = JSON.parse(JSON.stringify(groupsObject[id]));
$pgEditor.removeClass('hiddend');
mw.options({
'type': 'info',
'header': msg('msg_epg') + ' ' + openedRuleGroup.name,
'leaveContent': true,
'buttons': {
'okay': {
'text': msg('msg_sav'),
'type': 'okay',
'click': function(e, button){
mgController.saveOpenRule();
mgController.closeRuleEditor();
mgController.saveRuleGroup(id);
listController.printGroups();
$('#priority_groups').val(WD_Helpers.Base64.encode(JSON.stringify(groupsObject)));
}
},
'cancel': {
'text': msg('msg_can'),
'type': 'cancel',
'click': function(e, button){}
}
}
});
mgController.loadRuleGroup(openedRuleGroup);
mw.show();
});
// Delete a group
$('#pg_container').on('click', '.pg_rg_delete', function(){
var id = $(this).closest('.pg_rule_group').data('groupid') - 1;
if ( typeof groupsObject[id] == 'undefined' )
return false;
var sure = confirm( sprintf(msg('msg_del'), groupsObject[id].name) );
if ( sure ) {
listController.deleteGroup(id);
listController.printGroups();
}
});
// Save all groups
$('#pg_save').on('click', function(){
submit_clicked = true;
$(this).closest('form').submit();
});
// Delete all groups
$('#pg_remove_all').on('click', function(e){
e.preventDefault();
if ( confirm( msg('msg_dal') ) ) {
listController.deleteGroups();
submit_clicked = true;
$(this).closest('form').submit();
}
});
// ---------------------------------------------------------------------------------------------------------------------
// -------------------------------------- GROUP EDITOR INTERACTIONS ----------------------------------------------------
// Phrase logic change
$('#pg_phrase_logic').on('change', function(){
if ( $(this).val() == 'disabled' ) {
$('#pg_phrase').attr('disabled', 'disabled');
$('label[for=pg_phrase]').attr('disabled', 'disabled');
} else {
$('#pg_phrase').removeAttr('disabled');
$('label[for=pg_phrase]').removeAttr('disabled');
}
});
$('#pg_phrase_logic').trigger('change');
// Chose rule type
$('#wpd_modal_inner').on('change', 'select[name=rule_field]', function(){
$('#pg_rule_editor').find('.pg_rule_tax, .pg_rule_cf, .pg_rule_title').addClass('hiddend');
if ( $(this).val() != 0 ) {
$('#pg_rule_editor').find('.pg_rule_' + $(this).val()).removeClass('hiddend');
}
});
// Priority input
$('#wpd_modal_inner').on('input', '#pg_priority', function(e){
var val = $(this).val();
if ( val == '' ) {
$(this).val(0);
} else {
val = parseInt($(this).val());
var fval = Math.min(5000, Math.max(0, val));
if (val != fval)
$(this).val(fval);
}
});
// ---------------------------------------------------------------------------------------------------------------------
// -------------------------------------- RULE EDITOR BUTTONS ----------------------------------------------------------
// New rule button
$('#wpd_modal_inner').on('click', '#pg_add_rule', function(){
mgController.saveRule(-1);
mgController.printRules();
mgController.closeRuleEditor();
mgController.maxRulesCheck();
mgController.openRuleEditor();
});
// Edit rule icon
$('#wpd_modal_inner').on('click', '.pg_edit_rule', function(){
mgController.openRuleEditor($(this).closest('p').data('id'));
});
// Delete rule icon
$('#wpd_modal_inner').on('click', '.pg_delete_rule', function(){
if ( confirm( msg('msg_dru') ) ) {
mgController.closeRuleEditor();
mgController.deleteRule($(this).closest('p').data('id'));
mgController.printRules();
mgController.maxRulesCheck();
}
});
// Save rule button
$('#wpd_modal_inner').on('click', '#pg_editor_save_rule', function(){
mgController.saveOpenRule();
mgController.closeRuleEditor();
mgController.printRules();
mgController.maxRulesCheck();
});
// Delete rule button
$('#wpd_modal_inner').on('click', '#pg_editor_delete_rule', function(){
if ( confirm( msg('msg_dru') ) ) {
var id = $('#pg_rule_editor').data('rule-id');
mgController.deleteRule(id);
mgController.printRules();
mgController.maxRulesCheck();
mgController.closeRuleEditor();
}
});
// ---------------------------------------------------------------------------------------------------------------------
// -------------------------------------- RULE EDITOR OTHER INTERACTIONS -----------------------------------------------
// Taxonomy search interactions
$('#asp_pg_editor')
.on('wd_taxterm_search_end wd_taxterm_open_results', '.wd_taxterm_search', function(e, input, results){
e.stopPropagation(); // Prevent multiple fire
$('#asp_pg_editor .wd_taxterm_search_res li').removeClass('wtsr_selected');
$('#pg_selected_tax_terms li').each(function(i, o){
var iclass = $(this).attr('class');
$('#asp_pg_editor .wd_taxterm_search_res li.' + iclass).addClass('wtsr_selected');
});
});
// Taxonomy search adding new elements
$('#asp_pg_editor .wd_taxterm_search_res').on('click', 'li:not(.wtsr_selected)', function(e){
if ( $('#pg_selected_tax_terms li').length < 11 ) {
$(this).clone().appendTo('#pg_selected_tax_terms');
$('#asp_pg_editor .wd_taxterm_search').trigger('wd_taxterm_open_results');
} else {
alert( msg('msg_cru') );
}
});
// Taxonomy search removing elements
$('#pg_selected_tax_terms').on('click', 'li', function(e){
$(this).remove();
$('#asp_pg_editor .wd_taxterm_search').trigger('wd_taxterm_open_results');
});
// Change custom field operator type
$('#wpd_modal_inner').on('change', 'select[name=cf_operator]', function(){
if ( $(this).val() == 'between' ) {
$('input[name=cf_val2]').css('display', 'inline');
} else {
$('input[name=cf_val2]').css('display', 'none');
}
});
// ---------------------------------------------------------------------------------------------------------------------
// --------------------------------------- ETC -------------------------------------------------------------------------
function msg(k) {
return typeof ASP_EVTS[k] != 'undefined' ? ASP_EVTS[k] : '';
}
function sprintf(s) {
var i = 1, r = '';
while ( s.indexOf('%s') !== false ) {
r = typeof arguments[i] !== 'undefined' ? arguments[i] : '';
s = s.replace('%s', r);
i++;
if ( i > 40 )
break;
}
return s;
}
});

View File

@@ -0,0 +1,137 @@
#wpdreams .greenMsg {
color: #1a772c;
padding: 5px 7px;
margin: 5px;
border: 1px solid #eee;
font-size: 12px !important;
background: #f1fff1;
border-radius: 2px;
}
#wpd_white_fixed_bg {
width: 100%;
height: 100%;
margin: 0 auto;
background: rgba(255, 255, 255, 0.85);
display: none;
position: fixed;
top: 0;
left: 0;
z-index: 99999;
}
.highlight_over_bg {
z-index: 9999999;
position: relative;
border-width: 1px !important;
border-style: solid dashed !important;
border-color: grey !important;
}
/* SEARCH button and RESET button back-end */
#fe_search_button,
#fe_reset_button {
position: relative;
}
#fe_search_button fieldset legend:first-child,
#fe_reset_button fieldset legend:first-child {
padding: 0 0 0 12px;
}
#fe_search_button .wd_an_inputs,
#fe_reset_button .wd_an_inputs {
width: 50%;
}
#fe_search_button .wd_an_inputs:first-child,
#fe_reset_button .wd_an_inputs:first-child {
margin: 0 6px 0 0;
}
#fe_search_button .wd_an_inputs:last-child,
#fe_reset_button .wd_an_inputs:last-child {
margin: 0 0 0 6px;
}
#fe_sb_preview,
#fe_rb_preview {
position: absolute;
top: 48px;
left: 48px;
width: 240px;
background: white;
height: 100px;
border: 1px dashed #e7e7e7;
line-height: 100px;
}
#wpdreams .wd_TaxonomyTermSelect .wd_tts_disp_m_popup:after {
left: -21px;
border-right-color: #2F97D6;
border-left-color: transparent;
top: 62px;
}
#fe_sb_preview button.asp_search_btn.asp_s_btn,
#fe_rb_preview button.asp_reset_btn.asp_r_btn {
display: inline-block;
vertical-align: center;
outline: 0;
}
#fe_sb_popup,
#fe_rb_popup {
position: absolute;
background: #ffffff;
border: 1px solid rgb(219, 219, 219);
width: 368px;
max-height: 320px;
left: 300px;
z-index: 999999;
padding: 16px 0 16px 16px;
box-sizing: border-box;
box-shadow: -2px 2px 22px -2px rgba(0, 0, 0, 0.22);
text-align: left;
}
#fe_sb_popup:after,
#fe_rb_popup:after {
border: solid rgba(221, 221, 221, 0);
content: " ";
height: 0;
width: 0;
position: absolute;
pointer-events: none;
border-width: 10px;
margin-top: -10px;
left: -21px;
border-right-color: #2F97D6;
border-left-color: transparent;
top: 62px;
}
#fe_sb_trigger,
#fe_rb_trigger {
position: absolute;
top: 90px;
left: 304px;
}
#fe_sb_popup>div,
#fe_rb_popup>div {
float: left;
padding: 5px;
text-align: center;
transition: transform 0.05s linear;
}
#fe_sb_popup>div button,
#fe_rb_popup>div button {
cursor: pointer;
}
#fe_sb_popup>div:hover,
#fe_rb_popup>div:hover {
transform: scale(1.05);
}

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,144 @@
#asp-side-container {
overflow: hidden;
background: #FEFEFE;
border: solid 1px #DDDDDD;
outline: 0;
box-shadow: rgba(0,0,0,0.1) 0px 0px 8px;
-moz-box-shadow: rgba(0,0,0,0.1) 0px 0px 8px;
-webkit-box-shadow: rgba(0,0,0,0.1) 0px 0px 8px;
padding: 14px;
margin: 10px;
width: auto;
max-width: 340px;
float: left;
}
#asp-side-container:after {
content: " ";
display: block;
clear: both;
}
#asp-side-container input {
width: 100%;
margin: 5px 0 0;
padding: 5px 10px;
box-sizing: border-box;
line-height: 24px;
}
#asp-side-container label {
margin: 0;
font-size: 14px;
}
#wpdreams div.item.asp-os-highlighted {
background: rgba(255, 0, 0, 0.05) !important;
box-shadow: 3px 0 0 rgba(255, 0, 0, 0.74) inset;
transition: all 0.5s linear;
}
#asp-os-results label {
margin: 17px 0 5px;
display: inline-block;
}
#asp-os-results a {
padding: 2px 0;
display: inline-block;
}
#asp-side-container .asp-back-social,
#asp-side-container .asp-back-help {
margin: 5px auto 0;
padding-top: 0;
line-height: 32px;
}
#asp-side-container .asp-back-help > *,
#asp-side-container .asp-back-social > * {
vertical-align: bottom;
display: inline-block;
}
/************************************************\
Sidebar form
\************************************************/
#asp-side-container h2,
#asp-side-container p {
color: #4c4c4c;
display: inline-block;
margin: 8px 0;
}
#asp-side-container h2 {
font-size: 16px;
color: #444;
font-weight: 700;
margin: 14px 0 6px 0;
}
#asp-side-container form {
display: flex;
width: auto;
text-align: center;
box-sizing: border-box;
font-size: 0;
border: 1px solid #ffffff;
margin: 0;
border-radius: 3px;
background: #efefef;
align-items: center;
}
#asp-side-container input[type=email],
#asp-side-container input[type=submit] {
height: 38px;
padding: 0 14px;
border: none;
outline: none;
font-size: 14px;
text-shadow: none;
box-shadow: none;
}
#asp-side-container input[type=email] {
border-radius: 4px 0 0 4px;
vertical-align: top;
width: 100%;
background: transparent;
color: black;
margin: 0;
}
#asp-side-container input[type=submit] {
border-radius: 0 4px 4px 0;
background: #cb2550;
color: #fff;
width: auto;
flex: 1 1 auto;
margin: 0;
}
#asp-side-container .socials a {
color: white;
border-radius: 4px;
padding: 8px 12px;
margin-right: 12px;
font-size: 14px;
text-decoration: none;
}
#asp-side-container .socials svg {
fill: white;
vertical-align: middle;
margin: -3px 4px 0 0;
}
#asp-side-container .socials a.facebook {
background: #3A589E;
}
#asp-side-container .socials a.twitter {
background: #55ACEE;
}

View File

@@ -0,0 +1,74 @@
jQuery(function ($) {
$("form[name='asp_stat_settings'] .wpdreamsYesNoInner").on("click", function () {
setTimeout(function () {
$("form[name='asp_stat_settings']").get(0).submit();
}, 500);
});
$('a[tabid=1]').trigger('click');
$('#wpdreams .deletekeyword').on('click', function() {
var del = confirm(msg('msg_del'));
var $this = $(this);
if (del) {
id = $(this).attr('keyword');
var data = {
action: 'ajaxsearchpro_deletekeyword',
asp_statistics_request_nonce: $('#asp_statistics_request_nonce').val(),
keywordid: id
};
jQuery.post(ajaxurl, data, function (response) {
if (response == 1) {
$this.parent().fadeOut();
}
});
}
});
if (line1.length > 0) {
var plot1 = $.jqplot('top20', [line1], {
title: msg('msg_t20'),
series: [
{renderer: $.jqplot.BarRenderer}
],
axesDefaults: {
tickRenderer: $.jqplot.CanvasAxisTickRenderer,
tickOptions: {
angle: -30,
fontSize: '10pt'
}
},
axes: {
xaxis: {
renderer: $.jqplot.CategoryAxisRenderer
}
}
});
}
if (line2.length > 0) {
var plot2 = $.jqplot('last20', [line2], {
title: msg('msg_l20'),
series: [
{renderer: $.jqplot.BarRenderer}
],
axesDefaults: {
tickRenderer: $.jqplot.CanvasAxisTickRenderer,
tickOptions: {
angle: -30,
fontSize: '10pt'
}
},
axes: {
xaxis: {
renderer: $.jqplot.CategoryAxisRenderer
}
}
});
}
// ------------------------------------------- ETC -----------------------------------------------------------------
function msg(k) {
return typeof ASP_STAT[k] != 'undefined' ? ASP_STAT[k] : '';
}
});

View File

@@ -0,0 +1,399 @@
#wpdreams a.wd-accessible-switch {
color: white;
padding: 12px 16px;
padding-left: 42px;
border: none;
text-decoration: none;
background: #2d2d2d;
font-weight: bold;
font-size: 16px;
display: inline-block;
margin-bottom: 12px;
position: relative;
line-height: 18px !important;
}
#wpdreams a.wd-accessible-switch::before {
display: block;
content: '';
top: 5px;
left: 6px;
position: absolute;
width: 32px;
height: 32px;
background: url('icons/accessibility.png') no-repeat scroll 0px 0px transparent;
}
#wpcontent.wd-accessible {
background: #000000 !important;
box-shadow: none !important;
}
#wpd_shortcode_modal.wd-accessible,
#wpd_shortcode_modal.wd-accessible fieldset,
#wpd_shortcode_modal.wd-accessible p,
#wpdreams.wd-accessible,
#wpdreams.wd-accessible fieldset,
#wpdreams.wd-accessible .wpdreams-box,
#wpdreams.wd-accessible div.item,
#wpdreams.wd-accessible div.tabscontent,
#wpdreams.wd-accessible #asp-side-container,
#wpdreams.wd-accessible #asp-side-container p,
#wpdreams.wd-accessible #asp-side-container h2,
#wpdreams.wd-accessible .wd_tts_disp_m_popup {
background: #000000 !important;
color: white !important;
box-shadow: none !important;
}
#wpd_shortcode_modal.wd-accessible h3 {
color: white;
}
#wpd_shortcode_modal.wd-accessible {
border: 1px solid #FFFFFF;
}
#wpdreams.wd-accessible #gear_icon {
fill: white;
}
#wpd_shortcode_modal.wd-accessible,
#wpdreams.wd-accessible #asp-side-container p,
#wpdreams.wd-accessible #asp-side-container span,
#wpdreams.wd-accessible #asp-side-container a,
#wpdreams.wd-accessible #asp-side-container label,
#wpdreams.wd-accessible .wd_tts_disp_m_popup fieldset,
#wpdreams.wd-accessible .wd_tts_disp_m_popup fieldset b {
font-size: 16px !important;
line-height: 24px;
}
#wpdreams.wd-accessible #asp-side-container label {
font-weight: bold !important;
}
#wpdreams.wd-accessible #asp-side-container .asp-back-social {
display: none;
}
#wpd_shortcode_modal.wd-accessible input,
#wpd_shortcode_modal.wd-accessible select,
#wpd_shortcode_modal.wd-accessible .ui-sortable input,
#wpdreams.wd-accessible textarea,
#wpdreams.wd-accessible select,
#wpdreams.wd-accessible option,
#wpdreams.wd-accessible input[type=text],
#wpdreams.wd-accessible input[type=search],
#wpdreams.wd-accessible input.hasDatepicker {
min-height: 32px;
font-size: 16px;
font-weight: bold;
}
#wpd_shortcode_modal.wd-accessible .ui-sortable input {
width: 70px;
}
#wpd_shortcode_modal.wd-accessible textarea {
font-size: 14px;
}
#wpdreams.wd-accessible input.hasDatepicker,
#wpdreams.wd-accessible textarea {
color: white;
}
#wpdreams.wd-accessible legend {
color: white !important;
font-size: 18px !important;
}
#wpdreams.wd-accessible fieldset fieldset legend {
font-size: 16px !important;
}
#wpd_shortcode_modal.wd-accessible .ui-sortable,
#wpdreams.wd-accessible .draggablecontainer ul,
#wpdreams.wd-accessible .sortablecontainer ul {
background: #171717 !important;
font-size: 16px;
}
#wpd_shortcode_modal.wd-accessible .ui-sortable li,
#wpdreams.wd-accessible .draggablecontainer ul li,
#wpdreams.wd-accessible .sortablecontainer ul li,
#wpdreams.wd-accessible .sortablecontainer ul li.ui-left {
background: #000000 !important;
font-size: 16px;
color: white;
}
#wpdreams.wd-accessible .sortablecontainer ul li.ui-left {
border: 1px solid #9e9e9e !important;
}
#wpdreams.wd-accessible .sortablecontainer p,
#wpdreams.wd-accessible .draggablecontainer p,
#wpdreams.wd-accessible .draggablecontainer span {
font-size: 16px !important;
}
#wpdreams.wd-accessible .sortablecontainer label:not(.wd_plain),
#wpdreams.wd-accessible .draggablecontainer label:not(.wd_plain) {
background: black !important;
font-size: 14px !important;
font-weight: normal;
text-shadow: none !important;
box-shadow: none !important;
border: 1px solid #868686 !important;
}
#wpd_shortcode_modal.wd-accessible .ui-sortable label {
font-size: 14px !important;
}
#wpdreams.wd-accessible .sortablecontainer input[type="text"]:not(.wd_tts_all_text),
#wpdreams.wd-accessible .draggablecontainer input[type="text"] {
background: #191919 !important;
text-shadow: none !important;
font-weight: normal;
color: white;
margin-top: -1px;
width: 226px;
border: 1px solid #868686 !important;
}
#wpdreams.wd-accessible a {
color: yellow !important;
font-size: 14px;
}
#wpdreams.wd-accessible ul.tabs li a {
font-size: 16px !important;
background: black !important;
padding: 8px 16px !important;
box-shadow: none !important;
border: 1px solid rgba(238, 255, 0, 0.5) !important;
color: white !important;
opacity: 0.9 !important;
}
#wpdreams.wd-accessible ul.tabs li a.current {
box-shadow: 0px 0px 0px 3px #eeff00 inset !important;
border: 1px solid rgba(238, 255, 0, 1) !important;
opacity: 1 !important;
}
#wpdreams.wd-accessible fieldset ul.tabs li a {
padding: 4px 16px !important;
border: 1px solid rgba(0, 195, 255, 0.5) !important;
}
#wpdreams.wd-accessible fieldset ul.tabs li a.current {
box-shadow: 0px 0px 0px 3px #00c3ff inset !important;
border: 1px solid rgba(0, 195, 255, 1) !important;
opacity: 1 !important;
}
#wpdreams.wd-accessible label {
color: white !important;
font-size: 16px;
}
#wpdreams.wd-accessible .descMsg,
#wpdreams.wd-accessible .biggerDescMsg{
color: #cecece !important;
}
#wpdreams.wd-accessible .descMsg,
#wpdreams.wd-accessible .errorMsg,
#wpdreams.wd-accessible .infoMsg {
background: transparent;
font-size: 14px !important;
}
#wpdreams.wd-accessible .infoMsg,
#wpdreams.wd-accessible .errorMsg {
border-top: 1px solid #3c3c3c;
border-bottom: 1px solid #3c3c3c;
border-right: 1px solid #3c3c3c;
}
#wpdreams.wd-accessible input[type=submit],
#wpdreams.wd-accessible .asp_submit {
height: 40px !important;
text-shadow: none !important;
font-size: 16px !important;
font-weight: bold !important;
color: black !important;
box-shadow: none !important;
}
#wpdreams.wd-accessible input[type=submit] {
background: #fd2929 !important;
}
#wpdreams.wd-accessible .bs-overlay {
background: rgba(0, 0, 0, 0.81) !important;
}
#wpdreams.wd-accessible input[type='button'],
#wpdreams.wd-accessible .one-item button[name='reset'],
#wpdreams.wd-accessible .one-item button[name='back'],
#wpdreams.wd-accessible .one-item button[name='add'] {
font-size: 18px !important;
font-weight: bold;
padding: 12px 20px;
}
#wpd_shortcode_modal.wd-accessible input[type='button'],
#wpd_shortcode_modal.wd-accessible button {
font-weight: bold;
padding: 12px 20px;
}
#wpd_shortcode_modal.wd-accessible.wpd-modal .wpd-modal-close:before {
color: white;
}
#wpd_shortcode_modal.wd-accessible.wpd-modal .wpd-modal-close:hover:before {
color: #FFFF00;
}
#wpdreams.wd-accessible #shortcode_generator {
font-size: 16px !important;
padding: 6px 20px;
border-radius: 0 !important;
box-shadow: none !important;
}
#wpdreams.wd-accessible .wd_cf_search_res li {
color: black;
font-size: 16px !important;
}
#wpdreams.wd-accessible .wd_cf_search_res li:hover {
color: white;
background: black !important;
}
#wpdreams.wd-accessible .wd_tagSearchResults,
#wpdreams.wd-accessible .wd_tagSearchResults p {
font-size: 16px;
color: white;
}
#wpdreams.wd-accessible .wd_tagSelectContent span {
font-size: 18px;
color: white;
}
#wpdreams.wd-accessible .wpdreamsYesNoSt.active .wpdreamsYesNoInner {
background-position: -1px 0;
background-color: #bfd6e4;
}
#wpdreams.wd-accessible .wpdreamsYesNoSt .wpdreamsYesNoInner,
#wpdreams.wd-accessible .wpdreamsYesNo .wpdreamsYesNoInner {
background: url(icons/on-off-new-hc.png) no-repeat scroll -31px 0px transparent;
background-color: #ff0000;
}
#wpdreams.wd-accessible .wpdreamsYesNoSt.active .wpdreamsYesNoInner,
#wpdreams.wd-accessible .wpdreamsYesNo.active .wpdreamsYesNoInner {
background-color: #26ff00;
background-position: 2px 0;
}
#wpdreams.wd-accessible .wpdreamsTextSmall .wpd-txt-small-icon {
margin-top: 4px;
}
#wpdreams.wd-accessible .wpd-txt-small-icon.wpd-txt-small-icon-desktop {
background: url(icons/icon-desktop-white.png) no-repeat center;
}
#wpdreams.wd-accessible .wpd-txt-small-icon.wpd-txt-small-icon-tablet {
background: url(icons/icon-tablet-white.png) no-repeat center;
}
#wpdreams.wd-accessible .wpd-txt-small-icon.wpd-txt-small-icon-phone {
background: url(icons/icon-phone-white.png) no-repeat center;
}
#wpdreams.wd-accessible .wpdreams-box {
width: 860px;
}
#wpdreams.wd-accessible .wpdreams-box.wpdreams-box-wide {
width: 960px;
}
#wpdreams.wd-accessible .item-rlayout p,
#wpdreams.wd-accessible .item-rlayout p a {
font-size: 16px;
}
#wpdreams.wd-accessible .item-rlayout p {
color: white;
}
#wpdreams.wd-accessible div.item.asp-os-highlighted {
background: rgba(255, 255, 255, 0.24) !important;
}
#wpdreams.wd-accessible .asp-setting-search-all-cf {
right: 280px !important;
}
/* PRE-INSTANCE MENU (MAIN) */
#wpdreams.wd-accessible .wpd_instance_name {
font-size: 16px;
}
#wpdreams.wd-accessible .wpd_instance_edit_icon,
#wpdreams.wd-accessible .wpd_owner_edit_icon {
filter: invert(100%);
-webkit-filter: invert(100%);
}
/* INDEX TABLE SUBMENU */
#wpdreams.wd-accessible form #asp_indextable_options #asp_it_disable {
background: rgba(0, 0, 0, 0.77);
}
#wpdreams.wd-accessible .asp-last-execution-info li,
#wpdreams.wd-accessible .asp-last-execution-info li b {
font-size: 16px !important;
line-height: 22px;
}
/* PRIORITY SUBMENU */
#wpdreams.wd-accessible #p_asp_results,
#wpdreams.wd-accessible #p_asp_results p {
font-size: 16px;
}
/* PERFORMANCE SUBMENU */
#wpdreams.wd-accessible .asp_performance_settings_clear ul li {
font-size: 16px !important;
line-height: 22px;
}
#wpdreams.wd-accessible.asp_performance strong,
#wpdreams.wd-accessible.asp_performance dl dd,
#wpdreams.wd-accessible.asp_performance dl dt {
font-size: 16px;
line-height: 22px;
}
/* MAINTENANCE SUBMENU */
#wpdreams.wd-accessible .asp_maintenance p,
#wpdreams.wd-accessible .asp_maintenance strong,
#wpdreams.wd-accessible .asp_maintenance b,
#wpdreams.wd-accessible .asp_maintenance ul li {
font-size: 16px;
line-height: 22px;
}
/* UPDATES HELP */
#wpdreams.wd-accessible.asp_updates_help .wpdreams-box {
width: 1024px;
}
#wpdreams.wd-accessible.asp_updates_help h3 {
color: #FFFFFF;
}
#wpdreams.wd-accessible.asp_updates_help p,
#wpdreams.wd-accessible.asp_updates_help div.item {
font-size: 14px;
line-height: 20px;
}

Some files were not shown because too many files have changed in this diff Show More