aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/LocalFilesEditor/editarea/reg_syntax
diff options
context:
space:
mode:
authorpatdenice <patdenice@piwigo.org>2008-09-25 17:46:27 +0000
committerpatdenice <patdenice@piwigo.org>2008-09-25 17:46:27 +0000
commit1eb3d18ae24a221037a44d662439d50c74e6fe9f (patch)
treebad9aae88920126457aeadf09a7a9ec55242977b /plugins/LocalFilesEditor/editarea/reg_syntax
parentfd0b26af453fedf4528eaf4114914a6e5b7bc685 (diff)
- 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
Diffstat (limited to 'plugins/LocalFilesEditor/editarea/reg_syntax')
-rw-r--r--plugins/LocalFilesEditor/editarea/reg_syntax/html.js5
-rw-r--r--plugins/LocalFilesEditor/editarea/reg_syntax/js.js60
-rw-r--r--plugins/LocalFilesEditor/editarea/reg_syntax/php.js83
-rw-r--r--plugins/LocalFilesEditor/editarea/reg_syntax/sql.js55
-rw-r--r--plugins/LocalFilesEditor/editarea/reg_syntax/xml.js56
5 files changed, 86 insertions, 173 deletions
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', '&lt;?php', '?&gt;', '&lt;?',
'&lt;script language', '&lt;/script&gt;',
@@ -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' : '()(<!\\[CDATA\\[.*?\\]\\]>)()'
- ,'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;'
- }
- }
-};