hello there i hope you are doing well
i have this code made to me by @ Ange Tuteur
and modified a bit by @pedxz
i did post this issue in the arabic forum support and no one could solve it
so here i am
with members the code work just fine
the issue is that the code doesn't work with visteur
a video to show the issue
the code
i have this code made to me by @ Ange Tuteur
and modified a bit by @pedxz
i did post this issue in the arabic forum support and no one could solve it
so here i am
with members the code work just fine
the issue is that the code doesn't work with visteur
a video to show the issue
the code
- Code:
$(function() {
if (!$.sceditor) return;
$.sceditor.command.set('cmd', {
dropDown : function(editor, caller, callback) {
var content = $(
'<div>' +
' <div>' +
' <label>رابط</label>' +
' <input type="text" placeholder="رابط الخلفية" id="cmdValue" value="" />' +
' </div>' +
' <div>' +
' <input type="button" class="button" value="ادخال الخلفية">' +
' </div>' +
'</div>'
);
content.find('.button').click(function(e) {
callback(content.find('select').val());
editor.closeDropDown(true);
});
editor.createDropDown(caller, "cmd", content);
},
// WYSIWYG MODE
exec : function(caller) {
var editor = this;
$.sceditor.command.get('cmd').dropDown(editor, caller, function(cmd) {
var before = '[tbl]', title = $('#cmdValue').val();
if(title !== '') {
before = '[tbl=' + title + ']';
editor.wysiwygEditorInsertHtml(before);
}
});
},
// SOURCE MODE
txtExec : function(caller) {
var editor = this;
$.sceditor.command.get('cmd').dropDown(editor, caller, function(cmd) {
var title = $('#cmdValue').val();
if(title) {
editor.insertText('[tbl=' + title + ']');
} else {
editor.insertText('[tbl=' + title + ']');
}
});
}, tooltip: "خلفية الموضوع"});
for (var a = $('.post .content'), i = 0, j = a.length; i < j; i++) {
if (/\[tbl=.*?\]/i.test(a[i].innerHTML)) {
a[i].innerHTML = a[i].innerHTML.replace(/\[tbl=(.*?)\]/i, function(M, $1) {
a[i].style.backgroundImage = 'url(' + $1 + ')';
return '';
});
}
}
toolbar = toolbar.replace(/image/,'cmd,image');
$('head').append(
'<style type="text/css">' +
'.sceditor-button-cmd div {' +
' background:url(https://cdn2.iconfinder.com/data/icons/circle-icons-1/64/image-16.png) !important}' +
' .sceditor-cmd {' +
' width:auto;' +
' height:auto;' +
' overflow-y:auto;' +
'}' +
'.sceditor-cmd select {' +
' margin: 0 0 .75em;' +
'}' +
'</style>'
);
});
Last edited by alla13 on May 31st 2018, 3:49 pm; edited 1 time in total