From 1eb3d18ae24a221037a44d662439d50c74e6fe9f Mon Sep 17 00:00:00 2001 From: patdenice Date: Thu, 25 Sep 2008 17:46:27 +0000 Subject: - Move get_extents function to include/functions.inc.php. - Change all plugins version to 2.0. - LocalFiles Editor can now edit and create template extension. - Editarea (for LocalFiles Editor) go to version 0.7.2.2 (chrome compatible) - Editarea activation is now saved in database with AJAX. git-svn-id: http://piwigo.org/svn/trunk@2588 68402e56-0260-453c-a942-63ccdbb3a9ee --- .../LocalFilesEditor/editarea/edit_area_full.js | 8 +- .../editarea/images/autocompletion.gif | Bin 0 -> 359 bytes plugins/LocalFilesEditor/editarea/langs/cs.js | 4 + plugins/LocalFilesEditor/editarea/langs/de.js | 4 + plugins/LocalFilesEditor/editarea/langs/dk.js | 4 + plugins/LocalFilesEditor/editarea/langs/en.js | 4 + plugins/LocalFilesEditor/editarea/langs/es.js | 1 + plugins/LocalFilesEditor/editarea/langs/fr.js | 4 + plugins/LocalFilesEditor/editarea/langs/hr.js | 4 + plugins/LocalFilesEditor/editarea/langs/it.js | 4 + plugins/LocalFilesEditor/editarea/langs/ja.js | 4 + plugins/LocalFilesEditor/editarea/langs/mk.js | 4 + plugins/LocalFilesEditor/editarea/langs/nl.js | 4 + plugins/LocalFilesEditor/editarea/langs/pl.js | 4 + plugins/LocalFilesEditor/editarea/langs/pt.js | 4 + plugins/LocalFilesEditor/editarea/langs/ru.js | 4 + plugins/LocalFilesEditor/editarea/langs/sk.js | 4 + .../LocalFilesEditor/editarea/reg_syntax/html.js | 5 +- plugins/LocalFilesEditor/editarea/reg_syntax/js.js | 60 --------------- .../LocalFilesEditor/editarea/reg_syntax/php.js | 83 ++++++++++++++++++++- .../LocalFilesEditor/editarea/reg_syntax/sql.js | 55 -------------- .../LocalFilesEditor/editarea/reg_syntax/xml.js | 56 -------------- 22 files changed, 147 insertions(+), 177 deletions(-) create mode 100644 plugins/LocalFilesEditor/editarea/images/autocompletion.gif delete mode 100644 plugins/LocalFilesEditor/editarea/reg_syntax/js.js delete mode 100644 plugins/LocalFilesEditor/editarea/reg_syntax/sql.js delete mode 100644 plugins/LocalFilesEditor/editarea/reg_syntax/xml.js (limited to 'plugins/LocalFilesEditor/editarea') diff --git a/plugins/LocalFilesEditor/editarea/edit_area_full.js b/plugins/LocalFilesEditor/editarea/edit_area_full.js index ffbbb8f07..866103bfa 100644 --- a/plugins/LocalFilesEditor/editarea/edit_area_full.js +++ b/plugins/LocalFilesEditor/editarea/edit_area_full.js @@ -1,5 +1,5 @@ - function EAL(){this.version="0.7.1.1";date=new Date();this.start_time=date.getTime();this.win="loading";this.error=false;this.baseURL="";this.template="";this.lang=new Object();this.load_syntax=new Object();this.syntax=new Object();this.loadedFiles=new Array();this.waiting_loading=new Object();this.scripts_to_load=new Array();this.sub_scripts_to_load=new Array();this.resize=new Array();this.hidden=new Object();this.default_settings={debug:false ,smooth_selection:true ,font_size:"10" ,font_family:"monospace" ,start_highlight:false ,toolbar:"search,go_to_line,fullscreen,|,undo,redo,|,select_font,|,change_smooth_selection,highlight,reset_highlight,|,help" ,begin_toolbar:"" ,end_toolbar:"" ,is_multi_files:false ,allow_resize:"both" ,min_width:400 ,min_height:125 ,replace_tab_by_spaces:false ,allow_toggle:true ,language:"en" ,syntax:"" ,syntax_selection_allow:"basic,brainfuck,c,cpp,css,html,js,pas,php,python,ruby,sql,vb,xml" ,display:"onload" ,max_undo:30 ,browsers:"known" ,plugins:"" ,gecko_spellcheck:false ,fullscreen:false ,is_editable:true ,load_callback:"" ,save_callback:"" ,change_callback:"" ,submit_callback:"" ,EA_init_callback:"" ,EA_delete_callback:"" ,EA_load_callback:"" ,EA_unload_callback:"" ,EA_toggle_on_callback:"" ,EA_toggle_off_callback:"" ,EA_file_switch_on_callback:"" ,EA_file_switch_off_callback:"" ,EA_file_close_callback:"" };this.advanced_buttons=[ ['new_document','newdocument.gif','new_document',false],['search','search.gif','show_search',false],['go_to_line','go_to_line.gif','go_to_line',false],['undo','undo.gif','undo',true],['redo','redo.gif','redo',true],['change_smooth_selection','smooth_selection.gif','change_smooth_selection_mode',true],['reset_highlight','reset_highlight.gif','resync_highlight',true],['highlight','highlight.gif','change_highlight',true],['help','help.gif','show_help',false],['save','save.gif','save',false],['load','load.gif','load',false],['fullscreen','fullscreen.gif','toggle_full_screen',false] ];ua=navigator.userAgent;this.nav=new Object();this.nav['isMacOS']=(ua.indexOf('Mac OS')!=-1);this.nav['isIE']=(navigator.appName=="Microsoft Internet Explorer");if(this.nav['isIE']){this.nav['isIE']=ua.replace(/^.*?MSIE ([0-9\.]*).*$/,"$1");if(this.nav['isIE']<6)this.has_error();}if(this.nav['isNS']=ua.indexOf('Netscape/')!=-1){this.nav['isNS']=ua.substr(ua.indexOf('Netscape/')+9);if(this.nav['isNS']<8||!this.nav['isIE'])this.has_error();}if(this.nav['isOpera']=(ua.indexOf('Opera')!=-1)){this.nav['isOpera']=ua.replace(/^.*?Opera.*?([0-9\.]+).*$/i,"$1");if(this.nav['isOpera']<9)this.has_error();this.nav['isIE']=false;}this.nav['isGecko']=(ua.indexOf('Gecko')!=-1);if(this.nav['isFirefox'] =(ua.indexOf('Firefox')!=-1))this.nav['isFirefox']=ua.replace(/^.*?Firefox.*?([0-9\.]+).*$/i,"$1");if(this.nav['isIceweasel'] =(ua.indexOf('Iceweasel')!=-1))this.nav['isFirefox']=this.nav['isIceweasel']=ua.replace(/^.*?Iceweasel.*?([0-9\.]+).*$/i,"$1");if(this.nav['isCamino'] =(ua.indexOf('Camino')!=-1))this.nav['isCamino']=ua.replace(/^.*?Camino.*?([0-9\.]+).*$/i,"$1");if(this.nav['isSafari'] =(ua.indexOf('Safari')!=-1))this.nav['isSafari']=ua.replace(/^.*?Version\/([0-9]+\.[0-9]+).*$/i,"$1");if(this.nav['isIE']>=6||this.nav['isOpera']>=9||this.nav['isFirefox']||this.nav['isCamino']||this.nav['isSafari']>=3)this.nav['isValidBrowser']=true; -else this.nav['isValidBrowser']=false;this.set_base_url();for(var i=0;i0)settings["toolbar"]=settings["begin_toolbar"] +","+settings["toolbar"];if(settings["end_toolbar"].length>0)settings["toolbar"]=settings["toolbar"] +","+settings["end_toolbar"];settings["tab_toolbar"]=settings["toolbar"].replace(/ /g,"").split(",");settings["plugins"]=settings["plugins"].replace(/ /g,"").split(",");for(var i=0;i0){settings["syntax"]=settings["syntax"].toLowerCase();this.load_script(this.baseURL+"reg_syntax/"+settings["syntax"]+".js");}eAs[settings["id"]]={"settings":settings};eAs[settings["id"]]["displayed"]=false;eAs[settings["id"]]["hidden"]=false;eAL.start(settings["id"]);},delete_instance:function(id){eAL.execCommand(id,"EA_delete");if(window.frames["frame_"+id]&&window.frames["frame_"+id].editArea){if(eAs[id]["displayed"])eAL.toggle(id,"off");window.frames["frame_"+id].editArea.execCommand("EA_unload");}var span=document.getElementById("EditAreaArroundInfos_"+id);if(span)span.parentNode.removeChild(span);var iframe=document.getElementById("frame_"+id);if(iframe){iframe.parentNode.removeChild(iframe);try{delete window.frames["frame_"+id];}catch (e){}}delete eAs[id];},start:function(id){if(this.win!="loaded"){setTimeout("eAL.start('"+id+"');",50);return;}for(var i in eAL.waiting_loading){if(eAL.waiting_loading[i]!="loaded"&&typeof(eAL.waiting_loading[i])!="function"){setTimeout("eAL.start('"+id+"');",50);return;}}if(!eAL.lang[eAs[id]["settings"]["language"]]||(eAs[id]["settings"]["syntax"].length>0&&!eAL.load_syntax[eAs[id]["settings"]["syntax"]])){setTimeout("eAL.start('"+id+"');",50);return;}if(eAs[id]["settings"]["syntax"].length>0)eAL.init_syntax_regexp();if(!document.getElementById("EditAreaArroundInfos_"+id)&&(eAs[id]["settings"]["debug"]||eAs[id]["settings"]["allow_toggle"])){var span=document.createElement("span");span.id="EditAreaArroundInfos_"+id;var html="";if(eAs[id]["settings"]["allow_toggle"]){checked=(eAs[id]["settings"]["display"]=="onload")?"checked":"";html+="
";html+="";html+="
";}if(eAs[id]["settings"]["debug"])html+="
";html=eAL.translate(html,eAs[id]["settings"]["language"]);span.innerHTML=html;var father=document.getElementById(id).parentNode;var next=document.getElementById(id).nextSibling;if(next==null)father.appendChild(span); + function EAL(){this.version="0.7.2.2";date=new Date();this.start_time=date.getTime();this.win="loading";this.error=false;this.baseURL="";this.template="";this.lang=new Object();this.load_syntax=new Object();this.syntax=new Object();this.loadedFiles=new Array();this.waiting_loading=new Object();this.scripts_to_load=new Array();this.sub_scripts_to_load=new Array();this.resize=new Array();this.hidden=new Object();this.default_settings={debug:false ,smooth_selection:true ,font_size:"10" ,font_family:"monospace" ,start_highlight:false ,autocompletion:false ,toolbar:"search,go_to_line,fullscreen,|,undo,redo,|,select_font,|,change_smooth_selection,highlight,reset_highlight,|,help" ,begin_toolbar:"" ,end_toolbar:"" ,is_multi_files:false ,allow_resize:"both" ,show_line_colors:false ,min_width:400 ,min_height:125 ,replace_tab_by_spaces:false ,allow_toggle:true ,language:"en" ,syntax:"" ,syntax_selection_allow:"basic,brainfuck,c,coldfusion,cpp,css,html,js,pas,perl,php,python,ruby,robotstxt,sql,tsql,vb,xml" ,display:"onload" ,max_undo:30 ,browsers:"known" ,plugins:"" ,gecko_spellcheck:false ,fullscreen:false ,is_editable:true ,wrap_text:false ,load_callback:"" ,save_callback:"" ,change_callback:"" ,submit_callback:"" ,EA_init_callback:"" ,EA_delete_callback:"" ,EA_load_callback:"" ,EA_unload_callback:"" ,EA_toggle_on_callback:"" ,EA_toggle_off_callback:"" ,EA_file_switch_on_callback:"" ,EA_file_switch_off_callback:"" ,EA_file_close_callback:"" };this.advanced_buttons=[ ['new_document','newdocument.gif','new_document',false],['search','search.gif','show_search',false],['go_to_line','go_to_line.gif','go_to_line',false],['undo','undo.gif','undo',true],['redo','redo.gif','redo',true],['change_smooth_selection','smooth_selection.gif','change_smooth_selection_mode',true],['reset_highlight','reset_highlight.gif','resync_highlight',true],['highlight','highlight.gif','change_highlight',true],['help','help.gif','show_help',false],['save','save.gif','save',false],['load','load.gif','load',false],['fullscreen','fullscreen.gif','toggle_full_screen',false],['autocompletion','autocompletion.gif','toggle_autocompletion',true] ];ua=navigator.userAgent;this.nav=new Object();this.nav['isMacOS']=(ua.indexOf('Mac OS')!=-1);this.nav['isIE']=(navigator.appName=="Microsoft Internet Explorer");if(this.nav['isIE']){this.nav['isIE']=ua.replace(/^.*?MSIE ([0-9\.]*).*$/,"$1");if(this.nav['isIE']<6)this.has_error();}if(this.nav['isNS']=ua.indexOf('Netscape/')!=-1){this.nav['isNS']=ua.substr(ua.indexOf('Netscape/')+9);if(this.nav['isNS']<8||!this.nav['isIE'])this.has_error();}if(this.nav['isOpera']=(ua.indexOf('Opera')!=-1)){this.nav['isOpera']=ua.replace(/^.*?Opera.*?([0-9\.]+).*$/i,"$1");if(this.nav['isOpera']<9)this.has_error();this.nav['isIE']=false;}this.nav['isGecko']=(ua.indexOf('Gecko')!=-1);if(this.nav['isFirefox'] =(ua.indexOf('Firefox')!=-1))this.nav['isFirefox']=ua.replace(/^.*?Firefox.*?([0-9\.]+).*$/i,"$1");if(this.nav['isIceweasel'] =(ua.indexOf('Iceweasel')!=-1))this.nav['isFirefox']=this.nav['isIceweasel']=ua.replace(/^.*?Iceweasel.*?([0-9\.]+).*$/i,"$1");if(this.nav['GranParadiso'] =(ua.indexOf('GranParadiso')!=-1))this.nav['isFirefox']=this.nav['isGranParadiso']=ua.replace(/^.*?GranParadiso.*?([0-9\.]+).*$/i,"$1");if(this.nav['isCamino'] =(ua.indexOf('Camino')!=-1))this.nav['isCamino']=ua.replace(/^.*?Camino.*?([0-9\.]+).*$/i,"$1");if(this.nav['isChrome'] =(ua.indexOf('Chrome')!=-1))this.nav['isChrome']=ua.replace(/^.*?Chrome.*?([0-9\.]+).*$/i,"$1");if(this.nav['isSafari'] =(ua.indexOf('Safari')!=-1))this.nav['isSafari']=ua.replace(/^.*?Version\/([0-9]+\.[0-9]+).*$/i,"$1");if(this.nav['isIE']>=6||this.nav['isOpera']>=9||this.nav['isFirefox']||this.nav['isChrome']||this.nav['isCamino']||this.nav['isSafari']>=3)this.nav['isValidBrowser']=true; +else this.nav['isValidBrowser']=false;this.set_base_url();for(var i=0;i0)settings["toolbar"]=settings["begin_toolbar"] +","+settings["toolbar"];if(settings["end_toolbar"].length>0)settings["toolbar"]=settings["toolbar"] +","+settings["end_toolbar"];settings["tab_toolbar"]=settings["toolbar"].replace(/ /g,"").split(",");settings["plugins"]=settings["plugins"].replace(/ /g,"").split(",");for(var i=0;i0){settings["syntax"]=settings["syntax"].toLowerCase();this.load_script(this.baseURL+"reg_syntax/"+settings["syntax"]+".js");}eAs[settings["id"]]={"settings":settings};eAs[settings["id"]]["displayed"]=false;eAs[settings["id"]]["hidden"]=false;eAL.start(settings["id"]);},delete_instance:function(id){eAL.execCommand(id,"EA_delete");if(window.frames["frame_"+id]&&window.frames["frame_"+id].editArea){if(eAs[id]["displayed"])eAL.toggle(id,"off");window.frames["frame_"+id].editArea.execCommand("EA_unload");}var span=document.getElementById("EditAreaArroundInfos_"+id);if(span)span.parentNode.removeChild(span);var iframe=document.getElementById("frame_"+id);if(iframe){iframe.parentNode.removeChild(iframe);try{delete window.frames["frame_"+id];}catch (e){}}delete eAs[id];},start:function(id){if(this.win!="loaded"){setTimeout("eAL.start('"+id+"');",50);return;}for(var i in eAL.waiting_loading){if(eAL.waiting_loading[i]!="loaded"&&typeof(eAL.waiting_loading[i])!="function"){setTimeout("eAL.start('"+id+"');",50);return;}}if(!eAL.lang[eAs[id]["settings"]["language"]]||(eAs[id]["settings"]["syntax"].length>0&&!eAL.load_syntax[eAs[id]["settings"]["syntax"]])){setTimeout("eAL.start('"+id+"');",50);return;}if(eAs[id]["settings"]["syntax"].length>0)eAL.init_syntax_regexp();if(!document.getElementById("EditAreaArroundInfos_"+id)&&(eAs[id]["settings"]["debug"]||eAs[id]["settings"]["allow_toggle"])){var span=document.createElement("span");span.id="EditAreaArroundInfos_"+id;var html="";if(eAs[id]["settings"]["allow_toggle"]){checked=(eAs[id]["settings"]["display"]=="onload")?"checked":"";html+="
";html+="";html+="
";}if(eAs[id]["settings"]["debug"])html+="
";html=eAL.translate(html,eAs[id]["settings"]["language"]);span.innerHTML=html;var father=document.getElementById(id).parentNode;var next=document.getElementById(id).nextSibling;if(next==null)father.appendChild(span); else father.insertBefore(span,next);}if(!eAs[id]["initialized"]){this.execCommand(id,"EA_init");if(eAs[id]["settings"]["display"]=="later"){eAs[id]["initialized"]=true;return;}}if(this.nav['isIE']){eAL.init_ie_textarea(id);}var html_toolbar_content="";area=eAs[id];for(var i=0;i';}for(var i=0;i';this.iframe_script+='';}if(!this.iframe_css){this.iframe_css="";}var template=this.template.replace(/\[__BASEURL__\]/g,this.baseURL);template=template.replace("[__TOOLBAR__]",html_toolbar_content);template=this.translate(template,area["settings"]["language"],"template");template=template.replace("[__CSSRULES__]",this.iframe_css);template=template.replace("[__JSCODE__]",this.iframe_script);template=template.replace("[__EA_VERSION__]",this.version);area.textarea=document.getElementById(area["settings"]["id"]);eAs[area["settings"]["id"]]["textarea"]=area.textarea;if(typeof(window.frames["frame_"+area["settings"]["id"]])!='undefined')delete window.frames["frame_"+area["settings"]["id"]];var father=area.textarea.parentNode;var content=document.createElement("iframe");content.name="frame_"+area["settings"]["id"];content.id="frame_"+area["settings"]["id"];content.style.borderWidth="0px";setAttribute(content,"frameBorder","0");content.style.overflow="hidden";content.style.display="none";var next=area.textarea.nextSibling;if(next==null)father.appendChild(content); else father.insertBefore(content,next);var frame=window.frames["frame_"+area["settings"]["id"]];frame.document.open();frame.eAs=eAs;frame.area_id=area["settings"]["id"];frame.document.area_id=area["settings"]["id"];frame.document.write(template);frame.document.close();},toggle:function(id,toggle_to){if(!toggle_to)toggle_to=(eAs[id]["displayed"]==true)?"off":"on";if(eAs[id]["displayed"]==true &&toggle_to=="off"){this.toggle_off(id);} else if(eAs[id]["displayed"]==false &&toggle_to=="on"){this.toggle_on(id);}return false;},toggle_off:function(id){if(window.frames["frame_"+id]){var frame=window.frames["frame_"+id];if(frame.editArea.fullscreen['isFull'])frame.editArea.toggle_full_screen(false);eAs[id]["displayed"]=false;eAs[id]["textarea"].wrap="off";setAttribute(eAs[id]["textarea"],"wrap","off");var parNod=eAs[id]["textarea"].parentNode;var nxtSib=eAs[id]["textarea"].nextSibling;parNod.removeChild(eAs[id]["textarea"]);parNod.insertBefore(eAs[id]["textarea"],nxtSib);eAs[id]["textarea"].value=frame.editArea.textarea.value;var selStart=frame.editArea.last_selection["selectionStart"];var selEnd=frame.editArea.last_selection["selectionEnd"];var scrollTop=frame.document.getElementById("result").scrollTop;var scrollLeft=frame.document.getElementById("result").scrollLeft;document.getElementById("frame_"+id).style.display='none';eAs[id]["textarea"].style.display="inline";eAs[id]["textarea"].focus();if(this.nav['isIE']){eAs[id]["textarea"].selectionStart=selStart;eAs[id]["textarea"].selectionEnd=selEnd;eAs[id]["textarea"].focused=true;set_IE_selection(eAs[id]["textarea"]);} @@ -33,6 +33,6 @@ else return null;}var move_current_element;function start_move_element(e,id,fram EAL.prototype.start_resize_area=function(){document.onmouseup=eAL.end_resize_area;document.onmousemove=eAL.resize_area;eAL.toggle(eAL.resize["id"]);var textarea=eAs[eAL.resize["id"]]["textarea"];var div=document.getElementById("edit_area_resize");if(!div){div=document.createElement("div");div.id="edit_area_resize";div.style.border="dashed #888888 1px";}var width=textarea.offsetWidth -2;var height=textarea.offsetHeight -2;div.style.display="block";div.style.width=width+"px";div.style.height=height+"px";var father=textarea.parentNode;father.insertBefore(div,textarea);textarea.style.display="none";eAL.resize["start_top"]=calculeOffsetTop(div);eAL.resize["start_left"]=calculeOffsetLeft(div);};EAL.prototype.end_resize_area=function(e){document.onmouseup="";document.onmousemove="";var div=document.getElementById("edit_area_resize");var textarea=eAs[eAL.resize["id"]]["textarea"];var width=Math.max(eAs[eAL.resize["id"]]["settings"]["min_width"],div.offsetWidth-4);var height=Math.max(eAs[eAL.resize["id"]]["settings"]["min_height"],div.offsetHeight-4);if(eAL.nav['isIE']==6){width-=2;height-=2;}textarea.style.width=width+"px";textarea.style.height=height+"px";div.style.display="none";textarea.style.display="inline";textarea.selectionStart=eAL.resize["selectionStart"];textarea.selectionEnd=eAL.resize["selectionEnd"];eAL.toggle(eAL.resize["id"]);return false;};EAL.prototype.resize_area=function(e){var allow=eAs[eAL.resize["id"]]["settings"]["allow_resize"];if(allow=="both"||allow=="y"){new_y=getMouseY(e);var new_height=Math.max(20,new_y-eAL.resize["start_top"]);document.getElementById("edit_area_resize").style.height=new_height+"px";}if(allow=="both"||allow=="x"){new_x=getMouseX(e);var new_width=Math.max(20,new_x-eAL.resize["start_left"]);document.getElementById("edit_area_resize").style.width=new_width+"px";}return false;};eAL.waiting_loading["resize_area.js"]="loaded"; EAL.prototype.get_regexp=function(text_array){res="(\\b)(";for(i=0;i0)res+="|";res+=this.get_escaped_regexp(text_array[i]);}res+=")(\\b)";reg=new RegExp(res);return res;};EAL.prototype.get_escaped_regexp=function(str){return str.replace(/(\.|\?|\*|\+|\\|\(|\)|\[|\]|\}|\{|\$|\^|\|)/g,"\\$1");};EAL.prototype.init_syntax_regexp=function(){var lang_style=new Object();for(var lang in this.load_syntax){if(!this.syntax[lang]){this.syntax[lang]=new Object();this.syntax[lang]["keywords_reg_exp"]=new Object();this.keywords_reg_exp_nb=0;if(this.load_syntax[lang]['KEYWORDS']){param="g";if(this.load_syntax[lang]['KEYWORD_CASE_SENSITIVE']===false)param+="i";for(var i in this.load_syntax[lang]['KEYWORDS']){if(typeof(this.load_syntax[lang]['KEYWORDS'][i])=="function")continue;this.syntax[lang]["keywords_reg_exp"][i]=new RegExp(this.get_regexp(this.load_syntax[lang]['KEYWORDS'][i] ),param);this.keywords_reg_exp_nb++;}}if(this.load_syntax[lang]['OPERATORS']){var str="";var nb=0;for(var i in this.load_syntax[lang]['OPERATORS']){if(typeof(this.load_syntax[lang]['OPERATORS'][i])=="function")continue;if(nb>0)str+="|";str+=this.get_escaped_regexp(this.load_syntax[lang]['OPERATORS'][i]);nb++;}if(str.length>0)this.syntax[lang]["operators_reg_exp"]=new RegExp("("+str+")","g");}if(this.load_syntax[lang]['DELIMITERS']){var str="";var nb=0;for(var i in this.load_syntax[lang]['DELIMITERS']){if(typeof(this.load_syntax[lang]['DELIMITERS'][i])=="function")continue;if(nb>0)str+="|";str+=this.get_escaped_regexp(this.load_syntax[lang]['DELIMITERS'][i]);nb++;}if(str.length>0)this.syntax[lang]["delimiters_reg_exp"]=new RegExp("("+str+")","g");}var syntax_trace=new Array();this.syntax[lang]["quotes"]=new Object();var quote_tab=new Array();if(this.load_syntax[lang]['QUOTEMARKS']){for(var i in this.load_syntax[lang]['QUOTEMARKS']){if(typeof(this.load_syntax[lang]['QUOTEMARKS'][i])=="function")continue;var x=this.get_escaped_regexp(this.load_syntax[lang]['QUOTEMARKS'][i]);this.syntax[lang]["quotes"][x]=x;quote_tab[quote_tab.length]="("+x+"(?:[^"+x+"\\\\]*(\\\\\\\\)*(\\\\"+x+"?)?)*("+x+"|$))";syntax_trace.push(x);}}this.syntax[lang]["comments"]=new Object();if(this.load_syntax[lang]['COMMENT_SINGLE']){for(var i in this.load_syntax[lang]['COMMENT_SINGLE']){if(typeof(this.load_syntax[lang]['COMMENT_SINGLE'][i])=="function")continue;var x=this.get_escaped_regexp(this.load_syntax[lang]['COMMENT_SINGLE'][i]);quote_tab[quote_tab.length]="("+x+"(.|\\r|\\t)*(\\n|$))";syntax_trace.push(x);this.syntax[lang]["comments"][x]="\n";}}if(this.load_syntax[lang]['COMMENT_MULTI']){for(var i in this.load_syntax[lang]['COMMENT_MULTI']){if(typeof(this.load_syntax[lang]['COMMENT_MULTI'][i])=="function")continue;var start=this.get_escaped_regexp(i);var end=this.get_escaped_regexp(this.load_syntax[lang]['COMMENT_MULTI'][i]);quote_tab[quote_tab.length]="("+start+"(.|\\n|\\r)*?("+end+"|$))";syntax_trace.push(start);syntax_trace.push(end);this.syntax[lang]["comments"][i]=this.load_syntax[lang]['COMMENT_MULTI'][i];}}if(quote_tab.length>0)this.syntax[lang]["comment_or_quote_reg_exp"]=new RegExp("("+quote_tab.join("|")+")","gi");if(syntax_trace.length>0)this.syntax[lang]["syntax_trace_regexp"]=new RegExp("((.|\n)*?)(\\\\*("+syntax_trace.join("|")+"|$))","gmi");if(this.load_syntax[lang]['SCRIPT_DELIMITERS']){this.syntax[lang]["script_delimiters"]=new Object();for(var i in this.load_syntax[lang]['SCRIPT_DELIMITERS']){if(typeof(this.load_syntax[lang]['SCRIPT_DELIMITERS'][i])=="function")continue;this.syntax[lang]["script_delimiters"][i]=this.load_syntax[lang]['SCRIPT_DELIMITERS'];}}this.syntax[lang]["custom_regexp"]=new Object();if(this.load_syntax[lang]['REGEXPS']){for(var i in this.load_syntax[lang]['REGEXPS']){if(typeof(this.load_syntax[lang]['REGEXPS'][i])=="function")continue;var val=this.load_syntax[lang]['REGEXPS'][i];if(!this.syntax[lang]["custom_regexp"][val['execute']])this.syntax[lang]["custom_regexp"][val['execute']]=new Object();this.syntax[lang]["custom_regexp"][val['execute']][i]={'regexp':new RegExp(val['search'],val['modifiers']),'class':val['class']};}}if(this.load_syntax[lang]['STYLES']){lang_style[lang]=new Object();for(var i in this.load_syntax[lang]['STYLES']){if(typeof(this.load_syntax[lang]['STYLES'][i])=="function")continue;if(typeof(this.load_syntax[lang]['STYLES'][i])!="string"){for(var j in this.load_syntax[lang]['STYLES'][i]){lang_style[lang][j]=this.load_syntax[lang]['STYLES'][i][j];}} else{lang_style[lang][i]=this.load_syntax[lang]['STYLES'][i];}}}var style="";for(var i in lang_style[lang]){if(lang_style[lang][i].length>0){style+="."+lang +" ."+i.toLowerCase()+" span{"+lang_style[lang][i]+"}\n";style+="."+lang +" ."+i.toLowerCase()+"{"+lang_style[lang][i]+"}\n";}}this.syntax[lang]["styles"]=style;}}};eAL.waiting_loading["reg_syntax.js"]="loaded"; -var editAreaLoader= eAL;var editAreas=eAs;EditAreaLoader=EAL;editAreaLoader.iframe_script= "".replace(/Á/g,'this').replace(/Â/g,'textarea').replace(/Ã/g,'function').replace(/Ä/g,'prototype').replace(/Å/g,'settings').replace(/Æ/g,'length').replace(/Ç/g,'style').replace(/È/g,'parent').replace(/É/g,'last_selection').replace(/Ê/g,'value').replace(/Ë/g,'true').replace(/Ì/g,'false'); +var editAreaLoader= eAL;var editAreas=eAs;EditAreaLoader=EAL;editAreaLoader.iframe_script= "".replace(/Á/g,'this').replace(/Â/g,'textarea').replace(/Ã/g,'function').replace(/Ä/g,'prototype').replace(/Å/g,'settings').replace(/Æ/g,'length').replace(/Ç/g,'style').replace(/È/g,'parent').replace(/É/g,'last_selection').replace(/Ê/g,'value').replace(/Ë/g,'true').replace(/Ì/g,'false'); editAreaLoader.template= " EditArea [__CSSRULES__] [__JSCODE__]
[__TOOLBAR__]
 
 
{$position}: {$line_abbr} 0, {$char_abbr} 0 {$total}: {$line_abbr} 0, {$char_abbr} 0 resize
{$processing}
{$search} {$close_popup}
{$replace} {$move_popup}

{$find_next} {$replace} {$replace_all}
{$close_popup}

Editarea [__EA_VERSION__]


{$shortcuts}:

{$tab}: {$add_tab}
{$shift}+{$tab}: {$remove_tab}
{$ctrl}+f: {$search_command}
{$ctrl}+r: {$replace_command}
{$ctrl}+h: {$highlight}
{$ctrl}+g: {$go_to_line}
{$ctrl}+z: {$undo}
{$ctrl}+y: {$redo}
{$ctrl}+e: {$help}
{$ctrl}+q, {$esc}: {$close_popup}
{$accesskey} E: {$toggle}

{$about_notice}
"; -editAreaLoader.iframe_css= ""; +editAreaLoader.iframe_css= ""; diff --git a/plugins/LocalFilesEditor/editarea/images/autocompletion.gif b/plugins/LocalFilesEditor/editarea/images/autocompletion.gif new file mode 100644 index 000000000..f3dfc2e3a Binary files /dev/null and b/plugins/LocalFilesEditor/editarea/images/autocompletion.gif differ diff --git a/plugins/LocalFilesEditor/editarea/langs/cs.js b/plugins/LocalFilesEditor/editarea/langs/cs.js index cb7ff1e89..359b15a30 100644 --- a/plugins/LocalFilesEditor/editarea/langs/cs.js +++ b/plugins/LocalFilesEditor/editarea/langs/cs.js @@ -57,5 +57,9 @@ syntax_pas: "Pascal", syntax_brainfuck: "Brainfuck", syntax_sql: "SQL", syntax_ruby: "Ruby", +syntax_robotstxt: "Robots txt", +syntax_tsql: "T-SQL", +syntax_perl: "Perl", +syntax_coldfusion: "Coldfusion", close_tab: "Close file" }; diff --git a/plugins/LocalFilesEditor/editarea/langs/de.js b/plugins/LocalFilesEditor/editarea/langs/de.js index cd953473f..e238497f9 100644 --- a/plugins/LocalFilesEditor/editarea/langs/de.js +++ b/plugins/LocalFilesEditor/editarea/langs/de.js @@ -57,5 +57,9 @@ syntax_pas: "Pascal", syntax_brainfuck: "Brainfuck", syntax_sql: "SQL", syntax_ruby: "Ruby", +syntax_robotstxt: "Robots txt", +syntax_tsql: "T-SQL", +syntax_perl: "Perl", +syntax_coldfusion: "Coldfusion", close_tab: "Close file" }; diff --git a/plugins/LocalFilesEditor/editarea/langs/dk.js b/plugins/LocalFilesEditor/editarea/langs/dk.js index 75700ec65..2970baabf 100644 --- a/plugins/LocalFilesEditor/editarea/langs/dk.js +++ b/plugins/LocalFilesEditor/editarea/langs/dk.js @@ -57,5 +57,9 @@ syntax_pas: "Pascal", syntax_brainfuck: "Brainfuck", syntax_sql: "SQL", syntax_ruby: "Ruby", +syntax_robotstxt: "Robots txt", +syntax_tsql: "T-SQL", +syntax_perl: "Perl", +syntax_coldfusion: "Coldfusion", close_tab: "Close file" }; diff --git a/plugins/LocalFilesEditor/editarea/langs/en.js b/plugins/LocalFilesEditor/editarea/langs/en.js index aa432163b..2a942eb77 100644 --- a/plugins/LocalFilesEditor/editarea/langs/en.js +++ b/plugins/LocalFilesEditor/editarea/langs/en.js @@ -57,5 +57,9 @@ syntax_pas: "Pascal", syntax_brainfuck: "Brainfuck", syntax_sql: "SQL", syntax_ruby: "Ruby", +syntax_robotstxt: "Robots txt", +syntax_tsql: "T-SQL", +syntax_perl: "Perl", +syntax_coldfusion: "Coldfusion", close_tab: "Close file" }; diff --git a/plugins/LocalFilesEditor/editarea/langs/es.js b/plugins/LocalFilesEditor/editarea/langs/es.js index 0e425014a..b49c84bbc 100644 --- a/plugins/LocalFilesEditor/editarea/langs/es.js +++ b/plugins/LocalFilesEditor/editarea/langs/es.js @@ -57,5 +57,6 @@ syntax_pas: "Pascal", syntax_brainfuck: "Brainfuck", syntax_sql: "SQL", syntax_ruby: "Ruby", +syntax_coldfusion: "Coldfusion", close_tab: "Close file" }; diff --git a/plugins/LocalFilesEditor/editarea/langs/fr.js b/plugins/LocalFilesEditor/editarea/langs/fr.js index b24bd03ae..99b49c738 100644 --- a/plugins/LocalFilesEditor/editarea/langs/fr.js +++ b/plugins/LocalFilesEditor/editarea/langs/fr.js @@ -57,5 +57,9 @@ syntax_pas: "Pascal", syntax_brainfuck: "Brainfuck", syntax_sql: "SQL", syntax_ruby: "Ruby", +syntax_robotstxt: "Robots txt", +syntax_tsql: "T-SQL", +syntax_perl: "Perl", +syntax_coldfusion: "Coldfusion", close_tab: "Fermer le fichier" }; diff --git a/plugins/LocalFilesEditor/editarea/langs/hr.js b/plugins/LocalFilesEditor/editarea/langs/hr.js index f37b28c5e..5980c1690 100644 --- a/plugins/LocalFilesEditor/editarea/langs/hr.js +++ b/plugins/LocalFilesEditor/editarea/langs/hr.js @@ -57,5 +57,9 @@ syntax_pas: "Pascal", syntax_brainfuck: "Brainfuck", syntax_sql: "SQL", syntax_ruby: "Ruby", +syntax_robotstxt: "Robots txt", +syntax_tsql: "T-SQL", +syntax_perl: "Perl", +syntax_coldfusion: "Coldfusion", close_tab: "Close file" }; diff --git a/plugins/LocalFilesEditor/editarea/langs/it.js b/plugins/LocalFilesEditor/editarea/langs/it.js index 2191e6b26..a6840cdc6 100644 --- a/plugins/LocalFilesEditor/editarea/langs/it.js +++ b/plugins/LocalFilesEditor/editarea/langs/it.js @@ -57,5 +57,9 @@ syntax_pas: "Pascal", syntax_brainfuck: "Brainfuck", syntax_sql: "SQL", syntax_ruby: "Ruby", +syntax_robotstxt: "Robots txt", +syntax_tsql: "T-SQL", +syntax_perl: "Perl", +syntax_coldfusion: "Coldfusion", close_tab: "Close file" }; diff --git a/plugins/LocalFilesEditor/editarea/langs/ja.js b/plugins/LocalFilesEditor/editarea/langs/ja.js index 3afc1cb7d..bb21ab139 100644 --- a/plugins/LocalFilesEditor/editarea/langs/ja.js +++ b/plugins/LocalFilesEditor/editarea/langs/ja.js @@ -57,5 +57,9 @@ syntax_pas: "Pascal", syntax_brainfuck: "Brainfuck", syntax_sql: "SQL", syntax_ruby: "Ruby", +syntax_robotstxt: "Robots txt", +syntax_tsql: "T-SQL", +syntax_perl: "Perl", +syntax_coldfusion: "Coldfusion", close_tab: "Close file" }; diff --git a/plugins/LocalFilesEditor/editarea/langs/mk.js b/plugins/LocalFilesEditor/editarea/langs/mk.js index 7cacb038c..46daa3905 100644 --- a/plugins/LocalFilesEditor/editarea/langs/mk.js +++ b/plugins/LocalFilesEditor/editarea/langs/mk.js @@ -57,5 +57,9 @@ syntax_pas: "Pascal", syntax_brainfuck: "Brainfuck", syntax_sql: "SQL", syntax_ruby: "Ruby", +syntax_robotstxt: "Robots txt", +syntax_tsql: "T-SQL", +syntax_perl: "Perl", +syntax_coldfusion: "Coldfusion", close_tab: "Избери датотека" }; diff --git a/plugins/LocalFilesEditor/editarea/langs/nl.js b/plugins/LocalFilesEditor/editarea/langs/nl.js index 00cbbe3a6..920e9cf77 100644 --- a/plugins/LocalFilesEditor/editarea/langs/nl.js +++ b/plugins/LocalFilesEditor/editarea/langs/nl.js @@ -57,5 +57,9 @@ syntax_pas: "Pascal", syntax_brainfuck: "Brainfuck", syntax_sql: "SQL", syntax_ruby: "Ruby", +syntax_robotstxt: "Robots txt", +syntax_tsql: "T-SQL", +syntax_perl: "Perl", +syntax_coldfusion: "Coldfusion", close_tab: "Close file" }; diff --git a/plugins/LocalFilesEditor/editarea/langs/pl.js b/plugins/LocalFilesEditor/editarea/langs/pl.js index 501ec9a2b..a820285f9 100644 --- a/plugins/LocalFilesEditor/editarea/langs/pl.js +++ b/plugins/LocalFilesEditor/editarea/langs/pl.js @@ -57,5 +57,9 @@ syntax_pas: "Pascal", syntax_brainfuck: "Brainfuck", syntax_sql: "SQL", syntax_ruby: "Ruby", +syntax_robotstxt: "Robots txt", +syntax_tsql: "T-SQL", +syntax_perl: "Perl", +syntax_coldfusion: "Coldfusion", close_tab: "Close file" }; diff --git a/plugins/LocalFilesEditor/editarea/langs/pt.js b/plugins/LocalFilesEditor/editarea/langs/pt.js index 547796b0a..36d174225 100644 --- a/plugins/LocalFilesEditor/editarea/langs/pt.js +++ b/plugins/LocalFilesEditor/editarea/langs/pt.js @@ -57,5 +57,9 @@ syntax_pas: "Pascal", syntax_brainfuck: "Brainfuck", syntax_sql: "SQL", syntax_ruby: "Ruby", +syntax_robotstxt: "Robots txt", +syntax_tsql: "T-SQL", +syntax_perl: "Perl", +syntax_coldfusion: "Coldfusion", close_tab: "Close file" }; diff --git a/plugins/LocalFilesEditor/editarea/langs/ru.js b/plugins/LocalFilesEditor/editarea/langs/ru.js index 56b3cd57c..e7e6b6edf 100644 --- a/plugins/LocalFilesEditor/editarea/langs/ru.js +++ b/plugins/LocalFilesEditor/editarea/langs/ru.js @@ -57,5 +57,9 @@ syntax_pas: "Pascal", syntax_brainfuck: "Brainfuck", syntax_sql: "SQL", syntax_ruby: "Ruby", +syntax_robotstxt: "Robots txt", +syntax_tsql: "T-SQL", +syntax_perl: "Perl", +syntax_coldfusion: "Coldfusion", close_tab: "Закрыть файл" }; diff --git a/plugins/LocalFilesEditor/editarea/langs/sk.js b/plugins/LocalFilesEditor/editarea/langs/sk.js index 3d4881a3f..e72436527 100644 --- a/plugins/LocalFilesEditor/editarea/langs/sk.js +++ b/plugins/LocalFilesEditor/editarea/langs/sk.js @@ -57,5 +57,9 @@ syntax_pas: "Pascal", syntax_brainfuck: "Brainfuck", syntax_sql: "SQL", syntax_ruby: "Ruby", +syntax_robotstxt: "Robots txt", +syntax_tsql: "T-SQL", +syntax_perl: "Perl", +syntax_coldfusion: "Coldfusion", close_tab: "Close file" }; diff --git a/plugins/LocalFilesEditor/editarea/reg_syntax/html.js b/plugins/LocalFilesEditor/editarea/reg_syntax/html.js index cc2a90e6e..a6cf060fe 100644 --- a/plugins/LocalFilesEditor/editarea/reg_syntax/html.js +++ b/plugins/LocalFilesEditor/editarea/reg_syntax/html.js @@ -4,7 +4,10 @@ editAreaLoader.load_syntax["html"] = { 'COMMENT_SINGLE' : {} - ,'COMMENT_MULTI' : {''} + ,'COMMENT_MULTI' : { + '', + '{*' : '*}' + } ,'QUOTEMARKS' : {1: "'", 2: '"'} ,'KEYWORD_CASE_SENSITIVE' : false ,'KEYWORDS' : { diff --git a/plugins/LocalFilesEditor/editarea/reg_syntax/js.js b/plugins/LocalFilesEditor/editarea/reg_syntax/js.js deleted file mode 100644 index 8c7beb624..000000000 --- a/plugins/LocalFilesEditor/editarea/reg_syntax/js.js +++ /dev/null @@ -1,60 +0,0 @@ -editAreaLoader.load_syntax["js"] = { - 'COMMENT_SINGLE' : {1 : '//'} - ,'COMMENT_MULTI' : {'/*' : '*/'} - ,'QUOTEMARKS' : {1: "'", 2: '"'} - ,'KEYWORD_CASE_SENSITIVE' : false - ,'KEYWORDS' : { - 'statements' : [ - 'as', 'break', 'case', 'catch', 'continue', 'decodeURI', 'delete', 'do', - 'else', 'encodeURI', 'eval', 'finally', 'for', 'if', 'in', 'is', 'item', - 'instanceof', 'return', 'switch', 'this', 'throw', 'try', 'typeof', 'void', - 'while', 'write', 'with' - ] - ,'keywords' : [ - 'class', 'const', 'default', 'debugger', 'export', 'extends', 'false', - 'function', 'import', 'namespace', 'new', 'null', 'package', 'private', - 'protected', 'public', 'super', 'true', 'use', 'var', 'window', 'document', - // the list below must be sorted and checked (if it is a keywords or a function and if it is not present twice - 'Link ', 'outerHeight ', 'Anchor', 'FileUpload', - 'location', 'outerWidth', 'Select', 'Area', 'find', 'Location', 'Packages', 'self', - 'arguments', 'locationbar', 'pageXoffset', 'Form', - 'Math', 'pageYoffset', 'setTimeout', 'assign', 'Frame', 'menubar', 'parent', 'status', - 'blur', 'frames', 'MimeType', 'parseFloat', 'statusbar', 'Boolean', 'Function', 'moveBy', - 'parseInt', 'stop', 'Button', 'getClass', 'moveTo', 'Password', 'String', 'callee', 'Hidden', - 'name', 'personalbar', 'Submit', 'caller', 'history', 'NaN', 'Plugin', 'sun', 'captureEvents', - 'History', 'navigate', 'print', 'taint', 'Checkbox', 'home', 'navigator', 'prompt', 'Text', - 'Image', 'Navigator', 'prototype', 'Textarea', 'clearTimeout', 'Infinity', - 'netscape', 'Radio', 'toolbar', 'close', 'innerHeight', 'Number', 'ref', 'top', 'closed', - 'innerWidth', 'Object', 'RegExp', 'toString', 'confirm', 'isFinite', 'onBlur', 'releaseEvents', - 'unescape', 'constructor', 'isNan', 'onError', 'Reset', 'untaint', 'Date', 'java', 'onFocus', - 'resizeBy', 'unwatch', 'defaultStatus', 'JavaArray', 'onLoad', 'resizeTo', 'valueOf', 'document', - 'JavaClass', 'onUnload', 'routeEvent', 'watch', 'Document', 'JavaObject', 'open', 'scroll', 'window', - 'Element', 'JavaPackage', 'opener', 'scrollbars', 'Window', 'escape', 'length', 'Option', 'scrollBy' - ] - ,'functions' : [ - // common functions for Window object - 'alert', 'Array', 'back', 'blur', 'clearInterval', 'close', 'confirm', 'eval ', 'focus', 'forward', 'home', - 'name', 'navigate', 'onblur', 'onerror', 'onfocus', 'onload', 'onmove', - 'onresize', 'onunload', 'open', 'print', 'prompt', 'scroll', 'scrollTo', 'setInterval', 'status', - 'stop' - ] - } - ,'OPERATORS' :[ - '+', '-', '/', '*', '=', '<', '>', '%', '!' - ] - ,'DELIMITERS' :[ - '(', ')', '[', ']', '{', '}' - ] - ,'STYLES' : { - 'COMMENTS': 'color: #AAAAAA;' - ,'QUOTESMARKS': 'color: #6381F8;' - ,'KEYWORDS' : { - 'statements' : 'color: #60CA00;' - ,'keywords' : 'color: #48BDDF;' - ,'functions' : 'color: #2B60FF;' - } - ,'OPERATORS' : 'color: #FF00FF;' - ,'DELIMITERS' : 'color: #0038E1;' - - } -}; diff --git a/plugins/LocalFilesEditor/editarea/reg_syntax/php.js b/plugins/LocalFilesEditor/editarea/reg_syntax/php.js index 535a22bd3..a1c5883af 100644 --- a/plugins/LocalFilesEditor/editarea/reg_syntax/php.js +++ b/plugins/LocalFilesEditor/editarea/reg_syntax/php.js @@ -11,7 +11,7 @@ editAreaLoader.load_syntax["php"] = { 'return', 'break', 'continue' ] ,'reserved' : [ - '_GET', '_POST', '_SERVER', '_FILES', '_ENV', '_COOKIE', '_REQUEST', + '_GET', '_POST', '_SESSION', '_SERVER', '_FILES', '_ENV', '_COOKIE', '_REQUEST', 'null', '__LINE__', '__FILE__', 'false', '<?php', '?>', '<?', '<script language', '</script>', @@ -72,4 +72,85 @@ editAreaLoader.load_syntax["php"] = { 'variables' : 'color: #E0BD54;' } } + ,'AUTO_COMPLETION' : { + "default": { // the name of this definition group. It's posisble to have different rules inside the same definition file + "REGEXP": { "before_word": "[^a-zA-Z0-9_]|^" // \\s|\\.| + ,"possible_words_letters": "[a-zA-Z0-9_\$]+" + ,"letter_after_word_must_match": "[^a-zA-Z0-9_]|$" + ,"prefix_separator": "\\-\\>|\\:\\:" + } + ,"CASE_SENSITIVE": true + ,"MAX_TEXT_LENGTH": 100 // the maximum length of the text being analyzed before the cursor position + ,"KEYWORDS": { + '': [ // the prefix of thoses items + /** + * 0 : the keyword the user is typing + * 1 : (optionnal) the string inserted in code ("{@}" being the new position of the cursor, "§" beeing the equivalent to the value the typed string indicated if the previous ) + * If empty the keyword will be displayed + * 2 : (optionnal) the text that appear in the suggestion box (if empty, the string to insert will be displayed) + */ + ['$_POST'] + ,['$_GET'] + ,['$_SESSION'] + ,['$_SERVER'] + ,['$_FILES'] + ,['$_ENV'] + ,['$_COOKIE'] + ,['$_REQUEST'] + // magic methods + ,['__construct', '§( {@} )'] + ,['__destruct', '§( {@} )'] + ,['__sleep', '§( {@} )'] + ,['__wakeup', '§( {@} )'] + ,['__toString', '§( {@} )'] + // include + ,['include', '§ "{@}";'] + ,['include_once', '§ "{@}";'] + ,['require', '§ "{@}";'] + ,['require_once', '§ "{@}";'] + // statements + ,['for', '§( {@} )'] + ,['foreach', '§( {@} )'] + ,['if', '§( {@} )'] + ,['elseif', '§( {@} )'] + ,['while', '§( {@} )'] + ,['switch', '§( {@} )'] + ,['break'] + ,['case'] + ,['continue'] + ,['do'] + ,['else'] + ,['endif'] + ,['endswitch'] + ,['endwhile'] + ,['return'] + // function + ,['unset', '§( {@} )'] + ] + } + } + ,"live": { + + // class NAME: /class\W+([a-z]+)\W+/gi + // method: /^(public|private|protected)?\s*function\s+([a-z][a-z0-9\_]*)\s*(\([^\{]*\))/gmi + // static: /^(public|private|protected)?\s+static\s+(public|private|protected)?\s*function\s+([a-z][a-z0-9\_]*)\s*(\([^\{]*\))/gmi + // attributes: /(\$this\-\>|(?:var|public|protected|private)\W+\$)([a-z0-9\_]+)(?!\()\b/gi + // v1 : /(\$this\-\>|var\W+|public\W+|protected\W+|private\W+)([a-z0-9\_]+)\W*(=|;)/gi + // var type: /(\$(this\-\>)?[a-z0-9\_]+)\s*\=\s*new\s+([a-z0-9\_])+/gi + + + "REGEXP": { "before_word": "[^a-zA-Z0-9_]|^" // \\s|\\.| + ,"possible_words_letters": "[a-zA-Z0-9_\$]+" + ,"letter_after_word_must_match": "[^a-zA-Z0-9_]|$" + ,"prefix_separator": "\\-\\>" + } + ,"CASE_SENSITIVE": true + ,"MAX_TEXT_LENGTH": 100 // the maximum length of the text being analyzed before the cursor position + ,"KEYWORDS": { + '$this': [ // the prefix of thoses items + ['test'] + ] + } + } + } }; diff --git a/plugins/LocalFilesEditor/editarea/reg_syntax/sql.js b/plugins/LocalFilesEditor/editarea/reg_syntax/sql.js deleted file mode 100644 index f4530a99c..000000000 --- a/plugins/LocalFilesEditor/editarea/reg_syntax/sql.js +++ /dev/null @@ -1,55 +0,0 @@ -editAreaLoader.load_syntax["sql"] = { - 'COMMENT_SINGLE' : {1 : '--'} - ,'COMMENT_MULTI' : {'/*' : '*/'} - ,'QUOTEMARKS' : {1: "'", 2: '"', 3: '`'} - ,'KEYWORD_CASE_SENSITIVE' : false - ,'KEYWORDS' : { - 'statements' : [ - 'select', 'SELECT', 'where', 'order', 'by', - 'insert', 'from', 'update', 'grant', 'left join', 'right join', - 'union', 'group', 'having', 'limit', 'alter', 'LIKE','IN','CASE' - ] - ,'reserved' : [ - 'null', 'enum', 'int', 'boolean', 'add', 'varchar' - - ] - ,'functions' : [ - 'ABS','ACOS','ADDDATE','ADDTIME','AES_DECRYPT','AES_ENCRYPT','ASCII','ASIN','ATAN2 ATAN','ATAN','AVG','BENCHMARK','DISTINCT','BIN','BIT_AND','BIT_COUNT','BIT_LENGTH','BIT_OR','BIT_XOR','CAST','CEILING CEIL','CHAR_LENGTH','CHAR', -'CHARACTER_LENGTH','CHARSET','COALESCE','COERCIBILITY','COLLATION','COMPRESS','CONCAT_WS','CONCAT','CONNECTION_ID','CONV','CONVERT_TZ','COS','COT','COUNT','CRC32','CURDATE','CURRENT_DATE','CURRENT_TIME','CURRENT_TIMESTAMP','CURRENT_USER','CURTIME','DATABASE','DATE_ADD','DATE_FORMAT','DATE_SUB','DATE','DATEDIFF','DAY','DAYNAME','DAYOFMONTH', -'DAYOFWEEK','DAYOFYEAR','DECODE','DEFAULT','DEGREES','DES_DECRYPT','DES_ENCRYPT','ELT','ENCODE','ENCRYPT','EXP','EXPORT_SET','EXTRACT','FIELD','FIND_IN_SET','FLOOR','FORMAT','FOUND_ROWS','FROM_DAYS','FROM_UNIXTIME','GET_FORMAT','GET_LOCK','GREATEST','GROUP_CONCAT','HEX','HOUR','IF','IFNULL','INET_ATON','INET_NTOA', -'INSERT','INSTR','INTERVAL','IS_FREE_LOCK','IS_USED_LOCK','ISNULL','LAST_DAY','LAST_INSERT_ID','LCASE','LEAST','LEFT','LENGTH','LN','LOAD_FILE','LOCALTIME','LOCALTIMESTAMP','LOCATE','LOG10','LOG2','LOG','LOWER','LPAD','LTRIM','MAKE_SET','MAKEDATE','MAKETIME','MASTER_POS_WAIT','MAX','MD5','MICROSECOND', -'MID','MIN','MINUTE','MOD','MONTH','MONTHNAME','NOW','NULLIF','OCT','OCTET_LENGTH','OLD_PASSWORD','ORD','PASSWORD','PERIOD_ADD','PERIOD_DIFF','PI','POSITION','POW','POWER','PROCEDURE ANALYSE','QUARTER','QUOTE','RADIANS','RAND','RELEASE_LOCK','REPEAT','REPLACE','REVERSE','RIGHT','ROUND', -'RPAD','RTRIM','SEC_TO_TIME','SECOND','SESSION_USER','SHA1','SHA','SIGN','SIN','SOUNDEX','SOUNDS LIKE','SPACE','SQRT','STD','STDDEV','STR_TO_DATE','STRCMP','SUBDATE','SUBSTRING_INDEX','SUBSTRING','SUBSTR','SUBTIME','SUM','SYSDATE','SYSTEM_USER','TAN','TIME_FORMAT','TIME_TO_SEC','TIME','TIMEDIFF', -'TIMESTAMP','TO_DAYS','TRIM','TRUNCATE','UCASE','UNCOMPRESS','UNCOMPRESSED_LENGTH','UNHEX','UNIX_TIMESTAMP','UPPER','USER','UTC_DATE','UTC_TIME','UTC_TIMESTAMP','UUID','VALUES','VARIANCE','WEEK','WEEKDAY','WEEKOFYEAR','YEAR','YEARWEEK' - ] - } - ,'OPERATORS' :[ - 'AND','&&','BETWEEN','BINARY','&','|','^','/','DIV','<=>','=','>=','>','<<','>>','IS','NULL','<=','<','-','%','!=','<>','!','||','OR','+','REGEXP','RLIKE','XOR','~','*' - ] - ,'DELIMITERS' :[ - '(', ')', '[', ']', '{', '}' - ] - ,'REGEXPS' : { - // highlight all variables (@...) - 'variables' : { - 'search' : '()(\\@\\w+)()' - ,'class' : 'variables' - ,'modifiers' : 'g' - ,'execute' : 'before' // before or after - } - } - ,'STYLES' : { - 'COMMENTS': 'color: #AAAAAA;' - ,'QUOTESMARKS': 'color: #879EFA;' - ,'KEYWORDS' : { - 'reserved' : 'color: #48BDDF;' - ,'functions' : 'color: #0040FD;' - ,'statements' : 'color: #60CA00;' - } - ,'OPERATORS' : 'color: #FF00FF;' - ,'DELIMITERS' : 'color: #2B60FF;' - ,'REGEXPS' : { - 'variables' : 'color: #E0BD54;' - } - } -}; diff --git a/plugins/LocalFilesEditor/editarea/reg_syntax/xml.js b/plugins/LocalFilesEditor/editarea/reg_syntax/xml.js deleted file mode 100644 index a043dd63a..000000000 --- a/plugins/LocalFilesEditor/editarea/reg_syntax/xml.js +++ /dev/null @@ -1,56 +0,0 @@ -/* -* last update: 2006-08-24 -*/ - -editAreaLoader.load_syntax["xml"] = { - 'COMMENT_SINGLE' : {} - ,'COMMENT_MULTI' : {''} - ,'QUOTEMARKS' : {1: "'", 2: '"'} - ,'KEYWORD_CASE_SENSITIVE' : false - ,'KEYWORDS' : { - } - ,'OPERATORS' :[ - ] - ,'DELIMITERS' :[ - ] - ,'REGEXPS' : { - 'xml' : { - 'search' : '()(<\\?[^>]*?\\?>)()' - ,'class' : 'xml' - ,'modifiers' : 'g' - ,'execute' : 'before' // before or after - } - ,'cdatas' : { - 'search' : '()()()' - ,'class' : 'cdata' - ,'modifiers' : 'g' - ,'execute' : 'before' // before or after - } - ,'tags' : { - 'search' : '(<)(/?[a-z][^ \r\n\t>]*)([^>]*>)' - ,'class' : 'tags' - ,'modifiers' : 'gi' - ,'execute' : 'before' // before or after - } - ,'attributes' : { - 'search' : '( |\n|\r|\t)([^ \r\n\t=]+)(=)' - ,'class' : 'attributes' - ,'modifiers' : 'g' - ,'execute' : 'before' // before or after - } - } - ,'STYLES' : { - 'COMMENTS': 'color: #AAAAAA;' - ,'QUOTESMARKS': 'color: #6381F8;' - ,'KEYWORDS' : { - } - ,'OPERATORS' : 'color: #E775F0;' - ,'DELIMITERS' : '' - ,'REGEXPS' : { - 'attributes': 'color: #B1AC41;' - ,'tags': 'color: #E62253;' - ,'xml': 'color: #8DCFB5;' - ,'cdata': 'color: #50B020;' - } - } -}; -- cgit v1.2.3