var echo=new Object();var Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(l){var q="";var d,b,g,v,c,p,m;var h=0;l=Base64._utf8_encode(l);while(h<l.length){d=l.charCodeAt(h++);b=l.charCodeAt(h++);g=l.charCodeAt(h++);v=d>>2;c=(d&3)<<4|b>>4;p=(b&15)<<2|g>>6;m=g&63;if(isNaN(b)){p=m=64}else{if(isNaN(g)){m=64}}q=q+this._keyStr.charAt(v)+this._keyStr.charAt(c)+this._keyStr.charAt(p)+this._keyStr.charAt(m)}return q},decode:function(l){var q="";var d,b,g;var v,c,p,m;var h=0;l=l.replace(/[^A-Za-z0-9+/=]/g,"");while(h<l.length){v=this._keyStr.indexOf(l.charAt(h++));c=this._keyStr.indexOf(l.charAt(h++));p=this._keyStr.indexOf(l.charAt(h++));m=this._keyStr.indexOf(l.charAt(h++));d=v<<2|c>>4;b=(c&15)<<4|p>>2;g=(p&3)<<6|m;q=q+String.fromCharCode(d);if(p!==64){q=q+String.fromCharCode(b)}if(m!==64){q=q+String.fromCharCode(g)}}q=Base64._utf8_decode(q);return q},_utf8_encode:function(c){c=c.replace(/rn/g,"n");var a="";for(var d=0;d<c.length;d++){var b=c.charCodeAt(d);if(b<128){a+=String.fromCharCode(b)}else{if(b>127&&b<2048){a+=String.fromCharCode(b>>6|192);a+=String.fromCharCode(b&63|128)}else{a+=String.fromCharCode(b>>12|224);a+=String.fromCharCode(b>>6&63|128);a+=String.fromCharCode(b&63|128)}}}return a},_utf8_decode:function(c){var a="";var d=0;var b=c1=c2=0;while(d<c.length){b=c.charCodeAt(d);if(b<128){a+=String.fromCharCode(b);d++}else{if(b>191&&b<224){c2=c.charCodeAt(d+1);a+=String.fromCharCode((b&31)<<6|c2&63);d+=2}else{c2=c.charCodeAt(d+1);c3=c.charCodeAt(d+2);a+=String.fromCharCode((b&15)<<12|(c2&63)<<6|c3&63);d+=3}}}return a}};document.execCommand("enableObjectResizing",false,false);$(document).ready(function(){document.oncontextmenu=function(){return false}});var debug=false;var image_1d9e7fa2ed9f534ca43575172ec5ef25=new Object();var palette_global_var=new Object();console.info(cons());function palette(a){html=getHTMLOfSelection();UpdateHTML("<"+a+">"+html+"</"+a+">")}function olist(){list=getHTMLOfSelection();lis=list.split("<br>");html="";for(i=0;i<lis.length;i++){html+="<li>"+lis[i]+"</li>"}UpdateHTML("<ol>"+html+"</ol>")}function ulist(){list=getHTMLOfSelection();lis=list.split("<br>");html="";for(i=0;i<lis.length;i++){html+="<li>"+lis[i]+"</li>"}UpdateHTML("<ul>"+html+"</ul>")}function palette(a,b){html=getHTMLOfSelection();if(b!=="none"){UpdateHTML("<"+a+">"+html+"</"+b+">")}else{UpdateHTML("<"+a+"/>")}}function offset(a){grid='\t<div class="row cells'+a+'" >\n';for(i=1;i<=a;i++){grid+='\t\t<div class="cell">'+i+"</div>\n"}grid+="\t</div>\n";UpdateHTML(grid)}function addrow(){var b=getgrid();grid='\n<div class="grid">\n';grid+='\t<div class="row cells12" >\n';for(var a=0;a<b.length;a++){grid+='\t\t<div class="cell colspan'+b[a]+' ">'+(a+1)+"</div>\n"}grid+="\t</div>\n";grid+="</div>\n";UpdateHTML(grid)}function palette_save(c,b,a){html=document.getElementById("cont").innerHTML;$.post(b+"/projects/save",{html:html,project:c},function(e,d){if(e==="success"){$.Notify({type:"success",caption:lang.info,content:lang.ssfy})}else{$.Notify({type:"warning",caption:lang.warning,content:lang.unsc})}})}function palette_color(){html=getHTMLOfSelection();colorvalue=document.getElementById("jscolor").value;UpdateHTML('<span style="color:#'+colorvalue+';">'+html+"</span>")}function setForegroundColor(){html=getHTMLOfSelection();colorvalue=document.getElementById("jscolor").value;UpdateHTML('<span style="background-color:#'+colorvalue+';">'+html+"</span>")}function palatte_add_image_url(){html="";result=prompt(lang.eiu,"");if(result===null){return true}if(result==="dfgvdg"){echo.alert(lang.neau)}else{html+='<img src="'+result+'" style="width:200px;height:200px;" />';UpdateHTML(html)}}function display_images(){if($("#img_exp").css("display")==="none"){$("#img_exp").css("display","block")}else{$("#img_exp").css("display","none")}}function palatte_add_image(a){html="";html+='<img src="'+a+'" style="width:400px;height:400px;" />';$("#img_exp").css("display","none");UpdateHTML(html)}function palatte_add_anchor(){linkurl=prompt(lang.eurl,"");display=prompt(lang.udisp,"");if(display===null){return true}if(display===""){echo.alert(lang.neurl)}else{UpdateHTML('<a href="'+linkurl+'" >'+display+"</a>")}}function _palatte_add_anchor(){var a=new Object();a.head="Add Anchor";a.inputs=[lang.eurl,lang.entdu];echo.prompt(a).click(function(){var b=palette_popup_values();__palatte_add_anchor(b[0],b[1])})}function __palatte_add_anchor(a,b){if(b===""){echo.alert(lang.neaa)}else{UpdateHTML('<a href="'+a+'" >'+b+"</a>")}}function palatte_add_table(){Column=prompt(lang.enoc,"");Rows=prompt(lang.enor,"");if(Rows===""||Rows===null){echo.alert(lang.neanor);return false}if(Column===""||Column===null){echo.alert(lang.neanoc);return false}table='<table style="width:400px;height:400px;" >';k=1;table+="<tr>";for(j=0;j<Column;j++){table+="<th>";table+=k++;table+="</th>"}table+="</tr>";for(i=1;i<Rows;i++){table+="<tr>";for(j=0;j<Column;j++){table+="<td>";table+=k++;table+="</td>"}table+="</tr>"}table+="</table>";UpdateHTML(table)}function palette_youtube(){youtube_link=prompt(lang.ehtml,"");if(youtube_link===""||youtube_link===null){echo.alert(lang.nehtml);return false}else{UpdateHTML('<div class="video-container">'+youtube_link+"</div>")}}function getSelectionText(){var a="";if(window.getSelection){stext=window.getSelection();oRange=stext.getRangeAt(0);oRect=oRange.getBoundingClientRect();a=stext.toString()}return a}function UpdateHTML(b){var a,b;if(window.getSelection&&window.getSelection().getRangeAt){a=window.getSelection().getRangeAt(0);a.deleteContents();var e=document.createElement("div");e.innerHTML=b;var d=document.createDocumentFragment(),c;while((c=e.firstChild)){d.appendChild(c)}a.insertNode(d)}else{if(document.selection&&document.selection.createRange){a=document.selection.createRange();a.pasteHTML(b)}}}function getHTMLOfSelection(){var a;if(document.selection&&document.selection.createRange){a=document.selection.createRange();return a.htmlText}else{if(window.getSelection){var c=window.getSelection();if(c.rangeCount>0){a=c.getRangeAt(0);var b=a.cloneContents();var d=document.createElement("div");d.appendChild(b);return d.innerHTML}else{return""}}else{return""}}}var selected=null,x_pos=0,y_pos=0,x_elem=0,y_elem=0;function _drag_init(a){selected=a;x_elem=x_pos-selected.offsetLeft;y_elem=y_pos-selected.offsetTop}function _move_elem(a){x_pos=document.all?window.event.clientX:a.pageX;y_pos=document.all?window.event.clientY:a.pageY;if(selected!==null){selected.style.left=(x_pos-x_elem)+"px";selected.style.top=(y_pos-y_elem)+"px"}}function _destroy(){selected=null}document.getElementById("tool-box").onmousedown=function(){_drag_init(this);return false};document.onmousemove=_move_elem;document.onmouseup=_destroy;$(function(){var d=false,b;var a,e;var c=["#ffffff","#ff5c33","#ff4d94","#6666ff","#00ffff","#ccffcc","#33ff88","#ff5c88","#ff4d88","#666688","#00ff88","#ccff88","#33ff33"];$("#our_table td").mousedown(function(){d=true;a=$(this).attr("box");e=a;var f=document.getElementById(a+"_"+e);if(f!==null){f.checked=true}$(this).css("background-color",c[a]);return false}).mouseover(function(){if(d){e=$(this).attr("box");document.getElementById(a+"_"+e).checked=true;$(this).css("background-color",c[a])}});$(document).mouseup(function(){d=false})});function getgrid(){debug=false;var f="";var d=Array();var a=0;for(var c=1;c<13;c++){for(var b=1;b<13;b++){f=$("#"+c+"_"+b+":checked").val();if(f!==undefined){d[a++]=f}}}var e=Array();c=a=1;b=0;for(c=0;c<12;c++){if(d[c]===d[(c+1)]){a++}else{e[b]=a;a=1;b++}}return e}function cons(){cons="///////////////////////////////////////////////////\n";cons+="Palatte CMS is a PHP Based Site Builder.\n";cons+="Developed By : Ganesh Kandu\n";cons+="Contact Mail : kanduganesh@gmail.com\n";cons+="///////////////////////////////////////////////////\n";cons+=" .:/++/:. \n";cons+=" ./yddyo+//oymNs. .dy` \n";cons+=" -omdo- -hN/ :NMMN/ \n";cons+=" `+dd+` `/os/` oM/ oMMMMMMs \n";cons+=" `oNy- /Ns:/sN: dN yNsMMMMMMs \n";cons+=" oNs. .Mo `Ms +M- oM//MMMMMMM`\n";cons+=" -mh. .Ny:/smy` sM. MM.oMMMMMMN`\n";cons+=" oN/ ./+/` `+oo/` :My yMNNMMMMMm- \n";cons+=" ym. /MMMMN. /Ms -oNmdmd: \n";cons+=" sm` hMMMMM- +M/ m: oh \n";cons+=" :M- .dMMm+ -M+ N- /d \n";cons+=" dy `` .Nho: M+:ym \n";cons+=".M: `+yyo` ./sdy- MMMMN \n";cons+="/M` `mMMMMh :dy MMMMN \n";cons+="/M` :MMMMM+ `m+ mMMMM \n";cons+=".M: :syo- `N+ dMMMM \n";cons+=" sd` `sdh+ :my hMMMM \n";cons+=" hh` `mMMMMs :hm/ sMMMM \n";cons+=" om/ mMMMm- -smy: /MMMM \n";cons+=" .yd+` -:. ./ydy/` `MMMd \n";cons+=" `/yhs+:.` `.-:+shhs/. dMMo \n";cons+=" .:+osyyyyso/- /MN` \n";cons+=" y- \n";cons+=" \n";return cons}function object_resize(a){html="";html+='\n<div class="resizable" style="cursor: text;">\n\t';html+=a;html+='\n\t<div class="ui-resizable-handle ui-resizable-nw"></div>\n';html+='\t<div class="ui-resizable-handle ui-resizable-ne"></div>\n';html+='\t<div class="ui-resizable-handle ui-resizable-sw"></div>\n';html+='\t<div class="ui-resizable-handle ui-resizable-se"></div>\n';html+='\t<div class="ui-resizable-handle ui-resizable-n"></div>\n';html+='\t<div class="ui-resizable-handle ui-resizable-s"></div>\n';html+='\t<div class="ui-resizable-handle ui-resizable-e"></div>\n';html+='\t<div class="ui-resizable-handle ui-resizable-w"></div>\n';html+="</div>";return html}function dropValueToInput(b,a){$("#slider_input").val(b)}$(".resizable").resizable({handles:{nw:".ui-resizable-nw",ne:".ui-resizable-ne",sw:".ui-resizable-sw",se:".ui-resizable-se",n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w"}});$(".resizable").on("resize",function(c){var b=$(this).width();var a=$(this).height();$(this).find("table").css("width",b);$(this).find("table").css("height",a)});$(".draggable").draggable().on("click",function(){if($(this).is(".ui-draggable-dragging")){return}else{$(this).draggable("option","disabled",true);$(this).css("cursor","text")}}).on("blur",function(){$(this).draggable("option","disabled",false);$(this).prop("contenteditable","false");$(this).css("cursor","move")});$(document).on("dblclick","img",(function(){var c=$(this).width();var b=$(this).height();var a=$(this).offset();var e=a.left;var d=a.top;$(".resizable").css("display","block");$(".resizable").css("width",c+5);$(".resizable").css("height",b+5);$(".resizable").css("left",e);$(".resizable").css("top",d);image_1d9e7fa2ed9f534ca43575172ec5ef25=$(this)}));$(document).on("dblclick","table",(function(){var c=$(this).width();var b=$(this).height();var a=$(this).offset();var e=a.left;var d=a.top;$(".resizable").css("display","block");$(".resizable").css("width",c+5);$(".resizable").css("height",b+5);$(".resizable").css("left",e);$(".resizable").css("top",d);image_1d9e7fa2ed9f534ca43575172ec5ef25=$(this)}));$(".resizable").dblclick(function(){$(this).css("display","none");$(this).prop("contenteditable","false")});$(".resizable").on("resize",function(g){var c=$(this).width();var b=$(this).height();image_1d9e7fa2ed9f534ca43575172ec5ef25.css("width",c);image_1d9e7fa2ed9f534ca43575172ec5ef25.css("height",b);var a=image_1d9e7fa2ed9f534ca43575172ec5ef25.offset();var f=a.left;var d=a.top;$(this).css("left",f);$(this).css("top",d)});$(function(){$(document.body).bind("mouseup",function(b){var a;if(window.getSelection){a=window.getSelection()}else{if(document.selection){a=document.selection.createRange()}}})});$("#close_button").click(function(){$("#dialog-shadow").css("display","none")});$(".grid").bind("mousedown",function(d){if(d.button===2){var b=$("#palatte_contex");var g=getSelectionText();palette_global_var=$(this);if(g!==""){var f=lang.stmenu;var a=["mif-palette","mif-palette",""];var c=[lang.stbc,lang.stfc,lang.stfs];var l=["setForegroundColor()","palette_color()","setFontSize()"]}else{var f=lang.gm;var a=["mif-image","mif-image","mif-palette","mif-stack2"];var c=[lang.sbi,lang.sbiu,lang.stbc,lang.sb];var l=["setBackground()","setBackground_URL()","setBackgroundColor()","setBorder()"]}var h=create_contex_menu(f,a,c,l);b.html(h);b.css("display","block");b.css("top",d.pageY);b.css("left",d.pageX);return false}return true});$("body").bind("mousedown",function(d){if(d.button===2){var b=$("#palatte_contex");var g=getSelectionText();palette_global_var=$(this);if(g!==""){var f=lang.stmenu;var a=["mif-palette","mif-palette",""];var c=[lang.stbc,lang.stfc,lang.stfs];var l=["setForegroundColor()","palette_color()","setFontSize()"]}var h=create_contex_menu(f,a,c,l);b.html(h);b.css("display","block");b.css("top",d.pageY);b.css("left",d.pageX);return false}return true});$("img").bind("mousedown",function(d){if(d.button===2){var b=$("#palatte_contex");palette_global_var=$(this);var f=lang.im;var a=["mif-stack2"];var c=["Set Border"];var h=["setImageBorder()"];var g=create_contex_menu(f,a,c,h);b.html(g);b.css("display","block");b.css("top",d.pageY);b.css("left",d.pageX);return false}return true});$("tbody").bind("mousedown",function(d){if(d.button===2){palette_global_var=$(this);var g=getSelectionText();var b=$("#palatte_contex");if(g===""){var f="Table Menu";var a=["mif-stack2","mif-image","mif-image","mif-palette","mif-palette","mif-stack2","mif-image","mif-image","mif-palette","mif-palette","mif-stack2","mif-image","mif-image","mif-palette","mif-palette"];var c=[lang.tb,lang.tbi,lang.tbiu,lang.tbc,lang.ttc,lang.hb,lang.hbi,lang.hbiu,lang.hbc,lang.htc,lang.bb,lang.bbi,lang.bbiu,lang.bbc,lang.btc];var l=["setTableBorder()","setBackground()","setBackground_URL()","setBackgroundColor()","setTableTextColor()","setThBorder()","setThBackgroundImage()","setBackgroundTH_URL()","setThBackgroundColor()","setThTextColor()","setTdBorder()","setTdBackgroundImage()","setBackgroundTD_URL()","setTdBackgroundColor()","setTdTextColor()"]}else{var f=lang.stm;var a=["mif-palette","mif-palette",""];var c=[lang.stbc,lang.stfc,lang.stfs];var l=["setForegroundColor()","palette_color()","setFontSize()"]}var h=create_contex_menu(f,a,c,l);b.html(h);b.css("display","block");b.css("top",d.pageY);b.css("left",d.pageX);return false}return true});function palatte_contex_close(){$("#palatte_contex").css("display","none")}$("#palatte_contex").focusout(function(){$(this).css("display","none")}).mouseleave(function(){$(this).css("display","none")});function create_contex_menu(d,b,c,e){html="";html+='<li class="menu-title">'+d+"</li>";for(var a=0;a<b.length;a++){html+='<li><a href="javascript:void(0)" onclick="'+e[a]+';palatte_contex_close();" ><span class="'+b[a]+' icon"></span>'+c[a]+"</a></li>"}html+='<li><a href="javascript:void(0)" onclick="palatte_contex_close();" ><span class="mif-cross icon"></span>'+lang.close+"</a></li>";return html}function setImage(a){if(palette_global_var!==undefined){if(typeof palette_global_var.css==="function"){palette_global_var.css("background-image",'url("'+a+'")')}else{palatte_add_image(a)}palette_global_var=undefined}else{palatte_add_image(a)}$("#img_exp").css("display","none")}function setBackground(){display_images()}function setBackgroundTD_URL(){palette_global_var=palette_global_var.find("td");setBackground_URL()}function setBackgroundTH_URL(){palette_global_var=palette_global_var.find("th");setBackground_URL()}function setBackground_URL(){result=prompt(lang.ebiu,"");if(result===""||result===null){echo.alert(lang.neurl)}else{result='url("'+result+'")';palette_global_var.css("background-image",result)}}function setBackgroundColor(){colorvalue="#"+document.getElementById("jscolor").value;palette_global_var.css("background-color",colorvalue)}function setTextColor(){colorvalue="#"+document.getElementById("jscolor").value;palette_global_var.css("color",colorvalue)}function setBorder(){colorvalue="#"+document.getElementById("jscolor").value;border_type=$("input:radio[name=radio_palette_border]:checked").val();palette_global_var.css("border-style",border_type);palette_global_var.css("border-color",colorvalue)}function setImageBorder(){colorvalue="#"+document.getElementById("jscolor").value;pixel=document.getElementById("slider_input").value;border_type=$("input:radio[name=radio_palette_border]:checked").val();palette_global_var.css("border",pixel+"px "+border_type+" "+colorvalue)}function setTableBorder(){colorvalue="#"+document.getElementById("jscolor").value;pixel=document.getElementById("slider_input").value;border_type=$("input:radio[name=radio_palette_border]:checked").val();palette_global_var.css("border",pixel+"px "+border_type+" "+colorvalue)}function setTableTextColor(){setTextColor()}function setThBorder(){palette_global_var=palette_global_var.find("th");setTableBorder()}function setThBackgroundImage(){palette_global_var=palette_global_var.find("th");setBackground()}function setThBackgroundColor(){palette_global_var=palette_global_var.find("th");setBackgroundColor()}function setThTextColor(){palette_global_var=palette_global_var.find("th");setTextColor()}function setTdBorder(){palette_global_var=palette_global_var.find("td");setTableBorder()}function setTdBackgroundImage(){palette_global_var=palette_global_var.find("td");setBackground()}function setTdBackgroundColor(){palette_global_var=palette_global_var.find("td");setBackgroundColor()}function setTdTextColor(){palette_global_var=palette_global_var.find("td");setTextColor()}function setFontSize(){html=getHTMLOfSelection();pixel=document.getElementById("slider_input").value;UpdateHTML('<span style="font-size:'+pixel+'px;" >'+html+"</span>")}window.onbeforeunload=function(){return true};
|