bftarane
شنبه 25 آذر 1391, 22:37 عصر
سلام.
<script type="text/javascript">
$(function () {
$('textarea').tinymce({
script_url: 'jscripts/tiny_mce/tiny_mce.js',
theme: "advanced",
plugins: "spellchecker,pagebreak,style,layer,table,save,advh r,advimage,advlink,emotions,iespell,inlinepopups,i nsertdatetime,preview,media,searchreplace,print,co ntextmenu,paste,directionality,fullscreen,nonedita ble,visualchars,nonbreaking,xhtmlxtras,template",
theme_advanced_buttons1: "save,newdocument,|,bold,italic,underline,strikethr ough,|,justifyleft,justifycenter,justifyright,just ifyfull,|,styleselect,formatselect,fontselect,font sizeselect",
theme_advanced_buttons2: "cut,copy,paste,pastetext,pasteword,|,search,replac e,|,bullist,numlist,|,outdent,indent,blockquote,|, undo,redo,|,link,unlink,anchor,image,cleanup,help, code,|,insertdate,inserttime,preview,|,forecolor,b ackcolor",
theme_advanced_buttons3: "tablecontrols,|,hr,removeformat,visualaid,|,sub,su p,|,charmap,emotions,iespell,media,advhr,|,print,| ,ltr,rtl,|,fullscreen",
theme_advanced_buttons4: "insertlayer,moveforward,movebackward,absolute,|,st yleprops,spellchecker,|,cite,abbr,acronym,del,ins, attribs,|,visualchars,nonbreaking,template,blockqu ote,pagebreak,|,insertfile,insertimage",
theme_advanced_toolbar_location: "top",
theme_advanced_toolbar_align: "left",
theme_advanced_toolbar_location: "top",
theme_advanced_toolbar_align: "left",
theme_advanced_statusbar_location: "bottom",
theme_advanced_resizing: true,
height: 200,
skin: "o2k7",
skin_variant: "silver"
});
$("[id*=FileUpload1]").fileUpload({
'uploader': 'scripts/uploader.swf',
'cancelImg': 'images/cancel.png',
'buttonText': 'Browse Files',
'script': 'Upload.ashx',
'folder': 'uploads',
'fileDesc': 'Image Files',
'fileExt': '*.jpg;*.jpeg;*.gif;*.png',
'multi': true,
'auto': true,
'onComplete': function (event, ID, fileObj, response, data) {
var img = "<img style = 'height:80px;width:80px' src = '" + response + "' />";
tinyMCE.activeEditor.execCommand("mceInsertContent", true, img);
}
});
});
</script>
من کدهاي زير رو به چه نحوي بايد به کدهاي بالا اضافه کنم؟
'sizeLimit': (600 * 1024), //600 KB
onError: function (a, b, c, d) {
if (d.type === "File Size") {
// Display error message in span
$("#err").html('File: ' + c.name + ' Maximum ' + d.type + ' Limit: ' + Math.round(d.sizeLimit / 1024) + 'KB');
<script type="text/javascript">
$(function () {
$('textarea').tinymce({
script_url: 'jscripts/tiny_mce/tiny_mce.js',
theme: "advanced",
plugins: "spellchecker,pagebreak,style,layer,table,save,advh r,advimage,advlink,emotions,iespell,inlinepopups,i nsertdatetime,preview,media,searchreplace,print,co ntextmenu,paste,directionality,fullscreen,nonedita ble,visualchars,nonbreaking,xhtmlxtras,template",
theme_advanced_buttons1: "save,newdocument,|,bold,italic,underline,strikethr ough,|,justifyleft,justifycenter,justifyright,just ifyfull,|,styleselect,formatselect,fontselect,font sizeselect",
theme_advanced_buttons2: "cut,copy,paste,pastetext,pasteword,|,search,replac e,|,bullist,numlist,|,outdent,indent,blockquote,|, undo,redo,|,link,unlink,anchor,image,cleanup,help, code,|,insertdate,inserttime,preview,|,forecolor,b ackcolor",
theme_advanced_buttons3: "tablecontrols,|,hr,removeformat,visualaid,|,sub,su p,|,charmap,emotions,iespell,media,advhr,|,print,| ,ltr,rtl,|,fullscreen",
theme_advanced_buttons4: "insertlayer,moveforward,movebackward,absolute,|,st yleprops,spellchecker,|,cite,abbr,acronym,del,ins, attribs,|,visualchars,nonbreaking,template,blockqu ote,pagebreak,|,insertfile,insertimage",
theme_advanced_toolbar_location: "top",
theme_advanced_toolbar_align: "left",
theme_advanced_toolbar_location: "top",
theme_advanced_toolbar_align: "left",
theme_advanced_statusbar_location: "bottom",
theme_advanced_resizing: true,
height: 200,
skin: "o2k7",
skin_variant: "silver"
});
$("[id*=FileUpload1]").fileUpload({
'uploader': 'scripts/uploader.swf',
'cancelImg': 'images/cancel.png',
'buttonText': 'Browse Files',
'script': 'Upload.ashx',
'folder': 'uploads',
'fileDesc': 'Image Files',
'fileExt': '*.jpg;*.jpeg;*.gif;*.png',
'multi': true,
'auto': true,
'onComplete': function (event, ID, fileObj, response, data) {
var img = "<img style = 'height:80px;width:80px' src = '" + response + "' />";
tinyMCE.activeEditor.execCommand("mceInsertContent", true, img);
}
});
});
</script>
من کدهاي زير رو به چه نحوي بايد به کدهاي بالا اضافه کنم؟
'sizeLimit': (600 * 1024), //600 KB
onError: function (a, b, c, d) {
if (d.type === "File Size") {
// Display error message in span
$("#err").html('File: ' + c.name + ' Maximum ' + d.type + ' Limit: ' + Math.round(d.sizeLimit / 1024) + 'KB');