annotate Agendas/trunk/src/Agendas.Web/Scripts/MicrosoftMvcAjax.debug.js @ 116:53bcd338542b

acciones de confirmar y publicar desde la UI
author Nelo@Kenia.neluz.int
date Sun, 19 Jun 2011 13:00:02 -0300
parents c62b77fc33f4
children
rev   line source
10
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
1 //!----------------------------------------------------------
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
2 //! Copyright (C) Microsoft Corporation. All rights reserved.
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
3 //!----------------------------------------------------------
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
4 //! MicrosoftMvcAjax.js
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
5
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
6 Type.registerNamespace('Sys.Mvc');
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
7
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
8 ////////////////////////////////////////////////////////////////////////////////
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
9 // Sys.Mvc.AjaxOptions
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
10
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
11 Sys.Mvc.$create_AjaxOptions = function Sys_Mvc_AjaxOptions() { return {}; }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
12
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
13
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
14 ////////////////////////////////////////////////////////////////////////////////
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
15 // Sys.Mvc.InsertionMode
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
16
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
17 Sys.Mvc.InsertionMode = function() {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
18 /// <field name="replace" type="Number" integer="true" static="true">
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
19 /// </field>
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
20 /// <field name="insertBefore" type="Number" integer="true" static="true">
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
21 /// </field>
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
22 /// <field name="insertAfter" type="Number" integer="true" static="true">
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
23 /// </field>
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
24 };
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
25 Sys.Mvc.InsertionMode.prototype = {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
26 replace: 0,
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
27 insertBefore: 1,
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
28 insertAfter: 2
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
29 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
30 Sys.Mvc.InsertionMode.registerEnum('Sys.Mvc.InsertionMode', false);
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
31
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
32
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
33 ////////////////////////////////////////////////////////////////////////////////
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
34 // Sys.Mvc.AjaxContext
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
35
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
36 Sys.Mvc.AjaxContext = function Sys_Mvc_AjaxContext(request, updateTarget, loadingElement, insertionMode) {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
37 /// <param name="request" type="Sys.Net.WebRequest">
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
38 /// </param>
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
39 /// <param name="updateTarget" type="Object" domElement="true">
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
40 /// </param>
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
41 /// <param name="loadingElement" type="Object" domElement="true">
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
42 /// </param>
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
43 /// <param name="insertionMode" type="Sys.Mvc.InsertionMode">
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
44 /// </param>
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
45 /// <field name="_insertionMode" type="Sys.Mvc.InsertionMode">
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
46 /// </field>
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
47 /// <field name="_loadingElement" type="Object" domElement="true">
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
48 /// </field>
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
49 /// <field name="_response" type="Sys.Net.WebRequestExecutor">
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
50 /// </field>
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
51 /// <field name="_request" type="Sys.Net.WebRequest">
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
52 /// </field>
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
53 /// <field name="_updateTarget" type="Object" domElement="true">
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
54 /// </field>
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
55 this._request = request;
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
56 this._updateTarget = updateTarget;
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
57 this._loadingElement = loadingElement;
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
58 this._insertionMode = insertionMode;
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
59 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
60 Sys.Mvc.AjaxContext.prototype = {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
61 _insertionMode: 0,
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
62 _loadingElement: null,
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
63 _response: null,
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
64 _request: null,
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
65 _updateTarget: null,
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
66
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
67 get_data: function Sys_Mvc_AjaxContext$get_data() {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
68 /// <value type="String"></value>
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
69 if (this._response) {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
70 return this._response.get_responseData();
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
71 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
72 else {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
73 return null;
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
74 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
75 },
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
76
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
77 get_insertionMode: function Sys_Mvc_AjaxContext$get_insertionMode() {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
78 /// <value type="Sys.Mvc.InsertionMode"></value>
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
79 return this._insertionMode;
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
80 },
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
81
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
82 get_loadingElement: function Sys_Mvc_AjaxContext$get_loadingElement() {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
83 /// <value type="Object" domElement="true"></value>
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
84 return this._loadingElement;
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
85 },
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
86
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
87 get_object: function Sys_Mvc_AjaxContext$get_object() {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
88 /// <value type="Object"></value>
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
89 var executor = this.get_response();
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
90 return (executor) ? executor.get_object() : null;
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
91 },
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
92
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
93 get_response: function Sys_Mvc_AjaxContext$get_response() {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
94 /// <value type="Sys.Net.WebRequestExecutor"></value>
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
95 return this._response;
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
96 },
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
97 set_response: function Sys_Mvc_AjaxContext$set_response(value) {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
98 /// <value type="Sys.Net.WebRequestExecutor"></value>
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
99 this._response = value;
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
100 return value;
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
101 },
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
102
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
103 get_request: function Sys_Mvc_AjaxContext$get_request() {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
104 /// <value type="Sys.Net.WebRequest"></value>
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
105 return this._request;
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
106 },
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
107
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
108 get_updateTarget: function Sys_Mvc_AjaxContext$get_updateTarget() {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
109 /// <value type="Object" domElement="true"></value>
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
110 return this._updateTarget;
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
111 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
112 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
113
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
114
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
115 ////////////////////////////////////////////////////////////////////////////////
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
116 // Sys.Mvc.AsyncHyperlink
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
117
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
118 Sys.Mvc.AsyncHyperlink = function Sys_Mvc_AsyncHyperlink() {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
119 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
120 Sys.Mvc.AsyncHyperlink.handleClick = function Sys_Mvc_AsyncHyperlink$handleClick(anchor, evt, ajaxOptions) {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
121 /// <param name="anchor" type="Object" domElement="true">
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
122 /// </param>
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
123 /// <param name="evt" type="Sys.UI.DomEvent">
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
124 /// </param>
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
125 /// <param name="ajaxOptions" type="Sys.Mvc.AjaxOptions">
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
126 /// </param>
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
127 evt.preventDefault();
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
128 Sys.Mvc.MvcHelpers._asyncRequest(anchor.href, 'post', '', anchor, ajaxOptions);
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
129 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
130
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
131
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
132 ////////////////////////////////////////////////////////////////////////////////
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
133 // Sys.Mvc.MvcHelpers
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
134
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
135 Sys.Mvc.MvcHelpers = function Sys_Mvc_MvcHelpers() {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
136 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
137 Sys.Mvc.MvcHelpers._serializeSubmitButton = function Sys_Mvc_MvcHelpers$_serializeSubmitButton(element, offsetX, offsetY) {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
138 /// <param name="element" type="Object" domElement="true">
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
139 /// </param>
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
140 /// <param name="offsetX" type="Number" integer="true">
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
141 /// </param>
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
142 /// <param name="offsetY" type="Number" integer="true">
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
143 /// </param>
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
144 /// <returns type="String"></returns>
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
145 if (element.disabled) {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
146 return null;
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
147 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
148 var name = element.name;
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
149 if (name) {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
150 var tagName = element.tagName.toUpperCase();
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
151 var encodedName = encodeURIComponent(name);
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
152 var inputElement = element;
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
153 if (tagName === 'INPUT') {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
154 var type = inputElement.type;
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
155 if (type === 'submit') {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
156 return encodedName + '=' + encodeURIComponent(inputElement.value);
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
157 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
158 else if (type === 'image') {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
159 return encodedName + '.x=' + offsetX + '&' + encodedName + '.y=' + offsetY;
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
160 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
161 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
162 else if ((tagName === 'BUTTON') && (name.length) && (inputElement.type === 'submit')) {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
163 return encodedName + '=' + encodeURIComponent(inputElement.value);
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
164 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
165 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
166 return null;
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
167 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
168 Sys.Mvc.MvcHelpers._serializeForm = function Sys_Mvc_MvcHelpers$_serializeForm(form) {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
169 /// <param name="form" type="Object" domElement="true">
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
170 /// </param>
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
171 /// <returns type="String"></returns>
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
172 var formElements = form.elements;
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
173 var formBody = new Sys.StringBuilder();
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
174 var count = formElements.length;
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
175 for (var i = 0; i < count; i++) {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
176 var element = formElements[i];
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
177 var name = element.name;
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
178 if (!name || !name.length) {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
179 continue;
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
180 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
181 var tagName = element.tagName.toUpperCase();
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
182 if (tagName === 'INPUT') {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
183 var inputElement = element;
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
184 var type = inputElement.type;
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
185 if ((type === 'text') || (type === 'password') || (type === 'hidden') || (((type === 'checkbox') || (type === 'radio')) && element.checked)) {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
186 formBody.append(encodeURIComponent(name));
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
187 formBody.append('=');
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
188 formBody.append(encodeURIComponent(inputElement.value));
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
189 formBody.append('&');
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
190 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
191 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
192 else if (tagName === 'SELECT') {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
193 var selectElement = element;
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
194 var optionCount = selectElement.options.length;
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
195 for (var j = 0; j < optionCount; j++) {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
196 var optionElement = selectElement.options[j];
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
197 if (optionElement.selected) {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
198 formBody.append(encodeURIComponent(name));
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
199 formBody.append('=');
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
200 formBody.append(encodeURIComponent(optionElement.value));
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
201 formBody.append('&');
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
202 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
203 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
204 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
205 else if (tagName === 'TEXTAREA') {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
206 formBody.append(encodeURIComponent(name));
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
207 formBody.append('=');
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
208 formBody.append(encodeURIComponent((element.value)));
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
209 formBody.append('&');
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
210 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
211 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
212 var additionalInput = form._additionalInput;
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
213 if (additionalInput) {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
214 formBody.append(additionalInput);
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
215 formBody.append('&');
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
216 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
217 return formBody.toString();
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
218 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
219 Sys.Mvc.MvcHelpers._asyncRequest = function Sys_Mvc_MvcHelpers$_asyncRequest(url, verb, body, triggerElement, ajaxOptions) {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
220 /// <param name="url" type="String">
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
221 /// </param>
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
222 /// <param name="verb" type="String">
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
223 /// </param>
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
224 /// <param name="body" type="String">
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
225 /// </param>
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
226 /// <param name="triggerElement" type="Object" domElement="true">
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
227 /// </param>
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
228 /// <param name="ajaxOptions" type="Sys.Mvc.AjaxOptions">
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
229 /// </param>
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
230 if (ajaxOptions.confirm) {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
231 if (!confirm(ajaxOptions.confirm)) {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
232 return;
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
233 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
234 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
235 if (ajaxOptions.url) {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
236 url = ajaxOptions.url;
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
237 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
238 if (ajaxOptions.httpMethod) {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
239 verb = ajaxOptions.httpMethod;
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
240 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
241 if (body.length > 0 && !body.endsWith('&')) {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
242 body += '&';
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
243 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
244 body += 'X-Requested-With=XMLHttpRequest';
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
245 var upperCaseVerb = verb.toUpperCase();
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
246 var isGetOrPost = (upperCaseVerb === 'GET' || upperCaseVerb === 'POST');
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
247 if (!isGetOrPost) {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
248 body += '&';
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
249 body += 'X-HTTP-Method-Override=' + upperCaseVerb;
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
250 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
251 var requestBody = '';
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
252 if (upperCaseVerb === 'GET' || upperCaseVerb === 'DELETE') {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
253 if (url.indexOf('?') > -1) {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
254 if (!url.endsWith('&')) {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
255 url += '&';
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
256 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
257 url += body;
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
258 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
259 else {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
260 url += '?';
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
261 url += body;
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
262 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
263 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
264 else {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
265 requestBody = body;
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
266 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
267 var request = new Sys.Net.WebRequest();
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
268 request.set_url(url);
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
269 if (isGetOrPost) {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
270 request.set_httpVerb(verb);
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
271 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
272 else {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
273 request.set_httpVerb('POST');
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
274 request.get_headers()['X-HTTP-Method-Override'] = upperCaseVerb;
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
275 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
276 request.set_body(requestBody);
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
277 if (verb.toUpperCase() === 'PUT') {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
278 request.get_headers()['Content-Type'] = 'application/x-www-form-urlencoded;';
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
279 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
280 request.get_headers()['X-Requested-With'] = 'XMLHttpRequest';
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
281 var updateElement = null;
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
282 if (ajaxOptions.updateTargetId) {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
283 updateElement = $get(ajaxOptions.updateTargetId);
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
284 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
285 var loadingElement = null;
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
286 if (ajaxOptions.loadingElementId) {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
287 loadingElement = $get(ajaxOptions.loadingElementId);
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
288 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
289 var ajaxContext = new Sys.Mvc.AjaxContext(request, updateElement, loadingElement, ajaxOptions.insertionMode);
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
290 var continueRequest = true;
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
291 if (ajaxOptions.onBegin) {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
292 continueRequest = ajaxOptions.onBegin(ajaxContext) !== false;
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
293 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
294 if (loadingElement) {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
295 Sys.UI.DomElement.setVisible(ajaxContext.get_loadingElement(), true);
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
296 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
297 if (continueRequest) {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
298 request.add_completed(Function.createDelegate(null, function(executor) {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
299 Sys.Mvc.MvcHelpers._onComplete(request, ajaxOptions, ajaxContext);
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
300 }));
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
301 request.invoke();
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
302 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
303 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
304 Sys.Mvc.MvcHelpers._onComplete = function Sys_Mvc_MvcHelpers$_onComplete(request, ajaxOptions, ajaxContext) {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
305 /// <param name="request" type="Sys.Net.WebRequest">
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
306 /// </param>
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
307 /// <param name="ajaxOptions" type="Sys.Mvc.AjaxOptions">
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
308 /// </param>
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
309 /// <param name="ajaxContext" type="Sys.Mvc.AjaxContext">
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
310 /// </param>
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
311 ajaxContext.set_response(request.get_executor());
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
312 if (ajaxOptions.onComplete && ajaxOptions.onComplete(ajaxContext) === false) {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
313 return;
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
314 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
315 var statusCode = ajaxContext.get_response().get_statusCode();
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
316 if ((statusCode >= 200 && statusCode < 300) || statusCode === 304 || statusCode === 1223) {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
317 if (statusCode !== 204 && statusCode !== 304 && statusCode !== 1223) {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
318 var contentType = ajaxContext.get_response().getResponseHeader('Content-Type');
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
319 if ((contentType) && (contentType.indexOf('application/x-javascript') !== -1)) {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
320 eval(ajaxContext.get_data());
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
321 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
322 else {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
323 Sys.Mvc.MvcHelpers.updateDomElement(ajaxContext.get_updateTarget(), ajaxContext.get_insertionMode(), ajaxContext.get_data());
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
324 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
325 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
326 if (ajaxOptions.onSuccess) {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
327 ajaxOptions.onSuccess(ajaxContext);
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
328 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
329 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
330 else {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
331 if (ajaxOptions.onFailure) {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
332 ajaxOptions.onFailure(ajaxContext);
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
333 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
334 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
335 if (ajaxContext.get_loadingElement()) {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
336 Sys.UI.DomElement.setVisible(ajaxContext.get_loadingElement(), false);
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
337 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
338 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
339 Sys.Mvc.MvcHelpers.updateDomElement = function Sys_Mvc_MvcHelpers$updateDomElement(target, insertionMode, content) {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
340 /// <param name="target" type="Object" domElement="true">
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
341 /// </param>
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
342 /// <param name="insertionMode" type="Sys.Mvc.InsertionMode">
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
343 /// </param>
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
344 /// <param name="content" type="String">
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
345 /// </param>
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
346 if (target) {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
347 switch (insertionMode) {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
348 case Sys.Mvc.InsertionMode.replace:
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
349 target.innerHTML = content;
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
350 break;
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
351 case Sys.Mvc.InsertionMode.insertBefore:
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
352 if (content && content.length > 0) {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
353 target.innerHTML = content + target.innerHTML.trimStart();
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
354 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
355 break;
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
356 case Sys.Mvc.InsertionMode.insertAfter:
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
357 if (content && content.length > 0) {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
358 target.innerHTML = target.innerHTML.trimEnd() + content;
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
359 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
360 break;
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
361 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
362 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
363 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
364
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
365
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
366 ////////////////////////////////////////////////////////////////////////////////
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
367 // Sys.Mvc.AsyncForm
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
368
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
369 Sys.Mvc.AsyncForm = function Sys_Mvc_AsyncForm() {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
370 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
371 Sys.Mvc.AsyncForm.handleClick = function Sys_Mvc_AsyncForm$handleClick(form, evt) {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
372 /// <param name="form" type="Object" domElement="true">
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
373 /// </param>
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
374 /// <param name="evt" type="Sys.UI.DomEvent">
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
375 /// </param>
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
376 var additionalInput = Sys.Mvc.MvcHelpers._serializeSubmitButton(evt.target, evt.offsetX, evt.offsetY);
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
377 form._additionalInput = additionalInput;
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
378 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
379 Sys.Mvc.AsyncForm.handleSubmit = function Sys_Mvc_AsyncForm$handleSubmit(form, evt, ajaxOptions) {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
380 /// <param name="form" type="Object" domElement="true">
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
381 /// </param>
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
382 /// <param name="evt" type="Sys.UI.DomEvent">
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
383 /// </param>
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
384 /// <param name="ajaxOptions" type="Sys.Mvc.AjaxOptions">
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
385 /// </param>
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
386 evt.preventDefault();
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
387 var validationCallbacks = form.validationCallbacks;
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
388 if (validationCallbacks) {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
389 for (var i = 0; i < validationCallbacks.length; i++) {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
390 var callback = validationCallbacks[i];
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
391 if (!callback()) {
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
392 return;
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
393 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
394 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
395 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
396 var body = Sys.Mvc.MvcHelpers._serializeForm(form);
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
397 Sys.Mvc.MvcHelpers._asyncRequest(form.action, form.method || 'post', body, form, ajaxOptions);
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
398 }
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
399
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
400
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
401 Sys.Mvc.AjaxContext.registerClass('Sys.Mvc.AjaxContext');
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
402 Sys.Mvc.AsyncHyperlink.registerClass('Sys.Mvc.AsyncHyperlink');
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
403 Sys.Mvc.MvcHelpers.registerClass('Sys.Mvc.MvcHelpers');
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
404 Sys.Mvc.AsyncForm.registerClass('Sys.Mvc.AsyncForm');
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
405
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
406 // ---- Do not remove this footer ----
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
407 // Generated using Script# v0.5.0.0 (http://projects.nikhilk.net)
c62b77fc33f4 website inicial
nelo@MTEySS.neluz.int
parents:
diff changeset
408 // -----------------------------------