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 : |
/*! CLEditor Table Plugin v1.0.0 */ (function ($) { // Define the table button $.cleditor.buttons.table = { name: "table", image: "table.gif", title: "Insert Table", command: "inserthtml", popupName: "table", popupClass: "cleditorPrompt", popupContent: "<table cellpadding=0 cellspacing=0><tr>" + "<td style=\"padding-right:6px;\">Cols:<br /><input type=text value=4 size=12 /></td>" + "<td style=\"padding-right:6px;\">Rows:<br /><input type=text value=4 size=12 /></td>" + "</tr><tr>" + "<td style=\"padding-right:6px;\">Cell Spacing:<br /><input type=text value=2 size=12 /></td>" + "<td style=\"padding-right:6px;\">Cell Padding:<br /><input type=text value=2 size=12 /></td>" + "</tr><tr>" + "<td style=\"padding-right:6px;\">Border:<br /><input type=text value=1 size=12 /></td>" + "<td style=\"padding-right:6px;\">Style (CSS):<br /><input type=text size=12 /></td>" + "</tr></table><br /><input type=button value=Submit />", buttonClick: tableButtonClick }; // Add the button to the default controls $.cleditor.defaultOptions.controls = $.cleditor.defaultOptions.controls .replace("rule ", "rule table "); // Table button click event handler function tableButtonClick(e, data) { // Wire up the submit button click event handler $(data.popup).children(":button") .unbind("click") .bind("click", function(e) { // Get the editor var editor = data.editor; // Get the column and row count var $text = $(data.popup).find(":text"), cols = parseInt($text[0].value), rows = parseInt($text[1].value), spacing = parseInt($text[2].value), padding = parseInt($text[3].value), border = parseInt($text[4].value), styles = $text[5].value; if (parseInt(cols) < 1 || !parseInt(cols)) cols = 0; if (parseInt(rows) < 1 || !parseInt(rows)) rows = 0; if (parseInt(spacing) < 1 || !parseInt(spacing)) spacing = 0; if (parseInt(padding) < 1 || !parseInt(padding)) padding = 0; if (parseInt(border) < 1 || !parseInt(border)) border = 0; // Build the html var html; if (cols > 0 && rows > 0) { html = "<table border=" + border + " cellpadding=" + padding + " cellspacing=" + spacing + (styles ? ' style="' + styles + '"' : "") + ">"; for (y = 0; y < rows; y++) { html += "<tr>"; for (x = 0; x < cols; x++) html += "<td></td>"; html += "</tr>"; } html += "</table><br />"; } // Insert the html if (html) editor.execCommand(data.command, html, null, data.button); // Reset the text, hide the popup and set focus $text[0].value = "4"; $text[1].value = "4"; $text[2].value = "2"; $text[3].value = "2"; $text[4].value = "1"; $text[5].value = ""; editor.hidePopups(); editor.focus(); }); } })(jQuery);