| 1 |
var labels={ |
| 2 |
title:"Label Shortcode", |
| 3 |
id :'oscitas-form-label', |
| 4 |
pluginName: 'labels' |
| 5 |
}; |
| 6 |
(function() { |
| 7 |
_create_tinyMCE_options(labels); |
| 8 |
})(); |
| 9 |
|
| 10 |
function ebs_return_html_labels(pluginObj){ |
| 11 |
var form = jQuery('<div id="'+pluginObj.id+'" class="oscitas-container" title="'+pluginObj.title+'"><table id="oscitas-table" class="form-table ebs-default-options">\ |
| 12 |
<tr>\ |
| 13 |
<th><label for="oscitas-label-type">'+ebsjstrans.label+' '+ebsjstrans.type+':</label></th>\ |
| 14 |
<td>\ |
| 15 |
<select name="type" id="oscitas-label-type">\ |
| 16 |
<option value="label-default">'+ebsjstrans.simple+'</option>\ |
| 17 |
<option value="label-primary">'+ebsjstrans.primary+'</option>\ |
| 18 |
<option value="label-success">'+ebsjstrans.success+'</option>\ |
| 19 |
<option value="label-info">'+ebsjstrans.information+'</option>\ |
| 20 |
<option value="label-warning">'+ebsjstrans.warning+'</option>\ |
| 21 |
<option value="label-danger">'+ebsjstrans.danger+'</option>\ |
| 22 |
</select><br />\ |
| 23 |
</td>\ |
| 24 |
</tr>\ |
| 25 |
<tr>\ |
| 26 |
<th><label for="oscitas-label-content">'+ebsjstrans.label+' '+ebsjstrans.content+':</label></th>\ |
| 27 |
<td><input type="text" name="label" id="oscitas-label-content" value="Label"/><br />\ |
| 28 |
</td>\ |
| 29 |
</tr>\ |
| 30 |
<tr>\ |
| 31 |
<th><label for="oscitas-label-class">'+ebsjstrans.customclass+':</label></th>\ |
| 32 |
<td><input type="text" name="line" id="oscitas-label-class" value=""/><br />\ |
| 33 |
</td>\ |
| 34 |
</tr>\ |
| 35 |
</table>\ |
| 36 |
<p class="submit ebs-default-options">\ |
| 37 |
<input type="button" id="oscitas-label-submit" class="button-primary" value="'+ebsjstrans.insert+' '+ebsjstrans.label+'" name="submit" />\ |
| 38 |
</p>\ |
| 39 |
<div class="pro-version-image aligncenter" style="display: none;"><img src="'+ebs_url+'shortcode/labels/screenshot.jpg"/></div>\ |
| 40 |
</div>'); |
| 41 |
return form; |
| 42 |
|
| 43 |
} |
| 44 |
function create_oscitas_labels(pluginObj){ |
| 45 |
var form=jQuery(pluginObj.hashId); |
| 46 |
|
| 47 |
var table = form.find('table'); |
| 48 |
|
| 49 |
// handles the click event of the submit button |
| 50 |
form.find('#oscitas-label-submit').click(function(){ |
| 51 |
var cusclass=''; |
| 52 |
if(table.find('#oscitas-label-class').val()!=''){ |
| 53 |
cusclass= ' class="'+table.find('#oscitas-label-class').val()+'"'; |
| 54 |
} |
| 55 |
var shortcode = '['+$ebs_prefix+'label type="'+jQuery('#oscitas-label-type').val()+'"'+cusclass+']<br/>'; |
| 56 |
shortcode += jQuery('#oscitas-label-content').val()+'<br/>'; |
| 57 |
shortcode += '[/'+$ebs_prefix+'label]'; |
| 58 |
|
| 59 |
// inserts the shortcode into the active editor |
| 60 |
ebsInsertShortcode(shortcode); |
| 61 |
|
| 62 |
// closes fancybox |
| 63 |
close_dialogue(pluginObj.hashId); |
| 64 |
}); |
| 65 |
} |
| 66 |
|
| 67 |
|