Fixing an issue with output parameters that are of type IntPtr
[castle.git] / MonoRail / Castle.MonoRail.Framework / JSResources / Behaviour.resx
bloba3778cdbf7ea4bd0dbc9a3dd7d59cd6117aff48f
1 <?xml version="1.0" encoding="utf-8"?>
2 <root>
3 <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
4 <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
5 <xsd:element name="root" msdata:IsDataSet="true">
6 <xsd:complexType>
7 <xsd:choice maxOccurs="unbounded">
8 <xsd:element name="metadata">
9 <xsd:complexType>
10 <xsd:sequence>
11 <xsd:element name="value" type="xsd:string" minOccurs="0" />
12 </xsd:sequence>
13 <xsd:attribute name="name" use="required" type="xsd:string" />
14 <xsd:attribute name="type" type="xsd:string" />
15 <xsd:attribute name="mimetype" type="xsd:string" />
16 <xsd:attribute ref="xml:space" />
17 </xsd:complexType>
18 </xsd:element>
19 <xsd:element name="assembly">
20 <xsd:complexType>
21 <xsd:attribute name="alias" type="xsd:string" />
22 <xsd:attribute name="name" type="xsd:string" />
23 </xsd:complexType>
24 </xsd:element>
25 <xsd:element name="data">
26 <xsd:complexType>
27 <xsd:sequence>
28 <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
29 <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
30 </xsd:sequence>
31 <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
32 <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
33 <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
34 <xsd:attribute ref="xml:space" />
35 </xsd:complexType>
36 </xsd:element>
37 <xsd:element name="resheader">
38 <xsd:complexType>
39 <xsd:sequence>
40 <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
41 </xsd:sequence>
42 <xsd:attribute name="name" type="xsd:string" use="required" />
43 </xsd:complexType>
44 </xsd:element>
45 </xsd:choice>
46 </xsd:complexType>
47 </xsd:element>
48 </xsd:schema>
49 <resheader name="resmimetype">
50 <value>text/microsoft-resx</value>
51 </resheader>
52 <resheader name="version">
53 <value>2.0</value>
54 </resheader>
55 <resheader name="reader">
56 <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
57 </resheader>
58 <resheader name="writer">
59 <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
60 </resheader>
61 <data name="jsfunctions" xml:space="preserve">
62 <value><![CDATA[
64 Behaviour v1.1 by Ben Nolan, June 2005. Based largely on the work
65 of Simon Willison (see comments by Simon below).
67 Description:
69 Uses css selectors to apply javascript behaviours to enable
70 unobtrusive javascript in html documents.
72 Usage:
74 var myrules = {
75 'b.someclass' : function(element){
76 element.onclick = function(){
77 alert(this.innerHTML);
80 '#someid u' : function(element){
81 element.onmouseover = function(){
82 this.innerHTML = "BLAH!";
87 Behaviour.register(myrules);
89 // Call Behaviour.apply() to re-apply the rules (if you
90 // update the dom, etc).
92 License:
94 This file is entirely BSD licensed.
96 More information:
98 http://ripcord.co.nz/behaviour/
102 var Behaviour = {
103 list : new Array,
105 register : function(sheet){
106 Behaviour.list.push(sheet);
109 start : function(){
110 Behaviour.addLoadEvent(function(){
111 Behaviour.apply();
115 apply : function(){
116 for (h=0;sheet=Behaviour.list[h];h++){
117 for (selector in sheet){
118 list = document.getElementsBySelector(selector);
120 if (!list){
121 continue;
124 for (i=0;element=list[i];i++){
125 sheet[selector](element);
131 addLoadEvent : function(func){
132 var oldonload = window.onload;
134 if (typeof window.onload != 'function') {
135 window.onload = func;
136 } else {
137 window.onload = function() {
138 oldonload();
139 func();
145 Behaviour.start();
148 The following code is Copyright (C) Simon Willison 2004.
150 document.getElementsBySelector(selector)
151 - returns an array of element objects from the current document
152 matching the CSS selector. Selectors can contain element names,
153 class names and ids and can be nested. For example:
155 elements = document.getElementsBySelect('div#main p a.external')
157 Will return an array of all 'a' elements with 'external' in their
158 class attribute that are contained inside 'p' elements that are
159 contained inside the 'div' element which has id="main"
161 New in version 0.4: Support for CSS2 and CSS3 attribute selectors:
162 See http://www.w3.org/TR/css3-selectors/#attribute-selectors
164 Version 0.4 - Simon Willison, March 25th 2003
165 -- Works in Phoenix 0.5, Mozilla 1.3, Opera 7, Internet Explorer 6, Internet Explorer 5 on Windows
166 -- Opera 7 fails
169 function getAllChildren(e) {
170 // Returns all children of element. Workaround required for IE5/Windows. Ugh.
171 return e.all ? e.all : e.getElementsByTagName('*');
174 document.getElementsBySelector = function(selector) {
175 // Attempt to fail gracefully in lesser browsers
176 if (!document.getElementsByTagName) {
177 return new Array();
179 // Split selector in to tokens
180 var tokens = selector.split(' ');
181 var currentContext = new Array(document);
182 for (var i = 0; i < tokens.length; i++) {
183 token = tokens[i].replace(/^\s+/,'').replace(/\s+$/,'');;
184 if (token.indexOf('#') > -1) {
185 // Token is an ID selector
186 var bits = token.split('#');
187 var tagName = bits[0];
188 var id = bits[1];
189 var element = document.getElementById(id);
190 if (tagName && element.nodeName.toLowerCase() != tagName) {
191 // tag with that ID not found, return false
192 return new Array();
194 // Set currentContext to contain just this element
195 currentContext = new Array(element);
196 continue; // Skip to next token
198 if (token.indexOf('.') > -1) {
199 // Token contains a class selector
200 var bits = token.split('.');
201 var tagName = bits[0];
202 var className = bits[1];
203 if (!tagName) {
204 tagName = '*';
206 // Get elements matching tag, filter them for class selector
207 var found = new Array;
208 var foundCount = 0;
209 for (var h = 0; h < currentContext.length; h++) {
210 var elements;
211 if (tagName == '*') {
212 elements = getAllChildren(currentContext[h]);
213 } else {
214 elements = currentContext[h].getElementsByTagName(tagName);
216 for (var j = 0; j < elements.length; j++) {
217 found[foundCount++] = elements[j];
220 currentContext = new Array;
221 var currentContextIndex = 0;
222 for (var k = 0; k < found.length; k++) {
223 if (found[k].className && found[k].className.match(new RegExp('\\b'+className+'\\b'))) {
224 currentContext[currentContextIndex++] = found[k];
227 continue; // Skip to next token
229 // Code to deal with attribute selectors
230 if (token.match(/^(\w*)\[(\w+)([=~\|\^\$\*]?)=?"?([^\]"]*)"?\]$/)) {
231 var tagName = RegExp.$1;
232 var attrName = RegExp.$2;
233 var attrOperator = RegExp.$3;
234 var attrValue = RegExp.$4;
235 if (!tagName) {
236 tagName = '*';
238 // Grab all of the tagName elements within current context
239 var found = new Array;
240 var foundCount = 0;
241 for (var h = 0; h < currentContext.length; h++) {
242 var elements;
243 if (tagName == '*') {
244 elements = getAllChildren(currentContext[h]);
245 } else {
246 elements = currentContext[h].getElementsByTagName(tagName);
248 for (var j = 0; j < elements.length; j++) {
249 found[foundCount++] = elements[j];
252 currentContext = new Array;
253 var currentContextIndex = 0;
254 var checkFunction; // This function will be used to filter the elements
255 switch (attrOperator) {
256 case '=': // Equality
257 checkFunction = function(e) { return (e.getAttribute(attrName) == attrValue); };
258 break;
259 case '~': // Match one of space seperated words
260 checkFunction = function(e) { return (e.getAttribute(attrName).match(new RegExp('\\b'+attrValue+'\\b'))); };
261 break;
262 case '|': // Match start with value followed by optional hyphen
263 checkFunction = function(e) { return (e.getAttribute(attrName).match(new RegExp('^'+attrValue+'-?'))); };
264 break;
265 case '^': // Match starts with value
266 checkFunction = function(e) { return (e.getAttribute(attrName).indexOf(attrValue) == 0); };
267 break;
268 case '$': // Match ends with value - fails with "Warning" in Opera 7
269 checkFunction = function(e) { return (e.getAttribute(attrName).lastIndexOf(attrValue) == e.getAttribute(attrName).length - attrValue.length); };
270 break;
271 case '*': // Match ends with value
272 checkFunction = function(e) { return (e.getAttribute(attrName).indexOf(attrValue) > -1); };
273 break;
274 default :
275 // Just test for existence of attribute
276 checkFunction = function(e) { return e.getAttribute(attrName); };
278 currentContext = new Array;
279 var currentContextIndex = 0;
280 for (var k = 0; k < found.length; k++) {
281 if (checkFunction(found[k])) {
282 currentContext[currentContextIndex++] = found[k];
285 // alert('Attribute Selector: '+tagName+' '+attrName+' '+attrOperator+' '+attrValue);
286 continue; // Skip to next token
289 if (!currentContext[0]){
290 return;
293 // If we get here, token is JUST an element (not a class or ID selector)
294 tagName = token;
295 var found = new Array;
296 var foundCount = 0;
297 for (var h = 0; h < currentContext.length; h++) {
298 var elements = currentContext[h].getElementsByTagName(tagName);
299 for (var j = 0; j < elements.length; j++) {
300 found[foundCount++] = elements[j];
303 currentContext = found;
305 return currentContext;
308 /* That revolting regular expression explained
309 /^(\w+)\[(\w+)([=~\|\^\$\*]?)=?"?([^\]"]*)"?\]$/
310 \---/ \---/\-------------/ \-------/
311 | | | |
312 | | | The value
313 | | ~,|,^,$,* or =
314 | Attribute
320 </value>
321 </data>
322 </root>