Fixing an issue with output parameters that are of type IntPtr
[castle.git] / MonoRail / Castle.MonoRail.Framework / JSResources / FormHelper.resx
blobac0da1dac82b6849b2e6eefaaf30b86dfde7ee04
1 <?xml version="1.0" encoding="utf-8"?>
2 <root>
3 <!--
4 Microsoft ResX Schema
6 Version 2.0
8 The primary goals of this format is to allow a simple XML format
9 that is mostly human readable. The generation and parsing of the
10 various data types are done through the TypeConverter classes
11 associated with the data types.
13 Example:
15 ... ado.net/XML headers & schema ...
16 <resheader name="resmimetype">text/microsoft-resx</resheader>
17 <resheader name="version">2.0</resheader>
18 <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
19 <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
20 <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
21 <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
22 <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
23 <value>[base64 mime encoded serialized .NET Framework object]</value>
24 </data>
25 <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
26 <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
27 <comment>This is a comment</comment>
28 </data>
30 There are any number of "resheader" rows that contain simple
31 name/value pairs.
33 Each data row contains a name, and value. The row also contains a
34 type or mimetype. Type corresponds to a .NET class that support
35 text/value conversion through the TypeConverter architecture.
36 Classes that don't support this are serialized and stored with the
37 mimetype set.
39 The mimetype is used for serialized objects, and tells the
40 ResXResourceReader how to depersist the object. This is currently not
41 extensible. For a given mimetype the value must be set accordingly:
43 Note - application/x-microsoft.net.object.binary.base64 is the format
44 that the ResXResourceWriter will generate, however the reader can
45 read any of the formats listed below.
47 mimetype: application/x-microsoft.net.object.binary.base64
48 value : The object must be serialized with
49 : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
50 : and then encoded with base64 encoding.
52 mimetype: application/x-microsoft.net.object.soap.base64
53 value : The object must be serialized with
54 : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
55 : and then encoded with base64 encoding.
57 mimetype: application/x-microsoft.net.object.bytearray.base64
58 value : The object must be serialized into a byte array
59 : using a System.ComponentModel.TypeConverter
60 : and then encoded with base64 encoding.
61 -->
62 <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
63 <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
64 <xsd:element name="root" msdata:IsDataSet="true">
65 <xsd:complexType>
66 <xsd:choice maxOccurs="unbounded">
67 <xsd:element name="metadata">
68 <xsd:complexType>
69 <xsd:sequence>
70 <xsd:element name="value" type="xsd:string" minOccurs="0" />
71 </xsd:sequence>
72 <xsd:attribute name="name" use="required" type="xsd:string" />
73 <xsd:attribute name="type" type="xsd:string" />
74 <xsd:attribute name="mimetype" type="xsd:string" />
75 <xsd:attribute ref="xml:space" />
76 </xsd:complexType>
77 </xsd:element>
78 <xsd:element name="assembly">
79 <xsd:complexType>
80 <xsd:attribute name="alias" type="xsd:string" />
81 <xsd:attribute name="name" type="xsd:string" />
82 </xsd:complexType>
83 </xsd:element>
84 <xsd:element name="data">
85 <xsd:complexType>
86 <xsd:sequence>
87 <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
88 <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
89 </xsd:sequence>
90 <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
91 <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
92 <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
93 <xsd:attribute ref="xml:space" />
94 </xsd:complexType>
95 </xsd:element>
96 <xsd:element name="resheader">
97 <xsd:complexType>
98 <xsd:sequence>
99 <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
100 </xsd:sequence>
101 <xsd:attribute name="name" type="xsd:string" use="required" />
102 </xsd:complexType>
103 </xsd:element>
104 </xsd:choice>
105 </xsd:complexType>
106 </xsd:element>
107 </xsd:schema>
108 <resheader name="resmimetype">
109 <value>text/microsoft-resx</value>
110 </resheader>
111 <resheader name="version">
112 <value>2.0</value>
113 </resheader>
114 <resheader name="reader">
115 <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
116 </resheader>
117 <resheader name="writer">
118 <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119 </resheader>
120 <data name="jsfunctions" xml:space="preserve">
121 <value>
122 <![CDATA[
124 function monorail_formhelper_numberonly(e, exceptions, forbidalso)
126 exceptions = exceptions.concat([8,9,13,38,39,40,46]);
127 var code = e.charCode;
128 if (!code) code = e.keyCode;
129 if ((e.ctrlKey && code == 118) || (e.ctrlKey && code == 122))
131 return false;
133 if (e.ctrlKey || e.altKey) return true;
134 for(var i=0; i < forbidalso.length; i++) if (forbidalso[i] == code) return false;
135 for(var i=0; i < exceptions.length; i++) if (exceptions[i] == code) return true;
136 if (code <= 47 || code > 57) return false;
137 return true;
140 function monorail_formhelper_inputfilter(e, forbid)
142 var code = e.charCode;
143 if (!code) code = e.keyCode;
144 for(var i=0; i < forbid.length; i++) if (forbid[i] == code) return false;
148 The scripts on this page was produced by mordechai Sandhaus - 52action.com,
149 and is copyrighted . If you like this script, we encourage you to use it,
150 provided that include this note, and link to 52action.com.
153 function monorail_formhelper_getkeycode(e)
155 if( typeof( e.keyCode ) == 'number' )
157 return e.keyCode;
159 else if( typeof( e.which ) == 'number' )
161 return e.which;
163 else if( typeof( e.charCode ) == 'number' )
165 return e.charCode;
167 else
169 return null;
173 function monorail_formhelper_getevent(e)
175 if (!e)
177 if (window.event)
179 return window.event;
181 else
183 return null;
186 else
188 return e;
192 function monorail_formhelper_mask(e, elem,loc,delim)
194 e = monorail_formhelper_getevent(e);
195 var keycode = monorail_formhelper_getkeycode(e);
197 var locs = loc.split(',');
198 var str = elem.value;
200 for (var i = 0; i <= locs.length; i++)
202 for (var k = 0; k <= str.length; k++)
204 if (k == locs[i])
206 if (str.substring(k, k+1) != delim)
208 if (keycode != 8)
210 str = str.substring(0,k) + delim + str.substring(k,str.length);
216 elem.value = str
220 * Really easy field validation with Prototype
221 * http://tetlaw.id.au/view/javascript/really-easy-field-validation
222 * Andrew Tetlaw
223 * Version 1.5.4.1 (2007-01-05)
225 * Copyright (c) 2007 Andrew Tetlaw
226 * Permission is hereby granted, free of charge, to any person
227 * obtaining a copy of this software and associated documentation
228 * files (the "Software"), to deal in the Software without
229 * restriction, including without limitation the rights to use, copy,
230 * modify, merge, publish, distribute, sublicense, and/or sell copies
231 * of the Software, and to permit persons to whom the Software is
232 * furnished to do so, subject to the following conditions:
234 * The above copyright notice and this permission notice shall be
235 * included in all copies or substantial portions of the Software.
237 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
238 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
239 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
240 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
241 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
242 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
243 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
244 * SOFTWARE.
247 var Validator = Class.create();
249 Validator.prototype = {
250 initialize : function(className, error, test, options) {
251 if(typeof test == 'function'){
252 this.options = $H(options);
253 this._test = test;
254 } else {
255 this.options = $H(test);
256 this._test = function(){return true};
258 this.error = error || 'Validation failed.';
259 this.className = className;
261 test : function(v, elm) {
262 return (this._test(v,elm) && this.options.all(function(p){
263 return Validator.methods[p.key] ? Validator.methods[p.key](v,elm,p.value) : true;
264 }));
267 Validator.methods = {
268 pattern : function(v,elm,opt) {return Validation.get('IsEmpty').test(v) || opt.test(v)},
269 minLength : function(v,elm,opt) {return Validation.get('IsEmpty').test(v) || v.length >= opt},
270 maxLength : function(v,elm,opt) {return Validation.get('IsEmpty').test(v) || v.length <= opt},
271 min : function(v,elm,opt) {return Validation.get('IsEmpty').test(v) || v >= parseFloat(opt)},
272 max : function(v,elm,opt) {return Validation.get('IsEmpty').test(v) || v <= parseFloat(opt)},
273 notOneOf : function(v,elm,opt) {return $A(opt).all(function(value) {
274 return v != value;
275 })},
276 oneOf : function(v,elm,opt) {return $A(opt).any(function(value) {
277 return v == value;
278 })},
279 is : function(v,elm,opt) {return v == opt},
280 isNot : function(v,elm,opt) {return v != opt},
281 equalToField : function(v,elm,opt) {return v == $F(opt)},
282 notEqualToField : function(v,elm,opt) {return v != $F(opt)},
283 include : function(v,elm,opt) {return $A(opt).all(function(value) {
284 return Validation.get(value).test(v,elm);
288 var Validation = Class.create();
290 Validation.prototype = {
291 initialize : function(form, options){
292 this.options = Object.extend({
293 onSubmit : true,
294 stopOnFirst : false,
295 immediate : false,
296 focusOnError : true,
297 useTitles : false,
298 onFormValidate : function(result, form) {},
299 onElementValidate : function(result, elm) {}
300 }, options || {});
301 this.form = $(form);
302 if(this.options.onSubmit) Event.observe(this.form,'submit',this.onSubmit.bind(this),false);
303 if(this.options.immediate) {
304 var useTitles = this.options.useTitles;
305 var callback = this.options.onElementValidate;
306 Form.getElements(this.form).each(function(input) { // Thanks Mike!
307 Event.observe(input, 'blur', function(ev) { Validation.validate(Event.element(ev),{useTitle : useTitles, onElementValidate : callback}); });
311 onSubmit : function(ev){
312 if(!this.validate()) Event.stop(ev);
314 validate : function() {
315 var result = false;
316 var useTitles = this.options.useTitles;
317 var callback = this.options.onElementValidate;
318 if(this.options.stopOnFirst) {
319 result = Form.getElements(this.form).all(function(elm) { return Validation.validate(elm,{useTitle : useTitles, onElementValidate : callback}); });
320 } else {
321 result = Form.getElements(this.form).collect(function(elm) { return Validation.validate(elm,{useTitle : useTitles, onElementValidate : callback}); }).all();
323 if(!result && this.options.focusOnError) {
324 Form.getElements(this.form).findAll(function(elm){return $(elm).hasClassName('validation-failed')}).first().focus()
326 this.options.onFormValidate(result, this.form);
327 return result;
329 reset : function() {
330 Form.getElements(this.form).each(Validation.reset);
334 Object.extend(Validation, {
335 validate : function(elm, options){
336 options = Object.extend({
337 useTitle : false,
338 onElementValidate : function(result, elm) {}
339 }, options || {});
340 elm = $(elm);
341 var cn = elm.classNames();
342 return result = cn.all(function(value) {
343 var test = Validation.test(value,elm,options.useTitle);
344 options.onElementValidate(test, elm);
345 return test;
348 test : function(name, elm, useTitle) {
349 var v = Validation.get(name);
350 var prop = '__advice'+name.camelize();
351 try {
352 if(Validation.isVisible(elm) && !v.test($F(elm), elm)) {
353 if(!elm[prop]) {
354 var advice = Validation.getAdvice(name, elm);
355 if(advice == null) {
356 var errorMsg = useTitle ? ((elm && elm.title) ? elm.title : v.error) : v.error;
357 advice = '<div class="validation-advice" id="advice-' + name + '-' + Validation.getElmID(elm) +'" style="display:none">' + errorMsg + '</div>'
358 switch (elm.type.toLowerCase()) {
359 case 'checkbox':
360 case 'radio':
361 var p = elm.parentNode;
362 if(p) {
363 new Insertion.Bottom(p, advice);
364 } else {
365 new Insertion.After(elm, advice);
367 break;
368 default:
369 new Insertion.After(elm, advice);
371 advice = Validation.getAdvice(name, elm);
373 if(typeof Effect == 'undefined') {
374 advice.style.display = 'block';
375 } else {
376 new Effect.Appear(advice, {duration : 1 });
379 elm[prop] = true;
380 elm.removeClassName('validation-passed');
381 elm.addClassName('validation-failed');
382 return false;
383 } else {
384 var advice = Validation.getAdvice(name, elm);
385 if(advice != null) advice.hide();
386 elm[prop] = '';
387 elm.removeClassName('validation-failed');
388 elm.addClassName('validation-passed');
389 return true;
391 } catch(e) {
392 throw(e)
395 isVisible : function(elm) {
396 while(elm.tagName != 'BODY') {
397 if(!$(elm).visible()) return false;
398 elm = elm.parentNode;
400 return true;
402 getAdvice : function(name, elm) {
403 return $('advice-' + name + '-' + Validation.getElmID(elm)) || $('advice-' + Validation.getElmID(elm));
405 getElmID : function(elm) {
406 return elm.id ? elm.id : elm.name;
408 reset : function(elm) {
409 elm = $(elm);
410 var cn = elm.classNames();
411 cn.each(function(value) {
412 var prop = '__advice'+value.camelize();
413 if(elm[prop]) {
414 var advice = Validation.getAdvice(value, elm);
415 advice.hide();
416 elm[prop] = '';
418 elm.removeClassName('validation-failed');
419 elm.removeClassName('validation-passed');
422 add : function(className, error, test, options) {
423 var nv = {};
424 nv[className] = new Validator(className, error, test, options);
425 Object.extend(Validation.methods, nv);
427 addAllThese : function(validators) {
428 var nv = {};
429 $A(validators).each(function(value) {
430 nv[value[0]] = new Validator(value[0], value[1], value[2], (value.length > 3 ? value[3] : {}));
432 Object.extend(Validation.methods, nv);
434 get : function(name) {
435 return Validation.methods[name] ? Validation.methods[name] : Validation.methods['_LikeNoIDIEverSaw_'];
437 methods : {
438 '_LikeNoIDIEverSaw_' : new Validator('_LikeNoIDIEverSaw_','',{})
442 Validation.add('IsEmpty', '', function(v) {
443 return ((v == null) || (v.length == 0)); // || /^\s+$/.test(v));
446 Validation.addAllThese([
447 ['required', 'This is a required field.', function(v) {
448 return !Validation.get('IsEmpty').test(v);
450 ['validate-number', 'Please enter a valid number in this field.', function(v) {
451 return Validation.get('IsEmpty').test(v) || (!isNaN(v) && !/^\s+$/.test(v));
453 ['validate-digits', 'Please use numbers only in this field. please avoid spaces or other characters such as dots or commas.', function(v) {
454 return Validation.get('IsEmpty').test(v) || !/[^\d]/.test(v);
456 ['validate-alpha', 'Please use letters only (a-z) in this field.', function (v) {
457 return Validation.get('IsEmpty').test(v) || /^[a-zA-Z]+$/.test(v)
459 ['validate-alphanum', 'Please use only letters (a-z) or numbers (0-9) only in this field. No spaces or other characters are allowed.', function(v) {
460 return Validation.get('IsEmpty').test(v) || !/\W/.test(v)
462 ['validate-date', 'Please enter a valid date.', function(v) {
463 var test = new Date(v);
464 return Validation.get('IsEmpty').test(v) || !isNaN(test);
466 ['validate-email', 'Please enter a valid email address. For example fred@domain.com .', function (v) {
467 return Validation.get('IsEmpty').test(v) || /\w{1,}[@][\w\-]{1,}([.]([\w\-]{1,})){1,3}$/.test(v)
469 ['validate-url', 'Please enter a valid URL.', function (v) {
470 return Validation.get('IsEmpty').test(v) || /^(http|https|ftp):\/\/(([A-Z0-9][A-Z0-9_-]*)(\.[A-Z0-9][A-Z0-9_-]*)+)(:(\d+))?\/?/i.test(v)
472 ['validate-date-au', 'Please use this date format: dd/mm/yyyy. For example 17/03/2006 for the 17th of March, 2006.', function(v) {
473 if(Validation.get('IsEmpty').test(v)) return true;
474 var regex = /^(\d{2})\/(\d{2})\/(\d{4})$/;
475 if(!regex.test(v)) return false;
476 var d = new Date(v.replace(regex, '$2/$1/$3'));
477 return ( parseInt(RegExp.$2, 10) == (1+d.getMonth()) ) &&
478 (parseInt(RegExp.$1, 10) == d.getDate()) &&
479 (parseInt(RegExp.$3, 10) == d.getFullYear() );
481 ['validate-currency-dollar', 'Please enter a valid $ amount. For example $100.00 .', function(v) {
482 // [$]1[##][,###]+[.##]
483 // [$]1###+[.##]
484 // [$]0.##
485 // [$].##
486 return Validation.get('IsEmpty').test(v) || /^\$?\-?([1-9]{1}[0-9]{0,2}(\,[0-9]{3})*(\.[0-9]{0,2})?|[1-9]{1}\d*(\.[0-9]{0,2})?|0(\.[0-9]{0,2})?|(\.[0-9]{1,2})?)$/.test(v)
488 ['validate-selection', 'Please make a selection', function(v,elm){
489 return elm.options ? elm.selectedIndex > 0 : !Validation.get('IsEmpty').test(v);
491 ['validate-one-required', 'Please select one of the above options.', function (v,elm) {
492 var p = elm.parentNode;
493 var options = p.getElementsByTagName('INPUT');
494 return $A(options).any(function(elm) {
495 return $F(elm);
502 </value>
503 </data>
504 </root>