add files

This commit is contained in:
Andrey Kuvshinov
2025-07-09 21:21:17 +03:00
commit 8fc8cbae32
596 changed files with 207566 additions and 0 deletions

7
assets/js/admin/app.js Normal file
View File

@@ -0,0 +1,7 @@
jQuery(document).ready(function(){
jQuery(function() {
if (jQuery('.color-picker').length !== 0){
jQuery('.color-picker').wpColorPicker();
}
});
});

View File

@@ -0,0 +1,28 @@
jQuery(document).ready(function($) {
var taxonomy = 'category',
post_id = null,
term_id = null,
li_ele_id = null;
$('.editinline').on('click', function() {
post_id = inlineEditPost.getId(this);
$.ajax({
url: ajaxurl,
data: {
'action': 'wpse_139269_inline_edit_radio_checked_hack',
'ajax-taxonomy': taxonomy,
'ajax-post-id': post_id
},
type: 'POST',
dataType: 'json',
success: function (response) {
term_id = response;
li_ele_id = 'in-' + taxonomy + '-' + term_id;
$( 'input[id="'+li_ele_id+'"]' ).attr( 'checked', 'checked' );
},
error: function (response){
//console.log(response);
}
});
});
});

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,49 @@
tinymce.PluginManager.add('charactercount', function (editor) {
var _self = this;
function update() {
editor.theme.panel.find('#charactercount').text('Количество символов: '+ _self.getCount() + '(с пробелами) | ' + _self.getCountWithoutSpaces() + '(без пробелов)' );
}
editor.on('init', function () {
var statusbar = editor.theme.panel && editor.theme.panel.find('#statusbar')[0];
if (statusbar) {
window.setTimeout(function () {
statusbar.insert({
type: 'label',
name: 'charactercount',
text: 'Количество символов: '+ _self.getCount() + '(с пробелами) | ' + _self.getCountWithoutSpaces() + '(без пробелов)',
classes: 'charactercount',
disabled: editor.settings.readonly
}, 0);
editor.on('setcontent beforeaddundo keyup', update);
}, 0);
}
});
_self.getCount = function () {
var tx = editor.getContent({ format: 'raw' });
var decoded = decodeHtml(tx);
var decodedStripped = decoded.replace(/(<([^>]+)>)/ig, '');
var tc = decodedStripped.length;
return tc;
};
_self.getCountWithoutSpaces = function () {
var tx = editor.getContent({ format: 'raw' });
var decoded = decodeHtml(tx);
var decodedStripped = decoded.replace(/(<([^>]+)>)/ig, '');
var tc = decodedStripped.replace(/(?:\r\n|\r|\n)/g, '').replace('/ /g', '').split(' ').join('').replace(/\s\s+/g, '');
console.log(tc);
return tc.length;
};
function decodeHtml(html) {
var txt = document.createElement('textarea');
txt.innerHTML = html;
return txt.value;
}
});