Skip to content
Browse files

post module.declare

  • Loading branch information...
1 parent ee5a1d6 commit 2af79d8e58cc515841f322ac4f215a68fc1327c4 @rikarends rikarends committed Nov 12, 2010
Showing with 4,836 additions and 4,998 deletions.
  1. +2 −2 actionrecorder/uirecorder.js
  2. +2 −2 aml-core/lib/a11y.js
  3. +2 −2 aml-core/lib/anchoring.js
  4. +2 −7 aml-core/lib/basebutton.js
  5. +2 −2 aml-core/lib/baselist.js
  6. +2 −2 aml-core/lib/basesimple.js
  7. +2 −2 aml-core/lib/basestatebuttons.js
  8. +2 −2 aml-core/lib/basetree.js
  9. +2 −2 aml-core/lib/childvalue.js
  10. +2 −2 aml-core/lib/config.js
  11. +2 −6 aml-core/lib/dragdrop.js
  12. +202 −202 aml-core/lib/dragdrop/multiselect.js
  13. +52 −52 aml-core/lib/dragdrop/standard.js
  14. +50 −51 aml-core/lib/env/gecko.js
  15. +81 −85 aml-core/lib/env/ie.js
  16. +38 −39 aml-core/lib/env/opera.js
  17. +84 −85 aml-core/lib/env/w3c.js
  18. +38 −39 aml-core/lib/env/webkit.js
  19. +1 −2 aml-core/lib/focus/flash.js
  20. +2 −7 aml-core/lib/focus/focussable.js
  21. +2 −3 aml-core/lib/focus/manager.js
  22. +2 −3 aml-core/lib/focus/window.js
  23. +2 −9 aml-core/lib/guielement.js
  24. +1 −1 aml-core/lib/iframe.js
  25. +2 −2 aml-core/lib/inputevents/iphone.js
  26. +215 −219 aml-core/lib/inputevents/keyboard.js
  27. +217 −222 aml-core/lib/inputevents/mouse.js
  28. +1 −1 aml-core/lib/inputevents/touch.js
  29. +1 −1 aml-core/lib/inputevents/wheel.js
  30. +2 −2 aml-core/lib/interactive.js
  31. +2 −2 aml-core/lib/multicheck.js
  32. +2 −2 aml-core/lib/multiselect.js
  33. +2 −3 aml-core/lib/nameserver.js
  34. +2 −2 aml-core/lib/parser.js
  35. +2 −7 aml-core/lib/presentation.js
  36. +2 −2 aml-core/lib/rename.js
  37. +1 −2 aml-core/lib/setgetapi.js
  38. +2 −2 aml-core/lib/skinmanager.js
  39. +2 −2 aml-core/lib/transaction.js
  40. +2 −2 aml-core/lib/util.js
  41. +2 −2 aml-core/lib/util/async.js
  42. +2 −2 aml-core/lib/util/cookie.js
  43. +2 −2 aml-core/lib/util/iepopup.js
  44. +2 −5 aml-core/lib/util/layout.js
  45. +2 −2 aml-core/lib/util/plane.js
  46. +2 −9 aml-core/lib/util/popup.js
  47. +2 −2 aml-core/lib/util/printer.js
  48. +2 −2 aml-core/lib/util/registry.js
  49. +2 −2 aml-core/lib/util/sort.js
  50. +2 −2 aml-core/lib/util/uniquehtml.js
  51. +2 −2 aml-core/lib/util/visibilitymanager.js
  52. +2 −2 aml-core/lib/util/zmanager.js
  53. +2 −2 aml-core/lib/validation.js
  54. +240 −241 aml-core/lib/validation/validgroup.js
  55. +2 −2 aml-core/lib/virtualviewport.js
  56. +2 −2 aml/lib/bar/bar.js
  57. +2 −3 aml/lib/bar/divider.js
  58. +2 −3 aml/lib/bar/menubar.js
  59. +2 −3 aml/lib/bar/section.js
  60. +2 −3 aml/lib/bar/statusbar.js
  61. +2 −3 aml/lib/bar/toolbar.js
  62. +1 −1 aml/lib/button/actions.js
  63. +2 −3 aml/lib/button/button.js
  64. +2 −3 aml/lib/button/reset.js
  65. +2 −3 aml/lib/button/submit.js
  66. +2 −3 aml/lib/button/trigger.js
  67. +2 −2 aml/lib/calendar/caldropdown.js
  68. +2 −2 aml/lib/calendar/calendar.js
  69. +2 −2 aml/lib/calendar/calendarlist.js
  70. +2 −2 aml/lib/checkbox/checkbox.js
  71. +2 −3 aml/lib/core/application.js
  72. +2 −2 aml/lib/core/appsettings.js
  73. +2 −2 aml/lib/core/collection.js
  74. +2 −3 aml/lib/core/comment.js
  75. +2 −2 aml/lib/core/contextmenu.js
  76. +2 −2 aml/lib/core/defaults.js
  77. +2 −2 aml/lib/core/iconmap.js
  78. +2 −2 aml/lib/core/item.js
  79. +2 −2 aml/lib/core/junction.js
  80. +2 −3 aml/lib/core/loader.js
  81. +2 −2 aml/lib/core/script.js
  82. +2 −2 aml/lib/core/skin.js
  83. +2 −2 aml/lib/core/state-group.js
  84. +2 −3 aml/lib/core/state.js
  85. +2 −2 aml/lib/core/style.js
  86. +2 −8 aml/lib/datagrid/datagrid.js
  87. +2 −2 aml/lib/dropdown/dropdown.js
  88. +2 −3 aml/lib/errorbox/errorbox.js
  89. +2 −2 aml/lib/iframe/iframe.js
  90. +2 −3 aml/lib/img/img.js
  91. +2 −3 aml/lib/img/preview.js
  92. +2 −2 aml/lib/label/label.js
  93. +2 −2 aml/lib/layout/accordion.js
  94. +2 −2 aml/lib/layout/filler.js
  95. +2 −3 aml/lib/layout/hbox.js
  96. +2 −2 aml/lib/layout/splitter.js
  97. +2 −2 aml/lib/layout/table.js
  98. +2 −3 aml/lib/layout/vbox.js
  99. +2 −3 aml/lib/list/list.js
  100. +2 −3 aml/lib/list/thumbnail.js
  101. +2 −2 aml/lib/map/map.js
  102. +2 −2 aml/lib/menu/menu.js
  103. +2 −2 aml/lib/pagenav/pagenav.js
  104. +2 −3 aml/lib/panel/frame.js
  105. +2 −2 aml/lib/panel/panel.js
  106. +2 −2 aml/lib/progressbar/progressbar.js
  107. +2 −9 aml/lib/propgrid/propgrid.js
  108. +2 −2 aml/lib/radiobutton/radiobutton.js
  109. +2 −2 aml/lib/scrollbar/scrollbar.js
  110. +2 −2 aml/lib/slider/slider.js
  111. +2 −2 aml/lib/spinner/spinner.js
  112. +2 −2 aml/lib/tab/basetab.js
  113. +2 −2 aml/lib/tab/page.js
  114. +2 −3 aml/lib/tab/pages.js
  115. +2 −2 aml/lib/tab/tab.js
  116. +2 −2 aml/lib/tab/toc.js
  117. +2 −2 aml/lib/text/text.js
  118. +2 −3 aml/lib/textbox/email.js
  119. +2 −3 aml/lib/textbox/input.js
  120. +2 −2 aml/lib/textbox/modules/autocomplete.js
  121. +1 −1 aml/lib/textbox/modules/autocomplete2.js
  122. +2 −2 aml/lib/textbox/modules/masking.js
  123. +2 −3 aml/lib/textbox/secret.js
  124. +2 −3 aml/lib/textbox/textarea.js
  125. +2 −2 aml/lib/textbox/textbox.js
  126. +1 −1 aml/lib/tree/modules/databinding.js
  127. +1 −1 aml/lib/tree/modules/item.js
  128. +1 −1 aml/lib/tree/modules/mobile.js
  129. +1 −1 aml/lib/tree/tree-aml.js
  130. +2 −2 aml/lib/tree/tree.js
  131. +2 −3 aml/lib/upload/modules/flash.js
  132. +2 −3 aml/lib/upload/modules/html4.js
  133. +2 −3 aml/lib/upload/modules/html5.js
  134. +2 −8 aml/lib/upload/upload.js
  135. +2 −3 aml/lib/window/toolwindow.js
  136. +2 −2 aml/lib/window/window.js
  137. +2 −2 auth/auth.js
  138. +2 −3 auth/services.js
  139. +2 −2 charts/lib/axis.js
  140. +2 −2 charts/lib/canvas.js
  141. +2 −2 charts/lib/chart.js
  142. +2 −2 charts/lib/chartdraw.js
  143. +2 −2 charts/lib/draw.js
  144. +2 −2 charts/lib/graph.js
  145. +2 −2 charts/lib/vml.js
  146. +2 −2 colorpicker/colorpicker.js
  147. +2 −2 colorpicker/palette.js
  148. +2 −2 contenteditable/lib/clipboard.js
  149. +2 −2 contenteditable/lib/commands.js
  150. +2 −2 contenteditable/lib/contenteditable.js
  151. +1 −1 contenteditable/lib/docmodifier.js
  152. +1 −1 contenteditable/lib/interactive.js
  153. +2 −2 contenteditable/lib/selectrect.js
  154. +2 −2 contenteditable/lib/visualconnect.js
  155. +2 −2 contenteditable/lib/visualselect.js
  156. +1 −1 databinding/lib/_xmldb.js
  157. +2 −2 databinding/lib/actionrule/actionrule.js
  158. +2 −2 databinding/lib/actions.js
  159. +1 −1 databinding/lib/actiontracker/undodata.js
  160. +2 −2 databinding/lib/actiontracker/xmlactions.js
  161. +2 −2 databinding/lib/base/cache.js
  162. +2 −2 databinding/lib/base/dataaction.js
  163. +2 −7 databinding/lib/base/databinding.js
  164. +2 −2 databinding/lib/base/databinding/multiselect.js
  165. +2 −3 databinding/lib/base/databinding/standard.js
  166. +2 −2 databinding/lib/bindingrule/bindingrule.js
  167. +2 −2 databinding/lib/bindingrule/color.js
  168. +2 −2 databinding/lib/bindingrule/column.js
  169. +2 −2 databinding/lib/bindingrule/drag.js
  170. +2 −2 databinding/lib/bindingrule/each.js
  171. +2 −2 databinding/lib/bindingrule/load.js
  172. +2 −2 databinding/lib/bindingrule/quicksand.js
  173. +2 −2 databinding/lib/bindingrule/series.js
  174. +2 −7 databinding/lib/bindings.js
  175. +2 −2 databinding/lib/data.js
  176. +25 −26 databinding/lib/json2xml.js
  177. +2 −2 databinding/lib/merge.js
  178. +2 −2 databinding/lib/model.js
  179. +1 −1 databinding/lib/propbind.js
  180. +2 −3 databinding/lib/remote.js
  181. +135 −135 databinding/lib/rulelist.js
  182. +2 −2 databinding/lib/smartbinding.js
  183. +2 −2 databinding/lib/xmldb.js
  184. +2 −8 debugger/dbg/chromedebughost.js
  185. +2 −3 debugger/dbg/v8debugger.js
  186. +2 −5 debugger/dbg/v8debughost.js
  187. +2 −5 debugger/dbg/v8websocketdebughost.js
  188. +2 −2 debugger/debugger.js
  189. +2 −5 debugger/debughost.js
  190. +2 −2 debugview/debugwin.js
  191. +1 −1 debugview/docparser/JsParser.js
  192. +1 −1 debugview/docparser/docparser.js
  193. +1,507 −1,507 debugview/docparser/docparser_objects.js
  194. +1 −1 debugview/docparser/docparser_refguide_xml.js
  195. +1 −1 debugview/docparser/docparser_xmlschema.js
  196. +1 −1 debugview/docparser/onedit.js
  197. +1 −1 debugview/macrorecorder.js
  198. +1 −1 debugview/o3.js
  199. +1 −1 elementFromPoint/lib/main.js
  200. +2 −2 envdetect/lib/features.js
  201. +2 −2 envdetect/lib/main.js
  202. +2 −2 flowchart/lib/flow.js
  203. +2 −2 flowchart/lib/flowchart.js
  204. +2 −2 flowchart/lib/flowchart2.js
  205. +2 −2 flowchart/lib/vectorflow.js
  206. +2 −2 gallery/gallery.js
  207. +2 −2 gallery/slideshow.js
  208. +2 −2 geolocation/geolocation.js
  209. +2 −2 hashchange/history.js
  210. +2 −4 hotkey/lib/main.js
  211. +1 −2 html5/lib/audio.js
  212. +2 −2 html5/lib/audio/type_flash.js
  213. +2 −2 html5/lib/audio/type_native.js
  214. +2 −7 html5/lib/media.js
  215. +19 −23 html5/lib/nomedia.js
  216. +2 −3 html5/lib/source.js
  217. +1 −2 html5/lib/video.js
  218. +2 −2 html5/lib/video/type_flv.js
  219. +2 −2 html5/lib/video/type_native.js
  220. +2 −2 html5/lib/video/type_qt.js
  221. +2 −2 html5/lib/video/type_silverlight.js
  222. +2 −2 html5/lib/video/type_vlc.js
  223. +2 −2 html5/lib/video/type_wmp.js
  224. +2 −2 lib-color/color.js
  225. +2 −2 lib-crypto/lib/barrett.js
  226. +2 −2 lib-crypto/lib/base64.js
  227. +2 −2 lib-crypto/lib/bigint.js
  228. +2 −2 lib-crypto/lib/blowfish.js
  229. +2 −2 lib-crypto/lib/md4.js
  230. +2 −2 lib-crypto/lib/md5.js
  231. +2 −2 lib-crypto/lib/rsa.js
  232. +1 −1 lib-crypto/lib/sha1.js
  233. +1 −2 lib-css/lib/env/ie.js
  234. +2 −2 lib-css/lib/env/iepngfix.js
  235. +50 −51 lib-css/lib/env/non_ie.js
  236. +2 −2 lib-css/lib/env/opera.js
  237. +56 −57 lib-css/lib/env/webkit.js
  238. +2 −6 lib-css/lib/position.js
  239. +2 −5 lib-css/lib/stylesheet.js
  240. +324 −324 lib-debug/lib/console/browser.js
  241. +71 −71 lib-debug/lib/console/cli.js
  242. +1 −1 lib-debug/lib/debug.js
  243. +2 −2 lib-debug/lib/dump.js
  244. +1 −1 lib-debug/lib/error.js
  245. +1 −1 lib-debug/lib/gecko.js
  246. +2 −2 lib-debug/lib/hook.js
  247. +2 −2 lib-debug/lib/log.js
  248. +2 −2 lib-debug/lib/profiler.js
  249. +1 −1 lib-ecmaext/lib/array.js
  250. +527 −527 lib-ecmaext/lib/date.js
  251. +233 −233 lib-ecmaext/lib/date/format.js
  252. +55 −55 lib-ecmaext/lib/date/iso8601.js
  253. +1 −1 lib-ecmaext/lib/ecmaext.js
  254. +73 −73 lib-ecmaext/lib/function.js
  255. +2 −2 lib-ecmaext/lib/json.js
  256. +2 −2 lib-ecmaext/lib/main.js
  257. +18 −18 lib-ecmaext/lib/number.js
  258. +36 −36 lib-ecmaext/lib/object.js
  259. +36 −36 lib-ecmaext/lib/random.js
  260. +19 −19 lib-ecmaext/lib/regexp.js
Sorry, we could not display the entire diff because too many files (429) changed.
View
4 actionrecorder/uirecorder.js
@@ -1,4 +1,4 @@
-define([], function(){
+module.declare(function(require, exports, module){
/**
* Provides a way to record user actions, store them and play them back.
* @experimental
@@ -1770,5 +1770,5 @@ TEMPORARILY DISABLED
}
}
- return UIRecorder;
+ module.exports = UIRecorder;
});
View
4 aml-core/lib/a11y.js
@@ -21,7 +21,7 @@
apf.__ALIGNMENT__ = 1 << 29;
-define([], function(){
+module.declare(function(require, exports, module){
/**
* All elements inheriting from this {@link term.baseclass baseclass} have
@@ -138,6 +138,6 @@ A11y.ATTR_RELATIONS = {
"label":"1", "labelledby":{}, "owns":{}, "posinset":1, "setsize":1
};
-return A11y;
+module.exports = A11y;
});
View
4 aml-core/lib/anchoring.js
@@ -21,7 +21,7 @@
apf.__ANCHORING__ = 1 << 13;
-define([], function(){
+module.declare(function(require, exports, module){
//#ifdef __WITH_ANCHORING
this.percentageMatch = new RegExp();
@@ -497,6 +497,6 @@ var Anchoring = function(){
};
-return Anchoring;
+module.exports = Anchoring;
});
View
9 aml-core/lib/basebutton.js
@@ -19,12 +19,7 @@
*
*/
-define([
- "optional!databinding/base/standard",
- "aml-core/skin/skin",
- "optional!aml-core/childvalue",
- "lib-oop"],
- function(StandardBinding, Skin, ChildValue, oop){
+module.declare(function(require, exports, module){
var BaseClass = StandardBinding || Skin;
@@ -322,7 +317,7 @@ oop.decorate(BaseButton, ChildValue);
};
}).call(BaseButton.prototype);
-return BaseButton;
+module.exports = BaseButton;
}
);
View
4 aml-core/lib/baselist.js
@@ -19,7 +19,7 @@
*
*/
-define(["aml-core/multiselect", "optional!aml", "lib-oop"], function(MultiSelect, aml, oop){
+module.declare(function(require, exports, module){
/**
* Baseclass of elements that allows the user to select one or more items
@@ -965,6 +965,6 @@ oop.decorate(BaseList, DataAction);
#endif*/
-return BaseList;
+module.exports = BaseList;
});
View
4 aml-core/lib/basesimple.js
@@ -18,7 +18,7 @@
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*
*/
-define(["aml-core/standardbinding", "optional!aml", "lib-oop"], function(StandardBinding, aml, oop){
+module.declare(function(require, exports, module){
/**
* Baseclass of a simple element. This are usually displaying elements
@@ -51,6 +51,6 @@ oop.decorate(BaseSimple, DataAction);
}).call(BaseSimple.prototype);
-return BaseSimple;
+module.exports = BaseSimple;
});
View
4 aml-core/lib/basestatebuttons.js
@@ -18,7 +18,7 @@
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*
*/
-define([], function(){
+module.declare(function(require, exports, module){
/**
* @constructor
@@ -662,6 +662,6 @@ var BaseStateButtons = function(){
};
-return BaseStateButtons;
+module.exports = BaseStateButtons;
});
View
4 aml-core/lib/basetree.js
@@ -19,7 +19,7 @@
*
*/
-define(["aml-core/multiselect", "optional!aml", "lib-oop"], function(MultiSelect, aml, oop){
+module.declare(function(require, exports, module){
/**
* Baseclass of elements that allows the user to select one or more items
@@ -1208,6 +1208,6 @@ oop.decorate(BaseTree, Cache);
#endif*/
-return BaseTree;
+module.exports = BaseTree;
});
View
4 aml-core/lib/childvalue.js
@@ -21,7 +21,7 @@
apf.__CHILDVALUE__ = 1 << 27;
-define([], function(){
+module.declare(function(require, exports, module){
var ChildValue = function(){
if (!this.$childProperty)
this.$childProperty = "value";
@@ -92,6 +92,6 @@ var ChildValue = function(){
});
};
-return ChildValue;
+module.exports = ChildValue;
});
View
4 aml-core/lib/config.js
@@ -19,7 +19,7 @@
*
*/
-define([], function(){
+module.declare(function(require, exports, module){
var Config = new apf.Class().$init();
Object.extend(apf.config, {
@@ -241,6 +241,6 @@ if (apf.history)
//#endif
-return Config;
+module.exports = Config;
});
View
8 aml-core/lib/dragdrop.js
@@ -21,11 +21,7 @@
apf.__DRAGDROP__ = 1 << 5;
-define([
- "aml-core/guielement",
- "aml-core/dragdrop/multiselect",
- "aml-core/dragdrop/standard"],
- function(GuiElement, MultiselectDragDrop, StandardDragDrop){
+module.declare(function(require, exports, module){
/**
* All elements inheriting from this {@link term.baseclass baseclass} have drag&drop
@@ -1201,6 +1197,6 @@ var DragServer = {
DragServer.Init();
-return DragDrop;
+module.exports = DragDrop;
});
View
404 aml-core/lib/dragdrop/multiselect.js
@@ -1,203 +1,203 @@
-define([],function(){
-
-return function() {
- /**** Drag & Drop ****/
- // #ifdef __WITH_DRAGDROP
- this.diffX =
- this.diffY = 0;
- this.multiple = false;
- this.lastDragNode = null;
- this.lastel = null;
-
- this.$showDragIndicator = function(sel, e){
- this.multiple = sel.length > 1;
-
- if (this.multiple) {
- this.diffX = e.scrollX;
- this.diffY = e.scrollY;
- }
- else {
- this.diffX = -1 * e.offsetX;
- this.diffY = -1 * e.offsetY;
- }
-
- var prefix = this.oDrag.className.split(" ")[0]
- //@todo the class should be removed here
- this.$setStyleClass(this.oDrag, (this.multiple
- ? prefix + "_multiple" : "") + (this["class"] ? " " + this["class"] : ""), [prefix + "_multiple"]);
-
- if (this.multiple) {
- document.body.appendChild(this.oDrag);
- return this.oDrag;
- }
- else if (this.localName == "datagrid") {
- if (this.lastDragNode)
- amlCore.destroyHtmlNode(this.lastDragNode);
-
- sel = this.$selected || this.$caret;
- var oDrag = sel.cloneNode(true);
- oDrag.removeAttribute("onmousedown"); oDrag.onmousedown = null;
- oDrag.removeAttribute("onmouseup"); oDrag.onmouseup = null;
- oDrag.removeAttribute("onmouseout"); oDrag.onmouseout = null;
- oDrag.removeAttribute("ondblclick"); oDrag.ondblclick = null;
- document.body.appendChild(oDrag);
-
- oDrag.style.position = "absolute";
- oDrag.style.width = sel.offsetWidth + "px";
- oDrag.style.display = "none";
- oDrag.removeAttribute("id");
-
- this.$setStyleClass(oDrag, "draggrid");
- var nodes = sel.childNodes;
- var dragnodes = oDrag.childNodes;
- for (var i = nodes.length - 1; i >= 0; i--) {
- if (dragnodes[i].nodeType == 1)
- dragnodes[i].style.width = apf.getStyle(nodes[i], "width");
- }
- //@todo apf3.0 remove all the event handlers of the children.
- return (this.lastDragNode = oDrag);
- }
- else {
- var sel = this.$selected || this.$caret,
- width = apf.getStyle(this.oDrag, "width");
-
- if (!width || width == "auto")
- this.oDrag.style.width = (sel.offsetWidth - apf.getWidthDiff(this.oDrag)) + "px";
- this.$updateNode(this.selected, this.oDrag);
- }
-
- zManager.set("drag", this.oDrag);
-
- return this.oDrag;
- };
-
- this.$hideDragIndicator = function(success){
- var oDrag = this.lastDragNode || this.oDrag, _self = this;
- if (!this.multiple && !success && oDrag.style.display == "block") {
- if (!this.$selected && !this.$caret)
- return;
-
- var pos = apf.getAbsolutePosition(this.$selected || this.$caret);
- apf.tween.multi(oDrag, {
- anim : apf.tween.easeInOutCubic,
- steps : apf.isIE ? 15 : 20,
- interval : 15,
- tweens : [
- {type: "left", from: oDrag.offsetLeft, to: pos[0]},
- {type: "top", from: oDrag.offsetTop, to: pos[1]}
- ],
- onfinish : function(){
- if (_self.lastDragNode) {
- amlCore.destroyHtmlNode(_self.lastDragNode);
- _self.lastDragNode = null;
- }
- else {
- _self.oDrag.style.display = "none";
- }
- }
- });
- }
- else if (this.lastDragNode) {
- amlCore.destroyHtmlNode(this.lastDragNode);
- this.lastDragNode = null;
- }
- else {
- this.oDrag.style.display = "none";
- }
- };
-
- this.$moveDragIndicator = function(e){
- var oDrag = this.lastDragNode || this.oDrag;
- oDrag.style.left = (e.clientX + this.diffX) + "px";// - this.oDrag.startX
- oDrag.style.top = (e.clientY + this.diffY + (this.multiple ? 15 : 0)) + "px";// - this.oDrag.startY
- };
-
- this.addEventListener("$skinchange", function(){
- this.$initDragDrop();
- });
-
- this.$initDragDrop = function(){
- if (!this.$hasLayoutNode("dragindicator"))
- return;
-
- this.oDrag = apf.insertHtmlNode(
- this.$getLayoutNode("dragindicator"), document.body);
-
- zManager.set("drag", this.oDrag);
-
- this.oDrag.style.position = "absolute";
- this.oDrag.style.cursor = "default";
- this.oDrag.style.display = "none";
- };
-
- this.$findValueNode = function(el){
- if (!el) return null;
-
- while(el && el.nodeType == 1
- && !el.getAttribute(apf.xmldb.htmlIdTag)) {
- if (this.$isTreeArch && el.previousSibling
- && el.previousSibling.nodeType == 1) //@todo hack!! apf3.0 fix this.
- el = el.previousSibling;
- else
- el = el.parentNode;
- }
-
- return (el && el.nodeType == 1 && el.getAttribute(apf.xmldb.htmlIdTag))
- ? el
- : null;
- };
-
-
- this.$dragout = function(el, dragdata, extra){
- if (this.lastel)
- this.$setStyleClass(this.lastel, "", ["dragDenied", "dragInsert",
- "dragAppend", "selected", "indicate"]);
-
- var sel = this.$getSelection(true);
- for (var i = 0, l = sel.length; i < l; i++)
- this.$setStyleClass(sel[i], "selected", ["dragDenied",
- "dragInsert", "dragAppend", "indicate"]);
-
- this.$setStyleClass(this.$ext, "", [this.$baseCSSname + "Drop"]);
-
- this.lastel = null;
- };
-
- if (!this.$dragdrop)
- this.$dragdrop = this.$dragout;
-
- this.$dragover = function(el, dragdata, extra){
- this.$setStyleClass(this.$ext, this.$baseCSSname + "Drop");
-
- var sel = this.$getSelection(true);
- for (var i = 0, l = sel.length; i < l; i++)
- this.$setStyleClass(sel[i], "", ["dragDenied",
- "dragInsert", "dragAppend", "selected", "indicate"]);
-
- if (this.lastel)
- this.$setStyleClass(this.lastel, "", ["dragDenied",
- "dragInsert", "dragAppend", "selected", "indicate"]);
-
- var action = extra[1] && extra[1].action;
- this.lastel = this.$findValueNode(el);
- if (this.$isTreeArch && action == "list-append") {
- var htmlNode = apf.xmldb.findHtmlNode(this.getTraverseParent(apf.xmldb.getNode(this.lastel)), this);
-
- this.lastel = htmlNode
- ? this.$getLayoutNode("item", "container", htmlNode)
- : this.$container;
-
- this.$setStyleClass(this.lastel, "dragInsert");
- }
- else {
- this.$setStyleClass(this.lastel, extra
- ? (action == "insert-before"
- ? "dragInsert"
- : "dragAppend")
- : "dragDenied");
- }
- };
- // #endif
-};
-
+module.declare(function(require, exports, module){
+
+module.exports = function() {
+ /**** Drag & Drop ****/
+ // #ifdef __WITH_DRAGDROP
+ this.diffX =
+ this.diffY = 0;
+ this.multiple = false;
+ this.lastDragNode = null;
+ this.lastel = null;
+
+ this.$showDragIndicator = function(sel, e){
+ this.multiple = sel.length > 1;
+
+ if (this.multiple) {
+ this.diffX = e.scrollX;
+ this.diffY = e.scrollY;
+ }
+ else {
+ this.diffX = -1 * e.offsetX;
+ this.diffY = -1 * e.offsetY;
+ }
+
+ var prefix = this.oDrag.className.split(" ")[0]
+ //@todo the class should be removed here
+ this.$setStyleClass(this.oDrag, (this.multiple
+ ? prefix + "_multiple" : "") + (this["class"] ? " " + this["class"] : ""), [prefix + "_multiple"]);
+
+ if (this.multiple) {
+ document.body.appendChild(this.oDrag);
+ return this.oDrag;
+ }
+ else if (this.localName == "datagrid") {
+ if (this.lastDragNode)
+ amlCore.destroyHtmlNode(this.lastDragNode);
+
+ sel = this.$selected || this.$caret;
+ var oDrag = sel.cloneNode(true);
+ oDrag.removeAttribute("onmousedown"); oDrag.onmousedown = null;
+ oDrag.removeAttribute("onmouseup"); oDrag.onmouseup = null;
+ oDrag.removeAttribute("onmouseout"); oDrag.onmouseout = null;
+ oDrag.removeAttribute("ondblclick"); oDrag.ondblclick = null;
+ document.body.appendChild(oDrag);
+
+ oDrag.style.position = "absolute";
+ oDrag.style.width = sel.offsetWidth + "px";
+ oDrag.style.display = "none";
+ oDrag.removeAttribute("id");
+
+ this.$setStyleClass(oDrag, "draggrid");
+ var nodes = sel.childNodes;
+ var dragnodes = oDrag.childNodes;
+ for (var i = nodes.length - 1; i >= 0; i--) {
+ if (dragnodes[i].nodeType == 1)
+ dragnodes[i].style.width = apf.getStyle(nodes[i], "width");
+ }
+ //@todo apf3.0 remove all the event handlers of the children.
+ return (this.lastDragNode = oDrag);
+ }
+ else {
+ var sel = this.$selected || this.$caret,
+ width = apf.getStyle(this.oDrag, "width");
+
+ if (!width || width == "auto")
+ this.oDrag.style.width = (sel.offsetWidth - apf.getWidthDiff(this.oDrag)) + "px";
+ this.$updateNode(this.selected, this.oDrag);
+ }
+
+ zManager.set("drag", this.oDrag);
+
+ return this.oDrag;
+ };
+
+ this.$hideDragIndicator = function(success){
+ var oDrag = this.lastDragNode || this.oDrag, _self = this;
+ if (!this.multiple && !success && oDrag.style.display == "block") {
+ if (!this.$selected && !this.$caret)
+ return;
+
+ var pos = apf.getAbsolutePosition(this.$selected || this.$caret);
+ apf.tween.multi(oDrag, {
+ anim : apf.tween.easeInOutCubic,
+ steps : apf.isIE ? 15 : 20,
+ interval : 15,
+ tweens : [
+ {type: "left", from: oDrag.offsetLeft, to: pos[0]},
+ {type: "top", from: oDrag.offsetTop, to: pos[1]}
+ ],
+ onfinish : function(){
+ if (_self.lastDragNode) {
+ amlCore.destroyHtmlNode(_self.lastDragNode);
+ _self.lastDragNode = null;
+ }
+ else {
+ _self.oDrag.style.display = "none";
+ }
+ }
+ });
+ }
+ else if (this.lastDragNode) {
+ amlCore.destroyHtmlNode(this.lastDragNode);
+ this.lastDragNode = null;
+ }
+ else {
+ this.oDrag.style.display = "none";
+ }
+ };
+
+ this.$moveDragIndicator = function(e){
+ var oDrag = this.lastDragNode || this.oDrag;
+ oDrag.style.left = (e.clientX + this.diffX) + "px";// - this.oDrag.startX
+ oDrag.style.top = (e.clientY + this.diffY + (this.multiple ? 15 : 0)) + "px";// - this.oDrag.startY
+ };
+
+ this.addEventListener("$skinchange", function(){
+ this.$initDragDrop();
+ });
+
+ this.$initDragDrop = function(){
+ if (!this.$hasLayoutNode("dragindicator"))
+ return;
+
+ this.oDrag = apf.insertHtmlNode(
+ this.$getLayoutNode("dragindicator"), document.body);
+
+ zManager.set("drag", this.oDrag);
+
+ this.oDrag.style.position = "absolute";
+ this.oDrag.style.cursor = "default";
+ this.oDrag.style.display = "none";
+ };
+
+ this.$findValueNode = function(el){
+ if (!el) return null;
+
+ while(el && el.nodeType == 1
+ && !el.getAttribute(apf.xmldb.htmlIdTag)) {
+ if (this.$isTreeArch && el.previousSibling
+ && el.previousSibling.nodeType == 1) //@todo hack!! apf3.0 fix this.
+ el = el.previousSibling;
+ else
+ el = el.parentNode;
+ }
+
+ return (el && el.nodeType == 1 && el.getAttribute(apf.xmldb.htmlIdTag))
+ ? el
+ : null;
+ };
+
+
+ this.$dragout = function(el, dragdata, extra){
+ if (this.lastel)
+ this.$setStyleClass(this.lastel, "", ["dragDenied", "dragInsert",
+ "dragAppend", "selected", "indicate"]);
+
+ var sel = this.$getSelection(true);
+ for (var i = 0, l = sel.length; i < l; i++)
+ this.$setStyleClass(sel[i], "selected", ["dragDenied",
+ "dragInsert", "dragAppend", "indicate"]);
+
+ this.$setStyleClass(this.$ext, "", [this.$baseCSSname + "Drop"]);
+
+ this.lastel = null;
+ };
+
+ if (!this.$dragdrop)
+ this.$dragdrop = this.$dragout;
+
+ this.$dragover = function(el, dragdata, extra){
+ this.$setStyleClass(this.$ext, this.$baseCSSname + "Drop");
+
+ var sel = this.$getSelection(true);
+ for (var i = 0, l = sel.length; i < l; i++)
+ this.$setStyleClass(sel[i], "", ["dragDenied",
+ "dragInsert", "dragAppend", "selected", "indicate"]);
+
+ if (this.lastel)
+ this.$setStyleClass(this.lastel, "", ["dragDenied",
+ "dragInsert", "dragAppend", "selected", "indicate"]);
+
+ var action = extra[1] && extra[1].action;
+ this.lastel = this.$findValueNode(el);
+ if (this.$isTreeArch && action == "list-append") {
+ var htmlNode = apf.xmldb.findHtmlNode(this.getTraverseParent(apf.xmldb.getNode(this.lastel)), this);
+
+ this.lastel = htmlNode
+ ? this.$getLayoutNode("item", "container", htmlNode)
+ : this.$container;
+
+ this.$setStyleClass(this.lastel, "dragInsert");
+ }
+ else {
+ this.$setStyleClass(this.lastel, extra
+ ? (action == "insert-before"
+ ? "dragInsert"
+ : "dragAppend")
+ : "dragDenied");
+ }
+ };
+ // #endif
+};
+
});
View
104 aml-core/lib/dragdrop/standard.js
@@ -1,53 +1,53 @@
-define([], function(){
-
-return function() {
- this.$showDragIndicator = function(sel, e){
- var x = e.offsetX + 22,
- y = e.offsetY;
-
- this.oDrag.startX = x;
- this.oDrag.startY = y;
-
-
- document.body.appendChild(this.oDrag);
- //this.oDrag.getElementsByTagName("DIV")[0].innerHTML = this.selected.innerHTML;
- //this.oDrag.getElementsByTagName("IMG")[0].src = this.selected.parentNode.parentNode.childNodes[1].firstChild.src;
- var oInt = this.$getLayoutNode("main", "caption", this.oDrag);
- if (oInt.nodeType != 1)
- oInt = oInt.parentNode;
-
- oInt.innerHTML = this.$applyBindRule("caption", this.xmlRoot) || "";
-
- return this.oDrag;
- };
-
- this.$hideDragIndicator = function(){
- this.oDrag.style.display = "none";
- };
-
- this.$moveDragIndicator = function(e){
- this.oDrag.style.left = (e.clientX - this.oDrag.startX
- + document.documentElement.scrollLeft) + "px";
- this.oDrag.style.top = (e.clientY - this.oDrag.startY
- + document.documentElement.scrollTop) + "px";
- };
-
- //@todo falsely assuming only attributes are used for non multiselect widgets
- this.$initDragDrop = function(){
- if (!this.getAttribute("drag"))
- return;
-
- this.oDrag = document.body.appendChild(this.$ext.cloneNode(true));
-
- zManager.set("drag", this.oDrag);
-
- this.oDrag.style.position = "absolute";
- this.oDrag.style.cursor = "default";
- this.oDrag.style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity=50)";
- this.oDrag.style.MozOpacity = 0.5;
- this.oDrag.style.opacity = 0.5;
- this.oDrag.style.display = "none";
- };
-};
-
+module.declare(function(require, exports, module){
+
+module.exports = function() {
+ this.$showDragIndicator = function(sel, e){
+ var x = e.offsetX + 22,
+ y = e.offsetY;
+
+ this.oDrag.startX = x;
+ this.oDrag.startY = y;
+
+
+ document.body.appendChild(this.oDrag);
+ //this.oDrag.getElementsByTagName("DIV")[0].innerHTML = this.selected.innerHTML;
+ //this.oDrag.getElementsByTagName("IMG")[0].src = this.selected.parentNode.parentNode.childNodes[1].firstChild.src;
+ var oInt = this.$getLayoutNode("main", "caption", this.oDrag);
+ if (oInt.nodeType != 1)
+ oInt = oInt.parentNode;
+
+ oInt.innerHTML = this.$applyBindRule("caption", this.xmlRoot) || "";
+
+ return this.oDrag;
+ };
+
+ this.$hideDragIndicator = function(){
+ this.oDrag.style.display = "none";
+ };
+
+ this.$moveDragIndicator = function(e){
+ this.oDrag.style.left = (e.clientX - this.oDrag.startX
+ + document.documentElement.scrollLeft) + "px";
+ this.oDrag.style.top = (e.clientY - this.oDrag.startY
+ + document.documentElement.scrollTop) + "px";
+ };
+
+ //@todo falsely assuming only attributes are used for non multiselect widgets
+ this.$initDragDrop = function(){
+ if (!this.getAttribute("drag"))
+ return;
+
+ this.oDrag = document.body.appendChild(this.$ext.cloneNode(true));
+
+ zManager.set("drag", this.oDrag);
+
+ this.oDrag.style.position = "absolute";
+ this.oDrag.style.cursor = "default";
+ this.oDrag.style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity=50)";
+ this.oDrag.style.MozOpacity = 0.5;
+ this.oDrag.style.opacity = 0.5;
+ this.oDrag.style.display = "none";
+ };
+};
+
});
View
101 aml-core/lib/env/gecko.js
@@ -1,52 +1,51 @@
-define(["aml-core", "ecmaext/string"],
- function(amlCore){
-
-var serializer = new XMLSerializer();
-var o = document.createElement("div");
-amlCore.insertHtmlNodes = function(nodeList, htmlNode, beforeNode) {
- var frag = document.createDocumentFragment(),
- i = nodeList.length - 1,
- l, node;
- for (; i >= 0; i--) {
- node = nodeList[i];
- frag.insertBefore(node, frag.firstChild);
- }
-
- o.innerHTML = serializer.serializeToString(frag).unescapeHTML()
- .replace(/<([^>]+)\/>/g, "<$1></$1>");
-
- frag = document.createDocumentFragment();
- for (i = 0, l = o.childNodes.length; i < l; i++) {
- node = o.childNodes[0];
- frag.appendChild(node);
- }
-
- if (beforeNode)
- htmlNode.insertBefore(frag, beforeNode);
- htmlNode.appendChild(frag);
-};
-
-amlCore.insertHtmlNode = function(xmlNode, htmlNode, beforeNode, s) {
- if (htmlNode.nodeType != 11 && !htmlNode.style)
- return htmlNode.appendChild(xmlNode);
-
- if (!s) {
- s = (xmlNode.serialize
- ? xmlNode.serialize(true)
- : ((xmlNode.nodeType == 3 || xmlNode.nodeType == 4 || xmlNode.nodeType == 2)
- ? xmlNode.nodeValue
- : serializer.serializeToString(xmlNode))).unescapeHTML();
- }
-
- o.innerHTML = s.replace(/<([^>]+)\/>/g, "<$1></$1>");
-
- if (beforeNode)
- htmlNode.insertBefore(o.firstChild, beforeNode);
- else
- htmlNode.appendChild(o.firstChild);
-
- return beforeNode ? beforeNode.previousSibling : htmlNode.lastChild;
-};
-
- }
+module.declare(function(require, exports, module){
+
+var serializer = new XMLSerializer();
+var o = document.createElement("div");
+amlCore.insertHtmlNodes = function(nodeList, htmlNode, beforeNode) {
+ var frag = document.createDocumentFragment(),
+ i = nodeList.length - 1,
+ l, node;
+ for (; i >= 0; i--) {
+ node = nodeList[i];
+ frag.insertBefore(node, frag.firstChild);
+ }
+
+ o.innerHTML = serializer.serializeToString(frag).unescapeHTML()
+ .replace(/<([^>]+)\/>/g, "<$1></$1>");
+
+ frag = document.createDocumentFragment();
+ for (i = 0, l = o.childNodes.length; i < l; i++) {
+ node = o.childNodes[0];
+ frag.appendChild(node);
+ }
+
+ if (beforeNode)
+ htmlNode.insertBefore(frag, beforeNode);
+ htmlNode.appendChild(frag);
+};
+
+amlCore.insertHtmlNode = function(xmlNode, htmlNode, beforeNode, s) {
+ if (htmlNode.nodeType != 11 && !htmlNode.style)
+ return htmlNode.appendChild(xmlNode);
+
+ if (!s) {
+ s = (xmlNode.serialize
+ ? xmlNode.serialize(true)
+ : ((xmlNode.nodeType == 3 || xmlNode.nodeType == 4 || xmlNode.nodeType == 2)
+ ? xmlNode.nodeValue
+ : serializer.serializeToString(xmlNode))).unescapeHTML();
+ }
+
+ o.innerHTML = s.replace(/<([^>]+)\/>/g, "<$1></$1>");
+
+ if (beforeNode)
+ htmlNode.insertBefore(o.firstChild, beforeNode);
+ else
+ htmlNode.appendChild(o.firstChild);
+
+ return beforeNode ? beforeNode.previousSibling : htmlNode.lastChild;
+};
+
+ }
);
View
166 aml-core/lib/env/ie.js
@@ -1,86 +1,82 @@
-define(["aml-core",
- "ecmaext/string",
- "envdetect",
- "optional!debug/console"],
- function(amlCore, env, console){
-
-//IE fix
-try {
- document.execCommand("BackgroundImageCache", false, true);
-}
-catch(e) {}
-
-amlCore.insertHtmlNodes = function(nodeList, htmlNode, beforeNode){
- for (var str = [], i = 0, l = nodeList.length; i < l; i++)
- str[i] = nodeList[i].xml;
-
- str = str.join("").unescapeHTML();
-
- if (env.isIE < 7)
- str = str.replace(/style="background-image:([^"]*)"/g,
- "find='$1' style='background-image:$1'");
-
- try {
- (beforeNode || htmlNode).insertAdjacentHTML(beforeNode
- ? "beforebegin"
- : "beforeend", str);
- }
- catch (e) {
- //IE table hack
- document.body.insertAdjacentHTML("beforeend", "<table><tr>"
- + str + "</tr></table>");
-
- var x = document.body.lastChild.firstChild.firstChild;
- for (i = x.childNodes.length - 1; i >= 0; i--)
- htmlNode.appendChild(x.childNodes[0]);
- }
-
- //Fix IE image loading bug
- if (env.isIE < 7) {
- $setTimeout(function(){
- var nodes = htmlNode.getElementsByTagName("*");
- for (var s, i = 0, l = nodes.length; i < l; i++) {
- if (s = nodes[i].getAttribute("find"))
- nodes[i].style.backgroundImage = s.trim(); //@todo apf3.0 why is this needed?
- }
- });
- }
-};
-
-amlCore.insertHtmlNode = function(xmlNode, htmlNode, beforeNode, str){
- if (htmlNode.nodeType != 11 && !htmlNode.style)
- return htmlNode.appendChild(xmlNode);
-
- var pNode = beforeNode || htmlNode;
-
- if (!str)
- str = (xmlNode.serialize
- ? xmlNode.serialize(true)
- : xmlNode.xml || xmlNode.outerHTML || xmlNode.nodeValue).unescapeHTML();
- try {
- pNode.insertAdjacentHTML(beforeNode
- ? "beforeBegin"
- : "beforeEnd", str);
- }
- catch(e) {
- //#ifdef __DEBUG
- console && console.warn("Warning found block element inside a "
- + pNode.tagName
- + " element. Rendering will give unexpected results");
- //#endif
-
- pNode.insertAdjacentHTML("afterEnd", str);
- return pNode.nextSibling;
- }
-
- if (beforeNode)
- return beforeNode.previousSibling;
- else
- return htmlNode.lastChild.nodeType == 1
- ? htmlNode.lastChild
- : htmlNode.lastChild.previousSibling;
-
-};
-
- }
+module.declare(function(require, exports, module){
+
+//IE fix
+try {
+ document.execCommand("BackgroundImageCache", false, true);
+}
+catch(e) {}
+
+amlCore.insertHtmlNodes = function(nodeList, htmlNode, beforeNode){
+ for (var str = [], i = 0, l = nodeList.length; i < l; i++)
+ str[i] = nodeList[i].xml;
+
+ str = str.join("").unescapeHTML();
+
+ if (env.isIE < 7)
+ str = str.replace(/style="background-image:([^"]*)"/g,
+ "find='$1' style='background-image:$1'");
+
+ try {
+ (beforeNode || htmlNode).insertAdjacentHTML(beforeNode
+ ? "beforebegin"
+ : "beforeend", str);
+ }
+ catch (e) {
+ //IE table hack
+ document.body.insertAdjacentHTML("beforeend", "<table><tr>"
+ + str + "</tr></table>");
+
+ var x = document.body.lastChild.firstChild.firstChild;
+ for (i = x.childNodes.length - 1; i >= 0; i--)
+ htmlNode.appendChild(x.childNodes[0]);
+ }
+
+ //Fix IE image loading bug
+ if (env.isIE < 7) {
+ $setTimeout(function(){
+ var nodes = htmlNode.getElementsByTagName("*");
+ for (var s, i = 0, l = nodes.length; i < l; i++) {
+ if (s = nodes[i].getAttribute("find"))
+ nodes[i].style.backgroundImage = s.trim(); //@todo apf3.0 why is this needed?
+ }
+ });
+ }
+};
+
+amlCore.insertHtmlNode = function(xmlNode, htmlNode, beforeNode, str){
+ if (htmlNode.nodeType != 11 && !htmlNode.style)
+ return htmlNode.appendChild(xmlNode);
+
+ var pNode = beforeNode || htmlNode;
+
+ if (!str)
+ str = (xmlNode.serialize
+ ? xmlNode.serialize(true)
+ : xmlNode.xml || xmlNode.outerHTML || xmlNode.nodeValue).unescapeHTML();
+ try {
+ pNode.insertAdjacentHTML(beforeNode
+ ? "beforeBegin"
+ : "beforeEnd", str);
+ }
+ catch(e) {
+ //#ifdef __DEBUG
+ console && console.warn("Warning found block element inside a "
+ + pNode.tagName
+ + " element. Rendering will give unexpected results");
+ //#endif
+
+ pNode.insertAdjacentHTML("afterEnd", str);
+ return pNode.nextSibling;
+ }
+
+ if (beforeNode)
+ return beforeNode.previousSibling;
+ else
+ return htmlNode.lastChild.nodeType == 1
+ ? htmlNode.lastChild
+ : htmlNode.lastChild.previousSibling;
+
+};
+
+ }
);
View
77 aml-core/lib/env/opera.js
@@ -1,40 +1,39 @@
-define(["aml-core", "ecmaext/string"],
- function(amlCore){
-
-var serializer = new XMLSerializer();
-amlCore.insertHtmlNodes = function(nodeList, htmlNode, beforeNode) {
- var node,
- frag = document.createDocumentFragment(),
- i = 0,
- l = nodeList.length
- for (; i < l; i++) {
- if (!(node = nodeList[i])) continue;
- frag.appendChild(node);
- }
- (beforeNode || htmlNode).insertAdjacentHTML(beforeNode
- ? "beforebegin"
- : "beforeend", serializer.serializeToString(frag)
- .unescapeHTML().replace(/<([^>]+)\/>/g, "<$1></$1>"));
-};
-
-amlCore.insertHtmlNode = function(xmlNode, htmlNode, beforeNode, s) {
- if (htmlNode.nodeType != 11 && !htmlNode.style)
- return htmlNode.appendChild(xmlNode);
-
- if (!s) {
- s = (xmlNode.serialize
- ? xmlNode.serialize(true)
- : ((xmlNode.nodeType == 3 || xmlNode.nodeType == 4 || xmlNode.nodeType == 2)
- ? xmlNode.nodeValue
- : serializer.serializeToString(xmlNode))).unescapeHTML();
- }
-
- (beforeNode || htmlNode).insertAdjacentHTML(beforeNode
- ? "beforebegin"
- : "beforeend", s.replace(/<([^>]+)\/>/g, "<$1></$1>"));
-
- return beforeNode ? beforeNode.previousSibling : htmlNode.lastChild;
-};
-
- }
+module.declare(function(require, exports, module){
+
+var serializer = new XMLSerializer();
+amlCore.insertHtmlNodes = function(nodeList, htmlNode, beforeNode) {
+ var node,
+ frag = document.createDocumentFragment(),
+ i = 0,
+ l = nodeList.length
+ for (; i < l; i++) {
+ if (!(node = nodeList[i])) continue;
+ frag.appendChild(node);
+ }
+ (beforeNode || htmlNode).insertAdjacentHTML(beforeNode
+ ? "beforebegin"
+ : "beforeend", serializer.serializeToString(frag)
+ .unescapeHTML().replace(/<([^>]+)\/>/g, "<$1></$1>"));
+};
+
+amlCore.insertHtmlNode = function(xmlNode, htmlNode, beforeNode, s) {
+ if (htmlNode.nodeType != 11 && !htmlNode.style)
+ return htmlNode.appendChild(xmlNode);
+
+ if (!s) {
+ s = (xmlNode.serialize
+ ? xmlNode.serialize(true)
+ : ((xmlNode.nodeType == 3 || xmlNode.nodeType == 4 || xmlNode.nodeType == 2)
+ ? xmlNode.nodeValue
+ : serializer.serializeToString(xmlNode))).unescapeHTML();
+ }
+
+ (beforeNode || htmlNode).insertAdjacentHTML(beforeNode
+ ? "beforebegin"
+ : "beforeend", s.replace(/<([^>]+)\/>/g, "<$1></$1>"));
+
+ return beforeNode ? beforeNode.previousSibling : htmlNode.lastChild;
+};
+
+ }
);
View
169 aml-core/lib/env/w3c.js
@@ -1,86 +1,85 @@
-define(["envdetect"],
- function(env){
-
-if (document.body)
- document.body.focus = function(){};
-
-DocumentFragment.prototype.getElementById = function(id){
- return this.childNodes.length ? this.childNodes[0].ownerDocument.getElementById(id) : null;
-};
-
-if (typeof HTMLElement!="undefined") {
- if (!HTMLElement.prototype.insertAdjacentElement) {
- Text.prototype.insertAdjacentElement =
- HTMLElement.prototype.insertAdjacentElement = function(where,parsedNode){
- switch (where.toLowerCase()) {
- case "beforebegin":
- this.parentNode.insertBefore(parsedNode,this);
- break;
- case "afterbegin":
- this.insertBefore(parsedNode,this.firstChild);
- break;
- case "beforeend":
- this.appendChild(parsedNode);
- break;
- case "afterend":
- if (this.nextSibling)
- this.parentNode.insertBefore(parsedNode,this.nextSibling);
- else
- this.parentNode.appendChild(parsedNode);
- break;
- }
- };
- }
-
- if (!HTMLElement.prototype.insertAdjacentHTML) {
- Text.prototype.insertAdjacentHTML =
- HTMLElement.prototype.insertAdjacentHTML = function(where,htmlStr){
- var r = this.ownerDocument.createRange();
- r.setStartBefore(env.isWebkit
- ? document.body
- : (self.document ? document.body : this));
- var parsedHTML = r.createContextualFragment(htmlStr);
- this.insertAdjacentElement(where, parsedHTML);
- };
- }
-
- if (!HTMLBodyElement.prototype.insertAdjacentHTML) //apf.isWebkit)
- HTMLBodyElement.prototype.insertAdjacentHTML = HTMLElement.prototype.insertAdjacentHTML;
-
- if (!HTMLElement.prototype.insertAdjacentText) {
- Text.prototype.insertAdjacentText =
- HTMLElement.prototype.insertAdjacentText = function(where,txtStr){
- var parsedText = document.createTextNode(txtStr);
- this.insertAdjacentElement(where,parsedText);
- };
- }
-
- //HTMLElement.removeNode
- HTMLElement.prototype.removeNode = function(){
- if (!this.parentNode) return;
-
- this.parentNode.removeChild(this);
- };
-
- //Currently only supported by Gecko
- if (HTMLElement.prototype.__defineSetter__) {
- //HTMLElement.innerText
- HTMLElement.prototype.__defineSetter__("innerText", function(sText){
- var s = "" + sText;
- this.innerHTML = s.replace(/\&/g, "&amp;")
- .replace(/</g, "&lt;").replace(/>/g, "&gt;");
- });
-
- HTMLElement.prototype.__defineGetter__("innerText", function(){
- return this.innerHTML.replace(/<[^>]+>/g,"")
- .replace(/\s\s+/g, " ").replace(/^\s+|\s+$/g, " ");
- });
-
- HTMLElement.prototype.__defineGetter__("outerHTML", function(){
- return (new XMLSerializer()).serializeToString(this);
- });
- }
-}
-
- }
+module.declare(function(require, exports, module){
+
+if (document.body)
+ document.body.focus = function(){};
+
+DocumentFragment.prototype.getElementById = function(id){
+ return this.childNodes.length ? this.childNodes[0].ownerDocument.getElementById(id) : null;
+};
+
+if (typeof HTMLElement!="undefined") {
+ if (!HTMLElement.prototype.insertAdjacentElement) {
+ Text.prototype.insertAdjacentElement =
+ HTMLElement.prototype.insertAdjacentElement = function(where,parsedNode){
+ switch (where.toLowerCase()) {
+ case "beforebegin":
+ this.parentNode.insertBefore(parsedNode,this);
+ break;
+ case "afterbegin":
+ this.insertBefore(parsedNode,this.firstChild);
+ break;
+ case "beforeend":
+ this.appendChild(parsedNode);
+ break;
+ case "afterend":
+ if (this.nextSibling)
+ this.parentNode.insertBefore(parsedNode,this.nextSibling);
+ else
+ this.parentNode.appendChild(parsedNode);
+ break;
+ }
+ };
+ }
+
+ if (!HTMLElement.prototype.insertAdjacentHTML) {
+ Text.prototype.insertAdjacentHTML =
+ HTMLElement.prototype.insertAdjacentHTML = function(where,htmlStr){
+ var r = this.ownerDocument.createRange();
+ r.setStartBefore(env.isWebkit
+ ? document.body
+ : (self.document ? document.body : this));
+ var parsedHTML = r.createContextualFragment(htmlStr);
+ this.insertAdjacentElement(where, parsedHTML);
+ };
+ }
+
+ if (!HTMLBodyElement.prototype.insertAdjacentHTML) //apf.isWebkit)
+ HTMLBodyElement.prototype.insertAdjacentHTML = HTMLElement.prototype.insertAdjacentHTML;
+
+ if (!HTMLElement.prototype.insertAdjacentText) {
+ Text.prototype.insertAdjacentText =
+ HTMLElement.prototype.insertAdjacentText = function(where,txtStr){
+ var parsedText = document.createTextNode(txtStr);
+ this.insertAdjacentElement(where,parsedText);
+ };
+ }
+
+ //HTMLElement.removeNode
+ HTMLElement.prototype.removeNode = function(){
+ if (!this.parentNode) return;
+
+ this.parentNode.removeChild(this);
+ };
+
+ //Currently only supported by Gecko
+ if (HTMLElement.prototype.__defineSetter__) {
+ //HTMLElement.innerText
+ HTMLElement.prototype.__defineSetter__("innerText", function(sText){
+ var s = "" + sText;
+ this.innerHTML = s.replace(/\&/g, "&amp;")
+ .replace(/</g, "&lt;").replace(/>/g, "&gt;");
+ });
+
+ HTMLElement.prototype.__defineGetter__("innerText", function(){
+ return this.innerHTML.replace(/<[^>]+>/g,"")
+ .replace(/\s\s+/g, " ").replace(/^\s+|\s+$/g, " ");
+ });
+
+ HTMLElement.prototype.__defineGetter__("outerHTML", function(){
+ return (new XMLSerializer()).serializeToString(this);
+ });
+ }
+}
+
+ }
);
View
77 aml-core/lib/env/webkit.js
@@ -1,40 +1,39 @@
-define(["aml-core", "ecmaext/string"],
- function(amlCore){
-
-var serializer = new XMLSerializer();
-amlCore.insertHtmlNodes = function(nodeList, htmlNode, beforeNode) {
- var node,
- frag = document.createDocumentFragment(),
- a = [], i = 0, l = nodeList.length;
- for (; i < l; i++) {
- if (!(node = nodeList[i])) continue;
- frag.appendChild(node);
- }
-
- (beforeNode || htmlNode).insertAdjacentHTML(beforeNode
- ? "beforebegin"
- : "beforeend", serializer.serializeToString(frag).unescapeHTML()
- .replace(/<([^>]+)\/>/g, "<$1></$1>"));
-};
-
-amlCore.insertHtmlNode = function(xmlNode, htmlNode, beforeNode, s) {
- if (htmlNode.nodeType != 11 && !htmlNode.style)
- return htmlNode.appendChild(xmlNode);
-
- if (!s) {
- s = (xmlNode.serialize
- ? xmlNode.serialize(true)
- : ((xmlNode.nodeType == 3 || xmlNode.nodeType == 4 || xmlNode.nodeType == 2)
- ? xmlNode.nodeValue
- : serializer.serializeToString(xmlNode))).unescapeHTML()
- }
-
- (beforeNode || htmlNode).insertAdjacentHTML(beforeNode
- ? "beforebegin"
- : "beforeend", s.replace(/<([^>]+)\/>/g, "<$1></$1>"));
-
- return beforeNode ? beforeNode.previousSibling : htmlNode.lastChild;
-};
-
- }
+module.declare(function(require, exports, module){
+
+var serializer = new XMLSerializer();
+amlCore.insertHtmlNodes = function(nodeList, htmlNode, beforeNode) {
+ var node,
+ frag = document.createDocumentFragment(),
+ a = [], i = 0, l = nodeList.length;
+ for (; i < l; i++) {
+ if (!(node = nodeList[i])) continue;
+ frag.appendChild(node);
+ }
+
+ (beforeNode || htmlNode).insertAdjacentHTML(beforeNode
+ ? "beforebegin"
+ : "beforeend", serializer.serializeToString(frag).unescapeHTML()
+ .replace(/<([^>]+)\/>/g, "<$1></$1>"));
+};
+
+amlCore.insertHtmlNode = function(xmlNode, htmlNode, beforeNode, s) {
+ if (htmlNode.nodeType != 11 && !htmlNode.style)
+ return htmlNode.appendChild(xmlNode);
+
+ if (!s) {
+ s = (xmlNode.serialize
+ ? xmlNode.serialize(true)
+ : ((xmlNode.nodeType == 3 || xmlNode.nodeType == 4 || xmlNode.nodeType == 2)
+ ? xmlNode.nodeValue
+ : serializer.serializeToString(xmlNode))).unescapeHTML()
+ }
+
+ (beforeNode || htmlNode).insertAdjacentHTML(beforeNode
+ ? "beforebegin"
+ : "beforeend", s.replace(/<([^>]+)\/>/g, "<$1></$1>"));
+
+ return beforeNode ? beforeNode.previousSibling : htmlNode.lastChild;
+};
+
+ }
);
View
3 aml-core/lib/focus/flash.js
@@ -1,5 +1,4 @@
-define(["aml-core/focus/window"],
- function(FocusClientWindow){
+module.declare(function(require, exports, module){
/**
* Flashes the task bar. This can be useful to signal the user that an
View
9 aml-core/lib/focus/focussable.js
@@ -21,12 +21,7 @@
apf.__FOCUSSABLE__ = 1 << 26;
-define([
- "aml-core/focus/manager",
- "aml-core/presentation",
- "aml-core/guielement",
- "lib-oop"],
- function(focusManager, Presentation, GuiElement, oop){
+module.declare(function(require, exports, module){
var Focussable = function(){
this.$regbase = this.$regbase | apf.__FOCUSSABLE__;
@@ -160,6 +155,6 @@ GuiElement.propHandlers.focussable = function(value){
}
};
-return Focussable;
+module.exports = Focussable;
});
View
5 aml-core/lib/focus/manager.js
@@ -1,5 +1,4 @@
-define(["aml-core", "lib-oop", "lib-oop/class"],
- function(amlCore, oop, Class){
+module.declare(function(require, exports, module){
var FocusManager = function(document){
Class.call(this);
@@ -475,6 +474,6 @@ var FocusManager = function(document){
oop.inherits(FocusManager, Class);
-return new FocusManager();
+module.exports = new FocusManager();
});
View
5 aml-core/lib/focus/window.js
@@ -1,5 +1,4 @@
-define(["envdetect", "aml-core/focus/manager"],
- function(env, FocusManager){
+module.declare(function(require, exports, module){
var iframeFixTimer, lastFocusParent, lastFocusElement;
var timer, state = "", last = "";
@@ -151,6 +150,6 @@ amlCore.addListener(window, "blur", FocusClientWindow.$blurevent = function(){
}
});
-return FocusClientWindow;
+module.exports = FocusClientWindow;
});
View
11 aml-core/lib/guielement.js
@@ -21,14 +21,7 @@
require("aml-core").__GUIELEMENT__ = 1 << 15;
-define([
- "aml-core",
- "w3cdom/element",
- "optional!aml-core/anchoring",
- "optional!contenteditable",
- "optional!liveedit",
- "lib-oop"],
- function(core, DOMElement, Anchoring, ContentEditable, LiveEdit, oop){
+module.declare(function(require, exports, module){
/**
* All elements inheriting from this {@link term.baseclass baseclass} are an aml component.
@@ -507,7 +500,7 @@ GuiElement.propHandlers = {
}
};
-return GuiElement;
+module.exports = GuiElement;
}
);
View
2 aml-core/lib/iframe.js
@@ -1,4 +1,4 @@
-define([], function(){
+module.declare(function(require, exports, module){
// #ifdef __WITH_CONVERTIFRAME
/**
* @private
View
4 aml-core/lib/inputevents/iphone.js
@@ -19,7 +19,7 @@
*
*/
-define([], function(){
+module.declare(function(require, exports, module){
/**
* @private
*/
@@ -348,6 +348,6 @@ var RunIphone = function() {
};
-return RunIphone;
+module.exports = RunIphone;
});
View
434 aml-core/lib/inputevents/keyboard.js
@@ -1,220 +1,216 @@
-define([
- "aml-core",
- "aml-core/focus/manager",
- "envdetect"],
- function(amlCore, focusManager, env){
-
-// Keyboard forwarding to focussed object
-amlCore.addListener(document, "keyup", function(e){ //this.$keyup =
- if (!e) e = event;
-
- //#ifdef __WITH_KEYBOARD
- var ev = {
- keyCode : e.keyCode,
- ctrlKey : e.ctrlKey,
- shiftKey : e.shiftKey,
- altKey : e.altkey,
- htmlEvent: e,
- bubbles : true //@todo is this much slower?
- };
-
- var aEl = focusManager.activeElement;
- if ((aEl && !aEl.disableKeyboard
- ? aEl.dispatchEvent("keyup", ev)
- : apf.dispatchEvent("keyup", ev)) === false) {
- amlCore.preventDefault(e);
- return false;
- }
- //#endif
-});
-
-
-//var browserNavKeys = {32:1,33:1,34:1,35:1,36:1,37:1,38:1,39:1,40:1}
-
-amlCore.addListener(document, "keyup", function(e){
- e = e || event;
-
- if (e.ctrlKey && e.keyCode == 9 && focusManager.activeElement) {
- var w = focusManager.activeElement.$focusParent;
- if (w.modal) {
- if (e.preventDefault)
- e.preventDefault();
- return false;
- }
-
- FocusManager.moveNext(e.shiftKey,
- focusManager.activeElement.$focusParent, true);
-
- w = focusManager.activeElement.$focusParent;
- if (w && w.bringToFront)
- w.bringToFront();
-
- if (e.preventDefault)
- e.preventDefault();
- return false;
- }
-});
-
-//@todo optimize this function
-amlCore.addListener(document, "keydown", function(e){ //this.$keydown =
- e = e || event;
-
- //#ifdef __WITH_DEBUG_WIN
- if (e.keyCode == 120 || e.ctrlKey && e.altKey && e.keyCode == 68) {
- apf.$debugwin.activate();
- }
- //#endif
-
- //#ifdef __AMLCONTEXTMENU
- if (e.keyCode == 93)
- apf.contextMenuKeyboard = true;
- // #endif
-
- var amlNode = focusManager.activeElement, //apf.findHost(e.srcElement || e.target),
- htmlNode = (e.explicitOriginalTarget || e.srcElement || e.target),
- isTextInput = (ta[htmlNode.tagName]
- || htmlNode.contentEditable || htmlNode.contentEditable == "true") //@todo apf3.0 need to loop here?
- && !htmlNode.disabled
- || amlNode && amlNode.$isTextInput
- && amlNode.$isTextInput(e) && amlNode.disabled < 1;
-
- //#ifdef __WITH_ACTIONTRACKER && __WITH_UNDO_KEYS
- //@todo move this to appsettings and use with_hotkey
- var o,
- ctrlKey = env.isMac ? e.metaKey : e.ctrlKey;
- if (!isTextInput && apf.config.undokeys && ctrlKey) {
- //Ctrl-Z - Undo
- if (e.keyCode == 90) {
- o = focusManager.activeElement;
- while (o && !o.getActionTracker && !o.$at)
- o = o.parentNode;
- if (!o) o = apf.window;
- (o.$at || o.getActionTracker()).undo();
- }
- //Ctrl-Y - Redo
- else if (e.keyCode == 89) {
- o