CKEDITOR.plugins.add("simple-image-browser", { init: function (a) { "undefined" == typeof CKEDITOR.config.simpleImageBrowserListType && (CKEDITOR.config.simpleImageBrowserListType = "thumbnails"), a.on("dialogShow", function (a) { var b; var keyword; if (a.data.getName() === 'simple-image-browser-dialog') { keyword = prompt('enter Keyword'); } // change the JSON URL here var JSONURL = '/classes/ImageClass.php?a=getJsonForCKE&keyword='+keyword; b = a.data, "simple-image-browser-dialog" === b.getName() && $.get(JSONURL, function (a) { var block = $(".imageBrowser"); var b; //debugger; return console.log(a), b = $.parseJSON(a), a = "", $.each(b, function (b, c) { a = "thumbnails" === CKEDITOR.config.simpleImageBrowserListType ? a + "
" : "link" }), $(block).eq(-1).html(a); }) }), a.addCommand( "simple-image-browser-start", new CKEDITOR.dialogCommand("simple-image-browser-dialog")), CKEDITOR.tools.simpleimagebrowserinsertpicture = function (b) { var c, d; console.log(b), a = CKEDITOR.currentInstance, c = CKEDITOR.dialog.getCurrent(), d = '' + b + '', a.config.allowedContent = !0, a.insertHtml(d.trim()), c.hide() }, a.ui.addButton("Simple Image Browser", { label: "Simple Image Browser ", command: "simple-image-browser-start", icon: this.path + "images/icon.png" }) } }); CKEDITOR.dialog.add("simple-image-browser-dialog", function () { return { title: "Simple Image Browser", minWidth: 800, minHeight: 400, maxWidth: 800, maxHeight: 400, contents: [{ id: "tab-step1", label: "Browse for images", elements: [{ type: "html", align: "left", id: "titleid", style: "font-size: 20px; font-weight: bold;", html: "Browse for pictures" }, {type: "html", align: "left", id: "msg", style: "", class: "simple-image-browser-dialog", html: '
Test
'}] }, { id: "tab-step2", label: "About this plugin", elements: [{ type: "html", align: "left", id: "framepreviewtitleid", style: "font-size: 20px; font-weight: bold;", html: "About this author" }, { type: "html", align: "left", id: "descriptionid", style: "position:relative;width:800px;", html: 'EpicSoftworks released this plugin for free under the MIT licence.
You are free to use this for personal, educational or commercial use.

Free as in, the freedom to use.

Visit my website >>' }] }] } });