MyBB Support

sceditor add three text areas fields

Submitted by LorenWolf, , Thread ID: 156012

Thread Closed
20-01-2020, 09:31 PM
#1
Tryng add three textareas fields to sceditor button and output shoult looks like this
Code:
[hide cost="25" title="super secret content"]Pay to view this content.[/hide]

Text area fields showing when i click on button but it wont add nothing
Fields
- Ammount of gems
- Title
- Your hidden content


This my code what won't work!
Code:
$.sceditor.command.set('hidep', {
    tooltip: 'Add unlock content for gems!',

_dropDown: function (editor, caller) {
var $content;

$content = $(
'<div>' +
'<div>' +
'<label for="hidep">' + editor._('Ammount of gems') + '</label> ' +
'<input type="text" id="hidep" />' +
'</div>' +
'<div>' +

'<div>' +
'<label for="htit">' + editor._('Title') + '</label> ' +
'<input type="text" id="htit" />' +
'</div>' +


'<label for="des">' + editor._('Your hidden content') + '</label> ' +
'<input type="text" id="des" />' +
'</div>' +
'<div><input type="button" class="button" value="' + editor._('Insert') + '" /></div>' +
'</div>'
);

$content.find('.button').on('click', function (e) {
var val = $content.find('#hidep').val(),
description = $content.find('#des').val();
var val1 = $content.find('#htit').val(),
description1 = $content.find('#htit').val1();

if (val) {
// needed for IE to reset the last range
$(editor).trigger('focus');

if (!editor.getRangeHelper().selectedHtml() || description) {
if (!description)
description = val;

editor.insert('[hide cost="' + val + '" title="' + description1 + '"]' + description + '[/hide]');

} else

editor.execCommand('createlink', 'mailto:' + val);
}

editor.closeDropDown(true);
e.preventDefault();
});

editor.createDropDown(caller, 'inserthidep', $content.get(0));
},
exec: function (caller) {
$.sceditor.command.get('hidep')._dropDown(this, caller);
}
});

Users browsing this thread: 2 Guest(s)