Server IP : 80.241.246.6 / Your IP : 216.73.216.188 Web Server : Apache/2.4.25 (Debian) System : Linux kharagauli 4.9.0-19-amd64 #1 SMP Debian 4.9.320-2 (2022-06-30) x86_64 User : www-data ( 33) PHP Version : 7.0.33-0+deb9u12 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/kharagauli_new/Citizens_feedback/admin/cleditor/ |
Upload File : |
/** @preserve CLEditor Image Upload Plugin v1.0.0 http://premiumsoftware.net/cleditor requires CLEditor v1.3.0 or later Copyright 2011, Dmitry Dedukhin Plugin let you either to upload image or to specify image url. */ (function($) { var hidden_frame_name = '__upload_iframe'; // Define the image button by replacing the standard one $.cleditor.buttons.image = { name: 'image', title: 'Insert/Upload Image', command: 'insertimage', popupName: 'image', popupClass: 'cleditorPrompt', stripIndex: $.cleditor.buttons.image.stripIndex, popupContent: '<iframe style="width:0;height:0;border:0;" name="' + hidden_frame_name + '" />' + '<table cellpadding="0" cellspacing="0">' + '<tr><td>Choose a File:</td></tr>' + '<tr><td> ' + '<form method="post" enctype="multipart/form-data" action="" target="' + hidden_frame_name + '">' + '<input id="imageName" name="imageName" type="file" /></form> </td></tr>' + '<tr><td>Or enter URL:</td></tr>' + '<tr><td><input type="text" size="40" value="" /></td></tr>' + '</table><input type="button" value="Submit">', buttonClick: imageButtonClick, uploadUrl: '/uploadImage' // default url }; function closePopup(editor) { editor.hidePopups(); editor.focus(); } function imageButtonClick(e, data) { var editor = data.editor, $text = $(data.popup).find(':text'), url = $.trim($text.val()), $iframe = $(data.popup).find('iframe'), $file = $(data.popup).find(':file'); // clear previously selected file and url $file.val(''); $text.val('').focus(); $(data.popup) .children(":button") .unbind("click") .bind("click", function(e) { if($file.val()) { // proceed if any file was selected $iframe.bind('load', function() { var file_url; // console.log($iframe.get(0).contentWindow.document) try { file_url = $iframe.get(0).contentWindow.document.getElementById('image').innerHTML; } catch(e) {}; if(file_url) { editor.execCommand(data.command, file_url, null, data.button); // execCommand(editor, command, value, useCSS, button) } else { alert('An error occured during upload!'); } $iframe.unbind('load'); closePopup(editor); }); $(data.popup).find('form').attr('action', $.cleditor.buttons.image.uploadUrl).submit(); } else if (url != '') { editor.execCommand(data.command, url, null, data.button); closePopup(editor); } }); } })(jQuery);