From jvloothuis at codespeak.net Fri Jun 1 22:15:37 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Fri, 1 Jun 2007 22:15:37 +0200 (CEST) Subject: [KSS-checkins] r43980 - kukit/euro-python-2007 Message-ID: <20070601201537.AD2AB8067@code0.codespeak.net> Author: jvloothuis Date: Fri Jun 1 22:15:36 2007 New Revision: 43980 Added: kukit/euro-python-2007/EXTERNALS.txt - copied unchanged from r43810, kukit/euro-python-2007/staticdemo/EXTERNALS.txt kukit/euro-python-2007/demo.kss - copied unchanged from r43810, kukit/euro-python-2007/staticdemo/demo.kss kukit/euro-python-2007/photo.jpg - copied unchanged from r43810, kukit/euro-python-2007/staticdemo/photo.jpg kukit/euro-python-2007/static-demo.html - copied unchanged from r43810, kukit/euro-python-2007/staticdemo/index.html Modified: kukit/euro-python-2007/ (props changed) Log: Moved demo to parent folder, this is where all the HTML will be From jvloothuis at codespeak.net Fri Jun 1 22:16:43 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Fri, 1 Jun 2007 22:16:43 +0200 (CEST) Subject: [KSS-checkins] r43981 - in kukit/euro-python-2007: . languages Message-ID: <20070601201643.A1A8C8081@code0.codespeak.net> Author: jvloothuis Date: Fri Jun 1 22:16:43 2007 New Revision: 43981 Added: kukit/euro-python-2007/basic-workings.html kukit/euro-python-2007/highlight.js kukit/euro-python-2007/index.html kukit/euro-python-2007/languages/ kukit/euro-python-2007/presentation.css Log: Start of more info on how KSS works Added: kukit/euro-python-2007/basic-workings.html ============================================================================== --- (empty file) +++ kukit/euro-python-2007/basic-workings.html Fri Jun 1 22:16:43 2007 @@ -0,0 +1,38 @@ + + + + KSS, doing Ajax with style + + + + + + + + + +
+

Basic Workings

+
+ KSS Files +
+
+ KSS Commands +

+kukit.actionsGlobalRegistry.register('setStyle', function(oper) {
+    oper.completeParms(['name', 'value'], {}, 'setStyle action');
+    oper.node.style[oper.parms.name] = oper.parms.value;
+});
+kukit.commandsGlobalRegistry.registerFromAction('setStyle', kukit.cr.makeSelectorCommand);
+	
+ +
+
+ Event Binder +
+
+ + Added: kukit/euro-python-2007/highlight.js ============================================================================== --- (empty file) +++ kukit/euro-python-2007/highlight.js Fri Jun 1 22:16:43 2007 @@ -0,0 +1,404 @@ +/* +Syntax highlighting with language autodetection. +http://softwaremaniacs.org/soft/highlight/ +*/ + +var DEFAULT_LANGUAGES = ['python', 'ruby', 'perl', 'php', 'css', 'html', 'django', 'javascript', 'java', 'cpp', 'sql', 'smalltalk']; +var ALL_LANGUAGES = (DEFAULT_LANGUAGES.join(',') + ',' + ['1c', 'axapta', 'delphi', 'rib', 'rsl', 'vbscript'].join(',')).split(','); +var LANGUAGE_GROUPS = { + 'html': 'html', + 'css': 'html', + 'django': 'html' +} + +var IDENT_RE = '[a-zA-Z][a-zA-Z0-9_]*'; +var UNDERSCORE_IDENT_RE = '[a-zA-Z_][a-zA-Z0-9_]*'; +var NUMBER_RE = '\\b\\d+(\\.\\d+)?'; +var C_NUMBER_RE = '\\b(0x[A-Za-z0-9]+|\\d+(\\.\\d+)?)'; + +// Common modes +var APOS_STRING_MODE = { + className: 'string', + begin: '\'', end: '\'', + contains: ['escape'], + relevance: 0 +} +var QUOTE_STRING_MODE = { + className: 'string', + begin: '"', end: '"', + contains: ['escape'], + relevance: 0 +} +var BACKSLASH_ESCAPE = { + className: 'escape', + begin: '\\\\.', end: '^', + relevance: 0 +} +var C_LINE_COMMENT_MODE = { + className: 'comment', + begin: '//', end: '$', + relevance: 0 +} +var C_BLOCK_COMMENT_MODE = { + className: 'comment', + begin: '/\\*', end: '\\*/' +} +var HASH_COMMENT_MODE = { + className: 'comment', + begin: '#', end: '$' +} +var C_NUMBER_MODE = { + className: 'number', + begin: C_NUMBER_RE, end: '^', + relevance: 0 +} + +var LANGUAGES = {} +var selected_languages = {}; + +function Highlighter(language_name, value) { + currentMode = function(){ + return modes[modes.length - 1]; + }//currentMode + + function subMode(lexem) { + if (!currentMode().contains) + return null; + for (var key in language.modes) + if (contains(currentMode().contains, language.modes[key].className) && language.modes[key].beginRe.test(lexem)) + return language.modes[key]; + return null; + }//subMode + + function endOfMode(mode_index, lexem) { + if (modes[mode_index].end && modes[mode_index].endRe.test(lexem)) + return 1; + if (modes[mode_index].endsWithParent) { + var level = endOfMode(mode_index - 1, lexem); + return level ? level + 1 : 0; + }//if + return 0; + }//endOfMode + + function isIllegal(lexem) { + if (!currentMode().illegalRe) + return false; + return currentMode().illegalRe.test(lexem); + }//isIllegal + + function eatModeChunk(value, index) { + if (!currentMode().terminators) { + var terminators = []; + + if (currentMode().contains) + for (var key in language.modes) { + if (contains(currentMode().contains, language.modes[key].className) && + !contains(terminators, language.modes[key].begin)) + terminators[terminators.length] = language.modes[key].begin; + }//for + + var mode_index = modes.length - 1; + do { + if (modes[mode_index].end && !contains(terminators, modes[mode_index].end)) + terminators[terminators.length] = modes[mode_index].end; + mode_index--; + } while (modes[mode_index + 1].endsWithParent); + + if (currentMode().illegal) + if (!contains(terminators, currentMode().illegal)) + terminators[terminators.length] = currentMode().illegal; + + var terminator_re = '(' + terminators[0]; + for (var i = 0; i < terminators.length; i++) + terminator_re += '|' + terminators[i]; + terminator_re += ')'; + currentMode().terminators = langRe(language, terminator_re); + }//if + value = value.substr(index); + var match = currentMode().terminators.exec(value); + if (!match) + return [value, '', true]; + if (match.index == 0) + return ['', match[0], false]; + else + return [value.substr(0, match.index), match[0], false]; + }//eatModeChunk + + function escape(value) { + return value.replace(/&/gm, '&').replace(//gm, '>'); + }//escape + + function keywordMatch(mode, match) { + if (!mode.keywordGroups) { + for (var key in mode.keywords) { + if (mode.keywords[key] instanceof Object) + mode.keywordGroups = mode.keywords; + else + mode.keywordGroups = {'keyword': mode.keywords}; + break; + }//for + }//if + for (var className in mode.keywordGroups) { + var value = mode.keywordGroups[className][language.case_insensitive ? match[0].toLowerCase() : match[0]]; + if (value) + return [className, value]; + }//for + return false; + }//keywordMatch + + function processKeywords(buffer) { + var mode = currentMode(); + if (!mode.keywords || !mode.lexems) + return escape(buffer); + if (!mode.lexemsRe) { + var lexems = []; + for (var key in mode.lexems) + if (!contains(lexems, mode.lexems[key])) + lexems[lexems.length] = mode.lexems[key]; + var lexems_re = '(' + lexems[0]; + for (var i = 1; i < lexems.length; i++) + lexems_re += '|' + lexems[i]; + lexems_re += ')'; + mode.lexemsRe = langRe(language, lexems_re, true); + }//if + var result = ''; + var last_index = 0; + mode.lexemsRe.lastIndex = 0; + var match = mode.lexemsRe.exec(buffer); + while (match) { + result += escape(buffer.substr(last_index, match.index - last_index)); + keyword_match = keywordMatch(mode, match); + if (keyword_match) { + keyword_count += keyword_match[1]; + result += '' + escape(match[0]) + ''; + } else { + result += escape(match[0]); + }//if + last_index = mode.lexemsRe.lastIndex; + match = mode.lexemsRe.exec(buffer); + }//while + result += escape(buffer.substr(last_index, buffer.length - last_index)); + return result; + }//processKeywords + + function processModeInfo(buffer, lexem, end) { + if (end) { + result += processKeywords(currentMode().buffer + buffer); + return; + }//if + if (isIllegal(lexem)) + throw 'Illegal'; + var new_mode = subMode(lexem); + if (new_mode) { + currentMode().buffer += buffer; + result += processKeywords(currentMode().buffer); + if (new_mode.excludeBegin) { + result += lexem + ''; + new_mode.buffer = ''; + } else { + result += ''; + new_mode.buffer = lexem; + }//if + modes[modes.length] = new_mode; + relevance += currentMode().relevance != undefined ? currentMode().relevance : 1; + return; + }//if + var end_level = endOfMode(modes.length - 1, lexem); + if (end_level) { + currentMode().buffer += buffer; + if (currentMode().excludeEnd) { + result += processKeywords(currentMode().buffer) + '' + lexem; + } else { + result += processKeywords(currentMode().buffer + lexem) + ''; + } + while (end_level > 1) { + result += ''; + end_level--; + modes.length--; + }//while + modes.length--; + currentMode().buffer = ''; + return; + }//if + }//processModeInfo + + function highlight(value) { + var index = 0; + language.defaultMode.buffer = ''; + do { + var mode_info = eatModeChunk(value, index); + processModeInfo(mode_info[0], mode_info[1], mode_info[2]); + index += mode_info[0].length + mode_info[1].length; + } while (!mode_info[2]); + if(modes.length > 1) + throw 'Illegal'; + }//highlight + + this.language_name = language_name; + var language = LANGUAGES[language_name]; + var modes = [language.defaultMode]; + var relevance = 0; + var keyword_count = 0; + var result = ''; + try { + highlight(value); + this.relevance = relevance; + this.keyword_count = keyword_count; + this.result = result; + } catch (e) { + if (e == 'Illegal') { + this.relevance = 0; + this.keyword_count = 0; + this.result = escape(value); + } else { + throw e; + }//if + }//try +}//Highlighter + +function contains(array, item) { + if (!array) + return false; + for (var key in array) + if (array[key] == item) + return true; + return false; +}//contains + +function blockText(block) { + var result = ''; + for (var i = 0; i < block.childNodes.length; i++) + if (block.childNodes[i].nodeType == 3) + result += block.childNodes[i].nodeValue; + else if (block.childNodes[i].nodeName == 'BR') + result += '\n'; + else + throw 'Complex markup'; + return result; +}//blockText + +function initHighlight(block) { + if (block.className.search(/\bno\-highlight\b/) != -1) + return; + try { + blockText(block); + } catch (e) { + if (e == 'Complex markup') + return; + }//try + var classes = block.className.split(/\s+/); + for (var i = 0; i < classes.length; i++) { + if (LANGUAGES[classes[i]]) { + highlightLanguage(block, classes[i]); + return; + }//if + }//for + highlightAuto(block); +}//initHighlight + +function highlightLanguage(block, language) { + var highlight = new Highlighter(language, blockText(block)); + // See these 4 lines? This is IE's notion of "block.innerHTML = result". Love this browser :-/ + var container = document.createElement('div'); + container.innerHTML = '
' + highlight.result + '
'; + var environment = block.parentNode.parentNode; + environment.replaceChild(container.firstChild, block.parentNode); +}//highlightLanguage + +function highlightAuto(block) { + var result = null; + var language = ''; + var max_relevance = 2; + var relevance = 0; + var block_text = blockText(block); + for (var key in selected_languages) { + var highlight = new Highlighter(key, block_text); + relevance = highlight.keyword_count + highlight.relevance; + if (relevance > max_relevance) { + max_relevance = relevance; + result = highlight; + }//if + }//for + + if(result) { + // See these 4 lines? This is IE's notion of "block.innerHTML = result". Love this browser :-/ + var container = document.createElement('div'); + container.innerHTML = '
' + result.result + '
'; + var environment = block.parentNode.parentNode; + environment.replaceChild(container.firstChild, block.parentNode); + }//if +}//highlightAuto + +function langRe(language, value, global) { + var mode = 'm' + (language.case_insensitive ? 'i' : '') + (global ? 'g' : ''); + return new RegExp(value, mode); +}//re + +function compileRes() { + for (var i in LANGUAGES) { + var language = LANGUAGES[i]; + for (var key in language.modes) { + if (language.modes[key].begin) + language.modes[key].beginRe = langRe(language, '^' + language.modes[key].begin); + if (language.modes[key].end) + language.modes[key].endRe = langRe(language, '^' + language.modes[key].end); + if (language.modes[key].illegal) + language.modes[key].illegalRe = langRe(language, '^(?:' + language.modes[key].illegal + ')'); + language.defaultMode.illegalRe = langRe(language, '^(?:' + language.defaultMode.illegal + ')'); + }//for + }//for +}//compileRes + +function initHighlighting() { + if (initHighlighting.called) + return; + initHighlighting.called = true; + compileRes(); + if (arguments.length) { + for (var i = 0; i < arguments.length; i++) { + if (LANGUAGES[arguments[i]]) { + selected_languages[arguments[i]] = LANGUAGES[arguments[i]]; + }//if + }//for + } else + selected_languages = LANGUAGES; + var pres = document.getElementsByTagName('pre'); + for (var i = 0; i < pres.length; i++) { + if (pres[i].firstChild && pres[i].firstChild.nodeName == 'CODE') + initHighlight(pres[i].firstChild); + }//for +}//initHighlighting + +function injectScripts(languages) { + var scripts = document.getElementsByTagName('SCRIPT'); + for (var i=0; i < scripts.length; i++) { + if (scripts[i].src.match(/highlight\.js$/)) { + var path = scripts[i].src.replace(/highlight\.js$/, ''); + break; + }//if + }//for + if (languages.length == 0) { + languages = DEFAULT_LANGUAGES; + }//if + var injected = {} + for (var i=0; i < languages.length; i++) { + var filename = LANGUAGE_GROUPS[languages[i]] ? LANGUAGE_GROUPS[languages[i]] : languages[i]; + if (!injected[filename]) { + document.write(''); + injected[filename] = true; + }//if + }//for +}//injectScripts + +function initHighlightingOnLoad() { + var original_arguments = arguments; + injectScripts(arguments); + var handler = function(){initHighlighting.apply(null, original_arguments)}; + if (window.addEventListener) { + window.addEventListener('DOMContentLoaded', handler, false); + window.addEventListener('load', handler, false); + } else if (window.attachEvent) + window.attachEvent('onload', handler); + else + window.onload = handler; +}//initHighlightingOnLoad \ No newline at end of file Added: kukit/euro-python-2007/index.html ============================================================================== --- (empty file) +++ kukit/euro-python-2007/index.html Fri Jun 1 22:16:43 2007 @@ -0,0 +1,38 @@ + + + + KSS, doing Ajax with style + + + + + + + + + + + + + + + + + + + + + + + + + +
+

KSS, doing Ajax with style

+

Presented by: Jeroen Vloothuis

+ + Start the show! +
+ + Added: kukit/euro-python-2007/presentation.css ============================================================================== --- (empty file) +++ kukit/euro-python-2007/presentation.css Fri Jun 1 22:16:43 2007 @@ -0,0 +1,72 @@ +?/* +You can use this file as is or as a starting point for you own styling +*/ + +pre code[class]:after { + content: 'highlight: ' attr(class); + display: block; text-align: right; + font-size: smaller; + color: #CCC; background: white; + border-top: solid 1px; + padding-top: 0.5em; +} + +pre code { + display: block; + background: #F0F0F0; +} + +pre code, +.ruby .subst { + color: black; +} + +.string, +.function .title, +.class .title, +.tag .attribute .value, +.css .rules .value, +.preprocessor, +.ruby .symbol, +.built_in, +.sql .aggregate, +.django .template_tag, +.django .variable, +.smalltalk .class { + color: #800; +} + +.comment, +.java .annotation, +.template_comment { + color: #888; +} + +.number, +.regexp, +.javascript .literal, +.smalltalk .symbol, +.smalltalk .char { + color: #080; +} + +.javadoc, +.ruby .string, +.python .decorator, +.django .filter .argument, +.smalltalk .localvars, +.smalltalk .array { + color: #88F; +} + +.keyword, +.css .id, +.phpdoc, +.function .title, +.class .title, +.vbscript .built_in, +.sql .aggregate, +.rsl .built_in, +.smalltalk .class { + font-weight: bold; +} \ No newline at end of file From jvloothuis at codespeak.net Fri Jun 1 22:59:10 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Fri, 1 Jun 2007 22:59:10 +0200 (CEST) Subject: [KSS-checkins] r43984 - in kukit/euro-python-2007: . languages Message-ID: <20070601205910.E2B3D8091@code0.codespeak.net> Author: jvloothuis Date: Fri Jun 1 22:59:10 2007 New Revision: 43984 Added: kukit/euro-python-2007/languages/1c.js kukit/euro-python-2007/languages/axapta.js kukit/euro-python-2007/languages/cpp.js kukit/euro-python-2007/languages/delphi.js kukit/euro-python-2007/languages/html.js kukit/euro-python-2007/languages/java.js kukit/euro-python-2007/languages/javascript.js kukit/euro-python-2007/languages/perl.js kukit/euro-python-2007/languages/php.js kukit/euro-python-2007/languages/python.js kukit/euro-python-2007/languages/rib.js kukit/euro-python-2007/languages/rsl.js kukit/euro-python-2007/languages/ruby.js kukit/euro-python-2007/languages/smalltalk.js kukit/euro-python-2007/languages/sql.js kukit/euro-python-2007/languages/vbscript.js kukit/euro-python-2007/presentation.kss Modified: kukit/euro-python-2007/basic-workings.html kukit/euro-python-2007/presentation.css Log: Made slide on the basics workings more complete Modified: kukit/euro-python-2007/basic-workings.html ============================================================================== --- kukit/euro-python-2007/basic-workings.html (original) +++ kukit/euro-python-2007/basic-workings.html Fri Jun 1 22:59:10 2007 @@ -6,8 +6,29 @@ + + + + + + + + + + + + + + + + + + + + + @@ -16,22 +37,58 @@

Basic Workings

-
- KSS Files +
+ KSS Files +
- KSS Commands -

+	KSS Commands
+	
+
-
- Event Binder +
+ KSS runtime +
+ +
+

KSS consist of a few important pieces. The diagram above + shows three layers. At the top you can see the KSS file + layer. This represents the actual KSS files.

+ +

Next is the command layer. This represents all available + commands in the KSS system. This is also the point where you + can extend KSS to create your own command's.

+ +

An example KSS command in show which alters the style + property of a node. Notice how the plugin is registered using + the command registry API.

+ +

You can also see that a command is defined using + Javascript. In this example you can see it is pretty straight + forware to get the arguments and the node on which to + operate.

+ +

The last piece of the puzzle is the KSS runtime. This code + is responsible for loading and parsing the KSS. It will then + bind the events to the DOM etc.

+
Added: kukit/euro-python-2007/languages/1c.js ============================================================================== --- (empty file) +++ kukit/euro-python-2007/languages/1c.js Fri Jun 1 22:59:10 2007 @@ -0,0 +1,84 @@ +var IDENT_RE_RU = '[a-zA-Z?-??-?][a-zA-Z0-9_?-??-?]*'; +var NUMBER_RE = '\\b\\d+(\\.\\d+)?'; + +var OneS_KEYWORDS = {'?????????':1,'???????':1,'???????':1,'?????':1,'????????????':1,'??????????????':1,'????':1,'?????':1,'?????':1,'?????????':1,'?????????':1,'???????':1,'??????????':1,'????????????':1,'????':1,'??????':1,'????????????':1,'?':1,'???':1,'??':1,'null':1,'???':1,'???????':1,'??':1,'??':1,'????':1,'??????????':1}; + +LANGUAGES['1c'] = { + defaultMode: { + lexems: [IDENT_RE_RU], + contains: ['comment', 'string', 'function', 'preprocessor', 'number'], + keywords: OneS_KEYWORDS + }, + case_insensitive: true, + modes: [ + C_LINE_COMMENT_MODE, + { + className: 'string', + begin: '"', end: '"', + contains: ['dquote'], + relevance: 0 + }, + { + className: 'string', + begin: '"', end: '$', + contains: ['dquote'] + }, + { + className: 'string', + begin: '\\|', end: '$', + contains: ['dquote'] + }, + { + className: 'string', + begin: '\\|', end: '"', + contains: ['dquote'] + }, + { + className: 'dquote', + begin: '""', end: '^' + }, + { + className: 'number', + begin: NUMBER_RE, end: '^', + relevance: 0 + }, + { + className: 'title', + lexems: [IDENT_RE_RU], + begin: IDENT_RE_RU, end: '^' + }, + { + className: 'params', + begin: '\\(', end: '\\)', + lexems: [IDENT_RE_RU], + keywords: {'????':1}, + contains: ['string'] + }, + { + className: 'function', + begin: '(?????????|???????)', end: '$', + lexems: [IDENT_RE_RU], + keywords: {'?????????': 1, '???????':1, '???????': 1}, + contains: ['title','tail','comment'], + relevance: 0 + }, + { + className: 'tail', + begin: '^', endsWithParent: true, + lexems: [IDENT_RE_RU], + contains: ['params', 'export'] + }, + { + className: 'export', + begin: '???????', endsWithParent: true, + lexems: [IDENT_RE_RU], + keywords: {'???????': 1}, + contains: ['comment'] + }, + { + className: 'preprocessor', + begin: '#', end: '$', + lexems: [IDENT_RE_RU] + } + ] +};//1c \ No newline at end of file Added: kukit/euro-python-2007/languages/axapta.js ============================================================================== --- (empty file) +++ kukit/euro-python-2007/languages/axapta.js Fri Jun 1 22:59:10 2007 @@ -0,0 +1,52 @@ +/* + +Axapta definition (?) Dmitri Roudakov + +*/ +LANGUAGES.axapta = { + defaultMode: { + lexems: [UNDERSCORE_IDENT_RE], + contains: ['comment', 'string', 'class', 'number', 'preprocessor'], + keywords: {'false': 1, 'int': 1, 'abstract': 1, 'private': 1, 'char': 1, 'interface': 1, 'boolean': 1, 'static': 1, 'null': 1, 'if': 1, 'for': 1, 'true': 1, 'while': 1, 'long': 1, 'throw': 1, 'finally': 1, 'protected': 1, 'extends': 1, 'final': 1, 'implements': 1, 'return': 1, 'void': 1, 'enum': 1, 'else': 1, 'break': 1, 'new': 1, 'catch': 1, 'byte': 1, 'super': 1, 'class': 1, 'case': 1, 'short': 1, 'default': 1, 'double': 1, 'public': 1, 'try': 1, 'this': 1, 'switch': 1, 'continue': 1, + 'reverse':1, 'firstfast':1,'firstonly':1,'forupdate':1,'nofetch':1, 'sum':1, 'avg':1, 'minof':1, 'maxof':1, 'count':1, 'order':1, 'group':1, 'by':1, 'asc':1, 'desc':1, 'index':1, 'hint':1, 'like':1, + 'dispaly':1, 'edit':1, 'client':1, 'server':1, 'ttsbegin':1, 'ttscommit':1, + 'str':1, 'real':1, 'date':1, 'container':1, 'anytype':1, 'common':1, 'div':1,'mod':1 + } + }, + modes: [ + { + className: 'class', + lexems: [UNDERSCORE_IDENT_RE], + begin: '(class |interface )', end: '{', + illegal: ':', + keywords: {'class': 1, 'interface': 1}, + contains: ['inheritance', 'title'] + }, + { + className: 'inheritance', + begin: '(implements|extends)', end: '^', + lexems: [IDENT_RE], + keywords: {'extends': 1, 'implements': 1}, + relevance: 10 + }, + { + className: 'title', + begin: UNDERSCORE_IDENT_RE, end: '^' + }, + { + className: 'params', + begin: '\\(', end: '\\)', + contains: ['string', 'annotation'] + }, + C_NUMBER_MODE, + APOS_STRING_MODE, + QUOTE_STRING_MODE, + BACKSLASH_ESCAPE, + C_LINE_COMMENT_MODE, + C_BLOCK_COMMENT_MODE, + { + className: 'preprocessor', + begin: '#', end: '$' + } + ] +};//axapta \ No newline at end of file Added: kukit/euro-python-2007/languages/cpp.js ============================================================================== --- (empty file) +++ kukit/euro-python-2007/languages/cpp.js Fri Jun 1 22:59:10 2007 @@ -0,0 +1,24 @@ +LANGUAGES.cpp = { + defaultMode: { + lexems: [UNDERSCORE_IDENT_RE], + illegal: '' +}; +var HTML_DOCTYPE = { + className: 'doctype', + begin: '', + relevance: 10 +}; +var HTML_ATTR1 = { + className: 'attribute', + begin: ' [a-zA-Z]+=', end: '^', + contains: ['value'] +}; +var HTML_ATTR2 = { + className: 'attribute', + begin: ' [a-zA-Z]+', end: '^' +}; +var HTML_VALUE2 = { + className: 'value', + begin: '[a-zA-Z0-9]+', end: '^' +}; + +LANGUAGES.html = { + defaultMode: { + contains: ['tag', 'comment', 'doctype'] + }, + case_insensitive: true, + modes: [ + HTML_COMMENT, + HTML_DOCTYPE, + { + className: 'tag', + lexems: [IDENT_RE], + keywords: HTML_TAGS, + begin: '<[A-Za-z/]', end: '>', + contains: ['attribute'], + illegal: '[\\+\\.]' + }, + HTML_ATTR1, + HTML_ATTR2, + { + className: 'value', + begin: '"', end: '"' + }, + HTML_VALUE2 + ] +};//html + +LANGUAGES.css = { + defaultMode: { + contains: ['id', 'class', 'attr_selector', 'rules', 'comment'], + keywords: HTML_TAGS, + lexems: [IDENT_RE], + illegal: '=' + }, + case_insensitive: true, + modes: [ + { + className: 'id', + begin: '\\#[A-Za-z0-9_-]+', end: '^' + }, + { + className: 'class', + begin: '\\.[A-Za-z0-9_-]+', end: '^', + relevance: 0 + }, + { + className: 'attr_selector', + begin: '\\[', end: '\\]', + illegal: '$' + }, + { + className: 'rules', + begin: '{', end: '}', + lexems: ['[A-Za-z-]+'], + keywords: {'play-during': 1, 'counter-reset': 1, 'counter-increment': 1, 'min-height': 1, 'quotes': 1, 'border-top': 1, 'pitch': 1, 'font': 1, 'pause': 1, 'list-style-image': 1, 'border-width': 1, 'cue': 1, 'outline-width': 1, 'border-left': 1, 'elevation': 1, 'richness': 1, 'speech-rate': 1, 'border-bottom': 1, 'border-spacing': 1, 'background': 1, 'list-style-type': 1, 'text-align': 1, 'page-break-inside': 1, 'orphans': 1, 'page-break-before': 1, 'text-transform': 1, 'line-height': 1, 'padding-left': 1, 'font-size': 1, 'right': 1, 'word-spacing': 1, 'padding-top': 1, 'outline-style': 1, 'bottom': 1, 'content': 1, 'border-right-style': 1, 'padding-right': 1, 'border-left-style': 1, 'voice-family': 1, 'background-color': 1, 'border-bottom-color': 1, 'outline-color': 1, 'unicode-bidi': 1, 'max-width': 1, 'font-family': 1, 'caption-side': 1, 'border-right-width': 1, 'pause-before': 1, 'border-top-style': 1, 'color': 1, 'border-collapse': 1, 'border-bottom-width': 1, 'float': 1, 'height': 1, 'max-height': 1, 'margin-right': 1, 'border-top-width': 1, 'speak': 1, 'speak-header': 1, 'top': 1, 'cue-before': 1, 'min-width': 1, 'width': 1, 'font-variant': 1, 'border-top-color': 1, 'background-position': 1, 'empty-cells': 1, 'direction': 1, 'border-right': 1, 'visibility': 1, 'padding': 1, 'border-style': 1, 'background-attachment': 1, 'overflow': 1, 'border-bottom-style': 1, 'cursor': 1, 'margin': 1, 'display': 1, 'border-left-width': 1, 'letter-spacing': 1, 'vertical-align': 1, 'clip': 1, 'border-color': 1, 'list-style': 1, 'padding-bottom': 1, 'pause-after': 1, 'speak-numeral': 1, 'margin-left': 1, 'widows': 1, 'border': 1, 'font-style': 1, 'border-left-color': 1, 'pitch-range': 1, 'background-repeat': 1, 'table-layout': 1, 'margin-bottom': 1, 'speak-punctuation': 1, 'font-weight': 1, 'border-right-color': 1, 'page-break-after': 1, 'position': 1, 'white-space': 1, 'text-indent': 1, 'background-image': 1, 'volume': 1, 'stress': 1, 'outline': 1, 'clear': 1, 'z-index': 1, 'text-decoration': 1, 'margin-top': 1, 'azimuth': 1, 'cue-after': 1, 'left': 1, 'list-style-position': 1}, + contains: ['comment', 'value'] + }, + C_BLOCK_COMMENT_MODE, + { + className: 'value', + begin: ':', end: ';', endsWithParent: true, + excludeBegin: true, excludeEnd: true + } + ] +};//css + +LANGUAGES.django = { + defaultMode: { + contains: ['tag', 'comment', 'doctype', 'template_tag', 'variable', 'template_comment'] + }, + case_insensitive: true, + modes: [ + HTML_COMMENT, + HTML_DOCTYPE, + { + className: 'tag', + lexems: [IDENT_RE], + keywords: HTML_TAGS, + begin: '<[A-Za-z/]', end: '>', + contains: ['attribute', 'template_tag', 'variable', 'template_comment'] + }, + HTML_ATTR1, + HTML_ATTR2, + { + className: 'value', + begin: '"', end: '"', + contains: ['template_tag', 'variable', 'template_comment'] + }, + HTML_VALUE2, + { + className: 'template_comment', + begin: '\\{%\\s*comment\\s*%\\}', end: '\\{%\\s*endcomment\\s*%\\}' + }, + { + className: 'template_comment', + begin: '\\{#', end: '#\\}' + }, + { + className: 'template_tag', + begin: '\\{\\%', end: '\\%\\}', + lexems: [IDENT_RE], + keywords: {'comment': 1, 'endcomment': 1, 'load': 1, 'templatetag': 1, 'ifchanged': 1, 'endifchanged': 1, 'if': 1, 'endif': 1, 'firstof': 1, 'for': 1, 'endfor': 1, 'in': 1, 'ifnotequal': 1, 'endifnotequal': 1, 'widthratio': 1, 'extends': 1, 'include': 1, 'spaceless': 1, 'endspaceless': 1, 'regroup': 1, 'by': 1, 'as': 1, 'ifequal': 1, 'endifequal': 1, 'ssi': 1, 'now': 1, 'with': 1, 'cycle': 1, 'url': 1, 'filter': 1, 'endfilter': 1, 'debug': 1, 'block': 1, 'endblock': 1}, + contains: ['filter'] + }, + { + className: 'variable', + begin: '\\{\\{', end: '\\}\\}', + contains: ['filter'] + }, + { + className: 'filter', + begin: '\\|[A-Za-z]+\\:?', end: '^', excludeEnd: true, + lexems: [IDENT_RE], + keywords: {'truncatewords': 1, 'removetags': 1, 'linebreaksbr': 1, 'yesno': 1, 'get_digit': 1, 'timesince': 1, 'random': 1, 'striptags': 1, 'filesizeformat': 1, 'escape': 1, 'linebreaks': 1, 'length_is': 1, 'ljust': 1, 'rjust': 1, 'cut': 1, 'urlize': 1, 'fix_ampersands': 1, 'title': 1, 'floatformat': 1, 'capfirst': 1, 'pprint': 1, 'divisibleby': 1, 'add': 1, 'make_list': 1, 'unordered_list': 1, 'urlencode': 1, 'timeuntil': 1, 'urlizetrunc': 1, 'wordcount': 1, 'stringformat': 1, 'linenumbers': 1, 'slice': 1, 'date': 1, 'dictsort': 1, 'dictsortreversed': 1, 'default_if_none': 1, 'pluralize': 1, 'lower': 1, 'join': 1, 'center': 1, 'default': 1, 'truncatewords_html': 1, 'upper': 1, 'length': 1, 'phone2numeric': 1, 'wordwrap': 1, 'time': 1, 'addslashes': 1, 'slugify': 1, 'first': 1}, + contains: ['argument'] + }, + { + className: 'argument', + begin: '"', end: '"' + } + ] +};//django \ No newline at end of file Added: kukit/euro-python-2007/languages/java.js ============================================================================== --- (empty file) +++ kukit/euro-python-2007/languages/java.js Fri Jun 1 22:59:10 2007 @@ -0,0 +1,53 @@ +/* + +Java definition (?) Vsevolod Solovyov + +*/ +LANGUAGES.java = { + defaultMode: { + lexems: [UNDERSCORE_IDENT_RE], + contains: ['comment', 'string', 'class', 'number', 'javadoc', 'annotation'], + keywords: {'false': 1, 'synchronized': 1, 'int': 1, 'abstract': 1, 'float': 1, 'private': 1, 'char': 1, 'interface': 1, 'boolean': 1, 'static': 1, 'null': 1, 'if': 1, 'const': 1, 'for': 1, 'true': 1, 'while': 1, 'long': 1, 'throw': 1, 'strictfp': 1, 'finally': 1, 'protected': 1, 'extends': 1, 'import': 1, 'native': 1, 'final': 1, 'implements': 1, 'return': 1, 'void': 1, 'enum': 1, 'else': 1, 'break': 1, 'transient': 1, 'new': 1, 'catch': 1, 'instanceof': 1, 'byte': 1, 'super': 1, 'class': 1, 'volatile': 1, 'case': 1, 'assert': 1, 'short': 1, 'package': 1, 'default': 1, 'double': 1, 'public': 1, 'try': 1, 'this': 1, 'switch': 1, 'continue': 1, 'throws': 1} + }, + modes: [ + { + className: 'class', + lexems: [UNDERSCORE_IDENT_RE], + begin: '(class |interface )', end: '{', + illegal: ':', + keywords: {'class': 1, 'interface': 1}, + contains: ['inheritance', 'title'] + }, + { + className: 'inheritance', + begin: '(implements|extends)', end: '^', + lexems: [IDENT_RE], + keywords: {'extends': 1, 'implements': 1}, + relevance: 10 + }, + { + className: 'title', + begin: UNDERSCORE_IDENT_RE, end: '^' + }, + { + className: 'params', + begin: '\\(', end: '\\)', + contains: ['string', 'annotation'] + }, + C_NUMBER_MODE, + APOS_STRING_MODE, + QUOTE_STRING_MODE, + BACKSLASH_ESCAPE, + C_LINE_COMMENT_MODE, + { + className: 'javadoc', + begin: '/\\*\\*', end: '\\*/', + relevance: 10 + }, + C_BLOCK_COMMENT_MODE, + { + className: 'annotation', + begin: '@[A-Za-z]+', end: '^' + } + ] +};//java \ No newline at end of file Added: kukit/euro-python-2007/languages/javascript.js ============================================================================== --- (empty file) +++ kukit/euro-python-2007/languages/javascript.js Fri Jun 1 22:59:10 2007 @@ -0,0 +1,38 @@ +LANGUAGES.javascript = { + defaultMode: { + lexems: [UNDERSCORE_IDENT_RE], + contains: ['string', 'comment', 'number', 'regexp', 'function'], + keywords: { + 'keyword': {'in': 1, 'if': 1, 'for': 1, 'while': 1, 'finally': 1, 'var': 1, 'new': 1, 'function': 1, 'do': 1, 'return': 1, 'void': 1, 'else': 1, 'break': 1, 'catch': 1, 'instanceof': 1, 'with': 1, 'throw': 1, 'case': 1, 'default': 1, 'try': 1, 'this': 1, 'switch': 1, 'continue': 1, 'typeof': 1, 'delete': 1}, + 'literal': {'true': 1, 'false': 1, 'null': 1} + } + }, + modes: [ + C_LINE_COMMENT_MODE, + C_BLOCK_COMMENT_MODE, + C_NUMBER_MODE, + APOS_STRING_MODE, + QUOTE_STRING_MODE, + BACKSLASH_ESCAPE, + { + className: 'regexp', + begin: '\\/[^\\/]', end: '(^|[^\\\\])\\/[gim]*' + }, + { + className: 'function', + begin: 'function ', end: '{', + lexems: [UNDERSCORE_IDENT_RE], + keywords: {'function': 1}, + contains: ['title', 'params'] + }, + { + className: 'title', + begin: UNDERSCORE_IDENT_RE, end: '^' + }, + { + className: 'params', + begin: '\\(', end: '\\)', + contains: ['string', 'comment'] + } + ] +};//javascript \ No newline at end of file Added: kukit/euro-python-2007/languages/perl.js ============================================================================== --- (empty file) +++ kukit/euro-python-2007/languages/perl.js Fri Jun 1 22:59:10 2007 @@ -0,0 +1,117 @@ +/* + +Perl definition (?) Peter Leonov +Test you perl code here: http://wiki.cmsbuilder.ru/Highlite_test + +*/ + +var PERL_NUMBER_RE = '(\\b0[0-7]+)|(\\b0x[0-9a-fA-F]+)|(\\b[1-9]\\d*(\\.\\d+)?)|0\\b'; +var PERL_KEYWORDS = {'getpwent': 1, 'getservent': 1, 'quotemeta': 1, 'msgrcv': 1, 'scalar': 1, 'kill': 1, 'dbmclose': 1, 'undef': 1, 'lc': 1, 'ma': 1, 'syswrite': 1, 'tr': 1, 'send': 1, 'umask': 1, 'sysopen': 1, 'shmwrite': 1, 'vec': 1, 'qx': 1, 'utime': 1, 'local': 1, 'oct': 1, 'semctl': 1, 'localtime': 1, 'readpipe': 1, 'do': 1, 'return': 1, 'format': 1, 'read': 1, 'sprintf': 1, 'dbmopen': 1, 'pop': 1, 'getpgrp': 1, 'not': 1, 'getpwnam': 1, 'rewinddir': 1, 'qq': 1, 'fileno': 1, 'qw': 1, 'endprotoent': 1, 'wait': 1, 'sethostent': 1, 'bless': 1, 's': 1, 'opendir': 1, 'continue': 1, 'each': 1, 'sleep': 1, 'endgrent': 1, 'shutdown': 1, 'dump': 1, 'chomp': 1, 'connect': 1, 'getsockname': 1, 'die': 1, 'socketpair': 1, 'close': 1, 'flock': 1, 'exists': 1, 'index': 1, 'shmget': 1, 'sub': 1, 'for': 1, 'endpwent': 1, 'redo': 1, 'lstat': 1, 'msgctl': 1, 'setpgrp': 1, 'abs': 1, 'exit': 1, 'select': 1, 'print': 1, 'ref': 1, 'gethostbyaddr': 1, 'unshift': 1, 'fcntl': 1, 'syscall': 1, 'goto': 1, 'getnetbyaddr': 1, 'join': 1, 'gmtime': 1, 'symlink': 1, 'semget': 1, 'splice': 1, 'x': 1, 'getpeername': 1, 'recv': 1, 'log': 1, 'setsockopt': 1, 'cos': 1, 'last': 1, 'reverse': 1, 'gethostbyname': 1, 'getgrnam': 1, 'study': 1, 'formline': 1, 'endhostent': 1, 'times': 1, 'chop': 1, 'length': 1, 'gethostent': 1, 'getnetent': 1, 'pack': 1, 'getprotoent': 1, 'getservbyname': 1, 'rand': 1, 'mkdir': 1, 'pos': 1, 'chmod': 1, 'y': 1, 'substr': 1, 'endnetent': 1, 'printf': 1, 'next': 1, 'open': 1, 'msgsnd': 1, 'readdir': 1, 'use': 1, 'unlink': 1, 'getsockopt': 1, 'getpriority': 1, 'rindex': 1, 'wantarray': 1, 'hex': 1, 'system': 1, 'getservbyport': 1, 'endservent': 1, 'int': 1, 'chr': 1, 'untie': 1, 'rmdir': 1, 'prototype': 1, 'tell': 1, 'listen': 1, 'fork': 1, 'shmread': 1, 'ucfirst': 1, 'setprotoent': 1, 'else': 1, 'sysseek': 1, 'link': 1, 'getgrgid': 1, 'shmctl': 1, 'waitpid': 1, 'unpack': 1, 'getnetbyname': 1, 'reset': 1, 'chdir': 1, 'grep': 1, 'split': 1, 'require': 1, 'caller': 1, 'lcfirst': 1, 'until': 1, 'warn': 1, 'while': 1, 'values': 1, 'shift': 1, 'telldir': 1, 'getpwuid': 1, 'my': 1, 'getprotobynumber': 1, 'delete': 1, 'and': 1, 'sort': 1, 'uc': 1, 'defined': 1, 'srand': 1, 'accept': 1, 'package': 1, 'seekdir': 1, 'getprotobyname': 1, 'semop': 1, 'our': 1, 'rename': 1, 'seek': 1, 'if': 1, 'q': 1, 'chroot': 1, 'sysread': 1, 'setpwent': 1, 'no': 1, 'crypt': 1, 'getc': 1, 'chown': 1, 'sqrt': 1, 'write': 1, 'setnetent': 1, 'setpriority': 1, 'foreach': 1, 'tie': 1, 'sin': 1, 'msgget': 1, 'map': 1, 'stat': 1, 'getlogin': 1, 'unless': 1, 'elsif': 1, 'truncate': 1, 'exec': 1, 'keys': 1, 'glob': 1, 'tied': 1, 'closedir': 1, 'ioctl': 1, 'socket': 1, 'readlink': 1, 'eval': 1, 'xor': 1, 'readline': 1, 'binmode': 1, 'setservent': 1, 'eof': 1, 'ord': 1, 'bind': 1, 'alarm': 1, 'pipe': 1, 'atan2': 1, 'getgrent': 1, 'exp': 1, 'time': 1, 'push': 1, 'setgrent': 1, 'gt': 1, 'lt': 1, 'or': 1, 'ne': 1, 'm': 1}; + +LANGUAGES.perl = { + defaultMode: { + lexems: [IDENT_RE], + contains: ['comment', 'string', 'number', 'regexp', 'sub', 'variable', 'operator', 'pod', 'identifier'], + keywords: PERL_KEYWORDS + }, + modes: [ + + // variables + { + className: 'variable', + begin: '\\$\\d', end: '^', + relevance: 5 + }, + { + className: 'variable', + begin: '[\\$\\%\\@\\*](\\^\\w\\b|#\\w+|[^\\s\\w{]|{\\w+}|\\w+)', end: '^' + }, + + // numbers and strings + { + className: 'number', + begin: PERL_NUMBER_RE, end: '^', + relevance: 0 + }, + { + className: 'string', + begin: 'q[qwxr]?\\(', end: '[^\\\\]\\)', + relevance: 10 + }, + { + className: 'string', + begin: 'qw\\s+q', end: 'q', + relevance: 10 + }, + APOS_STRING_MODE, + QUOTE_STRING_MODE, + BACKSLASH_ESCAPE, + { + className: 'string', + begin: '`', end: '`', + contains: ['escape'] + }, + + // regexps + { + className: 'regexp', + begin: '(s|tr|y)(/.*?[^\\\\]/|//)(.*?[^\\\\]/|/)[a-z]*', end: '^', + relevance: 10 + }, + { + className: 'regexp', + begin: '(m|qr)?//[cgimosxe]*', end: '^', + relevance: 0 // allows empty "//" which is a common comment delimiter in other languages + }, + { + className: 'regexp', + begin: '(m|qr)?/.*?[^\\\\/]/[cgimosxe]*', end: '^' + }, + + // bareword context + { + className: 'string', + begin: '{\\w+}', end: '^', + relevance: 0 + }, + { + className: 'string', + begin: '\-?\\w+\\s*\\=\\>', end: '^', + relevance: 5 + }, + + // subroutines + { + className: 'sub', + begin: '\\bsub\\b', end: '(\\s*\\(.*?\\))?[;{]', + lexems: [IDENT_RE], + keywords: {'sub':1}, + contains: ['identifier'], + relevance: 10 + }, + + // operators + { + className: 'operator', + begin: '-\\w\\b', end: '^' + }, + + // comments + HASH_COMMENT_MODE, + + // pod + { + className: 'pod', + begin: '\\=\\w', end: '\\=cut' + }, + + // identifiers + { + className: 'identifier', + begin: '\\b[a-zA-Z]\\w*\\b', end: '^', + lexems: [IDENT_RE], + keywords: PERL_KEYWORDS, + relevance: 0 + } + ] +};//perl Added: kukit/euro-python-2007/languages/php.js ============================================================================== --- (empty file) +++ kukit/euro-python-2007/languages/php.js Fri Jun 1 22:59:10 2007 @@ -0,0 +1,39 @@ +/* + +PHP5 definition (?) Victor Karamzin + +*/ +PHP5_KEYWORDS = {'and': 1, 'include_once': 1, 'list': 1, 'abstract': 1, 'global': 1, 'private': 1, 'echo': 1, 'interface': 1, 'as': 1, 'static': 1, 'endswitch': 1, 'array': 1, 'null': 1, 'if': 1, 'endwhile': 1, 'or': 1, 'const': 1, 'for': 1, 'endforeach': 1, 'self': 1, 'var': 1, 'while': 1, 'isset': 1, 'public': 1, 'protected': 1, 'exit': 1, 'foreach': 1, 'throw': 1, 'elseif': 1, 'extends': 1, 'include': 1, '__FILE__': 1, 'empty': 1, 'require_once': 1, 'function': 1, 'do': 1, 'xor': 1, 'return': 1, 'implements': 1, 'parent': 1, 'clone': 1, 'use': 1, '__CLASS__': 1, '__LINE__': 1, 'else': 1, 'break': 1, 'print': 1, 'eval': 1, 'new': 1, 'catch': 1, '__METHOD__': 1, 'class': 1, 'case': 1, 'exception': 1, 'php_user_filter': 1, 'default': 1, 'die': 1, 'require': 1, '__FUNCTION__': 1, 'enddeclare': 1, 'final': 1, 'try': 1, 'this': 1, 'switch': 1, 'continue': 1, 'endfor': 1, 'endif': 1, 'declare': 1, 'unset': 1}; + +PHP_IDENTIFIER_RE = '[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*'; + +LANGUAGES.php = { + defaultMode: { + lexems: [IDENT_RE], + contains: ['comment', 'number', 'string', 'variable'], + keywords: PHP5_KEYWORDS + }, + case_insensitive: true, + modes: [ + C_LINE_COMMENT_MODE, + HASH_COMMENT_MODE, + { + className: 'comment', + begin: '/\\*', end: '\\*/', + contains: ['phpdoc'] + }, + { + className: 'phpdoc', + begin: '\\s@[A-Za-z]+', end: '^', + relevance: 10 + }, + C_NUMBER_MODE, + APOS_STRING_MODE, + QUOTE_STRING_MODE, + BACKSLASH_ESCAPE, + { + className: 'variable', + begin: '\\$' + PHP_IDENTIFIER_RE, end: '^' + }, + ] +};//php \ No newline at end of file Added: kukit/euro-python-2007/languages/python.js ============================================================================== --- (empty file) +++ kukit/euro-python-2007/languages/python.js Fri Jun 1 22:59:10 2007 @@ -0,0 +1,86 @@ +LANGUAGES.python = { + defaultMode: { + lexems: [UNDERSCORE_IDENT_RE], + illegal: '()', + contains: ['comment', 'string', 'function', 'class', 'number', 'decorator'], + keywords: {'and': 1, 'elif': 1, 'is': 1, 'global': 1, 'as': 1, 'in': 1, 'if': 1, 'from': 1, 'raise': 1, 'for': 1, 'except': 1, 'finally': 1, 'print': 1, 'import': 1, 'pass': 1, 'None': 1, 'return': 1, 'exec': 1, 'else': 1, 'break': 1, 'not': 1, 'with': 1, 'class': 1, 'assert': 1, 'yield': 1, 'try': 1, 'while': 1, 'continue': 1, 'del': 1, 'or': 1, 'def': 1, 'lambda': 1} + }, + modes: [ + { + className: 'function', + lexems: [UNDERSCORE_IDENT_RE], + begin: '\\bdef ', end: ':', + illegal: '$', + keywords: {'def': 1}, + contains: ['title', 'params'], + relevance: 10 + }, + { + className: 'class', + lexems: [UNDERSCORE_IDENT_RE], + begin: '\\bclass ', end: ':', + illegal: '[${]', + keywords: {'class': 1}, + contains: ['title', 'params',], + relevance: 10 + }, + { + className: 'title', + begin: UNDERSCORE_IDENT_RE, end: '^' + }, + { + className: 'params', + begin: '\\(', end: '\\)', + contains: ['string'] + }, + HASH_COMMENT_MODE, + C_NUMBER_MODE, + { + className: 'string', + begin: '\'\'\'', end: '\'\'\'', + relevance: 10 + }, + { + className: 'string', + begin: '"""', end: '"""', + relevance: 10 + }, + APOS_STRING_MODE, + QUOTE_STRING_MODE, + BACKSLASH_ESCAPE, + { + className: 'string', + begin: 'r\'', end: '\'', + relevance: 10 + }, + { + className: 'string', + begin: 'r"', end: '"', + relevance: 10 + }, + { + className: 'string', + begin: 'u\'', end: '(^|[^\\\\])\'', + relevance: 10 + }, + { + className: 'string', + begin: 'u"', end: '(^|[^\\\\])"', + relevance: 10 + }, + { + className: 'string', + begin: 'ur\'', end: '\'', + relevance: 10 + }, + { + className: 'string', + begin: 'ur"', end: '"', + relevance: 10 + }, + { + className: 'decorator', + begin: '@', end: '$' + } + ] +};//python Added: kukit/euro-python-2007/languages/rib.js ============================================================================== --- (empty file) +++ kukit/euro-python-2007/languages/rib.js Fri Jun 1 22:59:10 2007 @@ -0,0 +1,30 @@ +/* + +RenderMan Interface Bytestream (c) Konstantin Evdokimenko + +*/ + +LANGUAGES.rib = { + defaultMode: { + lexems: [UNDERSCORE_IDENT_RE], + illegal: ' + +*/ + +LANGUAGES.rsl = { + defaultMode: { + lexems: [UNDERSCORE_IDENT_RE], + illegal: ' + +*/ +LANGUAGES.ruby = { + defaultMode: { + lexems: [UNDERSCORE_IDENT_RE], + contains: ['comment', 'string', 'class', 'function', 'symbol'], + keywords: {'and': 1, 'false': 1, 'then': 1, 'defined': 1, 'module': 1, 'in': 1, 'return': 1, 'redo': 1, 'if': 1, 'BEGIN': 1, 'retry': 1, 'end': 1, 'for': 1, 'true': 1, 'self': 1, 'when': 1, 'next': 1, 'until': 1, 'do': 1, 'begin': 1, 'unless': 1, 'END': 1, 'rescue': 1, 'nil': 1, 'else': 1, 'break': 1, 'undef': 1, 'not': 1, 'super': 1, 'class': 1, 'case': 1, 'require': 1, 'yield': 1, 'alias': 1, 'while': 1, 'ensure': 1, 'elsif': 1, 'or': 1, 'def': 1} + }, + modes: [ + HASH_COMMENT_MODE, + { + className: 'comment', + begin: '^\\=begin', end: '^\\=end', + relevance: 10 + }, + { + className: 'string', + begin: '\'', end: '(^|[^\\\\])\'', + contains: ['subst'], + relevance: 0 + }, + { + className: 'string', + begin: '"', end: '(^|[^\\\\])"', + contains: ['subst'], + relevance: 0 + }, + { + className: 'subst', + begin: '#\\{', end: '\}', + contains: ['string'], + relevance: 10 + }, + { + className: 'function', + lexems: [IDENT_RE], + begin: '\\bdef ', end: '$', + illegal: '[{\\:]', + keywords: {'def': 1}, + contains: ['title', 'comment'], + relevance: 10 + }, + { + className: 'class', + lexems: [IDENT_RE], + begin: '\\bclass ', end: '$', + illegal: '[{\\:]', + contains: ['title', 'comment'], + keywords: {'class': 1} + }, + { + className: 'symbol', + begin: ':' + UNDERSCORE_IDENT_RE, end: '^' + }, + { + className: 'title', + begin: IDENT_RE + "\\s*<\\s*" + IDENT_RE, end: '^' + }, + { + className: 'title', + begin: 'self.' + IDENT_RE, end: '^' + }, + { + className: 'title', + begin: IDENT_RE, end: '^' + } + ] +};//ruby \ No newline at end of file Added: kukit/euro-python-2007/languages/smalltalk.js ============================================================================== --- (empty file) +++ kukit/euro-python-2007/languages/smalltalk.js Fri Jun 1 22:59:10 2007 @@ -0,0 +1,53 @@ +/* + +Smalltalk definition (c) Vladimir Gubarkov + +*/ + +var SMALLTALK_KEYWORDS = {'self': 1, 'super': 1, 'nil': 1, 'true': 1, 'false': 1, 'thisContext': 1}; // only 6 +var VAR_IDENT_RE = '[a-z][a-zA-Z0-9_]*'; + +LANGUAGES.smalltalk = { + defaultMode: { + lexems: [UNDERSCORE_IDENT_RE], + contains: ['comment', 'string', 'class', 'method', + 'number', 'symbol', 'char', 'localvars', 'array'], + keywords: SMALLTALK_KEYWORDS + }, + modes: [ + { + className: 'class', + begin: '\\b[A-Z][A-Za-z0-9_]*', end: '^', + relevance: 0 + }, + { + className: 'symbol', + begin: '#' + UNDERSCORE_IDENT_RE, end: '^' + }, + C_NUMBER_MODE, + APOS_STRING_MODE, + { + className: 'comment', + begin: '"', end: '"', + relevance: 0 + }, + { + className: 'method', + begin: VAR_IDENT_RE+':', end:'^' + }, + { + className: 'char', + begin: '\\$.{1}', end: '^' + }, + { + className: 'localvars', + begin: '\\|\\s*(('+VAR_IDENT_RE+')\\s*)+\\|', end: '^', + relevance: 10 + }, + { + className: 'array', + begin: '\\#\\(', end: '\\)', + contains: ['string', 'char', 'number', 'symbol'] + } + ] +};//smalltalk \ No newline at end of file Added: kukit/euro-python-2007/languages/sql.js ============================================================================== --- (empty file) +++ kukit/euro-python-2007/languages/sql.js Fri Jun 1 22:59:10 2007 @@ -0,0 +1,50 @@ +SQL_KEYWORDS = {'all': 1, 'partial': 1, 'global': 1, 'month': 1, 'current_timestamp': 1, 'using': 1, 'go': 1, 'revoke': 1, 'smallint': 1, 'indicator': 1, 'end-exec': 1, 'disconnect': 1, 'zone': 1, 'with': 1, 'character': 1, 'assertion': 1, 'to': 1, 'add': 1, 'current_user': 1, 'usage': 1, 'input': 1, 'local': 1, 'alter': 1, 'match': 1, 'collate': 1, 'real': 1, 'then': 1, 'rollback': 1, 'get': 1, 'read': 1, 'timestamp': 1, 'session_user': 1, 'not': 1, 'integer': 1, 'bit': 1, 'unique': 1, 'day': 1, 'minute': 1, 'desc': 1, 'insert': 1, 'execute': 1, 'like': 1, 'level': 1, 'decimal': 1, 'drop': 1, 'continue': 1, 'isolation': 1, 'found': 1, 'where': 1, 'constraints': 1, 'domain': 1, 'right': 1, 'national': 1, 'some': 1, 'module': 1, 'transaction': 1, 'relative': 1, 'second': 1, 'connect': 1, 'escape': 1, 'close': 1, 'system_user': 1, 'for': 1, 'deferred': 1, 'section': 1, 'cast': 1, 'current': 1, 'sqlstate': 1, 'allocate': 1, 'intersect': 1, 'deallocate': 1, 'numeric': 1, 'public': 1, 'preserve': 1, 'full': 1, 'goto': 1, 'initially': 1, 'asc': 1, 'no': 1, 'key': 1, 'output': 1, 'collation': 1, 'group': 1, 'by': 1, 'union': 1, 'session': 1, 'both': 1, 'last': 1, 'language': 1, 'constraint': 1, 'column': 1, 'of': 1, 'space': 1, 'foreign': 1, 'deferrable': 1, 'prior': 1, 'connection': 1, 'unknown': 1, 'action': 1, 'commit': 1, 'view': 1, 'or': 1, 'first': 1, 'into': 1, 'float': 1, 'year': 1, 'primary': 1, 'cascaded': 1, 'except': 1, 'restrict': 1, 'set': 1, 'references': 1, 'names': 1, 'table': 1, 'outer': 1, 'open': 1, 'select': 1, 'size': 1, 'are': 1, 'rows': 1, 'from': 1, 'prepare': 1, 'distinct': 1, 'leading': 1, 'create': 1, 'only': 1, 'next': 1, 'inner': 1, 'authorization': 1, 'schema': 1, 'corresponding': 1, 'option': 1, 'declare': 1, 'precision': 1, 'immediate': 1, 'else': 1, 'timezone_minute': 1, 'external': 1, 'varying': 1, 'translation': 1, 'true': 1, 'case': 1, 'exception': 1, 'join': 1, 'hour': 1, 'default': 1, 'double': 1, 'scroll': 1, 'value': 1, 'cursor': 1, 'descriptor': 1, 'values': 1, 'dec': 1, 'fetch': 1, 'procedure': 1, 'delete': 1, 'and': 1, 'false': 1, 'int': 1, 'is': 1, 'describe': 1, 'char': 1, 'as': 1, 'at': 1, 'in': 1, 'varchar': 1, 'null': 1, 'trailing': 1, 'any': 1, 'absolute': 1, 'current_time': 1, 'end': 1, 'grant': 1, 'privileges': 1, 'when': 1, 'cross': 1, 'check': 1, 'write': 1, 'current_date': 1, 'pad': 1, 'begin': 1, 'temporary': 1, 'exec': 1, 'time': 1, 'update': 1, 'catalog': 1, 'user': 1, 'sql': 1, 'date': 1, 'on': 1, 'identity': 1, 'timezone_hour': 1, 'natural': 1, 'whenever': 1, 'interval': 1, 'work': 1, 'order': 1, 'cascade': 1, 'diagnostics': 1, 'nchar': 1, 'having': 1, 'left': 1}; + +LANGUAGES.sql = +{ + case_insensitive: true, + defaultMode: + { + lexems: [IDENT_RE], + contains: ['string', 'number', 'comment'], + keywords: { + 'keyword': SQL_KEYWORDS, + 'aggregate': {'count': 1, 'sum': 1, 'min': 1, 'max': 1, 'avg': 1} + } + }, + + modes: [ + C_NUMBER_MODE, + C_BLOCK_COMMENT_MODE, + { + className: 'comment', + begin: '--', end: '$' + }, + { + className: 'string', + begin: '\'', end: '\'', + contains: ['escape', 'squote'], + relevance: 0 + }, + { + className: 'squote', + begin: '\'\'', end: '^' + }, + { + className: 'string', + begin: '"', end: '"', + contains: [ 'escape', 'dquote'], + relevance: 0 + }, + { + className: 'dquote', + begin: '""', end: '^' + }, + { + className: 'string', + begin: '`', end: '`', + contains: ['escape'] + }, + BACKSLASH_ESCAPE + ] +};//sql Added: kukit/euro-python-2007/languages/vbscript.js ============================================================================== --- (empty file) +++ kukit/euro-python-2007/languages/vbscript.js Fri Jun 1 22:59:10 2007 @@ -0,0 +1,25 @@ +/* + +VBScript definition (c) Nikita Ledyaev + +*/ +LANGUAGES.vbscript = { + defaultMode: { + lexems: [IDENT_RE], + contains: ['string', 'comment', 'number', 'built_in'], + keywords: { + 'keyword': {'call' : 1,'class' : 1,'const' : 1,'dim' : 1,'do' : 1,'loop' : 1,'erase' : 1,'execute' : 1,'executeglobal' : 1,'exit' : 1,'for' : 1,'each' : 1,'next' : 1,'function' : 1,'if' : 1,'then' : 1,'else' : 1,'on' : 1, 'error' : 1,'option' : 1, 'explicit' : 1,'private' : 1,'property' : 1,'let' : 1,'get' : 1,'public' : 1,'randomize' : 1,'redim' : 1,'rem' : 1,'select' : 1,'case' : 1,'set' : 1,'stop' : 1,'sub' : 1,'while' : 1,'wend' : 1,'with' : 1, 'end' : 1, 'to' : 1}, + 'built_in': {'lcase': 1, 'month': 1, 'vartype': 1, 'instrrev': 1, 'ubound': 1, 'setlocale': 1, 'getobject': 1, 'rgb': 1, 'getref': 1, 'string': 1, 'weekdayname': 1, 'rnd': 1, 'dateadd': 1, 'monthname': 1, 'now': 1, 'day': 1, 'minute': 1, 'isarray': 1, 'cbool': 1, 'round': 1, 'formatcurrency': 1, 'conversions': 1, 'csng': 1, 'timevalue': 1, 'second': 1, 'year': 1, 'space': 1, 'abs': 1, 'clng': 1, 'timeserial': 1, 'fixs': 1, 'len': 1, 'asc': 1, 'isempty': 1, 'maths': 1, 'dateserial': 1, 'atn': 1, 'timer': 1, 'isobject': 1, 'filter': 1, 'weekday': 1, 'datevalue': 1, 'ccur': 1, 'isdate': 1, 'instr': 1, 'datediff': 1, 'formatdatetime': 1, 'replace': 1, 'isnull': 1, 'right': 1, 'sgn': 1, 'array': 1, 'snumeric': 1, 'log': 1, 'cdbl': 1, 'hex': 1, 'chr': 1, 'lbound': 1, 'msgbox': 1, 'ucase': 1, 'getlocale': 1, 'cos': 1, 'cdate': 1, 'cbyte': 1, 'rtrim': 1, 'join': 1, 'hour': 1, 'oct': 1, 'typename': 1, 'trim': 1, 'strcomp': 1, 'int': 1, 'createobject': 1, 'loadpicture': 1, 'tan': 1, 'formatnumber': 1, 'mid': 1, 'scriptenginebuildversion': 1, 'scriptengine': 1, 'split': 1, 'scriptengineminorversion': 1, 'cint': 1, 'sin': 1, 'datepart': 1, 'ltrim': 1, 'sqr': 1, 'scriptenginemajorversion': 1, 'time': 1, 'derived': 1, 'eval': 1, 'date': 1, 'formatpercent': 1, 'exp': 1, 'inputbox': 1, 'left': 1} + } + }, + case_insensitive: true, + modes: [ + QUOTE_STRING_MODE, + BACKSLASH_ESCAPE, + { + className: 'comment', + begin: '\'', end: '$' + }, + C_NUMBER_MODE + ] +};//vbscript \ No newline at end of file Modified: kukit/euro-python-2007/presentation.css ============================================================================== --- kukit/euro-python-2007/presentation.css (original) +++ kukit/euro-python-2007/presentation.css Fri Jun 1 22:59:10 2007 @@ -1,3 +1,7 @@ +.hidden { display: none; } +.note { background-color: yellow; border: 1px solid black; color: black; font-size: 120%; } + + ?/* You can use this file as is or as a starting point for you own styling */ Added: kukit/euro-python-2007/presentation.kss ============================================================================== --- (empty file) +++ kukit/euro-python-2007/presentation.kss Fri Jun 1 22:59:10 2007 @@ -0,0 +1,21 @@ +div.commands a:click { + evt-click-preventdefault: True; + action-client: toggleClass; + toggleClass-kssSelector: css('div.commands .example'); + toggleClass-classname: hidden; +} + +div.kss-file a:click{ + evt-click-preventdefault: True; + action-client: toggleClass; + toggleClass-kssSelector: css('div.kss-file .example'); + toggleClass-classname: hidden; +} + +/* basic workings - set style example */ +#click-me:click{ + evt-click-preventdefault: True; + action-client: setStyle; + setStyle-name: color; + setStyle-value: red; +} \ No newline at end of file From jvloothuis at codespeak.net Sat Jun 2 21:02:20 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Sat, 2 Jun 2007 21:02:20 +0200 (CEST) Subject: [KSS-checkins] r43996 - kukit/euro-python-2007 Message-ID: <20070602190220.336F580A2@code0.codespeak.net> Author: jvloothuis Date: Sat Jun 2 21:02:19 2007 New Revision: 43996 Modified: kukit/euro-python-2007/basic-workings.html Log: Changed to contain only info on how to create a plugin Modified: kukit/euro-python-2007/basic-workings.html ============================================================================== --- kukit/euro-python-2007/basic-workings.html (original) +++ kukit/euro-python-2007/basic-workings.html Sat Jun 2 21:02:19 2007 @@ -36,8 +36,8 @@
-

Basic Workings

-
+

Command example

+
KSS Files
-
+
KSS Commands
-
- KSS runtime -
- -
-

KSS consist of a few important pieces. The diagram above - shows three layers. At the top you can see the KSS file - layer. This represents the actual KSS files.

- -

Next is the command layer. This represents all available - commands in the KSS system. This is also the point where you - can extend KSS to create your own command's.

+

An example KSS command in show which alters the style property of a node. Notice how the plugin is registered using the command registry API.

@@ -84,11 +73,6 @@ Javascript. In this example you can see it is pretty straight forware to get the arguments and the node on which to operate.

- -

The last piece of the puzzle is the KSS runtime. This code - is responsible for loading and parsing the KSS. It will then - bind the events to the DOM etc.

-
From jvloothuis at codespeak.net Sat Jun 2 21:17:06 2007 From: jvloothuis at codespeak.net (jvloothuis at codespeak.net) Date: Sat, 2 Jun 2007 21:17:06 +0200 (CEST) Subject: [KSS-checkins] r43997 - kukit/euro-python-2007 Message-ID: <20070602191706.B212180CE@code0.codespeak.net> Author: jvloothuis Date: Sat Jun 2 21:17:05 2007 New Revision: 43997 Added: kukit/euro-python-2007/example-plugin.html - copied unchanged from r43996, kukit/euro-python-2007/basic-workings.html Removed: kukit/euro-python-2007/basic-workings.html Modified: kukit/euro-python-2007/static-demo.html Log: Renamed to match the change of contents Deleted: /kukit/euro-python-2007/basic-workings.html ============================================================================== --- /kukit/euro-python-2007/basic-workings.html Sat Jun 2 21:17:05 2007 +++ (empty file) @@ -1,79 +0,0 @@ - - - - KSS, doing Ajax with style - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

Command example

-
- KSS Files - -
-
- KSS Commands - - -
- -
-

An example KSS command in show which alters the style - property of a node. Notice how the plugin is registered using - the command registry API.

- -

You can also see that a command is defined using - Javascript. In this example you can see it is pretty straight - forware to get the arguments and the node on which to - operate.

-
-
- - Modified: kukit/euro-python-2007/static-demo.html ============================================================================== --- kukit/euro-python-2007/static-demo.html (original) +++ kukit/euro-python-2007/static-demo.html Sat Jun 2 21:17:05 2007 @@ -62,6 +62,7 @@
+ Plugin example
From reebalazs at codespeak.net Mon Jun 11 16:08:41 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Mon, 11 Jun 2007 16:08:41 +0200 (CEST) Subject: [KSS-checkins] r44141 - kukit/kukit.js/branch/ree-stripout-comments/kukit Message-ID: <20070611140841.2601F8092@code0.codespeak.net> Author: reebalazs Date: Mon Jun 11 16:08:40 2007 New Revision: 44141 Modified: kukit/kukit.js/branch/ree-stripout-comments/kukit/actionreg.js kukit/kukit.js/branch/ree-stripout-comments/kukit/commandprocessor.js kukit/kukit.js/branch/ree-stripout-comments/kukit/dom.js kukit/kukit.js/branch/ree-stripout-comments/kukit/eventreg.js kukit/kukit.js/branch/ree-stripout-comments/kukit/forms.js kukit/kukit.js/branch/ree-stripout-comments/kukit/kssparser.js kukit/kukit.js/branch/ree-stripout-comments/kukit/kukit.js kukit/kukit.js/branch/ree-stripout-comments/kukit/oper.js kukit/kukit.js/branch/ree-stripout-comments/kukit/plugin.js kukit/kukit.js/branch/ree-stripout-comments/kukit/providerreg.js kukit/kukit.js/branch/ree-stripout-comments/kukit/resourcedata.js kukit/kukit.js/branch/ree-stripout-comments/kukit/selectorreg.js kukit/kukit.js/branch/ree-stripout-comments/kukit/serveraction.js kukit/kukit.js/branch/ree-stripout-comments/kukit/tokenizer.js kukit/kukit.js/branch/ree-stripout-comments/kukit/utils.js Log: Clean up commentification by removing ambigous use of multiline comments Modified: kukit/kukit.js/branch/ree-stripout-comments/kukit/actionreg.js ============================================================================== --- kukit/kukit.js/branch/ree-stripout-comments/kukit/actionreg.js (original) +++ kukit/kukit.js/branch/ree-stripout-comments/kukit/actionreg.js Mon Jun 11 16:08:40 2007 @@ -52,9 +52,9 @@ var func = this.content[name]; if (! func) { // not found - ;;; throw 'Error : undefined local action "' + name + '"'; - throw 'E'; - //kukit.logError('Error : undefined action ' + name); + ;;; kukit.E = 'Error : undefined local action "' + name + '"'; + throw kukit.E; + //kukit.logError(kukit.E); } return func; }; Modified: kukit/kukit.js/branch/ree-stripout-comments/kukit/commandprocessor.js ============================================================================== --- kukit/kukit.js/branch/ree-stripout-comments/kukit/commandprocessor.js (original) +++ kukit/kukit.js/branch/ree-stripout-comments/kukit/commandprocessor.js Mon Jun 11 16:08:40 2007 @@ -41,8 +41,8 @@ // we make sure we execute none of them. var lastcommand = this.commands[this.commands.length-1]; if (lastcommand.name == 'error') { - ;;; throw new kukit.err.ExplicitError(lastcommand); - throw 'E'; + ;;; kukit.E = new kukit.err.ExplicitError(lastcommand); + throw kukit.E; } } }; Modified: kukit/kukit.js/branch/ree-stripout-comments/kukit/dom.js ============================================================================== --- kukit/kukit.js/branch/ree-stripout-comments/kukit/dom.js (original) +++ kukit/kukit.js/branch/ree-stripout-comments/kukit/dom.js Mon Jun 11 16:08:40 2007 @@ -125,8 +125,8 @@ kukit.dom.cssQuery = function(selector, in_nodes) { // to eliminate possible errors if (typeof(in_nodes) != 'undefined' && in_nodes == null) { - ;;; throw 'Selection error in kukit.dom.cssQuery'; - throw 'E'; + ;;; kukit.E = 'Selection error in kukit.dom.cssQuery'; + throw kukit.E; } return kukit.dom._cssQuery(selector, in_nodes); }; Modified: kukit/kukit.js/branch/ree-stripout-comments/kukit/eventreg.js ============================================================================== --- kukit/kukit.js/branch/ree-stripout-comments/kukit/eventreg.js (original) +++ kukit/kukit.js/branch/ree-stripout-comments/kukit/eventreg.js Mon Jun 11 16:08:40 2007 @@ -48,8 +48,8 @@ kukit.er.EventRegistry.prototype.registerBinder = function(classname, func) { if (typeof(func) == 'undefined') { - ;;; throw 'func argument is mandatory when registering an event binder (EventRegistry.registerBinder).'; - throw 'E'; + ;;; kukit.E = 'func argument is mandatory when registering an event binder (EventRegistry.registerBinder).'; + throw kukit.E; } if (this.classes[classname]) { // Do not allow redefinition @@ -71,8 +71,8 @@ var func = this.classes[classname]; if (! func) { // not found - ;;; throw 'Error : undefined event setup type ' + classname; - throw 'E'; + ;;; kukit.E = 'Error : undefined event setup type ' + classname; + throw kukit.E; } return func; }; @@ -82,8 +82,8 @@ kukit.er.EventRegistry.prototype._register = function(namespace, eventname, klass, bindmethodname, defaultactionmethodname, itername) { if (typeof(defaultactionmethodname) == 'undefined') { - ;;; throw 'some arguments are not passed when calling EventRegistry.register'; - throw 'E'; + ;;; kukit.E = 'some arguments are not passed when calling EventRegistry.register'; + throw kukit.E; } // Find out the class name. (Not specified now.) var classname = klass.prototype.__classname__; @@ -95,8 +95,8 @@ klass.prototype.__classname__ = classname; } if (!eventname) { - ;;; throw 'eventname argument cannot be empty when registering an event (EventRegistry.register)'; - throw 'E'; + ;;; kukit.E = 'eventname argument cannot be empty when registering an event (EventRegistry.register)'; + throw kukit.E; } var key = this._getKey(namespace, eventname); var entry = this.content[key]; @@ -104,22 +104,24 @@ if (key[0] == '-') { key = key.substring(1); } - ;;; throw 'In EventRegistry.register double registration of key "' + key + '"'; - throw 'E'; + ;;; kukit.E = 'In EventRegistry.register double registration of key "' + key + '"'; + throw kukit.E; } // check bindmethodname and defaultactionmethodname if (bindmethodname && ! klass.prototype[bindmethodname]) { - ;;; throw 'In EventRegistry.register bind method "' + bindmethodname + '" is undefined for event "' + eventname + '" namespace "' + namespace + '"'; - throw 'E'; + ;;; kukit.E = 'In EventRegistry.register bind method "' + bindmethodname; + ;;; kukit.E += '" is undefined for event "' + eventname + '" namespace "' + namespace + '"'; + throw kukit.E; } if (defaultactionmethodname && ! klass.prototype[defaultactionmethodname]) { - ;;; throw 'In EventRegistry.register default action method "' + defaultactionmethodname + '" is undefined for event "' + eventname + '" namespace "' + namespace + '"'; - throw 'E'; + ;;; kukit.E = 'In EventRegistry.register default action method "' + defaultactionmethodname; + ;;; kukit.E += '" is undefined for event "' + eventname + '" namespace "' + namespace + '"'; + throw kukit.E; } // check the iterator. if (! kukit.er.getBindIterator(itername)) { - ;;; throw 'In EventRegistry.register unknown bind iterator "' + itername + '"'; - throw 'E'; + ;;; kukit.E = 'In EventRegistry.register unknown bind iterator "' + itername + '"'; + throw kukit.E; } // register it this.content[key] = { @@ -167,8 +169,8 @@ if (namespace == null) { namespace = ''; } else if (namespace.split('-') > 1) { - ;;; throw 'In EventRegistry.register namespace cannot contain -'; - throw 'E'; + ;;; kukit.E = 'In EventRegistry.register namespace cannot contain -'; + throw kukit.E; } return namespace + '-' + eventname; }; @@ -183,13 +185,14 @@ var key = this._getKey(namespace, eventname); var entry = this.content[key]; if (typeof(entry) == 'undefined') { - if (key[0] == '-') { - key = key.substring(1); - ;;; throw 'Error : undefined global event key ' + key + ' (or maybe namespace is missing?)'; - throw 'E'; + if (key.substr(0, 1) == '-') { + ;;; key = key.substring(1); + ;;; kukit.E = 'Error : undefined global event key '; + ;;; kukit.E += key + ' (or maybe namespace is missing?)'; + throw kukit.E; } else { - ;;; throw 'Error : undefined event key ' + key; - throw 'E'; + ;;; kukit.E = 'Error : undefined event key ' + key; + throw kukit.E; } } return entry; @@ -393,8 +396,10 @@ if (! success) { // instead of the standard message give more specific reason: // either way we should have executed something... - ;;; throw 'Could not trigger event name "' + name + '" on namespace "' + namespace + '", because there is neither an explicit kss rule, nor a default method'; - throw 'E'; + ;;; kukit.E = 'Could not trigger event name "' + name; + ;;; kukit.E += '" on namespace "' + namespace; + ;;; kukit.E += '", because there is neither an explicit kss rule, nor a default method'; + throw kukit.E; } } }; @@ -406,8 +411,10 @@ // (called from oper) var method = this[methodname]; if (! method) { - ;;; throw 'Could not trigger event name "' + name + '" on namespace "' + namespace + '", because the method "' + methodname + '" does not exist.'; - throw 'E'; + ;;; kukit.E = 'Could not trigger event name "' + name; + ;;; kukit.E += '" on namespace "' + namespace; + ;;; kukit.E += '", because the method "' + methodname + '" does not exist.'; + throw kukit.E; } // call it oper.binderinstance = this; @@ -452,8 +459,9 @@ //binderinstance.__bound_rules__ = []; } else if (binderinfo.getBinderInstance().__binder_classname__ != classname) { // just paranoia - ;;; throw 'Conflicting class for event id "' + id + '", "' + binderinfo.getBinderInstance().__binder_classname__ + '" != "' + classname + '"'; - throw 'E'; + ;;; kukit.E = 'Conflicting class for event id "' + id + '", "'; + ;;; kukit.E += binderinfo.getBinderInstance().__binder_classname__ + '" != "' + classname + '"'; + throw kukit.E; } return binderinfo; }; @@ -462,8 +470,8 @@ // Get an event. var binderinfo = this.info[id]; if (typeof(binderinfo) == 'undefined') { - ;;; throw 'Event with id "' + id + '" not found.'; - throw 'E'; + ;;; kukit.E = 'Event with id "' + id + '" not found.'; + throw kukit.E; } return binderinfo; }; @@ -475,8 +483,9 @@ var id = kukit.rd.makeId(namespace, classname); var binderinfo = this.info[id]; if (typeof(binderinfo) == 'undefined') { - ;;; throw 'Singleton event with namespace "' + namespace + '" and (event) name "' + name + '" not found.'; - throw 'E'; + ;;; kukit.E = 'Singleton event with namespace "' + namespace; + ;;; kukit.E += '" and (event) name "' + name + '" not found.'; + throw kukit.E; } return binderinfo; }; @@ -590,8 +599,8 @@ // Create an empty list. rules_per_name = info[name] = {}; } else if (typeof(rules_per_name[nodehash]) != 'undefined') { - ;;; throw 'Mismatch in bind registry, ' + name + ' already bound to node in this instance.'; - throw 'E'; + ;;; kukit.E = 'Mismatch in bind registry, ' + name + ' already bound to node in this instance.'; + throw kukit.E; } return rules_per_name; }; Modified: kukit/kukit.js/branch/ree-stripout-comments/kukit/forms.js ============================================================================== --- kukit/kukit.js/branch/ree-stripout-comments/kukit/forms.js (original) +++ kukit/kukit.js/branch/ree-stripout-comments/kukit/forms.js Mon Jun 11 16:08:40 2007 @@ -247,8 +247,8 @@ kukit.fo.FieldUpdateRegistry.prototype.register = function(node, editor) { var hash = kukit.rd.hashnode(node); if (typeof(this.editors[hash]) != 'undefined') { - ;;; throw 'Double registration of editor update on node.'; - throw 'E'; + ;;; kukit.E = 'Double registration of editor update on node.'; + throw kukit.E; } this.editors[hash] = editor; //kukit.logDebug('Registered '+node.name + ' hash=' + hash); Modified: kukit/kukit.js/branch/ree-stripout-comments/kukit/kssparser.js ============================================================================== --- kukit/kukit.js/branch/ree-stripout-comments/kukit/kssparser.js (original) +++ kukit/kukit.js/branch/ree-stripout-comments/kukit/kssparser.js Mon Jun 11 16:08:40 2007 @@ -74,13 +74,10 @@ // We have evt- parms in the rule. if (block.evt_name != parser.kssSelector.name || block.evt_namespace != parser.kssSelector.namespace) { // XXX this should be done in another way, so that we can see where the error happened. - /* - ;;; */ - block.emitError('kss param key evt-[-]-yyy must not have different [namespace and] name then the kss selector at the top of the rule, "' - + key + '", and inside we have "' + block.evt_namespace + '-' + block.evt_name + '"'); - ;;; /* - */ - block.emitError(''); + ;;; kukit.E = 'kss param key evt-[-]-yyy must not have different '; + ;;; kukit.E += '[namespace and] name then the kss selector at the top of the rule, "'; + ;;; kukit.E += key + '", and inside we have "' + block.evt_namespace + '-' + block.evt_name + '"'; + block.emitError(kukit.E); } } // Create the event rule. (one action only) @@ -161,28 +158,16 @@ // default-error: // var splitkey = key.split('-'); - /* - ;;; */ - if (splitkey.length < 2 || splitkey.length > 4) { - this.emitError( - 'kss param key must be like xxx-yyy or nnn-xxx-yyy or evt-xxx-yyy or evt-nnn-xxx-yyy"' - + key + '"'); - } - ;;; /* - */ + ;;; if (splitkey.length < 2 || splitkey.length > 4) { + ;;; this.emitError('kss param key must be like xxx-yyy or nnn-xxx-yyy or evt-xxx-yyy or evt-nnn-xxx-yyy"' + key + '"'); + ;;; } var name = splitkey[0]; if (name == 'evt') { // evt--: // evt---: - /* - ;;; */ - if (splitkey.length < 3) { - this.emitError( - 'kss param key must be like xxx-yyy or nnn-xxx-yyy or evt-xxx-yyy or evt-nnn-xxx-yyy"' - + key + '"'); - } - ;;; /* - */ + ;;; if (splitkey.length < 3) { + ;;; this.emitError('kss param key must be like xxx-yyy or nnn-xxx-yyy or evt-xxx-yyy or evt-nnn-xxx-yyy"' + key + '"'); + ;;; } var enamespace; var ename; var ekey; @@ -201,20 +186,17 @@ // so that we can check it stays the same within the block. this.evt_name = ename; this.evt_namespace = enamespace; - /* - ;;; */ - } else { - if (ename != this.evt_name || enamespace != this.evt_namespace) { - // Do not allow deviation from the previous event names. - this.emitError('kss param key evt-[-]-yyy must not have different [namespace and] name inside the same rule,"' - + key + '", it must be "' + this.evt_namespace + '-' + this.evt_name + '"'); - } - } - if (value.isMethod != false) { - this.emitError('evt-[nnn-]xxx-yyy: parameter producers are not allowed as value, key "' - + key + '"'); - ;;; /* - */ + ;;; } else { + ;;; if (ename != this.evt_name || enamespace != this.evt_namespace) { + ;;; // Do not allow deviation from the previous event names. + ;;; kukit.E = 'kss param key evt-[-]-yyy must not have different '; + ;;; kukit.E += '[namespace and] name inside the same rule,"' + key + '", it must be "'; + ;;; kukit.E += this.evt_namespace + '-' + this.evt_name + '"'; + ;;; this.emitError(kukit.E); + ;;; } + ;;; } + ;;; if (value.isMethod != false) { + ;;; this.emitError('evt-[nnn-]xxx-yyy: parameter producers are not allowed as value, key "' + key + '"'); } // set it this.evt_parms[ekey] = value.txt; @@ -224,39 +206,22 @@ // action-client: - // action-cancel: // action-cancel: - - /* - ;;; */ - if (splitkey.length != 2) { - this.emitError( - 'action-xxx must not have more "-" in it, key "' + - key + '"'); - } - if (value.isMethod != false) { - this.emitError('action-xxx: parameter producers are not allowed as value, key "' - + key + '"'); - } - ;;; /* - */ + ;;; if (splitkey.length != 2) { + ;;; this.emitError('action-xxx must not have more "-" in it, key "' + key + '"'); + ;;; } + ;;; if (value.isMethod != false) { + ;;; this.emitError('action-xxx: parameter producers are not allowed as value, key "' + key + '"'); + ;;; } var atab = {'server': 'S', 'client': 'C', 'cancel': 'X'}; var actionType = atab[splitkey[1]]; - /* - ;;; */ - if (! actionType) { - this.emitError('action-xxx: key must be action-server or action-client or action-cancel, key "' - + key + '"'); - } - ;;; /* - */ - // force value to be or - - var splitvalue = value.txt.split('-'); - /* - ;;; */ - if (splitvalue.length > 2) { - this.emitError('action-xxx: value must be or -, key "' - + key + '"'); - } - ;;; /* - */ + ;;; if (! actionType) { + ;;; this.emitError('action-xxx: key must be action-server or action-client or action-cancel, key "' + key + '"'); + ;;; } + ;;; // force value to be or - + ;;; var splitvalue = value.txt.split('-'); + ;;; if (splitvalue.length > 2) { + ;;; this.emitError('action-xxx: value must be or -, key "' + key + '"'); + ;;; } // set it var action = this.actions.getOrCreateAction(value.txt); if (actionType != 'X' || action.type == null) { @@ -292,14 +257,9 @@ case 'error': { // -error: // default-error: - /* - ;;; */ - if (value.isMethod != false) { - this.emitError('xxx-error: parameter producers are not allowed as value, key "' - + key + '"'); - } - ;;; /* - */ + ;;; if (value.isMethod != false) { + ;;; this.emitError('xxx-error: parameter producers are not allowed as value, key "' + key + '"'); + ;;; } action.setError(value.txt); // also create the action for the error itself. var err_action = this.actions.getOrCreateAction(value.txt); @@ -327,8 +287,8 @@ // Check also sets the parameter provider on the value. value.check(registry); } catch(e) { - ;;; throw new kukit.err.tk.ParsingError('Error in value: ' + e, this.src.makeMarker(this.startpos)); - throw "E"; + ;;; kukit.E = new kukit.err.tk.ParsingError('Error in value: ' + e, this.src.makeMarker(this.startpos)); + throw kukit.E; } } break; } Modified: kukit/kukit.js/branch/ree-stripout-comments/kukit/kukit.js ============================================================================== --- kukit/kukit.js/branch/ree-stripout-comments/kukit/kukit.js (original) +++ kukit/kukit.js/branch/ree-stripout-comments/kukit/kukit.js Mon Jun 11 16:08:40 2007 @@ -159,10 +159,8 @@ } } if (found) { - ;;; this.bindScheduler.addPre(deferred_setup_events, 'setting up events for ' + targetmsg); - ;;; /* - this.bindScheduler.addPre(deferred_setup_events, ''); - ;;; */ + ;;; kukit.E = 'setting up events for ' + targetmsg; + this.bindScheduler.addPre(deferred_setup_events, kukit.E); } }; Modified: kukit/kukit.js/branch/ree-stripout-comments/kukit/oper.js ============================================================================== --- kukit/kukit.js/branch/ree-stripout-comments/kukit/oper.js (original) +++ kukit/kukit.js/branch/ree-stripout-comments/kukit/oper.js Mon Jun 11 16:08:40 2007 @@ -77,14 +77,9 @@ return; } for (var key in dict) { - /* - ;;; */ - if (restricted && (key == 'node' || key == 'parms' || key == 'eventrule' - || key == 'binderinstance' || key == 'orignode')) { - throw 'Illegal update on oper object, protected attribute "' + key + '"'; - } - ;;; /* - */ + ;;; if (restricted && (key == 'node' || key == 'parms' || key == 'eventrule' || key == 'binderinstance' || key == 'orignode')) { + ;;; throw 'Illegal update on oper object, protected attribute "' + key + '"'; + ;;; } var value = dict[key]; if (typeof(value) != 'function') { this[key] = value; @@ -119,8 +114,9 @@ nodes = this.aparms[key]; } break; default: { - ;;; throw 'No kss parameter "' + key + '" allowed in action-client. (Normal parameters cannot start with kss.)'; - throw 'E'; + ;;; kukit.E = 'No kss parameter "' + key + '" allowed in action-client.'; + ;;; kukit.E += ' (Normal parameters cannot start with kss.)'; + throw kukit.E; } break; } } @@ -174,24 +170,15 @@ }; kukit.op.Oper.prototype.executeServerAction = function(name) { - /* - ;;; */ - for (key in this.aparms) { - switch (key) { - case 'kssUrl': { - // Value will be evaluated. - } break; - case 'kssSubmitForm': { - // Value will be evaluated. - } break; - default: { - throw 'No kss parameter "' + key + '" allowed in action-server. (Normal parameters cannot start with kss.)'; - } break; - } - } - ;;; /* - */ - + ;;; for (key in this.aparms) { + ;;; if (key == 'kssUrl') { + ;;; // Value will be evaluated. + ;;; } else if (key == 'kssSubmitForm') { + ;;; // Value will be evaluated. + ;;; } else { + ;;; throw 'No kss parameter "' + key + '" allowed in action-server. (Normal parameters cannot start with kss.)'; + ;;; } + ;;; } // oper will be accessible to some commands that execute in return var sa = new kukit.sa.ServerAction(name, this); }; @@ -299,25 +286,19 @@ kukit.op.Oper.prototype.evalBool = function(key, errname) { var value = this.parms[key]; - ;;; this.parms[key] = kukit.ut.evalBool(value, 'for key "' + key + '" in ' + errname); - ;;; /* - this.parms[key] = kukit.ut.evalBool(value, ''); - ;;; */ + ;;; kukit.E = 'for key "' + key + '" in ' + errname; + this.parms[key] = kukit.ut.evalBool(value, kukit.E); }; kukit.op.Oper.prototype.evalInt = function(key, errname) { var value = this.parms[key]; - ;;; this.parms[key] = kukit.ut.evalInt(value, 'for key "' + key + '" in ' + errname || this.componentname); - ;;; /* - this.parms[key] = kukit.ut.evalInt(value, ''); - ;;; */ + ;;; kukit.E = 'for key "' + key + '" in ' + errname || this.componentname; + this.parms[key] = kukit.ut.evalInt(value, kukit.E); }; kukit.op.Oper.prototype.evalList = function(key, errname) { var value = this.parms[key]; - ;;; this.parms[key] = kukit.ut.evalList(value, 'for key "' + key + '" in ' + errname || this.componentname); - ;;; /* - this.parms[key] = kukit.ut.evalList(value, ''); - ;;; */ + ;;; kukit.E = 'for key "' + key + '" in ' + errname || this.componentname; + this.parms[key] = kukit.ut.evalList(value, kukit.E); }; Modified: kukit/kukit.js/branch/ree-stripout-comments/kukit/plugin.js ============================================================================== --- kukit/kukit.js/branch/ree-stripout-comments/kukit/plugin.js (original) +++ kukit/kukit.js/branch/ree-stripout-comments/kukit/plugin.js Mon Jun 11 16:08:40 2007 @@ -339,31 +339,37 @@ loadoper = null; // with the legacy loads we suppose autodetect=false iloadoper.parms.autodetect = false; - ;;; kukit.logWarning('Deprecated the use of "load" event for iframes. It will behave differently in the future. Use the "iload" event (maybe with evt-iload-autodetect: false) instead!'); + ;;; kukit.E = 'Deprecated the use of "load" event for iframes. It will behave differently in the future. '; + ;;; kukit.E += 'Use the "iload" event (maybe with evt-iload-autodetect: false) instead!'; + ;;; kukit.logWarning(kukit.E); } } else { // Not an iframe. So iload is not usable. if (iloadoper) { - ;;; throw 'iload event can only be bound on an iframe node.'; - throw 'E'; + ;;; kukit.E = 'iload event can only be bound on an iframe node.'; + throw kukit.E; } } // Now, bind the events. if (loadoper) { - ;;; kukit.logDebug('EventRule #' + loadoper.eventrule.getNr() + ' mergeid ' + loadoper.eventrule.kss_selector.mergeid + ' event selected normal postponed execution.'); + ;;; kukit.E = 'EventRule #' + loadoper.eventrule.getNr() + ' mergeid '; + ;;; kukit.E += loadoper.eventrule.kss_selector.mergeid; + ;;; kukit.E += ' event selected normal postponed execution.'; + ;;; kukit.logDebug(kukit.E); // for any other node than iframe, or even for iframe in phase1, we need to execute immediately. var func_to_bind = loadoper.makeExecuteActionsHook(); - ;;; kukit.engine.bindScheduler.addPost(func_to_bind, 'Execute load event for node ' + loadoper.node.tagName.toLowerCase()); - ;;; /* - kukit.engine.bindScheduler.addPost(func_to_bind, ''); - ;;; */ + ;;; kukit.E = 'Execute load event for node ' + loadoper.node.tagName.toLowerCase(); + kukit.engine.bindScheduler.addPost(func_to_bind, kukit.E); } if (iloadoper) { var phase = iloadoper.node._kukitmark; // For phase 2 we need to execute posponed, for phase1 immediately. // XXX it would be better not need this and do always postponed. if (phase == 2 || (phase == 1 && kukit.engine.initializedOnDOMLoad)) { - ;;; kukit.logDebug('EventRule #' + iloadoper.eventrule.getNr() + ' mergeid ' + iloadoper.eventrule.kss_selector.mergeid + ' event selected delayed execution (when iframe loaded)'); + ;;; kukit.E = 'EventRule #' + iloadoper.eventrule.getNr() + ' mergeid '; + ;;; kukit.E += iloadoper.eventrule.kss_selector.mergeid; + ;;; kukit.E += ' event selected delayed execution (when iframe loaded)'; + ;;; kukit.logDebug(kukit.E); // We want the event execute once the iframe is loaded. // In a somewhat tricky way, we start the scheduler only from the normal delayed execution. This will enable that in // case we had a load event on the same node, it could modify the name and id parameters and we only start @@ -372,24 +378,21 @@ var g = function() { var f = function() { var func_to_bind = iloadoper.makeExecuteActionsHook(); - ;;; kukit.engine.bindScheduler.addPost(func_to_bind, 'Execute iload event for iframe ' + iloadoper.node.name); - ;;; /* - kukit.engine.bindScheduler.addPost(func_to_bind, ''); - ;;; */ + ;;; kukit.E = 'Execute iload event for iframe ' + iloadoper.node.name; + kukit.engine.bindScheduler.addPost(func_to_bind, kukit.E); }; new kukit.dom.EmbeddedContentLoadedScheduler(iloadoper.node.id, f, iloadoper.parms.autodetect); }; - ;;; kukit.engine.bindScheduler.addPost(g, 'Schedule iload event for iframe ' + iloadoper.node.name); - ;;; /* - kukit.engine.bindScheduler.addPost(g, ''); - ;;; */ + ;;; kukit.E = 'Schedule iload event for iframe ' + iloadoper.node.name; + kukit.engine.bindScheduler.addPost(g, kukit.E); } else { - ;;; kukit.logDebug('EventRule #' + iloadoper.eventrule.getNr() + ' mergeid ' + iloadoper.eventrule.kss_selector.mergeid + ' event selected normal postponed execution.'); + ;;; kukit.E = 'EventRule #' + iloadoper.eventrule.getNr() + ' mergeid '; + ;;; kukit.E += iloadoper.eventrule.kss_selector.mergeid; + ;;; kukit.E += ' event selected normal postponed execution.'; + ;;; kukit.logDebug(kukit.E); var func_to_bind = iloadoper.makeExecuteActionsHook(); - ;;; kukit.engine.bindScheduler.addPost(func_to_bind, 'Execute iload event for iframe ' + iloadoper.node.name); - ;;; /* - kukit.engine.bindScheduler.addPost(func_to_bind, ''); - ;;; */ + ;;; kukit.E = 'Execute iload event for iframe ' + iloadoper.node.name; + kukit.engine.bindScheduler.addPost(func_to_bind, kukit.E); } } }; @@ -569,8 +572,8 @@ ;;; oper.componentname = 'setAttribute action'; oper.completeParms(['name', 'value'], {}); if (oper.parms.name.toLowerCase() == 'style') { - ;;; throw 'Style attribute is not allowed with setAttribute'; - throw 'E'; + ;;; kukit.E = 'Style attribute is not allowed with setAttribute'; + throw kukit.E; } kukit.dom.setAttribute(oper.node, oper.parms.name, oper.parms.value); }); Modified: kukit/kukit.js/branch/ree-stripout-comments/kukit/providerreg.js ============================================================================== --- kukit/kukit.js/branch/ree-stripout-comments/kukit/providerreg.js (original) +++ kukit/kukit.js/branch/ree-stripout-comments/kukit/providerreg.js Mon Jun 11 16:08:40 2007 @@ -54,8 +54,8 @@ // default provider for the strings return kukit.pr.IdentityPP; } else { - ;;; throw 'Error : undefined parameter provider "' + name + '"'; - throw 'E'; + ;;; kukit.E = 'Error : undefined parameter provider "' + name + '"'; + throw kukit.E; } } return func; @@ -158,10 +158,8 @@ var argname = args[0]; var recurseParents = false; if (args.length == 2) { - ;;; kukit.ut.evalBool(args[1], '2nd attribute of currentFormVarForKssAttr must be a boolean'); - ;;; /* - kukit.ut.evalBool(args[1], ''); - ;;; */ + ;;; kukit.E = '2nd attribute of currentFormVarForKssAttr must be a boolean'; + kukit.ut.evalBool(args[1], kukit.E); recurseParents = args[1]; } var formvarname = kukit.dom.getRecursiveAttribute(node, argname, recurseParents, kukit.dom.getKssAttribute); @@ -231,10 +229,8 @@ var recurseParents = false; if (args.length == 2) { recurseParents = args[1]; - ;;; kukit.ut.evalBool(recurseParents, '2nd attribute of nodeAttr must be a boolean'); - ;;; /* - kukit.ut.evalBool(recurseParents, ''); - ;;; */ + ;;; kukit.E = '2nd attribute of nodeAttr must be a boolean'; + kukit.ut.evalBool(recurseParents, kukit.E); } return kukit.dom.getRecursiveAttribute(node, argname, recurseParents, kukit.dom.getAttribute); } @@ -260,10 +256,8 @@ var recurseParents = false; if (args.length == 2) { recurseParents = args[1]; - ;;; kukit.ut.evalBool(recurseParents, '2nd attribute of kssAttr must be a boolean'); - ;;; /* - kukit.ut.evalBool(recurseParents, '2nd attribute of kssAttr must be a boolean'); - ;;; */ + ;;; kukit.E = '2nd attribute of kssAttr must be a boolean'; + kukit.ut.evalBool(recurseParents, kukit.E); } return kukit.dom.getRecursiveAttribute(node, argname, recurseParents, kukit.dom.getKssAttribute); } @@ -307,8 +301,8 @@ var value = kukit.engine.statevars[key]; if (typeof(value) == 'undefined') { // notfound arguments will get null - ;;; throw 'Nonexistent statevar "'+ key +'"'; - throw 'E'; + ;;; kukit.E = 'Nonexistent statevar "'+ key +'"'; + throw kukit.E; } return value; } @@ -331,8 +325,8 @@ var value = defaultparms[key]; if (typeof(value) == 'undefined') { // notfound arguments will get null - ;;; throw 'Nonexistent default parm "'+ key +'"'; - throw 'E'; + ;;; kukit.E = 'Nonexistent default parm "'+ key +'"'; + throw kukit.E; } return value; } Modified: kukit/kukit.js/branch/ree-stripout-comments/kukit/resourcedata.js ============================================================================== --- kukit/kukit.js/branch/ree-stripout-comments/kukit/resourcedata.js (original) +++ kukit/kukit.js/branch/ree-stripout-comments/kukit/resourcedata.js Mon Jun 11 16:08:40 2007 @@ -323,8 +323,8 @@ action = new kukit.rd.Action(); this.content[key] = action; } else { - ;;; throw new kukit.err.rd.RuleMergeError('Cannot action-delete unexisting action, "' + key + '"'); - throw 'E'; + ;;; kukit.E = new kukit.err.rd.RuleMergeError('Cannot action-delete unexisting action, "' + key + '"'); + throw kukit.E; } } if (action2.type != 'X') { Modified: kukit/kukit.js/branch/ree-stripout-comments/kukit/selectorreg.js ============================================================================== --- kukit/kukit.js/branch/ree-stripout-comments/kukit/selectorreg.js (original) +++ kukit/kukit.js/branch/ree-stripout-comments/kukit/selectorreg.js Mon Jun 11 16:08:40 2007 @@ -73,8 +73,8 @@ var value = defaultparms[args[0]]; if (typeof(value) == 'undefined') { // notfound arguments will get null - ;;; throw 'Nonexistent default parm "'+ key +'"'; - throw 'E'; + ;;; kukit.E = 'Nonexistent default parm "'+ key +'"'; + throw kukit.E; } nodes = [value]; return nodes; Modified: kukit/kukit.js/branch/ree-stripout-comments/kukit/serveraction.js ============================================================================== --- kukit/kukit.js/branch/ree-stripout-comments/kukit/serveraction.js (original) +++ kukit/kukit.js/branch/ree-stripout-comments/kukit/serveraction.js Mon Jun 11 16:08:40 2007 @@ -157,8 +157,8 @@ try { dom = (new DOMParser()).parseFromString(payload, "text/xml"); } catch(e) { - ;;; throw new kukit.err.ResponseParsingError('Error parsing X-KSSCOMMANDS header.'); - throw 'E'; + ;;; kukit.E = new kukit.err.ResponseParsingError('Error parsing X-KSSCOMMANDS header.'); + throw kukit.E; } commandstags = kukit.dom.getNsTags(dom, 'commands'); if (commandstags.length != 1) { @@ -172,17 +172,17 @@ dom = domDoc.responseXML; ;;; var errtxt = 'Unknown server error (invalid KSS response, no error info received)'; ;;; if (dom && dom.parseError && (dom.parseError != 0)) { - ;;; throw new kukit.err.ResponseParsingError(errtxt + ': ' + Sarissa.getParseErrorText(dom)); + ;;; kukit.E = new kukit.err.ResponseParsingError(errtxt + ': ' + Sarissa.getParseErrorText(dom)); ;;; } else { - ;;; throw new kukit.err.ResponseParsingError(errtxt); + ;;; kukit.E = new kukit.err.ResponseParsingError(errtxt); ;;; } - throw 'E'; + throw kukit.E; } } if (dom == null) { // this should not happen - ;;; throw new kukit.err.ResponseParsingError('Neither xml nor html payload.'); - throw 'E'; + ;;; kukit.E = new kukit.err.ResponseParsingError('Neither xml nor html payload.'); + throw kukit.E; } // find the commands (atm we don't limit ourselves inside the commandstag) var commands = kukit.dom.getNsTags(dom, 'command'); @@ -211,17 +211,17 @@ ;;; reason = ', server_reason="' + errorcommand.parms.message + '" '; ;;; } if (error_action) { - /* - ;;; */ - kukit.logWarning('Request failed at url ' + this.oper.queueItem.url + - ', rid=' + this.oper.queueItem.rid + reason + ', will be handled by action "' + error_action.name + '"'); + ;;; kukit.E = 'Request failed at url ' + this.oper.queueItem.url; + ;;; kukit.E += ', rid=' + this.oper.queueItem.rid + reason; + ;;; kukit.E += ', will be handled by action "' + error_action.name + '"'; + ;;; kukit.logWarning(kukit.E); // Individual error handler was defined. Execute it! - ;;; /* - */ error_action.execute(this.oper); } else { // Unhandled: just log it... - ;;; kukit.logError('Request failed at url ' + this.oper.queueItem.url + ', rid=' + this.oper.queueItem.rid + reason); + ;;; kukit.E = 'Request failed at url ' + this.oper.queueItem.url; + ;;; kukit.E += ', rid=' + this.oper.queueItem.rid + reason; + ;;; kukit.logError(kukit.E); } }; Modified: kukit/kukit.js/branch/ree-stripout-comments/kukit/tokenizer.js ============================================================================== --- kukit/kukit.js/branch/ree-stripout-comments/kukit/tokenizer.js (original) +++ kukit/kukit.js/branch/ree-stripout-comments/kukit/tokenizer.js Mon Jun 11 16:08:40 2007 @@ -31,8 +31,8 @@ kukit.tk._TokenBase.prototype.emitError = function(txt) { // Use the start position of the token for the error report. - ;;; throw new kukit.err.tk.ParsingError(txt, this.src.makeMarker(this.startpos)); - throw 'E'; + ;;; kukit.E = new kukit.err.tk.ParsingError(txt, this.src.makeMarker(this.startpos)); + throw kukit.E; }; kukit.tk._TokenBase.prototype.setSrcStatus = function(eofOk) { Modified: kukit/kukit.js/branch/ree-stripout-comments/kukit/utils.js ============================================================================== --- kukit/kukit.js/branch/ree-stripout-comments/kukit/utils.js (original) +++ kukit/kukit.js/branch/ree-stripout-comments/kukit/utils.js Mon Jun 11 16:08:40 2007 @@ -1,9 +1,6 @@ /* -* Copyright (c) 2005-2006 -* Authors: -* Godefroid Chapelle -* Florian Schulze -* Balazs Ree +* Copyright (c) 2005-2007 +* Authors: KSS Project Contributors (see docs/CREDITS.txt) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as published @@ -31,15 +28,37 @@ ;;; * ---------------------------------------------------------------- ;;; */ +/* + * kukit.E is a proxy variable used globally for error and info messages. + * This assure the following code can be used: + * + * ;;; kukit.E = 'This is the error message'; + * throw kukit.E; + * + * or: + * + * ;;; kukit.E = 'The event' + event + ' caused problems'; + * method_with_info(x, kukit.E); + * + * or even: + * + * ;;; kukit.E = 'The event' + event + ' caused problems '; + * ;;; kukit.E += 'and this is a very long line '; + * ;;; kukit.E += 'so we split it to parts for better readibility'; + * ;;; kukit.logWarning(kukit.E); + * + */ +kukit.E = 'Unknown message (kss optimized for production mode)'; + // Browser identification. We need these switches only at the moment. try { kukit.HAVE_SAFARI = navigator.vendor && navigator.vendor.indexOf('Apple') != -1; kukit.HAVE_IE = eval("_SARISSA_IS_IE"); } catch (e) {} -// Activation of extra logging panel: if necessary -// this allows to start the logging panel from the browser with -// javascript:kukit.showlog(); +;;; // Activation of extra logging panel: if necessary +;;; // this allows to start the logging panel from the browser with +;;; // javascript:kukit.showlog(); ;;; kukit.showlog = function() { ;;; kukit.logWarning('Logging is on the console: request to show logging pane ignored'); ;;; }; @@ -53,62 +72,40 @@ // } kukit.hasFirebug = false; -/* check whether the logging stuff of Firebug is available */ -/* -;;; */ -if (typeof kukit.log == 'undefined' && - typeof console != 'undefined' && - typeof console.log != 'undefined' && - typeof console.debug != 'undefined' && - typeof console.error != 'undefined' && - typeof console.warn != 'undefined') { - kukit.log = console.log; - kukit.logDebug = console.debug; - kukit.logFatal = console.error; - kukit.logError = console.error; - kukit.logWarning = console.warn; - kukit.hasFirebug = true; -} -;;; /* - */ +;;; // check whether the logging stuff of Firebug is available +;;; if (typeof kukit.log == 'undefined' && typeof console != 'undefined' && typeof console.log != 'undefined' && typeof console.debug != 'undefined' && typeof console.error != 'undefined' && typeof console.warn != 'undefined') { +;;; kukit.log = console.log; +;;; kukit.logDebug = console.debug; +;;; kukit.logFatal = console.error; +;;; kukit.logError = console.error; +;;; kukit.logWarning = console.warn; +;;; kukit.hasFirebug = true; +;;; } -/* check whether the logging stuff of MochiKit is available */ -/* -;;; */ -if (typeof kukit.log == 'undefined' && - typeof MochiKit != 'undefined' && - typeof MochiKit.Logging != 'undefined' && - typeof MochiKit.Logging.log != 'undefined') { - kukit.log = MochiKit.Logging.log; - kukit.logError = MochiKit.Logging.logError; - kukit.logDebug = MochiKit.Logging.logDebug; - kukit.logFatal = MochiKit.Logging.logFatal; - kukit.logWarning = MochiKit.Logging.logWarning; - // make convenience url - // javascript:kukit.showlog(); - // instead of the need to say - // javascript:void(createLoggingPane(true)); - kukit.showlog = function() { - createLoggingPane(true); - }; -} -;;; /* - */ +;;; // check whether the logging stuff of MochiKit is available +;;; if (typeof kukit.log == 'undefined' && typeof MochiKit != 'undefined' && typeof MochiKit.Logging != 'undefined' && typeof MochiKit.Logging.log != 'undefined') { +;;; kukit.log = MochiKit.Logging.log; +;;; kukit.logError = MochiKit.Logging.logError; +;;; kukit.logDebug = MochiKit.Logging.logDebug; +;;; kukit.logFatal = MochiKit.Logging.logFatal; +;;; kukit.logWarning = MochiKit.Logging.logWarning; +;;; // make convenience url +;;; // javascript:kukit.showlog(); +;;; // instead of the need to say +;;; // javascript:void(createLoggingPane(true)); +;;; kukit.showlog = function() { +;;; createLoggingPane(true); +;;; }; +;;; } -/* check whether the logging stuff of Safari is available */ -/* -;;; */ -if (typeof kukit.log == 'undefined' && - typeof console != 'undefined' && - typeof console.log != 'undefined') { - kukit.log = function(str) { console.log('INFO: '+str); }; - kukit.logError = function(str) { console.log('ERROR: '+str); }; - kukit.logDebug = function(str) { console.log('DEBUG: '+str); }; - kukit.logFatal = function(str) { console.log('FATAL: '+str); }; - kukit.logWarning = function(str) { console.log('WARNING: '+str); }; -} -;;; /* - */ +;;; // check whether the logging stuff of Safari is available +;;; if (typeof kukit.log == 'undefined' && typeof console != 'undefined' && typeof console.log != 'undefined') { +;;; kukit.log = function(str) { console.log('INFO: '+str); }; +;;; kukit.logError = function(str) { console.log('ERROR: '+str); }; +;;; kukit.logDebug = function(str) { console.log('DEBUG: '+str); }; +;;; kukit.logFatal = function(str) { console.log('FATAL: '+str); }; +;;; kukit.logWarning = function(str) { console.log('WARNING: '+str); }; +;;; } /* no logging solution available */ ;;; if (typeof kukit.log == 'undefined') { @@ -277,8 +274,8 @@ kukit.ut.TimerCounter.prototype.start = function() { if (this.timer) { - ;;; throw 'Timer already started.'; - throw 'E'; + ;;; kukit.E = 'Timer already started.'; + throw kukit.E; } var self = this; var func = function() { From reebalazs at codespeak.net Mon Jun 11 16:17:47 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Mon, 11 Jun 2007 16:17:47 +0200 (CEST) Subject: [KSS-checkins] r44142 - kukit/kss.core/branch/ree-stripout-comments/kss/core Message-ID: <20070611141747.C2A3B8143@code0.codespeak.net> Author: reebalazs Date: Mon Jun 11 16:17:47 2007 New Revision: 44142 Modified: kukit/kss.core/branch/ree-stripout-comments/kss/core/concatresource.zcml Log: Adjust packing level properly. for production: use safe, as the full packing may cause problems. for the old RR resource: use devel (the entire code but ;;;-s removed) Modified: kukit/kss.core/branch/ree-stripout-comments/kss/core/concatresource.zcml ============================================================================== --- kukit/kss.core/branch/ree-stripout-comments/kss/core/concatresource.zcml (original) +++ kukit/kss.core/branch/ree-stripout-comments/kss/core/concatresource.zcml Mon Jun 11 16:17:47 2007 @@ -43,7 +43,7 @@ kukit/kukit/forms.js kukit/kukit/plugin.js" name="kukit.js" - compress_level="full" + compress_level="safe" /> @@ -73,7 +73,7 @@ /> - + From reebalazs at codespeak.net Mon Jun 11 16:22:55 2007 From: reebalazs at codespeak.net (reebalazs at codespeak.net) Date: Mon, 11 Jun 2007 16:22:55 +0200 (CEST) Subject: [KSS-checkins] r44143 - kukit/azax/branch/1.1-ree-plugin-dad Message-ID: <20070611142255.12BF68142@code0.codespeak.net> Author: reebalazs Date: Mon Jun 11 16:22:54 2007 New Revision: 44143 Modified: kukit/azax/branch/1.1-ree-plugin-dad/concatresource.zcml Log: Fix packing level: devel is used with the old RR resource (;;;-s removed) Modified: kukit/azax/branch/1.1-ree-plugin-dad/concatresource.zcml ============================================================================== --- kukit/azax/branch/1.1-ree-plugin-dad/concatresource.zcml (original) +++ kukit/azax/branch/1.1-ree-plugin-dad/concatresource.zcml Mon Jun 11 16:22:54 2007 @@ -74,7 +74,7 @@ kukit/kukit/forms.js kukit/kukit/plugin.js" name="kukit-src.js" - compress_level="none" + compress_level="devel" />